@okxweb3/a2a-openclaw 0.0.15 → 0.0.16-beta-d0ec14bc63-260623103149

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,49 +1,58 @@
1
1
  var __importMetaUrl=require('url').pathToFileURL(__filename).href;
2
- "use strict";var xh=Object.create;var Lr=Object.defineProperty;var Ph=Object.getOwnPropertyDescriptor;var Mh=Object.getOwnPropertyNames;var Uh=Object.getPrototypeOf,Lh=Object.prototype.hasOwnProperty;var Te=(t,e)=>()=>(t&&(e=t(t=0)),e);var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),fd=(t,e)=>{for(var n in e)Lr(t,n,{get:e[n],enumerable:!0})},gd=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Mh(e))!Lh.call(t,s)&&s!==n&&Lr(t,s,{get:()=>e[s],enumerable:!(r=Ph(e,s))||r.enumerable});return t};var qh=(t,e,n)=>(n=t!=null?xh(Uh(t)):{},gd(e||!t||!t.__esModule?Lr(n,"default",{value:t,enumerable:!0}):n,t)),Fh=t=>gd(Lr({},"__esModule",{value:!0}),t);function Gh(t=new Date){return t.toLocaleString(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,hour12:!1})}function Hi(t){return[`[${Gh()}]`,...t]}function y(...t){console.log(...Hi(t))}function _d(...t){console.warn(...Hi(t))}function hd(...t){console.error(...Hi(t))}var ee=Te(()=>{"use strict"});function md(t){Yi=t}function Je(){if(!Yi)throw new Error("[xmtp] PluginRuntime not initialized \u2014 ensure setXmtpRuntime is called in register()");return Yi}var Yi,vn=Te(()=>{"use strict";Yi=null});var oe=g($=>{Object.defineProperty($,"__esModule",{value:!0});var Ed=Object.prototype.toString;function Bh(t){switch(Ed.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return qr(t,Error)}}function Bt(t,e){return Ed.call(t)===`[object ${e}]`}function $h(t){return Bt(t,"ErrorEvent")}function jh(t){return Bt(t,"DOMError")}function Hh(t){return Bt(t,"DOMException")}function Yh(t){return Bt(t,"String")}function Kh(t){return t===null||typeof t!="object"&&typeof t!="function"}function yd(t){return Bt(t,"Object")}function Wh(t){return typeof Event<"u"&&qr(t,Event)}function Vh(t){return typeof Element<"u"&&qr(t,Element)}function zh(t){return Bt(t,"RegExp")}function Xh(t){return!!(t&&t.then&&typeof t.then=="function")}function Jh(t){return yd(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Qh(t){return typeof t=="number"&&t!==t}function qr(t,e){try{return t instanceof e}catch{return!1}}function Zh(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}$.isDOMError=jh;$.isDOMException=Hh;$.isElement=Vh;$.isError=Bh;$.isErrorEvent=$h;$.isEvent=Wh;$.isInstanceOf=qr;$.isNaN=Qh;$.isPlainObject=yd;$.isPrimitive=Kh;$.isRegExp=zh;$.isString=Yh;$.isSyntheticEvent=Jh;$.isThenable=Xh;$.isVueViewModel=Zh});var Rn=g(ft=>{Object.defineProperty(ft,"__esModule",{value:!0});var Fr=oe();function em(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function tm(t,e){let n=t,r=n.length;if(r<=150)return n;e>r&&(e=r);let s=Math.max(e-60,0);s<5&&(s=0);let i=Math.min(s+140,r);return i>r-5&&(i=r),i===r&&(s=Math.max(i-140,0)),n=n.slice(s,i),s>0&&(n=`'{snip} ${n}`),i<r&&(n+=" {snip}"),n}function nm(t,e){if(!Array.isArray(t))return"";let n=[];for(let r=0;r<t.length;r++){let s=t[r];try{Fr.isVueViewModel(s)?n.push("[VueViewModel]"):n.push(String(s))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function Sd(t,e,n=!1){return Fr.isString(t)?Fr.isRegExp(e)?e.test(t):Fr.isString(e)?n?t===e:t.includes(e):!1:!1}function rm(t,e=[],n=!1){return e.some(r=>Sd(t,r,n))}ft.isMatchingPattern=Sd;ft.safeJoin=nm;ft.snipLine=tm;ft.stringMatchesSomePattern=rm;ft.truncate=em});var Id=g(Vi=>{Object.defineProperty(Vi,"__esModule",{value:!0});var Ki=oe(),sm=Rn();function im(t,e,n=250,r,s,i,o){if(!i.exception||!i.exception.values||!o||!Ki.isInstanceOf(o.originalException,Error))return;let a=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;a&&(i.exception.values=om(Wi(t,e,s,o.originalException,r,i.exception.values,a,0),n))}function Wi(t,e,n,r,s,i,o,a){if(i.length>=n+1)return i;let c=[...i];if(Ki.isInstanceOf(r[s],Error)){Td(o,a);let u=t(e,r[s]),d=c.length;bd(u,s,d,a),c=Wi(t,e,n,r[s],s,[u,...c],u,d)}return Array.isArray(r.errors)&&r.errors.forEach((u,d)=>{if(Ki.isInstanceOf(u,Error)){Td(o,a);let l=t(e,u),p=c.length;bd(l,`errors[${d}]`,p,a),c=Wi(t,e,n,u,s,[l,...c],l,p)}}),c}function Td(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,is_exception_group:!0,exception_id:e}}function bd(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function om(t,e){return t.map(n=>(n.value&&(n.value=sm.truncate(n.value,e)),n))}Vi.applyAggregateErrorsToEvent=im});var Ue=g(Cn=>{Object.defineProperty(Cn,"__esModule",{value:!0});function Gr(t){return t&&t.Math==Math?t:void 0}var zi=typeof globalThis=="object"&&Gr(globalThis)||typeof window=="object"&&Gr(window)||typeof self=="object"&&Gr(self)||typeof global=="object"&&Gr(global)||(function(){return this})()||{};function am(){return zi}function cm(t,e,n){let r=n||zi,s=r.__SENTRY__=r.__SENTRY__||{};return s[t]||(s[t]=e())}Cn.GLOBAL_OBJ=zi;Cn.getGlobalObject=am;Cn.getGlobalSingleton=cm});var Xi=g(On=>{Object.defineProperty(On,"__esModule",{value:!0});var um=oe(),dm=Ue(),Br=dm.getGlobalObject(),lm=80;function pm(t,e={}){try{let n=t,r=5,s=[],i=0,o=0,a=" > ",c=a.length,u,d=Array.isArray(e)?e:e.keyAttrs,l=!Array.isArray(e)&&e.maxStringLength||lm;for(;n&&i++<r&&(u=fm(n,d),!(u==="html"||i>1&&o+s.length*c+u.length>=l));)s.push(u),o+=u.length,n=n.parentNode;return s.reverse().join(a)}catch{return"<unknown>"}}function fm(t,e){let n=t,r=[],s,i,o,a,c;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());let u=e&&e.length?e.filter(l=>n.getAttribute(l)).map(l=>[l,n.getAttribute(l)]):null;if(u&&u.length)u.forEach(l=>{r.push(`[${l[0]}="${l[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),s=n.className,s&&um.isString(s))for(i=s.split(/\s+/),c=0;c<i.length;c++)r.push(`.${i[c]}`);let d=["aria-label","type","name","title","alt"];for(c=0;c<d.length;c++)o=d[c],a=n.getAttribute(o),a&&r.push(`[${o}="${a}"]`);return r.join("")}function gm(){try{return Br.document.location.href}catch{return""}}function _m(t){return Br.document&&Br.document.querySelector?Br.document.querySelector(t):null}On.getDomElement=_m;On.getLocationHref=gm;On.htmlTreeAsString=pm});var gt=g($t=>{Object.defineProperty($t,"__esModule",{value:!0});var Ji=Ue(),hm="Sentry Logger ",Qi=["debug","info","warn","error","log","assert","trace"],Zi={};function Ad(t){if(!("console"in Ji.GLOBAL_OBJ))return t();let e=Ji.GLOBAL_OBJ.console,n={},r=Object.keys(Zi);r.forEach(s=>{let i=Zi[s];n[s]=e[s],e[s]=i});try{return t()}finally{r.forEach(s=>{e[s]=n[s]})}}function mm(){let t=!1,e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?Qi.forEach(n=>{e[n]=(...r)=>{t&&Ad(()=>{Ji.GLOBAL_OBJ.console[n](`${hm}[${n}]:`,...r)})}}):Qi.forEach(n=>{e[n]=()=>{}}),e}var Em=mm();$t.CONSOLE_LEVELS=Qi;$t.consoleSandbox=Ad;$t.logger=Em;$t.originalConsoleMethods=Zi});var eo=g(Dn=>{Object.defineProperty(Dn,"__esModule",{value:!0});var $r=gt(),ym=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Sm(t){return t==="http"||t==="https"}function Tm(t,e=!1){let{host:n,path:r,pass:s,port:i,projectId:o,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${o}`}function vd(t){let e=ym.exec(t);if(!e){console.error(`Invalid Sentry Dsn: ${t}`);return}let[n,r,s="",i,o="",a]=e.slice(1),c="",u=a,d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){let l=u.match(/^\d+/);l&&(u=l[0])}return Rd({host:i,pass:s,path:c,projectId:u,port:o,protocol:n,publicKey:r})}function Rd(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function bm(t){if(!(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__))return!0;let{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(o=>t[o]?!1:($r.logger.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?Sm(r)?e&&isNaN(parseInt(e,10))?($r.logger.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:($r.logger.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):($r.logger.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Im(t){let e=typeof t=="string"?vd(t):Rd(t);if(!(!e||!bm(e)))return e}Dn.dsnFromString=vd;Dn.dsnToString=Tm;Dn.makeDsn=Im});var ro=g(no=>{Object.defineProperty(no,"__esModule",{value:!0});var to=class extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}};no.SentryError=to});var Qe=g(ge=>{Object.defineProperty(ge,"__esModule",{value:!0});var Am=Xi(),jt=oe(),vm=gt(),Cd=Rn();function Rm(t,e,n){if(!(e in t))return;let r=t[e],s=n(r);typeof s=="function"&&wd(s,r),t[e]=s}function Nd(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&vm.logger.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function wd(t,e){try{let n=e.prototype||{};t.prototype=e.prototype=n,Nd(t,"__sentry_original__",e)}catch{}}function Cm(t){return t.__sentry_original__}function Om(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function kd(t){if(jt.isError(t))return{message:t.message,name:t.name,stack:t.stack,...Dd(t)};if(jt.isEvent(t)){let e={type:t.type,target:Od(t.target),currentTarget:Od(t.currentTarget),...Dd(t)};return typeof CustomEvent<"u"&&jt.isInstanceOf(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function Od(t){try{return jt.isElement(t)?Am.htmlTreeAsString(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function Dd(t){if(typeof t=="object"&&t!==null){let e={};for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function Dm(t,e=40){let n=Object.keys(kd(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return Cd.truncate(n[0],e);for(let r=n.length;r>0;r--){let s=n.slice(0,r).join(", ");if(!(s.length>e))return r===n.length?s:Cd.truncate(s,e)}return""}function Nm(t){return so(t,new Map)}function so(t,e){if(jt.isPlainObject(t)){let n=e.get(t);if(n!==void 0)return n;let r={};e.set(t,r);for(let s of Object.keys(t))typeof t[s]<"u"&&(r[s]=so(t[s],e));return r}if(Array.isArray(t)){let n=e.get(t);if(n!==void 0)return n;let r=[];return e.set(t,r),t.forEach(s=>{r.push(so(s,e))}),r}return t}function wm(t){let e;switch(!0){case t==null:e=new String(t);break;case(typeof t=="symbol"||typeof t=="bigint"):e=Object(t);break;case jt.isPrimitive(t):e=new t.constructor(t);break;default:e=t;break}return e}ge.addNonEnumerableProperty=Nd;ge.convertToPlainObject=kd;ge.dropUndefinedKeys=Nm;ge.extractExceptionKeysForMessage=Dm;ge.fill=Rm;ge.getOriginalFunction=Cm;ge.markFunctionWrapped=wd;ge.objectify=wm;ge.urlEncode=Om});var Hr=g(jr=>{Object.defineProperty(jr,"__esModule",{value:!0});function xd(t,e=!1){return!(e||t&&!t.startsWith("/")&&!t.includes(":\\")&&!t.startsWith(".")&&!t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&t!==void 0&&!t.includes("node_modules/")}function km(t){let e=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return r=>{let s=r.match(n);if(s){let i,o,a,c,u;if(s[1]){a=s[1];let p=a.lastIndexOf(".");if(a[p-1]==="."&&p--,p>0){i=a.slice(0,p),o=a.slice(p+1);let f=i.indexOf(".Module");f>0&&(a=a.slice(f+1),i=i.slice(0,f))}c=void 0}o&&(c=i,u=o),o==="<anonymous>"&&(u=void 0,a=void 0),a===void 0&&(u=u||"<anonymous>",a=c?`${c}.${u}`:u);let d=s[2]&&s[2].startsWith("file://")?s[2].slice(7):s[2],l=s[5]==="native";return!d&&s[5]&&!l&&(d=s[5]),{filename:d,module:t?t(d):void 0,function:a,lineno:parseInt(s[3],10)||void 0,colno:parseInt(s[4],10)||void 0,in_app:xd(d,l)}}if(r.match(e))return{filename:r}}}jr.filenameIsInApp=xd;jr.node=km});var Nn=g(Ze=>{Object.defineProperty(Ze,"__esModule",{value:!0});var Ud=Hr(),Ld=50,Pd=/\(error: (.*)\)/,Md=/captureMessage|captureException/;function qd(...t){let e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0)=>{let s=[],i=n.split(`
3
- `);for(let o=r;o<i.length;o++){let a=i[o];if(a.length>1024)continue;let c=Pd.test(a)?a.replace(Pd,"$1"):a;if(!c.match(/\S*Error: /)){for(let u of e){let d=u(c);if(d){s.push(d);break}}if(s.length>=Ld)break}}return Fd(s)}}function xm(t){return Array.isArray(t)?qd(...t):t}function Fd(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(e[e.length-1].function||"")&&e.pop(),e.reverse(),Md.test(e[e.length-1].function||"")&&(e.pop(),Md.test(e[e.length-1].function||"")&&e.pop()),e.slice(0,Ld).map(n=>({...n,filename:n.filename||e[e.length-1].filename,function:n.function||"?"}))}var io="<anonymous>";function Pm(t){try{return!t||typeof t!="function"?io:t.name||io}catch{return io}}function Mm(t){return[90,Ud.node(t)]}Ze.filenameIsInApp=Ud.filenameIsInApp;Ze.createStackParser=qd;Ze.getFunctionName=Pm;Ze.nodeStackLineParser=Mm;Ze.stackParserFromStackParserOptions=xm;Ze.stripSentryFramesAndReverse=Fd});var co=g(be=>{Object.defineProperty(be,"__esModule",{value:!0});var Um=gt(),Lm=Ue(),Yr=Lm.getGlobalObject();function qm(){try{return new ErrorEvent(""),!0}catch{return!1}}function Fm(){try{return new DOMError(""),!0}catch{return!1}}function Gm(){try{return new DOMException(""),!0}catch{return!1}}function ao(){if(!("fetch"in Yr))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function oo(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Bm(){if(!ao())return!1;if(oo(Yr.fetch))return!0;let t=!1,e=Yr.document;if(e&&typeof e.createElement=="function")try{let n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=oo(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Um.logger.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function $m(){return"ReportingObserver"in Yr}function jm(){if(!ao())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch{return!1}}be.isNativeFetch=oo;be.supportsDOMError=Fm;be.supportsDOMException=Gm;be.supportsErrorEvent=qm;be.supportsFetch=ao;be.supportsNativeFetch=Bm;be.supportsReferrerPolicy=jm;be.supportsReportingObserver=$m});var lo=g(uo=>{Object.defineProperty(uo,"__esModule",{value:!0});var Hm=Ue(),Kr=Hm.getGlobalObject();function Ym(){let t=Kr.chrome,e=t&&t.app&&t.app.runtime,n="history"in Kr&&!!Kr.history.pushState&&!!Kr.history.replaceState;return!e&&n}uo.supportsHistory=Ym});var Vd=g(et=>{Object.defineProperty(et,"__esModule",{value:!0});var Gd=oe(),kn=gt(),_e=Qe(),Km=Nn(),Wm=co(),_t=Ue(),Vm=lo(),q=_t.getGlobalObject(),wn="__sentry_xhr_v2__",ht={},Bd={};function zm(t){if(!Bd[t])switch(Bd[t]=!0,t){case"console":Qm();break;case"dom":Wd();break;case"xhr":Kd();break;case"fetch":Zm();break;case"history":eE();break;case"error":sE();break;case"unhandledrejection":iE();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&kn.logger.warn("unknown instrumentation type:",t);return}}function Xm(t,e){ht[t]=ht[t]||[],ht[t].push(e),zm(t)}function Jm(){Object.keys(ht).forEach(t=>{ht[t]=void 0})}function he(t,e){if(!(!t||!ht[t]))for(let n of ht[t]||[])try{n(e)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&kn.logger.error(`Error while triggering instrumentation handler.
4
- Type: ${t}
5
- Name: ${Km.getFunctionName(n)}
6
- Error:`,r)}}function Qm(){"console"in _t.GLOBAL_OBJ&&kn.CONSOLE_LEVELS.forEach(function(t){t in _t.GLOBAL_OBJ.console&&_e.fill(_t.GLOBAL_OBJ.console,t,function(e){return kn.originalConsoleMethods[t]=e,function(...n){he("console",{args:n,level:t});let r=kn.originalConsoleMethods[t];r&&r.apply(_t.GLOBAL_OBJ.console,n)}})})}function Zm(){Wm.supportsNativeFetch()&&_e.fill(_t.GLOBAL_OBJ,"fetch",function(t){return function(...e){let{method:n,url:r}=Yd(e),s={args:e,fetchData:{method:n,url:r},startTimestamp:Date.now()};return he("fetch",{...s}),t.apply(_t.GLOBAL_OBJ,e).then(i=>(he("fetch",{...s,endTimestamp:Date.now(),response:i}),i),i=>{throw he("fetch",{...s,endTimestamp:Date.now(),error:i}),i})}})}function po(t,e){return!!t&&typeof t=="object"&&!!t[e]}function $d(t){return typeof t=="string"?t:t?po(t,"url")?t.url:t.toString?t.toString():"":""}function Yd(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[n,r]=t;return{url:$d(n),method:po(r,"method")?String(r.method).toUpperCase():"GET"}}let e=t[0];return{url:$d(e),method:po(e,"method")?String(e.method).toUpperCase():"GET"}}function Kd(){if(!q.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;_e.fill(t,"open",function(e){return function(...n){let r=n[1],s=this[wn]={method:Gd.isString(n[0])?n[0].toUpperCase():n[0],url:n[1],request_headers:{}};Gd.isString(r)&&s.method==="POST"&&r.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let i=()=>{let o=this[wn];if(o&&this.readyState===4){try{o.status_code=this.status}catch{}he("xhr",{args:n,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?_e.fill(this,"onreadystatechange",function(o){return function(...a){return i(),o.apply(this,a)}}):this.addEventListener("readystatechange",i),_e.fill(this,"setRequestHeader",function(o){return function(...a){let[c,u]=a,d=this[wn];return d&&(d.request_headers[c.toLowerCase()]=u),o.apply(this,a)}}),e.apply(this,n)}}),_e.fill(t,"send",function(e){return function(...n){let r=this[wn];return r&&n[0]!==void 0&&(r.body=n[0]),he("xhr",{args:n,startTimestamp:Date.now(),xhr:this}),e.apply(this,n)}})}var Wr;function eE(){if(!Vm.supportsHistory())return;let t=q.onpopstate;q.onpopstate=function(...n){let r=q.location.href,s=Wr;if(Wr=r,he("history",{from:s,to:r}),t)try{return t.apply(this,n)}catch{}};function e(n){return function(...r){let s=r.length>2?r[2]:void 0;if(s){let i=Wr,o=String(s);Wr=o,he("history",{from:i,to:o})}return n.apply(this,r)}}_e.fill(q.history,"pushState",e),_e.fill(q.history,"replaceState",e)}var tE=1e3,jd,Vr;function nE(t,e){if(t.type!==e.type)return!1;try{if(t.target!==e.target)return!1}catch{}return!0}function rE(t){if(t.type!=="keypress")return!1;try{let e=t.target;if(!e||!e.tagName)return!0;if(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)return!1}catch{}return!0}function Hd(t,e=!1){return n=>{if(!n||n._sentryCaptured||rE(n))return;_e.addNonEnumerableProperty(n,"_sentryCaptured",!0);let r=n.type==="keypress"?"input":n.type;(Vr===void 0||!nE(Vr,n))&&(t({event:n,name:r,global:e}),Vr=n),clearTimeout(jd),jd=q.setTimeout(()=>{Vr=void 0},tE)}}function Wd(){if(!q.document)return;let t=he.bind(null,"dom"),e=Hd(t,!0);q.document.addEventListener("click",e,!1),q.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{let r=q[n]&&q[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(_e.fill(r,"addEventListener",function(s){return function(i,o,a){if(i==="click"||i=="keypress")try{let c=this,u=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},d=u[i]=u[i]||{refCount:0};if(!d.handler){let l=Hd(t);d.handler=l,s.call(this,i,l,a)}d.refCount++}catch{}return s.call(this,i,o,a)}}),_e.fill(r,"removeEventListener",function(s){return function(i,o,a){if(i==="click"||i=="keypress")try{let c=this,u=c.__sentry_instrumentation_handlers__||{},d=u[i];d&&(d.refCount--,d.refCount<=0&&(s.call(this,i,d.handler,a),d.handler=void 0,delete u[i]),Object.keys(u).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return s.call(this,i,o,a)}}))})}var zr=null;function sE(){zr=q.onerror,q.onerror=function(t,e,n,r,s){return he("error",{column:r,error:s,line:n,msg:t,url:e}),zr&&!zr.__SENTRY_LOADER__?zr.apply(this,arguments):!1},q.onerror.__SENTRY_INSTRUMENTED__=!0}var Xr=null;function iE(){Xr=q.onunhandledrejection,q.onunhandledrejection=function(t){return he("unhandledrejection",t),Xr&&!Xr.__SENTRY_LOADER__?Xr.apply(this,arguments):!0},q.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}et.SENTRY_XHR_DATA_KEY=wn;et.addInstrumentationHandler=Xm;et.instrumentDOM=Wd;et.instrumentXHR=Kd;et.parseFetchArgs=Yd;et.resetInstrumentationHandlers=Jm});var go=g(fo=>{Object.defineProperty(fo,"__esModule",{value:!0});function oE(){let t=typeof WeakSet=="function",e=t?new WeakSet:[];function n(s){if(t)return e.has(s)?!0:(e.add(s),!1);for(let i=0;i<e.length;i++)if(e[i]===s)return!0;return e.push(s),!1}function r(s){if(t)e.delete(s);else for(let i=0;i<e.length;i++)if(e[i]===s){e.splice(i,1);break}}return[n,r]}fo.memoBuilder=oE});var Jr=g(Ie=>{Object.defineProperty(Ie,"__esModule",{value:!0});var aE=Qe(),_o=Rn(),cE=Ue();function uE(){let t=cE.GLOBAL_OBJ,e=t.crypto||t.msCrypto,n=()=>Math.random()*16;try{if(e&&e.randomUUID)return e.randomUUID().replace(/-/g,"");e&&e.getRandomValues&&(n=()=>e.getRandomValues(new Uint8Array(1))[0])}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function zd(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function dE(t){let{message:e,event_id:n}=t;if(e)return e;let r=zd(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function lE(t,e,n){let r=t.exception=t.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=e||""),i.type||(i.type=n||"Error")}function pE(t,e){let n=zd(t);if(!n)return;let r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...e},e&&"data"in e){let i={...s&&s.data,...e.data};n.mechanism.data=i}}var fE=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function gE(t){let e=t.match(fE)||[],n=parseInt(e[1],10),r=parseInt(e[2],10),s=parseInt(e[3],10);return{buildmetadata:e[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(s)?void 0:s,prerelease:e[4]}}function _E(t,e,n=5){if(e.lineno===void 0)return;let r=t.length,s=Math.max(Math.min(r-1,e.lineno-1),0);e.pre_context=t.slice(Math.max(0,s-n),s).map(i=>_o.snipLine(i,0)),e.context_line=_o.snipLine(t[Math.min(r-1,s)],e.colno||0),e.post_context=t.slice(Math.min(s+1,r),s+1+n).map(i=>_o.snipLine(i,0))}function hE(t){if(t&&t.__sentry_captured__)return!0;try{aE.addNonEnumerableProperty(t,"__sentry_captured__",!0)}catch{}return!1}function mE(t){return Array.isArray(t)?t:[t]}Ie.addContextToFrame=_E;Ie.addExceptionMechanism=pE;Ie.addExceptionTypeValue=lE;Ie.arrayify=mE;Ie.checkOrSetAlreadyCaught=hE;Ie.getEventDescription=dE;Ie.parseSemver=gE;Ie.uuid4=uE});var ho=g(Qr=>{Object.defineProperty(Qr,"__esModule",{value:!0});function EE(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function yE(){return"npm"}Qr.getSDKSource=yE;Qr.isBrowserBundle=EE});var mo=g((xn,es)=>{Object.defineProperty(xn,"__esModule",{value:!0});var SE=ho();function TE(){return!SE.isBrowserBundle()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Zr(t,e){return t.require(e)}function bE(t){let e;try{e=Zr(es,t)}catch{}try{let{cwd:n}=Zr(es,"process");e=Zr(es,`${n()}/node_modules/${t}`)}catch{}return e}xn.dynamicRequire=Zr;xn.isNodeEnv=TE;xn.loadModule=bE});var Mn=g(Pn=>{Object.defineProperty(Pn,"__esModule",{value:!0});var Eo=oe(),IE=go(),AE=Qe(),vE=Nn();function Xd(t,e=100,n=1/0){try{return ts("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Jd(t,e=3,n=100*1024){let r=Xd(t,e);return DE(r)>n?Jd(t,e-1,n):r}function ts(t,e,n=1/0,r=1/0,s=IE.memoBuilder()){let[i,o]=s;if(e==null||["number","boolean","string"].includes(typeof e)&&!Eo.isNaN(e))return e;let a=RE(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;let c=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(i(e))return"[Circular ~]";let u=e;if(u&&typeof u.toJSON=="function")try{let f=u.toJSON();return ts("",f,c-1,r,s)}catch{}let d=Array.isArray(e)?[]:{},l=0,p=AE.convertToPlainObject(e);for(let f in p){if(!Object.prototype.hasOwnProperty.call(p,f))continue;if(l>=r){d[f]="[MaxProperties ~]";break}let m=p[f];d[f]=ts(f,m,c-1,r,s),l++}return o(e),d}function RE(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Eo.isVueViewModel(e))return"[VueViewModel]";if(Eo.isSyntheticEvent(e))return"[SyntheticEvent]";if(typeof e=="number"&&e!==e)return"[NaN]";if(typeof e=="function")return`[Function: ${vE.getFunctionName(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;let n=CE(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function CE(t){let e=Object.getPrototypeOf(t);return e?e.constructor.name:"null prototype"}function OE(t){return~-encodeURI(t).split(/%..|./).length}function DE(t){return OE(JSON.stringify(t))}Pn.normalize=Xd;Pn.normalizeToSize=Jd;Pn.walk=ts});var rl=g(Le=>{Object.defineProperty(Le,"__esModule",{value:!0});function Zd(t,e){let n=0;for(let r=t.length-1;r>=0;r--){let s=t[r];s==="."?t.splice(r,1):s===".."?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}var NE=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function el(t){let e=t.length>1024?`<truncated>${t.slice(-1024)}`:t,n=NE.exec(e);return n?n.slice(1):[]}function yo(...t){let e="",n=!1;for(let r=t.length-1;r>=-1&&!n;r--){let s=r>=0?t[r]:"/";s&&(e=`${s}/${e}`,n=s.charAt(0)==="/")}return e=Zd(e.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+e||"."}function Qd(t){let e=0;for(;e<t.length&&t[e]==="";e++);let n=t.length-1;for(;n>=0&&t[n]==="";n--);return e>n?[]:t.slice(e,n-e+1)}function wE(t,e){t=yo(t).slice(1),e=yo(e).slice(1);let n=Qd(t.split("/")),r=Qd(e.split("/")),s=Math.min(n.length,r.length),i=s;for(let a=0;a<s;a++)if(n[a]!==r[a]){i=a;break}let o=[];for(let a=i;a<n.length;a++)o.push("..");return o=o.concat(r.slice(i)),o.join("/")}function tl(t){let e=nl(t),n=t.slice(-1)==="/",r=Zd(t.split("/").filter(s=>!!s),!e).join("/");return!r&&!e&&(r="."),r&&n&&(r+="/"),(e?"/":"")+r}function nl(t){return t.charAt(0)==="/"}function kE(...t){return tl(t.join("/"))}function xE(t){let e=el(t),n=e[0],r=e[1];return!n&&!r?".":(r&&(r=r.slice(0,r.length-1)),n+r)}function PE(t,e){let n=el(t)[2];return e&&n.slice(e.length*-1)===e&&(n=n.slice(0,n.length-e.length)),n}Le.basename=PE;Le.dirname=xE;Le.isAbsolute=nl;Le.join=kE;Le.normalizePath=tl;Le.relative=wE;Le.resolve=yo});var So=g(Ln=>{Object.defineProperty(Ln,"__esModule",{value:!0});var ME=oe(),qe;(function(t){t[t.PENDING=0]="PENDING";let n=1;t[t.RESOLVED=n]="RESOLVED";let r=2;t[t.REJECTED=r]="REJECTED"})(qe||(qe={}));function UE(t){return new Un(e=>{e(t)})}function LE(t){return new Un((e,n)=>{n(t)})}var Un=class t{constructor(e){t.prototype.__init.call(this),t.prototype.__init2.call(this),t.prototype.__init3.call(this),t.prototype.__init4.call(this),this._state=qe.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(n){this._reject(n)}}then(e,n){return new t((r,s)=>{this._handlers.push([!1,i=>{if(!e)r(i);else try{r(e(i))}catch(o){s(o)}},i=>{if(!n)s(i);else try{r(n(i))}catch(o){s(o)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new t((n,r)=>{let s,i;return this.then(o=>{i=!1,s=o,e&&e()},o=>{i=!0,s=o,e&&e()}).then(()=>{if(i){r(s);return}n(s)})})}__init(){this._resolve=e=>{this._setResult(qe.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(qe.REJECTED,e)}}__init3(){this._setResult=(e,n)=>{if(this._state===qe.PENDING){if(ME.isThenable(n)){n.then(this._resolve,this._reject);return}this._state=e,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===qe.PENDING)return;let e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===qe.RESOLVED&&n[1](this._value),this._state===qe.REJECTED&&n[2](this._value),n[0]=!0)})}}};Ln.SyncPromise=Un;Ln.rejectedSyncPromise=LE;Ln.resolvedSyncPromise=UE});var sl=g(bo=>{Object.defineProperty(bo,"__esModule",{value:!0});var qE=ro(),To=So();function FE(t){let e=[];function n(){return t===void 0||e.length<t}function r(o){return e.splice(e.indexOf(o),1)[0]}function s(o){if(!n())return To.rejectedSyncPromise(new qE.SentryError("Not adding Promise because buffer limit was reached."));let a=o();return e.indexOf(a)===-1&&e.push(a),a.then(()=>r(a)).then(null,()=>r(a).then(null,()=>{})),a}function i(o){return new To.SyncPromise((a,c)=>{let u=e.length;if(!u)return a(!0);let d=setTimeout(()=>{o&&o>0&&a(!1)},o);e.forEach(l=>{To.resolvedSyncPromise(l).then(()=>{--u||(clearTimeout(d),a(!0))},c)})})}return{$:e,add:s,drain:i}}bo.makePromiseBuffer=FE});var Io=g(Ht=>{Object.defineProperty(Ht,"__esModule",{value:!0});function GE(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function BE(t){return t.split(/[\?#]/,1)[0]}function $E(t){return t.split(/\\?\//).filter(e=>e.length>0&&e!==",").length}function jE(t){let{protocol:e,host:n,path:r}=t,s=n&&n.replace(/^.*@/,"[filtered]:[filtered]@").replace(":80","").replace(":443","")||"";return`${e?`${e}://`:""}${s}${r}`}Ht.getNumberOfUrlSegments=$E;Ht.getSanitizedUrlString=jE;Ht.parseUrl=GE;Ht.stripUrlQueryAndFragment=BE});var al=g(Yt=>{Object.defineProperty(Yt,"__esModule",{value:!0});var il=oe(),HE=Mn(),YE=Io(),KE={ip:!1,request:!0,transaction:!0,user:!0},WE=["cookies","data","headers","method","query_string","url"],VE=["id","username","email"];function zE(t,e,n){t&&((!t.metadata.source||t.metadata.source==="url")&&t.setName(...ns(e,{path:!0,method:!0})),t.setData("url",e.originalUrl||e.url),e.baseUrl&&t.setData("baseUrl",e.baseUrl),t.setData("query",ol(e,n)))}function ns(t,e={}){let n=t.method&&t.method.toUpperCase(),r="",s="url";e.customRoute||t.route?(r=e.customRoute||`${t.baseUrl||""}${t.route&&t.route.path}`,s="route"):(t.originalUrl||t.url)&&(r=YE.stripUrlQueryAndFragment(t.originalUrl||t.url||""));let i="";return e.method&&n&&(i+=n),e.method&&e.path&&(i+=" "),e.path&&r&&(i+=r),[i,s]}function XE(t,e){switch(e){case"path":return ns(t,{path:!0})[0];case"handler":return t.route&&t.route.stack&&t.route.stack[0]&&t.route.stack[0].name||"<anonymous>";default:return ns(t,{path:!0,method:!0})[0]}}function JE(t,e){let n={};return(Array.isArray(e)?e:VE).forEach(s=>{t&&s in t&&(n[s]=t[s])}),n}function Ao(t,e){let{include:n=WE,deps:r}=e||{},s={},i=t.headers||{},o=t.method,a=t.hostname||t.host||i.host||"<no host>",c=t.protocol==="https"||t.socket&&t.socket.encrypted?"https":"http",u=t.originalUrl||t.url||"",d=`${c}://${a}${u}`;return n.forEach(l=>{switch(l){case"headers":{s.headers=i;break}case"method":{s.method=o;break}case"url":{s.url=d;break}case"cookies":{s.cookies=t.cookies||i.cookie&&r&&r.cookie&&r.cookie.parse(i.cookie)||{};break}case"query_string":{s.query_string=ol(t,r);break}case"data":{if(o==="GET"||o==="HEAD")break;t.body!==void 0&&(s.data=il.isString(t.body)?t.body:JSON.stringify(HE.normalize(t.body)));break}default:({}).hasOwnProperty.call(t,l)&&(s[l]=t[l])}}),s}function QE(t,e,n){let r={...KE,...n&&n.include};if(r.request){let s=Array.isArray(r.request)?Ao(e,{include:r.request,deps:n&&n.deps}):Ao(e,{deps:n&&n.deps});t.request={...t.request,...s}}if(r.user){let s=e.user&&il.isPlainObject(e.user)?JE(e.user,r.user):{};Object.keys(s).length&&(t.user={...t.user,...s})}if(r.ip){let s=e.ip||e.socket&&e.socket.remoteAddress;s&&(t.user={...t.user,ip_address:s})}return r.transaction&&!t.transaction&&(t.transaction=XE(e,r.transaction)),t}function ol(t,e){let n=t.originalUrl||t.url||"";if(n)return n.startsWith("/")&&(n=`http://dogs.are.great${n}`),t.query||typeof URL!==void 0&&new URL(n).search.replace("?","")||e&&e.url&&e.url.parse(n).query||void 0}Yt.addRequestDataToEvent=QE;Yt.addRequestDataToTransaction=zE;Yt.extractPathForTransaction=ns;Yt.extractRequestData=Ao});var dl=g(qn=>{Object.defineProperty(qn,"__esModule",{value:!0});var cl=["fatal","error","warning","log","info","debug"];function ZE(t){return ul(t)}function ul(t){return t==="warn"?"warning":cl.includes(t)?t:"log"}qn.severityFromString=ZE;qn.severityLevelFromString=ul;qn.validSeverityLevels=cl});var Ro=g((ae,_l)=>{Object.defineProperty(ae,"__esModule",{value:!0});var pl=mo(),ey=Ue(),fl=ey.getGlobalObject(),vo={nowSeconds:()=>Date.now()/1e3};function ty(){let{performance:t}=fl;if(!t||!t.now)return;let e=Date.now()-t.now();return{now:()=>t.now(),timeOrigin:e}}function ny(){try{return pl.dynamicRequire(_l,"perf_hooks").performance}catch{return}}var rs=pl.isNodeEnv()?ny():ty(),ll=rs===void 0?vo:{nowSeconds:()=>(rs.timeOrigin+rs.now())/1e3},ry=vo.nowSeconds.bind(vo),gl=ll.nowSeconds.bind(ll),sy=gl,iy=rs!==void 0;ae._browserPerformanceTimeOriginMode=void 0;var oy=(()=>{let{performance:t}=fl;if(!t||!t.now){ae._browserPerformanceTimeOriginMode="none";return}let e=3600*1e3,n=t.now(),r=Date.now(),s=t.timeOrigin?Math.abs(t.timeOrigin+n-r):e,i=s<e,o=t.timing&&t.timing.navigationStart,c=typeof o=="number"?Math.abs(o+n-r):e,u=c<e;return i||u?s<=c?(ae._browserPerformanceTimeOriginMode="timeOrigin",t.timeOrigin):(ae._browserPerformanceTimeOriginMode="navigationStart",o):(ae._browserPerformanceTimeOriginMode="dateNow",r)})();ae.browserPerformanceTimeOrigin=oy;ae.dateTimestampInSeconds=ry;ae.timestampInSeconds=gl;ae.timestampWithMs=sy;ae.usingPerformanceAPI=iy});var Oo=g(tt=>{Object.defineProperty(tt,"__esModule",{value:!0});var ay=oe(),cy=gt(),uy="baggage",Co="sentry-",ml=/^sentry-/,El=8192;function dy(t){if(!ay.isString(t)&&!Array.isArray(t))return;let e={};if(Array.isArray(t))e=t.reduce((r,s)=>{let i=hl(s);return{...r,...i}},{});else{if(!t)return;e=hl(t)}let n=Object.entries(e).reduce((r,[s,i])=>{if(s.match(ml)){let o=s.slice(Co.length);r[o]=i}return r},{});if(Object.keys(n).length>0)return n}function ly(t){if(!t)return;let e=Object.entries(t).reduce((n,[r,s])=>(s&&(n[`${Co}${r}`]=s),n),{});return py(e)}function hl(t){return t.split(",").map(e=>e.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((e,[n,r])=>(e[n]=r,e),{})}function py(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],s)=>{let i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=s===0?i:`${e},${i}`;return o.length>El?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&cy.logger.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):o},"")}tt.BAGGAGE_HEADER_NAME=uy;tt.MAX_BAGGAGE_STRING_LENGTH=El;tt.SENTRY_BAGGAGE_KEY_PREFIX=Co;tt.SENTRY_BAGGAGE_KEY_PREFIX_REGEX=ml;tt.baggageHeaderToDynamicSamplingContext=dy;tt.dynamicSamplingContextToSentryBaggageHeader=ly});var Tl=g(Kt=>{Object.defineProperty(Kt,"__esModule",{value:!0});var fy=Oo(),ss=Jr(),yl=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Sl(t){if(!t)return;let e=t.match(yl);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function gy(t,e){let n=Sl(t),r=fy.baggageHeaderToDynamicSamplingContext(e),{traceId:s,parentSpanId:i,parentSampled:o}=n||{},a={traceId:s||ss.uuid4(),spanId:ss.uuid4().substring(16),sampled:o};return i&&(a.parentSpanId=i),r&&(a.dsc=r),{traceparentData:n,dynamicSamplingContext:r,propagationContext:a}}function _y(t=ss.uuid4(),e=ss.uuid4().substring(16),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}Kt.TRACEPARENT_REGEXP=yl;Kt.extractTraceparentData=Sl;Kt.generateSentryTraceHeader=_y;Kt.tracingContextFromHeaders=gy});var No=g(ce=>{Object.defineProperty(ce,"__esModule",{value:!0});var hy=eo(),my=Mn(),bl=Qe();function Ey(t,e=[]){return[t,e]}function yy(t,e){let[n,r]=t;return[n,[...r,e]]}function Il(t,e){let n=t[1];for(let r of n){let s=r[0].type;if(e(r,s))return!0}return!1}function Sy(t,e){return Il(t,(n,r)=>e.includes(r))}function Do(t,e){return(e||new TextEncoder).encode(t)}function Ty(t,e){let[n,r]=t,s=JSON.stringify(n);function i(o){typeof s=="string"?s=typeof o=="string"?s+o:[Do(s,e),o]:s.push(typeof o=="string"?Do(o,e):o)}for(let o of r){let[a,c]=o;if(i(`
2
+ "use strict";var vm=Object.create;var Kr=Object.defineProperty;var Om=Object.getOwnPropertyDescriptor;var Cm=Object.getOwnPropertyNames;var Dm=Object.getPrototypeOf,Nm=Object.prototype.hasOwnProperty;var ee=(e,t)=>()=>(e&&(t=e(e=0)),t);var g=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Gd=(e,t)=>{for(var n in t)Kr(e,n,{get:t[n],enumerable:!0})},Bd=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Cm(t))!Nm.call(e,s)&&s!==n&&Kr(e,s,{get:()=>t[s],enumerable:!(r=Om(t,s))||r.enumerable});return e};var wm=(e,t,n)=>(n=e!=null?vm(Dm(e)):{},Bd(t||!e||!e.__esModule?Kr(n,"default",{value:e,enumerable:!0}):n,e)),km=e=>Bd(Kr({},"__esModule",{value:!0}),e);function xm(e=new Date){return e.toLocaleString(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,hour12:!1})}function ai(e){return[`[${xm()}]`,...e]}function y(...e){console.log(...ai(e))}function jd(...e){console.warn(...ai(e))}function $d(...e){console.error(...ai(e))}var te=ee(()=>{"use strict"});function Hd(e){ci=e}function qe(){if(!ci)throw new Error("[xmtp] PluginRuntime not initialized \u2014 ensure setXmtpRuntime is called in register()");return ci}var ci,Nn=ee(()=>{"use strict";ci=null});var ce=g(j=>{Object.defineProperty(j,"__esModule",{value:!0});var Yd=Object.prototype.toString;function Pm(e){switch(Yd.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Wr(e,Error)}}function $t(e,t){return Yd.call(e)===`[object ${t}]`}function Um(e){return $t(e,"ErrorEvent")}function Mm(e){return $t(e,"DOMError")}function Lm(e){return $t(e,"DOMException")}function qm(e){return $t(e,"String")}function Fm(e){return e===null||typeof e!="object"&&typeof e!="function"}function Kd(e){return $t(e,"Object")}function Gm(e){return typeof Event<"u"&&Wr(e,Event)}function Bm(e){return typeof Element<"u"&&Wr(e,Element)}function jm(e){return $t(e,"RegExp")}function $m(e){return!!(e&&e.then&&typeof e.then=="function")}function Hm(e){return Kd(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Ym(e){return typeof e=="number"&&e!==e}function Wr(e,t){try{return e instanceof t}catch{return!1}}function Km(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}j.isDOMError=Mm;j.isDOMException=Lm;j.isElement=Bm;j.isError=Pm;j.isErrorEvent=Um;j.isEvent=Gm;j.isInstanceOf=Wr;j.isNaN=Ym;j.isPlainObject=Kd;j.isPrimitive=Fm;j.isRegExp=jm;j.isString=qm;j.isSyntheticEvent=Hm;j.isThenable=$m;j.isVueViewModel=Km});var wn=g(ht=>{Object.defineProperty(ht,"__esModule",{value:!0});var Vr=ce();function Wm(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Vm(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let s=Math.max(t-60,0);s<5&&(s=0);let o=Math.min(s+140,r);return o>r-5&&(o=r),o===r&&(s=Math.max(o-140,0)),n=n.slice(s,o),s>0&&(n=`'{snip} ${n}`),o<r&&(n+=" {snip}"),n}function zm(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let s=e[r];try{Vr.isVueViewModel(s)?n.push("[VueViewModel]"):n.push(String(s))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Wd(e,t,n=!1){return Vr.isString(e)?Vr.isRegExp(t)?t.test(e):Vr.isString(t)?n?e===t:e.includes(t):!1:!1}function Xm(e,t=[],n=!1){return t.some(r=>Wd(e,r,n))}ht.isMatchingPattern=Wd;ht.safeJoin=zm;ht.snipLine=Vm;ht.stringMatchesSomePattern=Xm;ht.truncate=Wm});var Xd=g(li=>{Object.defineProperty(li,"__esModule",{value:!0});var ui=ce(),Jm=wn();function Qm(e,t,n=250,r,s,o,i){if(!o.exception||!o.exception.values||!i||!ui.isInstanceOf(i.originalException,Error))return;let a=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;a&&(o.exception.values=Zm(di(e,t,s,i.originalException,r,o.exception.values,a,0),n))}function di(e,t,n,r,s,o,i,a){if(o.length>=n+1)return o;let c=[...o];if(ui.isInstanceOf(r[s],Error)){Vd(i,a);let u=e(t,r[s]),d=c.length;zd(u,s,d,a),c=di(e,t,n,r[s],s,[u,...c],u,d)}return Array.isArray(r.errors)&&r.errors.forEach((u,d)=>{if(ui.isInstanceOf(u,Error)){Vd(i,a);let l=e(t,u),p=c.length;zd(l,`errors[${d}]`,p,a),c=di(e,t,n,u,s,[l,...c],l,p)}}),c}function Vd(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,is_exception_group:!0,exception_id:t}}function zd(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function Zm(e,t){return e.map(n=>(n.value&&(n.value=Jm.truncate(n.value,t)),n))}li.applyAggregateErrorsToEvent=Qm});var Fe=g(kn=>{Object.defineProperty(kn,"__esModule",{value:!0});function zr(e){return e&&e.Math==Math?e:void 0}var pi=typeof globalThis=="object"&&zr(globalThis)||typeof window=="object"&&zr(window)||typeof self=="object"&&zr(self)||typeof global=="object"&&zr(global)||(function(){return this})()||{};function eE(){return pi}function tE(e,t,n){let r=n||pi,s=r.__SENTRY__=r.__SENTRY__||{};return s[e]||(s[e]=t())}kn.GLOBAL_OBJ=pi;kn.getGlobalObject=eE;kn.getGlobalSingleton=tE});var fi=g(xn=>{Object.defineProperty(xn,"__esModule",{value:!0});var nE=ce(),rE=Fe(),Xr=rE.getGlobalObject(),sE=80;function oE(e,t={}){try{let n=e,r=5,s=[],o=0,i=0,a=" > ",c=a.length,u,d=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||sE;for(;n&&o++<r&&(u=iE(n,d),!(u==="html"||o>1&&i+s.length*c+u.length>=l));)s.push(u),i+=u.length,n=n.parentNode;return s.reverse().join(a)}catch{return"<unknown>"}}function iE(e,t){let n=e,r=[],s,o,i,a,c;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());let u=t&&t.length?t.filter(l=>n.getAttribute(l)).map(l=>[l,n.getAttribute(l)]):null;if(u&&u.length)u.forEach(l=>{r.push(`[${l[0]}="${l[1]}"]`)});else if(n.id&&r.push(`#${n.id}`),s=n.className,s&&nE.isString(s))for(o=s.split(/\s+/),c=0;c<o.length;c++)r.push(`.${o[c]}`);let d=["aria-label","type","name","title","alt"];for(c=0;c<d.length;c++)i=d[c],a=n.getAttribute(i),a&&r.push(`[${i}="${a}"]`);return r.join("")}function aE(){try{return Xr.document.location.href}catch{return""}}function cE(e){return Xr.document&&Xr.document.querySelector?Xr.document.querySelector(e):null}xn.getDomElement=cE;xn.getLocationHref=aE;xn.htmlTreeAsString=oE});var mt=g(Ht=>{Object.defineProperty(Ht,"__esModule",{value:!0});var gi=Fe(),uE="Sentry Logger ",_i=["debug","info","warn","error","log","assert","trace"],hi={};function Jd(e){if(!("console"in gi.GLOBAL_OBJ))return e();let t=gi.GLOBAL_OBJ.console,n={},r=Object.keys(hi);r.forEach(s=>{let o=hi[s];n[s]=t[s],t[s]=o});try{return e()}finally{r.forEach(s=>{t[s]=n[s]})}}function dE(){let e=!1,t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?_i.forEach(n=>{t[n]=(...r)=>{e&&Jd(()=>{gi.GLOBAL_OBJ.console[n](`${uE}[${n}]:`,...r)})}}):_i.forEach(n=>{t[n]=()=>{}}),t}var lE=dE();Ht.CONSOLE_LEVELS=_i;Ht.consoleSandbox=Jd;Ht.logger=lE;Ht.originalConsoleMethods=hi});var mi=g(Pn=>{Object.defineProperty(Pn,"__esModule",{value:!0});var Jr=mt(),pE=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function fE(e){return e==="http"||e==="https"}function gE(e,t=!1){let{host:n,path:r,pass:s,port:o,projectId:i,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&s?`:${s}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${i}`}function Qd(e){let t=pE.exec(e);if(!t){console.error(`Invalid Sentry Dsn: ${e}`);return}let[n,r,s="",o,i="",a]=t.slice(1),c="",u=a,d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){let l=u.match(/^\d+/);l&&(u=l[0])}return Zd({host:o,pass:s,path:c,projectId:u,port:i,protocol:n,publicKey:r})}function Zd(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function _E(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:(Jr.logger.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?fE(r)?t&&isNaN(parseInt(t,10))?(Jr.logger.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(Jr.logger.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(Jr.logger.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function hE(e){let t=typeof e=="string"?Qd(e):Zd(e);if(!(!t||!_E(t)))return t}Pn.dsnFromString=Qd;Pn.dsnToString=gE;Pn.makeDsn=hE});var Si=g(yi=>{Object.defineProperty(yi,"__esModule",{value:!0});var Ei=class extends Error{constructor(t,n="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}};yi.SentryError=Ei});var tt=g(he=>{Object.defineProperty(he,"__esModule",{value:!0});var mE=fi(),Yt=ce(),EE=mt(),el=wn();function yE(e,t,n){if(!(t in e))return;let r=e[t],s=n(r);typeof s=="function"&&sl(s,r),e[t]=s}function rl(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&EE.logger.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function sl(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,rl(e,"__sentry_original__",t)}catch{}}function SE(e){return e.__sentry_original__}function TE(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function ol(e){if(Yt.isError(e))return{message:e.message,name:e.name,stack:e.stack,...nl(e)};if(Yt.isEvent(e)){let t={type:e.type,target:tl(e.target),currentTarget:tl(e.currentTarget),...nl(e)};return typeof CustomEvent<"u"&&Yt.isInstanceOf(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function tl(e){try{return Yt.isElement(e)?mE.htmlTreeAsString(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function nl(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 bE(e,t=40){let n=Object.keys(ol(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return el.truncate(n[0],t);for(let r=n.length;r>0;r--){let s=n.slice(0,r).join(", ");if(!(s.length>t))return r===n.length?s:el.truncate(s,t)}return""}function IE(e){return Ti(e,new Map)}function Ti(e,t){if(Yt.isPlainObject(e)){let n=t.get(e);if(n!==void 0)return n;let r={};t.set(e,r);for(let s of Object.keys(e))typeof e[s]<"u"&&(r[s]=Ti(e[s],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(s=>{r.push(Ti(s,t))}),r}return e}function AE(e){let t;switch(!0){case e==null:t=new String(e);break;case(typeof e=="symbol"||typeof e=="bigint"):t=Object(e);break;case Yt.isPrimitive(e):t=new e.constructor(e);break;default:t=e;break}return t}he.addNonEnumerableProperty=rl;he.convertToPlainObject=ol;he.dropUndefinedKeys=IE;he.extractExceptionKeysForMessage=bE;he.fill=yE;he.getOriginalFunction=SE;he.markFunctionWrapped=sl;he.objectify=AE;he.urlEncode=TE});var Zr=g(Qr=>{Object.defineProperty(Qr,"__esModule",{value:!0});function il(e,t=!1){return!(t||e&&!e.startsWith("/")&&!e.includes(":\\")&&!e.startsWith(".")&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes("node_modules/")}function RE(e){let t=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return r=>{let s=r.match(n);if(s){let o,i,a,c,u;if(s[1]){a=s[1];let p=a.lastIndexOf(".");if(a[p-1]==="."&&p--,p>0){o=a.slice(0,p),i=a.slice(p+1);let f=o.indexOf(".Module");f>0&&(a=a.slice(f+1),o=o.slice(0,f))}c=void 0}i&&(c=o,u=i),i==="<anonymous>"&&(u=void 0,a=void 0),a===void 0&&(u=u||"<anonymous>",a=c?`${c}.${u}`:u);let d=s[2]&&s[2].startsWith("file://")?s[2].slice(7):s[2],l=s[5]==="native";return!d&&s[5]&&!l&&(d=s[5]),{filename:d,module:e?e(d):void 0,function:a,lineno:parseInt(s[3],10)||void 0,colno:parseInt(s[4],10)||void 0,in_app:il(d,l)}}if(r.match(t))return{filename:r}}}Qr.filenameIsInApp=il;Qr.node=RE});var Un=g(nt=>{Object.defineProperty(nt,"__esModule",{value:!0});var ul=Zr(),dl=50,al=/\(error: (.*)\)/,cl=/captureMessage|captureException/;function ll(...e){let t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0)=>{let s=[],o=n.split(`
3
+ `);for(let i=r;i<o.length;i++){let a=o[i];if(a.length>1024)continue;let c=al.test(a)?a.replace(al,"$1"):a;if(!c.match(/\S*Error: /)){for(let u of t){let d=u(c);if(d){s.push(d);break}}if(s.length>=dl)break}}return pl(s)}}function vE(e){return Array.isArray(e)?ll(...e):e}function pl(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(t[t.length-1].function||"")&&t.pop(),t.reverse(),cl.test(t[t.length-1].function||"")&&(t.pop(),cl.test(t[t.length-1].function||"")&&t.pop()),t.slice(0,dl).map(n=>({...n,filename:n.filename||t[t.length-1].filename,function:n.function||"?"}))}var bi="<anonymous>";function OE(e){try{return!e||typeof e!="function"?bi:e.name||bi}catch{return bi}}function CE(e){return[90,ul.node(e)]}nt.filenameIsInApp=ul.filenameIsInApp;nt.createStackParser=ll;nt.getFunctionName=OE;nt.nodeStackLineParser=CE;nt.stackParserFromStackParserOptions=vE;nt.stripSentryFramesAndReverse=pl});var Ri=g(Ie=>{Object.defineProperty(Ie,"__esModule",{value:!0});var DE=mt(),NE=Fe(),es=NE.getGlobalObject();function wE(){try{return new ErrorEvent(""),!0}catch{return!1}}function kE(){try{return new DOMError(""),!0}catch{return!1}}function xE(){try{return new DOMException(""),!0}catch{return!1}}function Ai(){if(!("fetch"in es))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Ii(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function PE(){if(!Ai())return!1;if(Ii(es.fetch))return!0;let e=!1,t=es.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=Ii(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&DE.logger.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function UE(){return"ReportingObserver"in es}function ME(){if(!Ai())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch{return!1}}Ie.isNativeFetch=Ii;Ie.supportsDOMError=kE;Ie.supportsDOMException=xE;Ie.supportsErrorEvent=wE;Ie.supportsFetch=Ai;Ie.supportsNativeFetch=PE;Ie.supportsReferrerPolicy=ME;Ie.supportsReportingObserver=UE});var Oi=g(vi=>{Object.defineProperty(vi,"__esModule",{value:!0});var LE=Fe(),ts=LE.getGlobalObject();function qE(){let e=ts.chrome,t=e&&e.app&&e.app.runtime,n="history"in ts&&!!ts.history.pushState&&!!ts.history.replaceState;return!t&&n}vi.supportsHistory=qE});var Tl=g(rt=>{Object.defineProperty(rt,"__esModule",{value:!0});var fl=ce(),Ln=mt(),me=tt(),FE=Un(),GE=Ri(),Et=Fe(),BE=Oi(),q=Et.getGlobalObject(),Mn="__sentry_xhr_v2__",yt={},gl={};function jE(e){if(!gl[e])switch(gl[e]=!0,e){case"console":YE();break;case"dom":Sl();break;case"xhr":yl();break;case"fetch":KE();break;case"history":WE();break;case"error":JE();break;case"unhandledrejection":QE();break;default:(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ln.logger.warn("unknown instrumentation type:",e);return}}function $E(e,t){yt[e]=yt[e]||[],yt[e].push(t),jE(e)}function HE(){Object.keys(yt).forEach(e=>{yt[e]=void 0})}function Ee(e,t){if(!(!e||!yt[e]))for(let n of yt[e]||[])try{n(t)}catch(r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ln.logger.error(`Error while triggering instrumentation handler.
4
+ Type: ${e}
5
+ Name: ${FE.getFunctionName(n)}
6
+ Error:`,r)}}function YE(){"console"in Et.GLOBAL_OBJ&&Ln.CONSOLE_LEVELS.forEach(function(e){e in Et.GLOBAL_OBJ.console&&me.fill(Et.GLOBAL_OBJ.console,e,function(t){return Ln.originalConsoleMethods[e]=t,function(...n){Ee("console",{args:n,level:e});let r=Ln.originalConsoleMethods[e];r&&r.apply(Et.GLOBAL_OBJ.console,n)}})})}function KE(){GE.supportsNativeFetch()&&me.fill(Et.GLOBAL_OBJ,"fetch",function(e){return function(...t){let{method:n,url:r}=El(t),s={args:t,fetchData:{method:n,url:r},startTimestamp:Date.now()};return Ee("fetch",{...s}),e.apply(Et.GLOBAL_OBJ,t).then(o=>(Ee("fetch",{...s,endTimestamp:Date.now(),response:o}),o),o=>{throw Ee("fetch",{...s,endTimestamp:Date.now(),error:o}),o})}})}function Ci(e,t){return!!e&&typeof e=="object"&&!!e[t]}function _l(e){return typeof e=="string"?e:e?Ci(e,"url")?e.url:e.toString?e.toString():"":""}function El(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){let[n,r]=e;return{url:_l(n),method:Ci(r,"method")?String(r.method).toUpperCase():"GET"}}let t=e[0];return{url:_l(t),method:Ci(t,"method")?String(t.method).toUpperCase():"GET"}}function yl(){if(!q.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;me.fill(e,"open",function(t){return function(...n){let r=n[1],s=this[Mn]={method:fl.isString(n[0])?n[0].toUpperCase():n[0],url:n[1],request_headers:{}};fl.isString(r)&&s.method==="POST"&&r.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let o=()=>{let i=this[Mn];if(i&&this.readyState===4){try{i.status_code=this.status}catch{}Ee("xhr",{args:n,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:this})}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?me.fill(this,"onreadystatechange",function(i){return function(...a){return o(),i.apply(this,a)}}):this.addEventListener("readystatechange",o),me.fill(this,"setRequestHeader",function(i){return function(...a){let[c,u]=a,d=this[Mn];return d&&(d.request_headers[c.toLowerCase()]=u),i.apply(this,a)}}),t.apply(this,n)}}),me.fill(e,"send",function(t){return function(...n){let r=this[Mn];return r&&n[0]!==void 0&&(r.body=n[0]),Ee("xhr",{args:n,startTimestamp:Date.now(),xhr:this}),t.apply(this,n)}})}var ns;function WE(){if(!BE.supportsHistory())return;let e=q.onpopstate;q.onpopstate=function(...n){let r=q.location.href,s=ns;if(ns=r,Ee("history",{from:s,to:r}),e)try{return e.apply(this,n)}catch{}};function t(n){return function(...r){let s=r.length>2?r[2]:void 0;if(s){let o=ns,i=String(s);ns=i,Ee("history",{from:o,to:i})}return n.apply(this,r)}}me.fill(q.history,"pushState",t),me.fill(q.history,"replaceState",t)}var VE=1e3,hl,rs;function zE(e,t){if(e.type!==t.type)return!1;try{if(e.target!==t.target)return!1}catch{}return!0}function XE(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 ml(e,t=!1){return n=>{if(!n||n._sentryCaptured||XE(n))return;me.addNonEnumerableProperty(n,"_sentryCaptured",!0);let r=n.type==="keypress"?"input":n.type;(rs===void 0||!zE(rs,n))&&(e({event:n,name:r,global:t}),rs=n),clearTimeout(hl),hl=q.setTimeout(()=>{rs=void 0},VE)}}function Sl(){if(!q.document)return;let e=Ee.bind(null,"dom"),t=ml(e,!0);q.document.addEventListener("click",t,!1),q.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{let r=q[n]&&q[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(me.fill(r,"addEventListener",function(s){return function(o,i,a){if(o==="click"||o=="keypress")try{let c=this,u=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},d=u[o]=u[o]||{refCount:0};if(!d.handler){let l=ml(e);d.handler=l,s.call(this,o,l,a)}d.refCount++}catch{}return s.call(this,o,i,a)}}),me.fill(r,"removeEventListener",function(s){return function(o,i,a){if(o==="click"||o=="keypress")try{let c=this,u=c.__sentry_instrumentation_handlers__||{},d=u[o];d&&(d.refCount--,d.refCount<=0&&(s.call(this,o,d.handler,a),d.handler=void 0,delete u[o]),Object.keys(u).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return s.call(this,o,i,a)}}))})}var ss=null;function JE(){ss=q.onerror,q.onerror=function(e,t,n,r,s){return Ee("error",{column:r,error:s,line:n,msg:e,url:t}),ss&&!ss.__SENTRY_LOADER__?ss.apply(this,arguments):!1},q.onerror.__SENTRY_INSTRUMENTED__=!0}var os=null;function QE(){os=q.onunhandledrejection,q.onunhandledrejection=function(e){return Ee("unhandledrejection",e),os&&!os.__SENTRY_LOADER__?os.apply(this,arguments):!0},q.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}rt.SENTRY_XHR_DATA_KEY=Mn;rt.addInstrumentationHandler=$E;rt.instrumentDOM=Sl;rt.instrumentXHR=yl;rt.parseFetchArgs=El;rt.resetInstrumentationHandlers=HE});var Ni=g(Di=>{Object.defineProperty(Di,"__esModule",{value:!0});function ZE(){let e=typeof WeakSet=="function",t=e?new WeakSet:[];function n(s){if(e)return t.has(s)?!0:(t.add(s),!1);for(let o=0;o<t.length;o++)if(t[o]===s)return!0;return t.push(s),!1}function r(s){if(e)t.delete(s);else for(let o=0;o<t.length;o++)if(t[o]===s){t.splice(o,1);break}}return[n,r]}Di.memoBuilder=ZE});var is=g(Ae=>{Object.defineProperty(Ae,"__esModule",{value:!0});var ey=tt(),wi=wn(),ty=Fe();function ny(){let e=ty.GLOBAL_OBJ,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 bl(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function ry(e){let{message:t,event_id:n}=e;if(t)return t;let r=bl(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function sy(e,t,n){let r=e.exception=e.exception||{},s=r.values=r.values||[],o=s[0]=s[0]||{};o.value||(o.value=t||""),o.type||(o.type=n||"Error")}function oy(e,t){let n=bl(e);if(!n)return;let r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...t},t&&"data"in t){let o={...s&&s.data,...t.data};n.mechanism.data=o}}var iy=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function ay(e){let t=e.match(iy)||[],n=parseInt(t[1],10),r=parseInt(t[2],10),s=parseInt(t[3],10);return{buildmetadata:t[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(s)?void 0:s,prerelease:t[4]}}function cy(e,t,n=5){if(t.lineno===void 0)return;let r=e.length,s=Math.max(Math.min(r-1,t.lineno-1),0);t.pre_context=e.slice(Math.max(0,s-n),s).map(o=>wi.snipLine(o,0)),t.context_line=wi.snipLine(e[Math.min(r-1,s)],t.colno||0),t.post_context=e.slice(Math.min(s+1,r),s+1+n).map(o=>wi.snipLine(o,0))}function uy(e){if(e&&e.__sentry_captured__)return!0;try{ey.addNonEnumerableProperty(e,"__sentry_captured__",!0)}catch{}return!1}function dy(e){return Array.isArray(e)?e:[e]}Ae.addContextToFrame=cy;Ae.addExceptionMechanism=oy;Ae.addExceptionTypeValue=sy;Ae.arrayify=dy;Ae.checkOrSetAlreadyCaught=uy;Ae.getEventDescription=ry;Ae.parseSemver=ay;Ae.uuid4=ny});var ki=g(as=>{Object.defineProperty(as,"__esModule",{value:!0});function ly(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function py(){return"npm"}as.getSDKSource=py;as.isBrowserBundle=ly});var xi=g((qn,us)=>{Object.defineProperty(qn,"__esModule",{value:!0});var fy=ki();function gy(){return!fy.isBrowserBundle()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function cs(e,t){return e.require(t)}function _y(e){let t;try{t=cs(us,e)}catch{}try{let{cwd:n}=cs(us,"process");t=cs(us,`${n()}/node_modules/${e}`)}catch{}return t}qn.dynamicRequire=cs;qn.isNodeEnv=gy;qn.loadModule=_y});var Gn=g(Fn=>{Object.defineProperty(Fn,"__esModule",{value:!0});var Pi=ce(),hy=Ni(),my=tt(),Ey=Un();function Il(e,t=100,n=1/0){try{return ds("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Al(e,t=3,n=100*1024){let r=Il(e,t);return by(r)>n?Al(e,t-1,n):r}function ds(e,t,n=1/0,r=1/0,s=hy.memoBuilder()){let[o,i]=s;if(t==null||["number","boolean","string"].includes(typeof t)&&!Pi.isNaN(t))return t;let a=yy(e,t);if(!a.startsWith("[object "))return a;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 a.replace("object ","");if(o(t))return"[Circular ~]";let u=t;if(u&&typeof u.toJSON=="function")try{let f=u.toJSON();return ds("",f,c-1,r,s)}catch{}let d=Array.isArray(t)?[]:{},l=0,p=my.convertToPlainObject(t);for(let f in p){if(!Object.prototype.hasOwnProperty.call(p,f))continue;if(l>=r){d[f]="[MaxProperties ~]";break}let m=p[f];d[f]=ds(f,m,c-1,r,s),l++}return i(t),d}function yy(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(Pi.isVueViewModel(t))return"[VueViewModel]";if(Pi.isSyntheticEvent(t))return"[SyntheticEvent]";if(typeof t=="number"&&t!==t)return"[NaN]";if(typeof t=="function")return`[Function: ${Ey.getFunctionName(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;let n=Sy(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Sy(e){let t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}function Ty(e){return~-encodeURI(e).split(/%..|./).length}function by(e){return Ty(JSON.stringify(e))}Fn.normalize=Il;Fn.normalizeToSize=Al;Fn.walk=ds});var Nl=g(Ge=>{Object.defineProperty(Ge,"__esModule",{value:!0});function vl(e,t){let n=0;for(let r=e.length-1;r>=0;r--){let s=e[r];s==="."?e.splice(r,1):s===".."?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var Iy=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Ol(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=Iy.exec(t);return n?n.slice(1):[]}function Ui(...e){let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let s=r>=0?e[r]:"/";s&&(t=`${s}/${t}`,n=s.charAt(0)==="/")}return t=vl(t.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+t||"."}function Rl(e){let t=0;for(;t<e.length&&e[t]==="";t++);let n=e.length-1;for(;n>=0&&e[n]==="";n--);return t>n?[]:e.slice(t,n-t+1)}function Ay(e,t){e=Ui(e).slice(1),t=Ui(t).slice(1);let n=Rl(e.split("/")),r=Rl(t.split("/")),s=Math.min(n.length,r.length),o=s;for(let a=0;a<s;a++)if(n[a]!==r[a]){o=a;break}let i=[];for(let a=o;a<n.length;a++)i.push("..");return i=i.concat(r.slice(o)),i.join("/")}function Cl(e){let t=Dl(e),n=e.slice(-1)==="/",r=vl(e.split("/").filter(s=>!!s),!t).join("/");return!r&&!t&&(r="."),r&&n&&(r+="/"),(t?"/":"")+r}function Dl(e){return e.charAt(0)==="/"}function Ry(...e){return Cl(e.join("/"))}function vy(e){let t=Ol(e),n=t[0],r=t[1];return!n&&!r?".":(r&&(r=r.slice(0,r.length-1)),n+r)}function Oy(e,t){let n=Ol(e)[2];return t&&n.slice(t.length*-1)===t&&(n=n.slice(0,n.length-t.length)),n}Ge.basename=Oy;Ge.dirname=vy;Ge.isAbsolute=Dl;Ge.join=Ry;Ge.normalizePath=Cl;Ge.relative=Ay;Ge.resolve=Ui});var Mi=g(jn=>{Object.defineProperty(jn,"__esModule",{value:!0});var Cy=ce(),Be;(function(e){e[e.PENDING=0]="PENDING";let n=1;e[e.RESOLVED=n]="RESOLVED";let r=2;e[e.REJECTED=r]="REJECTED"})(Be||(Be={}));function Dy(e){return new Bn(t=>{t(e)})}function Ny(e){return new Bn((t,n)=>{n(e)})}var Bn=class e{constructor(t){e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this),e.prototype.__init4.call(this),this._state=Be.PENDING,this._handlers=[];try{t(this._resolve,this._reject)}catch(n){this._reject(n)}}then(t,n){return new e((r,s)=>{this._handlers.push([!1,o=>{if(!t)r(o);else try{r(t(o))}catch(i){s(i)}},o=>{if(!n)s(o);else try{r(n(o))}catch(i){s(i)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new e((n,r)=>{let s,o;return this.then(i=>{o=!1,s=i,t&&t()},i=>{o=!0,s=i,t&&t()}).then(()=>{if(o){r(s);return}n(s)})})}__init(){this._resolve=t=>{this._setResult(Be.RESOLVED,t)}}__init2(){this._reject=t=>{this._setResult(Be.REJECTED,t)}}__init3(){this._setResult=(t,n)=>{if(this._state===Be.PENDING){if(Cy.isThenable(n)){n.then(this._resolve,this._reject);return}this._state=t,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===Be.PENDING)return;let t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===Be.RESOLVED&&n[1](this._value),this._state===Be.REJECTED&&n[2](this._value),n[0]=!0)})}}};jn.SyncPromise=Bn;jn.rejectedSyncPromise=Ny;jn.resolvedSyncPromise=Dy});var wl=g(qi=>{Object.defineProperty(qi,"__esModule",{value:!0});var wy=Si(),Li=Mi();function ky(e){let t=[];function n(){return e===void 0||t.length<e}function r(i){return t.splice(t.indexOf(i),1)[0]}function s(i){if(!n())return Li.rejectedSyncPromise(new wy.SentryError("Not adding Promise because buffer limit was reached."));let a=i();return t.indexOf(a)===-1&&t.push(a),a.then(()=>r(a)).then(null,()=>r(a).then(null,()=>{})),a}function o(i){return new Li.SyncPromise((a,c)=>{let u=t.length;if(!u)return a(!0);let d=setTimeout(()=>{i&&i>0&&a(!1)},i);t.forEach(l=>{Li.resolvedSyncPromise(l).then(()=>{--u||(clearTimeout(d),a(!0))},c)})})}return{$:t,add:s,drain:o}}qi.makePromiseBuffer=ky});var Fi=g(Kt=>{Object.defineProperty(Kt,"__esModule",{value:!0});function xy(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}}function Py(e){return e.split(/[\?#]/,1)[0]}function Uy(e){return e.split(/\\?\//).filter(t=>t.length>0&&t!==",").length}function My(e){let{protocol:t,host:n,path:r}=e,s=n&&n.replace(/^.*@/,"[filtered]:[filtered]@").replace(":80","").replace(":443","")||"";return`${t?`${t}://`:""}${s}${r}`}Kt.getNumberOfUrlSegments=Uy;Kt.getSanitizedUrlString=My;Kt.parseUrl=xy;Kt.stripUrlQueryAndFragment=Py});var Pl=g(Wt=>{Object.defineProperty(Wt,"__esModule",{value:!0});var kl=ce(),Ly=Gn(),qy=Fi(),Fy={ip:!1,request:!0,transaction:!0,user:!0},Gy=["cookies","data","headers","method","query_string","url"],By=["id","username","email"];function jy(e,t,n){e&&((!e.metadata.source||e.metadata.source==="url")&&e.setName(...ls(t,{path:!0,method:!0})),e.setData("url",t.originalUrl||t.url),t.baseUrl&&e.setData("baseUrl",t.baseUrl),e.setData("query",xl(t,n)))}function ls(e,t={}){let n=e.method&&e.method.toUpperCase(),r="",s="url";t.customRoute||e.route?(r=t.customRoute||`${e.baseUrl||""}${e.route&&e.route.path}`,s="route"):(e.originalUrl||e.url)&&(r=qy.stripUrlQueryAndFragment(e.originalUrl||e.url||""));let o="";return t.method&&n&&(o+=n),t.method&&t.path&&(o+=" "),t.path&&r&&(o+=r),[o,s]}function $y(e,t){switch(t){case"path":return ls(e,{path:!0})[0];case"handler":return e.route&&e.route.stack&&e.route.stack[0]&&e.route.stack[0].name||"<anonymous>";default:return ls(e,{path:!0,method:!0})[0]}}function Hy(e,t){let n={};return(Array.isArray(t)?t:By).forEach(s=>{e&&s in e&&(n[s]=e[s])}),n}function Gi(e,t){let{include:n=Gy,deps:r}=t||{},s={},o=e.headers||{},i=e.method,a=e.hostname||e.host||o.host||"<no host>",c=e.protocol==="https"||e.socket&&e.socket.encrypted?"https":"http",u=e.originalUrl||e.url||"",d=`${c}://${a}${u}`;return n.forEach(l=>{switch(l){case"headers":{s.headers=o;break}case"method":{s.method=i;break}case"url":{s.url=d;break}case"cookies":{s.cookies=e.cookies||o.cookie&&r&&r.cookie&&r.cookie.parse(o.cookie)||{};break}case"query_string":{s.query_string=xl(e,r);break}case"data":{if(i==="GET"||i==="HEAD")break;e.body!==void 0&&(s.data=kl.isString(e.body)?e.body:JSON.stringify(Ly.normalize(e.body)));break}default:({}).hasOwnProperty.call(e,l)&&(s[l]=e[l])}}),s}function Yy(e,t,n){let r={...Fy,...n&&n.include};if(r.request){let s=Array.isArray(r.request)?Gi(t,{include:r.request,deps:n&&n.deps}):Gi(t,{deps:n&&n.deps});e.request={...e.request,...s}}if(r.user){let s=t.user&&kl.isPlainObject(t.user)?Hy(t.user,r.user):{};Object.keys(s).length&&(e.user={...e.user,...s})}if(r.ip){let s=t.ip||t.socket&&t.socket.remoteAddress;s&&(e.user={...e.user,ip_address:s})}return r.transaction&&!e.transaction&&(e.transaction=$y(t,r.transaction)),e}function xl(e,t){let n=e.originalUrl||e.url||"";if(n)return n.startsWith("/")&&(n=`http://dogs.are.great${n}`),e.query||typeof URL!==void 0&&new URL(n).search.replace("?","")||t&&t.url&&t.url.parse(n).query||void 0}Wt.addRequestDataToEvent=Yy;Wt.addRequestDataToTransaction=jy;Wt.extractPathForTransaction=ls;Wt.extractRequestData=Gi});var Ll=g($n=>{Object.defineProperty($n,"__esModule",{value:!0});var Ul=["fatal","error","warning","log","info","debug"];function Ky(e){return Ml(e)}function Ml(e){return e==="warn"?"warning":Ul.includes(e)?e:"log"}$n.severityFromString=Ky;$n.severityLevelFromString=Ml;$n.validSeverityLevels=Ul});var ji=g((ue,jl)=>{Object.defineProperty(ue,"__esModule",{value:!0});var Fl=xi(),Wy=Fe(),Gl=Wy.getGlobalObject(),Bi={nowSeconds:()=>Date.now()/1e3};function Vy(){let{performance:e}=Gl;if(!e||!e.now)return;let t=Date.now()-e.now();return{now:()=>e.now(),timeOrigin:t}}function zy(){try{return Fl.dynamicRequire(jl,"perf_hooks").performance}catch{return}}var ps=Fl.isNodeEnv()?zy():Vy(),ql=ps===void 0?Bi:{nowSeconds:()=>(ps.timeOrigin+ps.now())/1e3},Xy=Bi.nowSeconds.bind(Bi),Bl=ql.nowSeconds.bind(ql),Jy=Bl,Qy=ps!==void 0;ue._browserPerformanceTimeOriginMode=void 0;var Zy=(()=>{let{performance:e}=Gl;if(!e||!e.now){ue._browserPerformanceTimeOriginMode="none";return}let t=3600*1e3,n=e.now(),r=Date.now(),s=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,o=s<t,i=e.timing&&e.timing.navigationStart,c=typeof i=="number"?Math.abs(i+n-r):t,u=c<t;return o||u?s<=c?(ue._browserPerformanceTimeOriginMode="timeOrigin",e.timeOrigin):(ue._browserPerformanceTimeOriginMode="navigationStart",i):(ue._browserPerformanceTimeOriginMode="dateNow",r)})();ue.browserPerformanceTimeOrigin=Zy;ue.dateTimestampInSeconds=Xy;ue.timestampInSeconds=Bl;ue.timestampWithMs=Jy;ue.usingPerformanceAPI=Qy});var Hi=g(st=>{Object.defineProperty(st,"__esModule",{value:!0});var eS=ce(),tS=mt(),nS="baggage",$i="sentry-",Hl=/^sentry-/,Yl=8192;function rS(e){if(!eS.isString(e)&&!Array.isArray(e))return;let t={};if(Array.isArray(e))t=e.reduce((r,s)=>{let o=$l(s);return{...r,...o}},{});else{if(!e)return;t=$l(e)}let n=Object.entries(t).reduce((r,[s,o])=>{if(s.match(Hl)){let i=s.slice($i.length);r[i]=o}return r},{});if(Object.keys(n).length>0)return n}function sS(e){if(!e)return;let t=Object.entries(e).reduce((n,[r,s])=>(s&&(n[`${$i}${r}`]=s),n),{});return oS(t)}function $l(e){return e.split(",").map(t=>t.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((t,[n,r])=>(t[n]=r,t),{})}function oS(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],s)=>{let o=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,i=s===0?o:`${t},${o}`;return i.length>Yl?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&tS.logger.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):i},"")}st.BAGGAGE_HEADER_NAME=nS;st.MAX_BAGGAGE_STRING_LENGTH=Yl;st.SENTRY_BAGGAGE_KEY_PREFIX=$i;st.SENTRY_BAGGAGE_KEY_PREFIX_REGEX=Hl;st.baggageHeaderToDynamicSamplingContext=rS;st.dynamicSamplingContextToSentryBaggageHeader=sS});var Vl=g(Vt=>{Object.defineProperty(Vt,"__esModule",{value:!0});var iS=Hi(),fs=is(),Kl=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Wl(e){if(!e)return;let t=e.match(Kl);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 aS(e,t){let n=Wl(e),r=iS.baggageHeaderToDynamicSamplingContext(t),{traceId:s,parentSpanId:o,parentSampled:i}=n||{},a={traceId:s||fs.uuid4(),spanId:fs.uuid4().substring(16),sampled:i};return o&&(a.parentSpanId=o),r&&(a.dsc=r),{traceparentData:n,dynamicSamplingContext:r,propagationContext:a}}function cS(e=fs.uuid4(),t=fs.uuid4().substring(16),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}Vt.TRACEPARENT_REGEXP=Kl;Vt.extractTraceparentData=Wl;Vt.generateSentryTraceHeader=cS;Vt.tracingContextFromHeaders=aS});var Ki=g(de=>{Object.defineProperty(de,"__esModule",{value:!0});var uS=mi(),dS=Gn(),zl=tt();function lS(e,t=[]){return[e,t]}function pS(e,t){let[n,r]=e;return[n,[...r,t]]}function Xl(e,t){let n=e[1];for(let r of n){let s=r[0].type;if(t(r,s))return!0}return!1}function fS(e,t){return Xl(e,(n,r)=>t.includes(r))}function Yi(e,t){return(t||new TextEncoder).encode(e)}function gS(e,t){let[n,r]=e,s=JSON.stringify(n);function o(i){typeof s=="string"?s=typeof i=="string"?s+i:[Yi(s,t),i]:s.push(typeof i=="string"?Yi(i,t):i)}for(let i of r){let[a,c]=i;if(o(`
7
7
  ${JSON.stringify(a)}
8
- `),typeof c=="string"||c instanceof Uint8Array)i(c);else{let u;try{u=JSON.stringify(c)}catch{u=JSON.stringify(my.normalize(c))}i(u)}}return typeof s=="string"?s:by(s)}function by(t){let e=t.reduce((s,i)=>s+i.length,0),n=new Uint8Array(e),r=0;for(let s of t)n.set(s,r),r+=s.length;return n}function Iy(t,e,n){let r=typeof t=="string"?e.encode(t):t;function s(c){let u=r.subarray(0,c);return r=r.subarray(c+1),u}function i(){let c=r.indexOf(10);return c<0&&(c=r.length),JSON.parse(n.decode(s(c)))}let o=i(),a=[];for(;r.length;){let c=i(),u=typeof c.length=="number"?c.length:void 0;a.push([c,u?s(u):i()])}return[o,a]}function Ay(t,e){let n=typeof t.data=="string"?Do(t.data,e):t.data;return[bl.dropUndefinedKeys({type:"attachment",length:n.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType}),n]}var vy={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 Ry(t){return vy[t]}function Cy(t){if(!t||!t.sdk)return;let{name:e,version:n}=t.sdk;return{name:e,version:n}}function Oy(t,e,n,r){let s=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:hy.dsnToString(r)},...s&&{trace:bl.dropUndefinedKeys({...s})}}}ce.addItemToEnvelope=yy;ce.createAttachmentEnvelopeItem=Ay;ce.createEnvelope=Ey;ce.createEventEnvelopeHeaders=Oy;ce.envelopeContainsItemType=Sy;ce.envelopeItemTypeToDataCategory=Ry;ce.forEachEnvelopeItem=Il;ce.getSdkMetadataForEnvelopeHeader=Cy;ce.parseEnvelope=Iy;ce.serializeEnvelope=Ty});var Al=g(wo=>{Object.defineProperty(wo,"__esModule",{value:!0});var Dy=No(),Ny=Ro();function wy(t,e,n){let r=[{type:"client_report"},{timestamp:n||Ny.dateTimestampInSeconds(),discarded_events:t}];return Dy.createEnvelope(e?{dsn:e}:{},[r])}wo.createClientReportEnvelope=wy});var Ol=g(mt=>{Object.defineProperty(mt,"__esModule",{value:!0});var vl=60*1e3;function Rl(t,e=Date.now()){let n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${t}`);return isNaN(r)?vl:r-e}function Cl(t,e){return t[e]||t.all||0}function ky(t,e,n=Date.now()){return Cl(t,e)>n}function xy(t,{statusCode:e,headers:n},r=Date.now()){let s={...t},i=n&&n["x-sentry-rate-limits"],o=n&&n["retry-after"];if(i)for(let a of i.trim().split(",")){let[c,u]=a.split(":",2),d=parseInt(c,10),l=(isNaN(d)?60:d)*1e3;if(!u)s.all=r+l;else for(let p of u.split(";"))s[p]=r+l}else o?s.all=r+Rl(o,r):e===429&&(s.all=r+60*1e3);return s}mt.DEFAULT_RETRY_AFTER=vl;mt.disabledUntil=Cl;mt.isRateLimited=ky;mt.parseRetryAfterHeader=Rl;mt.updateRateLimits=xy});var wl=g(ko=>{Object.defineProperty(ko,"__esModule",{value:!0});function Dl(t,e,n){let r=e.match(/([a-z_]+)\.(.*)/i);if(r===null)t[e]=n;else{let s=t[r[1]];Dl(s,r[2],n)}}function Py(t,e,n={}){return Array.isArray(e)?Nl(t,e,n):My(t,e,n)}function Nl(t,e,n){let r=e.find(s=>s.name===t.name);if(r){for(let[s,i]of Object.entries(n))Dl(r,s,i);return e}return[...e,t]}function My(t,e,n){return s=>{let i=e(s);return t.allowExclusionByUser&&!i.find(a=>a.name===t.name)?i:Nl(t,i,n)}}ko.addOrUpdateIntegration=Py});var kl=g(xo=>{Object.defineProperty(xo,"__esModule",{value:!0});function Uy(t){let e=[],n={};return{add(r,s){for(;e.length>=t;){let i=e.shift();i!==void 0&&delete n[i]}n[r]&&this.delete(r),e.push(r),n[r]=s},clear(){n={},e=[]},get(r){return n[r]},size(){return e.length},delete(r){if(!n[r])return!1;delete n[r];for(let s=0;s<e.length;s++)if(e[s]===r){e.splice(s,1);break}return!0}}}xo.makeFifoCache=Uy});var Ul=g(Wt=>{Object.defineProperty(Wt,"__esModule",{value:!0});var xl=oe(),Pl=Jr(),Ly=Mn(),qy=Qe();function Po(t,e){return t(e.stack||"",1)}function Ml(t,e){let n={type:e.name||e.constructor.name,value:e.message},r=Po(t,e);return r.length&&(n.stacktrace={frames:r}),n}function Fy(t){if("name"in t&&typeof t.name=="string"){let e=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(e+=` with message '${t.message}'`),e}else return"message"in t&&typeof t.message=="string"?t.message:`Object captured as exception with keys: ${qy.extractExceptionKeysForMessage(t)}`}function Gy(t,e,n,r){let s=n,o=r&&r.data&&r.data.mechanism||{handled:!0,type:"generic"};if(!xl.isError(n)){if(xl.isPlainObject(n)){let c=t(),u=c.getClient(),d=u&&u.getOptions().normalizeDepth;c.configureScope(p=>{p.setExtra("__serialized__",Ly.normalizeToSize(n,d))});let l=Fy(n);s=r&&r.syntheticException||new Error(l),s.message=l}else s=r&&r.syntheticException||new Error(n),s.message=n;o.synthetic=!0}let a={exception:{values:[Ml(e,s)]}};return Pl.addExceptionTypeValue(a,void 0,void 0),Pl.addExceptionMechanism(a,o),{...a,event_id:r&&r.event_id}}function By(t,e,n="info",r,s){let i={event_id:r&&r.event_id,level:n,message:e};if(s&&r&&r.syntheticException){let o=Po(t,r.syntheticException);o.length&&(i.exception={values:[{value:e,stacktrace:{frames:o}}]})}return i}Wt.eventFromMessage=By;Wt.eventFromUnknownInput=Gy;Wt.exceptionFromError=Ml;Wt.parseStackFrames=Po});var Ll=g(is=>{Object.defineProperty(is,"__esModule",{value:!0});var $y=Qe(),jy=Nn(),Hy=Hr();function Yy(t,e,n,r){let s=t(),i=!1,o=!0;return setInterval(()=>{let a=s.getTimeMs();i===!1&&a>e+n&&(i=!0,o&&r()),a<e+n&&(i=!1)},20),{poll:()=>{s.reset()},enabled:a=>{o=a}}}function Ky(t,e,n){let r=e?e.replace(/^file:\/\//,""):void 0,s=t.location.columnNumber?t.location.columnNumber+1:void 0,i=t.location.lineNumber?t.location.lineNumber+1:void 0;return $y.dropUndefinedKeys({filename:r,module:n(r),function:t.functionName||"?",colno:s,lineno:i,in_app:r?Hy.filenameIsInApp(r):void 0})}function Wy(t,e,n){let r=new Map;return s=>{if(s.method==="Debugger.scriptParsed")r.set(s.params.scriptId,s.params.url);else if(s.method==="Debugger.paused"){let i=[...s.params.callFrames];t("Debugger.resume"),t("Debugger.disable");let o=jy.stripSentryFramesAndReverse(i.map(a=>Ky(a,r.get(a.location.scriptId),e)));n(o)}}}is.createDebugPauseMessageHandler=Wy;is.watchdogTimer=Yy});var ql=g(Mo=>{Object.defineProperty(Mo,"__esModule",{value:!0});function Vy(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Mo.escapeStringForRegex=Vy});var T=g(_=>{Object.defineProperty(_,"__esModule",{value:!0});var zy=Id(),Uo=Xi(),Lo=eo(),Xy=ro(),qo=Ue(),Vt=Vd(),V=oe(),os=gt(),Jy=go(),nt=Jr(),Fo=mo(),Go=Mn(),Fe=Qe(),Et=rl(),Qy=sl(),as=al(),Bo=dl(),Fn=Nn(),Gn=Rn(),rt=co(),$o=So(),zt=Ro(),cs=Tl(),Fl=ho(),Ae=No(),Zy=Al(),Bn=Ol(),Xt=Oo(),us=Io(),eS=wl(),tS=kl(),ds=Ul(),Gl=Ll(),nS=Hr(),rS=ql(),sS=lo();_.applyAggregateErrorsToEvent=zy.applyAggregateErrorsToEvent;_.getDomElement=Uo.getDomElement;_.getLocationHref=Uo.getLocationHref;_.htmlTreeAsString=Uo.htmlTreeAsString;_.dsnFromString=Lo.dsnFromString;_.dsnToString=Lo.dsnToString;_.makeDsn=Lo.makeDsn;_.SentryError=Xy.SentryError;_.GLOBAL_OBJ=qo.GLOBAL_OBJ;_.getGlobalObject=qo.getGlobalObject;_.getGlobalSingleton=qo.getGlobalSingleton;_.SENTRY_XHR_DATA_KEY=Vt.SENTRY_XHR_DATA_KEY;_.addInstrumentationHandler=Vt.addInstrumentationHandler;_.instrumentDOM=Vt.instrumentDOM;_.instrumentXHR=Vt.instrumentXHR;_.parseFetchArgs=Vt.parseFetchArgs;_.resetInstrumentationHandlers=Vt.resetInstrumentationHandlers;_.isDOMError=V.isDOMError;_.isDOMException=V.isDOMException;_.isElement=V.isElement;_.isError=V.isError;_.isErrorEvent=V.isErrorEvent;_.isEvent=V.isEvent;_.isInstanceOf=V.isInstanceOf;_.isNaN=V.isNaN;_.isPlainObject=V.isPlainObject;_.isPrimitive=V.isPrimitive;_.isRegExp=V.isRegExp;_.isString=V.isString;_.isSyntheticEvent=V.isSyntheticEvent;_.isThenable=V.isThenable;_.isVueViewModel=V.isVueViewModel;_.CONSOLE_LEVELS=os.CONSOLE_LEVELS;_.consoleSandbox=os.consoleSandbox;_.logger=os.logger;_.originalConsoleMethods=os.originalConsoleMethods;_.memoBuilder=Jy.memoBuilder;_.addContextToFrame=nt.addContextToFrame;_.addExceptionMechanism=nt.addExceptionMechanism;_.addExceptionTypeValue=nt.addExceptionTypeValue;_.arrayify=nt.arrayify;_.checkOrSetAlreadyCaught=nt.checkOrSetAlreadyCaught;_.getEventDescription=nt.getEventDescription;_.parseSemver=nt.parseSemver;_.uuid4=nt.uuid4;_.dynamicRequire=Fo.dynamicRequire;_.isNodeEnv=Fo.isNodeEnv;_.loadModule=Fo.loadModule;_.normalize=Go.normalize;_.normalizeToSize=Go.normalizeToSize;_.walk=Go.walk;_.addNonEnumerableProperty=Fe.addNonEnumerableProperty;_.convertToPlainObject=Fe.convertToPlainObject;_.dropUndefinedKeys=Fe.dropUndefinedKeys;_.extractExceptionKeysForMessage=Fe.extractExceptionKeysForMessage;_.fill=Fe.fill;_.getOriginalFunction=Fe.getOriginalFunction;_.markFunctionWrapped=Fe.markFunctionWrapped;_.objectify=Fe.objectify;_.urlEncode=Fe.urlEncode;_.basename=Et.basename;_.dirname=Et.dirname;_.isAbsolute=Et.isAbsolute;_.join=Et.join;_.normalizePath=Et.normalizePath;_.relative=Et.relative;_.resolve=Et.resolve;_.makePromiseBuffer=Qy.makePromiseBuffer;_.addRequestDataToEvent=as.addRequestDataToEvent;_.addRequestDataToTransaction=as.addRequestDataToTransaction;_.extractPathForTransaction=as.extractPathForTransaction;_.extractRequestData=as.extractRequestData;_.severityFromString=Bo.severityFromString;_.severityLevelFromString=Bo.severityLevelFromString;_.validSeverityLevels=Bo.validSeverityLevels;_.createStackParser=Fn.createStackParser;_.getFunctionName=Fn.getFunctionName;_.nodeStackLineParser=Fn.nodeStackLineParser;_.stackParserFromStackParserOptions=Fn.stackParserFromStackParserOptions;_.stripSentryFramesAndReverse=Fn.stripSentryFramesAndReverse;_.isMatchingPattern=Gn.isMatchingPattern;_.safeJoin=Gn.safeJoin;_.snipLine=Gn.snipLine;_.stringMatchesSomePattern=Gn.stringMatchesSomePattern;_.truncate=Gn.truncate;_.isNativeFetch=rt.isNativeFetch;_.supportsDOMError=rt.supportsDOMError;_.supportsDOMException=rt.supportsDOMException;_.supportsErrorEvent=rt.supportsErrorEvent;_.supportsFetch=rt.supportsFetch;_.supportsNativeFetch=rt.supportsNativeFetch;_.supportsReferrerPolicy=rt.supportsReferrerPolicy;_.supportsReportingObserver=rt.supportsReportingObserver;_.SyncPromise=$o.SyncPromise;_.rejectedSyncPromise=$o.rejectedSyncPromise;_.resolvedSyncPromise=$o.resolvedSyncPromise;Object.defineProperty(_,"_browserPerformanceTimeOriginMode",{enumerable:!0,get:()=>zt._browserPerformanceTimeOriginMode});_.browserPerformanceTimeOrigin=zt.browserPerformanceTimeOrigin;_.dateTimestampInSeconds=zt.dateTimestampInSeconds;_.timestampInSeconds=zt.timestampInSeconds;_.timestampWithMs=zt.timestampWithMs;_.usingPerformanceAPI=zt.usingPerformanceAPI;_.TRACEPARENT_REGEXP=cs.TRACEPARENT_REGEXP;_.extractTraceparentData=cs.extractTraceparentData;_.generateSentryTraceHeader=cs.generateSentryTraceHeader;_.tracingContextFromHeaders=cs.tracingContextFromHeaders;_.getSDKSource=Fl.getSDKSource;_.isBrowserBundle=Fl.isBrowserBundle;_.addItemToEnvelope=Ae.addItemToEnvelope;_.createAttachmentEnvelopeItem=Ae.createAttachmentEnvelopeItem;_.createEnvelope=Ae.createEnvelope;_.createEventEnvelopeHeaders=Ae.createEventEnvelopeHeaders;_.envelopeContainsItemType=Ae.envelopeContainsItemType;_.envelopeItemTypeToDataCategory=Ae.envelopeItemTypeToDataCategory;_.forEachEnvelopeItem=Ae.forEachEnvelopeItem;_.getSdkMetadataForEnvelopeHeader=Ae.getSdkMetadataForEnvelopeHeader;_.parseEnvelope=Ae.parseEnvelope;_.serializeEnvelope=Ae.serializeEnvelope;_.createClientReportEnvelope=Zy.createClientReportEnvelope;_.DEFAULT_RETRY_AFTER=Bn.DEFAULT_RETRY_AFTER;_.disabledUntil=Bn.disabledUntil;_.isRateLimited=Bn.isRateLimited;_.parseRetryAfterHeader=Bn.parseRetryAfterHeader;_.updateRateLimits=Bn.updateRateLimits;_.BAGGAGE_HEADER_NAME=Xt.BAGGAGE_HEADER_NAME;_.MAX_BAGGAGE_STRING_LENGTH=Xt.MAX_BAGGAGE_STRING_LENGTH;_.SENTRY_BAGGAGE_KEY_PREFIX=Xt.SENTRY_BAGGAGE_KEY_PREFIX;_.SENTRY_BAGGAGE_KEY_PREFIX_REGEX=Xt.SENTRY_BAGGAGE_KEY_PREFIX_REGEX;_.baggageHeaderToDynamicSamplingContext=Xt.baggageHeaderToDynamicSamplingContext;_.dynamicSamplingContextToSentryBaggageHeader=Xt.dynamicSamplingContextToSentryBaggageHeader;_.getNumberOfUrlSegments=us.getNumberOfUrlSegments;_.getSanitizedUrlString=us.getSanitizedUrlString;_.parseUrl=us.parseUrl;_.stripUrlQueryAndFragment=us.stripUrlQueryAndFragment;_.addOrUpdateIntegration=eS.addOrUpdateIntegration;_.makeFifoCache=tS.makeFifoCache;_.eventFromMessage=ds.eventFromMessage;_.eventFromUnknownInput=ds.eventFromUnknownInput;_.exceptionFromError=ds.exceptionFromError;_.parseStackFrames=ds.parseStackFrames;_.createDebugPauseMessageHandler=Gl.createDebugPauseMessageHandler;_.watchdogTimer=Gl.watchdogTimer;_.filenameIsInApp=nS.filenameIsInApp;_.escapeStringForRegex=rS.escapeStringForRegex;_.supportsHistory=sS.supportsHistory});var $n=g(jo=>{Object.defineProperty(jo,"__esModule",{value:!0});var iS="production";jo.DEFAULT_ENVIRONMENT=iS});var Hn=g(jn=>{Object.defineProperty(jn,"__esModule",{value:!0});var ls=T();function Bl(){return ls.getGlobalSingleton("globalEventProcessors",()=>[])}function oS(t){Bl().push(t)}function Ho(t,e,n,r=0){return new ls.SyncPromise((s,i)=>{let o=t[r];if(e===null||typeof o!="function")s(e);else{let a=o({...e},n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&o.id&&a===null&&ls.logger.log(`Event processor "${o.id}" dropped event`),ls.isThenable(a)?a.then(c=>Ho(t,c,n,r+1).then(s)).then(null,i):Ho(t,a,n,r+1).then(s).then(null,i)}})}jn.addGlobalEventProcessor=oS;jn.getGlobalEventProcessors=Bl;jn.notifyEventProcessors=Ho});var Wn=g(Kn=>{Object.defineProperty(Kn,"__esModule",{value:!0});var Yn=T();function aS(t){let e=Yn.timestampInSeconds(),n={sid:Yn.uuid4(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>uS(n)};return t&&Yo(n,t),n}function Yo(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Yn.timestampInSeconds(),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:Yn.uuid4()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function cS(t,e){let n={};e?n={status:e}:t.status==="ok"&&(n={status:"exited"}),Yo(t,n)}function uS(t){return Yn.dropUndefinedKeys({sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}Kn.closeSession=cS;Kn.makeSession=aS;Kn.updateSession=Yo});var ps=g(Wo=>{Object.defineProperty(Wo,"__esModule",{value:!0});var Vn=T(),$l=Hn(),dS=Wn(),lS=100,Ko=class t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=jl()}static clone(e){let n=new t;return e&&(n._breadcrumbs=[...e._breadcrumbs],n._tags={...e._tags},n._extra={...e._extra},n._contexts={...e._contexts},n._user=e._user,n._level=e._level,n._span=e._span,n._session=e._session,n._transactionName=e._transactionName,n._fingerprint=e._fingerprint,n._eventProcessors=[...e._eventProcessors],n._requestSession=e._requestSession,n._attachments=[...e._attachments],n._sdkProcessingMetadata={...e._sdkProcessingMetadata},n._propagationContext={...e._propagationContext}),n}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&dS.updateSession(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={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},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,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,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 n=e(this);return n instanceof t?n:this}return e instanceof t?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...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)):Vn.isPlainObject(e)&&(e=e,this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...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=jl(),this}addBreadcrumb(e,n){let r=typeof n=="number"?n:lS;if(r<=0)return this;let s={timestamp:Vn.dateTimestampInSeconds(),...e},i=this._breadcrumbs;return i.push(s),this._breadcrumbs=i.length>r?i.slice(-r):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,n={},r){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts};let o=this._span.transaction;if(o){e.sdkProcessingMetadata={dynamicSamplingContext:o.getDynamicSamplingContext(),...e.sdkProcessingMetadata};let a=o.name;a&&(e.tags={transaction:a,...e.tags})}}this._applyFingerprint(e);let s=this._getBreadcrumbs(),i=[...e.breadcrumbs||[],...s];return e.breadcrumbs=i.length>0?i:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},$l.notifyEventProcessors([...r||[],...$l.getGlobalEventProcessors(),...this._eventProcessors],e,n)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...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?Vn.arrayify(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}};function jl(){return{traceId:Vn.uuid4(),spanId:Vn.uuid4().substring(16)}}Wo.Scope=Ko});var le=g(de=>{Object.defineProperty(de,"__esModule",{value:!0});var ue=T(),pS=$n(),zo=ps(),Vo=Wn(),fs=4,fS=100,Jt=class{constructor(e,n=new zo.Scope,r=fs){this._version=r,this._stack=[{scope:n}],e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){let n=this.getStackTop();n.client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){let e=zo.Scope.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 n=this.pushScope();try{e(n)}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,n){let r=this._lastEventId=n&&n.event_id?n.event_id:ue.uuid4(),s=new Error("Sentry syntheticException");return this._withClient((i,o)=>{i.captureException(e,{originalException:e,syntheticException:s,...n,event_id:r},o)}),r}captureMessage(e,n,r){let s=this._lastEventId=r&&r.event_id?r.event_id:ue.uuid4(),i=new Error(e);return this._withClient((o,a)=>{o.captureMessage(e,n,{originalException:e,syntheticException:i,...r,event_id:s},a)}),s}captureEvent(e,n){let r=n&&n.event_id?n.event_id:ue.uuid4();return e.type||(this._lastEventId=r),this._withClient((s,i)=>{s.captureEvent(e,{...n,event_id:r},i)}),r}lastEventId(){return this._lastEventId}addBreadcrumb(e,n){let{scope:r,client:s}=this.getStackTop();if(!s)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:o=fS}=s.getOptions&&s.getOptions()||{};if(o<=0)return;let c={timestamp:ue.dateTimestampInSeconds(),...e},u=i?ue.consoleSandbox(()=>i(c,n)):c;u!==null&&(s.emit&&s.emit("beforeAddBreadcrumb",u,n),r.addBreadcrumb(u,o))}setUser(e){this.getScope().setUser(e)}setTags(e){this.getScope().setTags(e)}setExtras(e){this.getScope().setExtras(e)}setTag(e,n){this.getScope().setTag(e,n)}setExtra(e,n){this.getScope().setExtra(e,n)}setContext(e,n){this.getScope().setContext(e,n)}configureScope(e){let{scope:n,client:r}=this.getStackTop();r&&e(n)}run(e){let n=Xo(this);try{e(this)}finally{Xo(n)}}getIntegration(e){let n=this.getClient();if(!n)return null;try{return n.getIntegration(e)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ue.logger.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,n){let r=this._callExtensionMethod("startTransaction",e,n);if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&!r){let s=this.getClient();console.warn(s?`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
8
+ `),typeof c=="string"||c instanceof Uint8Array)o(c);else{let u;try{u=JSON.stringify(c)}catch{u=JSON.stringify(dS.normalize(c))}o(u)}}return typeof s=="string"?s:_S(s)}function _S(e){let t=e.reduce((s,o)=>s+o.length,0),n=new Uint8Array(t),r=0;for(let s of e)n.set(s,r),r+=s.length;return n}function hS(e,t,n){let r=typeof e=="string"?t.encode(e):e;function s(c){let u=r.subarray(0,c);return r=r.subarray(c+1),u}function o(){let c=r.indexOf(10);return c<0&&(c=r.length),JSON.parse(n.decode(s(c)))}let i=o(),a=[];for(;r.length;){let c=o(),u=typeof c.length=="number"?c.length:void 0;a.push([c,u?s(u):o()])}return[i,a]}function mS(e,t){let n=typeof e.data=="string"?Yi(e.data,t):e.data;return[zl.dropUndefinedKeys({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}var ES={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 yS(e){return ES[e]}function SS(e){if(!e||!e.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function TS(e,t,n,r){let s=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:uS.dsnToString(r)},...s&&{trace:zl.dropUndefinedKeys({...s})}}}de.addItemToEnvelope=pS;de.createAttachmentEnvelopeItem=mS;de.createEnvelope=lS;de.createEventEnvelopeHeaders=TS;de.envelopeContainsItemType=fS;de.envelopeItemTypeToDataCategory=yS;de.forEachEnvelopeItem=Xl;de.getSdkMetadataForEnvelopeHeader=SS;de.parseEnvelope=hS;de.serializeEnvelope=gS});var Jl=g(Wi=>{Object.defineProperty(Wi,"__esModule",{value:!0});var bS=Ki(),IS=ji();function AS(e,t,n){let r=[{type:"client_report"},{timestamp:n||IS.dateTimestampInSeconds(),discarded_events:e}];return bS.createEnvelope(t?{dsn:t}:{},[r])}Wi.createClientReportEnvelope=AS});var tp=g(St=>{Object.defineProperty(St,"__esModule",{value:!0});var Ql=60*1e3;function Zl(e,t=Date.now()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?Ql:r-t}function ep(e,t){return e[t]||e.all||0}function RS(e,t,n=Date.now()){return ep(e,t)>n}function vS(e,{statusCode:t,headers:n},r=Date.now()){let s={...e},o=n&&n["x-sentry-rate-limits"],i=n&&n["retry-after"];if(o)for(let a of o.trim().split(",")){let[c,u]=a.split(":",2),d=parseInt(c,10),l=(isNaN(d)?60:d)*1e3;if(!u)s.all=r+l;else for(let p of u.split(";"))s[p]=r+l}else i?s.all=r+Zl(i,r):t===429&&(s.all=r+60*1e3);return s}St.DEFAULT_RETRY_AFTER=Ql;St.disabledUntil=ep;St.isRateLimited=RS;St.parseRetryAfterHeader=Zl;St.updateRateLimits=vS});var sp=g(Vi=>{Object.defineProperty(Vi,"__esModule",{value:!0});function np(e,t,n){let r=t.match(/([a-z_]+)\.(.*)/i);if(r===null)e[t]=n;else{let s=e[r[1]];np(s,r[2],n)}}function OS(e,t,n={}){return Array.isArray(t)?rp(e,t,n):CS(e,t,n)}function rp(e,t,n){let r=t.find(s=>s.name===e.name);if(r){for(let[s,o]of Object.entries(n))np(r,s,o);return t}return[...t,e]}function CS(e,t,n){return s=>{let o=t(s);return e.allowExclusionByUser&&!o.find(a=>a.name===e.name)?o:rp(e,o,n)}}Vi.addOrUpdateIntegration=OS});var op=g(zi=>{Object.defineProperty(zi,"__esModule",{value:!0});function DS(e){let t=[],n={};return{add(r,s){for(;t.length>=e;){let o=t.shift();o!==void 0&&delete n[o]}n[r]&&this.delete(r),t.push(r),n[r]=s},clear(){n={},t=[]},get(r){return n[r]},size(){return t.length},delete(r){if(!n[r])return!1;delete n[r];for(let s=0;s<t.length;s++)if(t[s]===r){t.splice(s,1);break}return!0}}}zi.makeFifoCache=DS});var up=g(zt=>{Object.defineProperty(zt,"__esModule",{value:!0});var ip=ce(),ap=is(),NS=Gn(),wS=tt();function Xi(e,t){return e(t.stack||"",1)}function cp(e,t){let n={type:t.name||t.constructor.name,value:t.message},r=Xi(e,t);return r.length&&(n.stacktrace={frames:r}),n}function kS(e){if("name"in e&&typeof e.name=="string"){let t=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(t+=` with message '${e.message}'`),t}else return"message"in e&&typeof e.message=="string"?e.message:`Object captured as exception with keys: ${wS.extractExceptionKeysForMessage(e)}`}function xS(e,t,n,r){let s=n,i=r&&r.data&&r.data.mechanism||{handled:!0,type:"generic"};if(!ip.isError(n)){if(ip.isPlainObject(n)){let c=e(),u=c.getClient(),d=u&&u.getOptions().normalizeDepth;c.configureScope(p=>{p.setExtra("__serialized__",NS.normalizeToSize(n,d))});let l=kS(n);s=r&&r.syntheticException||new Error(l),s.message=l}else s=r&&r.syntheticException||new Error(n),s.message=n;i.synthetic=!0}let a={exception:{values:[cp(t,s)]}};return ap.addExceptionTypeValue(a,void 0,void 0),ap.addExceptionMechanism(a,i),{...a,event_id:r&&r.event_id}}function PS(e,t,n="info",r,s){let o={event_id:r&&r.event_id,level:n,message:t};if(s&&r&&r.syntheticException){let i=Xi(e,r.syntheticException);i.length&&(o.exception={values:[{value:t,stacktrace:{frames:i}}]})}return o}zt.eventFromMessage=PS;zt.eventFromUnknownInput=xS;zt.exceptionFromError=cp;zt.parseStackFrames=Xi});var dp=g(gs=>{Object.defineProperty(gs,"__esModule",{value:!0});var US=tt(),MS=Un(),LS=Zr();function qS(e,t,n,r){let s=e(),o=!1,i=!0;return setInterval(()=>{let a=s.getTimeMs();o===!1&&a>t+n&&(o=!0,i&&r()),a<t+n&&(o=!1)},20),{poll:()=>{s.reset()},enabled:a=>{i=a}}}function FS(e,t,n){let r=t?t.replace(/^file:\/\//,""):void 0,s=e.location.columnNumber?e.location.columnNumber+1:void 0,o=e.location.lineNumber?e.location.lineNumber+1:void 0;return US.dropUndefinedKeys({filename:r,module:n(r),function:e.functionName||"?",colno:s,lineno:o,in_app:r?LS.filenameIsInApp(r):void 0})}function GS(e,t,n){let r=new Map;return s=>{if(s.method==="Debugger.scriptParsed")r.set(s.params.scriptId,s.params.url);else if(s.method==="Debugger.paused"){let o=[...s.params.callFrames];e("Debugger.resume"),e("Debugger.disable");let i=MS.stripSentryFramesAndReverse(o.map(a=>FS(a,r.get(a.location.scriptId),t)));n(i)}}}gs.createDebugPauseMessageHandler=GS;gs.watchdogTimer=qS});var lp=g(Ji=>{Object.defineProperty(Ji,"__esModule",{value:!0});function BS(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Ji.escapeStringForRegex=BS});var T=g(_=>{Object.defineProperty(_,"__esModule",{value:!0});var jS=Xd(),Qi=fi(),Zi=mi(),$S=Si(),ea=Fe(),Xt=Tl(),V=ce(),_s=mt(),HS=Ni(),ot=is(),ta=xi(),na=Gn(),je=tt(),Tt=Nl(),YS=wl(),hs=Pl(),ra=Ll(),Hn=Un(),Yn=wn(),it=Ri(),sa=Mi(),Jt=ji(),ms=Vl(),pp=ki(),Re=Ki(),KS=Jl(),Kn=tp(),Qt=Hi(),Es=Fi(),WS=sp(),VS=op(),ys=up(),fp=dp(),zS=Zr(),XS=lp(),JS=Oi();_.applyAggregateErrorsToEvent=jS.applyAggregateErrorsToEvent;_.getDomElement=Qi.getDomElement;_.getLocationHref=Qi.getLocationHref;_.htmlTreeAsString=Qi.htmlTreeAsString;_.dsnFromString=Zi.dsnFromString;_.dsnToString=Zi.dsnToString;_.makeDsn=Zi.makeDsn;_.SentryError=$S.SentryError;_.GLOBAL_OBJ=ea.GLOBAL_OBJ;_.getGlobalObject=ea.getGlobalObject;_.getGlobalSingleton=ea.getGlobalSingleton;_.SENTRY_XHR_DATA_KEY=Xt.SENTRY_XHR_DATA_KEY;_.addInstrumentationHandler=Xt.addInstrumentationHandler;_.instrumentDOM=Xt.instrumentDOM;_.instrumentXHR=Xt.instrumentXHR;_.parseFetchArgs=Xt.parseFetchArgs;_.resetInstrumentationHandlers=Xt.resetInstrumentationHandlers;_.isDOMError=V.isDOMError;_.isDOMException=V.isDOMException;_.isElement=V.isElement;_.isError=V.isError;_.isErrorEvent=V.isErrorEvent;_.isEvent=V.isEvent;_.isInstanceOf=V.isInstanceOf;_.isNaN=V.isNaN;_.isPlainObject=V.isPlainObject;_.isPrimitive=V.isPrimitive;_.isRegExp=V.isRegExp;_.isString=V.isString;_.isSyntheticEvent=V.isSyntheticEvent;_.isThenable=V.isThenable;_.isVueViewModel=V.isVueViewModel;_.CONSOLE_LEVELS=_s.CONSOLE_LEVELS;_.consoleSandbox=_s.consoleSandbox;_.logger=_s.logger;_.originalConsoleMethods=_s.originalConsoleMethods;_.memoBuilder=HS.memoBuilder;_.addContextToFrame=ot.addContextToFrame;_.addExceptionMechanism=ot.addExceptionMechanism;_.addExceptionTypeValue=ot.addExceptionTypeValue;_.arrayify=ot.arrayify;_.checkOrSetAlreadyCaught=ot.checkOrSetAlreadyCaught;_.getEventDescription=ot.getEventDescription;_.parseSemver=ot.parseSemver;_.uuid4=ot.uuid4;_.dynamicRequire=ta.dynamicRequire;_.isNodeEnv=ta.isNodeEnv;_.loadModule=ta.loadModule;_.normalize=na.normalize;_.normalizeToSize=na.normalizeToSize;_.walk=na.walk;_.addNonEnumerableProperty=je.addNonEnumerableProperty;_.convertToPlainObject=je.convertToPlainObject;_.dropUndefinedKeys=je.dropUndefinedKeys;_.extractExceptionKeysForMessage=je.extractExceptionKeysForMessage;_.fill=je.fill;_.getOriginalFunction=je.getOriginalFunction;_.markFunctionWrapped=je.markFunctionWrapped;_.objectify=je.objectify;_.urlEncode=je.urlEncode;_.basename=Tt.basename;_.dirname=Tt.dirname;_.isAbsolute=Tt.isAbsolute;_.join=Tt.join;_.normalizePath=Tt.normalizePath;_.relative=Tt.relative;_.resolve=Tt.resolve;_.makePromiseBuffer=YS.makePromiseBuffer;_.addRequestDataToEvent=hs.addRequestDataToEvent;_.addRequestDataToTransaction=hs.addRequestDataToTransaction;_.extractPathForTransaction=hs.extractPathForTransaction;_.extractRequestData=hs.extractRequestData;_.severityFromString=ra.severityFromString;_.severityLevelFromString=ra.severityLevelFromString;_.validSeverityLevels=ra.validSeverityLevels;_.createStackParser=Hn.createStackParser;_.getFunctionName=Hn.getFunctionName;_.nodeStackLineParser=Hn.nodeStackLineParser;_.stackParserFromStackParserOptions=Hn.stackParserFromStackParserOptions;_.stripSentryFramesAndReverse=Hn.stripSentryFramesAndReverse;_.isMatchingPattern=Yn.isMatchingPattern;_.safeJoin=Yn.safeJoin;_.snipLine=Yn.snipLine;_.stringMatchesSomePattern=Yn.stringMatchesSomePattern;_.truncate=Yn.truncate;_.isNativeFetch=it.isNativeFetch;_.supportsDOMError=it.supportsDOMError;_.supportsDOMException=it.supportsDOMException;_.supportsErrorEvent=it.supportsErrorEvent;_.supportsFetch=it.supportsFetch;_.supportsNativeFetch=it.supportsNativeFetch;_.supportsReferrerPolicy=it.supportsReferrerPolicy;_.supportsReportingObserver=it.supportsReportingObserver;_.SyncPromise=sa.SyncPromise;_.rejectedSyncPromise=sa.rejectedSyncPromise;_.resolvedSyncPromise=sa.resolvedSyncPromise;Object.defineProperty(_,"_browserPerformanceTimeOriginMode",{enumerable:!0,get:()=>Jt._browserPerformanceTimeOriginMode});_.browserPerformanceTimeOrigin=Jt.browserPerformanceTimeOrigin;_.dateTimestampInSeconds=Jt.dateTimestampInSeconds;_.timestampInSeconds=Jt.timestampInSeconds;_.timestampWithMs=Jt.timestampWithMs;_.usingPerformanceAPI=Jt.usingPerformanceAPI;_.TRACEPARENT_REGEXP=ms.TRACEPARENT_REGEXP;_.extractTraceparentData=ms.extractTraceparentData;_.generateSentryTraceHeader=ms.generateSentryTraceHeader;_.tracingContextFromHeaders=ms.tracingContextFromHeaders;_.getSDKSource=pp.getSDKSource;_.isBrowserBundle=pp.isBrowserBundle;_.addItemToEnvelope=Re.addItemToEnvelope;_.createAttachmentEnvelopeItem=Re.createAttachmentEnvelopeItem;_.createEnvelope=Re.createEnvelope;_.createEventEnvelopeHeaders=Re.createEventEnvelopeHeaders;_.envelopeContainsItemType=Re.envelopeContainsItemType;_.envelopeItemTypeToDataCategory=Re.envelopeItemTypeToDataCategory;_.forEachEnvelopeItem=Re.forEachEnvelopeItem;_.getSdkMetadataForEnvelopeHeader=Re.getSdkMetadataForEnvelopeHeader;_.parseEnvelope=Re.parseEnvelope;_.serializeEnvelope=Re.serializeEnvelope;_.createClientReportEnvelope=KS.createClientReportEnvelope;_.DEFAULT_RETRY_AFTER=Kn.DEFAULT_RETRY_AFTER;_.disabledUntil=Kn.disabledUntil;_.isRateLimited=Kn.isRateLimited;_.parseRetryAfterHeader=Kn.parseRetryAfterHeader;_.updateRateLimits=Kn.updateRateLimits;_.BAGGAGE_HEADER_NAME=Qt.BAGGAGE_HEADER_NAME;_.MAX_BAGGAGE_STRING_LENGTH=Qt.MAX_BAGGAGE_STRING_LENGTH;_.SENTRY_BAGGAGE_KEY_PREFIX=Qt.SENTRY_BAGGAGE_KEY_PREFIX;_.SENTRY_BAGGAGE_KEY_PREFIX_REGEX=Qt.SENTRY_BAGGAGE_KEY_PREFIX_REGEX;_.baggageHeaderToDynamicSamplingContext=Qt.baggageHeaderToDynamicSamplingContext;_.dynamicSamplingContextToSentryBaggageHeader=Qt.dynamicSamplingContextToSentryBaggageHeader;_.getNumberOfUrlSegments=Es.getNumberOfUrlSegments;_.getSanitizedUrlString=Es.getSanitizedUrlString;_.parseUrl=Es.parseUrl;_.stripUrlQueryAndFragment=Es.stripUrlQueryAndFragment;_.addOrUpdateIntegration=WS.addOrUpdateIntegration;_.makeFifoCache=VS.makeFifoCache;_.eventFromMessage=ys.eventFromMessage;_.eventFromUnknownInput=ys.eventFromUnknownInput;_.exceptionFromError=ys.exceptionFromError;_.parseStackFrames=ys.parseStackFrames;_.createDebugPauseMessageHandler=fp.createDebugPauseMessageHandler;_.watchdogTimer=fp.watchdogTimer;_.filenameIsInApp=zS.filenameIsInApp;_.escapeStringForRegex=XS.escapeStringForRegex;_.supportsHistory=JS.supportsHistory});var Wn=g(oa=>{Object.defineProperty(oa,"__esModule",{value:!0});var QS="production";oa.DEFAULT_ENVIRONMENT=QS});var zn=g(Vn=>{Object.defineProperty(Vn,"__esModule",{value:!0});var Ss=T();function gp(){return Ss.getGlobalSingleton("globalEventProcessors",()=>[])}function ZS(e){gp().push(e)}function ia(e,t,n,r=0){return new Ss.SyncPromise((s,o)=>{let i=e[r];if(t===null||typeof i!="function")s(t);else{let a=i({...t},n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&i.id&&a===null&&Ss.logger.log(`Event processor "${i.id}" dropped event`),Ss.isThenable(a)?a.then(c=>ia(e,c,n,r+1).then(s)).then(null,o):ia(e,a,n,r+1).then(s).then(null,o)}})}Vn.addGlobalEventProcessor=ZS;Vn.getGlobalEventProcessors=gp;Vn.notifyEventProcessors=ia});var Qn=g(Jn=>{Object.defineProperty(Jn,"__esModule",{value:!0});var Xn=T();function eT(e){let t=Xn.timestampInSeconds(),n={sid:Xn.uuid4(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>nT(n)};return e&&aa(n,e),n}function aa(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||Xn.timestampInSeconds(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:Xn.uuid4()),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 tT(e,t){let n={};t?n={status:t}:e.status==="ok"&&(n={status:"exited"}),aa(e,n)}function nT(e){return Xn.dropUndefinedKeys({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}})}Jn.closeSession=tT;Jn.makeSession=eT;Jn.updateSession=aa});var Ts=g(ua=>{Object.defineProperty(ua,"__esModule",{value:!0});var Zn=T(),_p=zn(),rT=Qn(),sT=100,ca=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=hp()}static clone(t){let n=new e;return t&&(n._breadcrumbs=[...t._breadcrumbs],n._tags={...t._tags},n._extra={...t._extra},n._contexts={...t._contexts},n._user=t._user,n._level=t._level,n._span=t._span,n._session=t._session,n._transactionName=t._transactionName,n._fingerprint=t._fingerprint,n._eventProcessors=[...t._eventProcessors],n._requestSession=t._requestSession,n._attachments=[...t._attachments],n._sdkProcessingMetadata={...t._sdkProcessingMetadata},n._propagationContext={...t._propagationContext}),n}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{},this._session&&rT.updateSession(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this._tags={...this._tags,[t]:n},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSpan(t){return this._span=t,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){let t=this.getSpan();return t&&t.transaction}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;if(typeof t=="function"){let n=t(this);return n instanceof e?n:this}return t instanceof e?(this._tags={...this._tags,...t._tags},this._extra={...this._extra,...t._extra},this._contexts={...this._contexts,...t._contexts},t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession),t._propagationContext&&(this._propagationContext=t._propagationContext)):Zn.isPlainObject(t)&&(t=t,this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...this._contexts,...t.contexts},t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession),t.propagationContext&&(this._propagationContext=t.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=hp(),this}addBreadcrumb(t,n){let r=typeof n=="number"?n:sT;if(r<=0)return this;let s={timestamp:Zn.dateTimestampInSeconds(),...t},o=this._breadcrumbs;return o.push(s),this._breadcrumbs=o.length>r?o.slice(-r):o,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(t,n={},r){if(this._extra&&Object.keys(this._extra).length&&(t.extra={...this._extra,...t.extra}),this._tags&&Object.keys(this._tags).length&&(t.tags={...this._tags,...t.tags}),this._user&&Object.keys(this._user).length&&(t.user={...this._user,...t.user}),this._contexts&&Object.keys(this._contexts).length&&(t.contexts={...this._contexts,...t.contexts}),this._level&&(t.level=this._level),this._transactionName&&(t.transaction=this._transactionName),this._span){t.contexts={trace:this._span.getTraceContext(),...t.contexts};let i=this._span.transaction;if(i){t.sdkProcessingMetadata={dynamicSamplingContext:i.getDynamicSamplingContext(),...t.sdkProcessingMetadata};let a=i.name;a&&(t.tags={transaction:a,...t.tags})}}this._applyFingerprint(t);let s=this._getBreadcrumbs(),o=[...t.breadcrumbs||[],...s];return t.breadcrumbs=o.length>0?o:void 0,t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...this._sdkProcessingMetadata,propagationContext:this._propagationContext},_p.notifyEventProcessors([...r||[],..._p.getGlobalEventProcessors(),...this._eventProcessors],t,n)}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...t},this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}_getBreadcrumbs(){return this._breadcrumbs}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}_applyFingerprint(t){t.fingerprint=t.fingerprint?Zn.arrayify(t.fingerprint):[],this._fingerprint&&(t.fingerprint=t.fingerprint.concat(this._fingerprint)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}};function hp(){return{traceId:Zn.uuid4(),spanId:Zn.uuid4().substring(16)}}ua.Scope=ca});var fe=g(pe=>{Object.defineProperty(pe,"__esModule",{value:!0});var le=T(),oT=Wn(),la=Ts(),da=Qn(),bs=4,iT=100,Zt=class{constructor(t,n=new la.Scope,r=bs){this._version=r,this._stack=[{scope:n}],t&&this.bindClient(t)}isOlderThan(t){return this._version<t}bindClient(t){let n=this.getStackTop();n.client=t,t&&t.setupIntegrations&&t.setupIntegrations()}pushScope(){let t=la.Scope.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:t}),t}popScope(){return this.getStack().length<=1?!1:!!this.getStack().pop()}withScope(t){let n=this.pushScope();try{t(n)}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(t,n){let r=this._lastEventId=n&&n.event_id?n.event_id:le.uuid4(),s=new Error("Sentry syntheticException");return this._withClient((o,i)=>{o.captureException(t,{originalException:t,syntheticException:s,...n,event_id:r},i)}),r}captureMessage(t,n,r){let s=this._lastEventId=r&&r.event_id?r.event_id:le.uuid4(),o=new Error(t);return this._withClient((i,a)=>{i.captureMessage(t,n,{originalException:t,syntheticException:o,...r,event_id:s},a)}),s}captureEvent(t,n){let r=n&&n.event_id?n.event_id:le.uuid4();return t.type||(this._lastEventId=r),this._withClient((s,o)=>{s.captureEvent(t,{...n,event_id:r},o)}),r}lastEventId(){return this._lastEventId}addBreadcrumb(t,n){let{scope:r,client:s}=this.getStackTop();if(!s)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:i=iT}=s.getOptions&&s.getOptions()||{};if(i<=0)return;let c={timestamp:le.dateTimestampInSeconds(),...t},u=o?le.consoleSandbox(()=>o(c,n)):c;u!==null&&(s.emit&&s.emit("beforeAddBreadcrumb",u,n),r.addBreadcrumb(u,i))}setUser(t){this.getScope().setUser(t)}setTags(t){this.getScope().setTags(t)}setExtras(t){this.getScope().setExtras(t)}setTag(t,n){this.getScope().setTag(t,n)}setExtra(t,n){this.getScope().setExtra(t,n)}setContext(t,n){this.getScope().setContext(t,n)}configureScope(t){let{scope:n,client:r}=this.getStackTop();r&&t(n)}run(t){let n=pa(this);try{t(this)}finally{pa(n)}}getIntegration(t){let n=this.getClient();if(!n)return null;try{return n.getIntegration(t)}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&le.logger.warn(`Cannot retrieve integration ${t.id} from the current Hub`),null}}startTransaction(t,n){let r=this._callExtensionMethod("startTransaction",t,n);if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&!r){let s=this.getClient();console.warn(s?`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':
9
9
  Sentry.addTracingExtensions();
10
10
  Sentry.init({...});
11
- `:"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){let n=this.getStackTop().scope,r=n.getSession();r&&Vo.closeSession(r),this._sendSessionUpdate(),n.setSession()}startSession(e){let{scope:n,client:r}=this.getStackTop(),{release:s,environment:i=pS.DEFAULT_ENVIRONMENT}=r&&r.getOptions()||{},{userAgent:o}=ue.GLOBAL_OBJ.navigator||{},a=Vo.makeSession({release:s,environment:i,user:n.getUser(),...o&&{userAgent:o},...e}),c=n.getSession&&n.getSession();return c&&c.status==="ok"&&Vo.updateSession(c,{status:"exited"}),this.endSession(),n.setSession(a),a}shouldSendDefaultPii(){let e=this.getClient(),n=e&&e.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){let{scope:e,client:n}=this.getStackTop(),r=e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_withClient(e){let{scope:n,client:r}=this.getStackTop();r&&e(r,n)}_callExtensionMethod(e,...n){let s=yt().__SENTRY__;if(s&&s.extensions&&typeof s.extensions[e]=="function")return s.extensions[e].apply(this,n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ue.logger.warn(`Extension method ${e} couldn't be found, doing nothing.`)}};function yt(){return ue.GLOBAL_OBJ.__SENTRY__=ue.GLOBAL_OBJ.__SENTRY__||{extensions:{},hub:void 0},ue.GLOBAL_OBJ}function Xo(t){let e=yt(),n=zn(e);return gs(e,t),n}function gS(){let t=yt();if(t.__SENTRY__&&t.__SENTRY__.acs){let e=t.__SENTRY__.acs.getCurrentHub();if(e)return e}return Hl(t)}function Hl(t=yt()){return(!Yl(t)||zn(t).isOlderThan(fs))&&gs(t,new Jt),zn(t)}function _S(t,e=Hl()){if(!Yl(t)||zn(t).isOlderThan(fs)){let n=e.getStackTop();gs(t,new Jt(n.client,zo.Scope.clone(n.scope)))}}function hS(t){let e=yt();e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.acs=t}function mS(t,e={}){let n=yt();return n.__SENTRY__&&n.__SENTRY__.acs?n.__SENTRY__.acs.runWithAsyncContext(t,e):t()}function Yl(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function zn(t){return ue.getGlobalSingleton("hub",()=>new Jt,t)}function gs(t,e){if(!t)return!1;let n=t.__SENTRY__=t.__SENTRY__||{};return n.hub=e,!0}de.API_VERSION=fs;de.Hub=Jt;de.ensureHubOnCarrier=_S;de.getCurrentHub=gS;de.getHubFromCarrier=zn;de.getMainCarrier=yt;de.makeMain=Xo;de.runWithAsyncContext=mS;de.setAsyncContextStrategy=hS;de.setHubOnCarrier=gs});var _s=g(Qt=>{Object.defineProperty(Qt,"__esModule",{value:!0});var ES=le(),Jo=T();function yS(t){return(t||ES.getCurrentHub()).getScope().getTransaction()}Qt.TRACEPARENT_REGEXP=Jo.TRACEPARENT_REGEXP;Qt.extractTraceparentData=Jo.extractTraceparentData;Qt.stripUrlQueryAndFragment=Jo.stripUrlQueryAndFragment;Qt.getActiveTransaction=yS});var Wl=g(ea=>{Object.defineProperty(ea,"__esModule",{value:!0});var Qo=T(),SS=_s(),Kl=!1;function TS(){Kl||(Kl=!0,Qo.addInstrumentationHandler("error",Zo),Qo.addInstrumentationHandler("unhandledrejection",Zo))}function Zo(){let t=SS.getActiveTransaction();if(t){let e="internal_error";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Qo.logger.log(`[Tracing] Transaction: ${e} -> Global error occured`),t.setStatus(e)}}Zo.tag="sentry_tracingErrorCallback";ea.registerErrorInstrumentation=TS});var hs=g(Xn=>{Object.defineProperty(Xn,"__esModule",{value:!0});var ve=T(),ta=class{constructor(e=1e3){this._maxlen=e,this.spans=[]}add(e){this.spans.length>this._maxlen?e.spanRecorder=void 0:this.spans.push(e)}},na=class t{constructor(e={}){this.traceId=e.traceId||ve.uuid4(),this.spanId=e.spanId||ve.uuid4().substring(16),this.startTimestamp=e.startTimestamp||ve.timestampInSeconds(),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 n=new t({...e,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n),n.transaction=this.transaction,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&n.transaction){let r=e&&e.op||"< unknown op >",s=n.transaction.name||"< unknown name >",i=n.transaction.spanId,o=`[Tracing] Starting '${r}' span on transaction '${s}' (${i}).`;n.transaction.metadata.spanMetadata[n.spanId]={logMessage:o},ve.logger.log(o)}return n}setTag(e,n){return this.tags={...this.tags,[e]:n},this}setData(e,n){return this.data={...this.data,[e]:n},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 n=Vl(e);return n!=="unknown_error"&&this.setStatus(n),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:n}=this.transaction.metadata.spanMetadata[this.spanId];n&&ve.logger.log(n.replace("Starting","Finishing"))}this.endTimestamp=typeof e=="number"?e:ve.timestampInSeconds()}toTraceparent(){return ve.generateSentryTraceHeader(this.traceId,this.spanId,this.sampled)}toContext(){return ve.dropUndefinedKeys({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 ve.dropUndefinedKeys({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 ve.dropUndefinedKeys({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 Vl(t){if(t<400&&t>=100)return"ok";if(t>=400&&t<500)switch(t){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(t>=500&&t<600)switch(t){case 501:return"unimplemented";case 503:return"unavailable";case 504:return"deadline_exceeded";default:return"internal_error"}return"unknown_error"}Xn.Span=na;Xn.SpanRecorder=ta;Xn.spanStatusfromHttpCode=Vl});var Jn=g(ra=>{Object.defineProperty(ra,"__esModule",{value:!0});var bS=T(),IS=$n();function AS(t,e,n){let r=e.getOptions(),{publicKey:s}=e.getDsn()||{},{segment:i}=n&&n.getUser()||{},o=bS.dropUndefinedKeys({environment:r.environment||IS.DEFAULT_ENVIRONMENT,release:r.release,user_segment:i,public_key:s,trace_id:t});return e.emit&&e.emit("createDsc",o),o}ra.getDynamicSamplingContextFromClient=AS});var ms=g(ia=>{Object.defineProperty(ia,"__esModule",{value:!0});var Qn=T(),zl=le(),vS=Jn(),Xl=hs(),sa=class extends Xl.Span{constructor(e,n){super(e),delete this.description,this._measurements={},this._contexts={},this._hub=n||zl.getCurrentHub(),this._name=e.name||"",this.metadata={source:"custom",...e.metadata,spanMetadata:{}},this._trimEnd=e.trimEnd,this.transaction=this;let r=this.metadata.dynamicSamplingContext;r&&(this._frozenDynamicSamplingContext={...r})}get name(){return this._name}set name(e){this.setName(e)}setName(e,n="custom"){this._name=e,this.metadata.source=n}initSpanRecorder(e=1e3){this.spanRecorder||(this.spanRecorder=new Xl.SpanRecorder(e)),this.spanRecorder.add(this)}setContext(e,n){n===null?delete this._contexts[e]:this._contexts[e]=n}setMeasurement(e,n,r=""){this._measurements[e]={value:n,unit:r}}setMetadata(e){this.metadata={...this.metadata,...e}}finish(e){let n=this._finishTransaction(e);if(n)return this._hub.captureEvent(n)}toContext(){let e=super.toContext();return Qn.dropUndefinedKeys({...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||zl.getCurrentHub(),n=e.getClient();if(!n)return{};let r=e.getScope(),s=vS.getDynamicSamplingContextFromClient(this.traceId,n,r),i=this.metadata.sampleRate;i!==void 0&&(s.sample_rate=`${i}`);let o=this.metadata.source;return o&&o!=="url"&&(s.transaction=this.name),this.sampled!==void 0&&(s.sampled=String(this.sampled)),s}setHub(e){this._hub=e}_finishTransaction(e){if(this.endTimestamp!==void 0)return;this.name||((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Qn.logger.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(e);let n=this._hub.getClient();if(n&&n.emit&&n.emit("finishTransaction",this),this.sampled!==!0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Qn.logger.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),n&&n.recordDroppedEvent("sample_rate","transaction");return}let r=this.spanRecorder?this.spanRecorder.spans.filter(a=>a!==this&&a.endTimestamp):[];this._trimEnd&&r.length>0&&(this.endTimestamp=r.reduce((a,c)=>a.endTimestamp&&c.endTimestamp?a.endTimestamp>c.endTimestamp?a:c:a).endTimestamp);let s=this.metadata,i={contexts:{...this._contexts,trace:this.getTraceContext()},spans:r,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...s,dynamicSamplingContext:this.getDynamicSamplingContext()},...s.source&&{transaction_info:{source:s.source}}};return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Qn.logger.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),i.measurements=this._measurements),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Qn.logger.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),i}};ia.Transaction=sa});var aa=g(Zn=>{Object.defineProperty(Zn,"__esModule",{value:!0});var j=T(),RS=hs(),CS=ms(),Es={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},OS="finishReason",Zt=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"],ys=class extends RS.SpanRecorder{constructor(e,n,r,s){super(s),this._pushActivity=e,this._popActivity=n,this.transactionSpanId=r}add(e){e.spanId!==this.transactionSpanId&&(e.finish=n=>{e.endTimestamp=typeof n=="number"?n:j.timestampInSeconds(),this._popActivity(e.spanId)},e.endTimestamp===void 0&&this._pushActivity(e.spanId)),super.add(e)}},oa=class extends CS.Transaction{constructor(e,n,r=Es.idleTimeout,s=Es.finalTimeout,i=Es.heartbeatInterval,o=!1){super(e,n),this._idleHub=n,this._idleTimeout=r,this._finalTimeout=s,this._heartbeatInterval=i,this._onScope=o,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=Zt[4],o&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),n.configureScope(a=>a.setSpan(this))),this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=Zt[3],this.finish())},this._finalTimeout)}finish(e=j.timestampInSeconds()){if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setTag(OS,this._finishReason),this.spanRecorder){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] finishing IdleTransaction",new Date(e*1e3).toISOString(),this.op);for(let n of this._beforeFinishCallbacks)n(this,e);this.spanRecorder.spans=this.spanRecorder.spans.filter(n=>{if(n.spanId===this.spanId)return!0;n.endTimestamp||(n.endTimestamp=e,n.setStatus("cancelled"),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(n,void 0,2)));let r=n.startTimestamp<e,s=(this._finalTimeout+this._idleTimeout)/1e3,i=n.endTimestamp-this.startTimestamp<s;if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let o=JSON.stringify(n,void 0,2);r?i||j.logger.log("[Tracing] discarding Span since it finished after Transaction final timeout",o):j.logger.log("[Tracing] discarding Span since it happened after Transaction was finished",o)}return r&&i}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] No active IdleTransaction");if(this._onScope){let n=this._idleHub.getScope();n.getTransaction()===this&&n.setSpan(void 0)}return super.finish(e)}registerBeforeFinishCallback(e){this._beforeFinishCallbacks.push(e)}initSpanRecorder(e){if(!this.spanRecorder){let n=s=>{this._finished||this._pushActivity(s)},r=s=>{this._finished||this._popActivity(s)};this.spanRecorder=new ys(n,r,this.spanId,e),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(e,{restartOnChildSpanChange:n}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=n===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=Zt[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=Zt[1],this.finish(e))},this._idleTimeout)}_pushActivity(e){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log(`[Tracing] pushActivity: ${e}`),this.activities[e]=!0,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(e){if(this.activities[e]&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log(`[Tracing] popActivity ${e}`),delete this.activities[e],(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){let n=j.timestampInSeconds();this._idleTimeoutCanceledPermanently?(this._finishReason=Zt[5],this.finish(n)):this._restartIdleTimeout(n+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__)&&j.logger.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=Zt[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&j.logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}};Zn.IdleTransaction=oa;Zn.IdleTransactionSpanRecorder=ys;Zn.TRACING_DEFAULTS=Es});var Ss=g(ca=>{Object.defineProperty(ca,"__esModule",{value:!0});var DS=le();function NS(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=DS.getCurrentHub().getClient(),n=t||e&&e.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}ca.hasTracingEnabled=NS});var Jl=g(ua=>{Object.defineProperty(ua,"__esModule",{value:!0});var St=T(),wS=Ss();function kS(t,e,n){if(!wS.hasTracingEnabled(e))return t.sampled=!1,t;if(t.sampled!==void 0)return t.setMetadata({sampleRate:Number(t.sampled)}),t;let r;return typeof e.tracesSampler=="function"?(r=e.tracesSampler(n),t.setMetadata({sampleRate:Number(r)})):n.parentSampled!==void 0?r=n.parentSampled:typeof e.tracesSampleRate<"u"?(r=e.tracesSampleRate,t.setMetadata({sampleRate:Number(r)})):(r=1,t.setMetadata({sampleRate:r})),xS(r)?r?(t.sampled=Math.random()<r,t.sampled?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.log(`[Tracing] starting ${t.op} transaction - ${t.name}`),t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),t)):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),t.sampled=!1,t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)}function xS(t){return St.isNaN(t)||!(typeof t=="number"||typeof t=="boolean")?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(t)} of type ${JSON.stringify(typeof t)}.`),!1):t<0||t>1?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&St.logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${t}.`),!1):!0}ua.sampleTransaction=kS});var da=g(Ts=>{Object.defineProperty(Ts,"__esModule",{value:!0});var PS=T(),MS=le(),US=Wl(),LS=aa(),Ql=Jl(),qS=ms();function FS(){let e=this.getScope().getSpan();return e?{"sentry-trace":e.toTraceparent()}:{}}function GS(t,e){let n=this.getClient(),r=n&&n.getOptions()||{},s=r.instrumenter||"sentry",i=t.instrumenter||"sentry";s!==i&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&PS.logger.error(`A transaction was started with instrumenter=\`${i}\`, but the SDK is configured with the \`${s}\` instrumenter.
12
- The transaction will not be sampled. Please use the ${s} instrumentation to start transactions.`),t.sampled=!1);let o=new qS.Transaction(t,this);return o=Ql.sampleTransaction(o,r,{parentSampled:t.parentSampled,transactionContext:t,...e}),o.sampled&&o.initSpanRecorder(r._experiments&&r._experiments.maxSpans),n&&n.emit&&n.emit("startTransaction",o),o}function BS(t,e,n,r,s,i,o){let a=t.getClient(),c=a&&a.getOptions()||{},u=new LS.IdleTransaction(e,t,n,r,o,s);return u=Ql.sampleTransaction(u,c,{parentSampled:e.parentSampled,transactionContext:e,...i}),u.sampled&&u.initSpanRecorder(c._experiments&&c._experiments.maxSpans),a&&a.emit&&a.emit("startTransaction",u),u}function $S(){let t=MS.getMainCarrier();t.__SENTRY__&&(t.__SENTRY__.extensions=t.__SENTRY__.extensions||{},t.__SENTRY__.extensions.startTransaction||(t.__SENTRY__.extensions.startTransaction=GS),t.__SENTRY__.extensions.traceHeaders||(t.__SENTRY__.extensions.traceHeaders=FS),US.registerErrorInstrumentation())}Ts.addTracingExtensions=$S;Ts.startIdleTransaction=BS});var la=g(er=>{Object.defineProperty(er,"__esModule",{value:!0});er.SpanStatus=void 0;(function(t){t.Ok="ok";let n="deadline_exceeded";t.DeadlineExceeded=n;let r="unauthenticated";t.Unauthenticated=r;let s="permission_denied";t.PermissionDenied=s;let i="not_found";t.NotFound=i;let o="resource_exhausted";t.ResourceExhausted=o;let a="invalid_argument";t.InvalidArgument=a;let c="unimplemented";t.Unimplemented=c;let u="unavailable";t.Unavailable=u;let d="internal_error";t.InternalError=d;let l="unknown_error";t.UnknownError=l;let p="cancelled";t.Cancelled=p;let f="already_exists";t.AlreadyExists=f;let m="failed_precondition";t.FailedPrecondition=m;let E="aborted";t.Aborted=E;let b="out_of_range";t.OutOfRange=b;let v="data_loss";t.DataLoss=v})(er.SpanStatus||(er.SpanStatus={}))});var np=g(Ge=>{Object.defineProperty(Ge,"__esModule",{value:!0});var en=T(),tn=le(),Zl=Ss();function jS(t,e,n=()=>{}){let r=fa(t),s=tn.getCurrentHub(),i=s.getScope(),o=i.getSpan(),a=pa(s,o,r);i.setSpan(a);function c(){a&&a.finish(),s.getScope().setSpan(o)}let u;try{u=e(a)}catch(d){throw a&&a.setStatus("internal_error"),n(d),c(),d}return en.isThenable(u)?Promise.resolve(u).then(()=>{c()},d=>{a&&a.setStatus("internal_error"),n(d),c()}):c(),u}function ep(t,e){let n=fa(t),r=tn.getCurrentHub(),s=r.getScope(),i=s.getSpan(),o=pa(r,i,n);s.setSpan(o);function a(){o&&o.finish(),r.getScope().setSpan(i)}let c;try{c=e(o)}catch(u){throw o&&o.setStatus("internal_error"),a(),u}return en.isThenable(c)?Promise.resolve(c).then(()=>{a()},()=>{o&&o.setStatus("internal_error"),a()}):a(),c}var HS=ep;function YS(t,e){let n=fa(t),r=tn.getCurrentHub(),s=r.getScope(),i=s.getSpan(),o=pa(r,i,n);s.setSpan(o);function a(){o&&o.finish(),r.getScope().setSpan(i)}let c;try{c=e(o,a)}catch(u){throw o&&o.setStatus("internal_error"),u}return en.isThenable(c)&&Promise.resolve(c).then(void 0,()=>{o&&o.setStatus("internal_error")}),c}function KS(t){if(!Zl.hasTracingEnabled())return;let e={...t};e.name!==void 0&&e.description===void 0&&(e.description=e.name);let n=tn.getCurrentHub(),r=tp();return r?r.startChild(e):n.startTransaction(e)}function tp(){return tn.getCurrentHub().getScope().getSpan()}function WS({sentryTrace:t,baggage:e},n){let s=tn.getCurrentHub().getScope(),{traceparentData:i,dynamicSamplingContext:o,propagationContext:a}=en.tracingContextFromHeaders(t,e);s.setPropagationContext(a),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&i&&en.logger.log(`[Tracing] Continuing trace ${i.traceId}.`);let c={...i,metadata:en.dropUndefinedKeys({dynamicSamplingContext:i&&!o?{}:o})};return n(c)}function pa(t,e,n){if(Zl.hasTracingEnabled())return e?e.startChild(n):t.startTransaction(n)}function fa(t){let e={...t};return e.name!==void 0&&e.description===void 0&&(e.description=e.name),e}Ge.continueTrace=WS;Ge.getActiveSpan=tp;Ge.startActiveSpan=HS;Ge.startInactiveSpan=KS;Ge.startSpan=ep;Ge.startSpanManual=YS;Ge.trace=jS});var rp=g(ga=>{Object.defineProperty(ga,"__esModule",{value:!0});var VS=_s();function zS(t,e,n){let r=VS.getActiveTransaction();r&&r.setMeasurement(t,e,n)}ga.setMeasurement=zS});var sp=g(P=>{Object.defineProperty(P,"__esModule",{value:!0});var tr=T(),H=le();function XS(t,e){return H.getCurrentHub().captureException(t,{captureContext:e})}function JS(t,e){let n=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return H.getCurrentHub().captureMessage(t,n,r)}function QS(t,e){return H.getCurrentHub().captureEvent(t,e)}function ZS(t){H.getCurrentHub().configureScope(t)}function eT(t){H.getCurrentHub().addBreadcrumb(t)}function tT(t,e){H.getCurrentHub().setContext(t,e)}function nT(t){H.getCurrentHub().setExtras(t)}function rT(t,e){H.getCurrentHub().setExtra(t,e)}function sT(t){H.getCurrentHub().setTags(t)}function iT(t,e){H.getCurrentHub().setTag(t,e)}function oT(t){H.getCurrentHub().setUser(t)}function aT(t){H.getCurrentHub().withScope(t)}function cT(t,e){return H.getCurrentHub().startTransaction({...t},e)}function uT(t,e){let n=H.getCurrentHub(),r=n.getScope(),s=n.getClient();if(!s)(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&tr.logger.warn("Cannot capture check-in. No client defined.");else if(!s.captureCheckIn)(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&tr.logger.warn("Cannot capture check-in. Client does not support sending check-ins.");else return s.captureCheckIn(t,e,r);return tr.uuid4()}async function dT(t){let e=H.getCurrentHub().getClient();return e?e.flush(t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&tr.logger.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function lT(t){let e=H.getCurrentHub().getClient();return e?e.close(t):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&tr.logger.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function pT(){return H.getCurrentHub().lastEventId()}P.addBreadcrumb=eT;P.captureCheckIn=uT;P.captureEvent=QS;P.captureException=XS;P.captureMessage=JS;P.close=lT;P.configureScope=ZS;P.flush=dT;P.lastEventId=pT;P.setContext=tT;P.setExtra=rT;P.setExtras=nT;P.setTag=iT;P.setTags=sT;P.setUser=oT;P.startTransaction=cT;P.withScope=aT});var ma=g(ha=>{Object.defineProperty(ha,"__esModule",{value:!0});var fT=T(),gT=le(),_a=class{constructor(e,n){this._client=e,this.flushTimeout=60,this._pendingAggregates={},this._isEnabled=!0,this._intervalId=setInterval(()=>this.flush(),this.flushTimeout*1e3),this._sessionAttrs=n}flush(){let e=this.getSessionAggregates();e.aggregates.length!==0&&(this._pendingAggregates={},this._client.sendSession(e))}getSessionAggregates(){let e=Object.keys(this._pendingAggregates).map(r=>this._pendingAggregates[parseInt(r)]),n={attrs:this._sessionAttrs,aggregates:e};return fT.dropUndefinedKeys(n)}close(){clearInterval(this._intervalId),this._isEnabled=!1,this.flush()}incrementSessionStatusCount(){if(!this._isEnabled)return;let e=gT.getCurrentHub().getScope(),n=e.getRequestSession();n&&n.status&&(this._incrementSessionStatusCount(n.status,new Date),e.setRequestSession(void 0))}_incrementSessionStatusCount(e,n){let r=new Date(n).setSeconds(0,0);this._pendingAggregates[r]=this._pendingAggregates[r]||{};let s=this._pendingAggregates[r];switch(s.started||(s.started=new Date(r).toISOString()),e){case"errored":return s.errored=(s.errored||0)+1,s.errored;case"ok":return s.exited=(s.exited||0)+1,s.exited;default:return s.crashed=(s.crashed||0)+1,s.crashed}}};ha.SessionFlusher=_a});var Is=g(bs=>{Object.defineProperty(bs,"__esModule",{value:!0});var Ea=T(),_T="7";function ip(t){let e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function hT(t){return`${ip(t)}${t.projectId}/envelope/`}function mT(t,e){return Ea.urlEncode({sentry_key:t.publicKey,sentry_version:_T,...e&&{sentry_client:`${e.name}/${e.version}`}})}function ET(t,e={}){let n=typeof e=="string"?e:e.tunnel,r=typeof e=="string"||!e._metadata?void 0:e._metadata.sdk;return n||`${hT(t)}?${mT(t,r)}`}function yT(t,e){let n=Ea.makeDsn(t);if(!n)return"";let r=`${ip(n)}embed/error-page/`,s=`dsn=${Ea.dsnToString(n)}`;for(let i in e)if(i!=="dsn")if(i==="user"){let o=e.user;if(!o)continue;o.name&&(s+=`&name=${encodeURIComponent(o.name)}`),o.email&&(s+=`&email=${encodeURIComponent(o.email)}`)}else s+=`&${encodeURIComponent(i)}=${encodeURIComponent(e[i])}`;return`${r}?${s}`}bs.getEnvelopeEndpointWithUrlEncodedAuth=ET;bs.getReportDialogEndpoint=yT});var op=g(As=>{Object.defineProperty(As,"__esModule",{value:!0});var nn=T();function ST(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function TT(t,e,n,r){let s=nn.getSdkMetadataForEnvelopeHeader(n),i={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&e&&{dsn:nn.dsnToString(e)}},o="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return nn.createEnvelope(i,[o])}function bT(t,e,n,r){let s=nn.getSdkMetadataForEnvelopeHeader(n),i=t.type&&t.type!=="replay_event"?t.type:"event";ST(t,n&&n.sdk);let o=nn.createEventEnvelopeHeaders(t,s,r,e);delete t.sdkProcessingMetadata;let a=[{type:i},t];return nn.createEnvelope(o,[a])}As.createEventEnvelope=bT;As.createSessionEnvelope=TT});var Ta=g(Tt=>{Object.defineProperty(Tt,"__esModule",{value:!0});var Sa=T(),IT=Hn(),ap=le(),ya=[];function AT(t){let e={};return t.forEach(n=>{let{name:r}=n,s=e[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.keys(e).map(n=>e[n])}function vT(t){let e=t.defaultIntegrations||[],n=t.integrations;e.forEach(o=>{o.isDefaultInstance=!0});let r;Array.isArray(n)?r=[...e,...n]:typeof n=="function"?r=Sa.arrayify(n(e)):r=e;let s=AT(r),i=OT(s,o=>o.name==="Debug");if(i!==-1){let[o]=s.splice(i,1);s.push(o)}return s}function RT(t,e){let n={};return e.forEach(r=>{r&&cp(t,r,n)}),n}function cp(t,e,n){if(n[e.name]=e,ya.indexOf(e.name)===-1&&(e.setupOnce(IT.addGlobalEventProcessor,ap.getCurrentHub),ya.push(e.name)),t.on&&typeof e.preprocessEvent=="function"){let r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(s,i)=>r(s,i,t))}if(t.addEventProcessor&&typeof e.processEvent=="function"){let r=e.processEvent.bind(e),s=Object.assign((i,o)=>r(i,o,t),{id:e.name});t.addEventProcessor(s)}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Sa.logger.log(`Integration installed: ${e.name}`)}function CT(t){let e=ap.getCurrentHub().getClient();if(!e||!e.addIntegration){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Sa.logger.warn(`Cannot add integration "${t.name}" because no SDK Client is available.`);return}e.addIntegration(t)}function OT(t,e){for(let n=0;n<t.length;n++)if(e(t[n])===!0)return n;return-1}Tt.addIntegration=CT;Tt.getIntegrationsToSetup=vT;Tt.installedIntegrations=ya;Tt.setupIntegration=cp;Tt.setupIntegrations=RT});var ba=g(nr=>{Object.defineProperty(nr,"__esModule",{value:!0});var te=T(),DT=$n(),up=Hn(),NT=ps();function wT(t,e,n,r,s){let{normalizeDepth:i=3,normalizeMaxBreadth:o=1e3}=t,a={...e,event_id:e.event_id||n.event_id||te.uuid4(),timestamp:e.timestamp||te.dateTimestampInSeconds()},c=n.integrations||t.integrations.map(p=>p.name);kT(a,t),xT(a,c),e.type===void 0&&lp(a,t.stackParser);let u=r;n.captureContext&&(u=NT.Scope.clone(u).update(n.captureContext));let d=te.resolvedSyncPromise(a),l=s&&s.getEventProcessors?s.getEventProcessors():[];if(u){if(u.getAttachments){let p=[...n.attachments||[],...u.getAttachments()];p.length&&(n.attachments=p)}d=u.applyToEvent(a,n,l)}else d=up.notifyEventProcessors([...l,...up.getGlobalEventProcessors()],a,n);return d.then(p=>(p&&pp(p),typeof i=="number"&&i>0?PT(p,i,o):p))}function kT(t,e){let{environment:n,release:r,dist:s,maxValueLength:i=250}=e;"environment"in t||(t.environment="environment"in e?n:DT.DEFAULT_ENVIRONMENT),t.release===void 0&&r!==void 0&&(t.release=r),t.dist===void 0&&s!==void 0&&(t.dist=s),t.message&&(t.message=te.truncate(t.message,i));let o=t.exception&&t.exception.values&&t.exception.values[0];o&&o.value&&(o.value=te.truncate(o.value,i));let a=t.request;a&&a.url&&(a.url=te.truncate(a.url,i))}var dp=new WeakMap;function lp(t,e){let n=te.GLOBAL_OBJ._sentryDebugIds;if(!n)return;let r,s=dp.get(e);s?r=s:(r=new Map,dp.set(e,r));let i=Object.keys(n).reduce((o,a)=>{let c,u=r.get(a);u?c=u:(c=e(a),r.set(a,c));for(let d=c.length-1;d>=0;d--){let l=c[d];if(l.filename){o[l.filename]=n[a];break}}return o},{});try{t.exception.values.forEach(o=>{o.stacktrace.frames.forEach(a=>{a.filename&&(a.debug_id=i[a.filename])})})}catch{}}function pp(t){let e={};try{t.exception.values.forEach(r=>{r.stacktrace.frames.forEach(s=>{s.debug_id&&(s.abs_path?e[s.abs_path]=s.debug_id:s.filename&&(e[s.filename]=s.debug_id),delete s.debug_id)})})}catch{}if(Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];let n=t.debug_meta.images;Object.keys(e).forEach(r=>{n.push({type:"sourcemap",code_file:r,debug_id:e[r]})})}function xT(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function PT(t,e,n){if(!t)return null;let r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(s=>({...s,...s.data&&{data:te.normalize(s.data,e,n)}}))},...t.user&&{user:te.normalize(t.user,e,n)},...t.contexts&&{contexts:te.normalize(t.contexts,e,n)},...t.extra&&{extra:te.normalize(t.extra,e,n)}};return t.contexts&&t.contexts.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=te.normalize(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(s=>(s.data&&(s.data=te.normalize(s.data,e,n)),s))),r}nr.applyDebugIds=lp;nr.applyDebugMeta=pp;nr.prepareEvent=wT});var va=g(Aa=>{Object.defineProperty(Aa,"__esModule",{value:!0});var C=T(),MT=Is(),fp=op(),gp=Ta(),_p=Wn(),UT=Jn(),LT=ba(),hp="Not capturing exception because it's already been captured.",Ia=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=C.makeDsn(e.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.warn("No DSN provided, client will not send events."),this._dsn){let n=MT.getEnvelopeEndpointWithUrlEncodedAuth(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:n})}}captureException(e,n,r){if(C.checkOrSetAlreadyCaught(e)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.log(hp);return}let s=n&&n.event_id;return this._process(this.eventFromException(e,n).then(i=>this._captureEvent(i,n,r)).then(i=>{s=i})),s}captureMessage(e,n,r,s){let i=r&&r.event_id,o=C.isPrimitive(e)?this.eventFromMessage(String(e),n,r):this.eventFromException(e,r);return this._process(o.then(a=>this._captureEvent(a,r,s)).then(a=>{i=a})),i}captureEvent(e,n,r){if(n&&n.originalException&&C.checkOrSetAlreadyCaught(n.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.log(hp);return}let s=n&&n.event_id;return this._process(this._captureEvent(e,n,r).then(i=>{s=i})),s}captureSession(e){typeof e.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),_p.updateSession(e,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let n=this._transport;return n?this._isClientDoneProcessing(e).then(r=>n.flush(e).then(s=>r&&s)):C.resolvedSyncPromise(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}setupIntegrations(e){(e&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&(this._integrations=gp.setupIntegrations(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__)&&C.logger.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}addIntegration(e){gp.setupIntegration(this,e,this._integrations)}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=fp.createEventEnvelope(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of n.attachments||[])r=C.addItemToEnvelope(r,C.createAttachmentEnvelopeItem(i,this._options.transportOptions&&this._options.transportOptions.textEncoder));let s=this._sendEnvelope(r);s&&s.then(i=>this.emit("afterSendEvent",e,i),null)}sendSession(e){let n=fp.createSessionEnvelope(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}recordDroppedEvent(e,n,r){if(this._options.sendClientReports){let s=`${e}:${n}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.log(`Adding outcome: "${s}"`),this._outcomes[s]=this._outcomes[s]+1||1}}on(e,n){this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(n)}emit(e,...n){this._hooks[e]&&this._hooks[e].forEach(r=>r(...n))}_updateSessionFromEvent(e,n){let r=!1,s=!1,i=n.exception&&n.exception.values;if(i){s=!0;for(let c of i){let u=c.mechanism;if(u&&u.handled===!1){r=!0;break}}}let o=e.status==="ok";(o&&e.errors===0||o&&r)&&(_p.updateSession(e,{...r&&{status:"crashed"},errors:e.errors||Number(s||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new C.SyncPromise(n=>{let r=0,s=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),n(!0)):(r+=s,e&&r>=e&&(clearInterval(i),n(!1)))},s)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r){let s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i.length>0&&(n.integrations=i),this.emit("preprocessEvent",e,n),LT.prepareEvent(s,e,n,r,this).then(o=>{if(o===null)return o;let{propagationContext:a}=o.sdkProcessingMetadata||{};if(!(o.contexts&&o.contexts.trace)&&a){let{traceId:u,spanId:d,parentSpanId:l,dsc:p}=a;o.contexts={trace:{trace_id:u,span_id:d,parent_span_id:l},...o.contexts};let f=p||UT.getDynamicSamplingContextFromClient(u,this,r);o.sdkProcessingMetadata={dynamicSamplingContext:f,...o.sdkProcessingMetadata}}return o})}_captureEvent(e,n={},r){return this._processEvent(e,n,r).then(s=>s.event_id,s=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let i=s;i.logLevel==="log"?C.logger.log(i.message):C.logger.warn(i)}})}_processEvent(e,n,r){let s=this.getOptions(),{sampleRate:i}=s,o=Ep(e),a=mp(e),c=e.type||"error",u=`before send for type \`${c}\``;if(a&&typeof i=="number"&&Math.random()>i)return this.recordDroppedEvent("sample_rate","error",e),C.rejectedSyncPromise(new C.SentryError(`Discarding event because it's not included in the random sample (sampling rate = ${i})`,"log"));let d=c==="replay_event"?"replay":c;return this._prepareEvent(e,n,r).then(l=>{if(l===null)throw this.recordDroppedEvent("event_processor",d,e),new C.SentryError("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return l;let f=FT(s,l,n);return qT(f,u)}).then(l=>{if(l===null)throw this.recordDroppedEvent("before_send",d,e),new C.SentryError(`${u} returned \`null\`, will not send event.`,"log");let p=r&&r.getSession();!o&&p&&this._updateSessionFromEvent(p,l);let f=l.transaction_info;if(o&&f&&l.transaction!==e.transaction){let m="custom";l.transaction_info={...f,source:m}}return this.sendEvent(l,n),l}).then(null,l=>{throw l instanceof C.SentryError?l:(this.captureException(l,{data:{__sentry__:!0},originalException:l}),new C.SentryError(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
13
- Reason: ${l}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)return this._transport.send(e).then(null,n=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.error("Error while sending event:",n)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&C.logger.error("Transport disabled")}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.keys(e).map(n=>{let[r,s]=n.split(":");return{reason:r,category:s,quantity:e[n]}})}};function qT(t,e){let n=`${e} must return \`null\` or a valid event.`;if(C.isThenable(t))return t.then(r=>{if(!C.isPlainObject(r)&&r!==null)throw new C.SentryError(n);return r},r=>{throw new C.SentryError(`${e} rejected with ${r}`)});if(!C.isPlainObject(t)&&t!==null)throw new C.SentryError(n);return t}function FT(t,e,n){let{beforeSend:r,beforeSendTransaction:s}=t;return mp(e)&&r?r(e,n):Ep(e)&&s?s(e,n):e}function mp(t){return t.type===void 0}function Ep(t){return t.type==="transaction"}Aa.BaseClient=Ia});var Oa=g(Ca=>{Object.defineProperty(Ca,"__esModule",{value:!0});var Ra=T();function GT(t,e,n,r,s){let i={sent_at:new Date().toISOString()};n&&n.sdk&&(i.sdk={name:n.sdk.name,version:n.sdk.version}),r&&s&&(i.dsn=Ra.dsnToString(s)),e&&(i.trace=Ra.dropUndefinedKeys(e));let o=BT(t);return Ra.createEnvelope(i,[o])}function BT(t){return[{type:"check_in"},t]}Ca.createCheckInEnvelope=GT});var yp=g(Na=>{Object.defineProperty(Na,"__esModule",{value:!0});var Be=T(),$T=va(),jT=Oa(),HT=le(),YT=ma(),KT=da(),WT=Jn();la();var Da=class extends $T.BaseClient{constructor(e){KT.addTracingExtensions(),super(e)}eventFromException(e,n){return Be.resolvedSyncPromise(Be.eventFromUnknownInput(HT.getCurrentHub,this._options.stackParser,e,n))}eventFromMessage(e,n="info",r){return Be.resolvedSyncPromise(Be.eventFromMessage(this._options.stackParser,e,n,r,this._options.attachStacktrace))}captureException(e,n,r){if(this._options.autoSessionTracking&&this._sessionFlusher&&r){let s=r.getRequestSession();s&&s.status==="ok"&&(s.status="errored")}return super.captureException(e,n,r)}captureEvent(e,n,r){if(this._options.autoSessionTracking&&this._sessionFlusher&&r&&(e.type||"exception")==="exception"&&e.exception&&e.exception.values&&e.exception.values.length>0){let o=r.getRequestSession();o&&o.status==="ok"&&(o.status="errored")}return super.captureEvent(e,n,r)}close(e){return this._sessionFlusher&&this._sessionFlusher.close(),super.close(e)}initSessionFlusher(){let{release:e,environment:n}=this._options;e?this._sessionFlusher=new YT.SessionFlusher(this,{release:e,environment:n}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Be.logger.warn("Cannot initialise an instance of SessionFlusher if no release is provided!")}captureCheckIn(e,n,r){let s=e.status!=="in_progress"&&e.checkInId?e.checkInId:Be.uuid4();if(!this._isEnabled())return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Be.logger.warn("SDK not enabled, will not capture checkin."),s;let i=this.getOptions(),{release:o,environment:a,tunnel:c}=i,u={check_in_id:s,monitor_slug:e.monitorSlug,status:e.status,release:o,environment:a};e.status!=="in_progress"&&(u.duration=e.duration),n&&(u.monitor_config={schedule:n.schedule,checkin_margin:n.checkinMargin,max_runtime:n.maxRuntime,timezone:n.timezone});let[d,l]=this._getTraceInfoFromScope(r);l&&(u.contexts={trace:l});let p=jT.createCheckInEnvelope(u,d,this.getSdkMetadata(),c,this.getDsn());return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Be.logger.info("Sending checkin:",e.monitorSlug,e.status),this._sendEnvelope(p),s}_captureRequestSession(){this._sessionFlusher?this._sessionFlusher.incrementSessionStatusCount():(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Be.logger.warn("Discarded request mode session because autoSessionTracking option was disabled")}_prepareEvent(e,n,r){return this._options.platform&&(e.platform=e.platform||this._options.platform),this._options.runtime&&(e.contexts={...e.contexts,runtime:(e.contexts||{}).runtime||this._options.runtime}),this._options.serverName&&(e.server_name=e.server_name||this._options.serverName),super._prepareEvent(e,n,r)}_getTraceInfoFromScope(e){if(!e)return[void 0,void 0];let n=e.getSpan();if(n)return[n.transaction?n.transaction.getDynamicSamplingContext():void 0,n.getTraceContext()];let{traceId:r,spanId:s,parentSpanId:i,dsc:o}=e.getPropagationContext(),a={trace_id:r,span_id:s,parent_span_id:i};return o?[o,a]:[WT.getDynamicSamplingContextFromClient(r,this,e),a]}};Na.ServerRuntimeClient=Da});var Sp=g(wa=>{Object.defineProperty(wa,"__esModule",{value:!0});var VT=T(),zT=le();function XT(t,e){e.debug===!0&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?VT.logger.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));let n=zT.getCurrentHub();n.getScope().update(e.initialScope);let s=new t(e);n.bindClient(s)}wa.initAndBind=XT});var Ip=g(vs=>{Object.defineProperty(vs,"__esModule",{value:!0});var Q=T(),bp=30;function JT(t,e,n=Q.makePromiseBuffer(t.bufferSize||bp)){let r={},s=o=>n.drain(o);function i(o){let a=[];if(Q.forEachEnvelopeItem(o,(l,p)=>{let f=Q.envelopeItemTypeToDataCategory(p);if(Q.isRateLimited(r,f)){let m=Tp(l,p);t.recordDroppedEvent("ratelimit_backoff",f,m)}else a.push(l)}),a.length===0)return Q.resolvedSyncPromise();let c=Q.createEnvelope(o[0],a),u=l=>{Q.forEachEnvelopeItem(c,(p,f)=>{let m=Tp(p,f);t.recordDroppedEvent(l,Q.envelopeItemTypeToDataCategory(f),m)})},d=()=>e({body:Q.serializeEnvelope(c,t.textEncoder)}).then(l=>(l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Q.logger.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=Q.updateRateLimits(r,l),l),l=>{throw u("network_error"),l});return n.add(d).then(l=>l,l=>{if(l instanceof Q.SentryError)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Q.logger.error("Skipped sending event because buffer is full."),u("queue_overflow"),Q.resolvedSyncPromise();throw l})}return i.__sentry__baseTransport__=!0,{send:i,flush:s}}function Tp(t,e){if(!(e!=="event"&&e!=="transaction"))return Array.isArray(t)?t[1]:void 0}vs.DEFAULT_TRANSPORT_BUFFER_SIZE=bp;vs.createTransport=JT});var vp=g(rr=>{Object.defineProperty(rr,"__esModule",{value:!0});var xa=T(),Ap=100,Pa=5e3,QT=36e5;function ka(t,e){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&xa.logger.info(`[Offline]: ${t}`,e)}function ZT(t){return e=>{let n=t(e),r=e.createStore?e.createStore(e):void 0,s=Pa,i;function o(d,l,p){return xa.envelopeContainsItemType(d,["replay_event","replay_recording","client_report"])?!1:e.shouldStore?e.shouldStore(d,l,p):!0}function a(d){r&&(i&&clearTimeout(i),i=setTimeout(async()=>{i=void 0;let l=await r.pop();l&&(ka("Attempting to send previously queued event"),u(l).catch(p=>{ka("Failed to retry sending",p)}))},d),typeof i!="number"&&i.unref&&i.unref())}function c(){i||(a(s),s=Math.min(s*2,QT))}async function u(d){try{let l=await n.send(d),p=Ap;if(l){if(l.headers&&l.headers["retry-after"])p=xa.parseRetryAfterHeader(l.headers["retry-after"]);else if((l.statusCode||0)>=400)return l}return a(p),s=Pa,l}catch(l){if(r&&await o(d,l,s))return await r.insert(d),c(),ka("Error sending. Event queued",l),{};throw l}}return e.flushAtStartup&&c(),{send:u,flush:d=>n.flush(d)}}}rr.MIN_DELAY=Ap;rr.START_DELAY=Pa;rr.makeOfflineTransport=ZT});var Cp=g(Rs=>{Object.defineProperty(Rs,"__esModule",{value:!0});var Rp=T(),eb=Is();function Ma(t,e){let n;return Rp.forEachEnvelopeItem(t,(r,s)=>(e.includes(s)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function tb(t,e){return n=>{let r=t(n);return{send:async s=>{let i=Ma(s,["event","transaction","profile","replay_event"]);return i&&(i.release=e),r.send(s)},flush:s=>r.flush(s)}}}function nb(t,e){return n=>{let r=t(n),s={};function i(c,u){let d=u?`${c}:${u}`:c;if(!s[d]){let l=Rp.dsnFromString(c);if(!l)return;let p=eb.getEnvelopeEndpointWithUrlEncodedAuth(l);s[d]=u?tb(t,u)({...n,url:p}):t({...n,url:p})}return s[d]}async function o(c){function u(p){let f=p&&p.length?p:["event"];return Ma(c,f)}let d=e({envelope:c,getEvent:u}).map(p=>typeof p=="string"?i(p,void 0):i(p.dsn,p.release)).filter(p=>!!p);return d.length===0&&d.push(r),(await Promise.all(d.map(p=>p.send(c))))[0]}async function a(c){let u=[...Object.keys(s).map(l=>s[l]),r];return(await Promise.all(u.map(l=>l.flush(c)))).every(l=>l)}return{send:o,flush:a}}}Rs.eventFromEnvelope=Ma;Rs.makeMultiplexedTransport=nb});var Op=g(Ua=>{Object.defineProperty(Ua,"__esModule",{value:!0});var rb="7.74.1";Ua.SDK_VERSION=rb});var qa=g(La=>{Object.defineProperty(La,"__esModule",{value:!0});var sb=T(),Dp,Cs=class t{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=t.id}setupOnce(){Dp=Function.prototype.toString;try{Function.prototype.toString=function(...e){let n=sb.getOriginalFunction(this)||this;return Dp.apply(n,e)}}catch{}}};Cs.__initStatic();La.FunctionToString=Cs});var Fa=g(sr=>{Object.defineProperty(sr,"__esModule",{value:!0});var F=T(),ib=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],ob=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],Os=class t{static __initStatic(){this.id="InboundFilters"}constructor(e={}){this.name=t.id,this._options=e}setupOnce(e,n){}processEvent(e,n,r){let s=r.getOptions(),i=Np(this._options,s);return wp(e,i)?null:e}};Os.__initStatic();function Np(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:ib],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[],...t.disableTransactionDefaults?[]:ob],ignoreInternal:t.ignoreInternal!==void 0?t.ignoreInternal:!0}}function wp(t,e){return e.ignoreInternal&&pb(t)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.warn(`Event dropped due to being internal Sentry Error.
14
- Event: ${F.getEventDescription(t)}`),!0):ab(t,e.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
15
- Event: ${F.getEventDescription(t)}`),!0):cb(t,e.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
16
- Event: ${F.getEventDescription(t)}`),!0):ub(t,e.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.warn(`Event dropped due to being matched by \`denyUrls\` option.
17
- Event: ${F.getEventDescription(t)}.
18
- Url: ${Ds(t)}`),!0):db(t,e.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.warn(`Event dropped due to not being matched by \`allowUrls\` option.
19
- Event: ${F.getEventDescription(t)}.
20
- Url: ${Ds(t)}`),!0)}function ab(t,e){return t.type||!e||!e.length?!1:lb(t).some(n=>F.stringMatchesSomePattern(n,e))}function cb(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;let n=t.transaction;return n?F.stringMatchesSomePattern(n,e):!1}function ub(t,e){if(!e||!e.length)return!1;let n=Ds(t);return n?F.stringMatchesSomePattern(n,e):!1}function db(t,e){if(!e||!e.length)return!0;let n=Ds(t);return n?F.stringMatchesSomePattern(n,e):!0}function lb(t){let e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch{}return n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`)),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&e.length===0&&F.logger.error(`Could not extract message for event ${F.getEventDescription(t)}`),e}function pb(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function fb(t=[]){for(let e=t.length-1;e>=0;e--){let n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Ds(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?fb(e):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.error(`Cannot extract url for event ${F.getEventDescription(t)}`),null}}sr.InboundFilters=Os;sr._mergeOptions=Np;sr._shouldDropEvent=wp});var kp=g(Ns=>{Object.defineProperty(Ns,"__esModule",{value:!0});var gb=qa(),_b=Fa();Ns.FunctionToString=gb.FunctionToString;Ns.InboundFilters=_b.InboundFilters});var Pp=g(Ga=>{Object.defineProperty(Ga,"__esModule",{value:!0});function hb(t,e){let n=e.getClient(),r=n&&n.getDsn(),s=n&&n.getOptions().tunnel;return Eb(t,r)||mb(t,s)}function mb(t,e){return e?xp(t)===xp(e):!1}function Eb(t,e){return e?t.includes(e.host):!1}function xp(t){return t[t.length-1]==="/"?t.slice(0,-1):t}Ga.isSentryRequestUrl=hb});var qp=g(ir=>{Object.defineProperty(ir,"__esModule",{value:!0});var Ba=T(),Up=new Map,Mp=new Set;function yb(t){if(Ba.GLOBAL_OBJ._sentryModuleMetadata)for(let e of Object.keys(Ba.GLOBAL_OBJ._sentryModuleMetadata)){let n=Ba.GLOBAL_OBJ._sentryModuleMetadata[e];if(Mp.has(e))continue;Mp.add(e);let r=t(e);for(let s of r.reverse())if(s.filename){Up.set(s.filename,n);break}}}function Lp(t,e){return yb(t),Up.get(e)}function Sb(t,e){try{e.exception.values.forEach(n=>{if(n.stacktrace)for(let r of n.stacktrace.frames||[]){if(!r.filename)continue;let s=Lp(t,r.filename);s&&(r.module_metadata=s)}})}catch{}}function Tb(t){try{t.exception.values.forEach(e=>{if(e.stacktrace)for(let n of e.stacktrace.frames||[])delete n.module_metadata})}catch{}}ir.addMetadataToStackFrames=Sb;ir.getMetadataForUrl=Lp;ir.stripMetadataFromStackFrames=Tb});var Gp=g($a=>{Object.defineProperty($a,"__esModule",{value:!0});var bb=T(),Fp=qp(),ws=class t{static __initStatic(){this.id="ModuleMetadata"}constructor(){this.name=t.id}setupOnce(e,n){let r=n().getClient();if(!r||typeof r.on!="function")return;r.on("beforeEnvelope",i=>{bb.forEachEnvelopeItem(i,(o,a)=>{if(a==="event"){let c=Array.isArray(o)?o[1]:void 0;c&&(Fp.stripMetadataFromStackFrames(c),o[1]=c)}})});let s=r.getOptions().stackParser;e(i=>(Fp.addMetadataToStackFrames(s,i),i))}};ws.__initStatic();$a.ModuleMetadata=ws});var N=g(S=>{Object.defineProperty(S,"__esModule",{value:!0});var Bp=da(),$p=aa(),jp=hs(),Ib=ms(),Ab=_s(),vb=la(),bt=np(),Rb=Jn(),Cb=rp(),Y=sp(),$e=le(),ja=Wn(),Ob=ma(),Db=ps(),Nb=Hn(),Hp=Is(),wb=va(),kb=yp(),xb=Sp(),Pb=Ip(),Mb=vp(),Ub=Cp(),Lb=Op(),Yp=Ta(),qb=kp(),Fb=ba(),Gb=Oa(),Bb=Ss(),$b=Pp(),jb=$n(),Hb=Gp(),Yb=qa(),Kb=Fa(),Wb=T();S.addTracingExtensions=Bp.addTracingExtensions;S.startIdleTransaction=Bp.startIdleTransaction;S.IdleTransaction=$p.IdleTransaction;S.TRACING_DEFAULTS=$p.TRACING_DEFAULTS;S.Span=jp.Span;S.spanStatusfromHttpCode=jp.spanStatusfromHttpCode;S.Transaction=Ib.Transaction;S.getActiveTransaction=Ab.getActiveTransaction;Object.defineProperty(S,"SpanStatus",{enumerable:!0,get:()=>vb.SpanStatus});S.continueTrace=bt.continueTrace;S.getActiveSpan=bt.getActiveSpan;S.startActiveSpan=bt.startActiveSpan;S.startInactiveSpan=bt.startInactiveSpan;S.startSpan=bt.startSpan;S.startSpanManual=bt.startSpanManual;S.trace=bt.trace;S.getDynamicSamplingContextFromClient=Rb.getDynamicSamplingContextFromClient;S.setMeasurement=Cb.setMeasurement;S.addBreadcrumb=Y.addBreadcrumb;S.captureCheckIn=Y.captureCheckIn;S.captureEvent=Y.captureEvent;S.captureException=Y.captureException;S.captureMessage=Y.captureMessage;S.close=Y.close;S.configureScope=Y.configureScope;S.flush=Y.flush;S.lastEventId=Y.lastEventId;S.setContext=Y.setContext;S.setExtra=Y.setExtra;S.setExtras=Y.setExtras;S.setTag=Y.setTag;S.setTags=Y.setTags;S.setUser=Y.setUser;S.startTransaction=Y.startTransaction;S.withScope=Y.withScope;S.Hub=$e.Hub;S.ensureHubOnCarrier=$e.ensureHubOnCarrier;S.getCurrentHub=$e.getCurrentHub;S.getHubFromCarrier=$e.getHubFromCarrier;S.getMainCarrier=$e.getMainCarrier;S.makeMain=$e.makeMain;S.runWithAsyncContext=$e.runWithAsyncContext;S.setAsyncContextStrategy=$e.setAsyncContextStrategy;S.setHubOnCarrier=$e.setHubOnCarrier;S.closeSession=ja.closeSession;S.makeSession=ja.makeSession;S.updateSession=ja.updateSession;S.SessionFlusher=Ob.SessionFlusher;S.Scope=Db.Scope;S.addGlobalEventProcessor=Nb.addGlobalEventProcessor;S.getEnvelopeEndpointWithUrlEncodedAuth=Hp.getEnvelopeEndpointWithUrlEncodedAuth;S.getReportDialogEndpoint=Hp.getReportDialogEndpoint;S.BaseClient=wb.BaseClient;S.ServerRuntimeClient=kb.ServerRuntimeClient;S.initAndBind=xb.initAndBind;S.createTransport=Pb.createTransport;S.makeOfflineTransport=Mb.makeOfflineTransport;S.makeMultiplexedTransport=Ub.makeMultiplexedTransport;S.SDK_VERSION=Lb.SDK_VERSION;S.addIntegration=Yp.addIntegration;S.getIntegrationsToSetup=Yp.getIntegrationsToSetup;S.Integrations=qb;S.prepareEvent=Fb.prepareEvent;S.createCheckInEnvelope=Gb.createCheckInEnvelope;S.hasTracingEnabled=Bb.hasTracingEnabled;S.isSentryRequestUrl=$b.isSentryRequestUrl;S.DEFAULT_ENVIRONMENT=jb.DEFAULT_ENVIRONMENT;S.ModuleMetadata=Hb.ModuleMetadata;S.FunctionToString=Yb.FunctionToString;S.InboundFilters=Kb.InboundFilters;S.extractTraceparentData=Wb.extractTraceparentData});var Ya=g(Ha=>{Object.defineProperty(Ha,"__esModule",{value:!0});function Vb(t,e){return t??e()}Ha._nullishCoalesce=Vb});var Kp=g(Ka=>{Object.defineProperty(Ka,"__esModule",{value:!0});var zb=Ya();async function Xb(t,e){return zb._nullishCoalesce(t,e)}Ka._asyncNullishCoalesce=Xb});var Va=g(Wa=>{Object.defineProperty(Wa,"__esModule",{value:!0});async function Jb(t){let e,n=t[0],r=1;for(;r<t.length;){let s=t[r],i=t[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(e=n,n=await i(n)):(s==="call"||s==="optionalCall")&&(n=await i((...o)=>n.call(e,...o)),e=void 0)}return n}Wa._asyncOptionalChain=Jb});var Wp=g(za=>{Object.defineProperty(za,"__esModule",{value:!0});var Qb=Va();async function Zb(t){let e=await Qb._asyncOptionalChain(t);return e??!0}za._asyncOptionalChainDelete=Zb});var Ja=g(Xa=>{Object.defineProperty(Xa,"__esModule",{value:!0});function eI(t){let e,n=t[0],r=1;for(;r<t.length;){let s=t[r],i=t[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(e=n,n=i(n)):(s==="call"||s==="optionalCall")&&(n=i((...o)=>n.call(e,...o)),e=void 0)}return n}Xa._optionalChain=eI});var Vp=g(Qa=>{Object.defineProperty(Qa,"__esModule",{value:!0});var tI=Ja();function nI(t){let e=tI._optionalChain(t);return e??!0}Qa._optionalChainDelete=nI});var k=g(st=>{Object.defineProperty(st,"__esModule",{value:!0});var rI=Kp(),sI=Va(),iI=Wp(),oI=Ya(),aI=Ja(),cI=Vp();st._asyncNullishCoalesce=rI._asyncNullishCoalesce;st._asyncOptionalChain=sI._asyncOptionalChain;st._asyncOptionalChainDelete=iI._asyncOptionalChainDelete;st._nullishCoalesce=oI._nullishCoalesce;st._optionalChain=aI._optionalChain;st._optionalChainDelete=cI._optionalChainDelete});var it=g(Za=>{var{_optionalChain:zp}=k();Object.defineProperty(Za,"__esModule",{value:!0});function uI(t){let e=zp([t,"call",r=>r(),"access",r=>r.getClient,"call",r=>r(),"optionalAccess",r=>r.getOptions,"call",r=>r()]);return(zp([e,"optionalAccess",r=>r.instrumenter])||"sentry")!=="sentry"}Za.shouldDisableAutoInstrumentation=uI});var Zp=g(or=>{var{_optionalChain:Re}=k();Object.defineProperty(or,"__esModule",{value:!0});var me=T(),dI=it(),ks=class t{static __initStatic(){this.id="Express"}constructor(e={}){this.name=t.id,this._router=e.router||e.app,this._methods=(Array.isArray(e.methods)?e.methods:[]).concat("use")}setupOnce(e,n){if(!this._router){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&me.logger.error("ExpressIntegration is missing an Express instance");return}if(dI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&me.logger.log("Express Integration is skipped because of instrumenter configuration.");return}fI(this._router,this._methods),gI(this._router)}};ks.__initStatic();function Xp(t,e){let n=t.length;switch(n){case 2:return function(r,s){let i=s.__sentry_transaction;if(i){let o=i.startChild({description:t.name,op:`middleware.express.${e}`,origin:"auto.middleware.express"});s.once("finish",()=>{o.finish()})}return t.call(this,r,s)};case 3:return function(r,s,i){let o=s.__sentry_transaction,a=Re([o,"optionalAccess",c=>c.startChild,"call",c=>c({description:t.name,op:`middleware.express.${e}`,origin:"auto.middleware.express"})]);t.call(this,r,s,function(...c){Re([a,"optionalAccess",u=>u.finish,"call",u=>u()]),i.call(this,...c)})};case 4:return function(r,s,i,o){let a=i.__sentry_transaction,c=Re([a,"optionalAccess",u=>u.startChild,"call",u=>u({description:t.name,op:`middleware.express.${e}`,origin:"auto.middleware.express"})]);t.call(this,r,s,i,function(...u){Re([c,"optionalAccess",d=>d.finish,"call",d=>d()]),o.call(this,...u)})};default:throw new Error(`Express middleware takes 2-4 arguments. Got: ${n}`)}}function lI(t,e){return t.map(n=>typeof n=="function"?Xp(n,e):Array.isArray(n)?n.map(r=>typeof r=="function"?Xp(r,e):r):n)}function pI(t,e){let n=t[e];return t[e]=function(...r){return n.call(this,...lI(r,e))},t}function fI(t,e=[]){e.forEach(n=>pI(t,n))}function gI(t){let e="settings"in t;e&&t._router===void 0&&t.lazyrouter&&t.lazyrouter();let n=e?t._router:t;if(!n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&me.logger.debug("Cannot instrument router for URL Parameterization (did not find a valid router)."),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&me.logger.debug("Routing instrumentation is currently only supported in Express 4.");return}let r=Object.getPrototypeOf(n),s=r.process_params;r.process_params=function(o,a,c,u,d){c._reconstructedRoute||(c._reconstructedRoute="");let{layerRoutePath:l,isRegex:p,isArray:f,numExtraSegments:m}=_I(o);(l||p||f)&&(c._hasParameters=!0);let E;l?E=l:E=Qp(c.originalUrl,c._reconstructedRoute,o.path)||"";let b=E.split("/").filter(se=>se.length>0&&(p||f||!se.includes("*"))).join("/");b&&b.length>0&&(c._reconstructedRoute+=`/${b}${p?"/":""}`);let v=me.getNumberOfUrlSegments(c.originalUrl||"")+m,L=me.getNumberOfUrlSegments(c._reconstructedRoute);if(v===L){c._hasParameters||c._reconstructedRoute!==c.originalUrl&&(c._reconstructedRoute=c.originalUrl?me.stripUrlQueryAndFragment(c.originalUrl):c.originalUrl);let se=u.__sentry_transaction;if(se&&se.metadata.source!=="custom"){let ie=c._reconstructedRoute||"/";se.setName(...me.extractPathForTransaction(c,{path:!0,method:!0,customRoute:ie}))}}return s.call(this,o,a,c,u,d)}}var Jp=(t,e,n)=>{if(!t||!e||!n||Object.keys(n).length===0||!Re([n,"access",u=>u[0],"optionalAccess",u=>u.offset]))return;let r=n.sort((u,d)=>u.offset-d.offset),i=new RegExp(e,`${e.flags}d`).exec(t);if(!i||!i.indices)return;let[,...o]=i.indices;if(o.length!==r.length)return;let a=t,c=0;return o.forEach(([u,d],l)=>{let p=a.substring(0,u-c),f=`:${r[l].name}`,m=a.substring(d-c);a=p+f+m,c=c+(d-u-f.length)}),a};function _I(t){let e=Re([t,"access",o=>o.route,"optionalAccess",o=>o.path]),n=me.isRegExp(e),r=Array.isArray(e);if(!e){let[o]=process.versions.node.split(".").map(Number);o>=16&&(e=Jp(t.path,t.regexp,t.keys))}if(!e)return{isRegex:n,isArray:r,numExtraSegments:0};let s=r?Math.max(hI(e)-me.getNumberOfUrlSegments(t.path||""),0):0;return{layerRoutePath:mI(r,e),isRegex:n,isArray:r,numExtraSegments:s}}function hI(t){return t.reduce((e,n)=>e+me.getNumberOfUrlSegments(n.toString()),0)}function mI(t,e){return t?e.map(n=>n.toString()).join(","):e&&e.toString()}function Qp(t,e,n){let r=Re([t,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>!!c)]),s=0,i=Re([e,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>!!c),"access",a=>a.length])||0;return Re([n,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>Re([r,"optionalAccess",u=>u[i+s]])===c?(s+=1,!0):!1),"access",a=>a.join,"call",a=>a("/")])}or.Express=ks;or.extractOriginalRoute=Jp;or.preventDuplicateSegments=Qp});var ef=g(ec=>{var{_optionalChain:rn}=k();Object.defineProperty(ec,"__esModule",{value:!0});var sn=T(),EI=it(),xs=class t{static __initStatic(){this.id="Postgres"}constructor(e={}){this.name=t.id,this._usePgNative=!!e.usePgNative,this._module=e.module}loadDependency(){return this._module=this._module||sn.loadModule("pg")}setupOnce(e,n){if(EI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&sn.logger.log("Postgres Integration is skipped because of instrumenter configuration.");return}let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&sn.logger.error("Postgres Integration was unable to require `pg` package.");return}let s=this._usePgNative?rn([r,"access",i=>i.native,"optionalAccess",i=>i.Client]):r.Client;if(!s){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&sn.logger.error("Postgres Integration was unable to access 'pg-native' bindings.");return}sn.fill(s.prototype,"query",function(i){return function(o,a,c){let d=n().getScope().getSpan(),l={"db.system":"postgresql"};try{this.database&&(l["db.name"]=this.database),this.host&&(l["server.address"]=this.host),this.port&&(l["server.port"]=this.port),this.user&&(l["db.user"]=this.user)}catch{}let p=rn([d,"optionalAccess",m=>m.startChild,"call",m=>m({description:typeof o=="string"?o:o.text,op:"db",origin:"auto.db.postgres",data:l})]);if(typeof c=="function")return i.call(this,o,a,function(m,E){rn([p,"optionalAccess",b=>b.finish,"call",b=>b()]),c(m,E)});if(typeof a=="function")return i.call(this,o,function(m,E){rn([p,"optionalAccess",b=>b.finish,"call",b=>b()]),a(m,E)});let f=typeof a<"u"?i.call(this,o,a):i.call(this,o);return sn.isThenable(f)?f.then(m=>(rn([p,"optionalAccess",E=>E.finish,"call",E=>E()]),m)):(rn([p,"optionalAccess",m=>m.finish,"call",m=>m()]),f)}})}};xs.__initStatic();ec.Postgres=xs});var tf=g(tc=>{var{_optionalChain:yI}=k();Object.defineProperty(tc,"__esModule",{value:!0});var ar=T(),SI=it(),Ps=class t{static __initStatic(){this.id="Mysql"}constructor(){this.name=t.id}loadDependency(){return this._module=this._module||ar.loadModule("mysql/lib/Connection.js")}setupOnce(e,n){if(SI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ar.logger.log("Mysql Integration is skipped because of instrumenter configuration.");return}let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ar.logger.error("Mysql Integration was unable to require `mysql` package.");return}let s;try{r.prototype.connect=new Proxy(r.prototype.connect,{apply(a,c,u){return s||(s=c.config),a.apply(c,u)}})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ar.logger.error("Mysql Integration was unable to instrument `mysql` config.")}function i(){return s?{"server.address":s.host,"server.port":s.port,"db.user":s.user}:{}}function o(a){if(!a||a.endTimestamp)return;let c=i();Object.keys(c).forEach(u=>{a.setData(u,c[u])}),a.finish()}ar.fill(r,"createQuery",function(a){return function(c,u,d){let p=n().getScope().getSpan(),f=yI([p,"optionalAccess",E=>E.startChild,"call",E=>E({description:typeof c=="string"?c:c.sql,op:"db",origin:"auto.db.mysql",data:{"db.system":"mysql"}})]);if(typeof d=="function")return a.call(this,c,u,function(E,b,v){o(f),d(E,b,v)});if(typeof u=="function")return a.call(this,c,function(E,b,v){o(f),u(E,b,v)});let m=a.call(this,c,u);return m.on("end",()=>{o(f)}),m}})}};Ps.__initStatic();tc.Mysql=Ps});var nf=g(nc=>{var{_optionalChain:It}=k();Object.defineProperty(nc,"__esModule",{value:!0});var cr=T(),TI=it(),bI=["aggregate","bulkWrite","countDocuments","createIndex","createIndexes","deleteMany","deleteOne","distinct","drop","dropIndex","dropIndexes","estimatedDocumentCount","find","findOne","findOneAndDelete","findOneAndReplace","findOneAndUpdate","indexes","indexExists","indexInformation","initializeOrderedBulkOp","insertMany","insertOne","isCapped","mapReduce","options","parallelCollectionScan","rename","replaceOne","stats","updateMany","updateOne"],II={bulkWrite:["operations"],countDocuments:["query"],createIndex:["fieldOrSpec"],createIndexes:["indexSpecs"],deleteMany:["filter"],deleteOne:["filter"],distinct:["key","query"],dropIndex:["indexName"],find:["query"],findOne:["query"],findOneAndDelete:["filter"],findOneAndReplace:["filter","replacement"],findOneAndUpdate:["filter","update"],indexExists:["indexes"],insertMany:["docs"],insertOne:["doc"],mapReduce:["map","reduce"],rename:["newName"],replaceOne:["filter","doc"],updateMany:["filter","update"],updateOne:["filter","update"]};function AI(t){return t&&typeof t=="object"&&t.once&&typeof t.once=="function"}var Ms=class t{static __initStatic(){this.id="Mongo"}constructor(e={}){this.name=t.id,this._operations=Array.isArray(e.operations)?e.operations:bI,this._describeOperations="describeOperations"in e?e.describeOperations:!0,this._useMongoose=!!e.useMongoose}loadDependency(){let e=this._useMongoose?"mongoose":"mongodb";return this._module=this._module||cr.loadModule(e)}setupOnce(e,n){if(TI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&cr.logger.log("Mongo Integration is skipped because of instrumenter configuration.");return}let r=this.loadDependency();if(!r){let s=this._useMongoose?"mongoose":"mongodb";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&cr.logger.error(`Mongo Integration was unable to require \`${s}\` package.`);return}this._instrumentOperations(r.Collection,this._operations,n)}_instrumentOperations(e,n,r){n.forEach(s=>this._patchOperation(e,s,r))}_patchOperation(e,n,r){if(!(n in e.prototype))return;let s=this._getSpanContextFromOperationArguments.bind(this);cr.fill(e.prototype,n,function(i){return function(...o){let a=o[o.length-1],u=r().getScope().getSpan();if(typeof a!="function"||n==="mapReduce"&&o.length===2){let l=It([u,"optionalAccess",f=>f.startChild,"call",f=>f(s(this,n,o))]),p=i.call(this,...o);if(cr.isThenable(p))return p.then(f=>(It([l,"optionalAccess",m=>m.finish,"call",m=>m()]),f));if(AI(p)){let f=p;try{f.once("close",()=>{It([l,"optionalAccess",m=>m.finish,"call",m=>m()])})}catch{It([l,"optionalAccess",E=>E.finish,"call",E=>E()])}return f}else return It([l,"optionalAccess",f=>f.finish,"call",f=>f()]),p}let d=It([u,"optionalAccess",l=>l.startChild,"call",l=>l(s(this,n,o.slice(0,-1)))]);return i.call(this,...o.slice(0,-1),function(l,p){It([d,"optionalAccess",f=>f.finish,"call",f=>f()]),a(l,p)})}})}_getSpanContextFromOperationArguments(e,n,r){let s={"db.system":"mongodb","db.name":e.dbName,"db.operation":n,"db.mongodb.collection":e.collectionName},i={op:"db",origin:"auto.db.mongo",description:n,data:s},o=II[n],a=Array.isArray(this._describeOperations)?this._describeOperations.includes(n):this._describeOperations;if(!o||!a)return i;try{if(n==="mapReduce"){let[c,u]=r;s[o[0]]=typeof c=="string"?c:c.name||"<anonymous>",s[o[1]]=typeof u=="string"?u:u.name||"<anonymous>"}else for(let c=0;c<o.length;c++)s[`db.mongodb.${o[c]}`]=JSON.stringify(r[c])}catch{}return i}};Ms.__initStatic();nc.Mongo=Ms});var of=g(rc=>{Object.defineProperty(rc,"__esModule",{value:!0});var rf=N(),sf=T(),vI=it();function RI(t){return!!t&&!!t.$use}var Us=class t{static __initStatic(){this.id="Prisma"}constructor(e={}){if(this.name=t.id,RI(e.client)&&!e.client._sentryInstrumented){sf.addNonEnumerableProperty(e.client,"_sentryInstrumented",!0);let n={};try{let r=e.client._engineConfig;if(r){let{activeProvider:s,clientVersion:i}=r;s&&(n["db.system"]=s),i&&(n["db.prisma.version"]=i)}}catch{}e.client.$use((r,s)=>{if(vI.shouldDisableAutoInstrumentation(rf.getCurrentHub))return s(r);let i=r.action,o=r.model;return rf.trace({name:o?`${o} ${i}`:i,op:"db.sql.prisma",origin:"auto.db.prisma",data:{...n,"db.operation":i}},()=>s(r))})}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&sf.logger.warn("Unsupported Prisma client provided to PrismaIntegration. Provided client:",e.client)}setupOnce(){}};Us.__initStatic();rc.Prisma=Us});var af=g(sc=>{var{_optionalChain:on}=k();Object.defineProperty(sc,"__esModule",{value:!0});var ur=T(),CI=it(),Ls=class t{static __initStatic(){this.id="GraphQL"}constructor(){this.name=t.id}loadDependency(){return this._module=this._module||ur.loadModule("graphql/execution/execute.js")}setupOnce(e,n){if(CI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ur.logger.log("GraphQL Integration is skipped because of instrumenter configuration.");return}let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ur.logger.error("GraphQL Integration was unable to require graphql/execution package.");return}ur.fill(r,"execute",function(s){return function(...i){let o=n().getScope(),a=o.getSpan(),c=on([a,"optionalAccess",d=>d.startChild,"call",d=>d({description:"execute",op:"graphql.execute",origin:"auto.graphql.graphql"})]);on([o,"optionalAccess",d=>d.setSpan,"call",d=>d(c)]);let u=s.call(this,...i);return ur.isThenable(u)?u.then(d=>(on([c,"optionalAccess",l=>l.finish,"call",l=>l()]),on([o,"optionalAccess",l=>l.setSpan,"call",l=>l(a)]),d)):(on([c,"optionalAccess",d=>d.finish,"call",d=>d()]),on([o,"optionalAccess",d=>d.setSpan,"call",d=>d(a)]),u)}})}};Ls.__initStatic();sc.GraphQL=Ls});var uf=g(oc=>{var{_optionalChain:ic}=k();Object.defineProperty(oc,"__esModule",{value:!0});var K=T(),OI=it(),qs=class t{static __initStatic(){this.id="Apollo"}constructor(e={useNestjs:!1}){this.name=t.id,this._useNest=!!e.useNestjs}loadDependency(){return this._useNest?this._module=this._module||K.loadModule("@nestjs/graphql"):this._module=this._module||K.loadModule("apollo-server-core"),this._module}setupOnce(e,n){if(OI.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&K.logger.log("Apollo Integration is skipped because of instrumenter configuration.");return}if(this._useNest){let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&K.logger.error("Apollo-NestJS Integration was unable to require @nestjs/graphql package.");return}K.fill(r.GraphQLFactory.prototype,"mergeWithSchema",function(s){return function(...i){return K.fill(this.resolversExplorerService,"explore",function(o){return function(){let a=K.arrayify(o.call(this));return cf(a,n)}}),s.call(this,...i)}})}else{let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&K.logger.error("Apollo Integration was unable to require apollo-server-core package.");return}K.fill(r.ApolloServerBase.prototype,"constructSchema",function(s){return function(){if(!this.config.resolvers)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this.config.schema?(K.logger.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `schema` property.If you are using NestJS with Apollo, please use `Sentry.Integrations.Apollo({ useNestjs: true })` instead."),K.logger.warn()):this.config.modules&&K.logger.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `modules` property."),K.logger.error("Skipping tracing as no resolvers found on the `ApolloServer` instance.")),s.call(this);let i=K.arrayify(this.config.resolvers);return this.config.resolvers=cf(i,n),s.call(this)}})}}};qs.__initStatic();function cf(t,e){return t.map(n=>(Object.keys(n).forEach(r=>{Object.keys(n[r]).forEach(s=>{typeof n[r][s]=="function"&&DI(n,r,s,e)})}),n))}function DI(t,e,n,r){K.fill(t[e],n,function(s){return function(...i){let a=r().getScope().getSpan(),c=ic([a,"optionalAccess",d=>d.startChild,"call",d=>d({description:`${e}.${n}`,op:"graphql.resolve",origin:"auto.graphql.apollo"})]),u=s.call(this,...i);return K.isThenable(u)?u.then(d=>(ic([c,"optionalAccess",l=>l.finish,"call",l=>l()]),d)):(ic([c,"optionalAccess",d=>d.finish,"call",d=>d()]),u)}})}oc.Apollo=qs});var df=g((ac,ot)=>{Object.defineProperty(ac,"__esModule",{value:!0});var At=T(),NI=[()=>{let t=At.dynamicRequire(ot,"./apollo");return new t.Apollo},()=>{let t=At.dynamicRequire(ot,"./apollo");return new t.Apollo({useNestjs:!0})},()=>{let t=At.dynamicRequire(ot,"./graphql");return new t.GraphQL},()=>{let t=At.dynamicRequire(ot,"./mongo");return new t.Mongo},()=>{let t=At.dynamicRequire(ot,"./mongo");return new t.Mongo({mongoose:!0})},()=>{let t=At.dynamicRequire(ot,"./mysql");return new t.Mysql},()=>{let t=At.dynamicRequire(ot,"./postgres");return new t.Postgres}];ac.lazyLoadedNodePerformanceMonitoringIntegrations=NI});var je=g(cc=>{Object.defineProperty(cc,"__esModule",{value:!0});var wI=T(),kI=wI.GLOBAL_OBJ;cc.WINDOW=kI});var pf=g(uc=>{Object.defineProperty(uc,"__esModule",{value:!0});var xI=N(),lf=T(),Fs=je();function PI(){Fs.WINDOW&&Fs.WINDOW.document?Fs.WINDOW.document.addEventListener("visibilitychange",()=>{let t=xI.getActiveTransaction();if(Fs.WINDOW.document.hidden&&t){let e="cancelled";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&lf.logger.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${t.op}`),t.status||t.setStatus(e),t.setTag("visibilitychange","document.hidden"),t.finish()}}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&lf.logger.warn("[Tracing] Could not set up background tab detection due to lack of global document")}uc.registerBackgroundTabDetection=PI});var Gs=g(dc=>{Object.defineProperty(dc,"__esModule",{value:!0});var MI=(t,e,n)=>{let r,s;return i=>{e.value>=0&&(i||n)&&(s=e.value-(r||0),(s||r===void 0)&&(r=e.value,e.delta=s,t(e)))}};dc.bindReporter=MI});var ff=g(lc=>{Object.defineProperty(lc,"__esModule",{value:!0});var UI=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`;lc.generateUniqueID=UI});var fc=g(pc=>{Object.defineProperty(pc,"__esModule",{value:!0});var dr=je(),LI=()=>{let t=dr.WINDOW.performance.timing,e=dr.WINDOW.performance.navigation.type,n={entryType:"navigation",startTime:0,type:e==2?"back_forward":e===1?"reload":"navigate"};for(let r in t)r!=="navigationStart"&&r!=="toJSON"&&(n[r]=Math.max(t[r]-t.navigationStart,0));return n},qI=()=>dr.WINDOW.__WEB_VITALS_POLYFILL__?dr.WINDOW.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||LI()):dr.WINDOW.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];pc.getNavigationEntry=qI});var _c=g(gc=>{Object.defineProperty(gc,"__esModule",{value:!0});var FI=fc(),GI=()=>{let t=FI.getNavigationEntry();return t&&t.activationStart||0};gc.getActivationStart=GI});var Bs=g(hc=>{Object.defineProperty(hc,"__esModule",{value:!0});var BI=je(),$I=ff(),jI=_c(),HI=fc(),YI=(t,e)=>{let n=HI.getNavigationEntry(),r="navigate";return n&&(BI.WINDOW.document.prerendering||jI.getActivationStart()>0?r="prerender":r=n.type.replace(/_/g,"-")),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:$I.generateUniqueID(),navigationType:r}};hc.initMetric=YI});var lr=g(mc=>{Object.defineProperty(mc,"__esModule",{value:!0});var KI=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){let r=new PerformanceObserver(s=>{e(s.getEntries())});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}};mc.observe=KI});var pr=g(Ec=>{Object.defineProperty(Ec,"__esModule",{value:!0});var WI=je(),VI=(t,e)=>{let n=r=>{(r.type==="pagehide"||WI.WINDOW.document.visibilityState==="hidden")&&(t(r),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)};Ec.onHidden=VI});var gf=g(yc=>{Object.defineProperty(yc,"__esModule",{value:!0});var zI=Gs(),XI=Bs(),JI=lr(),QI=pr(),ZI=t=>{let e=XI.initMetric("CLS",0),n,r=0,s=[],i=a=>{a.forEach(c=>{if(!c.hadRecentInput){let u=s[0],d=s[s.length-1];r&&s.length!==0&&c.startTime-d.startTime<1e3&&c.startTime-u.startTime<5e3?(r+=c.value,s.push(c)):(r=c.value,s=[c]),r>e.value&&(e.value=r,e.entries=s,n&&n())}})},o=JI.observe("layout-shift",i);if(o){n=zI.bindReporter(t,e);let a=()=>{i(o.takeRecords()),n(!0)};return QI.onHidden(a),a}};yc.onCLS=ZI});var js=g(Sc=>{Object.defineProperty(Sc,"__esModule",{value:!0});var _f=je(),eA=pr(),$s=-1,tA=()=>_f.WINDOW.document.visibilityState==="hidden"&&!_f.WINDOW.document.prerendering?0:1/0,nA=()=>{eA.onHidden(({timeStamp:t})=>{$s=t},!0)},rA=()=>($s<0&&($s=tA(),nA()),{get firstHiddenTime(){return $s}});Sc.getVisibilityWatcher=rA});var hf=g(Tc=>{Object.defineProperty(Tc,"__esModule",{value:!0});var sA=Gs(),iA=js(),oA=Bs(),aA=lr(),cA=pr(),uA=t=>{let e=iA.getVisibilityWatcher(),n=oA.initMetric("FID"),r,s=a=>{a.startTime<e.firstHiddenTime&&(n.value=a.processingStart-a.startTime,n.entries.push(a),r(!0))},i=a=>{a.forEach(s)},o=aA.observe("first-input",i);r=sA.bindReporter(t,n),o&&cA.onHidden(()=>{i(o.takeRecords()),o.disconnect()},!0)};Tc.onFID=uA});var Ef=g(bc=>{Object.defineProperty(bc,"__esModule",{value:!0});var dA=Gs(),lA=_c(),pA=js(),fA=Bs(),gA=lr(),_A=pr(),mf={},hA=t=>{let e=pA.getVisibilityWatcher(),n=fA.initMetric("LCP"),r,s=o=>{let a=o[o.length-1];if(a){let c=Math.max(a.startTime-lA.getActivationStart(),0);c<e.firstHiddenTime&&(n.value=c,n.entries=[a],r())}},i=gA.observe("largest-contentful-paint",s);if(i){r=dA.bindReporter(t,n);let o=()=>{mf[n.id]||(s(i.takeRecords()),i.disconnect(),mf[n.id]=!0,r(!0))};return["keydown","click"].forEach(a=>{addEventListener(a,o,{once:!0,capture:!0})}),_A.onHidden(o,!0),o}};bc.onLCP=hA});var yf=g(Hs=>{Object.defineProperty(Hs,"__esModule",{value:!0});function mA(t){return typeof t=="number"&&isFinite(t)}function EA(t,{startTimestamp:e,...n}){return e&&t.startTimestamp>e&&(t.startTimestamp=e),t.startChild({startTimestamp:e,...n})}Hs._startChild=EA;Hs.isMeasurementValue=mA});var Rf=g(at=>{Object.defineProperty(at,"__esModule",{value:!0});var Tf=N(),M=T(),vt=je(),yA=gf(),SA=hf(),TA=Ef(),bA=js(),bf=lr(),He=yf();function U(t){return t/1e3}function If(){return vt.WINDOW&&vt.WINDOW.addEventListener&&vt.WINDOW.performance}var Sf=0,w={},Ce,fr;function IA(){let t=If();if(t&&M.browserPerformanceTimeOrigin){t.mark&&vt.WINDOW.performance.mark("sentry-tracing-init"),OA();let e=RA(),n=CA();return()=>{e&&e(),n&&n()}}return()=>{}}function AA(){let t=e=>{for(let n of e){let r=Tf.getActiveTransaction();if(!r)return;let s=U(M.browserPerformanceTimeOrigin+n.startTime),i=U(n.duration);r.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:s,endTimestamp:s+i})}};bf.observe("longtask",t)}function vA(){let t=e=>{for(let n of e){let r=Tf.getActiveTransaction();if(!r)return;if(n.name==="click"){let s=U(M.browserPerformanceTimeOrigin+n.startTime),i=U(n.duration);r.startChild({description:M.htmlTreeAsString(n.target),op:`ui.interaction.${n.name}`,origin:"auto.ui.browser.metrics",startTimestamp:s,endTimestamp:s+i})}}};bf.observe("event",t,{durationThreshold:0})}function RA(){return yA.onCLS(t=>{let e=t.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&M.logger.log("[Measurements] Adding CLS"),w.cls={value:t.value,unit:""},fr=e)})}function CA(){return TA.onLCP(t=>{let e=t.entries.pop();e&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&M.logger.log("[Measurements] Adding LCP"),w.lcp={value:t.value,unit:"millisecond"},Ce=e)})}function OA(){SA.onFID(t=>{let e=t.entries.pop();if(!e)return;let n=U(M.browserPerformanceTimeOrigin),r=U(e.startTime);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&M.logger.log("[Measurements] Adding FID"),w.fid={value:t.value,unit:"millisecond"},w["mark.fid"]={value:n+r,unit:"second"}})}function DA(t){let e=If();if(!e||!vt.WINDOW.performance.getEntries||!M.browserPerformanceTimeOrigin)return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&M.logger.log("[Tracing] Adding & adjusting spans using Performance API");let n=U(M.browserPerformanceTimeOrigin),r=e.getEntries(),s,i;if(r.slice(Sf).forEach(o=>{let a=U(o.startTime),c=U(o.duration);if(!(t.op==="navigation"&&n+a<t.startTimestamp))switch(o.entryType){case"navigation":{NA(t,o,n),s=n+U(o.responseStart),i=n+U(o.requestStart);break}case"mark":case"paint":case"measure":{Af(t,o,a,c,n);let u=bA.getVisibilityWatcher(),d=o.startTime<u.firstHiddenTime;o.name==="first-paint"&&d&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&M.logger.log("[Measurements] Adding FP"),w.fp={value:o.startTime,unit:"millisecond"}),o.name==="first-contentful-paint"&&d&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&M.logger.log("[Measurements] Adding FCP"),w.fcp={value:o.startTime,unit:"millisecond"});break}case"resource":{let u=o.name.replace(vt.WINDOW.location.origin,"");vf(t,o,u,a,c,n);break}}}),Sf=Math.max(r.length-1,0),kA(t),t.op==="pageload"){typeof s=="number"&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&M.logger.log("[Measurements] Adding TTFB"),w.ttfb={value:(s-t.startTimestamp)*1e3,unit:"millisecond"},typeof i=="number"&&i<=s&&(w["ttfb.requestTime"]={value:(s-i)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(a=>{if(!w[a]||n>=t.startTimestamp)return;let c=w[a].value,u=n+U(c),d=Math.abs((u-t.startTimestamp)*1e3),l=d-c;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&M.logger.log(`[Measurements] Normalized ${a} from ${c} to ${d} (${l})`),w[a].value=d});let o=w["mark.fid"];o&&w.fid&&(He._startChild(t,{description:"first input delay",endTimestamp:o.value+U(w.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:o.value}),delete w["mark.fid"]),"fcp"in w||delete w.cls,Object.keys(w).forEach(a=>{t.setMeasurement(a,w[a].value,w[a].unit)}),xA(t)}Ce=void 0,fr=void 0,w={}}function Af(t,e,n,r,s){let i=s+n,o=i+r;return He._startChild(t,{description:e.name,endTimestamp:o,op:e.entryType,origin:"auto.resource.browser.metrics",startTimestamp:i}),i}function NA(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Ys(t,e,r,n)}),Ys(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),Ys(t,e,"fetch",n,"cache","domainLookupStart"),Ys(t,e,"domainLookup",n,"DNS"),wA(t,e,n)}function Ys(t,e,n,r,s,i){let o=i?e[i]:e[`${n}End`],a=e[`${n}Start`];!a||!o||He._startChild(t,{op:"browser",origin:"auto.browser.browser.metrics",description:s||n,startTimestamp:r+U(a),endTimestamp:r+U(o)})}function wA(t,e,n){He._startChild(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+U(e.requestStart),endTimestamp:n+U(e.responseEnd)}),He._startChild(t,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+U(e.responseStart),endTimestamp:n+U(e.responseEnd)})}function vf(t,e,n,r,s,i){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;let o={};"transferSize"in e&&(o["http.response_transfer_size"]=e.transferSize),"encodedBodySize"in e&&(o["http.response_content_length"]=e.encodedBodySize),"decodedBodySize"in e&&(o["http.decoded_response_content_length"]=e.decodedBodySize),"renderBlockingStatus"in e&&(o["resource.render_blocking_status"]=e.renderBlockingStatus);let a=i+r,c=a+s;He._startChild(t,{description:n,endTimestamp:c,op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:a,data:o})}function kA(t){let e=vt.WINDOW.navigator;if(!e)return;let n=e.connection;n&&(n.effectiveType&&t.setTag("effectiveConnectionType",n.effectiveType),n.type&&t.setTag("connectionType",n.type),He.isMeasurementValue(n.rtt)&&(w["connection.rtt"]={value:n.rtt,unit:"millisecond"})),He.isMeasurementValue(e.deviceMemory)&&t.setTag("deviceMemory",`${e.deviceMemory} GB`),He.isMeasurementValue(e.hardwareConcurrency)&&t.setTag("hardwareConcurrency",String(e.hardwareConcurrency))}function xA(t){Ce&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&M.logger.log("[Measurements] Adding LCP Data"),Ce.element&&t.setTag("lcp.element",M.htmlTreeAsString(Ce.element)),Ce.id&&t.setTag("lcp.id",Ce.id),Ce.url&&t.setTag("lcp.url",Ce.url.trim().slice(0,200)),t.setTag("lcp.size",Ce.size)),fr&&fr.sources&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&M.logger.log("[Measurements] Adding CLS Data"),fr.sources.forEach((e,n)=>t.setTag(`cls.source.${n+1}`,M.htmlTreeAsString(e.node))))}at._addMeasureSpans=Af;at._addResourceSpans=vf;at.addPerformanceEntries=DA;at.startTrackingInteractions=vA;at.startTrackingLongTasks=AA;at.startTrackingWebVitals=IA});var Ac=g(De=>{Object.defineProperty(De,"__esModule",{value:!0});var an=N(),W=T(),Ks=["localhost",/^\/(?!\/)/],Ic={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:Ks,tracePropagationTargets:Ks};function PA(t){let{traceFetch:e,traceXHR:n,tracePropagationTargets:r,tracingOrigins:s,shouldCreateSpanForRequest:i,enableHTTPTimings:o}={traceFetch:Ic.traceFetch,traceXHR:Ic.traceXHR,...t},a=typeof i=="function"?i:d=>!0,c=d=>Nf(d,r||s),u={};e&&W.addInstrumentationHandler("fetch",d=>{let l=wf(d,a,c,u);o&&l&&Cf(l)}),n&&W.addInstrumentationHandler("xhr",d=>{let l=xf(d,a,c,u);o&&l&&Cf(l)})}function MA(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function Cf(t){let e=t.data.url,n=new PerformanceObserver(r=>{r.getEntries().forEach(i=>{MA(i)&&i.name.endsWith(e)&&(UA(i).forEach(a=>t.setData(...a)),n.disconnect())})});n.observe({entryTypes:["resource"]})}function Df(t){let e="unknown",n="unknown",r="";for(let s of t){if(s==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(s))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=s}return r===t&&(e=r),{name:e,version:n}}function Oe(t=0){return((W.browserPerformanceTimeOrigin||performance.timeOrigin)+t)/1e3}function UA(t){let{name:e,version:n}=Df(t.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",e]),W.browserPerformanceTimeOrigin?[...r,["http.request.redirect_start",Oe(t.redirectStart)],["http.request.fetch_start",Oe(t.fetchStart)],["http.request.domain_lookup_start",Oe(t.domainLookupStart)],["http.request.domain_lookup_end",Oe(t.domainLookupEnd)],["http.request.connect_start",Oe(t.connectStart)],["http.request.secure_connection_start",Oe(t.secureConnectionStart)],["http.request.connection_end",Oe(t.connectEnd)],["http.request.request_start",Oe(t.requestStart)],["http.request.response_start",Oe(t.responseStart)],["http.request.response_end",Oe(t.responseEnd)]]:r}function Nf(t,e){return W.stringMatchesSomePattern(t,e||Ks)}function wf(t,e,n,r){if(!an.hasTracingEnabled()||!t.fetchData)return;let s=e(t.fetchData.url);if(t.endTimestamp&&s){let p=t.fetchData.__span;if(!p)return;let f=r[p];if(f){if(t.response){f.setHttpStatus(t.response.status);let m=t.response&&t.response.headers&&t.response.headers.get("content-length"),E=parseInt(m);E>0&&f.setData("http.response_content_length",E)}else t.error&&f.setStatus("internal_error");f.finish(),delete r[p]}return}let i=an.getCurrentHub(),o=i.getScope(),a=i.getClient(),c=o.getSpan(),{method:u,url:d}=t.fetchData,l=s&&c?c.startChild({data:{url:d,type:"fetch","http.method":u},description:`${u} ${d}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(l&&(t.fetchData.__span=l.spanId,r[l.spanId]=l),n(t.fetchData.url)&&a){let p=t.args[0];t.args[1]=t.args[1]||{};let f=t.args[1];f.headers=kf(p,a,o,f,l)}return l}function kf(t,e,n,r,s){let i=s||n.getSpan(),o=i&&i.transaction,{traceId:a,sampled:c,dsc:u}=n.getPropagationContext(),d=i?i.toTraceparent():W.generateSentryTraceHeader(a,void 0,c),l=o?o.getDynamicSamplingContext():u||an.getDynamicSamplingContextFromClient(a,e,n),p=W.dynamicSamplingContextToSentryBaggageHeader(l),f=typeof Request<"u"&&W.isInstanceOf(t,Request)?t.headers:r.headers;if(f)if(typeof Headers<"u"&&W.isInstanceOf(f,Headers)){let m=new Headers(f);return m.append("sentry-trace",d),p&&m.append(W.BAGGAGE_HEADER_NAME,p),m}else if(Array.isArray(f)){let m=[...f,["sentry-trace",d]];return p&&m.push([W.BAGGAGE_HEADER_NAME,p]),m}else{let m="baggage"in f?f.baggage:void 0,E=[];return Array.isArray(m)?E.push(...m):m&&E.push(m),p&&E.push(p),{...f,"sentry-trace":d,baggage:E.length>0?E.join(","):void 0}}else return{"sentry-trace":d,baggage:p}}function xf(t,e,n,r){let s=t.xhr,i=s&&s[W.SENTRY_XHR_DATA_KEY];if(!an.hasTracingEnabled()||s&&s.__sentry_own_request__||!s||!i)return;let o=e(i.url);if(t.endTimestamp&&o){let l=s.__sentry_xhr_span_id__;if(!l)return;let p=r[l];p&&(p.setHttpStatus(i.status_code),p.finish(),delete r[l]);return}let a=an.getCurrentHub(),c=a.getScope(),u=c.getSpan(),d=o&&u?u.startChild({data:{...i.data,type:"xhr","http.method":i.method,url:i.url},description:`${i.method} ${i.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(d&&(s.__sentry_xhr_span_id__=d.spanId,r[s.__sentry_xhr_span_id__]=d),s.setRequestHeader&&n(i.url))if(d){let l=d&&d.transaction,p=l&&l.getDynamicSamplingContext(),f=W.dynamicSamplingContextToSentryBaggageHeader(p);Of(s,d.toTraceparent(),f)}else{let l=a.getClient(),{traceId:p,sampled:f,dsc:m}=c.getPropagationContext(),E=W.generateSentryTraceHeader(p,void 0,f),b=m||(l?an.getDynamicSamplingContextFromClient(p,l,c):void 0),v=W.dynamicSamplingContextToSentryBaggageHeader(b);Of(s,E,v)}return d}function Of(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader(W.BAGGAGE_HEADER_NAME,n)}catch{}}De.DEFAULT_TRACE_PROPAGATION_TARGETS=Ks;De.addTracingHeadersToFetchRequest=kf;De.defaultRequestInstrumentationOptions=Ic;De.extractNetworkProtocol=Df;De.fetchCallback=wf;De.instrumentOutgoingRequests=PA;De.shouldAttachHeaders=Nf;De.xhrCallback=xf});var Pf=g(vc=>{Object.defineProperty(vc,"__esModule",{value:!0});var gr=T(),_r=je();function LA(t,e=!0,n=!0){if(!_r.WINDOW||!_r.WINDOW.location){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&gr.logger.warn("Could not initialize routing instrumentation due to invalid location");return}let r=_r.WINDOW.location.href,s;e&&(s=t({name:_r.WINDOW.location.pathname,startTimestamp:gr.browserPerformanceTimeOrigin?gr.browserPerformanceTimeOrigin/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),n&&gr.addInstrumentationHandler("history",({to:i,from:o})=>{if(o===void 0&&r&&r.indexOf(i)!==-1){r=void 0;return}o!==i&&(r=void 0,s&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&gr.logger.log(`[Tracing] Finishing current transaction with op: ${s.op}`),s.finish()),s=t({name:_r.WINDOW.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}vc.instrumentRoutingWithDefaults=LA});var qf=g(mr=>{Object.defineProperty(mr,"__esModule",{value:!0});var hr=N(),Ye=T(),qA=pf(),Ws=Rf(),Uf=Ac(),FA=Pf(),Mf=je(),Lf="BrowserTracing",GA={...hr.TRACING_DEFAULTS,markBackgroundTransactions:!0,routingInstrumentation:FA.instrumentRoutingWithDefaults,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...Uf.defaultRequestInstrumentationOptions},Rc=class{constructor(e){this.name=Lf,this._hasSetTracePropagationTargets=!1,hr.addTracingExtensions(),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!!(e&&(e.tracePropagationTargets||e.tracingOrigins))),this.options={...GA,...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=Ws.startTrackingWebVitals(),this.options.enableLongTask&&Ws.startTrackingLongTasks(),this.options._experiments.enableInteractions&&Ws.startTrackingInteractions()}setupOnce(e,n){this._getCurrentHub=n;let s=n().getClient(),i=s&&s.getOptions(),{routingInstrumentation:o,startTransactionOnLocationChange:a,startTransactionOnPageLoad:c,markBackgroundTransactions:u,traceFetch:d,traceXHR:l,shouldCreateSpanForRequest:p,enableHTTPTimings:f,_experiments:m}=this.options,E=i&&i.tracePropagationTargets,b=E||this.options.tracePropagationTargets;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&E&&Ye.logger.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."),o(v=>{let L=this._createRouteTransaction(v);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(L,v,n),L},c,a),u&&qA.registerBackgroundTabDetection(),m.enableInteractions&&this._registerInteractionListener(),Uf.instrumentOutgoingRequests({traceFetch:d,traceXHR:l,tracePropagationTargets:b,shouldCreateSpanForRequest:p,enableHTTPTimings:f})}_createRouteTransaction(e){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ye.logger.warn(`[Tracing] Did not create ${e.op} transaction because _getCurrentHub is invalid.`);return}let n=this._getCurrentHub(),{beforeNavigate:r,idleTimeout:s,finalTimeout:i,heartbeatInterval:o}=this.options,a=e.op==="pageload",c=a?Cc("sentry-trace"):"",u=a?Cc("baggage"):"",{traceparentData:d,dynamicSamplingContext:l,propagationContext:p}=Ye.tracingContextFromHeaders(c,u),f={...e,...d,metadata:{...e.metadata,dynamicSamplingContext:d&&!l?{}:l},trimEnd:!0},m=typeof r=="function"?r(f):f,E=m===void 0?{...f,sampled:!1}:m;E.metadata=E.name!==f.name?{...E.metadata,source:"custom"}:E.metadata,this._latestRouteName=E.name,this._latestRouteSource=E.metadata&&E.metadata.source,E.sampled===!1&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ye.logger.log(`[Tracing] Will not send ${E.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ye.logger.log(`[Tracing] Starting ${E.op} transaction on scope`);let{location:b}=Mf.WINDOW,v=hr.startIdleTransaction(n,E,s,i,!0,{location:b},o),L=n.getScope();return a&&d?L.setPropagationContext(p):L.setPropagationContext({traceId:v.traceId,spanId:v.spanId,parentSpanId:v.parentSpanId,sampled:v.sampled}),v.registerBeforeFinishCallback(se=>{this._collectWebVitals(),Ws.addPerformanceEntries(se)}),v}_registerInteractionListener(){let e,n=()=>{let{idleTimeout:r,finalTimeout:s,heartbeatInterval:i}=this.options,o="ui.action.click",a=hr.getActiveTransaction();if(a&&a.op&&["navigation","pageload"].includes(a.op)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ye.logger.warn(`[Tracing] Did not create ${o} 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__)&&Ye.logger.warn(`[Tracing] Did not create ${o} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRouteName){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ye.logger.warn(`[Tracing] Did not create ${o} transaction because _latestRouteName is missing.`);return}let c=this._getCurrentHub(),{location:u}=Mf.WINDOW,d={name:this._latestRouteName,op:o,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};e=hr.startIdleTransaction(c,d,r,s,!0,{location:u},i)};["click"].forEach(r=>{addEventListener(r,n,{once:!1,capture:!0})})}};function Cc(t){let e=Ye.getDomElement(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}mr.BROWSER_TRACING_INTEGRATION_ID=Lf;mr.BrowserTracing=Rc;mr.getMetaContent=Cc});var Gf=g((Oc,Er)=>{Object.defineProperty(Oc,"__esModule",{value:!0});var Ff=N(),cn=T();function BA(){let t=Ff.getMainCarrier();if(!t.__SENTRY__)return;let e={mongodb(){let r=cn.dynamicRequire(Er,"./node/integrations/mongo");return new r.Mongo},mongoose(){let r=cn.dynamicRequire(Er,"./node/integrations/mongo");return new r.Mongo},mysql(){let r=cn.dynamicRequire(Er,"./node/integrations/mysql");return new r.Mysql},pg(){let r=cn.dynamicRequire(Er,"./node/integrations/postgres");return new r.Postgres}},n=Object.keys(e).filter(r=>!!cn.loadModule(r)).map(r=>{try{return e[r]()}catch{return}}).filter(r=>r);n.length>0&&(t.__SENTRY__.integrations=[...t.__SENTRY__.integrations||[],...n])}function $A(){Ff.addTracingExtensions(),cn.isNodeEnv()&&BA()}Oc.addExtensionMethods=$A});var Nc=g(O=>{Object.defineProperty(O,"__esModule",{value:!0});var Ke=N(),Bf=T(),jA=Zp(),HA=ef(),YA=tf(),KA=nf(),WA=of(),VA=af(),zA=uf(),XA=df(),$f=qf(),Dc=Ac(),JA=Gf();O.IdleTransaction=Ke.IdleTransaction;O.Span=Ke.Span;O.SpanStatus=Ke.SpanStatus;O.Transaction=Ke.Transaction;O.extractTraceparentData=Ke.extractTraceparentData;O.getActiveTransaction=Ke.getActiveTransaction;O.hasTracingEnabled=Ke.hasTracingEnabled;O.spanStatusfromHttpCode=Ke.spanStatusfromHttpCode;O.startIdleTransaction=Ke.startIdleTransaction;O.TRACEPARENT_REGEXP=Bf.TRACEPARENT_REGEXP;O.stripUrlQueryAndFragment=Bf.stripUrlQueryAndFragment;O.Express=jA.Express;O.Postgres=HA.Postgres;O.Mysql=YA.Mysql;O.Mongo=KA.Mongo;O.Prisma=WA.Prisma;O.GraphQL=VA.GraphQL;O.Apollo=zA.Apollo;O.lazyLoadedNodePerformanceMonitoringIntegrations=XA.lazyLoadedNodePerformanceMonitoringIntegrations;O.BROWSER_TRACING_INTEGRATION_ID=$f.BROWSER_TRACING_INTEGRATION_ID;O.BrowserTracing=$f.BrowserTracing;O.addTracingHeadersToFetchRequest=Dc.addTracingHeadersToFetchRequest;O.defaultRequestInstrumentationOptions=Dc.defaultRequestInstrumentationOptions;O.instrumentOutgoingRequests=Dc.instrumentOutgoingRequests;O.addExtensionMethods=JA.addExtensionMethods});var jf=g(wc=>{Object.defineProperty(wc,"__esModule",{value:!0});var QA=Nc(),ZA=T();function ev(){let t=QA.lazyLoadedNodePerformanceMonitoringIntegrations.map(e=>{try{return e()}catch{return}}).filter(e=>!!e);return t.length===0&&ZA.logger.warn("Performance monitoring integrations could not be automatically loaded."),t.filter(e=>!!e.loadDependency())}wc.autoDiscoverNodePerformanceMonitoringIntegrations=ev});var Mc=g(Pc=>{Object.defineProperty(Pc,"__esModule",{value:!0});var kc=N(),tv=require("os"),nv=require("util"),xc=class extends kc.ServerRuntimeClient{constructor(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.node",packages:[{name:"npm:@sentry/node",version:kc.SDK_VERSION}],version:kc.SDK_VERSION},e.transportOptions={textEncoder:new nv.TextEncoder,...e.transportOptions};let n={...e,platform:"node",runtime:{name:"node",version:global.process.version},serverName:e.serverName||global.process.env.SENTRY_NAME||tv.hostname()};super(n)}};Pc.NodeClient=xc});var Yf=g((Zw,Hf)=>{var un=1e3,dn=un*60,ln=dn*60,Rt=ln*24,rv=Rt*7,sv=Rt*365.25;Hf.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return iv(t);if(n==="number"&&isFinite(t))return e.long?av(t):ov(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function iv(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*sv;case"weeks":case"week":case"w":return n*rv;case"days":case"day":case"d":return n*Rt;case"hours":case"hour":case"hrs":case"hr":case"h":return n*ln;case"minutes":case"minute":case"mins":case"min":case"m":return n*dn;case"seconds":case"second":case"secs":case"sec":case"s":return n*un;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function ov(t){var e=Math.abs(t);return e>=Rt?Math.round(t/Rt)+"d":e>=ln?Math.round(t/ln)+"h":e>=dn?Math.round(t/dn)+"m":e>=un?Math.round(t/un)+"s":t+"ms"}function av(t){var e=Math.abs(t);return e>=Rt?Vs(t,e,Rt,"day"):e>=ln?Vs(t,e,ln,"hour"):e>=dn?Vs(t,e,dn,"minute"):e>=un?Vs(t,e,un,"second"):t+" ms"}function Vs(t,e,n,r){var s=e>=n*1.5;return Math.round(t/n)+" "+r+(s?"s":"")}});var Uc=g((ek,Kf)=>{function cv(t){n.debug=n,n.default=n,n.coerce=c,n.disable=o,n.enable=s,n.enabled=a,n.humanize=Yf(),n.destroy=u,Object.keys(t).forEach(d=>{n[d]=t[d]}),n.names=[],n.skips=[],n.formatters={};function e(d){let l=0;for(let p=0;p<d.length;p++)l=(l<<5)-l+d.charCodeAt(p),l|=0;return n.colors[Math.abs(l)%n.colors.length]}n.selectColor=e;function n(d){let l,p=null,f,m;function E(...b){if(!E.enabled)return;let v=E,L=Number(new Date),se=L-(l||L);v.diff=se,v.prev=l,v.curr=L,l=L,b[0]=n.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let ie=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(x,Me)=>{if(x==="%%")return"%";ie++;let Se=n.formatters[Me];if(typeof Se=="function"){let ji=b[ie];x=Se.call(v,ji),b.splice(ie,1),ie--}return x}),n.formatArgs.call(v,b),(v.log||n.log).apply(v,b)}return E.namespace=d,E.useColors=n.useColors(),E.color=n.selectColor(d),E.extend=r,E.destroy=n.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(f!==n.namespaces&&(f=n.namespaces,m=n.enabled(d)),m),set:b=>{p=b}}),typeof n.init=="function"&&n.init(E),E}function r(d,l){let p=n(this.namespace+(typeof l>"u"?":":l)+d);return p.log=this.log,p}function s(d){n.save(d),n.namespaces=d,n.names=[],n.skips=[];let l=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let p of l)p[0]==="-"?n.skips.push(p.slice(1)):n.names.push(p)}function i(d,l){let p=0,f=0,m=-1,E=0;for(;p<d.length;)if(f<l.length&&(l[f]===d[p]||l[f]==="*"))l[f]==="*"?(m=f,E=p,f++):(p++,f++);else if(m!==-1)f=m+1,E++,p=E;else return!1;for(;f<l.length&&l[f]==="*";)f++;return f===l.length}function o(){let d=[...n.names,...n.skips.map(l=>"-"+l)].join(",");return n.enable(""),d}function a(d){for(let l of n.skips)if(i(d,l))return!1;for(let l of n.names)if(i(d,l))return!0;return!1}function c(d){return d instanceof Error?d.stack||d.message:d}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}Kf.exports=cv});var Wf=g((Z,zs)=>{Z.formatArgs=dv;Z.save=lv;Z.load=pv;Z.useColors=uv;Z.storage=fv();Z.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Z.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function uv(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function dv(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+zs.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(n++,s==="%c"&&(r=n))}),t.splice(r,0,e)}Z.log=console.debug||console.log||(()=>{});function lv(t){try{t?Z.storage.setItem("debug",t):Z.storage.removeItem("debug")}catch{}}function pv(){let t;try{t=Z.storage.getItem("debug")||Z.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function fv(){try{return localStorage}catch{}}zs.exports=Uc()(Z);var{formatters:gv}=zs.exports;gv.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var zf=g((tk,Vf)=>{"use strict";Vf.exports=(t,e=process.argv)=>{let n=t.startsWith("-")?"":t.length===1?"-":"--",r=e.indexOf(n+t),s=e.indexOf("--");return r!==-1&&(s===-1||r<s)}});var Qf=g((nk,Jf)=>{"use strict";var _v=require("os"),Xf=require("tty"),pe=zf(),{env:G}=process,ct;pe("no-color")||pe("no-colors")||pe("color=false")||pe("color=never")?ct=0:(pe("color")||pe("colors")||pe("color=true")||pe("color=always"))&&(ct=1);"FORCE_COLOR"in G&&(G.FORCE_COLOR==="true"?ct=1:G.FORCE_COLOR==="false"?ct=0:ct=G.FORCE_COLOR.length===0?1:Math.min(parseInt(G.FORCE_COLOR,10),3));function Lc(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function qc(t,e){if(ct===0)return 0;if(pe("color=16m")||pe("color=full")||pe("color=truecolor"))return 3;if(pe("color=256"))return 2;if(t&&!e&&ct===void 0)return 0;let n=ct||0;if(G.TERM==="dumb")return n;if(process.platform==="win32"){let r=_v.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in G)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in G)||G.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in G)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(G.TEAMCITY_VERSION)?1:0;if(G.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in G){let r=parseInt((G.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(G.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(G.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(G.TERM)||"COLORTERM"in G?1:n}function hv(t){let e=qc(t,t&&t.isTTY);return Lc(e)}Jf.exports={supportsColor:hv,stdout:Lc(qc(!0,Xf.isatty(1))),stderr:Lc(qc(!0,Xf.isatty(2)))}});var eg=g((B,Js)=>{var mv=require("tty"),Xs=require("util");B.init=Av;B.log=Tv;B.formatArgs=yv;B.save=bv;B.load=Iv;B.useColors=Ev;B.destroy=Xs.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");B.colors=[6,2,3,4,5,1];try{let t=Qf();t&&(t.stderr||t).level>=2&&(B.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}B.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let n=e.substring(6).toLowerCase().replace(/_([a-z])/g,(s,i)=>i.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),t[n]=r,t},{});function Ev(){return"colors"in B.inspectOpts?!!B.inspectOpts.colors:mv.isatty(process.stderr.fd)}function yv(t){let{namespace:e,useColors:n}=this;if(n){let r=this.color,s="\x1B[3"+(r<8?r:"8;5;"+r),i=` ${s};1m${e} \x1B[0m`;t[0]=i+t[0].split(`
11
+ `:"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return r}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(t=!1){if(t)return this.endSession();this._sendSessionUpdate()}endSession(){let n=this.getStackTop().scope,r=n.getSession();r&&da.closeSession(r),this._sendSessionUpdate(),n.setSession()}startSession(t){let{scope:n,client:r}=this.getStackTop(),{release:s,environment:o=oT.DEFAULT_ENVIRONMENT}=r&&r.getOptions()||{},{userAgent:i}=le.GLOBAL_OBJ.navigator||{},a=da.makeSession({release:s,environment:o,user:n.getUser(),...i&&{userAgent:i},...t}),c=n.getSession&&n.getSession();return c&&c.status==="ok"&&da.updateSession(c,{status:"exited"}),this.endSession(),n.setSession(a),a}shouldSendDefaultPii(){let t=this.getClient(),n=t&&t.getOptions();return!!(n&&n.sendDefaultPii)}_sendSessionUpdate(){let{scope:t,client:n}=this.getStackTop(),r=t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}_withClient(t){let{scope:n,client:r}=this.getStackTop();r&&t(r,n)}_callExtensionMethod(t,...n){let s=bt().__SENTRY__;if(s&&s.extensions&&typeof s.extensions[t]=="function")return s.extensions[t].apply(this,n);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&le.logger.warn(`Extension method ${t} couldn't be found, doing nothing.`)}};function bt(){return le.GLOBAL_OBJ.__SENTRY__=le.GLOBAL_OBJ.__SENTRY__||{extensions:{},hub:void 0},le.GLOBAL_OBJ}function pa(e){let t=bt(),n=er(t);return Is(t,e),n}function aT(){let e=bt();if(e.__SENTRY__&&e.__SENTRY__.acs){let t=e.__SENTRY__.acs.getCurrentHub();if(t)return t}return mp(e)}function mp(e=bt()){return(!Ep(e)||er(e).isOlderThan(bs))&&Is(e,new Zt),er(e)}function cT(e,t=mp()){if(!Ep(e)||er(e).isOlderThan(bs)){let n=t.getStackTop();Is(e,new Zt(n.client,la.Scope.clone(n.scope)))}}function uT(e){let t=bt();t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.acs=e}function dT(e,t={}){let n=bt();return n.__SENTRY__&&n.__SENTRY__.acs?n.__SENTRY__.acs.runWithAsyncContext(e,t):e()}function Ep(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function er(e){return le.getGlobalSingleton("hub",()=>new Zt,e)}function Is(e,t){if(!e)return!1;let n=e.__SENTRY__=e.__SENTRY__||{};return n.hub=t,!0}pe.API_VERSION=bs;pe.Hub=Zt;pe.ensureHubOnCarrier=cT;pe.getCurrentHub=aT;pe.getHubFromCarrier=er;pe.getMainCarrier=bt;pe.makeMain=pa;pe.runWithAsyncContext=dT;pe.setAsyncContextStrategy=uT;pe.setHubOnCarrier=Is});var As=g(en=>{Object.defineProperty(en,"__esModule",{value:!0});var lT=fe(),fa=T();function pT(e){return(e||lT.getCurrentHub()).getScope().getTransaction()}en.TRACEPARENT_REGEXP=fa.TRACEPARENT_REGEXP;en.extractTraceparentData=fa.extractTraceparentData;en.stripUrlQueryAndFragment=fa.stripUrlQueryAndFragment;en.getActiveTransaction=pT});var Sp=g(ha=>{Object.defineProperty(ha,"__esModule",{value:!0});var ga=T(),fT=As(),yp=!1;function gT(){yp||(yp=!0,ga.addInstrumentationHandler("error",_a),ga.addInstrumentationHandler("unhandledrejection",_a))}function _a(){let e=fT.getActiveTransaction();if(e){let t="internal_error";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ga.logger.log(`[Tracing] Transaction: ${t} -> Global error occured`),e.setStatus(t)}}_a.tag="sentry_tracingErrorCallback";ha.registerErrorInstrumentation=gT});var Rs=g(tr=>{Object.defineProperty(tr,"__esModule",{value:!0});var ve=T(),ma=class{constructor(t=1e3){this._maxlen=t,this.spans=[]}add(t){this.spans.length>this._maxlen?t.spanRecorder=void 0:this.spans.push(t)}},Ea=class e{constructor(t={}){this.traceId=t.traceId||ve.uuid4(),this.spanId=t.spanId||ve.uuid4().substring(16),this.startTimestamp=t.startTimestamp||ve.timestampInSeconds(),this.tags=t.tags||{},this.data=t.data||{},this.instrumenter=t.instrumenter||"sentry",this.origin=t.origin||"manual",t.parentSpanId&&(this.parentSpanId=t.parentSpanId),"sampled"in t&&(this.sampled=t.sampled),t.op&&(this.op=t.op),t.description&&(this.description=t.description),t.name&&(this.description=t.name),t.status&&(this.status=t.status),t.endTimestamp&&(this.endTimestamp=t.endTimestamp)}get name(){return this.description||""}set name(t){this.setName(t)}startChild(t){let n=new e({...t,parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId});if(n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n),n.transaction=this.transaction,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&n.transaction){let r=t&&t.op||"< unknown op >",s=n.transaction.name||"< unknown name >",o=n.transaction.spanId,i=`[Tracing] Starting '${r}' span on transaction '${s}' (${o}).`;n.transaction.metadata.spanMetadata[n.spanId]={logMessage:i},ve.logger.log(i)}return n}setTag(t,n){return this.tags={...this.tags,[t]:n},this}setData(t,n){return this.data={...this.data,[t]:n},this}setStatus(t){return this.status=t,this}setHttpStatus(t){this.setTag("http.status_code",String(t)),this.setData("http.response.status_code",t);let n=Tp(t);return n!=="unknown_error"&&this.setStatus(n),this}setName(t){this.description=t}isSuccess(){return this.status==="ok"}finish(t){if((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this.transaction&&this.transaction.spanId!==this.spanId){let{logMessage:n}=this.transaction.metadata.spanMetadata[this.spanId];n&&ve.logger.log(n.replace("Starting","Finishing"))}this.endTimestamp=typeof t=="number"?t:ve.timestampInSeconds()}toTraceparent(){return ve.generateSentryTraceHeader(this.traceId,this.spanId,this.sampled)}toContext(){return ve.dropUndefinedKeys({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(t){return this.data=t.data||{},this.description=t.description,this.endTimestamp=t.endTimestamp,this.op=t.op,this.parentSpanId=t.parentSpanId,this.sampled=t.sampled,this.spanId=t.spanId||this.spanId,this.startTimestamp=t.startTimestamp||this.startTimestamp,this.status=t.status,this.tags=t.tags||{},this.traceId=t.traceId||this.traceId,this}getTraceContext(){return ve.dropUndefinedKeys({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 ve.dropUndefinedKeys({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 Tp(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"}tr.Span=Ea;tr.SpanRecorder=ma;tr.spanStatusfromHttpCode=Tp});var nr=g(ya=>{Object.defineProperty(ya,"__esModule",{value:!0});var _T=T(),hT=Wn();function mT(e,t,n){let r=t.getOptions(),{publicKey:s}=t.getDsn()||{},{segment:o}=n&&n.getUser()||{},i=_T.dropUndefinedKeys({environment:r.environment||hT.DEFAULT_ENVIRONMENT,release:r.release,user_segment:o,public_key:s,trace_id:e});return t.emit&&t.emit("createDsc",i),i}ya.getDynamicSamplingContextFromClient=mT});var vs=g(Ta=>{Object.defineProperty(Ta,"__esModule",{value:!0});var rr=T(),bp=fe(),ET=nr(),Ip=Rs(),Sa=class extends Ip.Span{constructor(t,n){super(t),delete this.description,this._measurements={},this._contexts={},this._hub=n||bp.getCurrentHub(),this._name=t.name||"",this.metadata={source:"custom",...t.metadata,spanMetadata:{}},this._trimEnd=t.trimEnd,this.transaction=this;let r=this.metadata.dynamicSamplingContext;r&&(this._frozenDynamicSamplingContext={...r})}get name(){return this._name}set name(t){this.setName(t)}setName(t,n="custom"){this._name=t,this.metadata.source=n}initSpanRecorder(t=1e3){this.spanRecorder||(this.spanRecorder=new Ip.SpanRecorder(t)),this.spanRecorder.add(this)}setContext(t,n){n===null?delete this._contexts[t]:this._contexts[t]=n}setMeasurement(t,n,r=""){this._measurements[t]={value:n,unit:r}}setMetadata(t){this.metadata={...this.metadata,...t}}finish(t){let n=this._finishTransaction(t);if(n)return this._hub.captureEvent(n)}toContext(){let t=super.toContext();return rr.dropUndefinedKeys({...t,name:this.name,trimEnd:this._trimEnd})}updateWithContext(t){return super.updateWithContext(t),this.name=t.name||"",this._trimEnd=t.trimEnd,this}getDynamicSamplingContext(){if(this._frozenDynamicSamplingContext)return this._frozenDynamicSamplingContext;let t=this._hub||bp.getCurrentHub(),n=t.getClient();if(!n)return{};let r=t.getScope(),s=ET.getDynamicSamplingContextFromClient(this.traceId,n,r),o=this.metadata.sampleRate;o!==void 0&&(s.sample_rate=`${o}`);let i=this.metadata.source;return i&&i!=="url"&&(s.transaction=this.name),this.sampled!==void 0&&(s.sampled=String(this.sampled)),s}setHub(t){this._hub=t}_finishTransaction(t){if(this.endTimestamp!==void 0)return;this.name||((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&rr.logger.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),super.finish(t);let n=this._hub.getClient();if(n&&n.emit&&n.emit("finishTransaction",this),this.sampled!==!0){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&rr.logger.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),n&&n.recordDroppedEvent("sample_rate","transaction");return}let r=this.spanRecorder?this.spanRecorder.spans.filter(a=>a!==this&&a.endTimestamp):[];this._trimEnd&&r.length>0&&(this.endTimestamp=r.reduce((a,c)=>a.endTimestamp&&c.endTimestamp?a.endTimestamp>c.endTimestamp?a:c:a).endTimestamp);let s=this.metadata,o={contexts:{...this._contexts,trace:this.getTraceContext()},spans:r,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",sdkProcessingMetadata:{...s,dynamicSamplingContext:this.getDynamicSamplingContext()},...s.source&&{transaction_info:{source:s.source}}};return Object.keys(this._measurements).length>0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&rr.logger.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),o.measurements=this._measurements),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&rr.logger.log(`[Tracing] Finishing ${this.op} transaction: ${this.name}.`),o}};Ta.Transaction=Sa});var Ia=g(sr=>{Object.defineProperty(sr,"__esModule",{value:!0});var $=T(),yT=Rs(),ST=vs(),Os={idleTimeout:1e3,finalTimeout:3e4,heartbeatInterval:5e3},TT="finishReason",tn=["heartbeatFailed","idleTimeout","documentHidden","finalTimeout","externalFinish","cancelled"],Cs=class extends yT.SpanRecorder{constructor(t,n,r,s){super(s),this._pushActivity=t,this._popActivity=n,this.transactionSpanId=r}add(t){t.spanId!==this.transactionSpanId&&(t.finish=n=>{t.endTimestamp=typeof n=="number"?n:$.timestampInSeconds(),this._popActivity(t.spanId)},t.endTimestamp===void 0&&this._pushActivity(t.spanId)),super.add(t)}},ba=class extends ST.Transaction{constructor(t,n,r=Os.idleTimeout,s=Os.finalTimeout,o=Os.heartbeatInterval,i=!1){super(t,n),this._idleHub=n,this._idleTimeout=r,this._finalTimeout=s,this._heartbeatInterval=o,this._onScope=i,this.activities={},this._heartbeatCounter=0,this._finished=!1,this._idleTimeoutCanceledPermanently=!1,this._beforeFinishCallbacks=[],this._finishReason=tn[4],i&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&$.logger.log(`Setting idle transaction on scope. Span ID: ${this.spanId}`),n.configureScope(a=>a.setSpan(this))),this._restartIdleTimeout(),setTimeout(()=>{this._finished||(this.setStatus("deadline_exceeded"),this._finishReason=tn[3],this.finish())},this._finalTimeout)}finish(t=$.timestampInSeconds()){if(this._finished=!0,this.activities={},this.op==="ui.action.click"&&this.setTag(TT,this._finishReason),this.spanRecorder){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&$.logger.log("[Tracing] finishing IdleTransaction",new Date(t*1e3).toISOString(),this.op);for(let n of this._beforeFinishCallbacks)n(this,t);this.spanRecorder.spans=this.spanRecorder.spans.filter(n=>{if(n.spanId===this.spanId)return!0;n.endTimestamp||(n.endTimestamp=t,n.setStatus("cancelled"),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&$.logger.log("[Tracing] cancelling span since transaction ended early",JSON.stringify(n,void 0,2)));let r=n.startTimestamp<t,s=(this._finalTimeout+this._idleTimeout)/1e3,o=n.endTimestamp-this.startTimestamp<s;if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let i=JSON.stringify(n,void 0,2);r?o||$.logger.log("[Tracing] discarding Span since it finished after Transaction final timeout",i):$.logger.log("[Tracing] discarding Span since it happened after Transaction was finished",i)}return r&&o}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&$.logger.log("[Tracing] flushing IdleTransaction")}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&$.logger.log("[Tracing] No active IdleTransaction");if(this._onScope){let n=this._idleHub.getScope();n.getTransaction()===this&&n.setSpan(void 0)}return super.finish(t)}registerBeforeFinishCallback(t){this._beforeFinishCallbacks.push(t)}initSpanRecorder(t){if(!this.spanRecorder){let n=s=>{this._finished||this._pushActivity(s)},r=s=>{this._finished||this._popActivity(s)};this.spanRecorder=new Cs(n,r,this.spanId,t),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&$.logger.log("Starting heartbeat"),this._pingHeartbeat()}this.spanRecorder.add(this)}cancelIdleTimeout(t,{restartOnChildSpanChange:n}={restartOnChildSpanChange:!0}){this._idleTimeoutCanceledPermanently=n===!1,this._idleTimeoutID&&(clearTimeout(this._idleTimeoutID),this._idleTimeoutID=void 0,Object.keys(this.activities).length===0&&this._idleTimeoutCanceledPermanently&&(this._finishReason=tn[5],this.finish(t)))}setFinishReason(t){this._finishReason=t}_restartIdleTimeout(t){this.cancelIdleTimeout(),this._idleTimeoutID=setTimeout(()=>{!this._finished&&Object.keys(this.activities).length===0&&(this._finishReason=tn[1],this.finish(t))},this._idleTimeout)}_pushActivity(t){this.cancelIdleTimeout(void 0,{restartOnChildSpanChange:!this._idleTimeoutCanceledPermanently}),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&$.logger.log(`[Tracing] pushActivity: ${t}`),this.activities[t]=!0,(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&$.logger.log("[Tracing] new activities count",Object.keys(this.activities).length)}_popActivity(t){if(this.activities[t]&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&$.logger.log(`[Tracing] popActivity ${t}`),delete this.activities[t],(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&$.logger.log("[Tracing] new activities count",Object.keys(this.activities).length)),Object.keys(this.activities).length===0){let n=$.timestampInSeconds();this._idleTimeoutCanceledPermanently?(this._finishReason=tn[5],this.finish(n)):this._restartIdleTimeout(n+this._idleTimeout/1e3)}}_beat(){if(this._finished)return;let t=Object.keys(this.activities).join("");t===this._prevHeartbeatString?this._heartbeatCounter++:this._heartbeatCounter=1,this._prevHeartbeatString=t,this._heartbeatCounter>=3?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&$.logger.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus("deadline_exceeded"),this._finishReason=tn[0],this.finish()):this._pingHeartbeat()}_pingHeartbeat(){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&$.logger.log(`pinging Heartbeat -> current counter: ${this._heartbeatCounter}`),setTimeout(()=>{this._beat()},this._heartbeatInterval)}};sr.IdleTransaction=ba;sr.IdleTransactionSpanRecorder=Cs;sr.TRACING_DEFAULTS=Os});var Ds=g(Aa=>{Object.defineProperty(Aa,"__esModule",{value:!0});var bT=fe();function IT(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=bT.getCurrentHub().getClient(),n=e||t&&t.getOptions();return!!n&&(n.enableTracing||"tracesSampleRate"in n||"tracesSampler"in n)}Aa.hasTracingEnabled=IT});var Ap=g(Ra=>{Object.defineProperty(Ra,"__esModule",{value:!0});var It=T(),AT=Ds();function RT(e,t,n){if(!AT.hasTracingEnabled(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})),vT(r)?r?(e.sampled=Math.random()<r,e.sampled?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&It.logger.log(`[Tracing] starting ${e.op} transaction - ${e.name}`),e):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&It.logger.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(r)})`),e)):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&It.logger.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__)&&It.logger.warn("[Tracing] Discarding transaction because of invalid sample rate."),e.sampled=!1,e)}function vT(e){return It.isNaN(e)||!(typeof e=="number"||typeof e=="boolean")?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&It.logger.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__)&&It.logger.warn(`[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got ${e}.`),!1):!0}Ra.sampleTransaction=RT});var va=g(Ns=>{Object.defineProperty(Ns,"__esModule",{value:!0});var OT=T(),CT=fe(),DT=Sp(),NT=Ia(),Rp=Ap(),wT=vs();function kT(){let t=this.getScope().getSpan();return t?{"sentry-trace":t.toTraceparent()}:{}}function xT(e,t){let n=this.getClient(),r=n&&n.getOptions()||{},s=r.instrumenter||"sentry",o=e.instrumenter||"sentry";s!==o&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&OT.logger.error(`A transaction was started with instrumenter=\`${o}\`, but the SDK is configured with the \`${s}\` instrumenter.
12
+ The transaction will not be sampled. Please use the ${s} instrumentation to start transactions.`),e.sampled=!1);let i=new wT.Transaction(e,this);return i=Rp.sampleTransaction(i,r,{parentSampled:e.parentSampled,transactionContext:e,...t}),i.sampled&&i.initSpanRecorder(r._experiments&&r._experiments.maxSpans),n&&n.emit&&n.emit("startTransaction",i),i}function PT(e,t,n,r,s,o,i){let a=e.getClient(),c=a&&a.getOptions()||{},u=new NT.IdleTransaction(t,e,n,r,i,s);return u=Rp.sampleTransaction(u,c,{parentSampled:t.parentSampled,transactionContext:t,...o}),u.sampled&&u.initSpanRecorder(c._experiments&&c._experiments.maxSpans),a&&a.emit&&a.emit("startTransaction",u),u}function UT(){let e=CT.getMainCarrier();e.__SENTRY__&&(e.__SENTRY__.extensions=e.__SENTRY__.extensions||{},e.__SENTRY__.extensions.startTransaction||(e.__SENTRY__.extensions.startTransaction=xT),e.__SENTRY__.extensions.traceHeaders||(e.__SENTRY__.extensions.traceHeaders=kT),DT.registerErrorInstrumentation())}Ns.addTracingExtensions=UT;Ns.startIdleTransaction=PT});var Oa=g(or=>{Object.defineProperty(or,"__esModule",{value:!0});or.SpanStatus=void 0;(function(e){e.Ok="ok";let n="deadline_exceeded";e.DeadlineExceeded=n;let r="unauthenticated";e.Unauthenticated=r;let s="permission_denied";e.PermissionDenied=s;let o="not_found";e.NotFound=o;let i="resource_exhausted";e.ResourceExhausted=i;let a="invalid_argument";e.InvalidArgument=a;let c="unimplemented";e.Unimplemented=c;let u="unavailable";e.Unavailable=u;let d="internal_error";e.InternalError=d;let l="unknown_error";e.UnknownError=l;let p="cancelled";e.Cancelled=p;let f="already_exists";e.AlreadyExists=f;let m="failed_precondition";e.FailedPrecondition=m;let E="aborted";e.Aborted=E;let I="out_of_range";e.OutOfRange=I;let R="data_loss";e.DataLoss=R})(or.SpanStatus||(or.SpanStatus={}))});var Dp=g($e=>{Object.defineProperty($e,"__esModule",{value:!0});var nn=T(),rn=fe(),vp=Ds();function MT(e,t,n=()=>{}){let r=Da(e),s=rn.getCurrentHub(),o=s.getScope(),i=o.getSpan(),a=Ca(s,i,r);o.setSpan(a);function c(){a&&a.finish(),s.getScope().setSpan(i)}let u;try{u=t(a)}catch(d){throw a&&a.setStatus("internal_error"),n(d),c(),d}return nn.isThenable(u)?Promise.resolve(u).then(()=>{c()},d=>{a&&a.setStatus("internal_error"),n(d),c()}):c(),u}function Op(e,t){let n=Da(e),r=rn.getCurrentHub(),s=r.getScope(),o=s.getSpan(),i=Ca(r,o,n);s.setSpan(i);function a(){i&&i.finish(),r.getScope().setSpan(o)}let c;try{c=t(i)}catch(u){throw i&&i.setStatus("internal_error"),a(),u}return nn.isThenable(c)?Promise.resolve(c).then(()=>{a()},()=>{i&&i.setStatus("internal_error"),a()}):a(),c}var LT=Op;function qT(e,t){let n=Da(e),r=rn.getCurrentHub(),s=r.getScope(),o=s.getSpan(),i=Ca(r,o,n);s.setSpan(i);function a(){i&&i.finish(),r.getScope().setSpan(o)}let c;try{c=t(i,a)}catch(u){throw i&&i.setStatus("internal_error"),u}return nn.isThenable(c)&&Promise.resolve(c).then(void 0,()=>{i&&i.setStatus("internal_error")}),c}function FT(e){if(!vp.hasTracingEnabled())return;let t={...e};t.name!==void 0&&t.description===void 0&&(t.description=t.name);let n=rn.getCurrentHub(),r=Cp();return r?r.startChild(t):n.startTransaction(t)}function Cp(){return rn.getCurrentHub().getScope().getSpan()}function GT({sentryTrace:e,baggage:t},n){let s=rn.getCurrentHub().getScope(),{traceparentData:o,dynamicSamplingContext:i,propagationContext:a}=nn.tracingContextFromHeaders(e,t);s.setPropagationContext(a),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&o&&nn.logger.log(`[Tracing] Continuing trace ${o.traceId}.`);let c={...o,metadata:nn.dropUndefinedKeys({dynamicSamplingContext:o&&!i?{}:i})};return n(c)}function Ca(e,t,n){if(vp.hasTracingEnabled())return t?t.startChild(n):e.startTransaction(n)}function Da(e){let t={...e};return t.name!==void 0&&t.description===void 0&&(t.description=t.name),t}$e.continueTrace=GT;$e.getActiveSpan=Cp;$e.startActiveSpan=LT;$e.startInactiveSpan=FT;$e.startSpan=Op;$e.startSpanManual=qT;$e.trace=MT});var Np=g(Na=>{Object.defineProperty(Na,"__esModule",{value:!0});var BT=As();function jT(e,t,n){let r=BT.getActiveTransaction();r&&r.setMeasurement(e,t,n)}Na.setMeasurement=jT});var wp=g(P=>{Object.defineProperty(P,"__esModule",{value:!0});var ir=T(),H=fe();function $T(e,t){return H.getCurrentHub().captureException(e,{captureContext:t})}function HT(e,t){let n=typeof t=="string"?t:void 0,r=typeof t!="string"?{captureContext:t}:void 0;return H.getCurrentHub().captureMessage(e,n,r)}function YT(e,t){return H.getCurrentHub().captureEvent(e,t)}function KT(e){H.getCurrentHub().configureScope(e)}function WT(e){H.getCurrentHub().addBreadcrumb(e)}function VT(e,t){H.getCurrentHub().setContext(e,t)}function zT(e){H.getCurrentHub().setExtras(e)}function XT(e,t){H.getCurrentHub().setExtra(e,t)}function JT(e){H.getCurrentHub().setTags(e)}function QT(e,t){H.getCurrentHub().setTag(e,t)}function ZT(e){H.getCurrentHub().setUser(e)}function eb(e){H.getCurrentHub().withScope(e)}function tb(e,t){return H.getCurrentHub().startTransaction({...e},t)}function nb(e,t){let n=H.getCurrentHub(),r=n.getScope(),s=n.getClient();if(!s)(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ir.logger.warn("Cannot capture check-in. No client defined.");else if(!s.captureCheckIn)(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ir.logger.warn("Cannot capture check-in. Client does not support sending check-ins.");else return s.captureCheckIn(e,t,r);return ir.uuid4()}async function rb(e){let t=H.getCurrentHub().getClient();return t?t.flush(e):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ir.logger.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function sb(e){let t=H.getCurrentHub().getClient();return t?t.close(e):((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ir.logger.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function ob(){return H.getCurrentHub().lastEventId()}P.addBreadcrumb=WT;P.captureCheckIn=nb;P.captureEvent=YT;P.captureException=$T;P.captureMessage=HT;P.close=sb;P.configureScope=KT;P.flush=rb;P.lastEventId=ob;P.setContext=VT;P.setExtra=XT;P.setExtras=zT;P.setTag=QT;P.setTags=JT;P.setUser=ZT;P.startTransaction=tb;P.withScope=eb});var xa=g(ka=>{Object.defineProperty(ka,"__esModule",{value:!0});var ib=T(),ab=fe(),wa=class{constructor(t,n){this._client=t,this.flushTimeout=60,this._pendingAggregates={},this._isEnabled=!0,this._intervalId=setInterval(()=>this.flush(),this.flushTimeout*1e3),this._sessionAttrs=n}flush(){let t=this.getSessionAggregates();t.aggregates.length!==0&&(this._pendingAggregates={},this._client.sendSession(t))}getSessionAggregates(){let t=Object.keys(this._pendingAggregates).map(r=>this._pendingAggregates[parseInt(r)]),n={attrs:this._sessionAttrs,aggregates:t};return ib.dropUndefinedKeys(n)}close(){clearInterval(this._intervalId),this._isEnabled=!1,this.flush()}incrementSessionStatusCount(){if(!this._isEnabled)return;let t=ab.getCurrentHub().getScope(),n=t.getRequestSession();n&&n.status&&(this._incrementSessionStatusCount(n.status,new Date),t.setRequestSession(void 0))}_incrementSessionStatusCount(t,n){let r=new Date(n).setSeconds(0,0);this._pendingAggregates[r]=this._pendingAggregates[r]||{};let s=this._pendingAggregates[r];switch(s.started||(s.started=new Date(r).toISOString()),t){case"errored":return s.errored=(s.errored||0)+1,s.errored;case"ok":return s.exited=(s.exited||0)+1,s.exited;default:return s.crashed=(s.crashed||0)+1,s.crashed}}};ka.SessionFlusher=wa});var ks=g(ws=>{Object.defineProperty(ws,"__esModule",{value:!0});var Pa=T(),cb="7";function kp(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function ub(e){return`${kp(e)}${e.projectId}/envelope/`}function db(e,t){return Pa.urlEncode({sentry_key:e.publicKey,sentry_version:cb,...t&&{sentry_client:`${t.name}/${t.version}`}})}function lb(e,t={}){let n=typeof t=="string"?t:t.tunnel,r=typeof t=="string"||!t._metadata?void 0:t._metadata.sdk;return n||`${ub(e)}?${db(e,r)}`}function pb(e,t){let n=Pa.makeDsn(e);if(!n)return"";let r=`${kp(n)}embed/error-page/`,s=`dsn=${Pa.dsnToString(n)}`;for(let o in t)if(o!=="dsn")if(o==="user"){let i=t.user;if(!i)continue;i.name&&(s+=`&name=${encodeURIComponent(i.name)}`),i.email&&(s+=`&email=${encodeURIComponent(i.email)}`)}else s+=`&${encodeURIComponent(o)}=${encodeURIComponent(t[o])}`;return`${r}?${s}`}ws.getEnvelopeEndpointWithUrlEncodedAuth=lb;ws.getReportDialogEndpoint=pb});var xp=g(xs=>{Object.defineProperty(xs,"__esModule",{value:!0});var sn=T();function fb(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 gb(e,t,n,r){let s=sn.getSdkMetadataForEnvelopeHeader(n),o={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:sn.dsnToString(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return sn.createEnvelope(o,[i])}function _b(e,t,n,r){let s=sn.getSdkMetadataForEnvelopeHeader(n),o=e.type&&e.type!=="replay_event"?e.type:"event";fb(e,n&&n.sdk);let i=sn.createEventEnvelopeHeaders(e,s,r,t);delete e.sdkProcessingMetadata;let a=[{type:o},e];return sn.createEnvelope(i,[a])}xs.createEventEnvelope=_b;xs.createSessionEnvelope=gb});var La=g(At=>{Object.defineProperty(At,"__esModule",{value:!0});var Ma=T(),hb=zn(),Pp=fe(),Ua=[];function mb(e){let t={};return e.forEach(n=>{let{name:r}=n,s=t[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.keys(t).map(n=>t[n])}function Eb(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(i=>{i.isDefaultInstance=!0});let r;Array.isArray(n)?r=[...t,...n]:typeof n=="function"?r=Ma.arrayify(n(t)):r=t;let s=mb(r),o=Tb(s,i=>i.name==="Debug");if(o!==-1){let[i]=s.splice(o,1);s.push(i)}return s}function yb(e,t){let n={};return t.forEach(r=>{r&&Up(e,r,n)}),n}function Up(e,t,n){if(n[t.name]=t,Ua.indexOf(t.name)===-1&&(t.setupOnce(hb.addGlobalEventProcessor,Pp.getCurrentHub),Ua.push(t.name)),e.on&&typeof t.preprocessEvent=="function"){let r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(s,o)=>r(s,o,e))}if(e.addEventProcessor&&typeof t.processEvent=="function"){let r=t.processEvent.bind(t),s=Object.assign((o,i)=>r(o,i,e),{id:t.name});e.addEventProcessor(s)}(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ma.logger.log(`Integration installed: ${t.name}`)}function Sb(e){let t=Pp.getCurrentHub().getClient();if(!t||!t.addIntegration){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ma.logger.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}function Tb(e,t){for(let n=0;n<e.length;n++)if(t(e[n])===!0)return n;return-1}At.addIntegration=Sb;At.getIntegrationsToSetup=Eb;At.installedIntegrations=Ua;At.setupIntegration=Up;At.setupIntegrations=yb});var qa=g(ar=>{Object.defineProperty(ar,"__esModule",{value:!0});var ne=T(),bb=Wn(),Mp=zn(),Ib=Ts();function Ab(e,t,n,r,s){let{normalizeDepth:o=3,normalizeMaxBreadth:i=1e3}=e,a={...t,event_id:t.event_id||n.event_id||ne.uuid4(),timestamp:t.timestamp||ne.dateTimestampInSeconds()},c=n.integrations||e.integrations.map(p=>p.name);Rb(a,e),vb(a,c),t.type===void 0&&qp(a,e.stackParser);let u=r;n.captureContext&&(u=Ib.Scope.clone(u).update(n.captureContext));let d=ne.resolvedSyncPromise(a),l=s&&s.getEventProcessors?s.getEventProcessors():[];if(u){if(u.getAttachments){let p=[...n.attachments||[],...u.getAttachments()];p.length&&(n.attachments=p)}d=u.applyToEvent(a,n,l)}else d=Mp.notifyEventProcessors([...l,...Mp.getGlobalEventProcessors()],a,n);return d.then(p=>(p&&Fp(p),typeof o=="number"&&o>0?Ob(p,o,i):p))}function Rb(e,t){let{environment:n,release:r,dist:s,maxValueLength:o=250}=t;"environment"in e||(e.environment="environment"in t?n:bb.DEFAULT_ENVIRONMENT),e.release===void 0&&r!==void 0&&(e.release=r),e.dist===void 0&&s!==void 0&&(e.dist=s),e.message&&(e.message=ne.truncate(e.message,o));let i=e.exception&&e.exception.values&&e.exception.values[0];i&&i.value&&(i.value=ne.truncate(i.value,o));let a=e.request;a&&a.url&&(a.url=ne.truncate(a.url,o))}var Lp=new WeakMap;function qp(e,t){let n=ne.GLOBAL_OBJ._sentryDebugIds;if(!n)return;let r,s=Lp.get(t);s?r=s:(r=new Map,Lp.set(t,r));let o=Object.keys(n).reduce((i,a)=>{let c,u=r.get(a);u?c=u:(c=t(a),r.set(a,c));for(let d=c.length-1;d>=0;d--){let l=c[d];if(l.filename){i[l.filename]=n[a];break}}return i},{});try{e.exception.values.forEach(i=>{i.stacktrace.frames.forEach(a=>{a.filename&&(a.debug_id=o[a.filename])})})}catch{}}function Fp(e){let t={};try{e.exception.values.forEach(r=>{r.stacktrace.frames.forEach(s=>{s.debug_id&&(s.abs_path?t[s.abs_path]=s.debug_id:s.filename&&(t[s.filename]=s.debug_id),delete s.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 vb(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Ob(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(s=>({...s,...s.data&&{data:ne.normalize(s.data,t,n)}}))},...e.user&&{user:ne.normalize(e.user,t,n)},...e.contexts&&{contexts:ne.normalize(e.contexts,t,n)},...e.extra&&{extra:ne.normalize(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=ne.normalize(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(s=>(s.data&&(s.data=ne.normalize(s.data,t,n)),s))),r}ar.applyDebugIds=qp;ar.applyDebugMeta=Fp;ar.prepareEvent=Ab});var Ba=g(Ga=>{Object.defineProperty(Ga,"__esModule",{value:!0});var O=T(),Cb=ks(),Gp=xp(),Bp=La(),jp=Qn(),Db=nr(),Nb=qa(),$p="Not capturing exception because it's already been captured.",Fa=class{constructor(t){if(this._options=t,this._integrations={},this._integrationsInitialized=!1,this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],t.dsn?this._dsn=O.makeDsn(t.dsn):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&O.logger.warn("No DSN provided, client will not send events."),this._dsn){let n=Cb.getEnvelopeEndpointWithUrlEncodedAuth(this._dsn,t);this._transport=t.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:n})}}captureException(t,n,r){if(O.checkOrSetAlreadyCaught(t)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&O.logger.log($p);return}let s=n&&n.event_id;return this._process(this.eventFromException(t,n).then(o=>this._captureEvent(o,n,r)).then(o=>{s=o})),s}captureMessage(t,n,r,s){let o=r&&r.event_id,i=O.isPrimitive(t)?this.eventFromMessage(String(t),n,r):this.eventFromException(t,r);return this._process(i.then(a=>this._captureEvent(a,r,s)).then(a=>{o=a})),o}captureEvent(t,n,r){if(n&&n.originalException&&O.checkOrSetAlreadyCaught(n.originalException)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&O.logger.log($p);return}let s=n&&n.event_id;return this._process(this._captureEvent(t,n,r).then(o=>{s=o})),s}captureSession(t){typeof t.release!="string"?(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&O.logger.warn("Discarded session because of missing or non-string release"):(this.sendSession(t),jp.updateSession(t,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(t){let n=this._transport;return n?this._isClientDoneProcessing(t).then(r=>n.flush(t).then(s=>r&&s)):O.resolvedSyncPromise(!0)}close(t){return this.flush(t).then(n=>(this.getOptions().enabled=!1,n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}setupIntegrations(t){(t&&!this._integrationsInitialized||this._isEnabled()&&!this._integrationsInitialized)&&(this._integrations=Bp.setupIntegrations(this,this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(t){return this._integrations[t]}getIntegration(t){try{return this._integrations[t.id]||null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&O.logger.warn(`Cannot retrieve integration ${t.id} from the current Client`),null}}addIntegration(t){Bp.setupIntegration(this,t,this._integrations)}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=Gp.createEventEnvelope(t,this._dsn,this._options._metadata,this._options.tunnel);for(let o of n.attachments||[])r=O.addItemToEnvelope(r,O.createAttachmentEnvelopeItem(o,this._options.transportOptions&&this._options.transportOptions.textEncoder));let s=this._sendEnvelope(r);s&&s.then(o=>this.emit("afterSendEvent",t,o),null)}sendSession(t){let n=Gp.createSessionEnvelope(t,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(n)}recordDroppedEvent(t,n,r){if(this._options.sendClientReports){let s=`${t}:${n}`;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&O.logger.log(`Adding outcome: "${s}"`),this._outcomes[s]=this._outcomes[s]+1||1}}on(t,n){this._hooks[t]||(this._hooks[t]=[]),this._hooks[t].push(n)}emit(t,...n){this._hooks[t]&&this._hooks[t].forEach(r=>r(...n))}_updateSessionFromEvent(t,n){let r=!1,s=!1,o=n.exception&&n.exception.values;if(o){s=!0;for(let c of o){let u=c.mechanism;if(u&&u.handled===!1){r=!0;break}}}let i=t.status==="ok";(i&&t.errors===0||i&&r)&&(jp.updateSession(t,{...r&&{status:"crashed"},errors:t.errors||Number(s||r)}),this.captureSession(t))}_isClientDoneProcessing(t){return new O.SyncPromise(n=>{let r=0,s=1,o=setInterval(()=>{this._numProcessing==0?(clearInterval(o),n(!0)):(r+=s,t&&r>=t&&(clearInterval(o),n(!1)))},s)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r){let s=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&o.length>0&&(n.integrations=o),this.emit("preprocessEvent",t,n),Nb.prepareEvent(s,t,n,r,this).then(i=>{if(i===null)return i;let{propagationContext:a}=i.sdkProcessingMetadata||{};if(!(i.contexts&&i.contexts.trace)&&a){let{traceId:u,spanId:d,parentSpanId:l,dsc:p}=a;i.contexts={trace:{trace_id:u,span_id:d,parent_span_id:l},...i.contexts};let f=p||Db.getDynamicSamplingContextFromClient(u,this,r);i.sdkProcessingMetadata={dynamicSamplingContext:f,...i.sdkProcessingMetadata}}return i})}_captureEvent(t,n={},r){return this._processEvent(t,n,r).then(s=>s.event_id,s=>{if(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__){let o=s;o.logLevel==="log"?O.logger.log(o.message):O.logger.warn(o)}})}_processEvent(t,n,r){let s=this.getOptions(),{sampleRate:o}=s,i=Yp(t),a=Hp(t),c=t.type||"error",u=`before send for type \`${c}\``;if(a&&typeof o=="number"&&Math.random()>o)return this.recordDroppedEvent("sample_rate","error",t),O.rejectedSyncPromise(new O.SentryError(`Discarding event because it's not included in the random sample (sampling rate = ${o})`,"log"));let d=c==="replay_event"?"replay":c;return this._prepareEvent(t,n,r).then(l=>{if(l===null)throw this.recordDroppedEvent("event_processor",d,t),new O.SentryError("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return l;let f=kb(s,l,n);return wb(f,u)}).then(l=>{if(l===null)throw this.recordDroppedEvent("before_send",d,t),new O.SentryError(`${u} returned \`null\`, will not send event.`,"log");let p=r&&r.getSession();!i&&p&&this._updateSessionFromEvent(p,l);let f=l.transaction_info;if(i&&f&&l.transaction!==t.transaction){let m="custom";l.transaction_info={...f,source:m}}return this.sendEvent(l,n),l}).then(null,l=>{throw l instanceof O.SentryError?l:(this.captureException(l,{data:{__sentry__:!0},originalException:l}),new O.SentryError(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
13
+ Reason: ${l}`))})}_process(t){this._numProcessing++,t.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)return this._transport.send(t).then(null,n=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&O.logger.error("Error while sending event:",n)});(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&O.logger.error("Transport disabled")}_clearOutcomes(){let t=this._outcomes;return this._outcomes={},Object.keys(t).map(n=>{let[r,s]=n.split(":");return{reason:r,category:s,quantity:t[n]}})}};function wb(e,t){let n=`${t} must return \`null\` or a valid event.`;if(O.isThenable(e))return e.then(r=>{if(!O.isPlainObject(r)&&r!==null)throw new O.SentryError(n);return r},r=>{throw new O.SentryError(`${t} rejected with ${r}`)});if(!O.isPlainObject(e)&&e!==null)throw new O.SentryError(n);return e}function kb(e,t,n){let{beforeSend:r,beforeSendTransaction:s}=e;return Hp(t)&&r?r(t,n):Yp(t)&&s?s(t,n):t}function Hp(e){return e.type===void 0}function Yp(e){return e.type==="transaction"}Ga.BaseClient=Fa});var Ha=g($a=>{Object.defineProperty($a,"__esModule",{value:!0});var ja=T();function xb(e,t,n,r,s){let o={sent_at:new Date().toISOString()};n&&n.sdk&&(o.sdk={name:n.sdk.name,version:n.sdk.version}),r&&s&&(o.dsn=ja.dsnToString(s)),t&&(o.trace=ja.dropUndefinedKeys(t));let i=Pb(e);return ja.createEnvelope(o,[i])}function Pb(e){return[{type:"check_in"},e]}$a.createCheckInEnvelope=xb});var Kp=g(Ka=>{Object.defineProperty(Ka,"__esModule",{value:!0});var He=T(),Ub=Ba(),Mb=Ha(),Lb=fe(),qb=xa(),Fb=va(),Gb=nr();Oa();var Ya=class extends Ub.BaseClient{constructor(t){Fb.addTracingExtensions(),super(t)}eventFromException(t,n){return He.resolvedSyncPromise(He.eventFromUnknownInput(Lb.getCurrentHub,this._options.stackParser,t,n))}eventFromMessage(t,n="info",r){return He.resolvedSyncPromise(He.eventFromMessage(this._options.stackParser,t,n,r,this._options.attachStacktrace))}captureException(t,n,r){if(this._options.autoSessionTracking&&this._sessionFlusher&&r){let s=r.getRequestSession();s&&s.status==="ok"&&(s.status="errored")}return super.captureException(t,n,r)}captureEvent(t,n,r){if(this._options.autoSessionTracking&&this._sessionFlusher&&r&&(t.type||"exception")==="exception"&&t.exception&&t.exception.values&&t.exception.values.length>0){let i=r.getRequestSession();i&&i.status==="ok"&&(i.status="errored")}return super.captureEvent(t,n,r)}close(t){return this._sessionFlusher&&this._sessionFlusher.close(),super.close(t)}initSessionFlusher(){let{release:t,environment:n}=this._options;t?this._sessionFlusher=new qb.SessionFlusher(this,{release:t,environment:n}):(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&He.logger.warn("Cannot initialise an instance of SessionFlusher if no release is provided!")}captureCheckIn(t,n,r){let s=t.status!=="in_progress"&&t.checkInId?t.checkInId:He.uuid4();if(!this._isEnabled())return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&He.logger.warn("SDK not enabled, will not capture checkin."),s;let o=this.getOptions(),{release:i,environment:a,tunnel:c}=o,u={check_in_id:s,monitor_slug:t.monitorSlug,status:t.status,release:i,environment:a};t.status!=="in_progress"&&(u.duration=t.duration),n&&(u.monitor_config={schedule:n.schedule,checkin_margin:n.checkinMargin,max_runtime:n.maxRuntime,timezone:n.timezone});let[d,l]=this._getTraceInfoFromScope(r);l&&(u.contexts={trace:l});let p=Mb.createCheckInEnvelope(u,d,this.getSdkMetadata(),c,this.getDsn());return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&He.logger.info("Sending checkin:",t.monitorSlug,t.status),this._sendEnvelope(p),s}_captureRequestSession(){this._sessionFlusher?this._sessionFlusher.incrementSessionStatusCount():(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&He.logger.warn("Discarded request mode session because autoSessionTracking option was disabled")}_prepareEvent(t,n,r){return this._options.platform&&(t.platform=t.platform||this._options.platform),this._options.runtime&&(t.contexts={...t.contexts,runtime:(t.contexts||{}).runtime||this._options.runtime}),this._options.serverName&&(t.server_name=t.server_name||this._options.serverName),super._prepareEvent(t,n,r)}_getTraceInfoFromScope(t){if(!t)return[void 0,void 0];let n=t.getSpan();if(n)return[n.transaction?n.transaction.getDynamicSamplingContext():void 0,n.getTraceContext()];let{traceId:r,spanId:s,parentSpanId:o,dsc:i}=t.getPropagationContext(),a={trace_id:r,span_id:s,parent_span_id:o};return i?[i,a]:[Gb.getDynamicSamplingContextFromClient(r,this,t),a]}};Ka.ServerRuntimeClient=Ya});var Wp=g(Wa=>{Object.defineProperty(Wa,"__esModule",{value:!0});var Bb=T(),jb=fe();function $b(e,t){t.debug===!0&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__?Bb.logger.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));let n=jb.getCurrentHub();n.getScope().update(t.initialScope);let s=new e(t);n.bindClient(s)}Wa.initAndBind=$b});var Xp=g(Ps=>{Object.defineProperty(Ps,"__esModule",{value:!0});var Q=T(),zp=30;function Hb(e,t,n=Q.makePromiseBuffer(e.bufferSize||zp)){let r={},s=i=>n.drain(i);function o(i){let a=[];if(Q.forEachEnvelopeItem(i,(l,p)=>{let f=Q.envelopeItemTypeToDataCategory(p);if(Q.isRateLimited(r,f)){let m=Vp(l,p);e.recordDroppedEvent("ratelimit_backoff",f,m)}else a.push(l)}),a.length===0)return Q.resolvedSyncPromise();let c=Q.createEnvelope(i[0],a),u=l=>{Q.forEachEnvelopeItem(c,(p,f)=>{let m=Vp(p,f);e.recordDroppedEvent(l,Q.envelopeItemTypeToDataCategory(f),m)})},d=()=>t({body:Q.serializeEnvelope(c,e.textEncoder)}).then(l=>(l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Q.logger.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=Q.updateRateLimits(r,l),l),l=>{throw u("network_error"),l});return n.add(d).then(l=>l,l=>{if(l instanceof Q.SentryError)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Q.logger.error("Skipped sending event because buffer is full."),u("queue_overflow"),Q.resolvedSyncPromise();throw l})}return o.__sentry__baseTransport__=!0,{send:o,flush:s}}function Vp(e,t){if(!(t!=="event"&&t!=="transaction"))return Array.isArray(e)?e[1]:void 0}Ps.DEFAULT_TRANSPORT_BUFFER_SIZE=zp;Ps.createTransport=Hb});var Qp=g(cr=>{Object.defineProperty(cr,"__esModule",{value:!0});var za=T(),Jp=100,Xa=5e3,Yb=36e5;function Va(e,t){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&za.logger.info(`[Offline]: ${e}`,t)}function Kb(e){return t=>{let n=e(t),r=t.createStore?t.createStore(t):void 0,s=Xa,o;function i(d,l,p){return za.envelopeContainsItemType(d,["replay_event","replay_recording","client_report"])?!1:t.shouldStore?t.shouldStore(d,l,p):!0}function a(d){r&&(o&&clearTimeout(o),o=setTimeout(async()=>{o=void 0;let l=await r.pop();l&&(Va("Attempting to send previously queued event"),u(l).catch(p=>{Va("Failed to retry sending",p)}))},d),typeof o!="number"&&o.unref&&o.unref())}function c(){o||(a(s),s=Math.min(s*2,Yb))}async function u(d){try{let l=await n.send(d),p=Jp;if(l){if(l.headers&&l.headers["retry-after"])p=za.parseRetryAfterHeader(l.headers["retry-after"]);else if((l.statusCode||0)>=400)return l}return a(p),s=Xa,l}catch(l){if(r&&await i(d,l,s))return await r.insert(d),c(),Va("Error sending. Event queued",l),{};throw l}}return t.flushAtStartup&&c(),{send:u,flush:d=>n.flush(d)}}}cr.MIN_DELAY=Jp;cr.START_DELAY=Xa;cr.makeOfflineTransport=Kb});var ef=g(Us=>{Object.defineProperty(Us,"__esModule",{value:!0});var Zp=T(),Wb=ks();function Ja(e,t){let n;return Zp.forEachEnvelopeItem(e,(r,s)=>(t.includes(s)&&(n=Array.isArray(r)?r[1]:void 0),!!n)),n}function Vb(e,t){return n=>{let r=e(n);return{send:async s=>{let o=Ja(s,["event","transaction","profile","replay_event"]);return o&&(o.release=t),r.send(s)},flush:s=>r.flush(s)}}}function zb(e,t){return n=>{let r=e(n),s={};function o(c,u){let d=u?`${c}:${u}`:c;if(!s[d]){let l=Zp.dsnFromString(c);if(!l)return;let p=Wb.getEnvelopeEndpointWithUrlEncodedAuth(l);s[d]=u?Vb(e,u)({...n,url:p}):e({...n,url:p})}return s[d]}async function i(c){function u(p){let f=p&&p.length?p:["event"];return Ja(c,f)}let d=t({envelope:c,getEvent:u}).map(p=>typeof p=="string"?o(p,void 0):o(p.dsn,p.release)).filter(p=>!!p);return d.length===0&&d.push(r),(await Promise.all(d.map(p=>p.send(c))))[0]}async function a(c){let u=[...Object.keys(s).map(l=>s[l]),r];return(await Promise.all(u.map(l=>l.flush(c)))).every(l=>l)}return{send:i,flush:a}}}Us.eventFromEnvelope=Ja;Us.makeMultiplexedTransport=zb});var tf=g(Qa=>{Object.defineProperty(Qa,"__esModule",{value:!0});var Xb="7.74.1";Qa.SDK_VERSION=Xb});var ec=g(Za=>{Object.defineProperty(Za,"__esModule",{value:!0});var Jb=T(),nf,Ms=class e{static __initStatic(){this.id="FunctionToString"}constructor(){this.name=e.id}setupOnce(){nf=Function.prototype.toString;try{Function.prototype.toString=function(...t){let n=Jb.getOriginalFunction(this)||this;return nf.apply(n,t)}}catch{}}};Ms.__initStatic();Za.FunctionToString=Ms});var tc=g(ur=>{Object.defineProperty(ur,"__esModule",{value:!0});var F=T(),Qb=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],Zb=[/^.*\/healthcheck$/,/^.*\/healthy$/,/^.*\/live$/,/^.*\/ready$/,/^.*\/heartbeat$/,/^.*\/health$/,/^.*\/healthz$/],Ls=class e{static __initStatic(){this.id="InboundFilters"}constructor(t={}){this.name=e.id,this._options=t}setupOnce(t,n){}processEvent(t,n,r){let s=r.getOptions(),o=rf(this._options,s);return sf(t,o)?null:t}};Ls.__initStatic();function rf(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Qb],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[],...e.disableTransactionDefaults?[]:Zb],ignoreInternal:e.ignoreInternal!==void 0?e.ignoreInternal:!0}}function sf(e,t){return t.ignoreInternal&&oI(e)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.warn(`Event dropped due to being internal Sentry Error.
14
+ Event: ${F.getEventDescription(e)}`),!0):eI(e,t.ignoreErrors)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
15
+ Event: ${F.getEventDescription(e)}`),!0):tI(e,t.ignoreTransactions)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
16
+ Event: ${F.getEventDescription(e)}`),!0):nI(e,t.denyUrls)?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.warn(`Event dropped due to being matched by \`denyUrls\` option.
17
+ Event: ${F.getEventDescription(e)}.
18
+ Url: ${qs(e)}`),!0):rI(e,t.allowUrls)?!1:((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.warn(`Event dropped due to not being matched by \`allowUrls\` option.
19
+ Event: ${F.getEventDescription(e)}.
20
+ Url: ${qs(e)}`),!0)}function eI(e,t){return e.type||!t||!t.length?!1:sI(e).some(n=>F.stringMatchesSomePattern(n,t))}function tI(e,t){if(e.type!=="transaction"||!t||!t.length)return!1;let n=e.transaction;return n?F.stringMatchesSomePattern(n,t):!1}function nI(e,t){if(!t||!t.length)return!1;let n=qs(e);return n?F.stringMatchesSomePattern(n,t):!1}function rI(e,t){if(!t||!t.length)return!0;let n=qs(e);return n?F.stringMatchesSomePattern(n,t):!0}function sI(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&&F.logger.error(`Could not extract message for event ${F.getEventDescription(e)}`),t}function oI(e){try{return e.exception.values[0].type==="SentryError"}catch{}return!1}function iI(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 qs(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch{}return t?iI(t):null}catch{return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&F.logger.error(`Cannot extract url for event ${F.getEventDescription(e)}`),null}}ur.InboundFilters=Ls;ur._mergeOptions=rf;ur._shouldDropEvent=sf});var of=g(Fs=>{Object.defineProperty(Fs,"__esModule",{value:!0});var aI=ec(),cI=tc();Fs.FunctionToString=aI.FunctionToString;Fs.InboundFilters=cI.InboundFilters});var cf=g(nc=>{Object.defineProperty(nc,"__esModule",{value:!0});function uI(e,t){let n=t.getClient(),r=n&&n.getDsn(),s=n&&n.getOptions().tunnel;return lI(e,r)||dI(e,s)}function dI(e,t){return t?af(e)===af(t):!1}function lI(e,t){return t?e.includes(t.host):!1}function af(e){return e[e.length-1]==="/"?e.slice(0,-1):e}nc.isSentryRequestUrl=uI});var pf=g(dr=>{Object.defineProperty(dr,"__esModule",{value:!0});var rc=T(),df=new Map,uf=new Set;function pI(e){if(rc.GLOBAL_OBJ._sentryModuleMetadata)for(let t of Object.keys(rc.GLOBAL_OBJ._sentryModuleMetadata)){let n=rc.GLOBAL_OBJ._sentryModuleMetadata[t];if(uf.has(t))continue;uf.add(t);let r=e(t);for(let s of r.reverse())if(s.filename){df.set(s.filename,n);break}}}function lf(e,t){return pI(e),df.get(t)}function fI(e,t){try{t.exception.values.forEach(n=>{if(n.stacktrace)for(let r of n.stacktrace.frames||[]){if(!r.filename)continue;let s=lf(e,r.filename);s&&(r.module_metadata=s)}})}catch{}}function gI(e){try{e.exception.values.forEach(t=>{if(t.stacktrace)for(let n of t.stacktrace.frames||[])delete n.module_metadata})}catch{}}dr.addMetadataToStackFrames=fI;dr.getMetadataForUrl=lf;dr.stripMetadataFromStackFrames=gI});var gf=g(sc=>{Object.defineProperty(sc,"__esModule",{value:!0});var _I=T(),ff=pf(),Gs=class e{static __initStatic(){this.id="ModuleMetadata"}constructor(){this.name=e.id}setupOnce(t,n){let r=n().getClient();if(!r||typeof r.on!="function")return;r.on("beforeEnvelope",o=>{_I.forEachEnvelopeItem(o,(i,a)=>{if(a==="event"){let c=Array.isArray(i)?i[1]:void 0;c&&(ff.stripMetadataFromStackFrames(c),i[1]=c)}})});let s=r.getOptions().stackParser;t(o=>(ff.addMetadataToStackFrames(s,o),o))}};Gs.__initStatic();sc.ModuleMetadata=Gs});var N=g(S=>{Object.defineProperty(S,"__esModule",{value:!0});var _f=va(),hf=Ia(),mf=Rs(),hI=vs(),mI=As(),EI=Oa(),Rt=Dp(),yI=nr(),SI=Np(),Y=wp(),Ye=fe(),oc=Qn(),TI=xa(),bI=Ts(),II=zn(),Ef=ks(),AI=Ba(),RI=Kp(),vI=Wp(),OI=Xp(),CI=Qp(),DI=ef(),NI=tf(),yf=La(),wI=of(),kI=qa(),xI=Ha(),PI=Ds(),UI=cf(),MI=Wn(),LI=gf(),qI=ec(),FI=tc(),GI=T();S.addTracingExtensions=_f.addTracingExtensions;S.startIdleTransaction=_f.startIdleTransaction;S.IdleTransaction=hf.IdleTransaction;S.TRACING_DEFAULTS=hf.TRACING_DEFAULTS;S.Span=mf.Span;S.spanStatusfromHttpCode=mf.spanStatusfromHttpCode;S.Transaction=hI.Transaction;S.getActiveTransaction=mI.getActiveTransaction;Object.defineProperty(S,"SpanStatus",{enumerable:!0,get:()=>EI.SpanStatus});S.continueTrace=Rt.continueTrace;S.getActiveSpan=Rt.getActiveSpan;S.startActiveSpan=Rt.startActiveSpan;S.startInactiveSpan=Rt.startInactiveSpan;S.startSpan=Rt.startSpan;S.startSpanManual=Rt.startSpanManual;S.trace=Rt.trace;S.getDynamicSamplingContextFromClient=yI.getDynamicSamplingContextFromClient;S.setMeasurement=SI.setMeasurement;S.addBreadcrumb=Y.addBreadcrumb;S.captureCheckIn=Y.captureCheckIn;S.captureEvent=Y.captureEvent;S.captureException=Y.captureException;S.captureMessage=Y.captureMessage;S.close=Y.close;S.configureScope=Y.configureScope;S.flush=Y.flush;S.lastEventId=Y.lastEventId;S.setContext=Y.setContext;S.setExtra=Y.setExtra;S.setExtras=Y.setExtras;S.setTag=Y.setTag;S.setTags=Y.setTags;S.setUser=Y.setUser;S.startTransaction=Y.startTransaction;S.withScope=Y.withScope;S.Hub=Ye.Hub;S.ensureHubOnCarrier=Ye.ensureHubOnCarrier;S.getCurrentHub=Ye.getCurrentHub;S.getHubFromCarrier=Ye.getHubFromCarrier;S.getMainCarrier=Ye.getMainCarrier;S.makeMain=Ye.makeMain;S.runWithAsyncContext=Ye.runWithAsyncContext;S.setAsyncContextStrategy=Ye.setAsyncContextStrategy;S.setHubOnCarrier=Ye.setHubOnCarrier;S.closeSession=oc.closeSession;S.makeSession=oc.makeSession;S.updateSession=oc.updateSession;S.SessionFlusher=TI.SessionFlusher;S.Scope=bI.Scope;S.addGlobalEventProcessor=II.addGlobalEventProcessor;S.getEnvelopeEndpointWithUrlEncodedAuth=Ef.getEnvelopeEndpointWithUrlEncodedAuth;S.getReportDialogEndpoint=Ef.getReportDialogEndpoint;S.BaseClient=AI.BaseClient;S.ServerRuntimeClient=RI.ServerRuntimeClient;S.initAndBind=vI.initAndBind;S.createTransport=OI.createTransport;S.makeOfflineTransport=CI.makeOfflineTransport;S.makeMultiplexedTransport=DI.makeMultiplexedTransport;S.SDK_VERSION=NI.SDK_VERSION;S.addIntegration=yf.addIntegration;S.getIntegrationsToSetup=yf.getIntegrationsToSetup;S.Integrations=wI;S.prepareEvent=kI.prepareEvent;S.createCheckInEnvelope=xI.createCheckInEnvelope;S.hasTracingEnabled=PI.hasTracingEnabled;S.isSentryRequestUrl=UI.isSentryRequestUrl;S.DEFAULT_ENVIRONMENT=MI.DEFAULT_ENVIRONMENT;S.ModuleMetadata=LI.ModuleMetadata;S.FunctionToString=qI.FunctionToString;S.InboundFilters=FI.InboundFilters;S.extractTraceparentData=GI.extractTraceparentData});var ac=g(ic=>{Object.defineProperty(ic,"__esModule",{value:!0});function BI(e,t){return e??t()}ic._nullishCoalesce=BI});var Sf=g(cc=>{Object.defineProperty(cc,"__esModule",{value:!0});var jI=ac();async function $I(e,t){return jI._nullishCoalesce(e,t)}cc._asyncNullishCoalesce=$I});var dc=g(uc=>{Object.defineProperty(uc,"__esModule",{value:!0});async function HI(e){let t,n=e[0],r=1;for(;r<e.length;){let s=e[r],o=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=await o(n)):(s==="call"||s==="optionalCall")&&(n=await o((...i)=>n.call(t,...i)),t=void 0)}return n}uc._asyncOptionalChain=HI});var Tf=g(lc=>{Object.defineProperty(lc,"__esModule",{value:!0});var YI=dc();async function KI(e){let t=await YI._asyncOptionalChain(e);return t??!0}lc._asyncOptionalChainDelete=KI});var fc=g(pc=>{Object.defineProperty(pc,"__esModule",{value:!0});function WI(e){let t,n=e[0],r=1;for(;r<e.length;){let s=e[r],o=e[r+1];if(r+=2,(s==="optionalAccess"||s==="optionalCall")&&n==null)return;s==="access"||s==="optionalAccess"?(t=n,n=o(n)):(s==="call"||s==="optionalCall")&&(n=o((...i)=>n.call(t,...i)),t=void 0)}return n}pc._optionalChain=WI});var bf=g(gc=>{Object.defineProperty(gc,"__esModule",{value:!0});var VI=fc();function zI(e){let t=VI._optionalChain(e);return t??!0}gc._optionalChainDelete=zI});var k=g(at=>{Object.defineProperty(at,"__esModule",{value:!0});var XI=Sf(),JI=dc(),QI=Tf(),ZI=ac(),eA=fc(),tA=bf();at._asyncNullishCoalesce=XI._asyncNullishCoalesce;at._asyncOptionalChain=JI._asyncOptionalChain;at._asyncOptionalChainDelete=QI._asyncOptionalChainDelete;at._nullishCoalesce=ZI._nullishCoalesce;at._optionalChain=eA._optionalChain;at._optionalChainDelete=tA._optionalChainDelete});var ct=g(_c=>{var{_optionalChain:If}=k();Object.defineProperty(_c,"__esModule",{value:!0});function nA(e){let t=If([e,"call",r=>r(),"access",r=>r.getClient,"call",r=>r(),"optionalAccess",r=>r.getOptions,"call",r=>r()]);return(If([t,"optionalAccess",r=>r.instrumenter])||"sentry")!=="sentry"}_c.shouldDisableAutoInstrumentation=nA});var Of=g(lr=>{var{_optionalChain:Oe}=k();Object.defineProperty(lr,"__esModule",{value:!0});var ye=T(),rA=ct(),Bs=class e{static __initStatic(){this.id="Express"}constructor(t={}){this.name=e.id,this._router=t.router||t.app,this._methods=(Array.isArray(t.methods)?t.methods:[]).concat("use")}setupOnce(t,n){if(!this._router){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ye.logger.error("ExpressIntegration is missing an Express instance");return}if(rA.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ye.logger.log("Express Integration is skipped because of instrumenter configuration.");return}iA(this._router,this._methods),aA(this._router)}};Bs.__initStatic();function Af(e,t){let n=e.length;switch(n){case 2:return function(r,s){let o=s.__sentry_transaction;if(o){let i=o.startChild({description:e.name,op:`middleware.express.${t}`,origin:"auto.middleware.express"});s.once("finish",()=>{i.finish()})}return e.call(this,r,s)};case 3:return function(r,s,o){let i=s.__sentry_transaction,a=Oe([i,"optionalAccess",c=>c.startChild,"call",c=>c({description:e.name,op:`middleware.express.${t}`,origin:"auto.middleware.express"})]);e.call(this,r,s,function(...c){Oe([a,"optionalAccess",u=>u.finish,"call",u=>u()]),o.call(this,...c)})};case 4:return function(r,s,o,i){let a=o.__sentry_transaction,c=Oe([a,"optionalAccess",u=>u.startChild,"call",u=>u({description:e.name,op:`middleware.express.${t}`,origin:"auto.middleware.express"})]);e.call(this,r,s,o,function(...u){Oe([c,"optionalAccess",d=>d.finish,"call",d=>d()]),i.call(this,...u)})};default:throw new Error(`Express middleware takes 2-4 arguments. Got: ${n}`)}}function sA(e,t){return e.map(n=>typeof n=="function"?Af(n,t):Array.isArray(n)?n.map(r=>typeof r=="function"?Af(r,t):r):n)}function oA(e,t){let n=e[t];return e[t]=function(...r){return n.call(this,...sA(r,t))},e}function iA(e,t=[]){t.forEach(n=>oA(e,n))}function aA(e){let t="settings"in e;t&&e._router===void 0&&e.lazyrouter&&e.lazyrouter();let n=t?e._router:e;if(!n){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ye.logger.debug("Cannot instrument router for URL Parameterization (did not find a valid router)."),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ye.logger.debug("Routing instrumentation is currently only supported in Express 4.");return}let r=Object.getPrototypeOf(n),s=r.process_params;r.process_params=function(i,a,c,u,d){c._reconstructedRoute||(c._reconstructedRoute="");let{layerRoutePath:l,isRegex:p,isArray:f,numExtraSegments:m}=cA(i);(l||p||f)&&(c._hasParameters=!0);let E;l?E=l:E=vf(c.originalUrl,c._reconstructedRoute,i.path)||"";let I=E.split("/").filter(ie=>ie.length>0&&(p||f||!ie.includes("*"))).join("/");I&&I.length>0&&(c._reconstructedRoute+=`/${I}${p?"/":""}`);let R=ye.getNumberOfUrlSegments(c.originalUrl||"")+m,L=ye.getNumberOfUrlSegments(c._reconstructedRoute);if(R===L){c._hasParameters||c._reconstructedRoute!==c.originalUrl&&(c._reconstructedRoute=c.originalUrl?ye.stripUrlQueryAndFragment(c.originalUrl):c.originalUrl);let ie=u.__sentry_transaction;if(ie&&ie.metadata.source!=="custom"){let ae=c._reconstructedRoute||"/";ie.setName(...ye.extractPathForTransaction(c,{path:!0,method:!0,customRoute:ae}))}}return s.call(this,i,a,c,u,d)}}var Rf=(e,t,n)=>{if(!e||!t||!n||Object.keys(n).length===0||!Oe([n,"access",u=>u[0],"optionalAccess",u=>u.offset]))return;let r=n.sort((u,d)=>u.offset-d.offset),o=new RegExp(t,`${t.flags}d`).exec(e);if(!o||!o.indices)return;let[,...i]=o.indices;if(i.length!==r.length)return;let a=e,c=0;return i.forEach(([u,d],l)=>{let p=a.substring(0,u-c),f=`:${r[l].name}`,m=a.substring(d-c);a=p+f+m,c=c+(d-u-f.length)}),a};function cA(e){let t=Oe([e,"access",i=>i.route,"optionalAccess",i=>i.path]),n=ye.isRegExp(t),r=Array.isArray(t);if(!t){let[i]=process.versions.node.split(".").map(Number);i>=16&&(t=Rf(e.path,e.regexp,e.keys))}if(!t)return{isRegex:n,isArray:r,numExtraSegments:0};let s=r?Math.max(uA(t)-ye.getNumberOfUrlSegments(e.path||""),0):0;return{layerRoutePath:dA(r,t),isRegex:n,isArray:r,numExtraSegments:s}}function uA(e){return e.reduce((t,n)=>t+ye.getNumberOfUrlSegments(n.toString()),0)}function dA(e,t){return e?t.map(n=>n.toString()).join(","):t&&t.toString()}function vf(e,t,n){let r=Oe([e,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>!!c)]),s=0,o=Oe([t,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>!!c),"access",a=>a.length])||0;return Oe([n,"optionalAccess",a=>a.split,"call",a=>a("/"),"access",a=>a.filter,"call",a=>a(c=>Oe([r,"optionalAccess",u=>u[o+s]])===c?(s+=1,!0):!1),"access",a=>a.join,"call",a=>a("/")])}lr.Express=Bs;lr.extractOriginalRoute=Rf;lr.preventDuplicateSegments=vf});var Cf=g(hc=>{var{_optionalChain:on}=k();Object.defineProperty(hc,"__esModule",{value:!0});var an=T(),lA=ct(),js=class e{static __initStatic(){this.id="Postgres"}constructor(t={}){this.name=e.id,this._usePgNative=!!t.usePgNative,this._module=t.module}loadDependency(){return this._module=this._module||an.loadModule("pg")}setupOnce(t,n){if(lA.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&an.logger.log("Postgres Integration is skipped because of instrumenter configuration.");return}let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&an.logger.error("Postgres Integration was unable to require `pg` package.");return}let s=this._usePgNative?on([r,"access",o=>o.native,"optionalAccess",o=>o.Client]):r.Client;if(!s){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&an.logger.error("Postgres Integration was unable to access 'pg-native' bindings.");return}an.fill(s.prototype,"query",function(o){return function(i,a,c){let d=n().getScope().getSpan(),l={"db.system":"postgresql"};try{this.database&&(l["db.name"]=this.database),this.host&&(l["server.address"]=this.host),this.port&&(l["server.port"]=this.port),this.user&&(l["db.user"]=this.user)}catch{}let p=on([d,"optionalAccess",m=>m.startChild,"call",m=>m({description:typeof i=="string"?i:i.text,op:"db",origin:"auto.db.postgres",data:l})]);if(typeof c=="function")return o.call(this,i,a,function(m,E){on([p,"optionalAccess",I=>I.finish,"call",I=>I()]),c(m,E)});if(typeof a=="function")return o.call(this,i,function(m,E){on([p,"optionalAccess",I=>I.finish,"call",I=>I()]),a(m,E)});let f=typeof a<"u"?o.call(this,i,a):o.call(this,i);return an.isThenable(f)?f.then(m=>(on([p,"optionalAccess",E=>E.finish,"call",E=>E()]),m)):(on([p,"optionalAccess",m=>m.finish,"call",m=>m()]),f)}})}};js.__initStatic();hc.Postgres=js});var Df=g(mc=>{var{_optionalChain:pA}=k();Object.defineProperty(mc,"__esModule",{value:!0});var pr=T(),fA=ct(),$s=class e{static __initStatic(){this.id="Mysql"}constructor(){this.name=e.id}loadDependency(){return this._module=this._module||pr.loadModule("mysql/lib/Connection.js")}setupOnce(t,n){if(fA.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pr.logger.log("Mysql Integration is skipped because of instrumenter configuration.");return}let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pr.logger.error("Mysql Integration was unable to require `mysql` package.");return}let s;try{r.prototype.connect=new Proxy(r.prototype.connect,{apply(a,c,u){return s||(s=c.config),a.apply(c,u)}})}catch{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pr.logger.error("Mysql Integration was unable to instrument `mysql` config.")}function o(){return s?{"server.address":s.host,"server.port":s.port,"db.user":s.user}:{}}function i(a){if(!a||a.endTimestamp)return;let c=o();Object.keys(c).forEach(u=>{a.setData(u,c[u])}),a.finish()}pr.fill(r,"createQuery",function(a){return function(c,u,d){let p=n().getScope().getSpan(),f=pA([p,"optionalAccess",E=>E.startChild,"call",E=>E({description:typeof c=="string"?c:c.sql,op:"db",origin:"auto.db.mysql",data:{"db.system":"mysql"}})]);if(typeof d=="function")return a.call(this,c,u,function(E,I,R){i(f),d(E,I,R)});if(typeof u=="function")return a.call(this,c,function(E,I,R){i(f),u(E,I,R)});let m=a.call(this,c,u);return m.on("end",()=>{i(f)}),m}})}};$s.__initStatic();mc.Mysql=$s});var Nf=g(Ec=>{var{_optionalChain:vt}=k();Object.defineProperty(Ec,"__esModule",{value:!0});var fr=T(),gA=ct(),_A=["aggregate","bulkWrite","countDocuments","createIndex","createIndexes","deleteMany","deleteOne","distinct","drop","dropIndex","dropIndexes","estimatedDocumentCount","find","findOne","findOneAndDelete","findOneAndReplace","findOneAndUpdate","indexes","indexExists","indexInformation","initializeOrderedBulkOp","insertMany","insertOne","isCapped","mapReduce","options","parallelCollectionScan","rename","replaceOne","stats","updateMany","updateOne"],hA={bulkWrite:["operations"],countDocuments:["query"],createIndex:["fieldOrSpec"],createIndexes:["indexSpecs"],deleteMany:["filter"],deleteOne:["filter"],distinct:["key","query"],dropIndex:["indexName"],find:["query"],findOne:["query"],findOneAndDelete:["filter"],findOneAndReplace:["filter","replacement"],findOneAndUpdate:["filter","update"],indexExists:["indexes"],insertMany:["docs"],insertOne:["doc"],mapReduce:["map","reduce"],rename:["newName"],replaceOne:["filter","doc"],updateMany:["filter","update"],updateOne:["filter","update"]};function mA(e){return e&&typeof e=="object"&&e.once&&typeof e.once=="function"}var Hs=class e{static __initStatic(){this.id="Mongo"}constructor(t={}){this.name=e.id,this._operations=Array.isArray(t.operations)?t.operations:_A,this._describeOperations="describeOperations"in t?t.describeOperations:!0,this._useMongoose=!!t.useMongoose}loadDependency(){let t=this._useMongoose?"mongoose":"mongodb";return this._module=this._module||fr.loadModule(t)}setupOnce(t,n){if(gA.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&fr.logger.log("Mongo Integration is skipped because of instrumenter configuration.");return}let r=this.loadDependency();if(!r){let s=this._useMongoose?"mongoose":"mongodb";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&fr.logger.error(`Mongo Integration was unable to require \`${s}\` package.`);return}this._instrumentOperations(r.Collection,this._operations,n)}_instrumentOperations(t,n,r){n.forEach(s=>this._patchOperation(t,s,r))}_patchOperation(t,n,r){if(!(n in t.prototype))return;let s=this._getSpanContextFromOperationArguments.bind(this);fr.fill(t.prototype,n,function(o){return function(...i){let a=i[i.length-1],u=r().getScope().getSpan();if(typeof a!="function"||n==="mapReduce"&&i.length===2){let l=vt([u,"optionalAccess",f=>f.startChild,"call",f=>f(s(this,n,i))]),p=o.call(this,...i);if(fr.isThenable(p))return p.then(f=>(vt([l,"optionalAccess",m=>m.finish,"call",m=>m()]),f));if(mA(p)){let f=p;try{f.once("close",()=>{vt([l,"optionalAccess",m=>m.finish,"call",m=>m()])})}catch{vt([l,"optionalAccess",E=>E.finish,"call",E=>E()])}return f}else return vt([l,"optionalAccess",f=>f.finish,"call",f=>f()]),p}let d=vt([u,"optionalAccess",l=>l.startChild,"call",l=>l(s(this,n,i.slice(0,-1)))]);return o.call(this,...i.slice(0,-1),function(l,p){vt([d,"optionalAccess",f=>f.finish,"call",f=>f()]),a(l,p)})}})}_getSpanContextFromOperationArguments(t,n,r){let s={"db.system":"mongodb","db.name":t.dbName,"db.operation":n,"db.mongodb.collection":t.collectionName},o={op:"db",origin:"auto.db.mongo",description:n,data:s},i=hA[n],a=Array.isArray(this._describeOperations)?this._describeOperations.includes(n):this._describeOperations;if(!i||!a)return o;try{if(n==="mapReduce"){let[c,u]=r;s[i[0]]=typeof c=="string"?c:c.name||"<anonymous>",s[i[1]]=typeof u=="string"?u:u.name||"<anonymous>"}else for(let c=0;c<i.length;c++)s[`db.mongodb.${i[c]}`]=JSON.stringify(r[c])}catch{}return o}};Hs.__initStatic();Ec.Mongo=Hs});var xf=g(yc=>{Object.defineProperty(yc,"__esModule",{value:!0});var wf=N(),kf=T(),EA=ct();function yA(e){return!!e&&!!e.$use}var Ys=class e{static __initStatic(){this.id="Prisma"}constructor(t={}){if(this.name=e.id,yA(t.client)&&!t.client._sentryInstrumented){kf.addNonEnumerableProperty(t.client,"_sentryInstrumented",!0);let n={};try{let r=t.client._engineConfig;if(r){let{activeProvider:s,clientVersion:o}=r;s&&(n["db.system"]=s),o&&(n["db.prisma.version"]=o)}}catch{}t.client.$use((r,s)=>{if(EA.shouldDisableAutoInstrumentation(wf.getCurrentHub))return s(r);let o=r.action,i=r.model;return wf.trace({name:i?`${i} ${o}`:o,op:"db.sql.prisma",origin:"auto.db.prisma",data:{...n,"db.operation":o}},()=>s(r))})}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&kf.logger.warn("Unsupported Prisma client provided to PrismaIntegration. Provided client:",t.client)}setupOnce(){}};Ys.__initStatic();yc.Prisma=Ys});var Pf=g(Sc=>{var{_optionalChain:cn}=k();Object.defineProperty(Sc,"__esModule",{value:!0});var gr=T(),SA=ct(),Ks=class e{static __initStatic(){this.id="GraphQL"}constructor(){this.name=e.id}loadDependency(){return this._module=this._module||gr.loadModule("graphql/execution/execute.js")}setupOnce(t,n){if(SA.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&gr.logger.log("GraphQL Integration is skipped because of instrumenter configuration.");return}let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&gr.logger.error("GraphQL Integration was unable to require graphql/execution package.");return}gr.fill(r,"execute",function(s){return function(...o){let i=n().getScope(),a=i.getSpan(),c=cn([a,"optionalAccess",d=>d.startChild,"call",d=>d({description:"execute",op:"graphql.execute",origin:"auto.graphql.graphql"})]);cn([i,"optionalAccess",d=>d.setSpan,"call",d=>d(c)]);let u=s.call(this,...o);return gr.isThenable(u)?u.then(d=>(cn([c,"optionalAccess",l=>l.finish,"call",l=>l()]),cn([i,"optionalAccess",l=>l.setSpan,"call",l=>l(a)]),d)):(cn([c,"optionalAccess",d=>d.finish,"call",d=>d()]),cn([i,"optionalAccess",d=>d.setSpan,"call",d=>d(a)]),u)}})}};Ks.__initStatic();Sc.GraphQL=Ks});var Mf=g(bc=>{var{_optionalChain:Tc}=k();Object.defineProperty(bc,"__esModule",{value:!0});var K=T(),TA=ct(),Ws=class e{static __initStatic(){this.id="Apollo"}constructor(t={useNestjs:!1}){this.name=e.id,this._useNest=!!t.useNestjs}loadDependency(){return this._useNest?this._module=this._module||K.loadModule("@nestjs/graphql"):this._module=this._module||K.loadModule("apollo-server-core"),this._module}setupOnce(t,n){if(TA.shouldDisableAutoInstrumentation(n)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&K.logger.log("Apollo Integration is skipped because of instrumenter configuration.");return}if(this._useNest){let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&K.logger.error("Apollo-NestJS Integration was unable to require @nestjs/graphql package.");return}K.fill(r.GraphQLFactory.prototype,"mergeWithSchema",function(s){return function(...o){return K.fill(this.resolversExplorerService,"explore",function(i){return function(){let a=K.arrayify(i.call(this));return Uf(a,n)}}),s.call(this,...o)}})}else{let r=this.loadDependency();if(!r){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&K.logger.error("Apollo Integration was unable to require apollo-server-core package.");return}K.fill(r.ApolloServerBase.prototype,"constructSchema",function(s){return function(){if(!this.config.resolvers)return(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this.config.schema?(K.logger.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `schema` property.If you are using NestJS with Apollo, please use `Sentry.Integrations.Apollo({ useNestjs: true })` instead."),K.logger.warn()):this.config.modules&&K.logger.warn("Apollo integration is not able to trace `ApolloServer` instances constructed via `modules` property."),K.logger.error("Skipping tracing as no resolvers found on the `ApolloServer` instance.")),s.call(this);let o=K.arrayify(this.config.resolvers);return this.config.resolvers=Uf(o,n),s.call(this)}})}}};Ws.__initStatic();function Uf(e,t){return e.map(n=>(Object.keys(n).forEach(r=>{Object.keys(n[r]).forEach(s=>{typeof n[r][s]=="function"&&bA(n,r,s,t)})}),n))}function bA(e,t,n,r){K.fill(e[t],n,function(s){return function(...o){let a=r().getScope().getSpan(),c=Tc([a,"optionalAccess",d=>d.startChild,"call",d=>d({description:`${t}.${n}`,op:"graphql.resolve",origin:"auto.graphql.apollo"})]),u=s.call(this,...o);return K.isThenable(u)?u.then(d=>(Tc([c,"optionalAccess",l=>l.finish,"call",l=>l()]),d)):(Tc([c,"optionalAccess",d=>d.finish,"call",d=>d()]),u)}})}bc.Apollo=Ws});var Lf=g((Ic,ut)=>{Object.defineProperty(Ic,"__esModule",{value:!0});var Ot=T(),IA=[()=>{let e=Ot.dynamicRequire(ut,"./apollo");return new e.Apollo},()=>{let e=Ot.dynamicRequire(ut,"./apollo");return new e.Apollo({useNestjs:!0})},()=>{let e=Ot.dynamicRequire(ut,"./graphql");return new e.GraphQL},()=>{let e=Ot.dynamicRequire(ut,"./mongo");return new e.Mongo},()=>{let e=Ot.dynamicRequire(ut,"./mongo");return new e.Mongo({mongoose:!0})},()=>{let e=Ot.dynamicRequire(ut,"./mysql");return new e.Mysql},()=>{let e=Ot.dynamicRequire(ut,"./postgres");return new e.Postgres}];Ic.lazyLoadedNodePerformanceMonitoringIntegrations=IA});var Ke=g(Ac=>{Object.defineProperty(Ac,"__esModule",{value:!0});var AA=T(),RA=AA.GLOBAL_OBJ;Ac.WINDOW=RA});var Ff=g(Rc=>{Object.defineProperty(Rc,"__esModule",{value:!0});var vA=N(),qf=T(),Vs=Ke();function OA(){Vs.WINDOW&&Vs.WINDOW.document?Vs.WINDOW.document.addEventListener("visibilitychange",()=>{let e=vA.getActiveTransaction();if(Vs.WINDOW.document.hidden&&e){let t="cancelled";(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&qf.logger.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__)&&qf.logger.warn("[Tracing] Could not set up background tab detection due to lack of global document")}Rc.registerBackgroundTabDetection=OA});var zs=g(vc=>{Object.defineProperty(vc,"__esModule",{value:!0});var CA=(e,t,n)=>{let r,s;return o=>{t.value>=0&&(o||n)&&(s=t.value-(r||0),(s||r===void 0)&&(r=t.value,t.delta=s,e(t)))}};vc.bindReporter=CA});var Gf=g(Oc=>{Object.defineProperty(Oc,"__esModule",{value:!0});var DA=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`;Oc.generateUniqueID=DA});var Dc=g(Cc=>{Object.defineProperty(Cc,"__esModule",{value:!0});var _r=Ke(),NA=()=>{let e=_r.WINDOW.performance.timing,t=_r.WINDOW.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},wA=()=>_r.WINDOW.__WEB_VITALS_POLYFILL__?_r.WINDOW.performance&&(performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]||NA()):_r.WINDOW.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];Cc.getNavigationEntry=wA});var wc=g(Nc=>{Object.defineProperty(Nc,"__esModule",{value:!0});var kA=Dc(),xA=()=>{let e=kA.getNavigationEntry();return e&&e.activationStart||0};Nc.getActivationStart=xA});var Xs=g(kc=>{Object.defineProperty(kc,"__esModule",{value:!0});var PA=Ke(),UA=Gf(),MA=wc(),LA=Dc(),qA=(e,t)=>{let n=LA.getNavigationEntry(),r="navigate";return n&&(PA.WINDOW.document.prerendering||MA.getActivationStart()>0?r="prerender":r=n.type.replace(/_/g,"-")),{name:e,value:typeof t>"u"?-1:t,rating:"good",delta:0,entries:[],id:UA.generateUniqueID(),navigationType:r}};kc.initMetric=qA});var hr=g(xc=>{Object.defineProperty(xc,"__esModule",{value:!0});var FA=(e,t,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(s=>{t(s.getEntries())});return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch{}};xc.observe=FA});var mr=g(Pc=>{Object.defineProperty(Pc,"__esModule",{value:!0});var GA=Ke(),BA=(e,t)=>{let n=r=>{(r.type==="pagehide"||GA.WINDOW.document.visibilityState==="hidden")&&(e(r),t&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))};addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)};Pc.onHidden=BA});var Bf=g(Uc=>{Object.defineProperty(Uc,"__esModule",{value:!0});var jA=zs(),$A=Xs(),HA=hr(),YA=mr(),KA=e=>{let t=$A.initMetric("CLS",0),n,r=0,s=[],o=a=>{a.forEach(c=>{if(!c.hadRecentInput){let u=s[0],d=s[s.length-1];r&&s.length!==0&&c.startTime-d.startTime<1e3&&c.startTime-u.startTime<5e3?(r+=c.value,s.push(c)):(r=c.value,s=[c]),r>t.value&&(t.value=r,t.entries=s,n&&n())}})},i=HA.observe("layout-shift",o);if(i){n=jA.bindReporter(e,t);let a=()=>{o(i.takeRecords()),n(!0)};return YA.onHidden(a),a}};Uc.onCLS=KA});var Qs=g(Mc=>{Object.defineProperty(Mc,"__esModule",{value:!0});var jf=Ke(),WA=mr(),Js=-1,VA=()=>jf.WINDOW.document.visibilityState==="hidden"&&!jf.WINDOW.document.prerendering?0:1/0,zA=()=>{WA.onHidden(({timeStamp:e})=>{Js=e},!0)},XA=()=>(Js<0&&(Js=VA(),zA()),{get firstHiddenTime(){return Js}});Mc.getVisibilityWatcher=XA});var $f=g(Lc=>{Object.defineProperty(Lc,"__esModule",{value:!0});var JA=zs(),QA=Qs(),ZA=Xs(),eR=hr(),tR=mr(),nR=e=>{let t=QA.getVisibilityWatcher(),n=ZA.initMetric("FID"),r,s=a=>{a.startTime<t.firstHiddenTime&&(n.value=a.processingStart-a.startTime,n.entries.push(a),r(!0))},o=a=>{a.forEach(s)},i=eR.observe("first-input",o);r=JA.bindReporter(e,n),i&&tR.onHidden(()=>{o(i.takeRecords()),i.disconnect()},!0)};Lc.onFID=nR});var Yf=g(qc=>{Object.defineProperty(qc,"__esModule",{value:!0});var rR=zs(),sR=wc(),oR=Qs(),iR=Xs(),aR=hr(),cR=mr(),Hf={},uR=e=>{let t=oR.getVisibilityWatcher(),n=iR.initMetric("LCP"),r,s=i=>{let a=i[i.length-1];if(a){let c=Math.max(a.startTime-sR.getActivationStart(),0);c<t.firstHiddenTime&&(n.value=c,n.entries=[a],r())}},o=aR.observe("largest-contentful-paint",s);if(o){r=rR.bindReporter(e,n);let i=()=>{Hf[n.id]||(s(o.takeRecords()),o.disconnect(),Hf[n.id]=!0,r(!0))};return["keydown","click"].forEach(a=>{addEventListener(a,i,{once:!0,capture:!0})}),cR.onHidden(i,!0),i}};qc.onLCP=uR});var Kf=g(Zs=>{Object.defineProperty(Zs,"__esModule",{value:!0});function dR(e){return typeof e=="number"&&isFinite(e)}function lR(e,{startTimestamp:t,...n}){return t&&e.startTimestamp>t&&(e.startTimestamp=t),e.startChild({startTimestamp:t,...n})}Zs._startChild=lR;Zs.isMeasurementValue=dR});var Zf=g(dt=>{Object.defineProperty(dt,"__esModule",{value:!0});var Vf=N(),U=T(),Ct=Ke(),pR=Bf(),fR=$f(),gR=Yf(),_R=Qs(),zf=hr(),We=Kf();function M(e){return e/1e3}function Xf(){return Ct.WINDOW&&Ct.WINDOW.addEventListener&&Ct.WINDOW.performance}var Wf=0,w={},Ce,Er;function hR(){let e=Xf();if(e&&U.browserPerformanceTimeOrigin){e.mark&&Ct.WINDOW.performance.mark("sentry-tracing-init"),TR();let t=yR(),n=SR();return()=>{t&&t(),n&&n()}}return()=>{}}function mR(){let e=t=>{for(let n of t){let r=Vf.getActiveTransaction();if(!r)return;let s=M(U.browserPerformanceTimeOrigin+n.startTime),o=M(n.duration);r.startChild({description:"Main UI thread blocked",op:"ui.long-task",origin:"auto.ui.browser.metrics",startTimestamp:s,endTimestamp:s+o})}};zf.observe("longtask",e)}function ER(){let e=t=>{for(let n of t){let r=Vf.getActiveTransaction();if(!r)return;if(n.name==="click"){let s=M(U.browserPerformanceTimeOrigin+n.startTime),o=M(n.duration);r.startChild({description:U.htmlTreeAsString(n.target),op:`ui.interaction.${n.name}`,origin:"auto.ui.browser.metrics",startTimestamp:s,endTimestamp:s+o})}}};zf.observe("event",e,{durationThreshold:0})}function yR(){return pR.onCLS(e=>{let t=e.entries.pop();t&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding CLS"),w.cls={value:e.value,unit:""},Er=t)})}function SR(){return gR.onLCP(e=>{let t=e.entries.pop();t&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding LCP"),w.lcp={value:e.value,unit:"millisecond"},Ce=t)})}function TR(){fR.onFID(e=>{let t=e.entries.pop();if(!t)return;let n=M(U.browserPerformanceTimeOrigin),r=M(t.startTime);(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding FID"),w.fid={value:e.value,unit:"millisecond"},w["mark.fid"]={value:n+r,unit:"second"}})}function bR(e){let t=Xf();if(!t||!Ct.WINDOW.performance.getEntries||!U.browserPerformanceTimeOrigin)return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Tracing] Adding & adjusting spans using Performance API");let n=M(U.browserPerformanceTimeOrigin),r=t.getEntries(),s,o;if(r.slice(Wf).forEach(i=>{let a=M(i.startTime),c=M(i.duration);if(!(e.op==="navigation"&&n+a<e.startTimestamp))switch(i.entryType){case"navigation":{IR(e,i,n),s=n+M(i.responseStart),o=n+M(i.requestStart);break}case"mark":case"paint":case"measure":{Jf(e,i,a,c,n);let u=_R.getVisibilityWatcher(),d=i.startTime<u.firstHiddenTime;i.name==="first-paint"&&d&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding FP"),w.fp={value:i.startTime,unit:"millisecond"}),i.name==="first-contentful-paint"&&d&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding FCP"),w.fcp={value:i.startTime,unit:"millisecond"});break}case"resource":{let u=i.name.replace(Ct.WINDOW.location.origin,"");Qf(e,i,u,a,c,n);break}}}),Wf=Math.max(r.length-1,0),RR(e),e.op==="pageload"){typeof s=="number"&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding TTFB"),w.ttfb={value:(s-e.startTimestamp)*1e3,unit:"millisecond"},typeof o=="number"&&o<=s&&(w["ttfb.requestTime"]={value:(s-o)*1e3,unit:"millisecond"})),["fcp","fp","lcp"].forEach(a=>{if(!w[a]||n>=e.startTimestamp)return;let c=w[a].value,u=n+M(c),d=Math.abs((u-e.startTimestamp)*1e3),l=d-c;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log(`[Measurements] Normalized ${a} from ${c} to ${d} (${l})`),w[a].value=d});let i=w["mark.fid"];i&&w.fid&&(We._startChild(e,{description:"first input delay",endTimestamp:i.value+M(w.fid.value),op:"ui.action",origin:"auto.ui.browser.metrics",startTimestamp:i.value}),delete w["mark.fid"]),"fcp"in w||delete w.cls,Object.keys(w).forEach(a=>{e.setMeasurement(a,w[a].value,w[a].unit)}),vR(e)}Ce=void 0,Er=void 0,w={}}function Jf(e,t,n,r,s){let o=s+n,i=o+r;return We._startChild(e,{description:t.name,endTimestamp:i,op:t.entryType,origin:"auto.resource.browser.metrics",startTimestamp:o}),o}function IR(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{eo(e,t,r,n)}),eo(e,t,"secureConnection",n,"TLS/SSL","connectEnd"),eo(e,t,"fetch",n,"cache","domainLookupStart"),eo(e,t,"domainLookup",n,"DNS"),AR(e,t,n)}function eo(e,t,n,r,s,o){let i=o?t[o]:t[`${n}End`],a=t[`${n}Start`];!a||!i||We._startChild(e,{op:"browser",origin:"auto.browser.browser.metrics",description:s||n,startTimestamp:r+M(a),endTimestamp:r+M(i)})}function AR(e,t,n){We._startChild(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"request",startTimestamp:n+M(t.requestStart),endTimestamp:n+M(t.responseEnd)}),We._startChild(e,{op:"browser",origin:"auto.browser.browser.metrics",description:"response",startTimestamp:n+M(t.responseStart),endTimestamp:n+M(t.responseEnd)})}function Qf(e,t,n,r,s,o){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;let i={};"transferSize"in t&&(i["http.response_transfer_size"]=t.transferSize),"encodedBodySize"in t&&(i["http.response_content_length"]=t.encodedBodySize),"decodedBodySize"in t&&(i["http.decoded_response_content_length"]=t.decodedBodySize),"renderBlockingStatus"in t&&(i["resource.render_blocking_status"]=t.renderBlockingStatus);let a=o+r,c=a+s;We._startChild(e,{description:n,endTimestamp:c,op:t.initiatorType?`resource.${t.initiatorType}`:"resource.other",origin:"auto.resource.browser.metrics",startTimestamp:a,data:i})}function RR(e){let t=Ct.WINDOW.navigator;if(!t)return;let n=t.connection;n&&(n.effectiveType&&e.setTag("effectiveConnectionType",n.effectiveType),n.type&&e.setTag("connectionType",n.type),We.isMeasurementValue(n.rtt)&&(w["connection.rtt"]={value:n.rtt,unit:"millisecond"})),We.isMeasurementValue(t.deviceMemory)&&e.setTag("deviceMemory",`${t.deviceMemory} GB`),We.isMeasurementValue(t.hardwareConcurrency)&&e.setTag("hardwareConcurrency",String(t.hardwareConcurrency))}function vR(e){Ce&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding LCP Data"),Ce.element&&e.setTag("lcp.element",U.htmlTreeAsString(Ce.element)),Ce.id&&e.setTag("lcp.id",Ce.id),Ce.url&&e.setTag("lcp.url",Ce.url.trim().slice(0,200)),e.setTag("lcp.size",Ce.size)),Er&&Er.sources&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&U.logger.log("[Measurements] Adding CLS Data"),Er.sources.forEach((t,n)=>e.setTag(`cls.source.${n+1}`,U.htmlTreeAsString(t.node))))}dt._addMeasureSpans=Jf;dt._addResourceSpans=Qf;dt.addPerformanceEntries=bR;dt.startTrackingInteractions=ER;dt.startTrackingLongTasks=mR;dt.startTrackingWebVitals=hR});var Gc=g(Ne=>{Object.defineProperty(Ne,"__esModule",{value:!0});var un=N(),W=T(),to=["localhost",/^\/(?!\/)/],Fc={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,tracingOrigins:to,tracePropagationTargets:to};function OR(e){let{traceFetch:t,traceXHR:n,tracePropagationTargets:r,tracingOrigins:s,shouldCreateSpanForRequest:o,enableHTTPTimings:i}={traceFetch:Fc.traceFetch,traceXHR:Fc.traceXHR,...e},a=typeof o=="function"?o:d=>!0,c=d=>rg(d,r||s),u={};t&&W.addInstrumentationHandler("fetch",d=>{let l=sg(d,a,c,u);i&&l&&eg(l)}),n&&W.addInstrumentationHandler("xhr",d=>{let l=ig(d,a,c,u);i&&l&&eg(l)})}function CR(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function eg(e){let t=e.data.url,n=new PerformanceObserver(r=>{r.getEntries().forEach(o=>{CR(o)&&o.name.endsWith(t)&&(DR(o).forEach(a=>e.setData(...a)),n.disconnect())})});n.observe({entryTypes:["resource"]})}function ng(e){let t="unknown",n="unknown",r="";for(let s of e){if(s==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(s))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=s}return r===e&&(t=r),{name:t,version:n}}function De(e=0){return((W.browserPerformanceTimeOrigin||performance.timeOrigin)+e)/1e3}function DR(e){let{name:t,version:n}=ng(e.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",t]),W.browserPerformanceTimeOrigin?[...r,["http.request.redirect_start",De(e.redirectStart)],["http.request.fetch_start",De(e.fetchStart)],["http.request.domain_lookup_start",De(e.domainLookupStart)],["http.request.domain_lookup_end",De(e.domainLookupEnd)],["http.request.connect_start",De(e.connectStart)],["http.request.secure_connection_start",De(e.secureConnectionStart)],["http.request.connection_end",De(e.connectEnd)],["http.request.request_start",De(e.requestStart)],["http.request.response_start",De(e.responseStart)],["http.request.response_end",De(e.responseEnd)]]:r}function rg(e,t){return W.stringMatchesSomePattern(e,t||to)}function sg(e,t,n,r){if(!un.hasTracingEnabled()||!e.fetchData)return;let s=t(e.fetchData.url);if(e.endTimestamp&&s){let p=e.fetchData.__span;if(!p)return;let f=r[p];if(f){if(e.response){f.setHttpStatus(e.response.status);let m=e.response&&e.response.headers&&e.response.headers.get("content-length"),E=parseInt(m);E>0&&f.setData("http.response_content_length",E)}else e.error&&f.setStatus("internal_error");f.finish(),delete r[p]}return}let o=un.getCurrentHub(),i=o.getScope(),a=o.getClient(),c=i.getSpan(),{method:u,url:d}=e.fetchData,l=s&&c?c.startChild({data:{url:d,type:"fetch","http.method":u},description:`${u} ${d}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(l&&(e.fetchData.__span=l.spanId,r[l.spanId]=l),n(e.fetchData.url)&&a){let p=e.args[0];e.args[1]=e.args[1]||{};let f=e.args[1];f.headers=og(p,a,i,f,l)}return l}function og(e,t,n,r,s){let o=s||n.getSpan(),i=o&&o.transaction,{traceId:a,sampled:c,dsc:u}=n.getPropagationContext(),d=o?o.toTraceparent():W.generateSentryTraceHeader(a,void 0,c),l=i?i.getDynamicSamplingContext():u||un.getDynamicSamplingContextFromClient(a,t,n),p=W.dynamicSamplingContextToSentryBaggageHeader(l),f=typeof Request<"u"&&W.isInstanceOf(e,Request)?e.headers:r.headers;if(f)if(typeof Headers<"u"&&W.isInstanceOf(f,Headers)){let m=new Headers(f);return m.append("sentry-trace",d),p&&m.append(W.BAGGAGE_HEADER_NAME,p),m}else if(Array.isArray(f)){let m=[...f,["sentry-trace",d]];return p&&m.push([W.BAGGAGE_HEADER_NAME,p]),m}else{let m="baggage"in f?f.baggage:void 0,E=[];return Array.isArray(m)?E.push(...m):m&&E.push(m),p&&E.push(p),{...f,"sentry-trace":d,baggage:E.length>0?E.join(","):void 0}}else return{"sentry-trace":d,baggage:p}}function ig(e,t,n,r){let s=e.xhr,o=s&&s[W.SENTRY_XHR_DATA_KEY];if(!un.hasTracingEnabled()||s&&s.__sentry_own_request__||!s||!o)return;let i=t(o.url);if(e.endTimestamp&&i){let l=s.__sentry_xhr_span_id__;if(!l)return;let p=r[l];p&&(p.setHttpStatus(o.status_code),p.finish(),delete r[l]);return}let a=un.getCurrentHub(),c=a.getScope(),u=c.getSpan(),d=i&&u?u.startChild({data:{...o.data,type:"xhr","http.method":o.method,url:o.url},description:`${o.method} ${o.url}`,op:"http.client",origin:"auto.http.browser"}):void 0;if(d&&(s.__sentry_xhr_span_id__=d.spanId,r[s.__sentry_xhr_span_id__]=d),s.setRequestHeader&&n(o.url))if(d){let l=d&&d.transaction,p=l&&l.getDynamicSamplingContext(),f=W.dynamicSamplingContextToSentryBaggageHeader(p);tg(s,d.toTraceparent(),f)}else{let l=a.getClient(),{traceId:p,sampled:f,dsc:m}=c.getPropagationContext(),E=W.generateSentryTraceHeader(p,void 0,f),I=m||(l?un.getDynamicSamplingContextFromClient(p,l,c):void 0),R=W.dynamicSamplingContextToSentryBaggageHeader(I);tg(s,E,R)}return d}function tg(e,t,n){try{e.setRequestHeader("sentry-trace",t),n&&e.setRequestHeader(W.BAGGAGE_HEADER_NAME,n)}catch{}}Ne.DEFAULT_TRACE_PROPAGATION_TARGETS=to;Ne.addTracingHeadersToFetchRequest=og;Ne.defaultRequestInstrumentationOptions=Fc;Ne.extractNetworkProtocol=ng;Ne.fetchCallback=sg;Ne.instrumentOutgoingRequests=OR;Ne.shouldAttachHeaders=rg;Ne.xhrCallback=ig});var ag=g(Bc=>{Object.defineProperty(Bc,"__esModule",{value:!0});var yr=T(),Sr=Ke();function NR(e,t=!0,n=!0){if(!Sr.WINDOW||!Sr.WINDOW.location){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&yr.logger.warn("Could not initialize routing instrumentation due to invalid location");return}let r=Sr.WINDOW.location.href,s;t&&(s=e({name:Sr.WINDOW.location.pathname,startTimestamp:yr.browserPerformanceTimeOrigin?yr.browserPerformanceTimeOrigin/1e3:void 0,op:"pageload",origin:"auto.pageload.browser",metadata:{source:"url"}})),n&&yr.addInstrumentationHandler("history",({to:o,from:i})=>{if(i===void 0&&r&&r.indexOf(o)!==-1){r=void 0;return}i!==o&&(r=void 0,s&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&yr.logger.log(`[Tracing] Finishing current transaction with op: ${s.op}`),s.finish()),s=e({name:Sr.WINDOW.location.pathname,op:"navigation",origin:"auto.navigation.browser",metadata:{source:"url"}}))})}Bc.instrumentRoutingWithDefaults=NR});var lg=g(br=>{Object.defineProperty(br,"__esModule",{value:!0});var Tr=N(),Ve=T(),wR=Ff(),no=Zf(),ug=Gc(),kR=ag(),cg=Ke(),dg="BrowserTracing",xR={...Tr.TRACING_DEFAULTS,markBackgroundTransactions:!0,routingInstrumentation:kR.instrumentRoutingWithDefaults,startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0,enableLongTask:!0,_experiments:{},...ug.defaultRequestInstrumentationOptions},jc=class{constructor(t){this.name=dg,this._hasSetTracePropagationTargets=!1,Tr.addTracingExtensions(),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&(this._hasSetTracePropagationTargets=!!(t&&(t.tracePropagationTargets||t.tracingOrigins))),this.options={...xR,...t},this.options._experiments.enableLongTask!==void 0&&(this.options.enableLongTask=this.options._experiments.enableLongTask),t&&!t.tracePropagationTargets&&t.tracingOrigins&&(this.options.tracePropagationTargets=t.tracingOrigins),this._collectWebVitals=no.startTrackingWebVitals(),this.options.enableLongTask&&no.startTrackingLongTasks(),this.options._experiments.enableInteractions&&no.startTrackingInteractions()}setupOnce(t,n){this._getCurrentHub=n;let s=n().getClient(),o=s&&s.getOptions(),{routingInstrumentation:i,startTransactionOnLocationChange:a,startTransactionOnPageLoad:c,markBackgroundTransactions:u,traceFetch:d,traceXHR:l,shouldCreateSpanForRequest:p,enableHTTPTimings:f,_experiments:m}=this.options,E=o&&o.tracePropagationTargets,I=E||this.options.tracePropagationTargets;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&this._hasSetTracePropagationTargets&&E&&Ve.logger.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(R=>{let L=this._createRouteTransaction(R);return this.options._experiments.onStartRouteTransaction&&this.options._experiments.onStartRouteTransaction(L,R,n),L},c,a),u&&wR.registerBackgroundTabDetection(),m.enableInteractions&&this._registerInteractionListener(),ug.instrumentOutgoingRequests({traceFetch:d,traceXHR:l,tracePropagationTargets:I,shouldCreateSpanForRequest:p,enableHTTPTimings:f})}_createRouteTransaction(t){if(!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ve.logger.warn(`[Tracing] Did not create ${t.op} transaction because _getCurrentHub is invalid.`);return}let n=this._getCurrentHub(),{beforeNavigate:r,idleTimeout:s,finalTimeout:o,heartbeatInterval:i}=this.options,a=t.op==="pageload",c=a?$c("sentry-trace"):"",u=a?$c("baggage"):"",{traceparentData:d,dynamicSamplingContext:l,propagationContext:p}=Ve.tracingContextFromHeaders(c,u),f={...t,...d,metadata:{...t.metadata,dynamicSamplingContext:d&&!l?{}:l},trimEnd:!0},m=typeof r=="function"?r(f):f,E=m===void 0?{...f,sampled:!1}:m;E.metadata=E.name!==f.name?{...E.metadata,source:"custom"}:E.metadata,this._latestRouteName=E.name,this._latestRouteSource=E.metadata&&E.metadata.source,E.sampled===!1&&(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ve.logger.log(`[Tracing] Will not send ${E.op} transaction because of beforeNavigate.`),(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ve.logger.log(`[Tracing] Starting ${E.op} transaction on scope`);let{location:I}=cg.WINDOW,R=Tr.startIdleTransaction(n,E,s,o,!0,{location:I},i),L=n.getScope();return a&&d?L.setPropagationContext(p):L.setPropagationContext({traceId:R.traceId,spanId:R.spanId,parentSpanId:R.parentSpanId,sampled:R.sampled}),R.registerBeforeFinishCallback(ie=>{this._collectWebVitals(),no.addPerformanceEntries(ie)}),R}_registerInteractionListener(){let t,n=()=>{let{idleTimeout:r,finalTimeout:s,heartbeatInterval:o}=this.options,i="ui.action.click",a=Tr.getActiveTransaction();if(a&&a.op&&["navigation","pageload"].includes(a.op)){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ve.logger.warn(`[Tracing] Did not create ${i} transaction because a pageload or navigation transaction is in progress.`);return}if(t&&(t.setFinishReason("interactionInterrupted"),t.finish(),t=void 0),!this._getCurrentHub){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ve.logger.warn(`[Tracing] Did not create ${i} transaction because _getCurrentHub is invalid.`);return}if(!this._latestRouteName){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&Ve.logger.warn(`[Tracing] Did not create ${i} transaction because _latestRouteName is missing.`);return}let c=this._getCurrentHub(),{location:u}=cg.WINDOW,d={name:this._latestRouteName,op:i,trimEnd:!0,metadata:{source:this._latestRouteSource||"url"}};t=Tr.startIdleTransaction(c,d,r,s,!0,{location:u},o)};["click"].forEach(r=>{addEventListener(r,n,{once:!1,capture:!0})})}};function $c(e){let t=Ve.getDomElement(`meta[name=${e}]`);return t?t.getAttribute("content"):void 0}br.BROWSER_TRACING_INTEGRATION_ID=dg;br.BrowserTracing=jc;br.getMetaContent=$c});var fg=g((Hc,Ir)=>{Object.defineProperty(Hc,"__esModule",{value:!0});var pg=N(),dn=T();function PR(){let e=pg.getMainCarrier();if(!e.__SENTRY__)return;let t={mongodb(){let r=dn.dynamicRequire(Ir,"./node/integrations/mongo");return new r.Mongo},mongoose(){let r=dn.dynamicRequire(Ir,"./node/integrations/mongo");return new r.Mongo},mysql(){let r=dn.dynamicRequire(Ir,"./node/integrations/mysql");return new r.Mysql},pg(){let r=dn.dynamicRequire(Ir,"./node/integrations/postgres");return new r.Postgres}},n=Object.keys(t).filter(r=>!!dn.loadModule(r)).map(r=>{try{return t[r]()}catch{return}}).filter(r=>r);n.length>0&&(e.__SENTRY__.integrations=[...e.__SENTRY__.integrations||[],...n])}function UR(){pg.addTracingExtensions(),dn.isNodeEnv()&&PR()}Hc.addExtensionMethods=UR});var Kc=g(C=>{Object.defineProperty(C,"__esModule",{value:!0});var ze=N(),gg=T(),MR=Of(),LR=Cf(),qR=Df(),FR=Nf(),GR=xf(),BR=Pf(),jR=Mf(),$R=Lf(),_g=lg(),Yc=Gc(),HR=fg();C.IdleTransaction=ze.IdleTransaction;C.Span=ze.Span;C.SpanStatus=ze.SpanStatus;C.Transaction=ze.Transaction;C.extractTraceparentData=ze.extractTraceparentData;C.getActiveTransaction=ze.getActiveTransaction;C.hasTracingEnabled=ze.hasTracingEnabled;C.spanStatusfromHttpCode=ze.spanStatusfromHttpCode;C.startIdleTransaction=ze.startIdleTransaction;C.TRACEPARENT_REGEXP=gg.TRACEPARENT_REGEXP;C.stripUrlQueryAndFragment=gg.stripUrlQueryAndFragment;C.Express=MR.Express;C.Postgres=LR.Postgres;C.Mysql=qR.Mysql;C.Mongo=FR.Mongo;C.Prisma=GR.Prisma;C.GraphQL=BR.GraphQL;C.Apollo=jR.Apollo;C.lazyLoadedNodePerformanceMonitoringIntegrations=$R.lazyLoadedNodePerformanceMonitoringIntegrations;C.BROWSER_TRACING_INTEGRATION_ID=_g.BROWSER_TRACING_INTEGRATION_ID;C.BrowserTracing=_g.BrowserTracing;C.addTracingHeadersToFetchRequest=Yc.addTracingHeadersToFetchRequest;C.defaultRequestInstrumentationOptions=Yc.defaultRequestInstrumentationOptions;C.instrumentOutgoingRequests=Yc.instrumentOutgoingRequests;C.addExtensionMethods=HR.addExtensionMethods});var hg=g(Wc=>{Object.defineProperty(Wc,"__esModule",{value:!0});var YR=Kc(),KR=T();function WR(){let e=YR.lazyLoadedNodePerformanceMonitoringIntegrations.map(t=>{try{return t()}catch{return}}).filter(t=>!!t);return e.length===0&&KR.logger.warn("Performance monitoring integrations could not be automatically loaded."),e.filter(t=>!!t.loadDependency())}Wc.autoDiscoverNodePerformanceMonitoringIntegrations=WR});var Jc=g(Xc=>{Object.defineProperty(Xc,"__esModule",{value:!0});var Vc=N(),VR=require("os"),zR=require("util"),zc=class extends Vc.ServerRuntimeClient{constructor(t){t._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.node",packages:[{name:"npm:@sentry/node",version:Vc.SDK_VERSION}],version:Vc.SDK_VERSION},t.transportOptions={textEncoder:new zR.TextEncoder,...t.transportOptions};let n={...t,platform:"node",runtime:{name:"node",version:global.process.version},serverName:t.serverName||global.process.env.SENTRY_NAME||VR.hostname()};super(n)}};Xc.NodeClient=zc});var Eg=g((Ax,mg)=>{var ln=1e3,pn=ln*60,fn=pn*60,Dt=fn*24,XR=Dt*7,JR=Dt*365.25;mg.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return QR(e);if(n==="number"&&isFinite(e))return t.long?ev(e):ZR(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function QR(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*JR;case"weeks":case"week":case"w":return n*XR;case"days":case"day":case"d":return n*Dt;case"hours":case"hour":case"hrs":case"hr":case"h":return n*fn;case"minutes":case"minute":case"mins":case"min":case"m":return n*pn;case"seconds":case"second":case"secs":case"sec":case"s":return n*ln;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function ZR(e){var t=Math.abs(e);return t>=Dt?Math.round(e/Dt)+"d":t>=fn?Math.round(e/fn)+"h":t>=pn?Math.round(e/pn)+"m":t>=ln?Math.round(e/ln)+"s":e+"ms"}function ev(e){var t=Math.abs(e);return t>=Dt?ro(e,t,Dt,"day"):t>=fn?ro(e,t,fn,"hour"):t>=pn?ro(e,t,pn,"minute"):t>=ln?ro(e,t,ln,"second"):e+" ms"}function ro(e,t,n,r){var s=t>=n*1.5;return Math.round(e/n)+" "+r+(s?"s":"")}});var Qc=g((Rx,yg)=>{function tv(e){n.debug=n,n.default=n,n.coerce=c,n.disable=i,n.enable=s,n.enabled=a,n.humanize=Eg(),n.destroy=u,Object.keys(e).forEach(d=>{n[d]=e[d]}),n.names=[],n.skips=[],n.formatters={};function t(d){let l=0;for(let p=0;p<d.length;p++)l=(l<<5)-l+d.charCodeAt(p),l|=0;return n.colors[Math.abs(l)%n.colors.length]}n.selectColor=t;function n(d){let l,p=null,f,m;function E(...I){if(!E.enabled)return;let R=E,L=Number(new Date),ie=L-(l||L);R.diff=ie,R.prev=l,R.curr=L,l=L,I[0]=n.coerce(I[0]),typeof I[0]!="string"&&I.unshift("%O");let ae=0;I[0]=I[0].replace(/%([a-zA-Z%])/g,(x,Le)=>{if(x==="%%")return"%";ae++;let be=n.formatters[Le];if(typeof be=="function"){let ii=I[ae];x=be.call(R,ii),I.splice(ae,1),ae--}return x}),n.formatArgs.call(R,I),(R.log||n.log).apply(R,I)}return E.namespace=d,E.useColors=n.useColors(),E.color=n.selectColor(d),E.extend=r,E.destroy=n.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(f!==n.namespaces&&(f=n.namespaces,m=n.enabled(d)),m),set:I=>{p=I}}),typeof n.init=="function"&&n.init(E),E}function r(d,l){let p=n(this.namespace+(typeof l>"u"?":":l)+d);return p.log=this.log,p}function s(d){n.save(d),n.namespaces=d,n.names=[],n.skips=[];let l=(typeof d=="string"?d:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let p of l)p[0]==="-"?n.skips.push(p.slice(1)):n.names.push(p)}function o(d,l){let p=0,f=0,m=-1,E=0;for(;p<d.length;)if(f<l.length&&(l[f]===d[p]||l[f]==="*"))l[f]==="*"?(m=f,E=p,f++):(p++,f++);else if(m!==-1)f=m+1,E++,p=E;else return!1;for(;f<l.length&&l[f]==="*";)f++;return f===l.length}function i(){let d=[...n.names,...n.skips.map(l=>"-"+l)].join(",");return n.enable(""),d}function a(d){for(let l of n.skips)if(o(d,l))return!1;for(let l of n.names)if(o(d,l))return!0;return!1}function c(d){return d instanceof Error?d.stack||d.message:d}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}yg.exports=tv});var Sg=g((Z,so)=>{Z.formatArgs=rv;Z.save=sv;Z.load=ov;Z.useColors=nv;Z.storage=iv();Z.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Z.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function nv(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function rv(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+so.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(n++,s==="%c"&&(r=n))}),e.splice(r,0,t)}Z.log=console.debug||console.log||(()=>{});function sv(e){try{e?Z.storage.setItem("debug",e):Z.storage.removeItem("debug")}catch{}}function ov(){let e;try{e=Z.storage.getItem("debug")||Z.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function iv(){try{return localStorage}catch{}}so.exports=Qc()(Z);var{formatters:av}=so.exports;av.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var bg=g((vx,Tg)=>{"use strict";Tg.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),s=t.indexOf("--");return r!==-1&&(s===-1||r<s)}});var Rg=g((Ox,Ag)=>{"use strict";var cv=require("os"),Ig=require("tty"),ge=bg(),{env:G}=process,lt;ge("no-color")||ge("no-colors")||ge("color=false")||ge("color=never")?lt=0:(ge("color")||ge("colors")||ge("color=true")||ge("color=always"))&&(lt=1);"FORCE_COLOR"in G&&(G.FORCE_COLOR==="true"?lt=1:G.FORCE_COLOR==="false"?lt=0:lt=G.FORCE_COLOR.length===0?1:Math.min(parseInt(G.FORCE_COLOR,10),3));function Zc(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function eu(e,t){if(lt===0)return 0;if(ge("color=16m")||ge("color=full")||ge("color=truecolor"))return 3;if(ge("color=256"))return 2;if(e&&!t&&lt===void 0)return 0;let n=lt||0;if(G.TERM==="dumb")return n;if(process.platform==="win32"){let r=cv.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in G)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in G)||G.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in G)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(G.TEAMCITY_VERSION)?1:0;if(G.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in G){let r=parseInt((G.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(G.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(G.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(G.TERM)||"COLORTERM"in G?1:n}function uv(e){let t=eu(e,e&&e.isTTY);return Zc(t)}Ag.exports={supportsColor:uv,stdout:Zc(eu(!0,Ig.isatty(1))),stderr:Zc(eu(!0,Ig.isatty(2)))}});var Og=g((B,io)=>{var dv=require("tty"),oo=require("util");B.init=mv;B.log=gv;B.formatArgs=pv;B.save=_v;B.load=hv;B.useColors=lv;B.destroy=oo.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");B.colors=[6,2,3,4,5,1];try{let e=Rg();e&&(e.stderr||e).level>=2&&(B.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}B.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(s,o)=>o.toUpperCase()),r=process.env[t];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),e[n]=r,e},{});function lv(){return"colors"in B.inspectOpts?!!B.inspectOpts.colors:dv.isatty(process.stderr.fd)}function pv(e){let{namespace:t,useColors:n}=this;if(n){let r=this.color,s="\x1B[3"+(r<8?r:"8;5;"+r),o=` ${s};1m${t} \x1B[0m`;e[0]=o+e[0].split(`
21
21
  `).join(`
22
- `+i),t.push(s+"m+"+Js.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=Sv()+e+" "+t[0]}function Sv(){return B.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Tv(...t){return process.stderr.write(Xs.formatWithOptions(B.inspectOpts,...t)+`
23
- `)}function bv(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function Iv(){return process.env.DEBUG}function Av(t){t.inspectOpts={};let e=Object.keys(B.inspectOpts);for(let n=0;n<e.length;n++)t.inspectOpts[e[n]]=B.inspectOpts[e[n]]}Js.exports=Uc()(B);var{formatters:Zf}=Js.exports;Zf.o=function(t){return this.inspectOpts.colors=this.useColors,Xs.inspect(t,this.inspectOpts).split(`
24
- `).map(e=>e.trim()).join(" ")};Zf.O=function(t){return this.inspectOpts.colors=this.useColors,Xs.inspect(t,this.inspectOpts)}});var Qs=g((rk,Fc)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?Fc.exports=Wf():Fc.exports=eg()});var tg=g(Gc=>{"use strict";Object.defineProperty(Gc,"__esModule",{value:!0});function vv(t){return function(e,n){return new Promise((r,s)=>{t.call(this,e,n,(i,o)=>{i?s(i):r(o)})})}}Gc.default=vv});var sg=g(($c,rg)=>{"use strict";var ng=$c&&$c.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Rv=require("events"),Cv=ng(Qs()),Ov=ng(tg()),yr=Cv.default("agent-base");function Dv(t){return!!t&&typeof t.addRequest=="function"}function Bc(){let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
25
- `).some(e=>e.indexOf("(https.js:")!==-1||e.indexOf("node:https:")!==-1)}function Zs(t,e){return new Zs.Agent(t,e)}(function(t){class e extends Rv.EventEmitter{constructor(r,s){super();let i=s;typeof r=="function"?this.callback=r:r&&(i=r),this.timeout=null,i&&typeof i.timeout=="number"&&(this.timeout=i.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:Bc()?443:80}set defaultPort(r){this.explicitDefaultPort=r}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:Bc()?"https:":"http:"}set protocol(r){this.explicitProtocol=r}callback(r,s,i){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(r,s){let i=Object.assign({},s);typeof i.secureEndpoint!="boolean"&&(i.secureEndpoint=Bc()),i.host==null&&(i.host="localhost"),i.port==null&&(i.port=i.secureEndpoint?443:80),i.protocol==null&&(i.protocol=i.secureEndpoint?"https:":"http:"),i.host&&i.path&&delete i.path,delete i.agent,delete i.hostname,delete i._defaultAgent,delete i.defaultPort,delete i.createConnection,r._last=!0,r.shouldKeepAlive=!1;let o=!1,a=null,c=i.timeout||this.timeout,u=f=>{r._hadError||(r.emit("error",f),r._hadError=!0)},d=()=>{a=null,o=!0;let f=new Error(`A "socket" was not created for HTTP request before ${c}ms`);f.code="ETIMEOUT",u(f)},l=f=>{o||(a!==null&&(clearTimeout(a),a=null),u(f))},p=f=>{if(o)return;if(a!=null&&(clearTimeout(a),a=null),Dv(f)){yr("Callback returned another Agent instance %o",f.constructor.name),f.addRequest(r,i);return}if(f){f.once("free",()=>{this.freeSocket(f,i)}),r.onSocket(f);return}let m=new Error(`no Duplex stream was returned to agent-base for \`${r.method} ${r.path}\``);u(m)};if(typeof this.callback!="function"){u(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(yr("Converting legacy callback function to promise"),this.promisifiedCallback=Ov.default(this.callback)):this.promisifiedCallback=this.callback),typeof c=="number"&&c>0&&(a=setTimeout(d,c)),"port"in i&&typeof i.port!="number"&&(i.port=Number(i.port));try{yr("Resolving socket for %o request: %o",i.protocol,`${r.method} ${r.path}`),Promise.resolve(this.promisifiedCallback(r,i)).then(p,l)}catch(f){Promise.reject(f).catch(l)}}freeSocket(r,s){yr("Freeing socket %o %o",r.constructor.name,s),r.destroy()}destroy(){yr("Destroying agent %o",this.constructor.name)}}t.Agent=e,t.prototype=t.Agent.prototype})(Zs||(Zs={}));rg.exports=Zs});var ig=g(Tr=>{"use strict";var Nv=Tr&&Tr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Tr,"__esModule",{value:!0});var wv=Nv(Qs()),Sr=wv.default("https-proxy-agent:parse-proxy-response");function kv(t){return new Promise((e,n)=>{let r=0,s=[];function i(){let l=t.read();l?d(l):t.once("readable",i)}function o(){t.removeListener("end",c),t.removeListener("error",u),t.removeListener("close",a),t.removeListener("readable",i)}function a(l){Sr("onclose had error %o",l)}function c(){Sr("onend")}function u(l){o(),Sr("onerror %o",l),n(l)}function d(l){s.push(l),r+=l.length;let p=Buffer.concat(s,r);if(p.indexOf(`\r
22
+ `+o),e.push(s+"m+"+io.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=fv()+t+" "+e[0]}function fv(){return B.inspectOpts.hideDate?"":new Date().toISOString()+" "}function gv(...e){return process.stderr.write(oo.formatWithOptions(B.inspectOpts,...e)+`
23
+ `)}function _v(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function hv(){return process.env.DEBUG}function mv(e){e.inspectOpts={};let t=Object.keys(B.inspectOpts);for(let n=0;n<t.length;n++)e.inspectOpts[t[n]]=B.inspectOpts[t[n]]}io.exports=Qc()(B);var{formatters:vg}=io.exports;vg.o=function(e){return this.inspectOpts.colors=this.useColors,oo.inspect(e,this.inspectOpts).split(`
24
+ `).map(t=>t.trim()).join(" ")};vg.O=function(e){return this.inspectOpts.colors=this.useColors,oo.inspect(e,this.inspectOpts)}});var ao=g((Cx,tu)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?tu.exports=Sg():tu.exports=Og()});var Cg=g(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});function Ev(e){return function(t,n){return new Promise((r,s)=>{e.call(this,t,n,(o,i)=>{o?s(o):r(i)})})}}nu.default=Ev});var wg=g((su,Ng)=>{"use strict";var Dg=su&&su.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},yv=require("events"),Sv=Dg(ao()),Tv=Dg(Cg()),Ar=Sv.default("agent-base");function bv(e){return!!e&&typeof e.addRequest=="function"}function ru(){let{stack:e}=new Error;return typeof e!="string"?!1:e.split(`
25
+ `).some(t=>t.indexOf("(https.js:")!==-1||t.indexOf("node:https:")!==-1)}function co(e,t){return new co.Agent(e,t)}(function(e){class t extends yv.EventEmitter{constructor(r,s){super();let o=s;typeof r=="function"?this.callback=r:r&&(o=r),this.timeout=null,o&&typeof o.timeout=="number"&&(this.timeout=o.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:ru()?443:80}set defaultPort(r){this.explicitDefaultPort=r}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:ru()?"https:":"http:"}set protocol(r){this.explicitProtocol=r}callback(r,s,o){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(r,s){let o=Object.assign({},s);typeof o.secureEndpoint!="boolean"&&(o.secureEndpoint=ru()),o.host==null&&(o.host="localhost"),o.port==null&&(o.port=o.secureEndpoint?443:80),o.protocol==null&&(o.protocol=o.secureEndpoint?"https:":"http:"),o.host&&o.path&&delete o.path,delete o.agent,delete o.hostname,delete o._defaultAgent,delete o.defaultPort,delete o.createConnection,r._last=!0,r.shouldKeepAlive=!1;let i=!1,a=null,c=o.timeout||this.timeout,u=f=>{r._hadError||(r.emit("error",f),r._hadError=!0)},d=()=>{a=null,i=!0;let f=new Error(`A "socket" was not created for HTTP request before ${c}ms`);f.code="ETIMEOUT",u(f)},l=f=>{i||(a!==null&&(clearTimeout(a),a=null),u(f))},p=f=>{if(i)return;if(a!=null&&(clearTimeout(a),a=null),bv(f)){Ar("Callback returned another Agent instance %o",f.constructor.name),f.addRequest(r,o);return}if(f){f.once("free",()=>{this.freeSocket(f,o)}),r.onSocket(f);return}let m=new Error(`no Duplex stream was returned to agent-base for \`${r.method} ${r.path}\``);u(m)};if(typeof this.callback!="function"){u(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(Ar("Converting legacy callback function to promise"),this.promisifiedCallback=Tv.default(this.callback)):this.promisifiedCallback=this.callback),typeof c=="number"&&c>0&&(a=setTimeout(d,c)),"port"in o&&typeof o.port!="number"&&(o.port=Number(o.port));try{Ar("Resolving socket for %o request: %o",o.protocol,`${r.method} ${r.path}`),Promise.resolve(this.promisifiedCallback(r,o)).then(p,l)}catch(f){Promise.reject(f).catch(l)}}freeSocket(r,s){Ar("Freeing socket %o %o",r.constructor.name,s),r.destroy()}destroy(){Ar("Destroying agent %o",this.constructor.name)}}e.Agent=t,e.prototype=e.Agent.prototype})(co||(co={}));Ng.exports=co});var kg=g(vr=>{"use strict";var Iv=vr&&vr.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vr,"__esModule",{value:!0});var Av=Iv(ao()),Rr=Av.default("https-proxy-agent:parse-proxy-response");function Rv(e){return new Promise((t,n)=>{let r=0,s=[];function o(){let l=e.read();l?d(l):e.once("readable",o)}function i(){e.removeListener("end",c),e.removeListener("error",u),e.removeListener("close",a),e.removeListener("readable",o)}function a(l){Rr("onclose had error %o",l)}function c(){Rr("onend")}function u(l){i(),Rr("onerror %o",l),n(l)}function d(l){s.push(l),r+=l.length;let p=Buffer.concat(s,r);if(p.indexOf(`\r
26
26
  \r
27
- `)===-1){Sr("have not received end of HTTP headers yet..."),i();return}let m=p.toString("ascii",0,p.indexOf(`\r
28
- `)),E=+m.split(" ")[1];Sr("got proxy server response: %o",m),e({statusCode:E,buffered:p})}t.on("error",u),t.on("close",a),t.on("end",c),i()})}Tr.default=kv});var cg=g(Ct=>{"use strict";var xv=Ct&&Ct.__awaiter||function(t,e,n,r){function s(i){return i instanceof n?i:new n(function(o){o(i)})}return new(n||(n=Promise))(function(i,o){function a(d){try{u(r.next(d))}catch(l){o(l)}}function c(d){try{u(r.throw(d))}catch(l){o(l)}}function u(d){d.done?i(d.value):s(d.value).then(a,c)}u((r=r.apply(t,e||[])).next())})},pn=Ct&&Ct.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ct,"__esModule",{value:!0});var og=pn(require("net")),ag=pn(require("tls")),Pv=pn(require("url")),Mv=pn(require("assert")),Uv=pn(Qs()),Lv=sg(),qv=pn(ig()),br=Uv.default("https-proxy-agent:agent"),jc=class extends Lv.Agent{constructor(e){let n;if(typeof e=="string"?n=Pv.default.parse(e):n=e,!n)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");br("creating new HttpsProxyAgent instance: %o",n),super(n);let r=Object.assign({},n);this.secureProxy=n.secureProxy||Bv(r.protocol),r.host=r.hostname||r.host,typeof r.port=="string"&&(r.port=parseInt(r.port,10)),!r.port&&r.host&&(r.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in r)&&(r.ALPNProtocols=["http 1.1"]),r.host&&r.path&&(delete r.path,delete r.pathname),this.proxy=r}callback(e,n){return xv(this,void 0,void 0,function*(){let{proxy:r,secureProxy:s}=this,i;s?(br("Creating `tls.Socket`: %o",r),i=ag.default.connect(r)):(br("Creating `net.Socket`: %o",r),i=og.default.connect(r));let o=Object.assign({},r.headers),c=`CONNECT ${`${n.host}:${n.port}`} HTTP/1.1\r
29
- `;r.auth&&(o["Proxy-Authorization"]=`Basic ${Buffer.from(r.auth).toString("base64")}`);let{host:u,port:d,secureEndpoint:l}=n;Gv(d,l)||(u+=`:${d}`),o.Host=u,o.Connection="close";for(let b of Object.keys(o))c+=`${b}: ${o[b]}\r
30
- `;let p=qv.default(i);i.write(`${c}\r
31
- `);let{statusCode:f,buffered:m}=yield p;if(f===200){if(e.once("socket",Fv),n.secureEndpoint){br("Upgrading socket connection to TLS");let b=n.servername||n.host;return ag.default.connect(Object.assign(Object.assign({},$v(n,"host","hostname","path","port")),{socket:i,servername:b}))}return i}i.destroy();let E=new og.default.Socket({writable:!1});return E.readable=!0,e.once("socket",b=>{br("replaying proxy buffer for failed request"),Mv.default(b.listenerCount("data")>0),b.push(m),b.push(null)}),E})}};Ct.default=jc;function Fv(t){t.resume()}function Gv(t,e){return!!(!e&&t===80||e&&t===443)}function Bv(t){return typeof t=="string"?/^https:?$/i.test(t):!1}function $v(t,...e){let n={},r;for(r in t)e.includes(r)||(n[r]=t[r]);return n}});var dg=g((Kc,ug)=>{"use strict";var jv=Kc&&Kc.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},Hc=jv(cg());function Yc(t){return new Hc.default(t)}(function(t){t.HttpsProxyAgent=Hc.default,t.prototype=Hc.default.prototype})(Yc||(Yc={}));ug.exports=Yc});var zc=g(Vc=>{var{_nullishCoalesce:Wc}=k();Object.defineProperty(Vc,"__esModule",{value:!0});var lg=N(),Hv=require("http"),Yv=require("https"),Kv=dg(),Wv=require("stream"),pg=require("url"),Vv=require("zlib"),zv=1024*32;function Xv(t){return new Wv.Readable({read(){this.push(t),this.push(null)}})}function Jv(t){let e;try{e=new pg.URL(t.url)}catch{return console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used."),lg.createTransport(t,()=>Promise.resolve({}))}let n=e.protocol==="https:",r=Qv(e,t.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),s=n?Yv:Hv,i=t.keepAlive===void 0?!1:t.keepAlive,o=r?new Kv.HttpsProxyAgent(r):new s.Agent({keepAlive:i,maxSockets:30,timeout:2e3}),a=Zv(t,Wc(t.httpModule,()=>s),o);return lg.createTransport(t,a)}function Qv(t,e){let{no_proxy:n}=process.env;if(!(n&&n.split(",").some(s=>t.host.endsWith(s)||t.hostname.endsWith(s))))return e}function Zv(t,e,n){let{hostname:r,pathname:s,port:i,protocol:o,search:a}=new pg.URL(t.url);return function(u){return new Promise((d,l)=>{let p=Xv(u.body),f={...t.headers};u.body.length>zv&&(f["content-encoding"]="gzip",p=p.pipe(Vv.createGzip()));let m=e.request({method:"POST",agent:n,headers:f,hostname:r,path:`${s}${a}`,port:i,protocol:o,ca:t.caCerts},E=>{E.on("data",()=>{}),E.on("end",()=>{}),E.setEncoding("utf8");let b=Wc(E.headers["retry-after"],()=>null),v=Wc(E.headers["x-sentry-rate-limits"],()=>null);d({statusCode:E.statusCode,headers:{"retry-after":b,"x-sentry-rate-limits":Array.isArray(v)?v[0]:v}})});m.on("error",l),p.pipe(m)})}}Vc.makeNodeTransport=Jv});var ei=g(Xc=>{Object.defineProperty(Xc,"__esModule",{value:!0});var fg=require("path"),eR=fg.sep==="\\";function tR(t){return t.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function nR(t,e=eR){if(!t)return;let n=e?tR(t):t,{root:r,dir:s,base:i,ext:o}=fg.posix.parse(n),c=`${require&&require.main&&require.main.filename&&s||global.process.cwd()}/`,u=i;(o===".js"||o===".mjs"||o===".cjs")&&(u=u.slice(0,o.length*-1)),!r&&!s&&(s=".");let d=s.lastIndexOf("/node_modules/");if(d>-1)return`${s.slice(d+14).replace(/\//g,".")}:${u}`;if(d=`${s}/`.lastIndexOf(c,0),d===0){let l=s.slice(c.length).replace(/\//g,".");return l&&(l+=":"),l+=u,l}return u}Xc.getModuleFromFilename=nR});var _g=g(eu=>{Object.defineProperty(eu,"__esModule",{value:!0});var Zc=require("crypto"),rR=require("events"),sR=require("http"),iR=require("url"),ti={CONTINUATION:0,TEXT:1,BINARY:2,TERMINATE:8,PING:9,PONG:10},oR="258EAFA5-E914-47DA-95CA-C5AB0DC85B11";function gg(t){return Buffer.byteLength(t.payload)>=t.payloadLength}function Jc(t,e,n){if(e===void 0)return t;for(let r=0;r<t.length;r++)t[r]^=e[n+r&3];return t}function aR(t){let{opcode:e,fin:n,data:r}=t,s=6,i=r.length;i>=65536?(s+=8,i=127):i>125&&(s+=2,i=126);let o=Buffer.allocUnsafe(s);o[0]=n?e|128:e,o[1]=i,i===126?o.writeUInt16BE(r.length,2):i===127&&(o.writeUInt32BE(0,2),o.writeUInt32BE(r.length,6));let a=Zc.randomBytes(4);o[1]|=128,o[s-4]=a[0],o[s-3]=a[1],o[s-2]=a[2],o[s-1]=a[3];let c=Buffer.alloc(i);for(let u=0;u<i;++u)c[u]=r[u]^a[u&3];return Buffer.concat([o,c])}function cR(t){let e=t.readUInt8(0),n=!!(e>>>7&1),r=e&15,s=t.readUInt8(1),i=!!(s>>>7&1),o=2,a=s&127;if(a>125)if(a===126)a=t.readUInt16BE(o),o+=2;else if(a===127){let d=t.readUInt32BE(o);if(o+=4,d>=Number.MAX_SAFE_INTEGER)throw new Error("Unsupported WebSocket frame: payload length > 2^53 - 1");let l=t.readUInt32BE(o);o+=4,a=d*Math.pow(2,32)+l}else throw new Error("Unknown payload length");let c;i&&(c=t.slice(o,o+4),o+=4);let u=Jc(t.slice(o),c,0);return{fin:n,opcode:r,mask:c,payload:u,payloadLength:a}}function uR(t){return Zc.createHash("sha1").update(`${t}${oR}`).digest("base64")}var Qc=class extends rR.EventEmitter{constructor(e){super(),this._unfinishedFrame=void 0,this._incompleteFrame=void 0,this._socket=e,this._alive=!0,e.on("data",n=>{this._addBuffer(n)}),e.on("error",n=>{n.code==="ECONNRESET"?this.emit("close"):this.emit("error")}),e.on("close",()=>{this.end()})}end(){this._alive&&(this._alive=!1,this.emit("close"),this._socket.end())}send(e){this._sendFrame({opcode:ti.TEXT,fin:!0,data:Buffer.from(e)})}_sendFrame(e){this._socket.write(aR(e))}_completeFrame(e){let{_unfinishedFrame:n}=this;if(n!==void 0)if(e.opcode===ti.CONTINUATION){n.payload=Buffer.concat([n.payload,Jc(e.payload,n.mask,n.payload.length)]),e.fin&&(this._unfinishedFrame=void 0,this._completeFrame(n));return}else this._unfinishedFrame=void 0;if(e.fin)if(e.opcode===ti.PING)this._sendFrame({opcode:ti.PONG,fin:!0,data:e.payload});else{let r;e.payload.length>e.payloadLength&&(r=e.payload.slice(e.payloadLength),e.payload=e.payload.slice(0,e.payloadLength)),this.emit("message",e.payload),r!==void 0&&this._addBuffer(r)}else this._unfinishedFrame=e}_addBufferToIncompleteFrame(e,n){e.payload=Buffer.concat([e.payload,Jc(n,e.mask,e.payload.length)]),gg(e)&&(this._incompleteFrame=void 0,this._completeFrame(e))}_addBuffer(e){let{_incompleteFrame:n}=this;if(n!==void 0){this._addBufferToIncompleteFrame(n,e);return}let r=cR(e);gg(r)?this._completeFrame(r):this._incompleteFrame=r}};async function dR(t){let e=iR.parse(t);return new Promise((n,r)=>{let s=Zc.randomBytes(16).toString("base64"),i=uR(s),o=sR.request({hostname:e.hostname,port:e.port,path:e.path,method:"GET",headers:{Connection:"Upgrade",Upgrade:"websocket","Sec-WebSocket-Key":s,"Sec-WebSocket-Version":"13"}});o.on("response",a=>{a.statusCode&&a.statusCode>=400&&process.stderr.write(`Unexpected HTTP code: ${a.statusCode}
32
- `),a.pipe(process.stderr)}),o.on("upgrade",(a,c)=>{if(a.headers["sec-websocket-accept"]!==i){c.end(),r(new Error(`Digest mismatch ${i} !== ${a.headers["sec-websocket-accept"]}`));return}let u=new Qc(c);n(u)}),o.on("error",a=>{r(a)}),o.end()})}eu.createWebSocketClient=dR});var hg=g(tu=>{Object.defineProperty(tu,"__esModule",{value:!0});var lR=T(),pR=ei(),fR=_g();async function gR(t,e){let n=0,r=await fR.createWebSocketClient(t);return r.on("message",s=>{let i=JSON.parse(s.toString());e(i)}),s=>{r.send(JSON.stringify({id:n++,method:s}))}}async function _R(t,e){let n=await gR(t,lR.createDebugPauseMessageHandler(r=>n(r),pR.getModuleFromFilename,e));return()=>{n("Debugger.enable"),n("Debugger.pause")}}tu.captureStackTrace=_R});var ru=g(ri=>{Object.defineProperty(ri,"__esModule",{value:!0});var ni=T(),hR=require("child_process"),mR=hg(),nu=N(),ER=50,yR=5e3;function mg(t,e){let n={level:"error",exception:{values:[{type:"ApplicationNotResponding",value:`Application Not Responding for at least ${t} ms`,stacktrace:{frames:e},mechanism:{type:"ANR"}}]}};nu.captureEvent(n),nu.flush(3e3).then(()=>{process.exit()})}function SR(t=9229){let e=require("inspector"),n,r=t;for(;n===void 0&&r<t+100;)e.open(r),n=e.url(),r++;return n}function TR(t){function e(n,...r){ni.logger.log(`[ANR] ${n}`,...r)}try{let n={...process.env};n.SENTRY_ANR_CHILD_PROCESS="true",t.captureStackTrace&&(n.SENTRY_INSPECT_URL=SR()),e(`Spawning child process with execPath:'${process.execPath}' and entryScript'${t.entryScript}'`);let r=hR.spawn(process.execPath,[t.entryScript],{env:n,stdio:ni.logger.isEnabled()?["inherit","inherit","inherit","ipc"]:["ignore","ignore","ignore","ipc"]});r.unref();let s=setInterval(()=>{try{r.send("ping")}catch{}},t.pollInterval),i=o=>(...a)=>{clearInterval(s),e(`Child process ${o}`,...a)};r.on("error",i("error")),r.on("disconnect",i("disconnect")),r.on("exit",i("exit"))}catch(n){e("Failed to start child process",n)}}function bR(){let t=process.hrtime();return{getTimeMs:()=>{let[e,n]=process.hrtime(t);return Math.floor(e*1e3+n/1e6)},reset:()=>{t=process.hrtime()}}}function IR(t){function e(i){ni.logger.log(`[ANR child process] ${i}`)}process.title="sentry-anr",e("Started"),nu.addGlobalEventProcessor(i=>(delete i.sdkProcessingMetadata,i.tags={...i.tags,"process.name":"ANR"},i));let n;process.env.SENTRY_INSPECT_URL&&(e("Connecting to debugger"),n=mR.captureStackTrace(process.env.SENTRY_INSPECT_URL,i=>{e("Capturing event with stack frames"),mg(t.anrThreshold,i)}));async function r(){e("Watchdog timeout");let i=await n;i?(e("Pausing debugger to capture stack trace"),i()):(e("Capturing event"),mg(t.anrThreshold))}let{poll:s}=ni.watchdogTimer(bR,t.pollInterval,t.anrThreshold,r);process.on("message",()=>{s()})}function Eg(){return!!process.send&&!!process.env.SENTRY_ANR_CHILD_PROCESS}function AR(t){let n={entryScript:t.entryScript||process.env.pm_exec_path||process.argv[1],pollInterval:t.pollInterval||ER,anrThreshold:t.anrThreshold||yR,captureStackTrace:!!t.captureStackTrace,debug:!!t.debug};return Eg()?(IR(n),new Promise(()=>{})):(TR(n),Promise.resolve())}ri.enableAnrDetection=AR;ri.isAnrChildProcess=Eg});var fn=g(su=>{Object.defineProperty(su,"__esModule",{value:!0});var vR=T(),RR=vR.parseSemver(process.versions.node);su.NODE_VERSION=RR});var Tg=g(iu=>{var{_optionalChain:CR}=k();Object.defineProperty(iu,"__esModule",{value:!0});var Ot=N(),yg=require("domain");function Sg(){return yg.active}function OR(){let t=Sg();if(t)return Ot.ensureHubOnCarrier(t),Ot.getHubFromCarrier(t)}function DR(t){let e={};return Ot.ensureHubOnCarrier(e,t),Ot.getHubFromCarrier(e)}function NR(t,e){let n=Sg();if(n&&CR([e,"optionalAccess",o=>o.reuseExisting]))return t();let r=yg.create(),s=n?Ot.getHubFromCarrier(n):void 0,i=DR(s);return Ot.setHubOnCarrier(r,i),r.bind(()=>t())()}function wR(){Ot.setAsyncContextStrategy({getCurrentHub:OR,runWithAsyncContext:NR})}iu.setDomainAsyncContextStrategy=wR});var bg=g(au=>{var{_optionalChain:kR}=k();Object.defineProperty(au,"__esModule",{value:!0});var ou=N(),xR=require("async_hooks"),si;function PR(){si||(si=new xR.AsyncLocalStorage);function t(){return si.getStore()}function e(r){let s={};return ou.ensureHubOnCarrier(s,r),ou.getHubFromCarrier(s)}function n(r,s){let i=t();if(i&&kR([s,"optionalAccess",a=>a.reuseExisting]))return r();let o=e(i);return si.run(o,()=>r())}ou.setAsyncContextStrategy({getCurrentHub:t,runWithAsyncContext:n})}au.setHooksAsyncContextStrategy=PR});var Ag=g(cu=>{Object.defineProperty(cu,"__esModule",{value:!0});var Ig=fn(),MR=Tg(),UR=bg();function LR(){Ig.NODE_VERSION.major&&Ig.NODE_VERSION.major>=14?UR.setHooksAsyncContextStrategy():MR.setDomainAsyncContextStrategy()}cu.setNodeAsyncContextStrategy=LR});var du=g(uu=>{Object.defineProperty(uu,"__esModule",{value:!0});var qR=N(),vg=T(),FR=require("util"),ii=class t{constructor(){t.prototype.__init.call(this)}static __initStatic(){this.id="Console"}__init(){this.name=t.id}setupOnce(){vg.addInstrumentationHandler("console",({args:e,level:n})=>{let r=qR.getCurrentHub();r.getIntegration(t)&&r.addBreadcrumb({category:"console",level:vg.severityLevelFromString(n),message:FR.format.apply(void 0,e)},{input:[...e],level:n})})}};ii.__initStatic();uu.Console=ii});var Ir=g(oi=>{(function(t,e){let n=typeof oi=="object"?oi:typeof t=="object"?t:{};e(n),typeof define=="function"&&define.amd&&define("lru",n)})(oi,function(t){let e=Symbol("newer"),n=Symbol("older");function r(c,u){typeof c!="number"&&(u=c,c=0),this.size=0,this.limit=c,this.oldest=this.newest=void 0,this._keymap=new Map,u&&(this.assign(u),c<1&&(this.limit=this.size))}t.LRUMap=r;function s(c,u){this.key=c,this.value=u,this[e]=void 0,this[n]=void 0}r.prototype._markEntryAsUsed=function(c){c!==this.newest&&(c[e]&&(c===this.oldest&&(this.oldest=c[e]),c[e][n]=c[n]),c[n]&&(c[n][e]=c[e]),c[e]=void 0,c[n]=this.newest,this.newest&&(this.newest[e]=c),this.newest=c)},r.prototype.assign=function(c){let u,d=this.limit||Number.MAX_VALUE;this._keymap.clear();let l=c[Symbol.iterator]();for(let p=l.next();!p.done;p=l.next()){let f=new s(p.value[0],p.value[1]);if(this._keymap.set(f.key,f),u?(u[e]=f,f[n]=u):this.oldest=f,u=f,d--==0)throw new Error("overflow")}this.newest=u,this.size=this._keymap.size},r.prototype.get=function(c){var u=this._keymap.get(c);if(u)return this._markEntryAsUsed(u),u.value},r.prototype.set=function(c,u){var d=this._keymap.get(c);return d?(d.value=u,this._markEntryAsUsed(d),this):(this._keymap.set(c,d=new s(c,u)),this.newest?(this.newest[e]=d,d[n]=this.newest):this.oldest=d,this.newest=d,++this.size,this.size>this.limit&&this.shift(),this)},r.prototype.shift=function(){var c=this.oldest;if(c)return this.oldest[e]?(this.oldest=this.oldest[e],this.oldest[n]=void 0):(this.oldest=void 0,this.newest=void 0),c[e]=c[n]=void 0,this._keymap.delete(c.key),--this.size,[c.key,c.value]},r.prototype.find=function(c){let u=this._keymap.get(c);return u?u.value:void 0},r.prototype.has=function(c){return this._keymap.has(c)},r.prototype.delete=function(c){var u=this._keymap.get(c);if(u)return this._keymap.delete(u.key),u[e]&&u[n]?(u[n][e]=u[e],u[e][n]=u[n]):u[e]?(u[e][n]=void 0,this.oldest=u[e]):u[n]?(u[n][e]=void 0,this.newest=u[n]):this.oldest=this.newest=void 0,this.size--,u.value},r.prototype.clear=function(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()};function i(c){this.entry=c}i.prototype[Symbol.iterator]=function(){return this},i.prototype.next=function(){let c=this.entry;return c?(this.entry=c[e],{done:!1,value:[c.key,c.value]}):{done:!0,value:void 0}};function o(c){this.entry=c}o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){let c=this.entry;return c?(this.entry=c[e],{done:!1,value:c.key}):{done:!0,value:void 0}};function a(c){this.entry=c}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let c=this.entry;return c?(this.entry=c[e],{done:!1,value:c.value}):{done:!0,value:void 0}},r.prototype.keys=function(){return new o(this.oldest)},r.prototype.values=function(){return new a(this.oldest)},r.prototype.entries=function(){return this},r.prototype[Symbol.iterator]=function(){return new i(this.oldest)},r.prototype.forEach=function(c,u){typeof u!="object"&&(u=this);let d=this.oldest;for(;d;)c.call(u,d.value,d.key,this),d=d[e]},r.prototype.toJSON=function(){for(var c=new Array(this.size),u=0,d=this.oldest;d;)c[u++]={key:d.key,value:d.value},d=d[e];return c},r.prototype.toString=function(){for(var c="",u=this.oldest;u;)c+=String(u.key)+":"+u.value,u=u[e],u&&(c+=" < ");return c}})});var Dg=g(Dt=>{var{_optionalChain:Ne}=k();Object.defineProperty(Dt,"__esModule",{value:!0});var lu=require("url"),Rg=fn();function GR(t){let{protocol:e,hostname:n,port:r}=Og(t),s=t.path?t.path:"/";return`${e}//${n}${r}${s}`}function Cg(t){let{protocol:e,hostname:n,port:r}=Og(t),s=t.pathname||"/",i=t.auth?BR(t.auth):"";return`${e}//${i}${n}${r}${s}`}function BR(t){let[e,n]=t.split(":");return`${e?"[Filtered]":""}:${n?"[Filtered]":""}@`}function $R(t,e,n){if(!t)return t;let[r,s]=t.split(" ");return e.host&&!e.protocol&&(e.protocol=Ne([n,"optionalAccess",i=>i.agent,"optionalAccess",i=>i.protocol]),s=Cg(e)),Ne([s,"optionalAccess",i=>i.startsWith,"call",i=>i("///")])&&(s=s.slice(2)),`${r} ${s}`}function pu(t){let e={protocol:t.protocol,hostname:typeof t.hostname=="string"&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,hash:t.hash,search:t.search,pathname:t.pathname,path:`${t.pathname||""}${t.search||""}`,href:t.href};return t.port!==""&&(e.port=Number(t.port)),(t.username||t.password)&&(e.auth=`${t.username}:${t.password}`),e}function jR(t,e){let n,r;if(typeof e[e.length-1]=="function"&&(n=e.pop()),typeof e[0]=="string")r=pu(new lu.URL(e[0]));else if(e[0]instanceof lu.URL)r=pu(e[0]);else{r=e[0];try{let s=new lu.URL(r.path||"",`${r.protocol||"http:"}//${r.hostname}`);r={pathname:s.pathname,search:s.search,hash:s.hash,...r}}catch{}}return e.length===2&&(r={...r,...e[1]}),r.protocol===void 0&&(Rg.NODE_VERSION.major&&Rg.NODE_VERSION.major>8?r.protocol=Ne([Ne([t,"optionalAccess",s=>s.globalAgent]),"optionalAccess",s=>s.protocol])||Ne([r.agent,"optionalAccess",s=>s.protocol])||Ne([r._defaultAgent,"optionalAccess",s=>s.protocol]):r.protocol=Ne([r.agent,"optionalAccess",s=>s.protocol])||Ne([r._defaultAgent,"optionalAccess",s=>s.protocol])||Ne([Ne([t,"optionalAccess",s=>s.globalAgent]),"optionalAccess",s=>s.protocol])),n?[r,n]:[r]}function Og(t){let e=t.protocol||"",n=t.hostname||t.host||"",r=!t.port||t.port===80||t.port===443||/^(.*):(\d+)$/.test(n)?"":`:${t.port}`;return{protocol:e,hostname:n,port:r}}Dt.cleanSpanDescription=$R;Dt.extractRawUrl=GR;Dt.extractUrl=Cg;Dt.normalizeRequestArgs=jR;Dt.urlToOptions=pu});var gu=g(fu=>{var{_optionalChain:Nt}=k();Object.defineProperty(fu,"__esModule",{value:!0});var gn=N(),we=T(),Ng=Ir(),wg=fn(),Ar=Dg(),vr=class t{static __initStatic(){this.id="Http"}__init(){this.name=t.id}constructor(e={}){t.prototype.__init.call(this),this._breadcrumbs=typeof e.breadcrumbs>"u"?!0:e.breadcrumbs,this._tracing=e.tracing?e.tracing===!0?{}:e.tracing:void 0}setupOnce(e,n){if(!this._breadcrumbs&&!this._tracing)return;let r=Nt([n,"call",c=>c(),"access",c=>c.getClient,"call",c=>c(),"optionalAccess",c=>c.getOptions,"call",c=>c()]);if(r&&r.instrumenter!=="sentry"){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&we.logger.log("HTTP Integration is skipped because of instrumenter configuration.");return}let s=Nt([this,"access",c=>c._tracing,"optionalAccess",c=>c.shouldCreateSpanForRequest])||Nt([r,"optionalAccess",c=>c.shouldCreateSpanForRequest]),i=Nt([r,"optionalAccess",c=>c.tracePropagationTargets])||Nt([this,"access",c=>c._tracing,"optionalAccess",c=>c.tracePropagationTargets]),o=require("http"),a=kg(o,this._breadcrumbs,s,i);if(we.fill(o,"get",a),we.fill(o,"request",a),wg.NODE_VERSION.major&&wg.NODE_VERSION.major>8){let c=require("https"),u=kg(c,this._breadcrumbs,s,i);we.fill(c,"get",u),we.fill(c,"request",u)}}};vr.__initStatic();function kg(t,e,n,r){let s=new Ng.LRUMap(100),i=new Ng.LRUMap(100),o=u=>{if(n===void 0)return!0;let d=s.get(u);if(d!==void 0)return d;let l=n(u);return s.set(u,l),l},a=u=>{if(r===void 0)return!0;let d=i.get(u);if(d!==void 0)return d;let l=we.stringMatchesSomePattern(u,r);return i.set(u,l),l};function c(u,d,l,p){gn.getCurrentHub().getIntegration(vr)&&gn.getCurrentHub().addBreadcrumb({category:"http",data:{status_code:p&&p.statusCode,...d},type:"http"},{event:u,request:l,response:p})}return function(d){return function(...p){let f=Ar.normalizeRequestArgs(t,p),m=f[0],E=Ar.extractRawUrl(m),b=Ar.extractUrl(m);if(gn.isSentryRequestUrl(b,gn.getCurrentHub()))return d.apply(t,f);let v=gn.getCurrentHub(),L=v.getScope(),se=L.getSpan(),ie=HR(b,m),J=o(E)?Nt([se,"optionalAccess",x=>x.startChild,"call",x=>x({op:"http.client",origin:"auto.http.node.http",description:`${ie["http.method"]} ${ie.url}`,data:ie})]):void 0;if(a(E))if(J){let x=J.toTraceparent(),Me=Nt([J,"optionalAccess",Se=>Se.transaction,"optionalAccess",Se=>Se.getDynamicSamplingContext,"call",Se=>Se()]);xg(m,b,x,Me)}else{let x=v.getClient(),{traceId:Me,sampled:Se,dsc:ji}=L.getPropagationContext(),wh=we.generateSentryTraceHeader(Me,void 0,Se),kh=ji||(x?gn.getDynamicSamplingContextFromClient(Me,x,L):void 0);xg(m,b,wh,kh)}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&we.logger.log(`[Tracing] Not adding sentry-trace header to outgoing request (${b}) due to mismatching tracePropagationTargets option.`);return d.apply(t,f).once("response",function(x){let Me=this;e&&c("response",ie,Me,x),J&&(x.statusCode&&J.setHttpStatus(x.statusCode),J.description=Ar.cleanSpanDescription(J.description,m,Me),J.finish())}).once("error",function(){let x=this;e&&c("error",ie,x),J&&(J.setHttpStatus(500),J.description=Ar.cleanSpanDescription(J.description,m,x),J.finish())})}}}function xg(t,e,n,r){if((t.headers||{})["sentry-trace"])return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&we.logger.log(`[Tracing] Adding sentry-trace header ${n} to outgoing request to "${e}": `);let i=we.dynamicSamplingContextToSentryBaggageHeader(r),o=i&&i.length>0?YR(t,i):void 0;t.headers={...t.headers,"sentry-trace":n,...o&&{baggage:o}}}function HR(t,e){let n=e.method||"GET",r={url:t,"http.method":n};return e.hash&&(r["http.fragment"]=e.hash.substring(1)),e.search&&(r["http.query"]=e.search.substring(1)),r}function YR(t,e){if(!t.headers||!t.headers.baggage)return e;if(e){if(Array.isArray(t.headers.baggage))return[...t.headers.baggage,e]}else return t.headers.baggage;return[t.headers.baggage,e]}fu.Http=vr});var mu=g(hu=>{Object.defineProperty(hu,"__esModule",{value:!0});var KR=N(),_u=T(),WR=2e3;function VR(t){console.error(t);let e=KR.getCurrentHub().getClient();e===void 0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_u.logger.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1));let n=e.getOptions(),r=n&&n.shutdownTimeout&&n.shutdownTimeout>0&&n.shutdownTimeout||WR;e.close(r).then(s=>{s||(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_u.logger.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},s=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&_u.logger.error(s)})}hu.logAndExitProcess=VR});var yu=g(Eu=>{Object.defineProperty(Eu,"__esModule",{value:!0});var Pg=N(),zR=T(),Mg=mu(),ai=class t{static __initStatic(){this.id="OnUncaughtException"}__init(){this.name=t.id}__init2(){this.handler=this._makeErrorHandler()}constructor(e={}){t.prototype.__init.call(this),t.prototype.__init2.call(this),this._options={exitEvenIfOtherHandlersAreRegistered:!0,...e}}setupOnce(){global.process.on("uncaughtException",this.handler)}_makeErrorHandler(){let n=!1,r=!1,s=!1,i;return o=>{let a=Mg.logAndExitProcess,c=Pg.getCurrentHub().getClient();this._options.onFatalError?a=this._options.onFatalError:c&&c.getOptions().onFatalError&&(a=c.getOptions().onFatalError);let d=global.process.listeners("uncaughtException").reduce((p,f)=>f.name==="domainUncaughtExceptionClear"||f.tag&&f.tag==="sentry_tracingErrorCallback"||f===this.handler?p:p+1,0)===0,l=this._options.exitEvenIfOtherHandlersAreRegistered||d;if(n)l&&(s?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&zR.logger.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),Mg.logAndExitProcess(o)):r||(r=!0,setTimeout(()=>{s||(s=!0,a(i,o))},2e3)));else{let p=Pg.getCurrentHub();i=o,n=!0,p.getIntegration(t)?p.withScope(f=>{f.setLevel("fatal"),p.captureException(o,{originalException:o,data:{mechanism:{handled:!1,type:"onuncaughtexception"}}}),!s&&l&&(s=!0,a(o))}):!s&&l&&(s=!0,a(o))}}}};ai.__initStatic();Eu.OnUncaughtException=ai});var Tu=g(Su=>{Object.defineProperty(Su,"__esModule",{value:!0});var XR=N(),Ug=T(),JR=mu(),ci=class t{static __initStatic(){this.id="OnUnhandledRejection"}__init(){this.name=t.id}constructor(e={mode:"warn"}){this._options=e,t.prototype.__init.call(this)}setupOnce(){global.process.on("unhandledRejection",this.sendUnhandledPromise.bind(this))}sendUnhandledPromise(e,n){let r=XR.getCurrentHub();r.getIntegration(t)&&r.withScope(s=>{s.setExtra("unhandledPromiseRejection",!0),r.captureException(e,{originalException:n,data:{mechanism:{handled:!1,type:"onunhandledrejection"}}})}),this._handleRejection(e)}_handleRejection(e){let n="This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:";this._options.mode==="warn"?Ug.consoleSandbox(()=>{console.warn(n),console.error(e&&e.stack?e.stack:e)}):this._options.mode==="strict"&&(Ug.consoleSandbox(()=>{console.warn(n)}),JR.logAndExitProcess(e))}};ci.__initStatic();Su.OnUnhandledRejection=ci});var Iu=g(bu=>{Object.defineProperty(bu,"__esModule",{value:!0});var Lg=T(),QR="cause",ZR=5,ui=class t{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=t.id}constructor(e={}){t.prototype.__init.call(this),this._key=e.key||QR,this._limit=e.limit||ZR}setupOnce(){}preprocessEvent(e,n,r){let s=r.getOptions();Lg.applyAggregateErrorsToEvent(Lg.exceptionFromError,s.stackParser,s.maxValueLength,this._key,this._limit,e,n)}};ui.__initStatic();bu.LinkedErrors=ui});var Ru=g(vu=>{Object.defineProperty(vu,"__esModule",{value:!0});var qg=require("fs"),Fg=require("path"),Au;function eC(){try{return require.cache?Object.keys(require.cache):[]}catch{return[]}}function tC(){let t=require.main&&require.main.paths||[],e=eC(),n={},r={};return e.forEach(s=>{let i=s,o=()=>{let a=i;if(i=Fg.dirname(a),!i||a===i||r[a])return;if(t.indexOf(i)<0)return o();let c=Fg.join(a,"package.json");if(r[a]=!0,!qg.existsSync(c))return o();try{let u=JSON.parse(qg.readFileSync(c,"utf8"));n[u.name]=u.version}catch{}};o()}),n}var di=class t{constructor(){t.prototype.__init.call(this)}static __initStatic(){this.id="Modules"}__init(){this.name=t.id}setupOnce(e,n){e(r=>n().getIntegration(t)?{...r,modules:{...r.modules,...this._getModules()}}:r)}_getModules(){return Au||(Au=tC()),Au}};di.__initStatic();vu.Modules=di});var Du=g(Ou=>{var{_optionalChain:Cu}=k();Object.defineProperty(Ou,"__esModule",{value:!0});var nC=T(),rC=require("fs"),sC=Ir(),li=new sC.LRUMap(100),iC=7;function oC(t){return new Promise((e,n)=>{rC.readFile(t,"utf8",(r,s)=>{r?n(r):e(s)})})}var pi=class t{static __initStatic(){this.id="ContextLines"}__init(){this.name=t.id}constructor(e={}){this._options=e,t.prototype.__init.call(this)}get _contextLines(){return this._options.frameContextLines!==void 0?this._options.frameContextLines:iC}setupOnce(e,n){e(r=>n().getIntegration(t)?this.addSourceContext(r):r)}async addSourceContext(e){let n={},r=[];if(this._contextLines>0&&Cu([e,"access",s=>s.exception,"optionalAccess",s=>s.values])){for(let s of e.exception.values)if(Cu([s,"access",i=>i.stacktrace,"optionalAccess",i=>i.frames]))for(let i=s.stacktrace.frames.length-1;i>=0;i--){let o=s.stacktrace.frames[i];o.filename&&!n[o.filename]&&!li.get(o.filename)&&(r.push(aC(o.filename)),n[o.filename]=1)}}if(r.length>0&&await Promise.all(r),this._contextLines>0&&Cu([e,"access",s=>s.exception,"optionalAccess",s=>s.values]))for(let s of e.exception.values)s.stacktrace&&s.stacktrace.frames&&await this.addSourceContextToFrames(s.stacktrace.frames);return e}addSourceContextToFrames(e){for(let n of e)if(n.filename&&n.context_line===void 0){let r=li.get(n.filename);if(r)try{nC.addContextToFrame(r,n,this._contextLines)}catch{}}}};pi.__initStatic();async function aC(t){let e=li.get(t);if(e===null)return null;if(e!==void 0)return e;let n=null;try{n=(await oC(t)).split(`
33
- `)}catch{}return li.set(t,n),n}Ou.ContextLines=pi});var Nu=g(_n=>{var{_optionalChain:wt}=k();Object.defineProperty(_n,"__esModule",{value:!0});var cC=require("child_process"),Bg=require("fs"),fe=require("os"),uC=require("path"),$g=require("util"),jg=$g.promisify(Bg.readFile),Hg=$g.promisify(Bg.readdir),fi=class t{static __initStatic(){this.id="Context"}__init(){this.name=t.id}constructor(e={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0}){this._options=e,t.prototype.__init.call(this)}setupOnce(e){e(n=>this.addContext(n))}async addContext(e){this._cachedContext===void 0&&(this._cachedContext=this._getContexts());let n=this._updateContext(await this._cachedContext);return e.contexts={...e.contexts,app:{...n.app,...wt([e,"access",r=>r.contexts,"optionalAccess",r=>r.app])},os:{...n.os,...wt([e,"access",r=>r.contexts,"optionalAccess",r=>r.os])},device:{...n.device,...wt([e,"access",r=>r.contexts,"optionalAccess",r=>r.device])},culture:{...n.culture,...wt([e,"access",r=>r.contexts,"optionalAccess",r=>r.culture])},cloud_resource:{...n.cloud_resource,...wt([e,"access",r=>r.contexts,"optionalAccess",r=>r.cloud_resource])}},e}_updateContext(e){return wt([e,"optionalAccess",n=>n.app,"optionalAccess",n=>n.app_memory])&&(e.app.app_memory=process.memoryUsage().rss),wt([e,"optionalAccess",n=>n.device,"optionalAccess",n=>n.free_memory])&&(e.device.free_memory=fe.freemem()),e}async _getContexts(){let e={};if(this._options.os&&(e.os=await dC()),this._options.app&&(e.app=pC()),this._options.device&&(e.device=Yg(this._options.device)),this._options.culture){let n=lC();n&&(e.culture=n)}return this._options.cloudResource&&(e.cloud_resource=EC()),e}};fi.__initStatic();async function dC(){let t=fe.platform();switch(t){case"darwin":return hC();case"linux":return mC();default:return{name:fC[t]||t,version:fe.release()}}}function lC(){try{if(typeof process.versions.icu!="string")return;let t=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(t)==="enero"){let n=Intl.DateTimeFormat().resolvedOptions();return{locale:n.locale,timezone:n.timeZone}}}catch{}}function pC(){let t=process.memoryUsage().rss;return{app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:t}}function Yg(t){let e={},n;try{n=fe.uptime&&fe.uptime()}catch{}if(typeof n=="number"&&(e.boot_time=new Date(Date.now()-n*1e3).toISOString()),e.arch=fe.arch(),(t===!0||t.memory)&&(e.memory_size=fe.totalmem(),e.free_memory=fe.freemem()),t===!0||t.cpu){let r=fe.cpus();if(r&&r.length){let s=r[0];e.processor_count=r.length,e.cpu_description=s.model,e.processor_frequency=s.speed}}return e}var fC={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows"},gC=[{name:"fedora-release",distros:["Fedora"]},{name:"redhat-release",distros:["Red Hat Linux","Centos"]},{name:"redhat_version",distros:["Red Hat Linux"]},{name:"SuSE-release",distros:["SUSE Linux"]},{name:"lsb-release",distros:["Ubuntu Linux","Arch Linux"]},{name:"debian_version",distros:["Debian"]},{name:"debian_release",distros:["Debian"]},{name:"arch-release",distros:["Arch Linux"]},{name:"gentoo-release",distros:["Gentoo Linux"]},{name:"novell-release",distros:["SUSE Linux"]},{name:"alpine-release",distros:["Alpine Linux"]}],_C={alpine:t=>t,arch:t=>ke(/distrib_release=(.*)/,t),centos:t=>ke(/release ([^ ]+)/,t),debian:t=>t,fedora:t=>ke(/release (..)/,t),mint:t=>ke(/distrib_release=(.*)/,t),red:t=>ke(/release ([^ ]+)/,t),suse:t=>ke(/VERSION = (.*)\n/,t),ubuntu:t=>ke(/distrib_release=(.*)/,t)};function ke(t,e){let n=t.exec(e);return n?n[1]:void 0}async function hC(){let t={kernel_version:fe.release(),name:"Mac OS X",version:`10.${Number(fe.release().split(".")[0])-4}`};try{let e=await new Promise((n,r)=>{cC.execFile("/usr/bin/sw_vers",(s,i)=>{if(s){r(s);return}n(i)})});t.name=ke(/^ProductName:\s+(.*)$/m,e),t.version=ke(/^ProductVersion:\s+(.*)$/m,e),t.build=ke(/^BuildVersion:\s+(.*)$/m,e)}catch{}return t}function Gg(t){return t.split(" ")[0].toLowerCase()}async function mC(){let t={kernel_version:fe.release(),name:"Linux"};try{let e=await Hg("/etc"),n=gC.find(a=>e.includes(a.name));if(!n)return t;let r=uC.join("/etc",n.name),s=(await jg(r,{encoding:"utf-8"})).toLowerCase(),{distros:i}=n;t.name=i.find(a=>s.indexOf(Gg(a))>=0)||i[0];let o=Gg(t.name);t.version=_C[o](s)}catch{}return t}function EC(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}_n.Context=fi;_n.getDeviceContext=Yg;_n.readDirAsync=Hg;_n.readFileAsync=jg});var Kg=g(wu=>{"use strict";wu.parse=SC;wu.serialize=TC;var yC=Object.prototype.toString,gi=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function SC(t,e){if(typeof t!="string")throw new TypeError("argument str must be a string");for(var n={},r=e||{},s=r.decode||bC,i=0;i<t.length;){var o=t.indexOf("=",i);if(o===-1)break;var a=t.indexOf(";",i);if(a===-1)a=t.length;else if(a<o){i=t.lastIndexOf(";",o-1)+1;continue}var c=t.slice(i,o).trim();if(n[c]===void 0){var u=t.slice(o+1,a).trim();u.charCodeAt(0)===34&&(u=u.slice(1,-1)),n[c]=vC(u,s)}i=a+1}return n}function TC(t,e,n){var r=n||{},s=r.encode||IC;if(typeof s!="function")throw new TypeError("option encode is invalid");if(!gi.test(t))throw new TypeError("argument name is invalid");var i=s(e);if(i&&!gi.test(i))throw new TypeError("argument val is invalid");var o=t+"="+i;if(r.maxAge!=null){var a=r.maxAge-0;if(isNaN(a)||!isFinite(a))throw new TypeError("option maxAge is invalid");o+="; Max-Age="+Math.floor(a)}if(r.domain){if(!gi.test(r.domain))throw new TypeError("option domain is invalid");o+="; Domain="+r.domain}if(r.path){if(!gi.test(r.path))throw new TypeError("option path is invalid");o+="; Path="+r.path}if(r.expires){var c=r.expires;if(!AC(c)||isNaN(c.valueOf()))throw new TypeError("option expires is invalid");o+="; Expires="+c.toUTCString()}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.priority){var u=typeof r.priority=="string"?r.priority.toLowerCase():r.priority;switch(u){case"low":o+="; Priority=Low";break;case"medium":o+="; Priority=Medium";break;case"high":o+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){var d=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(d){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o}function bC(t){return t.indexOf("%")!==-1?decodeURIComponent(t):t}function IC(t){return encodeURIComponent(t)}function AC(t){return yC.call(t)==="[object Date]"||t instanceof Date}function vC(t,e){try{return e(t)}catch{return t}}});var Rr=g(hn=>{var{_optionalChain:RC}=k();Object.defineProperty(hn,"__esModule",{value:!0});var _i=T(),CC=Kg(),OC=require("url"),DC={ip:!1,request:!0,transaction:!0,user:!0},NC=["cookies","data","headers","method","query_string","url"],Wg=["id","username","email"];function ku(t,e={}){let n=t.method&&t.method.toUpperCase(),r="",s="url";e.customRoute||t.route?(r=e.customRoute||`${t.baseUrl||""}${t.route&&t.route.path}`,s="route"):(t.originalUrl||t.url)&&(r=_i.stripUrlQueryAndFragment(t.originalUrl||t.url||""));let i="";return e.method&&n&&(i+=n),e.method&&e.path&&(i+=" "),e.path&&r&&(i+=r),[i,s]}function wC(t,e){switch(e){case"path":return ku(t,{path:!0})[0];case"handler":return t.route&&t.route.stack&&t.route.stack[0]&&t.route.stack[0].name||"<anonymous>";default:{let n=t._reconstructedRoute?t._reconstructedRoute:void 0;return ku(t,{path:!0,method:!0,customRoute:n})[0]}}}function kC(t,e){let n={};return(Array.isArray(e)?e:Wg).forEach(s=>{t&&s in t&&(n[s]=t[s])}),n}function xu(t,e){let{include:n=NC}=e||{},r={},s=t.headers||{},i=t.method,o=t.hostname||t.host||s.host||"<no host>",a=t.protocol==="https"||t.socket&&t.socket.encrypted?"https":"http",c=t.originalUrl||t.url||"",u=c.startsWith(a)?c:`${a}://${o}${c}`;return n.forEach(d=>{switch(d){case"headers":{r.headers=s,n.includes("cookies")||delete r.headers.cookie;break}case"method":{r.method=i;break}case"url":{r.url=u;break}case"cookies":{r.cookies=t.cookies||s.cookie&&CC.parse(s.cookie)||{};break}case"query_string":{r.query_string=PC(t);break}case"data":{if(i==="GET"||i==="HEAD")break;t.body!==void 0&&(r.data=_i.isString(t.body)?t.body:JSON.stringify(_i.normalize(t.body)));break}default:({}).hasOwnProperty.call(t,d)&&(r[d]=t[d])}}),r}function xC(t,e,n){let r={...DC,...RC([n,"optionalAccess",s=>s.include])};if(r.request){let s=Array.isArray(r.request)?xu(e,{include:r.request}):xu(e);t.request={...t.request,...s}}if(r.user){let s=e.user&&_i.isPlainObject(e.user)?kC(e.user,r.user):{};Object.keys(s).length&&(t.user={...t.user,...s})}if(r.ip){let s=e.ip||e.socket&&e.socket.remoteAddress;s&&(t.user={...t.user,ip_address:s})}return r.transaction&&!t.transaction&&(t.transaction=wC(e,r.transaction)),t}function PC(t){let e=t.originalUrl||t.url||"";if(e)return e.startsWith("/")&&(e=`http://dogs.are.great${e}`),t.query||new OC.URL(e).search.replace("?","")||void 0}hn.DEFAULT_USER_INCLUDES=Wg;hn.addRequestDataToEvent=xC;hn.extractPathForTransaction=ku;hn.extractRequestData=xu});var Uu=g(Mu=>{Object.defineProperty(Mu,"__esModule",{value:!0});var MC=T(),UC=Rr(),Pu={include:{cookies:!0,data:!0,headers:!0,ip:!1,query_string:!0,url:!0,user:{id:!0,username:!0,email:!0}},transactionNamingScheme:"methodPath"},hi=class t{static __initStatic(){this.id="RequestData"}__init(){this.name=t.id}constructor(e={}){t.prototype.__init.call(this),this._addRequestData=UC.addRequestDataToEvent,this._options={...Pu,...e,include:{method:!0,...Pu.include,...e.include,user:e.include&&typeof e.include.user=="boolean"?e.include.user:{...Pu.include.user,...(e.include||{}).user}}}}setupOnce(e,n){let{transactionNamingScheme:r}=this._options;e(s=>{let i=n(),o=i.getIntegration(t),{sdkProcessingMetadata:a={}}=s,c=a.request;if(!o||!c)return s;let u=a.requestDataOptionsFromExpressHandler||a.requestDataOptionsFromGCPWrapper||LC(this._options),d=this._addRequestData(s,c,u);if(s.type==="transaction"||r==="handler")return d;let p=c._sentryTransaction;if(p){let f=qC(i)==="sentry.javascript.nextjs"?p.name.startsWith("/api"):r!=="path",[m]=MC.extractPathForTransaction(c,{path:!0,method:f,customRoute:p.name});d.transaction=m}return d})}};hi.__initStatic();function LC(t){let{transactionNamingScheme:e,include:{ip:n,user:r,...s}}=t,i=[];for(let[a,c]of Object.entries(s))c&&i.push(a);let o;if(r===void 0)o=!0;else if(typeof r=="boolean")o=r;else{let a=[];for(let[c,u]of Object.entries(r))u&&a.push(c);o=a}return{include:{ip:n,user:o,request:i.length!==0?i:void 0,transaction:e}}}function qC(t){try{return t.getClient().getOptions()._metadata.sdk.name}catch{return}}Mu.RequestData=hi});var Gu=g(Cr=>{var{_optionalChain:D}=k();Object.defineProperty(Cr,"__esModule",{value:!0});var Lu=T(),FC=Ir(),GC=fn();function zg(t,e,n){let r=0,s=5,i=0;return setInterval(()=>{i===0?r>t&&(s*=2,n(s),s>86400&&(s=86400),i=s):(i-=1,i===0&&e()),r=0},1e3).unref(),()=>{r+=1}}function Fu(t){let e=[],n=!1;function r(o){e=[],!n&&(n=!0,t(o))}e.push(r);function s(o){e.push(o)}function i(o){let a=e.pop()||r;try{a(o)}catch{r(o)}}return{add:s,next:i}}var qu=class{constructor(){let{Session:e}=require("inspector");this._session=new e}configureAndConnect(e,n){this._session.connect(),this._session.on("Debugger.paused",r=>{e(r,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:n?"all":"uncaught"})}setPauseOnExceptions(e){this._session.post("Debugger.setPauseOnExceptions",{state:e?"all":"uncaught"})}getLocalVariables(e,n){this._getProperties(e,r=>{let{add:s,next:i}=Fu(n);for(let o of r)if(D([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.objectId])&&D([o,"optionalAccess",a=>a.value,"access",a=>a.className])==="Array"){let a=o.value.objectId;s(c=>this._unrollArray(a,o.name,c,i))}else if(D([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.objectId])&&D([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.className])==="Object"){let a=o.value.objectId;s(c=>this._unrollObject(a,o.name,c,i))}else(D([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])||D([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.description]))&&s(a=>this._unrollOther(o,a,i));i({})})}_getProperties(e,n){this._session.post("Runtime.getProperties",{objectId:e,ownProperties:!0},(r,s)=>{n(r?[]:s.result)})}_unrollArray(e,n,r,s){this._getProperties(e,i=>{r[n]=i.filter(o=>o.name!=="length"&&!isNaN(parseInt(o.name,10))).sort((o,a)=>parseInt(o.name,10)-parseInt(a.name,10)).map(o=>D([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])),s(r)})}_unrollObject(e,n,r,s){this._getProperties(e,i=>{r[n]=i.map(o=>[o.name,D([o,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])]).reduce((o,[a,c])=>(o[a]=c,o),{}),s(r)})}_unrollOther(e,n,r){D([e,"optionalAccess",s=>s.value,"optionalAccess",s=>s.value])?n[e.name]=e.value.value:D([e,"optionalAccess",s=>s.value,"optionalAccess",s=>s.description])&&D([e,"optionalAccess",s=>s.value,"optionalAccess",s=>s.type])!=="function"&&(n[e.name]=`<${e.value.description}>`),r(n)}};function BC(){try{return new qu}catch{return}}function Vg(t){return t!==void 0&&["","?","<anonymous>"].includes(t)}function $C(t,e){return t===e||Vg(t)&&Vg(e)}function Xg(t){if(t!==void 0)return t.slice(-10).reduce((e,n)=>`${e},${n.function},${n.lineno},${n.colno}`,"")}function jC(t,e){if(e!==void 0)return Xg(t(e,1))}var mi=class t{static __initStatic(){this.id="LocalVariables"}__init(){this.name=t.id}__init2(){this._cachedFrames=new FC.LRUMap(20)}constructor(e={},n=BC()){this._options=e,this._session=n,t.prototype.__init.call(this),t.prototype.__init2.call(this)}setupOnce(e,n){this._setup(e,D([n,"call",r=>r(),"access",r=>r.getClient,"call",r=>r(),"optionalAccess",r=>r.getOptions,"call",r=>r()]))}_setup(e,n){if(this._session&&D([n,"optionalAccess",r=>r.includeLocalVariables])){if((GC.NODE_VERSION.major||0)<18){Lu.logger.log("The `LocalVariables` integration is only supported on Node >= v18.");return}let s=this._options.captureAllExceptions!==!1;if(this._session.configureAndConnect((i,o)=>this._handlePaused(n.stackParser,i,o),s),s){let i=this._options.maxExceptionsPerSecond||50;this._rateLimiter=zg(i,()=>{Lu.logger.log("Local variables rate-limit lifted."),D([this,"access",o=>o._session,"optionalAccess",o=>o.setPauseOnExceptions,"call",o=>o(!0)])},o=>{Lu.logger.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${o} seconds.`),D([this,"access",a=>a._session,"optionalAccess",a=>a.setPauseOnExceptions,"call",a=>a(!1)])})}e(async i=>this._addLocalVariables(i))}}_handlePaused(e,{params:{reason:n,data:r,callFrames:s}},i){if(n!=="exception"&&n!=="promiseRejection"){i();return}D([this,"access",u=>u._rateLimiter,"optionalCall",u=>u()]);let o=jC(e,D([r,"optionalAccess",u=>u.description]));if(o==null){i();return}let{add:a,next:c}=Fu(u=>{this._cachedFrames.set(o,u),i()});for(let u=0;u<Math.min(s.length,5);u++){let{scopeChain:d,functionName:l,this:p}=s[u],f=d.find(E=>E.type==="local"),m=p.className==="global"||!p.className?l:`${p.className}.${l}`;if(D([f,"optionalAccess",E=>E.object,"access",E=>E.objectId])===void 0)a(E=>{E[u]={function:m},c(E)});else{let E=f.object.objectId;a(b=>D([this,"access",v=>v._session,"optionalAccess",v=>v.getLocalVariables,"call",v=>v(E,L=>{b[u]={function:m,vars:L},c(b)})]))}}c([])}_addLocalVariables(e){for(let n of D([e,"optionalAccess",r=>r.exception,"optionalAccess",r=>r.values])||[])this._addLocalVariablesToException(n);return e}_addLocalVariablesToException(e){let n=Xg(D([e,"optionalAccess",i=>i.stacktrace,"optionalAccess",i=>i.frames]));if(n===void 0)return;let r=this._cachedFrames.delete(n);if(r===void 0)return;let s=D([e,"access",i=>i.stacktrace,"optionalAccess",i=>i.frames,"optionalAccess",i=>i.length])||0;for(let i=0;i<s;i++){let o=s-i-1;if(!D([e,"optionalAccess",a=>a.stacktrace,"optionalAccess",a=>a.frames,"optionalAccess",a=>a[o]])||!r[i])break;r[i].vars===void 0||e.stacktrace.frames[o].in_app===!1||!$C(e.stacktrace.frames[o].function,r[i].function)||(e.stacktrace.frames[o].vars=r[i].vars)}}};mi.__initStatic();Cr.LocalVariables=mi;Cr.createCallbackList=Fu;Cr.createRateLimiter=zg});var Bu=g((We,t_)=>{var{_optionalChain:e_}=k();Object.defineProperty(We,"__esModule",{value:!0});var kt=N(),xt=T(),Jg=Ir(),Qg=fn();We.ChannelName=void 0;(function(t){let e="undici:request:create";t.RequestCreate=e;let n="undici:request:headers";t.RequestEnd=n;let r="undici:request:error";t.RequestError=r})(We.ChannelName||(We.ChannelName={}));var Ei=class t{static __initStatic(){this.id="Undici"}__init(){this.name=t.id}__init2(){this._createSpanUrlMap=new Jg.LRUMap(100)}__init3(){this._headersUrlMap=new Jg.LRUMap(100)}constructor(e={}){t.prototype.__init.call(this),t.prototype.__init2.call(this),t.prototype.__init3.call(this),t.prototype.__init4.call(this),t.prototype.__init5.call(this),t.prototype.__init6.call(this),this._options={breadcrumbs:e.breadcrumbs===void 0?!0:e.breadcrumbs,shouldCreateSpanForRequest:e.shouldCreateSpanForRequest}}setupOnce(e){if(Qg.NODE_VERSION.major&&Qg.NODE_VERSION.major<16)return;let n;try{n=xt.dynamicRequire(t_,"diagnostics_channel")}catch{}!n||!n.subscribe||(n.subscribe(We.ChannelName.RequestCreate,this._onRequestCreate),n.subscribe(We.ChannelName.RequestEnd,this._onRequestEnd),n.subscribe(We.ChannelName.RequestError,this._onRequestError))}_shouldCreateSpan(e){if(this._options.shouldCreateSpanForRequest===void 0)return!0;let n=this._createSpanUrlMap.get(e);if(n!==void 0)return n;let r=this._options.shouldCreateSpanForRequest(e);return this._createSpanUrlMap.set(e,r),r}__init4(){this._onRequestCreate=e=>{let n=kt.getCurrentHub();if(!n.getIntegration(t))return;let{request:r}=e,s=r.origin?r.origin.toString()+r.path:r.path;if(kt.isSentryRequestUrl(s,n)||r.__sentry_span__!==void 0)return;let i=n.getClient();if(!i)return;let o=i.getOptions(),a=n.getScope(),c=a.getSpan(),u=this._shouldCreateSpan(s)?HC(c,r,s):void 0;if(u&&(r.__sentry_span__=u),(l=>{if(o.tracePropagationTargets===void 0)return!0;let p=this._headersUrlMap.get(l);if(p!==void 0)return p;let f=xt.stringMatchesSomePattern(l,o.tracePropagationTargets);return this._headersUrlMap.set(l,f),f})(s))if(u){let l=e_([u,"optionalAccess",f=>f.transaction,"optionalAccess",f=>f.getDynamicSamplingContext,"call",f=>f()]),p=xt.dynamicSamplingContextToSentryBaggageHeader(l);Zg(r,u.toTraceparent(),p)}else{let{traceId:l,sampled:p,dsc:f}=a.getPropagationContext(),m=xt.generateSentryTraceHeader(l,void 0,p),E=f||kt.getDynamicSamplingContextFromClient(l,i,a),b=xt.dynamicSamplingContextToSentryBaggageHeader(E);Zg(r,m,b)}}}__init5(){this._onRequestEnd=e=>{let n=kt.getCurrentHub();if(!n.getIntegration(t))return;let{request:r,response:s}=e,i=r.origin?r.origin.toString()+r.path:r.path;if(kt.isSentryRequestUrl(i,n))return;let o=r.__sentry_span__;o&&(o.setHttpStatus(s.statusCode),o.finish()),this._options.breadcrumbs&&n.addBreadcrumb({category:"http",data:{method:r.method,status_code:s.statusCode,url:i},type:"http"},{event:"response",request:r,response:s})}}__init6(){this._onRequestError=e=>{let n=kt.getCurrentHub();if(!n.getIntegration(t))return;let{request:r}=e,s=r.origin?r.origin.toString()+r.path:r.path;if(kt.isSentryRequestUrl(s,n))return;let i=r.__sentry_span__;i&&(i.setStatus("internal_error"),i.finish()),this._options.breadcrumbs&&n.addBreadcrumb({category:"http",data:{method:r.method,url:s},level:"error",type:"http"},{event:"error",request:r})}}};Ei.__initStatic();function Zg(t,e,n){t.__sentry_has_headers__||(t.addHeader("sentry-trace",e),n&&t.addHeader("baggage",n),t.__sentry_has_headers__=!0)}function HC(t,e,n){let r=xt.parseUrl(n),s=e.method||"GET",i={"http.method":s};return r.search&&(i["http.query"]=r.search),r.hash&&(i["http.fragment"]=r.hash),e_([t,"optionalAccess",o=>o.startChild,"call",o=>o({op:"http.client",origin:"auto.http.node.undici",description:`${s} ${xt.getSanitizedUrlString(r)}`,data:i})])}We.Undici=Ei});var $u=g(Ut=>{var{_optionalChain:YC}=k();Object.defineProperty(Ut,"__esModule",{value:!0});var Pt=N(),Mt=T(),KC=ru(),WC=Ag(),VC=Mc(),zC=du(),XC=gu(),JC=yu(),QC=Tu(),ZC=Iu(),eO=Ru(),tO=Du(),nO=Nu(),rO=Uu(),sO=Gu(),iO=Bu(),oO=ei(),aO=zc(),n_=[new Pt.Integrations.InboundFilters,new Pt.Integrations.FunctionToString,new zC.Console,new XC.Http,new iO.Undici,new JC.OnUncaughtException,new QC.OnUnhandledRejection,new tO.ContextLines,new sO.LocalVariables,new nO.Context,new eO.Modules,new rO.RequestData,new ZC.LinkedErrors];function cO(t={}){KC.isAnrChildProcess()&&(t.autoSessionTracking=!1,t.tracesSampleRate=0);let e=Pt.getMainCarrier();WC.setNodeAsyncContextStrategy();let n=YC([e,"access",i=>i.__SENTRY__,"optionalAccess",i=>i.integrations])||[];t.defaultIntegrations=t.defaultIntegrations===!1?[]:[...Array.isArray(t.defaultIntegrations)?t.defaultIntegrations:n_,...n],t.dsn===void 0&&process.env.SENTRY_DSN&&(t.dsn=process.env.SENTRY_DSN);let r=process.env.SENTRY_TRACES_SAMPLE_RATE;if(t.tracesSampleRate===void 0&&r){let i=parseFloat(r);isFinite(i)&&(t.tracesSampleRate=i)}if(t.release===void 0){let i=r_();i!==void 0?t.release=i:t.autoSessionTracking=!1}t.environment===void 0&&process.env.SENTRY_ENVIRONMENT&&(t.environment=process.env.SENTRY_ENVIRONMENT),t.autoSessionTracking===void 0&&t.dsn!==void 0&&(t.autoSessionTracking=!0),t.instrumenter===void 0&&(t.instrumenter="sentry");let s={...t,stackParser:Mt.stackParserFromStackParserOptions(t.stackParser||s_),integrations:Pt.getIntegrationsToSetup(t),transport:t.transport||aO.makeNodeTransport};Pt.initAndBind(t.clientClass||VC.NodeClient,s),t.autoSessionTracking&&dO(),lO()}function uO(t){if(t===void 0)return!1;let e=t&&t.getOptions();return e&&e.autoSessionTracking!==void 0?e.autoSessionTracking:!1}function r_(t){return process.env.SENTRY_RELEASE?process.env.SENTRY_RELEASE:Mt.GLOBAL_OBJ.SENTRY_RELEASE&&Mt.GLOBAL_OBJ.SENTRY_RELEASE.id?Mt.GLOBAL_OBJ.SENTRY_RELEASE.id:process.env.GITHUB_SHA||process.env.COMMIT_REF||process.env.VERCEL_GIT_COMMIT_SHA||process.env.VERCEL_GITHUB_COMMIT_SHA||process.env.VERCEL_GITLAB_COMMIT_SHA||process.env.VERCEL_BITBUCKET_COMMIT_SHA||process.env.ZEIT_GITHUB_COMMIT_SHA||process.env.ZEIT_GITLAB_COMMIT_SHA||process.env.ZEIT_BITBUCKET_COMMIT_SHA||t}var s_=Mt.createStackParser(Mt.nodeStackLineParser(oO.getModuleFromFilename));function dO(){let t=Pt.getCurrentHub();t.startSession(),process.on("beforeExit",()=>{let e=t.getScope().getSession();e&&!["exited","crashed"].includes(e.status)&&t.endSession()})}function lO(){let t=(process.env.SENTRY_USE_ENVIRONMENT||"").toLowerCase();if(!["false","n","no","off","0"].includes(t)){let e=process.env.SENTRY_TRACE,n=process.env.SENTRY_BAGGAGE,{propagationContext:r}=Mt.tracingContextFromHeaders(e,n);Pt.getCurrentHub().getScope().setPropagationContext(r)}}Ut.defaultIntegrations=n_;Ut.defaultStackParser=s_;Ut.getSentryRelease=r_;Ut.init=cO;Ut.isAutoSessionTrackingEnabled=uO});var i_=g(Hu=>{Object.defineProperty(Hu,"__esModule",{value:!0});var yi=require("fs"),ju=require("path");function pO(t){let e=ju.resolve(t);if(!yi.existsSync(e))throw new Error(`Cannot read contents of ${e}. Directory does not exist.`);if(!yi.statSync(e).isDirectory())throw new Error(`Cannot read contents of ${e}, because it is not a directory.`);let n=r=>yi.readdirSync(r).reduce((s,i)=>{let o=ju.join(r,i);return yi.statSync(o).isDirectory()?s.concat(n(o)):(s.push(o),s)},[]);return n(e).map(r=>ju.relative(e,r))}Hu.deepReadDirSync=pO});var a_=g(Si=>{Object.defineProperty(Si,"__esModule",{value:!0});var o_=Rr();function fO(t,e){return o_.extractRequestData(t,{include:e})}function gO(t,e,n={}){return o_.addRequestDataToEvent(t,e,{include:n})}Si.extractRequestData=fO;Si.parseRequest=gO});var u_=g(dt=>{var{_optionalChain:mn}=k();Object.defineProperty(dt,"__esModule",{value:!0});var Ee=N(),ut=T(),_O=Rr(),Ti=$u(),c_=a_();function hO(){return function(e,n,r){let s=Ee.getCurrentHub(),i=mn([s,"access",m=>m.getClient,"call",m=>m(),"optionalAccess",m=>m.getOptions,"call",m=>m()]);if(!i||i.instrumenter!=="sentry"||mn([e,"access",m=>m.method,"optionalAccess",m=>m.toUpperCase,"call",m=>m()])==="OPTIONS"||mn([e,"access",m=>m.method,"optionalAccess",m=>m.toUpperCase,"call",m=>m()])==="HEAD")return r();let o=e.headers&&ut.isString(e.headers["sentry-trace"])?e.headers["sentry-trace"]:void 0,a=mn([e,"access",m=>m.headers,"optionalAccess",m=>m.baggage]),{traceparentData:c,dynamicSamplingContext:u,propagationContext:d}=ut.tracingContextFromHeaders(o,a);if(s.getScope().setPropagationContext(d),!Ee.hasTracingEnabled(i))return r();let[l,p]=ut.extractPathForTransaction(e,{path:!0,method:!0}),f=Ee.startTransaction({name:l,op:"http.server",origin:"auto.http.node.tracingHandler",...c,metadata:{dynamicSamplingContext:c&&!u?{}:u,request:e,source:p}},{request:_O.extractRequestData(e)});s.configureScope(m=>{m.setSpan(f)}),n.__sentry_transaction=f,n.once("finish",()=>{setImmediate(()=>{ut.addRequestDataToTransaction(f,e),f.setHttpStatus(n.statusCode),f.finish()})}),r()}}function mO(t={}){let e;if("include"in t)e={include:t.include};else{let{ip:n,request:r,transaction:s,user:i}=t;(n||r||s||i)&&(e={include:ut.dropUndefinedKeys({ip:n,request:r,transaction:s,user:i})})}return e}function EO(t){let e=mO(t),n=Ee.getCurrentHub(),r=n.getClient();if(r&&Ti.isAutoSessionTrackingEnabled(r)){r.initSessionFlusher();let s=n.getScope();s.getSession()&&s.setSession()}return function(i,o,a){if(t&&t.flushTimeout&&t.flushTimeout>0){let c=o.end;o.end=function(u,d,l){Ee.flush(t.flushTimeout).then(()=>{c.call(this,u,d,l)}).then(null,p=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ut.logger.error(p),c.call(this,u,d,l)})}}Ee.runWithAsyncContext(()=>{let c=Ee.getCurrentHub();c.configureScope(u=>{u.setSDKProcessingMetadata({request:i,requestDataOptionsFromExpressHandler:e});let d=c.getClient();Ti.isAutoSessionTrackingEnabled(d)&&c.getScope().setRequestSession({status:"ok"})}),o.once("finish",()=>{let u=c.getClient();Ti.isAutoSessionTrackingEnabled(u)&&setImmediate(()=>{u&&u._captureRequestSession&&u._captureRequestSession()})}),a()})}}function yO(t){let e=t.status||t.statusCode||t.status_code||t.output&&t.output.statusCode;return e?parseInt(e,10):500}function SO(t){return yO(t)>=500}function TO(t){return function(n,r,s,i){if((t&&t.shouldHandleError||SO)(n)){Ee.withScope(a=>{a.setSDKProcessingMetadata({request:r});let c=s.__sentry_transaction;c&&a.getSpan()===void 0&&a.setSpan(c);let u=Ee.getCurrentHub().getClient();if(u&&Ti.isAutoSessionTrackingEnabled(u)&&u._sessionFlusher!==void 0){let p=a.getRequestSession();p&&p.status!==void 0&&(p.status="crashed")}a.addEventProcessor(l=>(ut.addExceptionMechanism(l,{type:"middleware",handled:!1}),l));let d=Ee.captureException(n);s.sentry=d,i(n)});return}i(n)}}function bO(t={}){return function({path:e,type:n,next:r,rawInput:s}){let i=Ee.getCurrentHub(),o=mn([i,"access",c=>c.getClient,"call",c=>c(),"optionalAccess",c=>c.getOptions,"call",c=>c()]),a=i.getScope().getTransaction();if(a){a.setName(`trpc/${e}`,"route"),a.op="rpc.server";let c={procedure_type:n};(t.attachRpcInput!==void 0?t.attachRpcInput:mn([o,"optionalAccess",u=>u.sendDefaultPii]))&&(c.input=ut.normalize(s)),a.setContext("trpc",c)}return r()}}dt.extractRequestData=c_.extractRequestData;dt.parseRequest=c_.parseRequest;dt.errorHandler=TO;dt.requestHandler=EO;dt.tracingHandler=hO;dt.trpcMiddleware=bO});var d_=g(ne=>{Object.defineProperty(ne,"__esModule",{value:!0});var IO=du(),AO=gu(),vO=yu(),RO=Tu(),CO=Iu(),OO=Ru(),DO=Du(),NO=Nu(),wO=Uu(),kO=Gu(),xO=Bu();ne.Console=IO.Console;ne.Http=AO.Http;ne.OnUncaughtException=vO.OnUncaughtException;ne.OnUnhandledRejection=RO.OnUnhandledRejection;ne.LinkedErrors=CO.LinkedErrors;ne.Modules=OO.Modules;ne.ContextLines=DO.ContextLines;ne.Context=NO.Context;ne.RequestData=wO.RequestData;ne.LocalVariables=kO.LocalVariables;ne.Undici=xO.Undici});var l_=g(Ve=>{Object.defineProperty(Ve,"__esModule",{value:!0});var Lt=Nc();Ve.Apollo=Lt.Apollo;Ve.Express=Lt.Express;Ve.GraphQL=Lt.GraphQL;Ve.Mongo=Lt.Mongo;Ve.Mysql=Lt.Mysql;Ve.Postgres=Lt.Postgres;Ve.Prisma=Lt.Prisma});var p_=g(A=>{Object.defineProperty(A,"__esModule",{value:!0});var R=N(),PO=jf(),MO=Mc(),UO=zc(),bi=$u(),Yu=Rr(),LO=i_(),qO=ei(),FO=ru(),GO=u_(),BO=d_(),$O=l_(),jO={...R.Integrations,...BO,...$O};A.Hub=R.Hub;A.SDK_VERSION=R.SDK_VERSION;A.Scope=R.Scope;A.addBreadcrumb=R.addBreadcrumb;A.addGlobalEventProcessor=R.addGlobalEventProcessor;A.addIntegration=R.addIntegration;A.captureCheckIn=R.captureCheckIn;A.captureEvent=R.captureEvent;A.captureException=R.captureException;A.captureMessage=R.captureMessage;A.close=R.close;A.configureScope=R.configureScope;A.continueTrace=R.continueTrace;A.createTransport=R.createTransport;A.extractTraceparentData=R.extractTraceparentData;A.flush=R.flush;A.getActiveSpan=R.getActiveSpan;A.getActiveTransaction=R.getActiveTransaction;A.getCurrentHub=R.getCurrentHub;A.getHubFromCarrier=R.getHubFromCarrier;A.lastEventId=R.lastEventId;A.makeMain=R.makeMain;A.runWithAsyncContext=R.runWithAsyncContext;A.setContext=R.setContext;A.setExtra=R.setExtra;A.setExtras=R.setExtras;A.setMeasurement=R.setMeasurement;A.setTag=R.setTag;A.setTags=R.setTags;A.setUser=R.setUser;A.spanStatusfromHttpCode=R.spanStatusfromHttpCode;A.startActiveSpan=R.startActiveSpan;A.startInactiveSpan=R.startInactiveSpan;A.startSpan=R.startSpan;A.startSpanManual=R.startSpanManual;A.startTransaction=R.startTransaction;A.trace=R.trace;A.withScope=R.withScope;A.autoDiscoverNodePerformanceMonitoringIntegrations=PO.autoDiscoverNodePerformanceMonitoringIntegrations;A.NodeClient=MO.NodeClient;A.makeNodeTransport=UO.makeNodeTransport;A.defaultIntegrations=bi.defaultIntegrations;A.defaultStackParser=bi.defaultStackParser;A.getSentryRelease=bi.getSentryRelease;A.init=bi.init;A.DEFAULT_USER_INCLUDES=Yu.DEFAULT_USER_INCLUDES;A.addRequestDataToEvent=Yu.addRequestDataToEvent;A.extractRequestData=Yu.extractRequestData;A.deepReadDirSync=LO.deepReadDirSync;A.getModuleFromFilename=qO.getModuleFromFilename;A.enableAnrDetection=FO.enableAnrDetection;A.Handlers=GO;A.Integrations=jO});var h,Ku=Te(()=>{"use strict";h={GATEWAY_STARTED:"Gateway started",GATEWAY_STOPPED:"Gateway stopped",BOOTSTRAP_APPLIED:"Bootstrap applied",CHANNEL_READY:"Channel ready",CONVERSATION_STARTED:"Conversation started",EVALUATE_CONVERSATION_STARTED:"Evaluate conversation started",CONVERSATION_DELETED:"Conversation deleted",PENDING_CONVERSATION_DENIED:"Pending conversation denied",AGENTS_REFRESHED:"Agents refreshed",USER_DISPATCHED:"User dispatched",SESSION_DISPATCHED:"Session dispatched",SYNC_TICK_COMPLETED:"Sync tick completed",INBOUND_HANDLER_ENTERED:"Inbound handler entered",MESSAGE_RECEIVED:"Message received",MESSAGE_SENT:"Message sent",INBOUND_BUYER_PENDING:"Inbound buyer: no session, group still Unknown (pending)",INBOUND_BUYER_SESSION_AUTO_RECOVERED:"Inbound buyer: session missing for Allowed group, auto-recovered",INBOUND_BLOCKED_SENSITIVE:"Inbound blocked: sensitive word; reply sent",INBOUND_BLOCKED_ADDRESS_MISMATCH:"Inbound blocked: address mismatch",INBOUND_BLOCKED_INELIGIBLE:"Inbound blocked: message-eligible check failed",INBOUND_DROP_EMPTY_CONTENT:"Inbound drop: empty content",INBOUND_DROP_MISSING_JOBID:"Inbound drop: missing jobId",INBOUND_DROP_UNSUPPORTED_MSGTYPE:"Inbound drop: unsupported msgType",INBOUND_DROP_DM_NON_SYSTEM:"Inbound drop: DM sender not in system whitelist",INBOUND_DROP_DM_INVALID_PAYLOAD:"Inbound drop: DM payload invalid",INBOUND_DROP_DM_UNKNOWN_AGENT:"Inbound drop: DM target agent not local",DM_FALLBACK_TO_BACKUP:"DM fallback to backup session",DM_WHITELIST_FAIL_OPEN:"DM whitelist fail-open (empty system accounts)",FILE_UPLOADED:"File uploaded",FILE_DOWNLOADED:"File downloaded",PENDING_LIST_QUERIED:"Pending list queried",AGENT_LIST_QUERIED:"Agent list queried",SESSION_KEY_DERIVED:"Session key derived",CONVERSATION_HISTORY_QUERIED:"Conversation history queried",SESSIONS_QUERIED:"Sessions queried",GROUP_CONSENT_CHANGED:"Group consent changed",SESSION_CREATED:"Session created",SESSION_DELETED:"Session deleted",SESSION_AUTO_RECOVERED:"Session auto-recovered",INBOUND_DELIVERED:"Inbound delivered to session",DM_DELIVERED:"DM delivered to session",OUTBOUND_ELIGIBILITY_CHECKED:"Outbound eligibility checked",AGENT_CLIENT_CREATED:"Agent client created",AGENT_CLIENT_REMOVED:"Agent client removed",ADDRESS_SYNC_COMPLETED:"Address sync completed",AGENT_REFRESH_SESSION_EXPIRED:"Agent refresh aborted: onchainos session expired, local clients taken offline",OFFLINE_REPLAY_MESSAGE_REPLAYED:"Offline replay message replayed",AGENTS_WAKEUP_NOTIFIED:"Agents wakeup notified",CONFIG_SENSITIVE_WORDS_REFRESHED:"Sensitive words config refreshed",CONFIG_SYSTEM_REFRESHED:"System config refreshed",GATEWAY_DISCONNECTED:"Gateway disconnected",GATEWAY_REQUEST:"Gateway request",GATEWAY_DELIVERY_BUFFERED:"Gateway delivery buffered",DAEMON_LIFECYCLE_SKIPPED:"Daemon lifecycle skipped",DAEMON_LIFECYCLE_REQUESTED:"Daemon lifecycle requested",PROMPT_USER_CHECKPOINT:"Prompt user checkpoint",USER_WATCH_STARTED:"User watch started",USER_WATCH_EVENT_DELIVERED:"User watch event delivered",INBOUND_DM_RAW:"Inbound DM raw",INBOUND_GROUP_RAW:"Inbound group raw",SYSTEM_NOTIFICATION_RECEIVED:"System notification received",SYSTEM_NOTIFICATION_ROUTED:"System notification routed",HERMES_SESSION_ROUTE_BINDING:"Hermes session route binding",XMTP_CONNECTION_FAILED:"XMTP connection failed",CONVERSATIONS_STREAM_FAILED:"conversations.stream failed",AGENT_START_FAILED:"agent.start failed",AGENT_STREAM_ERROR:"agent stream error",BOOTSTRAP_FAILED:"Bootstrap failed",ONCHAINOS_SESSION_EXPIRED:"Onchainos session expired",ONCHAINOS_CLI_ERROR:"Onchainos CLI error",HEARTBEAT_FAILED:"Heartbeat failed",MESSAGE_PARSE_FAILED:"Message parse failed",MESSAGE_HANDLER_ERROR:"Message handler error",OFFLINE_REPLAY_FAILED:"Offline replay failed",INBOUND_ROUTING_FAILED:"Inbound routing failed",CONVERSATION_NOT_FOUND:"Conversation not found for send",XMTP_SEND_FAILED:"XMTP send failed",AGENT_REFRESH_FAILED:"Agent refresh failed",GROUP_CONSENT_UPDATE_FAILED:"Group consent update failed",TOOL_EXECUTE_FAILED:"Tool execute failed",AGENT_RESOLUTION_FAILED:"Agent resolution failed",USER_DISPATCH_FAILED:"User dispatch failed",INBOUND_ELIGIBILITY_BYPASSED:"Inbound eligibility bypassed",INBOUND_ADDRESS_CHECK_FAILED:"Inbound address check failed",INBOUND_ADDRESS_CHECK_BYPASSED:"Inbound address check bypassed",INBOUND_SENSITIVE_CHECK_FAILED:"Inbound sensitive check failed",FILE_UPLOAD_FAILED:"File upload failed",FILE_DOWNLOAD_FAILED:"File download failed",OFFLINE_REPLAY_MESSAGE_FAILED:"Offline replay message failed",PENDING_NOTIFICATION_FAILED:"Pending notification failed",GATEWAY_CONNECT_FAILED:"Gateway connect failed",GATEWAY_REQUEST_FAILED:"Gateway request failed",PROMPT_USER_FAILED:"Prompt user failed",DAEMON_COMMAND_FAILED:"Daemon command failed",DAEMON_COMMAND_TIMEOUT:"Daemon command timeout",DAEMON_COMMAND_STALE:"Daemon command stale",DAEMON_LIFECYCLE_FAILED:"Daemon lifecycle failed",DAEMON_TICK_FAILED:"Daemon tick failed",DIRECT_CLI_FAILED:"Direct CLI failed",AI_RUN_FAILED:"AI run failed",AI_RUN_TIMEOUT:"AI run timeout",AI_RUN_TOOL_FAILED:"AI run tool failed",IPC_FAILED:"IPC failed",NOTIFY_AGENTS_WAKEUP_FAILED:"Notify agents wakeup failed",OUTBOUND_AGENT_LOOKUP_FAILED:"Outbound agent lookup failed",OUTBOUND_ELIGIBILITY_CHECK_FAILED:"Outbound eligibility check failed",OUTBOUND_ELIGIBILITY_BYPASSED:"Outbound eligibility bypassed",OUTBOUND_BLOCKED_INELIGIBLE:"Outbound blocked: message-eligible check failed",CACHE_LOAD_FAILED:"Cache load failed",CACHE_WRITE_FAILED:"Cache write failed",CONFIG_LOAD_FAILED:"Config load failed",SENTRY_INIT_SKIPPED:"Sentry init skipped",AGENT_DB_DIR_CREATE_FAILED:"Agent DB dir create failed"}});var z,h_,f_,g_,HO,YO,KO,WO,VO,Ii,__,Wu,I,m_,E_,re=Te(()=>{"use strict";ee();z=qh(p_()),h_=require("node:crypto");Ku();Ku();f_=(0,h_.randomUUID)(),g_=new Set(["args","apikey","argv","auth","authorization","authtoken","bearer","body","cache","command","content","credential","credentials","cwd","data","error","failures","filename","file_name","filepath","file_path","headers","input","logpath","message","output","password","params","path","payload","privatekey","prompt","raw","rawevent","rawtext","request","response","accesstoken","refreshtoken","digest","nonce","salt","secret","token","stderr","stdout","title","tooloutput"]),HO=["accesstoken","apikey","authorization","authtoken","content","credential","filepath","logpath","outputpath","password","payload","privatekey","prompt","rawevent","rawtext","refreshtoken","requestbody","responsebody","secret","stderr","stdout","token","tooloutput"],YO=new Set(["onchainosagentlistresultjson","onchainosagentlistdiagnostictext"]),KO=new Set(["agentPlatform","cacheName","checkpoint","code","communicationClass","component","eventName","exitCode","kind","method","onchainosAgentId","operation","phase","platform","provider","reason","role","source","stage","status","subcommand","taskId","type"]),WO=["eventName","cacheName","checkpoint","component","method","operation","phase","reason","code","provider","type","kind","status","subcommand"],VO=new Set([h.GATEWAY_STARTED,h.GATEWAY_STOPPED,h.GATEWAY_DISCONNECTED,h.GATEWAY_REQUEST,h.GATEWAY_DELIVERY_BUFFERED,h.DAEMON_LIFECYCLE_SKIPPED,h.DAEMON_LIFECYCLE_REQUESTED,h.PROMPT_USER_CHECKPOINT,h.USER_WATCH_STARTED,h.USER_WATCH_EVENT_DELIVERED,h.CHANNEL_READY,h.CONVERSATION_STARTED,h.EVALUATE_CONVERSATION_STARTED,h.CONVERSATION_DELETED,h.USER_DISPATCHED,h.SESSION_DISPATCHED,h.SESSION_CREATED,h.SESSION_DELETED,h.SESSION_AUTO_RECOVERED,h.INBOUND_DELIVERED,h.INBOUND_DM_RAW,h.INBOUND_GROUP_RAW,h.SYSTEM_NOTIFICATION_RECEIVED,h.SYSTEM_NOTIFICATION_ROUTED,h.HERMES_SESSION_ROUTE_BINDING,h.INBOUND_BLOCKED_ADDRESS_MISMATCH,h.INBOUND_BLOCKED_INELIGIBLE,h.INBOUND_BLOCKED_SENSITIVE,h.INBOUND_DROP_DM_INVALID_PAYLOAD,h.INBOUND_DROP_DM_NON_SYSTEM,h.INBOUND_DROP_DM_UNKNOWN_AGENT,h.INBOUND_DROP_EMPTY_CONTENT,h.INBOUND_DROP_MISSING_JOBID,h.INBOUND_DROP_UNSUPPORTED_MSGTYPE,h.DM_DELIVERED,h.DM_FALLBACK_TO_BACKUP,h.DM_WHITELIST_FAIL_OPEN,h.INBOUND_BUYER_PENDING,h.INBOUND_BUYER_SESSION_AUTO_RECOVERED,h.MESSAGE_SENT,h.AGENT_CLIENT_CREATED,h.AGENT_CLIENT_REMOVED,h.ADDRESS_SYNC_COMPLETED,h.AGENTS_REFRESHED,h.AGENTS_WAKEUP_NOTIFIED,h.AGENT_LIST_QUERIED,h.BOOTSTRAP_APPLIED,h.CONFIG_SENSITIVE_WORDS_REFRESHED,h.CONFIG_SYSTEM_REFRESHED,h.CONVERSATION_HISTORY_QUERIED,h.FILE_DOWNLOADED,h.FILE_UPLOADED,h.GROUP_CONSENT_CHANGED,h.INBOUND_HANDLER_ENTERED,h.MESSAGE_RECEIVED,h.OFFLINE_REPLAY_MESSAGE_REPLAYED,h.AGENT_REFRESH_SESSION_EXPIRED,h.OUTBOUND_ELIGIBILITY_CHECKED,h.OUTBOUND_BLOCKED_INELIGIBLE,h.PENDING_CONVERSATION_DENIED,h.PENDING_LIST_QUERIED,h.SESSION_KEY_DERIVED,h.SESSIONS_QUERIED,h.SYNC_TICK_COMPLETED]),Ii=256,__=128,Wu=class t{static instance;initialized=!1;buffer=[];constructor(){}static getInstance(){return t.instance||(t.instance=new t),t.instance}init(e){if(this.initialized){_d("[logger] Already initialized, skipping.");return}try{z.init({dsn:e.dsn,release:e.release,environment:e.environment,maxBreadcrumbs:0,beforeBreadcrumb:()=>null,isInner:!1}),z.setTags({projectName:e.projectName,agentPlatform:e.agentPlatform})}catch{return}this.initialized=!0,this.flush()}info(e,n){let r=t.sanitizeExtra({flowId:f_,...n??{}});if(VO.has(e)){if(!this.initialized){this.buffer.push({level:"info",message:e,extra:r});return}try{z.withScope(s=>{t.applyDiagnostics(s,e,r),z.captureEvent({level:"info",message:e,extra:{...r,eventName:e}})})}catch{}}}error(e,n,r){let s=t.sanitizeExtra({flowId:f_,...r??{}});if(!this.initialized){this.buffer.push({level:"error",message:e,error:n,extra:s});return}try{z.withScope(i=>{i.setLevel("error"),t.applyDiagnostics(i,e,s),z.captureException(t.createSentryEvent(e),{extra:n?{...s,eventName:e,errorName:n.name,errorMessageLength:String(n.message.length)}:s})})}catch{}}async shutdown(){try{await z.close(5e3)}catch{await z.flush(5e3)}}flush(){for(;this.buffer.length>0;){let e=this.buffer.shift();e.level==="info"?this.info(e.message,e.extra):this.error(e.message,e.error,e.extra)}}static sanitizeExtra(e){return Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0).filter(([n])=>!t.isBlockedExtraKey(n)).map(([n,r])=>[n,t.safeValueForKey(n,r)]))}static isBlockedExtraKey(e){let n=e.toLowerCase(),r=t.normalizeSensitiveKey(e);return g_.has(n)||g_.has(r)?!0:t.isSafeMetricKey(r)?!1:HO.some(s=>r.includes(s))}static isSafeMetricKey(e){return/(bytes|count|length|ms|size)$/.test(e)}static safeValueForKey(e,n){return typeof n=="string"&&YO.has(t.normalizeSensitiveKey(e))?n:t.safeValue(n)}static normalizeSensitiveKey(e){return e.toLowerCase().replace(/[^a-z0-9]/g,"")}static safeValue(e){if(typeof e=="string")return e.length<=Ii?e:`${e.slice(0,Ii)}...`;if(e==null||typeof e=="number"||typeof e=="boolean")return e;if(typeof e=="bigint")return e.toString();if(e instanceof Error)return{name:e.name,messageLength:e.message.length};if(Array.isArray(e))return e.slice(0,20).map(r=>t.safeValue(r));if(typeof e=="object")return Object.fromEntries(Object.entries(e).slice(0,50).filter(([,r])=>r!==void 0).filter(([r])=>!t.isBlockedExtraKey(r)).map(([r,s])=>[r,t.safeValueForKey(r,s)]));let n=String(e);return n.length<=Ii?n:`${n.slice(0,Ii)}...`}static tagValue(e){let n=String(e);return n.length<=__?n:`${n.slice(0,__)}...`}static normalizeTagKey(e){return e.replace(/[^A-Za-z0-9_.:-]+/g,"_").slice(0,32)||"unknown"}static applyDiagnostics(e,n,r){let s={eventName:n,...r};for(let[o,a]of Object.entries(s))KO.has(o)&&e.setTag(t.normalizeTagKey(o),t.tagValue(a));let i=["a2a",n];for(let o of WO){let a=s[o];a&&i.push(`${o}:${t.tagValue(a)}`)}e.setFingerprint(i)}static toPascalCase(e){return e.split(/[\s:]+/).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}static createSentryEvent(e){let n=new Error(e);return n.name=t.toPascalCase(e),n.stack=`${n.name}: ${e}`,n}},I=Wu.getInstance(),m_=t=>I.init(t),E_=()=>I.shutdown()});function Vu(){return En||(process.env.OKX_AGENT_TASK_HOME?(En=Ai(process.env.OKX_AGENT_TASK_HOME),En):(En=Ai((0,vi.join)(JO(),".okx-agent-task")),En))}function Ai(t){return XO(t)}function XO(t){(0,Ri.mkdirSync)(t,{recursive:!0,mode:S_});try{(0,Ri.chmodSync)(t,S_)}catch(e){let n=e.code;if(n!=="EPERM"&&n!=="EACCES")throw e}return t}function JO(){try{let t=(0,T_.homedir)();if(t)return t}catch(t){}return(0,vi.resolve)(process.cwd())}var T_,vi,Ri,En,S_,b_=Te(()=>{"use strict";T_=require("node:os"),vi=require("node:path"),Ri=require("node:fs"),En=null,S_=448});function QO(t=Vu()){return(0,I_.join)(t,"openclaw-gateway.json")}function A_(t,e=Vu()){let n=Ai(e),r=QO(n),s=`${r}.${process.pid}.tmp`,i={version:1,url:t.url,...t.password?{password:t.password}:{},...t.token?{token:t.token}:{},updatedAt:new Date().toISOString(),source:"openclaw-plugin"};(0,ze.writeFileSync)(s,`${JSON.stringify(i,null,2)}
34
- `,{encoding:"utf8",mode:384});try{(0,ze.chmodSync)(s,384)}catch{}(0,ze.renameSync)(s,r);try{(0,ze.chmodSync)(r,384)}catch{}return r}var ze,I_,v_=Te(()=>{"use strict";ze=require("node:fs"),I_=require("node:path");b_()});function C_(t){return t.includes(Oi)||t.includes(`:${Di}:`)}function R_(t){return t.toLowerCase().startsWith("0x")}function ZO(t){if(typeof t=="string")return`${Oi}:${t}`;let e="myAgentId"in t&&"toAgentId"in t?new URLSearchParams({my:t.myAgentId,to:t.toAgentId,job:t.jobId}):new URLSearchParams({my:t.myXmtpAddress,to:t.toXmtpAddress,job:t.jobId});return`${Oi}:${e.toString()}`}function Xu(t){let e=`${Oi}:`,n=t.indexOf(e);if(n===-1)return null;let r=new URLSearchParams(t.slice(n+e.length)),s=r.get("myAgentId")||r.get("myagentid"),i=r.get("toAgentId")||r.get("toagentid"),o=r.get("my"),a=r.get("to"),c=r.get("job"),u=r.get("gid");return s&&i&&c?{format:"agent",myAgentId:s,toAgentId:i,jobId:c,xmtpGroupId:u??""}:!o||!a||!c?null:!R_(o)&&(a==="_"||!R_(a))?{format:"agent",myAgentId:o,toAgentId:a,jobId:c,xmtpGroupId:u??""}:{format:"address",myXmtpAddress:o,toXmtpAddress:a,jobId:c,xmtpGroupId:u??""}}function zu(t){if(!t)return"";let e=Xu(t);return e?.jobId?e.jobId:/(?:^|:)backup:([^:&]+)/.exec(t)?.[1]??""}function Dr(t){let e=t.taskId?.trim()||zu(t.scopeKey)||zu(t.sessionKey);return e?{taskId:e}:{}}function eD(t){let e=typeof t=="string"?t:ZO(t);return(0,Or.buildAgentSessionKey)({agentId:"main",channel:Di,peer:{kind:"group",id:e}})}function O_(){let n=Je().config.loadConfig().agents?.list;if(n&&n.length>0){let r=n.find(s=>s.id==="main");return r?r.id:n[0].id}return"main"}function D_(){return(0,Or.buildAgentSessionKey)({agentId:O_(),channel:Di,peer:{kind:"group",id:"backup"}})}function tD(t){return(0,Or.buildAgentSessionKey)({agentId:O_(),channel:Di,peer:{kind:"group",id:`backup:${t}`}})}function Ni(){let t=Je(),e=t.agent.session.resolveStorePath(void 0,{agentId:"main"}),n=t.agent.session.loadSessionStore(e,{skipCache:!0}),r=new Map,s=new Map;function i(c){if(!(!c||c==="direct"||c==="@direct"))return c.startsWith("telegram:")||c.startsWith("@")?c:`telegram:${c}`}function o(c,u){let d=c.split(":");if(u==="telegram"){let l=d.indexOf("telegram"),p=l>=0?d.slice(l+1):d.slice(3),f=p.indexOf("direct");if(f>=0){let m=f>0?p[f-1]:void 0,E=p[f+1]==="telegram"&&p[f+2]?`telegram:${p[f+2]}`:p[f+1];return{to:i(E),accountId:m}}if(p[0]==="telegram"&&p[1])return{to:`telegram:${p[1]}`,accountId:void 0};if(p[1]==="telegram"&&p[2])return{to:`telegram:${p[2]}`,accountId:p[0]};if(p.length>=2)return{to:i(p[1]),accountId:p[0]};if(p.length===1)return{to:i(p[0]),accountId:void 0}}return{to:d[4],accountId:void 0}}function a(c,u){return typeof c!="string"||c==="direct"||c==="@direct"?u:c}for(let[c,u]of Object.entries(n)){if(C_(c))continue;let d=u;if(d.spawnedBy||d.subagentRole)continue;let l=d.deliveryContext?.channel??d.lastChannel??d.origin?.provider;if(!l)continue;let p=o(c,l),f=a(d.deliveryContext?.to,p.to)??a(d.lastTo,p.to)??p.to,m=d.deliveryContext?.accountId??p.accountId,E=d.lastInteractionAt??d.updatedAt??0;f&&(!s.get(l)||E>(r.get(l)?.updatedAt??0))&&s.set(l,f);let b=r.get(l);(!b||E>b.updatedAt)&&r.set(l,{sessionKey:c,to:f,accountId:m,updatedAt:E})}for(let[c,u]of r)if(!u.to){let d=s.get(c);d&&(u.to=d)}for(let[c,u]of r)y(`[findLatestUserSessions] channel=${c} winner=${u.sessionKey} to=${u.to??"(none)"} accountId=${u.accountId??"(none)"} interactedAt=${u.updatedAt}`);return r}function N_(t){let e=new Set,n=[...t.sessionKey?[t.sessionKey]:[],...Array.isArray(t.sessionKeys)?t.sessionKeys:[]].filter(s=>s.trim()),r=[];t.jobId&&r.push({jobId:t.jobId,myAgentId:t.myAgentId,toAgentId:t.toAgentId,myXmtpAddress:t.myXmtpAddress,toXmtpAddress:t.toXmtpAddress});for(let s of n){if(s.startsWith("agent:")){e.add(s);continue}let i=iD(s);if(i){e.add(tD(i));continue}let o=w_(s);if(o){r.push(o);continue}let a=Xu(s);if(a){r.push(sD(a));continue}e.add(eD(s))}for(let s of nD())for(let i of r)if(rD(s,i)){e.add(s);break}return[...e].sort()}function nD(){let t=Je(),e=t.agent.session.resolveStorePath(void 0,{agentId:"main"}),n=t.agent.session.loadSessionStore(e,{skipCache:!0});return Object.keys(n).filter(C_)}function rD(t,e){let n=Xu(t);if(n)return oD(n,e);let r=w_(t);return r?!(e.jobId&&r.jobId!==e.jobId||e.myAgentId&&r.myAgentId!==e.myAgentId||e.toAgentId&&r.toAgentId!==e.toAgentId||e.myXmtpAddress&&!e.myAgentId||e.toXmtpAddress&&!e.toAgentId):!e.jobId||e.myAgentId||e.toAgentId||e.myXmtpAddress||e.toXmtpAddress?!1:zu(t)===e.jobId}function sD(t){return"myAgentId"in t?{myAgentId:t.myAgentId,toAgentId:t.toAgentId,jobId:t.jobId}:{myXmtpAddress:t.myXmtpAddress,toXmtpAddress:t.toXmtpAddress,jobId:t.jobId}}function w_(t){let e=t.split(":"),n=e.indexOf("job");return n<0||e[n+2]!=="my"||e[n+4]!=="to"||!e[n+1]||!e[n+3]||!e[n+5]?null:{jobId:Ci(e[n+1]),myAgentId:Ci(e[n+3]),toAgentId:Ci(e[n+5])}}function iD(t){return t.startsWith("backup:")?Ci(t.slice(7)):null}function oD(t,e){return e.jobId&&t.jobId!==e.jobId?!1:"myAgentId"in t?!(e.myAgentId&&t.myAgentId!==e.myAgentId||e.toAgentId&&t.toAgentId!==e.toAgentId||e.myXmtpAddress&&!e.myAgentId||e.toXmtpAddress&&!e.toAgentId):!(e.myXmtpAddress&&t.myXmtpAddress.toLowerCase()!==e.myXmtpAddress.toLowerCase()||e.toXmtpAddress&&t.toXmtpAddress.toLowerCase()!==e.toXmtpAddress.toLowerCase()||e.myAgentId&&!e.myXmtpAddress||e.toAgentId&&!e.toXmtpAddress)}function Ci(t){try{return decodeURIComponent(t)}catch{return t}}var Or,Oi,Di,Nr=Te(()=>{"use strict";ee();Or=require("openclaw/plugin-sdk/routing");vn();Oi="okx-xmtp",Di="okx-a2a"});function Ju(t){if(t){if(typeof t=="string")return t;if(typeof t=="object"&&t!==null&&"env"in t)return process.env[t.env]||void 0}}function dD(t){return t&&(typeof t=="string"?{type:"string",configured:!0}:typeof t=="object"&&t!==null&&"env"in t?{type:"env",env:String(t.env),configured:!!Ju(t)}:{type:typeof t,configured:!0})}function Qu(t){if(!t||typeof t!="object")return t??null;if(Array.isArray(t))return t.map(n=>Qu(n));let e={};for(let[n,r]of Object.entries(t)){if(/password|token|secret/i.test(n)){e[n]=dD(r);continue}e[n]=Qu(r)}return e}function lD(t){try{return JSON.stringify(t)}catch{return"[unserializable]"}}function pD(t){let e=t.params;if(!e||typeof e!="object"||Array.isArray(e))return Dr({taskId:t.taskId});let n=e;return Dr({taskId:t.taskId,sessionKey:typeof n.sessionKey=="string"?n.sessionKey:typeof n.key=="string"?n.key:""})}function q_(t){let e={};for(let[n,r]of Object.entries(t))r!=null&&(e[n]=String(r));return e}function ye(t,e={}){let n=q_({phase:t,...e});y(`[gateway] ${t}: ${JSON.stringify(n)}`),I.info(t.startsWith("request_")?h.GATEWAY_REQUEST:h.GATEWAY_STARTED,{component:"openclaw_gateway",...n})}function Sn(t,e,n={},r=h.GATEWAY_CONNECT_FAILED){let s=q_({phase:t,component:"openclaw_gateway",...n});y(`[gateway] ${t}:`,e),I.error(r,e instanceof Error?e:new Error(String(e)),s)}function fD(t){for(let e of Zu)try{e(t)}catch(n){y("[gateway] event handler failed:",n)}}function F_(t){return Zu.add(t),()=>{Zu.delete(t)}}function x_(){ye("ready_gate_reset",{hasSharedClient:!!Pe,hasConnected:xe}),yn=new Promise((t,e)=>{wi=t,ki=e})}function P_(t,e,n){if(Pe!==t){ye(`${e}_skip_clear_noncurrent`,n);return}try{t.stop?.()}catch(r){Sn(`${e}_stop_failed`,r,n)}Pe=null,xe=!1,yn=null,wi=null,ki=null,ye(`${e}_cleared_client`,n)}function gD(){if(Pe)return ye("reuse_client",{hasConnected:xe,hasReadyPromise:!!yn}),{client:Pe,ready:yn};let t=G_(),{url:e,password:n,token:r}=t,s=(0,ed.randomUUID)(),i=++uD;x_(),ye("init_client",{clientSeq:i,instanceId:s,url:e,hasGatewayConfig:!!t.rawGatewayConfig,gatewayConfig:lD(Qu(t.rawGatewayConfig)),passwordConfigured:!!n,tokenConfigured:!!r,scopes:k_.join(",")});let o=new L_.GatewayClient({url:e,password:n,token:r,instanceId:s,clientName:"gateway-client",clientDisplayName:"okx-a2a-plugin",mode:"backend",role:"operator",scopes:[...k_],onHelloOk:()=>{ye("hello_ok",{clientSeq:i,instanceId:s,url:e}),xe=!0,wi?.()},onEvent:fD,onClose:(a,c)=>{if(y(`[gateway] closed (${a}): ${c||"no reason"}`),I.info(h.GATEWAY_DISCONNECTED,{clientSeq:String(i),instanceId:s,url:e,code:String(a),reason:c||"no-reason",hadConnected:String(xe)}),xe){xe=!1,x_();return}P_(o,"close_before_connect",{clientSeq:i,instanceId:s,url:e,code:a,reason:c||"no-reason"})},onConnectError:a=>{let c=a;if(c?.retryable){Sn("connect_error_retryable",a,{clientSeq:i,instanceId:s,url:e,retryable:"true",reason:c?.details?.reason??"retryable",code:c?.gatewayCode??c?.details?.code});return}Sn("connect_error",a,{clientSeq:i,instanceId:s,url:e,retryable:"false",code:c?.gatewayCode??c?.details?.code}),ki?.(a instanceof Error?a:new Error(String(a))),P_(o,"connect_error",{clientSeq:i,instanceId:s,url:e,code:c?.gatewayCode??c?.details?.code,reason:c?.details?.reason})}});return Pe=o,ye("start_client",{clientSeq:i,instanceId:s,url:e}),o.start(),{client:o,ready:yn}}function G_(){let e=Je().config.loadConfig().gateway;return{url:`ws://127.0.0.1:${M_(process.env.OPENCLAW_GATEWAY_PORT)??M_(e?.port)??cD}`,password:Ju(e?.auth?.password),token:Ju(e?.auth?.token),rawGatewayConfig:e}}function M_(t){if(typeof t=="number"&&Number.isFinite(t)){let r=Math.trunc(t);return r>0&&r<=65535?r:null}if(typeof t!="string")return null;let e=t.trim();if(!/^\d+$/.test(e))return null;let n=Number.parseInt(e,10);return n>0&&n<=65535?n:null}function B_(){let t=G_();try{let e=A_({url:t.url,password:t.password,token:t.token});return ye("synced_node_gateway_config",{path:e,url:t.url,passwordConfigured:!!t.password,tokenConfigured:!!t.token}),e}catch(e){return Sn("sync_node_gateway_config_failed",e,{url:t.url,passwordConfigured:!!t.password,tokenConfigured:!!t.token},h.GATEWAY_CONNECT_FAILED),null}}function $_(){if(Pe){try{Pe.stop()}catch{}Pe=null,yn=null,wi=null,ki=null,xe=!1}}function td(t){let e=t,n=e?.gatewayCode??e?.details?.code;if(!n)return null;let r=e?.details??{},s=[`code=${n}`];r.reason&&s.push(`reason=${r.reason}`),r.authReason&&s.push(`authReason=${r.authReason}`),Array.isArray(r.requestedScopes)&&r.requestedScopes.length&&s.push(`requestedScopes=${r.requestedScopes.join(",")}`),r.deviceId&&s.push(`deviceId=${r.deviceId}`),r.requestId&&s.push(`requestId=${r.requestId}`);let i=` (${s.join(", ")})`;switch(n){case"NOT_PAIRED":case"PAIRING_REQUIRED":return`Device pairing approval pending${i}. On the openclaw host run \`openclaw devices approve --latest\` to review and approve the pending request, then retry.`;case"AUTH_SCOPE_MISMATCH":return`Existing device token lacks the required scope${i}. On the openclaw host run \`openclaw devices list\` to find the operator deviceId, then \`openclaw devices rotate --device <id> --role operator --scope operator.admin\` to reissue a token with operator.admin, and restart openclaw.`;case"AUTH_TOKEN_MISSING":case"AUTH_TOKEN_MISMATCH":case"AUTH_DEVICE_TOKEN_MISMATCH":return`Gateway device token is missing or stale${i}. On the openclaw host run \`openclaw devices list\`, then \`openclaw devices remove <deviceId>\`, then restart openclaw to re-pair.`;default:return null}}async function Xe(t){let e=t.timeoutMs??aD,n=Date.now(),r=pD(t);ye("request_start",{method:t.method,timeoutMs:e,hasSharedClient:!!Pe,hasConnected:xe,...r});let{client:s,ready:i}=gD();try{await i}catch(a){let c=Date.now()-n;throw Sn("request_ready_failed",a,{method:t.method,durationMs:c,timeoutMs:e,...r,code:a?.gatewayCode??a?.code??a?.details?.code,reason:"gateway_ready_failed",communicationClass:"openclaw_gateway_connect"},h.GATEWAY_REQUEST_FAILED),a}let o=Date.now()-n;ye("request_ready",{method:t.method,readyWaitMs:o,timeoutMs:e,hasConnected:xe,...r});try{let a=await s.request(t.method,t.params,{timeoutMs:e});return ye("request_done",{method:t.method,durationMs:Date.now()-n,timeoutMs:e,...r}),a}catch(a){let c=Date.now()-n,u=/timeout|timed out/i.test(String(a?.message??a??""));Sn("request_error",a,{method:t.method,durationMs:c,timeoutMs:e,readyWaitMs:o,...r,isTimeout:u,code:a?.gatewayCode??a?.code??a?.details?.code,reason:u?"gateway_request_timeout":"gateway_request_error",communicationClass:"openclaw_gateway_rpc"},h.GATEWAY_REQUEST_FAILED);let d=td(a);if(d){let l=a?.message??String(a);try{a.message=`${l}
35
- ${d}`}catch{}}throw a}}async function xi(t){return Xe({method:"sessions.create",params:t})}async function j_(t){return Xe({method:"sessions.delete",params:t})}async function wr(t){let e=t.idempotencyKey??(0,ed.randomUUID)(),n={key:t.key,message:t.message,idempotencyKey:e};try{let r=await Xe({method:"sessions.send",params:n});return{runId:U_(r),raw:r}}catch(r){let s=r?.gatewayCode??r?.code,i=String(r?.message??"");if(s==="INVALID_REQUEST"&&i.includes("session not found")){await xi({key:t.key}),I.info(h.SESSION_AUTO_RECOVERED,{sessionKey:t.key,trigger:"sessions.send"});let o=await Xe({method:"sessions.send",params:n});return{runId:U_(o),raw:o}}throw r}}function U_(t){if(!t||typeof t!="object")return;let e=t.runId;return typeof e=="string"&&e.trim()?e:void 0}async function kr(t){try{return await Xe({method:"chat.inject",params:t})}catch(e){let n=e?.gatewayCode??e?.code,r=String(e?.message??"");if(n==="INVALID_REQUEST"&&r.includes("session not found"))return await xi({key:t.sessionKey}),I.info(h.SESSION_AUTO_RECOVERED,{sessionKey:t.sessionKey,trigger:"chat.inject"}),await Xe({method:"chat.inject",params:t});throw e}}var L_,ed,aD,cD,k_,uD,Pe,yn,wi,ki,xe,Zu,Tn=Te(()=>{"use strict";ee();L_=require("openclaw/plugin-sdk/gateway-runtime"),ed=require("node:crypto");vn();re();v_();Nr();aD=2e4,cD=18789,k_=["operator.admin"],uD=0;Pe=null,yn=null,wi=null,ki=null,xe=!1,Zu=new Set});var V_={};fd(V_,{isPromptUserSessionRunning:()=>_D,markPromptUserSessionEnded:()=>id,markPromptUserSessionRunning:()=>sd,queuePromptUserAction:()=>hD});function qt(t){let e=Y_.get(t);return e||(e={running:!1,processing:!1,queue:[]},Y_.set(t,e)),e}function nd(t,e,n){t.fallbackTimer&&(clearTimeout(t.fallbackTimer),t.fallbackTimer=void 0,e&&y(`[xmtp_prompt_user:queue] fallback cleared sessionKey=${e}${n?` reason=${n}`:""}`))}function rd(t,e){nd(e,t,"reschedule");let n=e.queue[0];if(!n||e.processing)return;let r=Math.max(0,n.deadlineAt-Date.now());y(`[xmtp_prompt_user:queue] fallback scheduled sessionKey=${t} channel=${n.channel} delayMs=${r} queued=${e.queue.length}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"fallback_scheduled",sessionKey:t,channel:n.channel,taskId:n.taskId,delayMs:r,queued:e.queue.length})),e.fallbackTimer=setTimeout(()=>{let s=qt(t);s.fallbackTimer=void 0,y(`[xmtp_prompt_user:queue] fallback fired sessionKey=${t} queued=${s.queue.length}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"fallback_fired",sessionKey:t,taskId:s.queue[0]?.taskId,queued:s.queue.length,reason:"fallback_timeout"})),Pr(t,"fallback_timeout")},r)}async function Pr(t,e){let n=qt(t);if(n.processing)return;let r=n.queue.shift();if(!r){nd(n,t,"empty_queue"),y(`[xmtp_prompt_user:queue] dispatch skipped empty sessionKey=${t} reason=${e}`);return}nd(n,t,e),n.processing=!0;try{y(`[xmtp_prompt_user:queue] dispatch sessionKey=${t} channel=${r.channel} reason=${e} remaining=${n.queue.length}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"dispatch_started",sessionKey:t,channel:r.channel,taskId:r.taskId,reason:e,queued:n.queue.length}));let s=await z_({...r,onRunStarted:i=>{let o=Pi.get(i);if(o){y(`[xmtp_prompt_user:queue] run already completed sessionKey=${t} channel=${r.channel} runId=${i} state=${o.state} completedAt=${o.completedAt}`),Pi.delete(i);return}xr.set(i,{sessionKey:t,channel:r.channel,taskId:r.taskId,startedAt:Date.now()}),y(`[xmtp_prompt_user:queue] run pending sessionKey=${t} channel=${r.channel} runId=${i}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"run_pending",sessionKey:t,channel:r.channel,taskId:r.taskId,runId:i}))}});n.running=!s.runId||xr.has(s.runId),y(`[xmtp_prompt_user:queue] dispatch completed sessionKey=${t} channel=${r.channel} reason=${e} running=${n.running?1:0} runId=${s.runId??"(none)"}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"dispatch_completed",sessionKey:t,channel:r.channel,taskId:r.taskId,reason:e,running:n.running?1:0,runId:s.runId,queued:n.queue.length}))}catch(s){y(`[xmtp_prompt_user:queue] dispatch failed sessionKey=${t} channel=${r.channel} reason=${e}:`,s),I.error(h.PROMPT_USER_FAILED,s instanceof Error?s:new Error(String(s)),lt({checkpoint:"dispatch_failed",sessionKey:t,channel:r.channel,taskId:r.taskId,reason:e,queued:n.queue.length}))}finally{n.processing=!1}if(n.queue.length===0){y(`[xmtp_prompt_user:queue] queue drained sessionKey=${t}`);return}if(n.running){y(`[xmtp_prompt_user:queue] queue waiting sessionKey=${t} queued=${n.queue.length} running=1`),rd(t,n);return}y(`[xmtp_prompt_user:queue] queue continues sessionKey=${t} queued=${n.queue.length} running=0`),Pr(t,"session_idle")}function _D(t){return qt(t).running}async function hD(t){let e=t.target.sessionKey,n=qt(e);return n.queue.push({...t,deadlineAt:Date.now()+W_}),n.running||n.processing||n.queue.length>1?(n.queue.length===1&&rd(e,n),y(`[xmtp_prompt_user:queue] queued sessionKey=${e} channel=${t.channel} size=${n.queue.length}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"queued",sessionKey:e,channel:t.channel,taskId:t.taskId,queued:n.queue.length,running:n.running?1:0,processing:n.processing?1:0})),{status:"queued",size:n.queue.length}):(await Pr(e,"session_idle"),{status:"dispatched",size:n.queue.length})}function sd(t){let e=qt(t);e.running=!0;let n=e.queue[0];n&&(n.deadlineAt=Date.now()+W_,y(`[xmtp_prompt_user:queue] fallback reset sessionKey=${t} channel=${n.channel} queued=${e.queue.length}`),rd(t,e)),y(`[xmtp_prompt_user:queue] agent_start sessionKey=${t} queued=${e.queue.length}`)}function id(t){let e=qt(t),n=mD(t);if(n.length>0){y(`[xmtp_prompt_user:queue] agent_end sessionKey=${t} queued=${e.queue.length} pendingRunIds=${n.join(",")} waiting=run_final`);return}e.running=!1,y(`[xmtp_prompt_user:queue] agent_end sessionKey=${t} queued=${e.queue.length}`),e.queue.length>0&&Pr(t,"agent_end")}function mD(t){let e=[];for(let[n,r]of xr)r.sessionKey===t&&e.push(n);return e}function K_(t,e,n){Pi.set(t,{state:e,sessionKey:n,completedAt:Date.now()}),setTimeout(()=>{Pi.delete(t)},60*1e3)}function ED(t,e,n,r,s){let i=qt(t);i.running=!1,y(`[xmtp_prompt_user:queue] run completed sessionKey=${t} runId=${e} state=${n} durationMs=${r} queued=${i.queue.length}`),I.info(h.PROMPT_USER_CHECKPOINT,lt({checkpoint:"run_completed",sessionKey:t,taskId:s,runId:e,status:n,durationMs:r,queued:i.queue.length})),i.queue.length>0&&Pr(t,`run_${n}`)}function lt(t){return Object.entries({component:"openclaw_prompt_user_queue",operation:"xmtp_prompt_user",checkpoint:t.checkpoint,sessionKey:t.sessionKey,channel:t.channel??"",taskId:t.taskId??"",runId:t.runId??"",reason:t.reason??"",status:t.status??"",queued:t.queued??"",delayMs:t.delayMs??"",durationMs:t.durationMs??"",running:t.running??"",processing:t.processing??""}).filter(([,n])=>n!=="").reduce((n,[r,s])=>(n[r]=String(s),n),{})}var W_,Y_,xr,Pi,od=Te(()=>{"use strict";ee();Mi();Tn();re();W_=300*1e3,Y_=new Map,xr=new Map,Pi=new Map;F_(t=>{let e=t;if(e.event!=="chat"||!e.payload||typeof e.payload!="object")return;let n=e.payload,r=typeof n.runId=="string"?n.runId:"";if(!r)return;let s=typeof n.state=="string"?n.state:"",i=xr.get(r);if(!i){(s==="final"||s==="error")&&K_(r,s,String(n.sessionKey??""));return}y(`[xmtp_prompt_user:queue] observed chat event runId=${r} state=${s||"(none)"} sessionKey=${String(n.sessionKey??"")}`),!(s!=="final"&&s!=="error")&&(xr.delete(r),K_(r,s,String(n.sessionKey??"")),ED(i.sessionKey,r,s,Date.now()-i.startedAt,i.taskId))})});async function z_(t){let{channel:e,target:n,llmContent:r,userContent:s}=t,i=await wr({key:n.sessionKey,message:r});if(i.runId?t.onRunStarted?.(i.runId):y(`[xmtp_prompt_user:queue] sessions.send returned without runId sessionKey=${n.sessionKey} channel=${e}`),n.to&&!X_.has(e)){let o={to:n.to,message:s,channel:e,sessionKey:n.sessionKey,idempotencyKey:(0,Ui.randomUUID)()};return n.accountId&&(o.accountId=n.accountId),await Xe({method:"send",params:o}),{runId:i.runId}}return await kr({sessionKey:n.sessionKey,message:s}),{runId:i.runId}}async function Li(t){let e=Ni();if(e.size===0)return y("[okx-a2a:gateway-method] dispatch_user no deliverable user session found"),{ok:!1,dispatched:[],failed:[]};let n=[],r=[],s=t.label?`[${t.label}] ${t.content}`:t.content;for(let[i,o]of e)if(!ad.has(i))try{if(o.to&&!X_.has(i)){let a={to:o.to,message:s,channel:i,sessionKey:o.sessionKey,idempotencyKey:(0,Ui.randomUUID)()};o.accountId&&(a.accountId=o.accountId),await Xe({method:"send",params:a})}else await kr({sessionKey:o.sessionKey,message:t.content,label:t.label});n.push({channel:i,sessionKey:o.sessionKey}),y(`[okx-a2a:gateway-method] dispatch_user delivered channel=${i} sessionKey=${o.sessionKey}`)}catch(a){let c=a instanceof Error?a.message:String(a);r.push({channel:i,sessionKey:o.sessionKey,error:c}),y(`[okx-a2a:gateway-method] dispatch_user failed channel=${i} sessionKey=${o.sessionKey}: ${c}`),I.error(h.USER_DISPATCH_FAILED,a instanceof Error?a:new Error(String(a)),{source:"okx-a2a.dispatch_user",channel:i,sessionKey:o.sessionKey,hasTo:o.to?"1":"0"})}return{ok:n.length>0&&r.length===0,dispatched:n,failed:r}}async function qi(t){let{queuePromptUserAction:e}=await Promise.resolve().then(()=>(od(),V_)),n=Ni();if(n.size===0)return y("[okx-a2a:gateway-method] prompt_user no deliverable user session found"),{ok:!1,dispatched:[],failed:[]};let r=[],s=[];for(let[i,o]of n)if(!ad.has(i))try{let a=await e({channel:i,target:o,llmContent:t.llmContent,userContent:t.userContent});r.push({channel:i,sessionKey:o.sessionKey,status:a.status,size:a.size}),y(`[okx-a2a:gateway-method] prompt_user ${a.status} channel=${i} sessionKey=${o.sessionKey} size=${a.size}`)}catch(a){let c=a instanceof Error?a.message:String(a);s.push({channel:i,sessionKey:o.sessionKey,error:c}),y(`[okx-a2a:gateway-method] prompt_user failed channel=${i} sessionKey=${o.sessionKey}: ${c}`),I.error(h.PROMPT_USER_FAILED,a instanceof Error?a:new Error(String(a)),{source:"okx-a2a.prompt_user",channel:i,sessionKey:o.sessionKey})}return{ok:r.length>0&&s.length===0,dispatched:r,failed:s}}async function J_(t,e){let n=Ni();if(n.size===0)return y("[sendLlmToLatestUserSessions] no latest user session found"),{dispatched:[],failed:[]};let r=[],s=[];for(let[i,o]of n)if(!ad.has(i))try{await Je().subagent.run({sessionKey:o.sessionKey,message:t,deliver:!0,idempotencyKey:(0,Ui.randomUUID)()}),r.push(i),y(`[sendLlmToLatestUserSessions] sent to ${i} sessionKey=${o.sessionKey}`)}catch(a){s.push(i),y(`[sendLlmToLatestUserSessions] send to ${i} failed:`,a),I.error(h.USER_DISPATCH_FAILED,a instanceof Error?a:new Error(String(a)),{source:e?.source??"sendLlmToLatestUserSessions",channel:i,sessionKey:o.sessionKey})}return{dispatched:r,failed:s}}var Ui,ad,X_,Mi=Te(()=>{"use strict";ee();Ui=require("node:crypto");Tn();Nr();re();vn();ad=new Set(["heartbeat","cron","webhook","voice"]),X_=new Set(["webchat","tui"])});var VD={};fd(VD,{default:()=>WD});module.exports=Fh(VD);ee();vn();ee();re();var zO="main",y_={id:"okx-a2a",meta:{id:"okx-a2a",label:"OKX A2A",selectionLabel:"OKX A2A",docsPath:"channels/okx-a2a",blurb:"E2E encrypted communication (wallet-to-agent)",order:101},capabilities:{chatTypes:["group"],media:!1,reply:!0},reload:{configPrefixes:["channels.okx-a2a"]},config:{resolveAccount:async()=>({}),listAccountIds:()=>[zO]},outbound:{deliveryMode:"direct"},gateway:{startAccount:async t=>{t.setStatus({accountId:t.accountId,connected:!0,lastConnectedAt:Date.now(),lastEventAt:Date.now()}),y(`[okx-a2a:${t.accountId}] startAccount activated`),await new Promise(e=>{t.abortSignal.addEventListener("abort",()=>e(),{once:!0})}),y(`[okx-a2a:${t.accountId}] received abort signal, cleaning up...`)},stopAccount:async()=>{y("[okx-a2a] stopAccount"),await E_()}}};ee();Tn();Nr();re();var H_=async t=>{let e=N_(t),n=[];for(let r of e)await j_({key:r,...t.deleteTranscript!==void 0?{deleteTranscript:t.deleteTranscript}:{}}),n.push(r),y(`[okx-a2a] session deleted: ${r}`),I.info(h.SESSION_DELETED,{sessionKey:r,...Dr({sessionKey:r})});return{ok:!0,deleted:n.length,deletedSessionKeys:n,matched:e.length}};Tn();Nr();Mi();od();ee();var Q_=require("node:os"),cd=require("node:path"),Z_=require("node:fs");Tn();Mi();re();var yD=15e3,SD=50;function TD(t=process.env){return t.OKX_AGENT_TASK_HOME?.trim()||(0,cd.join)((0,Q_.homedir)(),".okx-agent-task")}function bD(t=process.env){return t.OKX_A2A_OUTBOX_DB_PATH?.trim()||(0,cd.join)(TD(t),"sqlite","session-store.sqlite")}function ID(){let t=process.emitWarning;process.emitWarning=((e,...n)=>{if(!((typeof e=="string"?e:e.message).includes("SQLite is an experimental feature")&&n.some(s=>s==="ExperimentalWarning")))return t.call(process,e,...n)});try{return require("node:sqlite")}finally{process.emitWarning=t}}async function AD(t){let e=t.message_id??void 0;if(t.kind==="dispatch_user_latest"){let n=await Li({content:t.content});if(!n.ok)throw new Error(`dispatch_user_latest delivered=${n.dispatched.length} failed=${n.failed.length}`);return}if(t.kind==="prompt_user_latest"){if(!t.llm_content)throw new Error("prompt_user_latest missing llm_content");let n=await qi({userContent:t.content,llmContent:t.llm_content});if(!n.ok)throw new Error(`prompt_user_latest delivered=${n.dispatched.length} failed=${n.failed.length}`);return}if(t.kind==="chat_inject"){await kr({sessionKey:t.session_key,message:t.content}),t.llm_content&&await wr({key:t.session_key,message:t.llm_content,idempotencyKey:e});return}await wr({key:t.session_key,message:t.content,idempotencyKey:e})}async function vD(t={}){let e=t.dbPath??bD();if(!(0,Z_.existsSync)(e))return{delivered:0,failed:0,skipped:!0};let{DatabaseSync:n}=ID(),r=new n(e);try{if(r.exec("PRAGMA busy_timeout=5000"),r.exec("PRAGMA journal_mode=WAL"),!r.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='pending_gateway_deliveries'").get())return{delivered:0,failed:0,skipped:!0};let i=r.prepare(`
27
+ `)===-1){Rr("have not received end of HTTP headers yet..."),o();return}let m=p.toString("ascii",0,p.indexOf(`\r
28
+ `)),E=+m.split(" ")[1];Rr("got proxy server response: %o",m),t({statusCode:E,buffered:p})}e.on("error",u),e.on("close",a),e.on("end",c),o()})}vr.default=Rv});var Ug=g(Nt=>{"use strict";var vv=Nt&&Nt.__awaiter||function(e,t,n,r){function s(o){return o instanceof n?o:new n(function(i){i(o)})}return new(n||(n=Promise))(function(o,i){function a(d){try{u(r.next(d))}catch(l){i(l)}}function c(d){try{u(r.throw(d))}catch(l){i(l)}}function u(d){d.done?o(d.value):s(d.value).then(a,c)}u((r=r.apply(e,t||[])).next())})},gn=Nt&&Nt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Nt,"__esModule",{value:!0});var xg=gn(require("net")),Pg=gn(require("tls")),Ov=gn(require("url")),Cv=gn(require("assert")),Dv=gn(ao()),Nv=wg(),wv=gn(kg()),Or=Dv.default("https-proxy-agent:agent"),ou=class extends Nv.Agent{constructor(t){let n;if(typeof t=="string"?n=Ov.default.parse(t):n=t,!n)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");Or("creating new HttpsProxyAgent instance: %o",n),super(n);let r=Object.assign({},n);this.secureProxy=n.secureProxy||Pv(r.protocol),r.host=r.hostname||r.host,typeof r.port=="string"&&(r.port=parseInt(r.port,10)),!r.port&&r.host&&(r.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in r)&&(r.ALPNProtocols=["http 1.1"]),r.host&&r.path&&(delete r.path,delete r.pathname),this.proxy=r}callback(t,n){return vv(this,void 0,void 0,function*(){let{proxy:r,secureProxy:s}=this,o;s?(Or("Creating `tls.Socket`: %o",r),o=Pg.default.connect(r)):(Or("Creating `net.Socket`: %o",r),o=xg.default.connect(r));let i=Object.assign({},r.headers),c=`CONNECT ${`${n.host}:${n.port}`} HTTP/1.1\r
29
+ `;r.auth&&(i["Proxy-Authorization"]=`Basic ${Buffer.from(r.auth).toString("base64")}`);let{host:u,port:d,secureEndpoint:l}=n;xv(d,l)||(u+=`:${d}`),i.Host=u,i.Connection="close";for(let I of Object.keys(i))c+=`${I}: ${i[I]}\r
30
+ `;let p=wv.default(o);o.write(`${c}\r
31
+ `);let{statusCode:f,buffered:m}=yield p;if(f===200){if(t.once("socket",kv),n.secureEndpoint){Or("Upgrading socket connection to TLS");let I=n.servername||n.host;return Pg.default.connect(Object.assign(Object.assign({},Uv(n,"host","hostname","path","port")),{socket:o,servername:I}))}return o}o.destroy();let E=new xg.default.Socket({writable:!1});return E.readable=!0,t.once("socket",I=>{Or("replaying proxy buffer for failed request"),Cv.default(I.listenerCount("data")>0),I.push(m),I.push(null)}),E})}};Nt.default=ou;function kv(e){e.resume()}function xv(e,t){return!!(!t&&e===80||t&&e===443)}function Pv(e){return typeof e=="string"?/^https:?$/i.test(e):!1}function Uv(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}});var Lg=g((cu,Mg)=>{"use strict";var Mv=cu&&cu.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},iu=Mv(Ug());function au(e){return new iu.default(e)}(function(e){e.HttpsProxyAgent=iu.default,e.prototype=iu.default.prototype})(au||(au={}));Mg.exports=au});var lu=g(du=>{var{_nullishCoalesce:uu}=k();Object.defineProperty(du,"__esModule",{value:!0});var qg=N(),Lv=require("http"),qv=require("https"),Fv=Lg(),Gv=require("stream"),Fg=require("url"),Bv=require("zlib"),jv=1024*32;function $v(e){return new Gv.Readable({read(){this.push(e),this.push(null)}})}function Hv(e){let t;try{t=new Fg.URL(e.url)}catch{return console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used."),qg.createTransport(e,()=>Promise.resolve({}))}let n=t.protocol==="https:",r=Yv(t,e.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),s=n?qv:Lv,o=e.keepAlive===void 0?!1:e.keepAlive,i=r?new Fv.HttpsProxyAgent(r):new s.Agent({keepAlive:o,maxSockets:30,timeout:2e3}),a=Kv(e,uu(e.httpModule,()=>s),i);return qg.createTransport(e,a)}function Yv(e,t){let{no_proxy:n}=process.env;if(!(n&&n.split(",").some(s=>e.host.endsWith(s)||e.hostname.endsWith(s))))return t}function Kv(e,t,n){let{hostname:r,pathname:s,port:o,protocol:i,search:a}=new Fg.URL(e.url);return function(u){return new Promise((d,l)=>{let p=$v(u.body),f={...e.headers};u.body.length>jv&&(f["content-encoding"]="gzip",p=p.pipe(Bv.createGzip()));let m=t.request({method:"POST",agent:n,headers:f,hostname:r,path:`${s}${a}`,port:o,protocol:i,ca:e.caCerts},E=>{E.on("data",()=>{}),E.on("end",()=>{}),E.setEncoding("utf8");let I=uu(E.headers["retry-after"],()=>null),R=uu(E.headers["x-sentry-rate-limits"],()=>null);d({statusCode:E.statusCode,headers:{"retry-after":I,"x-sentry-rate-limits":Array.isArray(R)?R[0]:R}})});m.on("error",l),p.pipe(m)})}}du.makeNodeTransport=Hv});var uo=g(pu=>{Object.defineProperty(pu,"__esModule",{value:!0});var Gg=require("path"),Wv=Gg.sep==="\\";function Vv(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function zv(e,t=Wv){if(!e)return;let n=t?Vv(e):e,{root:r,dir:s,base:o,ext:i}=Gg.posix.parse(n),c=`${require&&require.main&&require.main.filename&&s||global.process.cwd()}/`,u=o;(i===".js"||i===".mjs"||i===".cjs")&&(u=u.slice(0,i.length*-1)),!r&&!s&&(s=".");let d=s.lastIndexOf("/node_modules/");if(d>-1)return`${s.slice(d+14).replace(/\//g,".")}:${u}`;if(d=`${s}/`.lastIndexOf(c,0),d===0){let l=s.slice(c.length).replace(/\//g,".");return l&&(l+=":"),l+=u,l}return u}pu.getModuleFromFilename=zv});var jg=g(hu=>{Object.defineProperty(hu,"__esModule",{value:!0});var _u=require("crypto"),Xv=require("events"),Jv=require("http"),Qv=require("url"),lo={CONTINUATION:0,TEXT:1,BINARY:2,TERMINATE:8,PING:9,PONG:10},Zv="258EAFA5-E914-47DA-95CA-C5AB0DC85B11";function Bg(e){return Buffer.byteLength(e.payload)>=e.payloadLength}function fu(e,t,n){if(t===void 0)return e;for(let r=0;r<e.length;r++)e[r]^=t[n+r&3];return e}function eO(e){let{opcode:t,fin:n,data:r}=e,s=6,o=r.length;o>=65536?(s+=8,o=127):o>125&&(s+=2,o=126);let i=Buffer.allocUnsafe(s);i[0]=n?t|128:t,i[1]=o,o===126?i.writeUInt16BE(r.length,2):o===127&&(i.writeUInt32BE(0,2),i.writeUInt32BE(r.length,6));let a=_u.randomBytes(4);i[1]|=128,i[s-4]=a[0],i[s-3]=a[1],i[s-2]=a[2],i[s-1]=a[3];let c=Buffer.alloc(o);for(let u=0;u<o;++u)c[u]=r[u]^a[u&3];return Buffer.concat([i,c])}function tO(e){let t=e.readUInt8(0),n=!!(t>>>7&1),r=t&15,s=e.readUInt8(1),o=!!(s>>>7&1),i=2,a=s&127;if(a>125)if(a===126)a=e.readUInt16BE(i),i+=2;else if(a===127){let d=e.readUInt32BE(i);if(i+=4,d>=Number.MAX_SAFE_INTEGER)throw new Error("Unsupported WebSocket frame: payload length > 2^53 - 1");let l=e.readUInt32BE(i);i+=4,a=d*Math.pow(2,32)+l}else throw new Error("Unknown payload length");let c;o&&(c=e.slice(i,i+4),i+=4);let u=fu(e.slice(i),c,0);return{fin:n,opcode:r,mask:c,payload:u,payloadLength:a}}function nO(e){return _u.createHash("sha1").update(`${e}${Zv}`).digest("base64")}var gu=class extends Xv.EventEmitter{constructor(t){super(),this._unfinishedFrame=void 0,this._incompleteFrame=void 0,this._socket=t,this._alive=!0,t.on("data",n=>{this._addBuffer(n)}),t.on("error",n=>{n.code==="ECONNRESET"?this.emit("close"):this.emit("error")}),t.on("close",()=>{this.end()})}end(){this._alive&&(this._alive=!1,this.emit("close"),this._socket.end())}send(t){this._sendFrame({opcode:lo.TEXT,fin:!0,data:Buffer.from(t)})}_sendFrame(t){this._socket.write(eO(t))}_completeFrame(t){let{_unfinishedFrame:n}=this;if(n!==void 0)if(t.opcode===lo.CONTINUATION){n.payload=Buffer.concat([n.payload,fu(t.payload,n.mask,n.payload.length)]),t.fin&&(this._unfinishedFrame=void 0,this._completeFrame(n));return}else this._unfinishedFrame=void 0;if(t.fin)if(t.opcode===lo.PING)this._sendFrame({opcode:lo.PONG,fin:!0,data:t.payload});else{let r;t.payload.length>t.payloadLength&&(r=t.payload.slice(t.payloadLength),t.payload=t.payload.slice(0,t.payloadLength)),this.emit("message",t.payload),r!==void 0&&this._addBuffer(r)}else this._unfinishedFrame=t}_addBufferToIncompleteFrame(t,n){t.payload=Buffer.concat([t.payload,fu(n,t.mask,t.payload.length)]),Bg(t)&&(this._incompleteFrame=void 0,this._completeFrame(t))}_addBuffer(t){let{_incompleteFrame:n}=this;if(n!==void 0){this._addBufferToIncompleteFrame(n,t);return}let r=tO(t);Bg(r)?this._completeFrame(r):this._incompleteFrame=r}};async function rO(e){let t=Qv.parse(e);return new Promise((n,r)=>{let s=_u.randomBytes(16).toString("base64"),o=nO(s),i=Jv.request({hostname:t.hostname,port:t.port,path:t.path,method:"GET",headers:{Connection:"Upgrade",Upgrade:"websocket","Sec-WebSocket-Key":s,"Sec-WebSocket-Version":"13"}});i.on("response",a=>{a.statusCode&&a.statusCode>=400&&process.stderr.write(`Unexpected HTTP code: ${a.statusCode}
32
+ `),a.pipe(process.stderr)}),i.on("upgrade",(a,c)=>{if(a.headers["sec-websocket-accept"]!==o){c.end(),r(new Error(`Digest mismatch ${o} !== ${a.headers["sec-websocket-accept"]}`));return}let u=new gu(c);n(u)}),i.on("error",a=>{r(a)}),i.end()})}hu.createWebSocketClient=rO});var $g=g(mu=>{Object.defineProperty(mu,"__esModule",{value:!0});var sO=T(),oO=uo(),iO=jg();async function aO(e,t){let n=0,r=await iO.createWebSocketClient(e);return r.on("message",s=>{let o=JSON.parse(s.toString());t(o)}),s=>{r.send(JSON.stringify({id:n++,method:s}))}}async function cO(e,t){let n=await aO(e,sO.createDebugPauseMessageHandler(r=>n(r),oO.getModuleFromFilename,t));return()=>{n("Debugger.enable"),n("Debugger.pause")}}mu.captureStackTrace=cO});var yu=g(fo=>{Object.defineProperty(fo,"__esModule",{value:!0});var po=T(),uO=require("child_process"),dO=$g(),Eu=N(),lO=50,pO=5e3;function Hg(e,t){let n={level:"error",exception:{values:[{type:"ApplicationNotResponding",value:`Application Not Responding for at least ${e} ms`,stacktrace:{frames:t},mechanism:{type:"ANR"}}]}};Eu.captureEvent(n),Eu.flush(3e3).then(()=>{process.exit()})}function fO(e=9229){let t=require("inspector"),n,r=e;for(;n===void 0&&r<e+100;)t.open(r),n=t.url(),r++;return n}function gO(e){function t(n,...r){po.logger.log(`[ANR] ${n}`,...r)}try{let n={...process.env};n.SENTRY_ANR_CHILD_PROCESS="true",e.captureStackTrace&&(n.SENTRY_INSPECT_URL=fO()),t(`Spawning child process with execPath:'${process.execPath}' and entryScript'${e.entryScript}'`);let r=uO.spawn(process.execPath,[e.entryScript],{env:n,stdio:po.logger.isEnabled()?["inherit","inherit","inherit","ipc"]:["ignore","ignore","ignore","ipc"]});r.unref();let s=setInterval(()=>{try{r.send("ping")}catch{}},e.pollInterval),o=i=>(...a)=>{clearInterval(s),t(`Child process ${i}`,...a)};r.on("error",o("error")),r.on("disconnect",o("disconnect")),r.on("exit",o("exit"))}catch(n){t("Failed to start child process",n)}}function _O(){let e=process.hrtime();return{getTimeMs:()=>{let[t,n]=process.hrtime(e);return Math.floor(t*1e3+n/1e6)},reset:()=>{e=process.hrtime()}}}function hO(e){function t(o){po.logger.log(`[ANR child process] ${o}`)}process.title="sentry-anr",t("Started"),Eu.addGlobalEventProcessor(o=>(delete o.sdkProcessingMetadata,o.tags={...o.tags,"process.name":"ANR"},o));let n;process.env.SENTRY_INSPECT_URL&&(t("Connecting to debugger"),n=dO.captureStackTrace(process.env.SENTRY_INSPECT_URL,o=>{t("Capturing event with stack frames"),Hg(e.anrThreshold,o)}));async function r(){t("Watchdog timeout");let o=await n;o?(t("Pausing debugger to capture stack trace"),o()):(t("Capturing event"),Hg(e.anrThreshold))}let{poll:s}=po.watchdogTimer(_O,e.pollInterval,e.anrThreshold,r);process.on("message",()=>{s()})}function Yg(){return!!process.send&&!!process.env.SENTRY_ANR_CHILD_PROCESS}function mO(e){let n={entryScript:e.entryScript||process.env.pm_exec_path||process.argv[1],pollInterval:e.pollInterval||lO,anrThreshold:e.anrThreshold||pO,captureStackTrace:!!e.captureStackTrace,debug:!!e.debug};return Yg()?(hO(n),new Promise(()=>{})):(gO(n),Promise.resolve())}fo.enableAnrDetection=mO;fo.isAnrChildProcess=Yg});var _n=g(Su=>{Object.defineProperty(Su,"__esModule",{value:!0});var EO=T(),yO=EO.parseSemver(process.versions.node);Su.NODE_VERSION=yO});var Vg=g(Tu=>{var{_optionalChain:SO}=k();Object.defineProperty(Tu,"__esModule",{value:!0});var wt=N(),Kg=require("domain");function Wg(){return Kg.active}function TO(){let e=Wg();if(e)return wt.ensureHubOnCarrier(e),wt.getHubFromCarrier(e)}function bO(e){let t={};return wt.ensureHubOnCarrier(t,e),wt.getHubFromCarrier(t)}function IO(e,t){let n=Wg();if(n&&SO([t,"optionalAccess",i=>i.reuseExisting]))return e();let r=Kg.create(),s=n?wt.getHubFromCarrier(n):void 0,o=bO(s);return wt.setHubOnCarrier(r,o),r.bind(()=>e())()}function AO(){wt.setAsyncContextStrategy({getCurrentHub:TO,runWithAsyncContext:IO})}Tu.setDomainAsyncContextStrategy=AO});var zg=g(Iu=>{var{_optionalChain:RO}=k();Object.defineProperty(Iu,"__esModule",{value:!0});var bu=N(),vO=require("async_hooks"),go;function OO(){go||(go=new vO.AsyncLocalStorage);function e(){return go.getStore()}function t(r){let s={};return bu.ensureHubOnCarrier(s,r),bu.getHubFromCarrier(s)}function n(r,s){let o=e();if(o&&RO([s,"optionalAccess",a=>a.reuseExisting]))return r();let i=t(o);return go.run(i,()=>r())}bu.setAsyncContextStrategy({getCurrentHub:e,runWithAsyncContext:n})}Iu.setHooksAsyncContextStrategy=OO});var Jg=g(Au=>{Object.defineProperty(Au,"__esModule",{value:!0});var Xg=_n(),CO=Vg(),DO=zg();function NO(){Xg.NODE_VERSION.major&&Xg.NODE_VERSION.major>=14?DO.setHooksAsyncContextStrategy():CO.setDomainAsyncContextStrategy()}Au.setNodeAsyncContextStrategy=NO});var vu=g(Ru=>{Object.defineProperty(Ru,"__esModule",{value:!0});var wO=N(),Qg=T(),kO=require("util"),_o=class e{constructor(){e.prototype.__init.call(this)}static __initStatic(){this.id="Console"}__init(){this.name=e.id}setupOnce(){Qg.addInstrumentationHandler("console",({args:t,level:n})=>{let r=wO.getCurrentHub();r.getIntegration(e)&&r.addBreadcrumb({category:"console",level:Qg.severityLevelFromString(n),message:kO.format.apply(void 0,t)},{input:[...t],level:n})})}};_o.__initStatic();Ru.Console=_o});var Cr=g(ho=>{(function(e,t){let n=typeof ho=="object"?ho:typeof e=="object"?e:{};t(n),typeof define=="function"&&define.amd&&define("lru",n)})(ho,function(e){let t=Symbol("newer"),n=Symbol("older");function r(c,u){typeof c!="number"&&(u=c,c=0),this.size=0,this.limit=c,this.oldest=this.newest=void 0,this._keymap=new Map,u&&(this.assign(u),c<1&&(this.limit=this.size))}e.LRUMap=r;function s(c,u){this.key=c,this.value=u,this[t]=void 0,this[n]=void 0}r.prototype._markEntryAsUsed=function(c){c!==this.newest&&(c[t]&&(c===this.oldest&&(this.oldest=c[t]),c[t][n]=c[n]),c[n]&&(c[n][t]=c[t]),c[t]=void 0,c[n]=this.newest,this.newest&&(this.newest[t]=c),this.newest=c)},r.prototype.assign=function(c){let u,d=this.limit||Number.MAX_VALUE;this._keymap.clear();let l=c[Symbol.iterator]();for(let p=l.next();!p.done;p=l.next()){let f=new s(p.value[0],p.value[1]);if(this._keymap.set(f.key,f),u?(u[t]=f,f[n]=u):this.oldest=f,u=f,d--==0)throw new Error("overflow")}this.newest=u,this.size=this._keymap.size},r.prototype.get=function(c){var u=this._keymap.get(c);if(u)return this._markEntryAsUsed(u),u.value},r.prototype.set=function(c,u){var d=this._keymap.get(c);return d?(d.value=u,this._markEntryAsUsed(d),this):(this._keymap.set(c,d=new s(c,u)),this.newest?(this.newest[t]=d,d[n]=this.newest):this.oldest=d,this.newest=d,++this.size,this.size>this.limit&&this.shift(),this)},r.prototype.shift=function(){var c=this.oldest;if(c)return this.oldest[t]?(this.oldest=this.oldest[t],this.oldest[n]=void 0):(this.oldest=void 0,this.newest=void 0),c[t]=c[n]=void 0,this._keymap.delete(c.key),--this.size,[c.key,c.value]},r.prototype.find=function(c){let u=this._keymap.get(c);return u?u.value:void 0},r.prototype.has=function(c){return this._keymap.has(c)},r.prototype.delete=function(c){var u=this._keymap.get(c);if(u)return this._keymap.delete(u.key),u[t]&&u[n]?(u[n][t]=u[t],u[t][n]=u[n]):u[t]?(u[t][n]=void 0,this.oldest=u[t]):u[n]?(u[n][t]=void 0,this.newest=u[n]):this.oldest=this.newest=void 0,this.size--,u.value},r.prototype.clear=function(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()};function o(c){this.entry=c}o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){let c=this.entry;return c?(this.entry=c[t],{done:!1,value:[c.key,c.value]}):{done:!0,value:void 0}};function i(c){this.entry=c}i.prototype[Symbol.iterator]=function(){return this},i.prototype.next=function(){let c=this.entry;return c?(this.entry=c[t],{done:!1,value:c.key}):{done:!0,value:void 0}};function a(c){this.entry=c}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let c=this.entry;return c?(this.entry=c[t],{done:!1,value:c.value}):{done:!0,value:void 0}},r.prototype.keys=function(){return new i(this.oldest)},r.prototype.values=function(){return new a(this.oldest)},r.prototype.entries=function(){return this},r.prototype[Symbol.iterator]=function(){return new o(this.oldest)},r.prototype.forEach=function(c,u){typeof u!="object"&&(u=this);let d=this.oldest;for(;d;)c.call(u,d.value,d.key,this),d=d[t]},r.prototype.toJSON=function(){for(var c=new Array(this.size),u=0,d=this.oldest;d;)c[u++]={key:d.key,value:d.value},d=d[t];return c},r.prototype.toString=function(){for(var c="",u=this.oldest;u;)c+=String(u.key)+":"+u.value,u=u[t],u&&(c+=" < ");return c}})});var n_=g(kt=>{var{_optionalChain:we}=k();Object.defineProperty(kt,"__esModule",{value:!0});var Ou=require("url"),Zg=_n();function xO(e){let{protocol:t,hostname:n,port:r}=t_(e),s=e.path?e.path:"/";return`${t}//${n}${r}${s}`}function e_(e){let{protocol:t,hostname:n,port:r}=t_(e),s=e.pathname||"/",o=e.auth?PO(e.auth):"";return`${t}//${o}${n}${r}${s}`}function PO(e){let[t,n]=e.split(":");return`${t?"[Filtered]":""}:${n?"[Filtered]":""}@`}function UO(e,t,n){if(!e)return e;let[r,s]=e.split(" ");return t.host&&!t.protocol&&(t.protocol=we([n,"optionalAccess",o=>o.agent,"optionalAccess",o=>o.protocol]),s=e_(t)),we([s,"optionalAccess",o=>o.startsWith,"call",o=>o("///")])&&(s=s.slice(2)),`${r} ${s}`}function Cu(e){let t={protocol:e.protocol,hostname:typeof e.hostname=="string"&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,hash:e.hash,search:e.search,pathname:e.pathname,path:`${e.pathname||""}${e.search||""}`,href:e.href};return e.port!==""&&(t.port=Number(e.port)),(e.username||e.password)&&(t.auth=`${e.username}:${e.password}`),t}function MO(e,t){let n,r;if(typeof t[t.length-1]=="function"&&(n=t.pop()),typeof t[0]=="string")r=Cu(new Ou.URL(t[0]));else if(t[0]instanceof Ou.URL)r=Cu(t[0]);else{r=t[0];try{let s=new Ou.URL(r.path||"",`${r.protocol||"http:"}//${r.hostname}`);r={pathname:s.pathname,search:s.search,hash:s.hash,...r}}catch{}}return t.length===2&&(r={...r,...t[1]}),r.protocol===void 0&&(Zg.NODE_VERSION.major&&Zg.NODE_VERSION.major>8?r.protocol=we([we([e,"optionalAccess",s=>s.globalAgent]),"optionalAccess",s=>s.protocol])||we([r.agent,"optionalAccess",s=>s.protocol])||we([r._defaultAgent,"optionalAccess",s=>s.protocol]):r.protocol=we([r.agent,"optionalAccess",s=>s.protocol])||we([r._defaultAgent,"optionalAccess",s=>s.protocol])||we([we([e,"optionalAccess",s=>s.globalAgent]),"optionalAccess",s=>s.protocol])),n?[r,n]:[r]}function t_(e){let t=e.protocol||"",n=e.hostname||e.host||"",r=!e.port||e.port===80||e.port===443||/^(.*):(\d+)$/.test(n)?"":`:${e.port}`;return{protocol:t,hostname:n,port:r}}kt.cleanSpanDescription=UO;kt.extractRawUrl=xO;kt.extractUrl=e_;kt.normalizeRequestArgs=MO;kt.urlToOptions=Cu});var Nu=g(Du=>{var{_optionalChain:xt}=k();Object.defineProperty(Du,"__esModule",{value:!0});var hn=N(),ke=T(),r_=Cr(),s_=_n(),Dr=n_(),Nr=class e{static __initStatic(){this.id="Http"}__init(){this.name=e.id}constructor(t={}){e.prototype.__init.call(this),this._breadcrumbs=typeof t.breadcrumbs>"u"?!0:t.breadcrumbs,this._tracing=t.tracing?t.tracing===!0?{}:t.tracing:void 0}setupOnce(t,n){if(!this._breadcrumbs&&!this._tracing)return;let r=xt([n,"call",c=>c(),"access",c=>c.getClient,"call",c=>c(),"optionalAccess",c=>c.getOptions,"call",c=>c()]);if(r&&r.instrumenter!=="sentry"){(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ke.logger.log("HTTP Integration is skipped because of instrumenter configuration.");return}let s=xt([this,"access",c=>c._tracing,"optionalAccess",c=>c.shouldCreateSpanForRequest])||xt([r,"optionalAccess",c=>c.shouldCreateSpanForRequest]),o=xt([r,"optionalAccess",c=>c.tracePropagationTargets])||xt([this,"access",c=>c._tracing,"optionalAccess",c=>c.tracePropagationTargets]),i=require("http"),a=o_(i,this._breadcrumbs,s,o);if(ke.fill(i,"get",a),ke.fill(i,"request",a),s_.NODE_VERSION.major&&s_.NODE_VERSION.major>8){let c=require("https"),u=o_(c,this._breadcrumbs,s,o);ke.fill(c,"get",u),ke.fill(c,"request",u)}}};Nr.__initStatic();function o_(e,t,n,r){let s=new r_.LRUMap(100),o=new r_.LRUMap(100),i=u=>{if(n===void 0)return!0;let d=s.get(u);if(d!==void 0)return d;let l=n(u);return s.set(u,l),l},a=u=>{if(r===void 0)return!0;let d=o.get(u);if(d!==void 0)return d;let l=ke.stringMatchesSomePattern(u,r);return o.set(u,l),l};function c(u,d,l,p){hn.getCurrentHub().getIntegration(Nr)&&hn.getCurrentHub().addBreadcrumb({category:"http",data:{status_code:p&&p.statusCode,...d},type:"http"},{event:u,request:l,response:p})}return function(d){return function(...p){let f=Dr.normalizeRequestArgs(e,p),m=f[0],E=Dr.extractRawUrl(m),I=Dr.extractUrl(m);if(hn.isSentryRequestUrl(I,hn.getCurrentHub()))return d.apply(e,f);let R=hn.getCurrentHub(),L=R.getScope(),ie=L.getSpan(),ae=LO(I,m),J=i(E)?xt([ie,"optionalAccess",x=>x.startChild,"call",x=>x({op:"http.client",origin:"auto.http.node.http",description:`${ae["http.method"]} ${ae.url}`,data:ae})]):void 0;if(a(E))if(J){let x=J.toTraceparent(),Le=xt([J,"optionalAccess",be=>be.transaction,"optionalAccess",be=>be.getDynamicSamplingContext,"call",be=>be()]);i_(m,I,x,Le)}else{let x=R.getClient(),{traceId:Le,sampled:be,dsc:ii}=L.getPropagationContext(),Am=ke.generateSentryTraceHeader(Le,void 0,be),Rm=ii||(x?hn.getDynamicSamplingContextFromClient(Le,x,L):void 0);i_(m,I,Am,Rm)}else(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ke.logger.log(`[Tracing] Not adding sentry-trace header to outgoing request (${I}) due to mismatching tracePropagationTargets option.`);return d.apply(e,f).once("response",function(x){let Le=this;t&&c("response",ae,Le,x),J&&(x.statusCode&&J.setHttpStatus(x.statusCode),J.description=Dr.cleanSpanDescription(J.description,m,Le),J.finish())}).once("error",function(){let x=this;t&&c("error",ae,x),J&&(J.setHttpStatus(500),J.description=Dr.cleanSpanDescription(J.description,m,x),J.finish())})}}}function i_(e,t,n,r){if((e.headers||{})["sentry-trace"])return;(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&ke.logger.log(`[Tracing] Adding sentry-trace header ${n} to outgoing request to "${t}": `);let o=ke.dynamicSamplingContextToSentryBaggageHeader(r),i=o&&o.length>0?qO(e,o):void 0;e.headers={...e.headers,"sentry-trace":n,...i&&{baggage:i}}}function LO(e,t){let n=t.method||"GET",r={url:e,"http.method":n};return t.hash&&(r["http.fragment"]=t.hash.substring(1)),t.search&&(r["http.query"]=t.search.substring(1)),r}function qO(e,t){if(!e.headers||!e.headers.baggage)return t;if(t){if(Array.isArray(e.headers.baggage))return[...e.headers.baggage,t]}else return e.headers.baggage;return[e.headers.baggage,t]}Du.Http=Nr});var xu=g(ku=>{Object.defineProperty(ku,"__esModule",{value:!0});var FO=N(),wu=T(),GO=2e3;function BO(e){console.error(e);let t=FO.getCurrentHub().getClient();t===void 0&&((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&wu.logger.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1));let n=t.getOptions(),r=n&&n.shutdownTimeout&&n.shutdownTimeout>0&&n.shutdownTimeout||GO;t.close(r).then(s=>{s||(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&wu.logger.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},s=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&wu.logger.error(s)})}ku.logAndExitProcess=BO});var Uu=g(Pu=>{Object.defineProperty(Pu,"__esModule",{value:!0});var a_=N(),jO=T(),c_=xu(),mo=class e{static __initStatic(){this.id="OnUncaughtException"}__init(){this.name=e.id}__init2(){this.handler=this._makeErrorHandler()}constructor(t={}){e.prototype.__init.call(this),e.prototype.__init2.call(this),this._options={exitEvenIfOtherHandlersAreRegistered:!0,...t}}setupOnce(){global.process.on("uncaughtException",this.handler)}_makeErrorHandler(){let n=!1,r=!1,s=!1,o;return i=>{let a=c_.logAndExitProcess,c=a_.getCurrentHub().getClient();this._options.onFatalError?a=this._options.onFatalError:c&&c.getOptions().onFatalError&&(a=c.getOptions().onFatalError);let d=global.process.listeners("uncaughtException").reduce((p,f)=>f.name==="domainUncaughtExceptionClear"||f.tag&&f.tag==="sentry_tracingErrorCallback"||f===this.handler?p:p+1,0)===0,l=this._options.exitEvenIfOtherHandlersAreRegistered||d;if(n)l&&(s?((typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&jO.logger.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),c_.logAndExitProcess(i)):r||(r=!0,setTimeout(()=>{s||(s=!0,a(o,i))},2e3)));else{let p=a_.getCurrentHub();o=i,n=!0,p.getIntegration(e)?p.withScope(f=>{f.setLevel("fatal"),p.captureException(i,{originalException:i,data:{mechanism:{handled:!1,type:"onuncaughtexception"}}}),!s&&l&&(s=!0,a(i))}):!s&&l&&(s=!0,a(i))}}}};mo.__initStatic();Pu.OnUncaughtException=mo});var Lu=g(Mu=>{Object.defineProperty(Mu,"__esModule",{value:!0});var $O=N(),u_=T(),HO=xu(),Eo=class e{static __initStatic(){this.id="OnUnhandledRejection"}__init(){this.name=e.id}constructor(t={mode:"warn"}){this._options=t,e.prototype.__init.call(this)}setupOnce(){global.process.on("unhandledRejection",this.sendUnhandledPromise.bind(this))}sendUnhandledPromise(t,n){let r=$O.getCurrentHub();r.getIntegration(e)&&r.withScope(s=>{s.setExtra("unhandledPromiseRejection",!0),r.captureException(t,{originalException:n,data:{mechanism:{handled:!1,type:"onunhandledrejection"}}})}),this._handleRejection(t)}_handleRejection(t){let n="This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:";this._options.mode==="warn"?u_.consoleSandbox(()=>{console.warn(n),console.error(t&&t.stack?t.stack:t)}):this._options.mode==="strict"&&(u_.consoleSandbox(()=>{console.warn(n)}),HO.logAndExitProcess(t))}};Eo.__initStatic();Mu.OnUnhandledRejection=Eo});var Fu=g(qu=>{Object.defineProperty(qu,"__esModule",{value:!0});var d_=T(),YO="cause",KO=5,yo=class e{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=e.id}constructor(t={}){e.prototype.__init.call(this),this._key=t.key||YO,this._limit=t.limit||KO}setupOnce(){}preprocessEvent(t,n,r){let s=r.getOptions();d_.applyAggregateErrorsToEvent(d_.exceptionFromError,s.stackParser,s.maxValueLength,this._key,this._limit,t,n)}};yo.__initStatic();qu.LinkedErrors=yo});var ju=g(Bu=>{Object.defineProperty(Bu,"__esModule",{value:!0});var l_=require("fs"),p_=require("path"),Gu;function WO(){try{return require.cache?Object.keys(require.cache):[]}catch{return[]}}function VO(){let e=require.main&&require.main.paths||[],t=WO(),n={},r={};return t.forEach(s=>{let o=s,i=()=>{let a=o;if(o=p_.dirname(a),!o||a===o||r[a])return;if(e.indexOf(o)<0)return i();let c=p_.join(a,"package.json");if(r[a]=!0,!l_.existsSync(c))return i();try{let u=JSON.parse(l_.readFileSync(c,"utf8"));n[u.name]=u.version}catch{}};i()}),n}var So=class e{constructor(){e.prototype.__init.call(this)}static __initStatic(){this.id="Modules"}__init(){this.name=e.id}setupOnce(t,n){t(r=>n().getIntegration(e)?{...r,modules:{...r.modules,...this._getModules()}}:r)}_getModules(){return Gu||(Gu=VO()),Gu}};So.__initStatic();Bu.Modules=So});var Yu=g(Hu=>{var{_optionalChain:$u}=k();Object.defineProperty(Hu,"__esModule",{value:!0});var zO=T(),XO=require("fs"),JO=Cr(),To=new JO.LRUMap(100),QO=7;function ZO(e){return new Promise((t,n)=>{XO.readFile(e,"utf8",(r,s)=>{r?n(r):t(s)})})}var bo=class e{static __initStatic(){this.id="ContextLines"}__init(){this.name=e.id}constructor(t={}){this._options=t,e.prototype.__init.call(this)}get _contextLines(){return this._options.frameContextLines!==void 0?this._options.frameContextLines:QO}setupOnce(t,n){t(r=>n().getIntegration(e)?this.addSourceContext(r):r)}async addSourceContext(t){let n={},r=[];if(this._contextLines>0&&$u([t,"access",s=>s.exception,"optionalAccess",s=>s.values])){for(let s of t.exception.values)if($u([s,"access",o=>o.stacktrace,"optionalAccess",o=>o.frames]))for(let o=s.stacktrace.frames.length-1;o>=0;o--){let i=s.stacktrace.frames[o];i.filename&&!n[i.filename]&&!To.get(i.filename)&&(r.push(eC(i.filename)),n[i.filename]=1)}}if(r.length>0&&await Promise.all(r),this._contextLines>0&&$u([t,"access",s=>s.exception,"optionalAccess",s=>s.values]))for(let s of t.exception.values)s.stacktrace&&s.stacktrace.frames&&await this.addSourceContextToFrames(s.stacktrace.frames);return t}addSourceContextToFrames(t){for(let n of t)if(n.filename&&n.context_line===void 0){let r=To.get(n.filename);if(r)try{zO.addContextToFrame(r,n,this._contextLines)}catch{}}}};bo.__initStatic();async function eC(e){let t=To.get(e);if(t===null)return null;if(t!==void 0)return t;let n=null;try{n=(await ZO(e)).split(`
33
+ `)}catch{}return To.set(e,n),n}Hu.ContextLines=bo});var Ku=g(mn=>{var{_optionalChain:Pt}=k();Object.defineProperty(mn,"__esModule",{value:!0});var tC=require("child_process"),g_=require("fs"),_e=require("os"),nC=require("path"),__=require("util"),h_=__.promisify(g_.readFile),m_=__.promisify(g_.readdir),Io=class e{static __initStatic(){this.id="Context"}__init(){this.name=e.id}constructor(t={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0}){this._options=t,e.prototype.__init.call(this)}setupOnce(t){t(n=>this.addContext(n))}async addContext(t){this._cachedContext===void 0&&(this._cachedContext=this._getContexts());let n=this._updateContext(await this._cachedContext);return t.contexts={...t.contexts,app:{...n.app,...Pt([t,"access",r=>r.contexts,"optionalAccess",r=>r.app])},os:{...n.os,...Pt([t,"access",r=>r.contexts,"optionalAccess",r=>r.os])},device:{...n.device,...Pt([t,"access",r=>r.contexts,"optionalAccess",r=>r.device])},culture:{...n.culture,...Pt([t,"access",r=>r.contexts,"optionalAccess",r=>r.culture])},cloud_resource:{...n.cloud_resource,...Pt([t,"access",r=>r.contexts,"optionalAccess",r=>r.cloud_resource])}},t}_updateContext(t){return Pt([t,"optionalAccess",n=>n.app,"optionalAccess",n=>n.app_memory])&&(t.app.app_memory=process.memoryUsage().rss),Pt([t,"optionalAccess",n=>n.device,"optionalAccess",n=>n.free_memory])&&(t.device.free_memory=_e.freemem()),t}async _getContexts(){let t={};if(this._options.os&&(t.os=await rC()),this._options.app&&(t.app=oC()),this._options.device&&(t.device=E_(this._options.device)),this._options.culture){let n=sC();n&&(t.culture=n)}return this._options.cloudResource&&(t.cloud_resource=lC()),t}};Io.__initStatic();async function rC(){let e=_e.platform();switch(e){case"darwin":return uC();case"linux":return dC();default:return{name:iC[e]||e,version:_e.release()}}}function sC(){try{if(typeof process.versions.icu!="string")return;let e=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(e)==="enero"){let n=Intl.DateTimeFormat().resolvedOptions();return{locale:n.locale,timezone:n.timeZone}}}catch{}}function oC(){let e=process.memoryUsage().rss;return{app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:e}}function E_(e){let t={},n;try{n=_e.uptime&&_e.uptime()}catch{}if(typeof n=="number"&&(t.boot_time=new Date(Date.now()-n*1e3).toISOString()),t.arch=_e.arch(),(e===!0||e.memory)&&(t.memory_size=_e.totalmem(),t.free_memory=_e.freemem()),e===!0||e.cpu){let r=_e.cpus();if(r&&r.length){let s=r[0];t.processor_count=r.length,t.cpu_description=s.model,t.processor_frequency=s.speed}}return t}var iC={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows"},aC=[{name:"fedora-release",distros:["Fedora"]},{name:"redhat-release",distros:["Red Hat Linux","Centos"]},{name:"redhat_version",distros:["Red Hat Linux"]},{name:"SuSE-release",distros:["SUSE Linux"]},{name:"lsb-release",distros:["Ubuntu Linux","Arch Linux"]},{name:"debian_version",distros:["Debian"]},{name:"debian_release",distros:["Debian"]},{name:"arch-release",distros:["Arch Linux"]},{name:"gentoo-release",distros:["Gentoo Linux"]},{name:"novell-release",distros:["SUSE Linux"]},{name:"alpine-release",distros:["Alpine Linux"]}],cC={alpine:e=>e,arch:e=>xe(/distrib_release=(.*)/,e),centos:e=>xe(/release ([^ ]+)/,e),debian:e=>e,fedora:e=>xe(/release (..)/,e),mint:e=>xe(/distrib_release=(.*)/,e),red:e=>xe(/release ([^ ]+)/,e),suse:e=>xe(/VERSION = (.*)\n/,e),ubuntu:e=>xe(/distrib_release=(.*)/,e)};function xe(e,t){let n=e.exec(t);return n?n[1]:void 0}async function uC(){let e={kernel_version:_e.release(),name:"Mac OS X",version:`10.${Number(_e.release().split(".")[0])-4}`};try{let t=await new Promise((n,r)=>{tC.execFile("/usr/bin/sw_vers",(s,o)=>{if(s){r(s);return}n(o)})});e.name=xe(/^ProductName:\s+(.*)$/m,t),e.version=xe(/^ProductVersion:\s+(.*)$/m,t),e.build=xe(/^BuildVersion:\s+(.*)$/m,t)}catch{}return e}function f_(e){return e.split(" ")[0].toLowerCase()}async function dC(){let e={kernel_version:_e.release(),name:"Linux"};try{let t=await m_("/etc"),n=aC.find(a=>t.includes(a.name));if(!n)return e;let r=nC.join("/etc",n.name),s=(await h_(r,{encoding:"utf-8"})).toLowerCase(),{distros:o}=n;e.name=o.find(a=>s.indexOf(f_(a))>=0)||o[0];let i=f_(e.name);e.version=cC[i](s)}catch{}return e}function lC(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}mn.Context=Io;mn.getDeviceContext=E_;mn.readDirAsync=m_;mn.readFileAsync=h_});var y_=g(Wu=>{"use strict";Wu.parse=fC;Wu.serialize=gC;var pC=Object.prototype.toString,Ao=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function fC(e,t){if(typeof e!="string")throw new TypeError("argument str must be a string");for(var n={},r=t||{},s=r.decode||_C,o=0;o<e.length;){var i=e.indexOf("=",o);if(i===-1)break;var a=e.indexOf(";",o);if(a===-1)a=e.length;else if(a<i){o=e.lastIndexOf(";",i-1)+1;continue}var c=e.slice(o,i).trim();if(n[c]===void 0){var u=e.slice(i+1,a).trim();u.charCodeAt(0)===34&&(u=u.slice(1,-1)),n[c]=EC(u,s)}o=a+1}return n}function gC(e,t,n){var r=n||{},s=r.encode||hC;if(typeof s!="function")throw new TypeError("option encode is invalid");if(!Ao.test(e))throw new TypeError("argument name is invalid");var o=s(t);if(o&&!Ao.test(o))throw new TypeError("argument val is invalid");var i=e+"="+o;if(r.maxAge!=null){var a=r.maxAge-0;if(isNaN(a)||!isFinite(a))throw new TypeError("option maxAge is invalid");i+="; Max-Age="+Math.floor(a)}if(r.domain){if(!Ao.test(r.domain))throw new TypeError("option domain is invalid");i+="; Domain="+r.domain}if(r.path){if(!Ao.test(r.path))throw new TypeError("option path is invalid");i+="; Path="+r.path}if(r.expires){var c=r.expires;if(!mC(c)||isNaN(c.valueOf()))throw new TypeError("option expires is invalid");i+="; Expires="+c.toUTCString()}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.priority){var u=typeof r.priority=="string"?r.priority.toLowerCase():r.priority;switch(u){case"low":i+="; Priority=Low";break;case"medium":i+="; Priority=Medium";break;case"high":i+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){var d=typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite;switch(d){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return i}function _C(e){return e.indexOf("%")!==-1?decodeURIComponent(e):e}function hC(e){return encodeURIComponent(e)}function mC(e){return pC.call(e)==="[object Date]"||e instanceof Date}function EC(e,t){try{return t(e)}catch{return e}}});var wr=g(En=>{var{_optionalChain:yC}=k();Object.defineProperty(En,"__esModule",{value:!0});var Ro=T(),SC=y_(),TC=require("url"),bC={ip:!1,request:!0,transaction:!0,user:!0},IC=["cookies","data","headers","method","query_string","url"],S_=["id","username","email"];function Vu(e,t={}){let n=e.method&&e.method.toUpperCase(),r="",s="url";t.customRoute||e.route?(r=t.customRoute||`${e.baseUrl||""}${e.route&&e.route.path}`,s="route"):(e.originalUrl||e.url)&&(r=Ro.stripUrlQueryAndFragment(e.originalUrl||e.url||""));let o="";return t.method&&n&&(o+=n),t.method&&t.path&&(o+=" "),t.path&&r&&(o+=r),[o,s]}function AC(e,t){switch(t){case"path":return Vu(e,{path:!0})[0];case"handler":return e.route&&e.route.stack&&e.route.stack[0]&&e.route.stack[0].name||"<anonymous>";default:{let n=e._reconstructedRoute?e._reconstructedRoute:void 0;return Vu(e,{path:!0,method:!0,customRoute:n})[0]}}}function RC(e,t){let n={};return(Array.isArray(t)?t:S_).forEach(s=>{e&&s in e&&(n[s]=e[s])}),n}function zu(e,t){let{include:n=IC}=t||{},r={},s=e.headers||{},o=e.method,i=e.hostname||e.host||s.host||"<no host>",a=e.protocol==="https"||e.socket&&e.socket.encrypted?"https":"http",c=e.originalUrl||e.url||"",u=c.startsWith(a)?c:`${a}://${i}${c}`;return n.forEach(d=>{switch(d){case"headers":{r.headers=s,n.includes("cookies")||delete r.headers.cookie;break}case"method":{r.method=o;break}case"url":{r.url=u;break}case"cookies":{r.cookies=e.cookies||s.cookie&&SC.parse(s.cookie)||{};break}case"query_string":{r.query_string=OC(e);break}case"data":{if(o==="GET"||o==="HEAD")break;e.body!==void 0&&(r.data=Ro.isString(e.body)?e.body:JSON.stringify(Ro.normalize(e.body)));break}default:({}).hasOwnProperty.call(e,d)&&(r[d]=e[d])}}),r}function vC(e,t,n){let r={...bC,...yC([n,"optionalAccess",s=>s.include])};if(r.request){let s=Array.isArray(r.request)?zu(t,{include:r.request}):zu(t);e.request={...e.request,...s}}if(r.user){let s=t.user&&Ro.isPlainObject(t.user)?RC(t.user,r.user):{};Object.keys(s).length&&(e.user={...e.user,...s})}if(r.ip){let s=t.ip||t.socket&&t.socket.remoteAddress;s&&(e.user={...e.user,ip_address:s})}return r.transaction&&!e.transaction&&(e.transaction=AC(t,r.transaction)),e}function OC(e){let t=e.originalUrl||e.url||"";if(t)return t.startsWith("/")&&(t=`http://dogs.are.great${t}`),e.query||new TC.URL(t).search.replace("?","")||void 0}En.DEFAULT_USER_INCLUDES=S_;En.addRequestDataToEvent=vC;En.extractPathForTransaction=Vu;En.extractRequestData=zu});var Qu=g(Ju=>{Object.defineProperty(Ju,"__esModule",{value:!0});var CC=T(),DC=wr(),Xu={include:{cookies:!0,data:!0,headers:!0,ip:!1,query_string:!0,url:!0,user:{id:!0,username:!0,email:!0}},transactionNamingScheme:"methodPath"},vo=class e{static __initStatic(){this.id="RequestData"}__init(){this.name=e.id}constructor(t={}){e.prototype.__init.call(this),this._addRequestData=DC.addRequestDataToEvent,this._options={...Xu,...t,include:{method:!0,...Xu.include,...t.include,user:t.include&&typeof t.include.user=="boolean"?t.include.user:{...Xu.include.user,...(t.include||{}).user}}}}setupOnce(t,n){let{transactionNamingScheme:r}=this._options;t(s=>{let o=n(),i=o.getIntegration(e),{sdkProcessingMetadata:a={}}=s,c=a.request;if(!i||!c)return s;let u=a.requestDataOptionsFromExpressHandler||a.requestDataOptionsFromGCPWrapper||NC(this._options),d=this._addRequestData(s,c,u);if(s.type==="transaction"||r==="handler")return d;let p=c._sentryTransaction;if(p){let f=wC(o)==="sentry.javascript.nextjs"?p.name.startsWith("/api"):r!=="path",[m]=CC.extractPathForTransaction(c,{path:!0,method:f,customRoute:p.name});d.transaction=m}return d})}};vo.__initStatic();function NC(e){let{transactionNamingScheme:t,include:{ip:n,user:r,...s}}=e,o=[];for(let[a,c]of Object.entries(s))c&&o.push(a);let i;if(r===void 0)i=!0;else if(typeof r=="boolean")i=r;else{let a=[];for(let[c,u]of Object.entries(r))u&&a.push(c);i=a}return{include:{ip:n,user:i,request:o.length!==0?o:void 0,transaction:t}}}function wC(e){try{return e.getClient().getOptions()._metadata.sdk.name}catch{return}}Ju.RequestData=vo});var nd=g(kr=>{var{_optionalChain:D}=k();Object.defineProperty(kr,"__esModule",{value:!0});var Zu=T(),kC=Cr(),xC=_n();function b_(e,t,n){let r=0,s=5,o=0;return setInterval(()=>{o===0?r>e&&(s*=2,n(s),s>86400&&(s=86400),o=s):(o-=1,o===0&&t()),r=0},1e3).unref(),()=>{r+=1}}function td(e){let t=[],n=!1;function r(i){t=[],!n&&(n=!0,e(i))}t.push(r);function s(i){t.push(i)}function o(i){let a=t.pop()||r;try{a(i)}catch{r(i)}}return{add:s,next:o}}var ed=class{constructor(){let{Session:t}=require("inspector");this._session=new t}configureAndConnect(t,n){this._session.connect(),this._session.on("Debugger.paused",r=>{t(r,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:n?"all":"uncaught"})}setPauseOnExceptions(t){this._session.post("Debugger.setPauseOnExceptions",{state:t?"all":"uncaught"})}getLocalVariables(t,n){this._getProperties(t,r=>{let{add:s,next:o}=td(n);for(let i of r)if(D([i,"optionalAccess",a=>a.value,"optionalAccess",a=>a.objectId])&&D([i,"optionalAccess",a=>a.value,"access",a=>a.className])==="Array"){let a=i.value.objectId;s(c=>this._unrollArray(a,i.name,c,o))}else if(D([i,"optionalAccess",a=>a.value,"optionalAccess",a=>a.objectId])&&D([i,"optionalAccess",a=>a.value,"optionalAccess",a=>a.className])==="Object"){let a=i.value.objectId;s(c=>this._unrollObject(a,i.name,c,o))}else(D([i,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])||D([i,"optionalAccess",a=>a.value,"optionalAccess",a=>a.description]))&&s(a=>this._unrollOther(i,a,o));o({})})}_getProperties(t,n){this._session.post("Runtime.getProperties",{objectId:t,ownProperties:!0},(r,s)=>{n(r?[]:s.result)})}_unrollArray(t,n,r,s){this._getProperties(t,o=>{r[n]=o.filter(i=>i.name!=="length"&&!isNaN(parseInt(i.name,10))).sort((i,a)=>parseInt(i.name,10)-parseInt(a.name,10)).map(i=>D([i,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])),s(r)})}_unrollObject(t,n,r,s){this._getProperties(t,o=>{r[n]=o.map(i=>[i.name,D([i,"optionalAccess",a=>a.value,"optionalAccess",a=>a.value])]).reduce((i,[a,c])=>(i[a]=c,i),{}),s(r)})}_unrollOther(t,n,r){D([t,"optionalAccess",s=>s.value,"optionalAccess",s=>s.value])?n[t.name]=t.value.value:D([t,"optionalAccess",s=>s.value,"optionalAccess",s=>s.description])&&D([t,"optionalAccess",s=>s.value,"optionalAccess",s=>s.type])!=="function"&&(n[t.name]=`<${t.value.description}>`),r(n)}};function PC(){try{return new ed}catch{return}}function T_(e){return e!==void 0&&["","?","<anonymous>"].includes(e)}function UC(e,t){return e===t||T_(e)&&T_(t)}function I_(e){if(e!==void 0)return e.slice(-10).reduce((t,n)=>`${t},${n.function},${n.lineno},${n.colno}`,"")}function MC(e,t){if(t!==void 0)return I_(e(t,1))}var Oo=class e{static __initStatic(){this.id="LocalVariables"}__init(){this.name=e.id}__init2(){this._cachedFrames=new kC.LRUMap(20)}constructor(t={},n=PC()){this._options=t,this._session=n,e.prototype.__init.call(this),e.prototype.__init2.call(this)}setupOnce(t,n){this._setup(t,D([n,"call",r=>r(),"access",r=>r.getClient,"call",r=>r(),"optionalAccess",r=>r.getOptions,"call",r=>r()]))}_setup(t,n){if(this._session&&D([n,"optionalAccess",r=>r.includeLocalVariables])){if((xC.NODE_VERSION.major||0)<18){Zu.logger.log("The `LocalVariables` integration is only supported on Node >= v18.");return}let s=this._options.captureAllExceptions!==!1;if(this._session.configureAndConnect((o,i)=>this._handlePaused(n.stackParser,o,i),s),s){let o=this._options.maxExceptionsPerSecond||50;this._rateLimiter=b_(o,()=>{Zu.logger.log("Local variables rate-limit lifted."),D([this,"access",i=>i._session,"optionalAccess",i=>i.setPauseOnExceptions,"call",i=>i(!0)])},i=>{Zu.logger.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${i} seconds.`),D([this,"access",a=>a._session,"optionalAccess",a=>a.setPauseOnExceptions,"call",a=>a(!1)])})}t(async o=>this._addLocalVariables(o))}}_handlePaused(t,{params:{reason:n,data:r,callFrames:s}},o){if(n!=="exception"&&n!=="promiseRejection"){o();return}D([this,"access",u=>u._rateLimiter,"optionalCall",u=>u()]);let i=MC(t,D([r,"optionalAccess",u=>u.description]));if(i==null){o();return}let{add:a,next:c}=td(u=>{this._cachedFrames.set(i,u),o()});for(let u=0;u<Math.min(s.length,5);u++){let{scopeChain:d,functionName:l,this:p}=s[u],f=d.find(E=>E.type==="local"),m=p.className==="global"||!p.className?l:`${p.className}.${l}`;if(D([f,"optionalAccess",E=>E.object,"access",E=>E.objectId])===void 0)a(E=>{E[u]={function:m},c(E)});else{let E=f.object.objectId;a(I=>D([this,"access",R=>R._session,"optionalAccess",R=>R.getLocalVariables,"call",R=>R(E,L=>{I[u]={function:m,vars:L},c(I)})]))}}c([])}_addLocalVariables(t){for(let n of D([t,"optionalAccess",r=>r.exception,"optionalAccess",r=>r.values])||[])this._addLocalVariablesToException(n);return t}_addLocalVariablesToException(t){let n=I_(D([t,"optionalAccess",o=>o.stacktrace,"optionalAccess",o=>o.frames]));if(n===void 0)return;let r=this._cachedFrames.delete(n);if(r===void 0)return;let s=D([t,"access",o=>o.stacktrace,"optionalAccess",o=>o.frames,"optionalAccess",o=>o.length])||0;for(let o=0;o<s;o++){let i=s-o-1;if(!D([t,"optionalAccess",a=>a.stacktrace,"optionalAccess",a=>a.frames,"optionalAccess",a=>a[i]])||!r[o])break;r[o].vars===void 0||t.stacktrace.frames[i].in_app===!1||!UC(t.stacktrace.frames[i].function,r[o].function)||(t.stacktrace.frames[i].vars=r[o].vars)}}};Oo.__initStatic();kr.LocalVariables=Oo;kr.createCallbackList=td;kr.createRateLimiter=b_});var rd=g((Xe,C_)=>{var{_optionalChain:O_}=k();Object.defineProperty(Xe,"__esModule",{value:!0});var Ut=N(),Mt=T(),A_=Cr(),R_=_n();Xe.ChannelName=void 0;(function(e){let t="undici:request:create";e.RequestCreate=t;let n="undici:request:headers";e.RequestEnd=n;let r="undici:request:error";e.RequestError=r})(Xe.ChannelName||(Xe.ChannelName={}));var Co=class e{static __initStatic(){this.id="Undici"}__init(){this.name=e.id}__init2(){this._createSpanUrlMap=new A_.LRUMap(100)}__init3(){this._headersUrlMap=new A_.LRUMap(100)}constructor(t={}){e.prototype.__init.call(this),e.prototype.__init2.call(this),e.prototype.__init3.call(this),e.prototype.__init4.call(this),e.prototype.__init5.call(this),e.prototype.__init6.call(this),this._options={breadcrumbs:t.breadcrumbs===void 0?!0:t.breadcrumbs,shouldCreateSpanForRequest:t.shouldCreateSpanForRequest}}setupOnce(t){if(R_.NODE_VERSION.major&&R_.NODE_VERSION.major<16)return;let n;try{n=Mt.dynamicRequire(C_,"diagnostics_channel")}catch{}!n||!n.subscribe||(n.subscribe(Xe.ChannelName.RequestCreate,this._onRequestCreate),n.subscribe(Xe.ChannelName.RequestEnd,this._onRequestEnd),n.subscribe(Xe.ChannelName.RequestError,this._onRequestError))}_shouldCreateSpan(t){if(this._options.shouldCreateSpanForRequest===void 0)return!0;let n=this._createSpanUrlMap.get(t);if(n!==void 0)return n;let r=this._options.shouldCreateSpanForRequest(t);return this._createSpanUrlMap.set(t,r),r}__init4(){this._onRequestCreate=t=>{let n=Ut.getCurrentHub();if(!n.getIntegration(e))return;let{request:r}=t,s=r.origin?r.origin.toString()+r.path:r.path;if(Ut.isSentryRequestUrl(s,n)||r.__sentry_span__!==void 0)return;let o=n.getClient();if(!o)return;let i=o.getOptions(),a=n.getScope(),c=a.getSpan(),u=this._shouldCreateSpan(s)?LC(c,r,s):void 0;if(u&&(r.__sentry_span__=u),(l=>{if(i.tracePropagationTargets===void 0)return!0;let p=this._headersUrlMap.get(l);if(p!==void 0)return p;let f=Mt.stringMatchesSomePattern(l,i.tracePropagationTargets);return this._headersUrlMap.set(l,f),f})(s))if(u){let l=O_([u,"optionalAccess",f=>f.transaction,"optionalAccess",f=>f.getDynamicSamplingContext,"call",f=>f()]),p=Mt.dynamicSamplingContextToSentryBaggageHeader(l);v_(r,u.toTraceparent(),p)}else{let{traceId:l,sampled:p,dsc:f}=a.getPropagationContext(),m=Mt.generateSentryTraceHeader(l,void 0,p),E=f||Ut.getDynamicSamplingContextFromClient(l,o,a),I=Mt.dynamicSamplingContextToSentryBaggageHeader(E);v_(r,m,I)}}}__init5(){this._onRequestEnd=t=>{let n=Ut.getCurrentHub();if(!n.getIntegration(e))return;let{request:r,response:s}=t,o=r.origin?r.origin.toString()+r.path:r.path;if(Ut.isSentryRequestUrl(o,n))return;let i=r.__sentry_span__;i&&(i.setHttpStatus(s.statusCode),i.finish()),this._options.breadcrumbs&&n.addBreadcrumb({category:"http",data:{method:r.method,status_code:s.statusCode,url:o},type:"http"},{event:"response",request:r,response:s})}}__init6(){this._onRequestError=t=>{let n=Ut.getCurrentHub();if(!n.getIntegration(e))return;let{request:r}=t,s=r.origin?r.origin.toString()+r.path:r.path;if(Ut.isSentryRequestUrl(s,n))return;let o=r.__sentry_span__;o&&(o.setStatus("internal_error"),o.finish()),this._options.breadcrumbs&&n.addBreadcrumb({category:"http",data:{method:r.method,url:s},level:"error",type:"http"},{event:"error",request:r})}}};Co.__initStatic();function v_(e,t,n){e.__sentry_has_headers__||(e.addHeader("sentry-trace",t),n&&e.addHeader("baggage",n),e.__sentry_has_headers__=!0)}function LC(e,t,n){let r=Mt.parseUrl(n),s=t.method||"GET",o={"http.method":s};return r.search&&(o["http.query"]=r.search),r.hash&&(o["http.fragment"]=r.hash),O_([e,"optionalAccess",i=>i.startChild,"call",i=>i({op:"http.client",origin:"auto.http.node.undici",description:`${s} ${Mt.getSanitizedUrlString(r)}`,data:o})])}Xe.Undici=Co});var sd=g(Ft=>{var{_optionalChain:qC}=k();Object.defineProperty(Ft,"__esModule",{value:!0});var Lt=N(),qt=T(),FC=yu(),GC=Jg(),BC=Jc(),jC=vu(),$C=Nu(),HC=Uu(),YC=Lu(),KC=Fu(),WC=ju(),VC=Yu(),zC=Ku(),XC=Qu(),JC=nd(),QC=rd(),ZC=uo(),eD=lu(),D_=[new Lt.Integrations.InboundFilters,new Lt.Integrations.FunctionToString,new jC.Console,new $C.Http,new QC.Undici,new HC.OnUncaughtException,new YC.OnUnhandledRejection,new VC.ContextLines,new JC.LocalVariables,new zC.Context,new WC.Modules,new XC.RequestData,new KC.LinkedErrors];function tD(e={}){FC.isAnrChildProcess()&&(e.autoSessionTracking=!1,e.tracesSampleRate=0);let t=Lt.getMainCarrier();GC.setNodeAsyncContextStrategy();let n=qC([t,"access",o=>o.__SENTRY__,"optionalAccess",o=>o.integrations])||[];e.defaultIntegrations=e.defaultIntegrations===!1?[]:[...Array.isArray(e.defaultIntegrations)?e.defaultIntegrations:D_,...n],e.dsn===void 0&&process.env.SENTRY_DSN&&(e.dsn=process.env.SENTRY_DSN);let r=process.env.SENTRY_TRACES_SAMPLE_RATE;if(e.tracesSampleRate===void 0&&r){let o=parseFloat(r);isFinite(o)&&(e.tracesSampleRate=o)}if(e.release===void 0){let o=N_();o!==void 0?e.release=o:e.autoSessionTracking=!1}e.environment===void 0&&process.env.SENTRY_ENVIRONMENT&&(e.environment=process.env.SENTRY_ENVIRONMENT),e.autoSessionTracking===void 0&&e.dsn!==void 0&&(e.autoSessionTracking=!0),e.instrumenter===void 0&&(e.instrumenter="sentry");let s={...e,stackParser:qt.stackParserFromStackParserOptions(e.stackParser||w_),integrations:Lt.getIntegrationsToSetup(e),transport:e.transport||eD.makeNodeTransport};Lt.initAndBind(e.clientClass||BC.NodeClient,s),e.autoSessionTracking&&rD(),sD()}function nD(e){if(e===void 0)return!1;let t=e&&e.getOptions();return t&&t.autoSessionTracking!==void 0?t.autoSessionTracking:!1}function N_(e){return process.env.SENTRY_RELEASE?process.env.SENTRY_RELEASE:qt.GLOBAL_OBJ.SENTRY_RELEASE&&qt.GLOBAL_OBJ.SENTRY_RELEASE.id?qt.GLOBAL_OBJ.SENTRY_RELEASE.id:process.env.GITHUB_SHA||process.env.COMMIT_REF||process.env.VERCEL_GIT_COMMIT_SHA||process.env.VERCEL_GITHUB_COMMIT_SHA||process.env.VERCEL_GITLAB_COMMIT_SHA||process.env.VERCEL_BITBUCKET_COMMIT_SHA||process.env.ZEIT_GITHUB_COMMIT_SHA||process.env.ZEIT_GITLAB_COMMIT_SHA||process.env.ZEIT_BITBUCKET_COMMIT_SHA||e}var w_=qt.createStackParser(qt.nodeStackLineParser(ZC.getModuleFromFilename));function rD(){let e=Lt.getCurrentHub();e.startSession(),process.on("beforeExit",()=>{let t=e.getScope().getSession();t&&!["exited","crashed"].includes(t.status)&&e.endSession()})}function sD(){let e=(process.env.SENTRY_USE_ENVIRONMENT||"").toLowerCase();if(!["false","n","no","off","0"].includes(e)){let t=process.env.SENTRY_TRACE,n=process.env.SENTRY_BAGGAGE,{propagationContext:r}=qt.tracingContextFromHeaders(t,n);Lt.getCurrentHub().getScope().setPropagationContext(r)}}Ft.defaultIntegrations=D_;Ft.defaultStackParser=w_;Ft.getSentryRelease=N_;Ft.init=tD;Ft.isAutoSessionTrackingEnabled=nD});var k_=g(id=>{Object.defineProperty(id,"__esModule",{value:!0});var Do=require("fs"),od=require("path");function oD(e){let t=od.resolve(e);if(!Do.existsSync(t))throw new Error(`Cannot read contents of ${t}. Directory does not exist.`);if(!Do.statSync(t).isDirectory())throw new Error(`Cannot read contents of ${t}, because it is not a directory.`);let n=r=>Do.readdirSync(r).reduce((s,o)=>{let i=od.join(r,o);return Do.statSync(i).isDirectory()?s.concat(n(i)):(s.push(i),s)},[]);return n(t).map(r=>od.relative(t,r))}id.deepReadDirSync=oD});var P_=g(No=>{Object.defineProperty(No,"__esModule",{value:!0});var x_=wr();function iD(e,t){return x_.extractRequestData(e,{include:t})}function aD(e,t,n={}){return x_.addRequestDataToEvent(e,t,{include:n})}No.extractRequestData=iD;No.parseRequest=aD});var M_=g(ft=>{var{_optionalChain:yn}=k();Object.defineProperty(ft,"__esModule",{value:!0});var Se=N(),pt=T(),cD=wr(),wo=sd(),U_=P_();function uD(){return function(t,n,r){let s=Se.getCurrentHub(),o=yn([s,"access",m=>m.getClient,"call",m=>m(),"optionalAccess",m=>m.getOptions,"call",m=>m()]);if(!o||o.instrumenter!=="sentry"||yn([t,"access",m=>m.method,"optionalAccess",m=>m.toUpperCase,"call",m=>m()])==="OPTIONS"||yn([t,"access",m=>m.method,"optionalAccess",m=>m.toUpperCase,"call",m=>m()])==="HEAD")return r();let i=t.headers&&pt.isString(t.headers["sentry-trace"])?t.headers["sentry-trace"]:void 0,a=yn([t,"access",m=>m.headers,"optionalAccess",m=>m.baggage]),{traceparentData:c,dynamicSamplingContext:u,propagationContext:d}=pt.tracingContextFromHeaders(i,a);if(s.getScope().setPropagationContext(d),!Se.hasTracingEnabled(o))return r();let[l,p]=pt.extractPathForTransaction(t,{path:!0,method:!0}),f=Se.startTransaction({name:l,op:"http.server",origin:"auto.http.node.tracingHandler",...c,metadata:{dynamicSamplingContext:c&&!u?{}:u,request:t,source:p}},{request:cD.extractRequestData(t)});s.configureScope(m=>{m.setSpan(f)}),n.__sentry_transaction=f,n.once("finish",()=>{setImmediate(()=>{pt.addRequestDataToTransaction(f,t),f.setHttpStatus(n.statusCode),f.finish()})}),r()}}function dD(e={}){let t;if("include"in e)t={include:e.include};else{let{ip:n,request:r,transaction:s,user:o}=e;(n||r||s||o)&&(t={include:pt.dropUndefinedKeys({ip:n,request:r,transaction:s,user:o})})}return t}function lD(e){let t=dD(e),n=Se.getCurrentHub(),r=n.getClient();if(r&&wo.isAutoSessionTrackingEnabled(r)){r.initSessionFlusher();let s=n.getScope();s.getSession()&&s.setSession()}return function(o,i,a){if(e&&e.flushTimeout&&e.flushTimeout>0){let c=i.end;i.end=function(u,d,l){Se.flush(e.flushTimeout).then(()=>{c.call(this,u,d,l)}).then(null,p=>{(typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__)&&pt.logger.error(p),c.call(this,u,d,l)})}}Se.runWithAsyncContext(()=>{let c=Se.getCurrentHub();c.configureScope(u=>{u.setSDKProcessingMetadata({request:o,requestDataOptionsFromExpressHandler:t});let d=c.getClient();wo.isAutoSessionTrackingEnabled(d)&&c.getScope().setRequestSession({status:"ok"})}),i.once("finish",()=>{let u=c.getClient();wo.isAutoSessionTrackingEnabled(u)&&setImmediate(()=>{u&&u._captureRequestSession&&u._captureRequestSession()})}),a()})}}function pD(e){let t=e.status||e.statusCode||e.status_code||e.output&&e.output.statusCode;return t?parseInt(t,10):500}function fD(e){return pD(e)>=500}function gD(e){return function(n,r,s,o){if((e&&e.shouldHandleError||fD)(n)){Se.withScope(a=>{a.setSDKProcessingMetadata({request:r});let c=s.__sentry_transaction;c&&a.getSpan()===void 0&&a.setSpan(c);let u=Se.getCurrentHub().getClient();if(u&&wo.isAutoSessionTrackingEnabled(u)&&u._sessionFlusher!==void 0){let p=a.getRequestSession();p&&p.status!==void 0&&(p.status="crashed")}a.addEventProcessor(l=>(pt.addExceptionMechanism(l,{type:"middleware",handled:!1}),l));let d=Se.captureException(n);s.sentry=d,o(n)});return}o(n)}}function _D(e={}){return function({path:t,type:n,next:r,rawInput:s}){let o=Se.getCurrentHub(),i=yn([o,"access",c=>c.getClient,"call",c=>c(),"optionalAccess",c=>c.getOptions,"call",c=>c()]),a=o.getScope().getTransaction();if(a){a.setName(`trpc/${t}`,"route"),a.op="rpc.server";let c={procedure_type:n};(e.attachRpcInput!==void 0?e.attachRpcInput:yn([i,"optionalAccess",u=>u.sendDefaultPii]))&&(c.input=pt.normalize(s)),a.setContext("trpc",c)}return r()}}ft.extractRequestData=U_.extractRequestData;ft.parseRequest=U_.parseRequest;ft.errorHandler=gD;ft.requestHandler=lD;ft.tracingHandler=uD;ft.trpcMiddleware=_D});var L_=g(re=>{Object.defineProperty(re,"__esModule",{value:!0});var hD=vu(),mD=Nu(),ED=Uu(),yD=Lu(),SD=Fu(),TD=ju(),bD=Yu(),ID=Ku(),AD=Qu(),RD=nd(),vD=rd();re.Console=hD.Console;re.Http=mD.Http;re.OnUncaughtException=ED.OnUncaughtException;re.OnUnhandledRejection=yD.OnUnhandledRejection;re.LinkedErrors=SD.LinkedErrors;re.Modules=TD.Modules;re.ContextLines=bD.ContextLines;re.Context=ID.Context;re.RequestData=AD.RequestData;re.LocalVariables=RD.LocalVariables;re.Undici=vD.Undici});var q_=g(Je=>{Object.defineProperty(Je,"__esModule",{value:!0});var Gt=Kc();Je.Apollo=Gt.Apollo;Je.Express=Gt.Express;Je.GraphQL=Gt.GraphQL;Je.Mongo=Gt.Mongo;Je.Mysql=Gt.Mysql;Je.Postgres=Gt.Postgres;Je.Prisma=Gt.Prisma});var F_=g(A=>{Object.defineProperty(A,"__esModule",{value:!0});var v=N(),OD=hg(),CD=Jc(),DD=lu(),ko=sd(),ad=wr(),ND=k_(),wD=uo(),kD=yu(),xD=M_(),PD=L_(),UD=q_(),MD={...v.Integrations,...PD,...UD};A.Hub=v.Hub;A.SDK_VERSION=v.SDK_VERSION;A.Scope=v.Scope;A.addBreadcrumb=v.addBreadcrumb;A.addGlobalEventProcessor=v.addGlobalEventProcessor;A.addIntegration=v.addIntegration;A.captureCheckIn=v.captureCheckIn;A.captureEvent=v.captureEvent;A.captureException=v.captureException;A.captureMessage=v.captureMessage;A.close=v.close;A.configureScope=v.configureScope;A.continueTrace=v.continueTrace;A.createTransport=v.createTransport;A.extractTraceparentData=v.extractTraceparentData;A.flush=v.flush;A.getActiveSpan=v.getActiveSpan;A.getActiveTransaction=v.getActiveTransaction;A.getCurrentHub=v.getCurrentHub;A.getHubFromCarrier=v.getHubFromCarrier;A.lastEventId=v.lastEventId;A.makeMain=v.makeMain;A.runWithAsyncContext=v.runWithAsyncContext;A.setContext=v.setContext;A.setExtra=v.setExtra;A.setExtras=v.setExtras;A.setMeasurement=v.setMeasurement;A.setTag=v.setTag;A.setTags=v.setTags;A.setUser=v.setUser;A.spanStatusfromHttpCode=v.spanStatusfromHttpCode;A.startActiveSpan=v.startActiveSpan;A.startInactiveSpan=v.startInactiveSpan;A.startSpan=v.startSpan;A.startSpanManual=v.startSpanManual;A.startTransaction=v.startTransaction;A.trace=v.trace;A.withScope=v.withScope;A.autoDiscoverNodePerformanceMonitoringIntegrations=OD.autoDiscoverNodePerformanceMonitoringIntegrations;A.NodeClient=CD.NodeClient;A.makeNodeTransport=DD.makeNodeTransport;A.defaultIntegrations=ko.defaultIntegrations;A.defaultStackParser=ko.defaultStackParser;A.getSentryRelease=ko.getSentryRelease;A.init=ko.init;A.DEFAULT_USER_INCLUDES=ad.DEFAULT_USER_INCLUDES;A.addRequestDataToEvent=ad.addRequestDataToEvent;A.extractRequestData=ad.extractRequestData;A.deepReadDirSync=ND.deepReadDirSync;A.getModuleFromFilename=wD.getModuleFromFilename;A.enableAnrDetection=kD.enableAnrDetection;A.Handlers=xD;A.Integrations=MD});var h,cd=ee(()=>{"use strict";h={GATEWAY_STARTED:"Gateway started",GATEWAY_STOPPED:"Gateway stopped",BOOTSTRAP_APPLIED:"Bootstrap applied",CHANNEL_READY:"Channel ready",CONVERSATION_STARTED:"Conversation started",EVALUATE_CONVERSATION_STARTED:"Evaluate conversation started",CONVERSATION_DELETED:"Conversation deleted",PENDING_CONVERSATION_DENIED:"Pending conversation denied",AGENTS_REFRESHED:"Agents refreshed",USER_DISPATCHED:"User dispatched",SESSION_DISPATCHED:"Session dispatched",SYNC_TICK_COMPLETED:"Sync tick completed",INBOUND_HANDLER_ENTERED:"Inbound handler entered",MESSAGE_RECEIVED:"Message received",MESSAGE_SENT:"Message sent",INBOUND_BUYER_PENDING:"Inbound buyer: no session, group still Unknown (pending)",INBOUND_BUYER_SESSION_AUTO_RECOVERED:"Inbound buyer: session missing for Allowed group, auto-recovered",INBOUND_BLOCKED_SENSITIVE:"Inbound blocked: sensitive word; reply sent",INBOUND_BLOCKED_ADDRESS_MISMATCH:"Inbound blocked: address mismatch",INBOUND_BLOCKED_INELIGIBLE:"Inbound blocked: message-eligible check failed",INBOUND_DROP_EMPTY_CONTENT:"Inbound drop: empty content",INBOUND_DROP_MISSING_JOBID:"Inbound drop: missing jobId",INBOUND_DROP_UNSUPPORTED_MSGTYPE:"Inbound drop: unsupported msgType",INBOUND_DROP_DM_NON_SYSTEM:"Inbound drop: DM sender not in system whitelist",INBOUND_DROP_DM_INVALID_PAYLOAD:"Inbound drop: DM payload invalid",INBOUND_DROP_DM_UNKNOWN_AGENT:"Inbound drop: DM target agent not local",DM_FALLBACK_TO_BACKUP:"DM fallback to backup session",DM_WHITELIST_FAIL_OPEN:"DM whitelist fail-open (empty system accounts)",FILE_UPLOADED:"File uploaded",FILE_DOWNLOADED:"File downloaded",PENDING_LIST_QUERIED:"Pending list queried",AGENT_LIST_QUERIED:"Agent list queried",SESSION_KEY_DERIVED:"Session key derived",CONVERSATION_HISTORY_QUERIED:"Conversation history queried",SESSIONS_QUERIED:"Sessions queried",GROUP_CONSENT_CHANGED:"Group consent changed",SESSION_CREATED:"Session created",SESSION_DELETED:"Session deleted",SESSION_AUTO_RECOVERED:"Session auto-recovered",INBOUND_DELIVERED:"Inbound delivered to session",DM_DELIVERED:"DM delivered to session",OUTBOUND_ELIGIBILITY_CHECKED:"Outbound eligibility checked",AGENT_CLIENT_CREATED:"Agent client created",AGENT_CLIENT_REMOVED:"Agent client removed",ADDRESS_SYNC_COMPLETED:"Address sync completed",AGENT_REFRESH_SESSION_EXPIRED:"Agent refresh aborted: onchainos session expired, local clients taken offline",OFFLINE_REPLAY_MESSAGE_REPLAYED:"Offline replay message replayed",AGENTS_WAKEUP_NOTIFIED:"Agents wakeup notified",CONFIG_SENSITIVE_WORDS_REFRESHED:"Sensitive words config refreshed",CONFIG_SYSTEM_REFRESHED:"System config refreshed",GATEWAY_DISCONNECTED:"Gateway disconnected",GATEWAY_REQUEST:"Gateway request",GATEWAY_DELIVERY_BUFFERED:"Gateway delivery buffered",DAEMON_LIFECYCLE_SKIPPED:"Daemon lifecycle skipped",DAEMON_LIFECYCLE_REQUESTED:"Daemon lifecycle requested",PROMPT_USER_CHECKPOINT:"Prompt user checkpoint",USER_WATCH_STARTED:"User watch started",USER_WATCH_EVENT_DELIVERED:"User watch event delivered",INBOUND_DM_RAW:"Inbound DM raw",INBOUND_GROUP_RAW:"Inbound group raw",SYSTEM_NOTIFICATION_RECEIVED:"System notification received",SYSTEM_NOTIFICATION_ROUTED:"System notification routed",HERMES_SESSION_ROUTE_BINDING:"Hermes session route binding",XMTP_CONNECTION_FAILED:"XMTP connection failed",CONVERSATIONS_STREAM_FAILED:"conversations.stream failed",AGENT_START_FAILED:"agent.start failed",AGENT_STREAM_ERROR:"agent stream error",BOOTSTRAP_FAILED:"Bootstrap failed",ONCHAINOS_SESSION_EXPIRED:"Onchainos session expired",ONCHAINOS_CLI_ERROR:"Onchainos CLI error",HEARTBEAT_FAILED:"Heartbeat failed",MESSAGE_PARSE_FAILED:"Message parse failed",MESSAGE_HANDLER_ERROR:"Message handler error",OFFLINE_REPLAY_FAILED:"Offline replay failed",INBOUND_ROUTING_FAILED:"Inbound routing failed",CONVERSATION_NOT_FOUND:"Conversation not found for send",XMTP_SEND_FAILED:"XMTP send failed",AGENT_REFRESH_FAILED:"Agent refresh failed",GROUP_CONSENT_UPDATE_FAILED:"Group consent update failed",TOOL_EXECUTE_FAILED:"Tool execute failed",AGENT_RESOLUTION_FAILED:"Agent resolution failed",USER_DISPATCH_FAILED:"User dispatch failed",INBOUND_ELIGIBILITY_BYPASSED:"Inbound eligibility bypassed",INBOUND_ADDRESS_CHECK_FAILED:"Inbound address check failed",INBOUND_ADDRESS_CHECK_BYPASSED:"Inbound address check bypassed",INBOUND_SENSITIVE_CHECK_FAILED:"Inbound sensitive check failed",FILE_UPLOAD_FAILED:"File upload failed",FILE_DOWNLOAD_FAILED:"File download failed",OFFLINE_REPLAY_MESSAGE_FAILED:"Offline replay message failed",PENDING_NOTIFICATION_FAILED:"Pending notification failed",GATEWAY_CONNECT_FAILED:"Gateway connect failed",GATEWAY_REQUEST_FAILED:"Gateway request failed",PROMPT_USER_FAILED:"Prompt user failed",DAEMON_COMMAND_FAILED:"Daemon command failed",DAEMON_COMMAND_TIMEOUT:"Daemon command timeout",DAEMON_COMMAND_STALE:"Daemon command stale",DAEMON_LIFECYCLE_FAILED:"Daemon lifecycle failed",DAEMON_TICK_FAILED:"Daemon tick failed",DIRECT_CLI_FAILED:"Direct CLI failed",AI_RUN_FAILED:"AI run failed",AI_RUN_TIMEOUT:"AI run timeout",AI_RUN_TOOL_FAILED:"AI run tool failed",IPC_FAILED:"IPC failed",NOTIFY_AGENTS_WAKEUP_FAILED:"Notify agents wakeup failed",OUTBOUND_AGENT_LOOKUP_FAILED:"Outbound agent lookup failed",OUTBOUND_ELIGIBILITY_CHECK_FAILED:"Outbound eligibility check failed",OUTBOUND_ELIGIBILITY_BYPASSED:"Outbound eligibility bypassed",OUTBOUND_BLOCKED_INELIGIBLE:"Outbound blocked: message-eligible check failed",CACHE_LOAD_FAILED:"Cache load failed",CACHE_WRITE_FAILED:"Cache write failed",CONFIG_LOAD_FAILED:"Config load failed",SENTRY_INIT_SKIPPED:"Sentry init skipped",AGENT_DB_DIR_CREATE_FAILED:"Agent DB dir create failed"}});var z,$_,G_,B_,LD,qD,FD,GD,BD,xo,j_,ud,b,H_,Y_,se=ee(()=>{"use strict";te();z=wm(F_()),$_=require("node:crypto");cd();cd();G_=(0,$_.randomUUID)(),B_=new Set(["args","apikey","argv","auth","authorization","authtoken","bearer","body","cache","command","content","credential","credentials","cwd","data","error","failures","filename","file_name","filepath","file_path","headers","input","logpath","message","output","password","params","path","payload","privatekey","prompt","raw","rawevent","rawtext","request","response","accesstoken","refreshtoken","digest","nonce","salt","secret","token","stderr","stdout","title","tooloutput"]),LD=["accesstoken","apikey","authorization","authtoken","content","credential","filepath","logpath","outputpath","password","payload","privatekey","prompt","rawevent","rawtext","refreshtoken","requestbody","responsebody","secret","stderr","stdout","token","tooloutput"],qD=new Set(["onchainosagentlistresultjson","onchainosagentlistdiagnostictext"]),FD=new Set(["agentPlatform","cacheName","checkpoint","code","communicationClass","component","eventName","exitCode","kind","method","onchainosAgentId","operation","phase","platform","provider","reason","role","source","stage","status","subcommand","taskId","type"]),GD=["eventName","cacheName","checkpoint","component","method","operation","phase","reason","code","provider","type","kind","status","subcommand"],BD=new Set([h.GATEWAY_STARTED,h.GATEWAY_STOPPED,h.GATEWAY_DISCONNECTED,h.GATEWAY_REQUEST,h.GATEWAY_DELIVERY_BUFFERED,h.DAEMON_LIFECYCLE_SKIPPED,h.DAEMON_LIFECYCLE_REQUESTED,h.PROMPT_USER_CHECKPOINT,h.USER_WATCH_STARTED,h.USER_WATCH_EVENT_DELIVERED,h.CHANNEL_READY,h.CONVERSATION_STARTED,h.EVALUATE_CONVERSATION_STARTED,h.CONVERSATION_DELETED,h.USER_DISPATCHED,h.SESSION_DISPATCHED,h.SESSION_CREATED,h.SESSION_DELETED,h.SESSION_AUTO_RECOVERED,h.INBOUND_DELIVERED,h.INBOUND_DM_RAW,h.INBOUND_GROUP_RAW,h.SYSTEM_NOTIFICATION_RECEIVED,h.SYSTEM_NOTIFICATION_ROUTED,h.HERMES_SESSION_ROUTE_BINDING,h.INBOUND_BLOCKED_ADDRESS_MISMATCH,h.INBOUND_BLOCKED_INELIGIBLE,h.INBOUND_BLOCKED_SENSITIVE,h.INBOUND_DROP_DM_INVALID_PAYLOAD,h.INBOUND_DROP_DM_NON_SYSTEM,h.INBOUND_DROP_DM_UNKNOWN_AGENT,h.INBOUND_DROP_EMPTY_CONTENT,h.INBOUND_DROP_MISSING_JOBID,h.INBOUND_DROP_UNSUPPORTED_MSGTYPE,h.DM_DELIVERED,h.DM_FALLBACK_TO_BACKUP,h.DM_WHITELIST_FAIL_OPEN,h.INBOUND_BUYER_PENDING,h.INBOUND_BUYER_SESSION_AUTO_RECOVERED,h.MESSAGE_SENT,h.AGENT_CLIENT_CREATED,h.AGENT_CLIENT_REMOVED,h.ADDRESS_SYNC_COMPLETED,h.AGENTS_REFRESHED,h.AGENTS_WAKEUP_NOTIFIED,h.AGENT_LIST_QUERIED,h.BOOTSTRAP_APPLIED,h.CONFIG_SENSITIVE_WORDS_REFRESHED,h.CONFIG_SYSTEM_REFRESHED,h.CONVERSATION_HISTORY_QUERIED,h.FILE_DOWNLOADED,h.FILE_UPLOADED,h.GROUP_CONSENT_CHANGED,h.INBOUND_HANDLER_ENTERED,h.MESSAGE_RECEIVED,h.OFFLINE_REPLAY_MESSAGE_REPLAYED,h.AGENT_REFRESH_SESSION_EXPIRED,h.OUTBOUND_ELIGIBILITY_CHECKED,h.OUTBOUND_BLOCKED_INELIGIBLE,h.PENDING_CONVERSATION_DENIED,h.PENDING_LIST_QUERIED,h.SESSION_KEY_DERIVED,h.SESSIONS_QUERIED,h.SYNC_TICK_COMPLETED]),xo=256,j_=128,ud=class e{static instance;initialized=!1;buffer=[];constructor(){}static getInstance(){return e.instance||(e.instance=new e),e.instance}init(t){if(this.initialized){jd("[logger] Already initialized, skipping.");return}try{z.init({dsn:t.dsn,release:t.release,environment:t.environment,maxBreadcrumbs:0,beforeBreadcrumb:()=>null,isInner:!1}),z.setTags({projectName:t.projectName,agentPlatform:t.agentPlatform})}catch{return}this.initialized=!0,this.flush()}info(t,n){let r=e.sanitizeExtra({flowId:G_,...n??{}});if(BD.has(t)){if(!this.initialized){this.buffer.push({level:"info",message:t,extra:r});return}try{z.withScope(s=>{e.applyDiagnostics(s,t,r),z.captureEvent({level:"info",message:t,extra:{...r,eventName:t}})})}catch{}}}error(t,n,r){let s=e.sanitizeExtra({flowId:G_,...r??{}});if(!this.initialized){this.buffer.push({level:"error",message:t,error:n,extra:s});return}try{z.withScope(o=>{o.setLevel("error"),e.applyDiagnostics(o,t,s),z.captureException(e.createSentryEvent(t),{extra:n?{...s,eventName:t,errorName:n.name,errorMessageLength:String(n.message.length)}:s})})}catch{}}async shutdown(){try{await z.close(5e3)}catch{await z.flush(5e3)}}flush(){for(;this.buffer.length>0;){let t=this.buffer.shift();t.level==="info"?this.info(t.message,t.extra):this.error(t.message,t.error,t.extra)}}static sanitizeExtra(t){return Object.fromEntries(Object.entries(t).filter(([,n])=>n!==void 0).filter(([n])=>!e.isBlockedExtraKey(n)).map(([n,r])=>[n,e.safeValueForKey(n,r)]))}static isBlockedExtraKey(t){let n=t.toLowerCase(),r=e.normalizeSensitiveKey(t);return B_.has(n)||B_.has(r)?!0:e.isSafeMetricKey(r)?!1:LD.some(s=>r.includes(s))}static isSafeMetricKey(t){return/(bytes|count|length|ms|size)$/.test(t)}static safeValueForKey(t,n){return typeof n=="string"&&qD.has(e.normalizeSensitiveKey(t))?n:e.safeValue(n)}static normalizeSensitiveKey(t){return t.toLowerCase().replace(/[^a-z0-9]/g,"")}static safeValue(t){if(typeof t=="string")return t.length<=xo?t:`${t.slice(0,xo)}...`;if(t==null||typeof t=="number"||typeof t=="boolean")return t;if(typeof t=="bigint")return t.toString();if(t instanceof Error)return{name:t.name,messageLength:t.message.length};if(Array.isArray(t))return t.slice(0,20).map(r=>e.safeValue(r));if(typeof t=="object")return Object.fromEntries(Object.entries(t).slice(0,50).filter(([,r])=>r!==void 0).filter(([r])=>!e.isBlockedExtraKey(r)).map(([r,s])=>[r,e.safeValueForKey(r,s)]));let n=String(t);return n.length<=xo?n:`${n.slice(0,xo)}...`}static tagValue(t){let n=String(t);return n.length<=j_?n:`${n.slice(0,j_)}...`}static normalizeTagKey(t){return t.replace(/[^A-Za-z0-9_.:-]+/g,"_").slice(0,32)||"unknown"}static applyDiagnostics(t,n,r){let s={eventName:n,...r};for(let[i,a]of Object.entries(s))FD.has(i)&&t.setTag(e.normalizeTagKey(i),e.tagValue(a));let o=["a2a",n];for(let i of GD){let a=s[i];a&&o.push(`${i}:${e.tagValue(a)}`)}t.setFingerprint(o)}static toPascalCase(t){return t.split(/[\s:]+/).filter(Boolean).map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}static createSentryEvent(t){let n=new Error(t);return n.name=e.toPascalCase(t),n.stack=`${n.name}: ${t}`,n}},b=ud.getInstance(),H_=e=>b.init(e),Y_=()=>b.shutdown()});function dd(){return Sn||(process.env.OKX_AGENT_TASK_HOME?(Sn=Po(process.env.OKX_AGENT_TASK_HOME),Sn):(Sn=Po((0,Uo.join)(HD(),".okx-agent-task")),Sn))}function Po(e){return $D(e)}function $D(e){(0,Mo.mkdirSync)(e,{recursive:!0,mode:W_});try{(0,Mo.chmodSync)(e,W_)}catch(t){let n=t.code;if(n!=="EPERM"&&n!=="EACCES")throw t}return e}function HD(){try{let e=(0,V_.homedir)();if(e)return e}catch(e){}return(0,Uo.resolve)(process.cwd())}var V_,Uo,Mo,Sn,W_,z_=ee(()=>{"use strict";V_=require("node:os"),Uo=require("node:path"),Mo=require("node:fs"),Sn=null,W_=448});function YD(e=dd()){return(0,X_.join)(e,"openclaw-gateway.json")}function J_(e,t=dd()){let n=Po(t),r=YD(n),s=`${r}.${process.pid}.tmp`,o={version:1,url:e.url,...e.password?{password:e.password}:{},...e.token?{token:e.token}:{},updatedAt:new Date().toISOString(),source:"openclaw-plugin"};(0,Qe.writeFileSync)(s,`${JSON.stringify(o,null,2)}
34
+ `,{encoding:"utf8",mode:384});try{(0,Qe.chmodSync)(s,384)}catch{}(0,Qe.renameSync)(s,r);try{(0,Qe.chmodSync)(r,384)}catch{}return r}var Qe,X_,Q_=ee(()=>{"use strict";Qe=require("node:fs"),X_=require("node:path");z_()});function Go(e){return e.includes(qo)||e.includes(`:${Fo}:`)}function ld(e){if(!(!e||e==="direct"||e==="@direct"))return e.startsWith("telegram:")||e.startsWith("@")?e:`telegram:${e}`}function KD(e,t){let n=e.split(":");if(t==="telegram"){let r=n.indexOf("telegram"),s=r>=0?n.slice(r+1):n.slice(3),o=s.indexOf("direct");if(o>=0){let i=o>0?s[o-1]:void 0,a=s[o+1]==="telegram"&&s[o+2]?`telegram:${s[o+2]}`:s[o+1];return{to:ld(a),accountId:i}}if(s[0]==="telegram"&&s[1])return{to:`telegram:${s[1]}`,accountId:void 0};if(s[1]==="telegram"&&s[2])return{to:`telegram:${s[2]}`,accountId:s[0]};if(s.length>=2)return{to:ld(s[1]),accountId:s[0]};if(s.length===1)return{to:ld(s[0]),accountId:void 0}}return{to:n[4],accountId:void 0}}function Z_(e,t){return typeof e!="string"||e==="direct"||e==="@direct"?t:e}function WD(e){if(e==="agent:main")return"main";let t=e.split(":");return t.length<4||t[0]!=="agent"||!t[1]||!t[2]||Go(e)||t[2]==="backup"?null:t[2]}function th(e,t){let n=t??{},r=n.deliveryContext?.channel??n.lastChannel??n.origin?.provider??WD(e);if(!r)return null;let s=KD(e,r),o=Z_(n.deliveryContext?.to,s.to)??Z_(n.lastTo,s.to)??s.to,i=n.deliveryContext?.accountId??s.accountId;return{channel:r,target:{sessionKey:e,to:o,accountId:i,updatedAt:n.lastInteractionAt??n.updatedAt??Date.now()}}}function nh(e){if(Go(e))return null;let t=qe(),n=t.agent.session.resolveStorePath(void 0,{agentId:"main"}),r=t.agent.session.loadSessionStore(n,{skipCache:!0});return th(e,r[e])}function eh(e){return e.toLowerCase().startsWith("0x")}function VD(e){if(typeof e=="string")return`${qo}:${e}`;let t="myAgentId"in e&&"toAgentId"in e?new URLSearchParams({my:e.myAgentId,to:e.toAgentId,job:e.jobId}):new URLSearchParams({my:e.myXmtpAddress,to:e.toXmtpAddress,job:e.jobId});return`${qo}:${t.toString()}`}function pd(e){let t=`${qo}:`,n=e.indexOf(t);if(n===-1)return null;let r=new URLSearchParams(e.slice(n+t.length)),s=r.get("myAgentId")||r.get("myagentid"),o=r.get("toAgentId")||r.get("toagentid"),i=r.get("my"),a=r.get("to"),c=r.get("job"),u=r.get("gid");return s&&o&&c?{format:"agent",myAgentId:s,toAgentId:o,jobId:c,xmtpGroupId:u??""}:!i||!a||!c?null:!eh(i)&&(a==="_"||!eh(a))?{format:"agent",myAgentId:i,toAgentId:a,jobId:c,xmtpGroupId:u??""}:{format:"address",myXmtpAddress:i,toXmtpAddress:a,jobId:c,xmtpGroupId:u??""}}function xr(e){if(!e)return"";let t=pd(e);return t?.jobId?t.jobId:/(?:^|:)backup:([^:&]+)/.exec(e)?.[1]??""}function Ur(e){let t=e.taskId?.trim()||xr(e.scopeKey)||xr(e.sessionKey);return t?{taskId:t}:{}}function zD(e){let t=typeof e=="string"?e:VD(e);return(0,Pr.buildAgentSessionKey)({agentId:"main",channel:Fo,peer:{kind:"group",id:t}})}function rh(){let n=qe().config.loadConfig().agents?.list;if(n&&n.length>0){let r=n.find(s=>s.id==="main");return r?r.id:n[0].id}return"main"}function sh(){return(0,Pr.buildAgentSessionKey)({agentId:rh(),channel:Fo,peer:{kind:"group",id:"backup"}})}function XD(e){return(0,Pr.buildAgentSessionKey)({agentId:rh(),channel:Fo,peer:{kind:"group",id:`backup:${e}`}})}function Bo(){let e=qe(),t=e.agent.session.resolveStorePath(void 0,{agentId:"main"}),n=e.agent.session.loadSessionStore(t,{skipCache:!0}),r=new Map,s=new Map;for(let[o,i]of Object.entries(n)){if(Go(o))continue;let a=i;if(a.spawnedBy||a.subagentRole)continue;let c=th(o,i);if(!c)continue;let{channel:u,target:d}=c,{to:l,updatedAt:p}=d;l&&(!s.get(u)||p>(r.get(u)?.updatedAt??0))&&s.set(u,l);let f=r.get(u);(!f||p>f.updatedAt)&&r.set(u,d)}for(let[o,i]of r)if(!i.to){let a=s.get(o);a&&(i.to=a)}for(let[o,i]of r)y(`[findLatestUserSessions] channel=${o} winner=${i.sessionKey} to=${i.to??"(none)"} accountId=${i.accountId??"(none)"} interactedAt=${i.updatedAt}`);return r}function oh(e){let t=new Set,n=[...e.sessionKey?[e.sessionKey]:[],...Array.isArray(e.sessionKeys)?e.sessionKeys:[]].filter(s=>s.trim()),r=[];e.jobId&&r.push({jobId:e.jobId,myAgentId:e.myAgentId,toAgentId:e.toAgentId,myXmtpAddress:e.myXmtpAddress,toXmtpAddress:e.toXmtpAddress});for(let s of n){if(s.startsWith("agent:")){t.add(s);continue}let o=eN(s);if(o){t.add(XD(o));continue}let i=ih(s);if(i){r.push(i);continue}let a=pd(s);if(a){r.push(ZD(a));continue}t.add(zD(s))}for(let s of JD())for(let o of r)if(QD(s,o)){t.add(s);break}return[...t].sort()}function JD(){let e=qe(),t=e.agent.session.resolveStorePath(void 0,{agentId:"main"}),n=e.agent.session.loadSessionStore(t,{skipCache:!0});return Object.keys(n).filter(Go)}function QD(e,t){let n=pd(e);if(n)return tN(n,t);let r=ih(e);return r?!(t.jobId&&r.jobId!==t.jobId||t.myAgentId&&r.myAgentId!==t.myAgentId||t.toAgentId&&r.toAgentId!==t.toAgentId||t.myXmtpAddress&&!t.myAgentId||t.toXmtpAddress&&!t.toAgentId):!t.jobId||t.myAgentId||t.toAgentId||t.myXmtpAddress||t.toXmtpAddress?!1:xr(e)===t.jobId}function ZD(e){return"myAgentId"in e?{myAgentId:e.myAgentId,toAgentId:e.toAgentId,jobId:e.jobId}:{myXmtpAddress:e.myXmtpAddress,toXmtpAddress:e.toXmtpAddress,jobId:e.jobId}}function ih(e){let t=e.split(":"),n=t.indexOf("job");return n<0||t[n+2]!=="my"||t[n+4]!=="to"||!t[n+1]||!t[n+3]||!t[n+5]?null:{jobId:Lo(t[n+1]),myAgentId:Lo(t[n+3]),toAgentId:Lo(t[n+5])}}function eN(e){return e.startsWith("backup:")?Lo(e.slice(7)):null}function tN(e,t){return t.jobId&&e.jobId!==t.jobId?!1:"myAgentId"in e?!(t.myAgentId&&e.myAgentId!==t.myAgentId||t.toAgentId&&e.toAgentId!==t.toAgentId||t.myXmtpAddress&&!t.myAgentId||t.toXmtpAddress&&!t.toAgentId):!(t.myXmtpAddress&&e.myXmtpAddress.toLowerCase()!==t.myXmtpAddress.toLowerCase()||t.toXmtpAddress&&e.toXmtpAddress.toLowerCase()!==t.toXmtpAddress.toLowerCase()||t.myAgentId&&!t.myXmtpAddress||t.toAgentId&&!t.toXmtpAddress)}function Lo(e){try{return decodeURIComponent(e)}catch{return e}}var Pr,qo,Fo,Tn=ee(()=>{"use strict";te();Pr=require("openclaw/plugin-sdk/routing");Nn();qo="okx-xmtp",Fo="okx-a2a"});function fd(e){if(e){if(typeof e=="string")return e;if(typeof e=="object"&&e!==null&&"env"in e)return process.env[e.env]||void 0}}function oN(e){return e&&(typeof e=="string"?{type:"string",configured:!0}:typeof e=="object"&&e!==null&&"env"in e?{type:"env",env:String(e.env),configured:!!fd(e)}:{type:typeof e,configured:!0})}function gd(e){if(!e||typeof e!="object")return e??null;if(Array.isArray(e))return e.map(n=>gd(n));let t={};for(let[n,r]of Object.entries(e)){if(/password|token|secret/i.test(n)){t[n]=oN(r);continue}t[n]=gd(r)}return t}function iN(e){try{return JSON.stringify(e)}catch{return"[unserializable]"}}function aN(e){let t=e.params;if(!t||typeof t!="object"||Array.isArray(t))return Ur({taskId:e.taskId});let n=t;return Ur({taskId:e.taskId,sessionKey:typeof n.sessionKey=="string"?n.sessionKey:typeof n.key=="string"?n.key:""})}function fh(e){let t={};for(let[n,r]of Object.entries(e))r!=null&&(t[n]=String(r));return t}function Te(e,t={}){let n=fh({phase:e,...t});y(`[gateway] ${e}: ${JSON.stringify(n)}`),b.info(e.startsWith("request_")?h.GATEWAY_REQUEST:h.GATEWAY_STARTED,{component:"openclaw_gateway",...n})}function In(e,t,n={},r=h.GATEWAY_CONNECT_FAILED){let s=fh({phase:e,component:"openclaw_gateway",...n});y(`[gateway] ${e}:`,t),b.error(r,t instanceof Error?t:new Error(String(t)),s)}function cN(e){for(let t of _d)try{t(e)}catch(n){y("[gateway] event handler failed:",n)}}function gh(e){return _d.add(e),()=>{_d.delete(e)}}function ch(){Te("ready_gate_reset",{hasSharedClient:!!Ue,hasConnected:Pe}),bn=new Promise((e,t)=>{jo=e,$o=t})}function uh(e,t,n){if(Ue!==e){Te(`${t}_skip_clear_noncurrent`,n);return}try{e.stop?.()}catch(r){In(`${t}_stop_failed`,r,n)}Ue=null,Pe=!1,bn=null,jo=null,$o=null,Te(`${t}_cleared_client`,n)}function uN(){if(Ue)return Te("reuse_client",{hasConnected:Pe,hasReadyPromise:!!bn}),{client:Ue,ready:bn};let e=_h(),{url:t,password:n,token:r}=e,s=(0,hd.randomUUID)(),o=++sN;ch(),Te("init_client",{clientSeq:o,instanceId:s,url:t,hasGatewayConfig:!!e.rawGatewayConfig,gatewayConfig:iN(gd(e.rawGatewayConfig)),passwordConfigured:!!n,tokenConfigured:!!r,scopes:ah.join(",")});let i=new ph.GatewayClient({url:t,password:n,token:r,instanceId:s,clientName:"gateway-client",clientDisplayName:"okx-a2a-plugin",mode:"backend",role:"operator",scopes:[...ah],onHelloOk:()=>{Te("hello_ok",{clientSeq:o,instanceId:s,url:t}),Pe=!0,jo?.()},onEvent:cN,onClose:(a,c)=>{if(y(`[gateway] closed (${a}): ${c||"no reason"}`),b.info(h.GATEWAY_DISCONNECTED,{clientSeq:String(o),instanceId:s,url:t,code:String(a),reason:c||"no-reason",hadConnected:String(Pe)}),Pe){Pe=!1,ch();return}uh(i,"close_before_connect",{clientSeq:o,instanceId:s,url:t,code:a,reason:c||"no-reason"})},onConnectError:a=>{let c=a;if(c?.retryable){In("connect_error_retryable",a,{clientSeq:o,instanceId:s,url:t,retryable:"true",reason:c?.details?.reason??"retryable",code:c?.gatewayCode??c?.details?.code});return}In("connect_error",a,{clientSeq:o,instanceId:s,url:t,retryable:"false",code:c?.gatewayCode??c?.details?.code}),$o?.(a instanceof Error?a:new Error(String(a))),uh(i,"connect_error",{clientSeq:o,instanceId:s,url:t,code:c?.gatewayCode??c?.details?.code,reason:c?.details?.reason})}});return Ue=i,Te("start_client",{clientSeq:o,instanceId:s,url:t}),i.start(),{client:i,ready:bn}}function _h(){let t=qe().config.loadConfig().gateway;return{url:`ws://127.0.0.1:${dh(process.env.OPENCLAW_GATEWAY_PORT)??dh(t?.port)??rN}`,password:fd(t?.auth?.password),token:fd(t?.auth?.token),rawGatewayConfig:t}}function dh(e){if(typeof e=="number"&&Number.isFinite(e)){let r=Math.trunc(e);return r>0&&r<=65535?r:null}if(typeof e!="string")return null;let t=e.trim();if(!/^\d+$/.test(t))return null;let n=Number.parseInt(t,10);return n>0&&n<=65535?n:null}function hh(){let e=_h();try{let t=J_({url:e.url,password:e.password,token:e.token});return Te("synced_node_gateway_config",{path:t,url:e.url,passwordConfigured:!!e.password,tokenConfigured:!!e.token}),t}catch(t){return In("sync_node_gateway_config_failed",t,{url:e.url,passwordConfigured:!!e.password,tokenConfigured:!!e.token},h.GATEWAY_CONNECT_FAILED),null}}function mh(){if(Ue){try{Ue.stop()}catch{}Ue=null,bn=null,jo=null,$o=null,Pe=!1}}function md(e){let t=e,n=t?.gatewayCode??t?.details?.code;if(!n)return null;let r=t?.details??{},s=[`code=${n}`];r.reason&&s.push(`reason=${r.reason}`),r.authReason&&s.push(`authReason=${r.authReason}`),Array.isArray(r.requestedScopes)&&r.requestedScopes.length&&s.push(`requestedScopes=${r.requestedScopes.join(",")}`),r.deviceId&&s.push(`deviceId=${r.deviceId}`),r.requestId&&s.push(`requestId=${r.requestId}`);let o=` (${s.join(", ")})`;switch(n){case"NOT_PAIRED":case"PAIRING_REQUIRED":return`Device pairing approval pending${o}. On the openclaw host run \`openclaw devices approve --latest\` to review and approve the pending request, then retry.`;case"AUTH_SCOPE_MISMATCH":return`Existing device token lacks the required scope${o}. On the openclaw host run \`openclaw devices list\` to find the operator deviceId, then \`openclaw devices rotate --device <id> --role operator --scope operator.admin\` to reissue a token with operator.admin, and restart openclaw.`;case"AUTH_TOKEN_MISSING":case"AUTH_TOKEN_MISMATCH":case"AUTH_DEVICE_TOKEN_MISMATCH":return`Gateway device token is missing or stale${o}. On the openclaw host run \`openclaw devices list\`, then \`openclaw devices remove <deviceId>\`, then restart openclaw to re-pair.`;default:return null}}async function Ze(e){let t=e.timeoutMs??nN,n=Date.now(),r=aN(e);Te("request_start",{method:e.method,timeoutMs:t,hasSharedClient:!!Ue,hasConnected:Pe,...r});let{client:s,ready:o}=uN();try{await o}catch(a){let c=Date.now()-n;throw In("request_ready_failed",a,{method:e.method,durationMs:c,timeoutMs:t,...r,code:a?.gatewayCode??a?.code??a?.details?.code,reason:"gateway_ready_failed",communicationClass:"openclaw_gateway_connect"},h.GATEWAY_REQUEST_FAILED),a}let i=Date.now()-n;Te("request_ready",{method:e.method,readyWaitMs:i,timeoutMs:t,hasConnected:Pe,...r});try{let a=await s.request(e.method,e.params,{timeoutMs:t});return Te("request_done",{method:e.method,durationMs:Date.now()-n,timeoutMs:t,...r}),a}catch(a){let c=Date.now()-n,u=/timeout|timed out/i.test(String(a?.message??a??""));In("request_error",a,{method:e.method,durationMs:c,timeoutMs:t,readyWaitMs:i,...r,isTimeout:u,code:a?.gatewayCode??a?.code??a?.details?.code,reason:u?"gateway_request_timeout":"gateway_request_error",communicationClass:"openclaw_gateway_rpc"},h.GATEWAY_REQUEST_FAILED);let d=md(a);if(d){let l=a?.message??String(a);try{a.message=`${l}
35
+ ${d}`}catch{}}throw a}}async function Ho(e){return Ze({method:"sessions.create",params:e})}async function Eh(e){return Ze({method:"sessions.delete",params:e})}async function Mr(e){let t=e.idempotencyKey??(0,hd.randomUUID)(),n={key:e.key,message:e.message,idempotencyKey:t};try{let r=await Ze({method:"sessions.send",params:n});return{runId:lh(r),raw:r}}catch(r){let s=r?.gatewayCode??r?.code,o=String(r?.message??"");if(s==="INVALID_REQUEST"&&o.includes("session not found")){await Ho({key:e.key}),b.info(h.SESSION_AUTO_RECOVERED,{sessionKey:e.key,trigger:"sessions.send"});let i=await Ze({method:"sessions.send",params:n});return{runId:lh(i),raw:i}}throw r}}function lh(e){if(!e||typeof e!="object")return;let t=e.runId;return typeof t=="string"&&t.trim()?t:void 0}async function Lr(e){try{return await Ze({method:"chat.inject",params:e})}catch(t){let n=t?.gatewayCode??t?.code,r=String(t?.message??"");if(n==="INVALID_REQUEST"&&r.includes("session not found"))return await Ho({key:e.sessionKey}),b.info(h.SESSION_AUTO_RECOVERED,{sessionKey:e.sessionKey,trigger:"chat.inject"}),await Ze({method:"chat.inject",params:e});throw t}}var ph,hd,nN,rN,ah,sN,Ue,bn,jo,$o,Pe,_d,An=ee(()=>{"use strict";te();ph=require("openclaw/plugin-sdk/gateway-runtime"),hd=require("node:crypto");Nn();se();Q_();Tn();nN=2e4,rN=18789,ah=["operator.admin"],sN=0;Ue=null,bn=null,jo=null,$o=null,Pe=!1,_d=new Set});function bh(e){if(e.toolName!=="exec")return null;let t=e.sessionKey?.trim(),n=new Set;for(let o of e.routeSessionKeys??[]){let i=o?.trim();i&&n.add(i)}if(t&&n.add(t),n.size===0)return null;yd(t);let r=e.params??{},s=bN(r.env)?r.env:{};return{...r,env:{...s,[pN]:"openclaw",[fN]:"openclaw-gateway",[gN]:"1",[dN]:t??[...n][0],[lN]:JSON.stringify([...n])}}}function Ih(e){let t=e.runId?.trim(),n=e.sessionKey?.trim();return!n||!Yo(n)?!1:(Sd(),EN(n),t&&Gr.set(t,{sessionKey:n,updatedAt:Date.now()}),!0)}function Ah(e){let t=typeof e=="string"?e.trim():e?.runId?.trim(),n=typeof e=="string"?null:e?.sessionKey?.trim();t&&Gr.delete(t),n&&Yo(n)&&yN(n)}function Ko(e){let t=new Set,n=e.sessionKey?.trim();n&&Yo(n)&&t.add(n);let r=e.runId?.trim();if(r){Sd(e.now??Date.now());let s=Gr.get(r);s?.sessionKey&&t.add(s.sessionKey)}else if(!n||!Yo(n)){let s=SN(e.now??Date.now());s&&t.add(s)}return[...t]}function yd(e){let t=e?.trim();!t||!mN(t)||(qr={sessionKey:t,updatedAt:Date.now()})}function Rh(e=Date.now()){return qr?e-qr.updatedAt>_N?(qr=null,null):qr.sessionKey:null}function mN(e){return e.startsWith("job:")||e.startsWith("backup:")||/(?:^|[?&:])job=([^:&]+)/.test(e)}function Yo(e){if(e==="agent:main")return!0;let t=e.split(":");if(t.length<4||t[0]!=="agent"||!t[1])return!1;let n=t[2];return!!(n&&n!=="okx-a2a"&&!hN.has(n))}function Sd(e=Date.now()){for(let[t,n]of Gr)e-n.updatedAt>Sh&&Gr.delete(t);for(let[t,n]of et)e-n.updatedAt>Sh&&et.delete(t)}function EN(e){let t=et.get(e);et.set(e,{count:(t?.count??0)+1,updatedAt:Date.now()}),Ed()}function yN(e){let t=et.get(e);if(t){if(t.count<=1){et.delete(e),Ed();return}et.set(e,{count:t.count-1,updatedAt:Date.now()}),Ed()}}function SN(e=Date.now()){Sd(e);let t=[...et.keys()];return t.length===1?t[0]:null}function Ed(){try{let e=TN();(0,Rn.mkdirSync)((0,Fr.dirname)(e),{recursive:!0,mode:448});let n={version:1,updatedAt:Date.now(),origins:[...et.entries()].map(([s,o])=>({sessionKey:s,count:o.count,updatedAt:o.updatedAt}))},r=`${e}.${process.pid}.tmp`;(0,Rn.writeFileSync)(r,`${JSON.stringify(n)}
36
+ `,{encoding:"utf8",mode:384}),(0,Rn.renameSync)(r,e)}catch(e){console.log(`[okx-a2a:hook] failed to persist gateway route origins: ${e instanceof Error?e.message:String(e)}`)}}function TN(e=process.env){let t=e.OKX_AGENT_TASK_HOME?.trim()||(0,Fr.join)((0,Th.homedir)(),".okx-agent-task");return(0,Fr.join)(t,"run","gateway-route-origins.json")}function bN(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Rn,Th,Fr,dN,lN,pN,fN,gN,_N,Sh,hN,qr,Gr,et,Td=ee(()=>{"use strict";Rn=require("node:fs"),Th=require("node:os"),Fr=require("node:path"),dN="OKX_A2A_CURRENT_GATEWAY_SESSION_KEY",lN="OKX_A2A_CURRENT_GATEWAY_SESSION_KEYS",pN="OKX_A2A_GATEWAY_PROVIDER",fN="OKX_A2A_RUNTIME_CONTEXT",gN="OKX_A2A_IN_GATEWAY",_N=12e4,Sh=30*6e4,hN=new Set(["heartbeat","cron","webhook","voice"]),qr=null,Gr=new Map,et=new Map});function AN(e=process.env){return e.OKX_AGENT_TASK_HOME?.trim()||(0,bd.join)((0,Oh.homedir)(),".okx-agent-task")}function RN(e=process.env){return e.OKX_A2A_SESSION_STORE_DB_PATH?.trim()||(0,bd.join)(AN(e),"sqlite","session-store.sqlite")}function Ch(e){let t=Me(e.jobId)??xr(e.sessionKey);return t?vN(ON(t,e.dbPath??RN())):[]}function vN(e){let t=new Set,n=[];for(let r of e){let s=Me(r.gatewaySessionKey)??Me(r.sessionKey),o=NN(s);!s||!o||t.has(o)||(t.add(o),n.push(s))}return n}function ON(e,t){if(!(0,vh.existsSync)(t))return[];let{DatabaseSync:n}=CN(),r=new n(t,{readOnly:!0});try{if(r.exec("PRAGMA busy_timeout=5000"),!r.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='job_provider_bindings'").get())return[];let o=r.prepare("SELECT provider, gateway_routes_json FROM job_provider_bindings WHERE job_id = ?").get(e);return o?.provider!=="openclaw"||typeof o.gateway_routes_json!="string"?[]:DN(o.gateway_routes_json)}catch(s){return console.log(`[okx-a2a:stored-routes] failed to resolve job route jobId=${e}: ${s instanceof Error?s.message:String(s)}`),[]}finally{r.close()}}function CN(){let e=process.emitWarning;process.emitWarning=((t,...n)=>{if(!((typeof t=="string"?t:t.message).includes("SQLite is an experimental feature")&&n.some(s=>s==="ExperimentalWarning")))return e.call(process,t,...n)});try{return require("node:sqlite")}finally{process.emitWarning=e}}function DN(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return[];let n=[];for(let r of t){if(!wN(r))continue;let s=Me(typeof r.platform=="string"?r.platform:null),o=Me(typeof r.sessionKey=="string"?r.sessionKey:null);if(!s||!o)continue;let i=Me(typeof r.gatewaySessionKey=="string"?r.gatewaySessionKey:null),a=Me(typeof r.chatId=="string"?r.chatId:null),c=Me(typeof r.threadId=="string"?r.threadId:null),u=Me(typeof r.updatedAt=="string"?r.updatedAt:null);n.push({platform:s,sessionKey:o,...i?{gatewaySessionKey:i}:{},...a?{chatId:a}:{},...c?{threadId:c}:{},...u?{updatedAt:u}:{}})}return n}catch{return[]}}function NN(e){let t=Me(e);if(!t)return null;if(t==="agent:main")return"main";if(t.startsWith("backup:"))return null;let n=t.split(":");if(n.length<4||n[0]!=="agent"||!n[1])return null;let r=n[2];return!r||r==="okx-a2a"||r==="backup"||IN.has(r)?null:r}function wN(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Me(e){let t=e?.trim();return t||null}var vh,Oh,bd,IN,Dh=ee(()=>{"use strict";vh=require("node:fs"),Oh=require("node:os"),bd=require("node:path");Tn();IN=new Set(["heartbeat","cron","webhook","voice"])});function Ad(e){let t=vn(e.jobId)??MN([e.content,...e.contents??[]]);if(!t)return console.log("[okx-a2a:stored-routes] skipped delivered route bind reason=missing_job_id"),[];let n=e.sessionKeys.map(i=>xN(i)).filter(i=>!!i);if(n.length===0)return[];let r=e.dbPath??qN(),{DatabaseSync:s}=FN(),o=new s(r);try{o.exec("PRAGMA busy_timeout=5000"),o.exec(`
37
+ CREATE TABLE IF NOT EXISTS job_provider_bindings (
38
+ job_id TEXT PRIMARY KEY,
39
+ provider TEXT NOT NULL CHECK (provider IN ('codex', 'claude', 'hermes', 'openclaw')),
40
+ gateway_routes_json TEXT,
41
+ created_at TEXT NOT NULL,
42
+ updated_at TEXT NOT NULL
43
+ )
44
+ `);let i=new Date().toISOString();o.prepare("INSERT OR IGNORE INTO job_provider_bindings(job_id, provider, created_at, updated_at) VALUES (?, 'openclaw', ?, ?)").run(t,i,i);let a=o.prepare("SELECT provider, gateway_routes_json FROM job_provider_bindings WHERE job_id = ?").get(t);if(a?.provider!=="openclaw")return[];let c=PN(a.gateway_routes_json),u=new Set(c.map(l=>l.platform)),d=[];for(let l of n)u.has(l.platform)||(c.push(l),u.add(l.platform),d.push(l.gatewaySessionKey));return d.length===0?[]:(o.prepare("UPDATE job_provider_bindings SET gateway_routes_json = ?, updated_at = ? WHERE job_id = ? AND provider = 'openclaw'").run(JSON.stringify(c),i,t),console.log(`[okx-a2a:stored-routes] bound delivered route jobId=${t} sessionKeys=${d.join(",")}`),d)}catch(i){return console.log(`[okx-a2a:stored-routes] failed to bind delivered route jobId=${t}: ${i instanceof Error?i.message:String(i)}`),[]}finally{o.close()}}function xN(e){let t=vn(e);if(!t)return null;let n=wh(t);if(!n)return null;let r=UN(t);return{platform:n,sessionKey:t,gatewaySessionKey:t,...r.chatId?{chatId:r.chatId}:{},...r.threadId?{threadId:r.threadId}:{},updatedAt:new Date().toISOString()}}function PN(e){if(typeof e!="string"||!e.trim())return[];try{let t=JSON.parse(e);if(!Array.isArray(t))return[];let n=[];for(let r of t){if(!GN(r))continue;let s=vn(typeof r.gatewaySessionKey=="string"?r.gatewaySessionKey:null)??vn(typeof r.sessionKey=="string"?r.sessionKey:null),o=wh(s);!s||!o||n.push({platform:o,sessionKey:s,gatewaySessionKey:s,...typeof r.chatId=="string"&&r.chatId.trim()?{chatId:r.chatId.trim()}:{},...typeof r.threadId=="string"&&r.threadId.trim()?{threadId:r.threadId.trim()}:{},...typeof r.updatedAt=="string"&&r.updatedAt.trim()?{updatedAt:r.updatedAt.trim()}:{updatedAt:new Date().toISOString()}})}return n}catch{return[]}}function UN(e){let t=e.split(":");if(t.length<4||t[0]!=="agent")return{};let n=t[2],r=t[3];return n==="discord"&&r==="thread"?{...t[4]?{chatId:t[4]}:{},...t[5]?{threadId:t[5]}:{}}:n==="discord"&&(r==="channel"||r==="dm")?t[4]?{chatId:t[4]}:{}:n==="telegram"&&r==="direct"?t[4]?{chatId:t[4]}:{}:n==="telegram"&&r==="group"?{...t[4]?{chatId:t[4]}:{},...t[6]?{threadId:t[6]}:{}}:{}}function MN(e){for(let t of e){let n=vn(t);if(!n)continue;let r=/\b0x[a-fA-F0-9]{64}\b/.exec(n);if(r?.[0])return r[0]}return null}function wh(e){let t=vn(e);if(!t)return null;if(t==="agent:main")return"main";if(t.startsWith("backup:"))return null;let n=t.split(":");if(n.length<4||n[0]!=="agent"||!n[1])return null;let r=n[2];return!r||r==="okx-a2a"||r==="backup"||kN.has(r)?null:r}function LN(e=process.env){return e.OKX_AGENT_TASK_HOME?.trim()||(0,Id.join)((0,Nh.homedir)(),".okx-agent-task")}function qN(e=process.env){return e.OKX_A2A_SESSION_STORE_DB_PATH?.trim()||(0,Id.join)(LN(e),"sqlite","session-store.sqlite")}function FN(){let e=process.emitWarning;process.emitWarning=((t,...n)=>{if(!((typeof t=="string"?t:t.message).includes("SQLite is an experimental feature")&&n.some(s=>s==="ExperimentalWarning")))return e.call(process,t,...n)});try{return require("node:sqlite")}finally{process.emitWarning=e}}function GN(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vn(e){let t=e?.trim();return t||null}var Nh,Id,kN,kh=ee(()=>{"use strict";Nh=require("node:os"),Id=require("node:path"),kN=new Set(["heartbeat","cron","webhook","voice"])});var Vo={};Gd(Vo,{isPromptUserSessionRunning:()=>BN,markPromptUserSessionEnded:()=>Cd,markPromptUserSessionRunning:()=>Od,queuePromptUserAction:()=>jN});function Bt(e){let t=xh.get(e);return t||(t={running:!1,processing:!1,queue:[]},xh.set(e,t)),t}function Rd(e,t,n){e.fallbackTimer&&(clearTimeout(e.fallbackTimer),e.fallbackTimer=void 0,t&&y(`[xmtp_prompt_user:queue] fallback cleared sessionKey=${t}${n?` reason=${n}`:""}`))}function vd(e,t){Rd(t,e,"reschedule");let n=t.queue[0];if(!n||t.processing)return;let r=Math.max(0,n.deadlineAt-Date.now());y(`[xmtp_prompt_user:queue] fallback scheduled sessionKey=${e} channel=${n.channel} delayMs=${r} queued=${t.queue.length}`),b.info(h.PROMPT_USER_CHECKPOINT,gt({checkpoint:"fallback_scheduled",sessionKey:e,channel:n.channel,taskId:n.taskId,delayMs:r,queued:t.queue.length})),t.fallbackTimer=setTimeout(()=>{let s=Bt(e);s.fallbackTimer=void 0,y(`[xmtp_prompt_user:queue] fallback fired sessionKey=${e} queued=${s.queue.length}`),b.info(h.PROMPT_USER_CHECKPOINT,gt({checkpoint:"fallback_fired",sessionKey:e,taskId:s.queue[0]?.taskId,queued:s.queue.length,reason:"fallback_timeout"})),jr(e,"fallback_timeout")},r)}async function jr(e,t){let n=Bt(e);if(n.processing)return;let r=n.queue.shift();if(!r){Rd(n,e,"empty_queue"),y(`[xmtp_prompt_user:queue] dispatch skipped empty sessionKey=${e} reason=${t}`);return}Rd(n,e,t),n.processing=!0;try{y(`[xmtp_prompt_user:queue] dispatch sessionKey=${e} channel=${r.channel} reason=${t} remaining=${n.queue.length}`),b.info(h.PROMPT_USER_CHECKPOINT,gt({checkpoint:"dispatch_started",sessionKey:e,channel:r.channel,taskId:r.taskId,reason:t,queued:n.queue.length}));let s=await Mh({...r,onRunStarted:o=>{let i=Wo.get(o);if(i){y(`[xmtp_prompt_user:queue] run already completed sessionKey=${e} channel=${r.channel} runId=${o} state=${i.state} completedAt=${i.completedAt}`),Wo.delete(o);return}Br.set(o,{sessionKey:e,channel:r.channel,taskId:r.taskId,startedAt:Date.now()}),y(`[xmtp_prompt_user:queue] run pending sessionKey=${e} channel=${r.channel} runId=${o}`),b.info(h.PROMPT_USER_CHECKPOINT,gt({checkpoint:"run_pending",sessionKey:e,channel:r.channel,taskId:r.taskId,runId:o}))}});n.running=!s.runId||Br.has(s.runId),y(`[xmtp_prompt_user:queue] dispatch completed sessionKey=${e} channel=${r.channel} reason=${t} running=${n.running?1:0} runId=${s.runId??"(none)"}`),b.info(h.PROMPT_USER_CHECKPOINT,gt({checkpoint:"dispatch_completed",sessionKey:e,channel:r.channel,taskId:r.taskId,reason:t,running:n.running?1:0,runId:s.runId,queued:n.queue.length}))}catch(s){y(`[xmtp_prompt_user:queue] dispatch failed sessionKey=${e} channel=${r.channel} reason=${t}:`,s),b.error(h.PROMPT_USER_FAILED,s instanceof Error?s:new Error(String(s)),gt({checkpoint:"dispatch_failed",sessionKey:e,channel:r.channel,taskId:r.taskId,reason:t,queued:n.queue.length}))}finally{n.processing=!1}if(n.queue.length===0){y(`[xmtp_prompt_user:queue] queue drained sessionKey=${e}`);return}if(n.running){y(`[xmtp_prompt_user:queue] queue waiting sessionKey=${e} queued=${n.queue.length} running=1`),vd(e,n);return}y(`[xmtp_prompt_user:queue] queue continues sessionKey=${e} queued=${n.queue.length} running=0`),jr(e,"session_idle")}function BN(e){return Bt(e).running}async function jN(e){let t=e.target.sessionKey,n=Bt(t);return n.queue.push({...e,deadlineAt:Date.now()+Uh}),n.running||n.processing||n.queue.length>1?(n.queue.length===1&&vd(t,n),y(`[xmtp_prompt_user:queue] queued sessionKey=${t} channel=${e.channel} size=${n.queue.length}`),b.info(h.PROMPT_USER_CHECKPOINT,gt({checkpoint:"queued",sessionKey:t,channel:e.channel,taskId:e.taskId,queued:n.queue.length,running:n.running?1:0,processing:n.processing?1:0})),{status:"queued",size:n.queue.length}):(await jr(t,"session_idle"),{status:"dispatched",size:n.queue.length})}function Od(e){let t=Bt(e);t.running=!0;let n=t.queue[0];n&&(n.deadlineAt=Date.now()+Uh,y(`[xmtp_prompt_user:queue] fallback reset sessionKey=${e} channel=${n.channel} queued=${t.queue.length}`),vd(e,t)),y(`[xmtp_prompt_user:queue] agent_start sessionKey=${e} queued=${t.queue.length}`)}function Cd(e){let t=Bt(e),n=$N(e);if(n.length>0){y(`[xmtp_prompt_user:queue] agent_end sessionKey=${e} queued=${t.queue.length} pendingRunIds=${n.join(",")} waiting=run_final`);return}t.running=!1,y(`[xmtp_prompt_user:queue] agent_end sessionKey=${e} queued=${t.queue.length}`),t.queue.length>0&&jr(e,"agent_end")}function $N(e){let t=[];for(let[n,r]of Br)r.sessionKey===e&&t.push(n);return t}function Ph(e,t,n){Wo.set(e,{state:t,sessionKey:n,completedAt:Date.now()}),setTimeout(()=>{Wo.delete(e)},60*1e3)}function HN(e,t,n,r,s){let o=Bt(e);o.running=!1,y(`[xmtp_prompt_user:queue] run completed sessionKey=${e} runId=${t} state=${n} durationMs=${r} queued=${o.queue.length}`),b.info(h.PROMPT_USER_CHECKPOINT,gt({checkpoint:"run_completed",sessionKey:e,taskId:s,runId:t,status:n,durationMs:r,queued:o.queue.length})),o.queue.length>0&&jr(e,`run_${n}`)}function gt(e){return Object.entries({component:"openclaw_prompt_user_queue",operation:"xmtp_prompt_user",checkpoint:e.checkpoint,sessionKey:e.sessionKey,channel:e.channel??"",taskId:e.taskId??"",runId:e.runId??"",reason:e.reason??"",status:e.status??"",queued:e.queued??"",delayMs:e.delayMs??"",durationMs:e.durationMs??"",running:e.running??"",processing:e.processing??""}).filter(([,n])=>n!=="").reduce((n,[r,s])=>(n[r]=String(s),n),{})}var Uh,xh,Br,Wo,$r=ee(()=>{"use strict";te();zo();An();se();Uh=300*1e3,xh=new Map,Br=new Map,Wo=new Map;gh(e=>{let t=e;if(t.event!=="chat"||!t.payload||typeof t.payload!="object")return;let n=t.payload,r=typeof n.runId=="string"?n.runId:"";if(!r)return;let s=typeof n.state=="string"?n.state:"",o=Br.get(r);if(!o){(s==="final"||s==="error")&&Ph(r,s,String(n.sessionKey??""));return}y(`[xmtp_prompt_user:queue] observed chat event runId=${r} state=${s||"(none)"} sessionKey=${String(n.sessionKey??"")}`),!(s!=="final"&&s!=="error")&&(Br.delete(r),Ph(r,s,String(n.sessionKey??"")),HN(o.sessionKey,r,s,Date.now()-o.startedAt,o.taskId))})});function Dd(e){let t=nh(e);return!t||Zo.has(t.channel)?null:t}async function qh(e){let t=e.label?`[${e.label}] ${e.content}`:e.content;if(e.target.to&&!Lh.has(e.channel)){let n={to:e.target.to,message:t,channel:e.channel,sessionKey:e.target.sessionKey,idempotencyKey:(0,Qo.randomUUID)()};e.target.accountId&&(n.accountId=e.target.accountId),await Ze({method:"send",params:n});return}await Lr({sessionKey:e.target.sessionKey,message:e.content,label:e.label})}async function Mh(e){let{channel:t,target:n,llmContent:r,userContent:s}=e,o=await Mr({key:n.sessionKey,message:r});if(o.runId?e.onRunStarted?.(o.runId):y(`[xmtp_prompt_user:queue] sessions.send returned without runId sessionKey=${n.sessionKey} channel=${t}`),n.to&&!Lh.has(t)){let i={to:n.to,message:s,channel:t,sessionKey:n.sessionKey,idempotencyKey:(0,Qo.randomUUID)()};return n.accountId&&(i.accountId=n.accountId),await Ze({method:"send",params:i}),{runId:o.runId}}return await Lr({sessionKey:n.sessionKey,message:s}),{runId:o.runId}}async function ei(e){let t=wd({jobId:e.jobId,currentSessionKey:e.currentSessionKey});if(t)return console.log(`[okx-a2a:gateway-method] dispatch_user stored routes jobId=${e.jobId??"(none)"} currentSessionKey=${e.currentSessionKey??"(none)"} routeCount=${t.targets.size} failed=${t.failed.length}`),Xo(t.targets,e,t.failed);let n=Bh({jobId:e.jobId,currentSessionKey:e.currentSessionKey,contents:[e.content]});if(n)return console.log(`[okx-a2a:gateway-method] dispatch_user rebound remembered route jobId=${e.jobId??"(none)"} routeCount=${n.targets.size} failed=${n.failed.length}`),Xo(n.targets,e,n.failed);let r=await Xo(Bo(),e);return jh(e.jobId,r.dispatched,[e.content]),r}function Nd(e){let t=new Map,n=[];for(let r of e){let s=Dd(r);if(!s){n.push({channel:"",sessionKey:r,error:"invalid user gateway session"});continue}t.set(s.channel,s.target)}return{targets:t,failed:n}}function wd(e){let t=e.currentSessionKey?.trim()||Rh(),n=Ch({jobId:e.jobId,sessionKey:t});return n.length>0?Nd(n):null}async function Xo(e,t,n=[]){if(e.size===0)return y("[okx-a2a:gateway-method] dispatch_user no deliverable user session found"),{ok:!1,dispatched:[],failed:n};let r=[],s=[...n];for(let[o,i]of e)if(!Zo.has(o))try{await qh({channel:o,target:i,content:t.content,label:t.label}),r.push({channel:o,sessionKey:i.sessionKey}),y(`[okx-a2a:gateway-method] dispatch_user delivered channel=${o} sessionKey=${i.sessionKey}`)}catch(a){let c=a instanceof Error?a.message:String(a);s.push({channel:o,sessionKey:i.sessionKey,error:c}),y(`[okx-a2a:gateway-method] dispatch_user failed channel=${o} sessionKey=${i.sessionKey}: ${c}`),b.error(h.USER_DISPATCH_FAILED,a instanceof Error?a:new Error(String(a)),{source:"okx-a2a.dispatch_user",channel:o,sessionKey:i.sessionKey,hasTo:i.to?"1":"0"})}return{ok:r.length>0&&s.length===0,dispatched:r,failed:s}}async function Fh(e){let{targets:t,failed:n}=Nd(e.sessionKeys);return Xo(t,{content:e.content,label:e.label},n)}async function Gh(e){let t=Dd(e.sessionKey);if(!t)return{ok:!1,dispatched:[],failed:[{channel:"",sessionKey:e.sessionKey,error:"invalid user gateway session"}]};try{return await qh({channel:t.channel,target:t.target,content:e.content,label:e.label}),console.log(`[okx-a2a:gateway-method] dispatch_user delivered routed channel=${t.channel} sessionKey=${e.sessionKey}`),{ok:!0,dispatched:[{channel:t.channel,sessionKey:e.sessionKey}],failed:[]}}catch(n){let r=n instanceof Error?n.message:String(n);return b.error(h.USER_DISPATCH_FAILED,n instanceof Error?n:new Error(String(n)),{source:"okx-a2a.dispatch_user",channel:t.channel,sessionKey:e.sessionKey,hasTo:t.target.to?"1":"0"}),{ok:!1,dispatched:[],failed:[{channel:t.channel,sessionKey:e.sessionKey,error:r}]}}}async function ti(e){let{queuePromptUserAction:t}=await Promise.resolve().then(()=>($r(),Vo)),n=wd({jobId:e.jobId,currentSessionKey:e.currentSessionKey});if(n)return console.log(`[okx-a2a:gateway-method] prompt_user stored routes jobId=${e.jobId??"(none)"} currentSessionKey=${e.currentSessionKey??"(none)"} routeCount=${n.targets.size} failed=${n.failed.length}`),Jo(n.targets,e,n.failed,t);let r=Bh({jobId:e.jobId,currentSessionKey:e.currentSessionKey,contents:[e.userContent,e.llmContent]});if(r)return console.log(`[okx-a2a:gateway-method] prompt_user rebound remembered route jobId=${e.jobId??"(none)"} routeCount=${r.targets.size} failed=${r.failed.length}`),Jo(r.targets,e,r.failed,t);let s=await Jo(Bo(),e,[],t);return jh(e.jobId,s.dispatched,[e.userContent,e.llmContent]),s}function Bh(e){let t=Ko({sessionKey:e.currentSessionKey});return t.length===0||Ad({jobId:e.jobId,contents:e.contents,sessionKeys:t}).length===0?null:wd({jobId:e.jobId,currentSessionKey:e.currentSessionKey})}function jh(e,t,n){let r=t.map(s=>s.sessionKey).filter(Boolean);r.length!==0&&Ad({jobId:e,contents:n,sessionKeys:r})}async function Jo(e,t,n=[],r){if(e.size===0)return y("[okx-a2a:gateway-method] prompt_user no deliverable user session found"),{ok:!1,dispatched:[],failed:n};let s=[],o=[...n];for(let[i,a]of e)if(!Zo.has(i))try{let c=await r({channel:i,target:a,llmContent:t.llmContent,userContent:t.userContent});s.push({channel:i,sessionKey:a.sessionKey,status:c.status,size:c.size}),y(`[okx-a2a:gateway-method] prompt_user ${c.status} channel=${i} sessionKey=${a.sessionKey} size=${c.size}`)}catch(c){let u=c instanceof Error?c.message:String(c);o.push({channel:i,sessionKey:a.sessionKey,error:u}),y(`[okx-a2a:gateway-method] prompt_user failed channel=${i} sessionKey=${a.sessionKey}: ${u}`),b.error(h.PROMPT_USER_FAILED,c instanceof Error?c:new Error(String(c)),{source:"okx-a2a.prompt_user",channel:i,sessionKey:a.sessionKey})}return{ok:s.length>0&&o.length===0,dispatched:s,failed:o}}async function $h(e){let{queuePromptUserAction:t}=await Promise.resolve().then(()=>($r(),Vo)),{targets:n,failed:r}=Nd(e.sessionKeys);return Jo(n,{llmContent:e.llmContent,userContent:e.userContent},r,t)}async function Hh(e){let{queuePromptUserAction:t}=await Promise.resolve().then(()=>($r(),Vo)),n=Dd(e.sessionKey);if(!n)return{ok:!1,dispatched:[],failed:[{channel:"",sessionKey:e.sessionKey,error:"invalid user gateway session"}]};try{let r=await t({channel:n.channel,target:n.target,llmContent:e.llmContent,userContent:e.userContent});return console.log(`[okx-a2a:gateway-method] prompt_user ${r.status} routed channel=${n.channel} sessionKey=${e.sessionKey} size=${r.size}`),{ok:!0,dispatched:[{channel:n.channel,sessionKey:e.sessionKey,status:r.status,size:r.size}],failed:[]}}catch(r){let s=r instanceof Error?r.message:String(r);return b.error(h.PROMPT_USER_FAILED,r instanceof Error?r:new Error(String(r)),{source:"okx-a2a.prompt_user",channel:n.channel,sessionKey:e.sessionKey}),{ok:!1,dispatched:[],failed:[{channel:n.channel,sessionKey:e.sessionKey,error:s}]}}}async function Yh(e,t){let n=Bo();if(n.size===0)return y("[sendLlmToLatestUserSessions] no latest user session found"),{dispatched:[],failed:[]};let r=[],s=[];for(let[o,i]of n)if(!Zo.has(o))try{await qe().subagent.run({sessionKey:i.sessionKey,message:e,deliver:!0,idempotencyKey:(0,Qo.randomUUID)()}),r.push(o),y(`[sendLlmToLatestUserSessions] sent to ${o} sessionKey=${i.sessionKey}`)}catch(a){s.push(o),y(`[sendLlmToLatestUserSessions] send to ${o} failed:`,a),b.error(h.USER_DISPATCH_FAILED,a instanceof Error?a:new Error(String(a)),{source:t?.source??"sendLlmToLatestUserSessions",channel:o,sessionKey:i.sessionKey})}return{dispatched:r,failed:s}}var Qo,Zo,Lh,zo=ee(()=>{"use strict";te();Qo=require("node:crypto");An();Tn();Td();Dh();kh();se();Nn();Zo=new Set(["heartbeat","cron","webhook","voice"]),Lh=new Set(["webchat","tui"])});var yw={};Gd(yw,{default:()=>Ew});module.exports=km(yw);te();Nn();te();se();var jD="main",K_={id:"okx-a2a",meta:{id:"okx-a2a",label:"OKX A2A",selectionLabel:"OKX A2A",docsPath:"channels/okx-a2a",blurb:"E2E encrypted communication (wallet-to-agent)",order:101},capabilities:{chatTypes:["group"],media:!1,reply:!0},reload:{configPrefixes:["channels.okx-a2a"]},config:{resolveAccount:async()=>({}),listAccountIds:()=>[jD]},outbound:{deliveryMode:"direct"},gateway:{startAccount:async e=>{e.setStatus({accountId:e.accountId,connected:!0,lastConnectedAt:Date.now(),lastEventAt:Date.now()}),y(`[okx-a2a:${e.accountId}] startAccount activated`),await new Promise(t=>{e.abortSignal.addEventListener("abort",()=>t(),{once:!0})}),y(`[okx-a2a:${e.accountId}] received abort signal, cleaning up...`)},stopAccount:async()=>{y("[okx-a2a] stopAccount"),await Y_()}}};te();An();Tn();se();var yh=async e=>{let t=oh(e),n=[];for(let r of t)await Eh({key:r,...e.deleteTranscript!==void 0?{deleteTranscript:e.deleteTranscript}:{}}),n.push(r),y(`[okx-a2a] session deleted: ${r}`),b.info(h.SESSION_DELETED,{sessionKey:r,...Ur({sessionKey:r})});return{ok:!0,deleted:n.length,deletedSessionKeys:n,matched:t.length}};An();Tn();zo();$r();Td();te();var Kh=require("node:os"),kd=require("node:path"),Wh=require("node:fs");An();zo();se();var YN=15e3,KN=50;function WN(e=process.env){return e.OKX_AGENT_TASK_HOME?.trim()||(0,kd.join)((0,Kh.homedir)(),".okx-agent-task")}function VN(e=process.env){return e.OKX_A2A_OUTBOX_DB_PATH?.trim()||(0,kd.join)(WN(e),"sqlite","session-store.sqlite")}function zN(){let e=process.emitWarning;process.emitWarning=((t,...n)=>{if(!((typeof t=="string"?t:t.message).includes("SQLite is an experimental feature")&&n.some(s=>s==="ExperimentalWarning")))return e.call(process,t,...n)});try{return require("node:sqlite")}finally{process.emitWarning=e}}async function XN(e){let t=e.message_id??void 0;if(e.kind==="dispatch_user_latest"){let n=await ei({content:e.content,jobId:e.job_id});if(!n.ok)throw new Error(`dispatch_user_latest delivered=${n.dispatched.length} failed=${n.failed.length}`);return}if(e.kind==="prompt_user_latest"){if(!e.llm_content)throw new Error("prompt_user_latest missing llm_content");let n=await ti({userContent:e.content,llmContent:e.llm_content,jobId:e.job_id});if(!n.ok)throw new Error(`prompt_user_latest delivered=${n.dispatched.length} failed=${n.failed.length}`);return}if(e.kind==="chat_inject"){e.llm_content&&await Mr({key:e.session_key,message:e.llm_content,idempotencyKey:t}),await Lr({sessionKey:e.session_key,message:e.content});return}await Mr({key:e.session_key,message:e.content,idempotencyKey:t})}async function JN(e={}){let t=e.dbPath??VN();if(!(0,Wh.existsSync)(t))return{delivered:0,failed:0,skipped:!0};let{DatabaseSync:n}=zN(),r=new n(t);try{if(r.exec("PRAGMA busy_timeout=5000"),r.exec("PRAGMA journal_mode=WAL"),!r.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='pending_gateway_deliveries'").get())return{delivered:0,failed:0,skipped:!0};let o=r.prepare(`
36
45
  SELECT id, kind, provider, session_key, job_id, content, llm_content, message_id, attempts
37
46
  FROM pending_gateway_deliveries
38
47
  WHERE provider = 'openclaw'
39
48
  ORDER BY created_at ASC, id ASC
40
49
  LIMIT ?
41
- `).all(t.limit??SD),o=0,a=0;for(let c of i)try{await AD(c),r.prepare("DELETE FROM pending_gateway_deliveries WHERE id = ?").run(c.id),o+=1}catch(u){a+=1;let d=u instanceof Error?u.message:String(u);r.prepare(`
50
+ `).all(e.limit??KN),i=0,a=0;for(let c of o)try{await XN(c),r.prepare("DELETE FROM pending_gateway_deliveries WHERE id = ?").run(c.id),i+=1}catch(u){a+=1;let d=u instanceof Error?u.message:String(u);r.prepare(`
42
51
  UPDATE pending_gateway_deliveries
43
52
  SET attempts = attempts + 1, last_error = ?, last_attempt_at = ?
44
53
  WHERE id = ?
45
- `).run(d,new Date().toISOString(),c.id),y(`[okx-a2a:outbox-drain] delivery failed id=${c.id} kind=${c.kind}: ${d}`)}return(o>0||a>0)&&I.info(h.SESSION_DISPATCHED,{onchainosAgentId:"*",source:"gateway_outbox_drain",deliveredCount:String(o),failedCount:String(a),batchSize:String(i.length)}),{delivered:o,failed:a,skipped:!1}}finally{r.close()}}function eh(t={}){let e=t.intervalMs??yD,n=!1,r=async()=>{if(!n){n=!0;try{await vD({...t.dbPath!==void 0?{dbPath:t.dbPath}:{},...t.limit!==void 0?{limit:t.limit}:{}})}catch(i){y("[okx-a2a:outbox-drain] tick failed:",i)}finally{n=!1}}},s=setInterval(()=>{r()},e);return s.unref?.(),r(),()=>{clearInterval(s)}}ee();var Mr=require("node:child_process"),ud=require("node:fs"),Fi=require("node:os"),bn=require("node:path"),th=require("node:util");re();var nh=(0,th.promisify)(Mr.execFile),RD=12e4,dd=3e4,rh=5e3,sh=[(0,bn.join)((0,Fi.homedir)(),".local","bin"),(0,bn.join)((0,Fi.homedir)(),"Library","pnpm"),(0,bn.join)((0,Fi.homedir)(),".npm-global","bin"),"/opt/homebrew/bin","/usr/local/bin"];function X(t,e){return{source:"openclaw_gateway",provider:"openclaw",action:t,...e??{}}}async function Gi(t,e=dd){let n=process.env.OKX_A2A_BIN?.trim();if(n)return ih(`${n} ${t.map(uh).join(" ")}`,e,Bi());let r=await CD();if(!r)return{ok:!1,stdout:"",stderr:"okx-a2a binary not found"};try{let{stdout:s,stderr:i}=await nh(r,t,{timeout:e,env:Bi()});return{ok:!0,stdout:s,stderr:i}}catch(s){let i=s;return{ok:!1,stdout:String(i.stdout??""),stderr:String(i.stderr??i.message??s)}}}async function CD(){let t=await ih("command -v okx-a2a",dd),e=t.stdout.trim().split(/\r?\n/)[0]?.trim();if(t.ok&&e)return e;for(let n of sh){let r=(0,bn.join)(n,"okx-a2a");if((0,ud.existsSync)(r))return r}return null}function OD(){let t=ah("command -v okx-a2a",dd),e=t.stdout.trim().split(/\r?\n/)[0]?.trim();if(t.ok&&e)return e;for(let n of sh){let r=(0,bn.join)(n,"okx-a2a");if((0,ud.existsSync)(r))return r}return null}async function ih(t,e,n=process.env){try{let{stdout:r,stderr:s}=await nh(ch(),["-lc",t],{timeout:e,env:n});return{ok:!0,stdout:r,stderr:s}}catch(r){let s=r;return{ok:!1,stdout:String(s.stdout??""),stderr:String(s.stderr??s.message??r)}}}function oh(t,e=rh){let n=process.env.OKX_A2A_BIN?.trim();if(n)return ah(`${n} ${t.map(uh).join(" ")}`,e,Bi());let r=OD();if(!r)return{ok:!1,stdout:"",stderr:"okx-a2a binary not found"};try{return{ok:!0,stdout:(0,Mr.execFileSync)(r,t,{encoding:"utf8",stdio:["ignore","pipe","pipe"],timeout:e,env:Bi()}),stderr:""}}catch(s){let i=s;return{ok:!1,stdout:String(i.stdout??""),stderr:String(i.stderr??i.message??s)}}}function ah(t,e,n=process.env){try{return{ok:!0,stdout:(0,Mr.execFileSync)(ch(),["-lc",t],{encoding:"utf8",stdio:["ignore","pipe","pipe"],timeout:e,env:n}),stderr:""}}catch(r){let s=r;return{ok:!1,stdout:String(s.stdout??""),stderr:String(s.stderr??s.message??r)}}}function ch(){return process.env.SHELL||"/bin/sh"}function Bi(){return{...process.env,OKX_A2A_RUNTIME_CONTEXT:"openclaw-gateway",OKX_A2A_IN_GATEWAY:"1",OKX_A2A_GATEWAY_PROVIDER:"openclaw"}}function uh(t){return`'${t.replace(/'/g,"'\\''")}'`}function DD(t){let e=t.trim();return e.startsWith("running ")?"running":e.startsWith("stale ")?"stale":e==="stopped"?"stopped":"unknown"}function dh(t){let e=t.trim().split(/\r?\n/).reverse();for(let n of e){let r=n.trim();if(r.startsWith("{"))try{let s=JSON.parse(r);if(s&&typeof s=="object"&&!Array.isArray(s))return s}catch{}}return null}async function ND(){let t=await Gi(["ai-provider","status","--json"]);if(!t.ok)return y("[okx-a2a:daemon] ai-provider status failed:",(t.stderr||t.stdout).trim()),I.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a ai-provider status failed"),X("provider_status",{status:"failed",stderr:t.stderr,stdout:t.stdout})),null;let n=dh(t.stdout)?.provider;return typeof n!="string"&&I.info(h.DAEMON_LIFECYCLE_SKIPPED,X("provider_status",{reason:"invalid_provider_status_output",status:"skipped",stdout:t.stdout})),typeof n=="string"?n:null}function wD(){let t=oh(["ai-provider","status","--json"]);if(!t.ok)return y("[okx-a2a:daemon] ai-provider status failed during gateway signal:",(t.stderr||t.stdout).trim()),I.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a ai-provider status failed during gateway signal"),X("provider_status_signal",{status:"failed",stderr:t.stderr,stdout:t.stdout})),null;let n=dh(t.stdout)?.provider;return typeof n!="string"&&I.info(h.DAEMON_LIFECYCLE_SKIPPED,X("provider_status_signal",{reason:"invalid_provider_status_output",status:"skipped",stdout:t.stdout})),typeof n=="string"?n:null}async function lh(){let t=await ND();return t!=="openclaw"?(y(`[okx-a2a:daemon] provider=${t??"(not set)"}; skipping OpenClaw-owned daemon lifecycle`),I.info(h.DAEMON_LIFECYCLE_SKIPPED,X("provider_mismatch",{selectedProvider:t??"",reason:"provider_not_openclaw",status:"skipped"})),!1):!0}function kD(){let t=wD();return t!=="openclaw"?(y(`[okx-a2a:daemon] provider=${t??"(not set)"}; skipping OpenClaw-owned daemon lifecycle during gateway signal`),I.info(h.DAEMON_LIFECYCLE_SKIPPED,X("provider_mismatch_signal",{selectedProvider:t??"",reason:"provider_not_openclaw",status:"skipped"})),!1):!0}async function ph(){if(!await lh())return;let t=await Gi(["daemon","status"]),e=t.ok?DD(t.stdout):"unknown";t.ok||y("[okx-a2a:daemon] status failed:",(t.stderr||t.stdout).trim()),I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("restart",{previousStatus:e,status:"requested"}));let n=await Gi(["daemon","restart"],RD);if(!n.ok){y("[okx-a2a:daemon] restart failed:",(n.stderr||n.stdout).trim()),I.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a daemon restart failed"),X("restart",{previousStatus:e,status:"failed",stderr:n.stderr,stdout:n.stdout}));return}let r=n.stdout.trim();y(`[okx-a2a:daemon] ${r||"restart ok"} selectedProvider=openclaw previousStatus=${e}`),I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("restart",{previousStatus:e,status:"ok"}))}async function fh(){if(!await lh())return;I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("stop",{status:"requested"}));let t=await Gi(["daemon","stop"]);if(!t.ok){y("[okx-a2a:daemon] stop failed:",(t.stderr||t.stdout).trim()),I.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a daemon stop failed"),X("stop",{status:"failed",stderr:t.stderr,stdout:t.stdout}));return}y(`[okx-a2a:daemon] ${t.stdout.trim()||"stop ok"}`),I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("stop",{status:"ok"}))}function xD(t){if(!kD())return;I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("stop_signal",{reason:t,status:"requested"}));let e=oh(["daemon","stop"],rh);if(!e.ok){y(`[okx-a2a:daemon] stop failed during ${t}:`,(e.stderr||e.stdout).trim()),I.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a daemon stop failed during gateway signal"),X("stop_signal",{reason:t,status:"failed",stderr:e.stderr,stdout:e.stdout}));return}y(`[okx-a2a:daemon] ${e.stdout.trim()||"stop ok"} reason=${t}`),I.info(h.DAEMON_LIFECYCLE_REQUESTED,X("stop_signal",{reason:t,status:"ok"}))}function gh(){let t=e=>{xD(e)};return process.on("SIGTERM",t),process.on("SIGINT",t),()=>{process.off("SIGTERM",t),process.off("SIGINT",t)}}ee();re();ee();var $i=require("node:fs"),hh=require("node:child_process"),mh=require("node:util");re();var Eh=(0,mh.promisify)(hh.execFile),pt=null,_h=new Set(["--message"]);async function PD(){if(pt)return pt;let t=process.env.ONCHAINOS_BIN;if(t)return y(`[onchainos] using ONCHAINOS_BIN=${t}`),pt=t,pt;try{let e=process.env.SHELL||"/bin/bash",{stdout:n}=await Eh(e,["-lc","command -v onchainos"]),r=MD(n);if(r)return y(`[onchainos] resolved binary via shell: ${r}`),pt=r,pt}catch(e){y("[onchainos] shell resolve failed, will fallback to bare 'onchainos':",e)}return y("[onchainos] could not resolve binary path, falling back to bare 'onchainos'"),pt="onchainos",pt}function MD(t){let e=t.split(/\r?\n/).map(n=>n.trim()).filter(Boolean).reverse();for(let n of e)if(UD(n))return n;return null}function UD(t){try{return(0,$i.accessSync)(t,$i.constants.X_OK),!0}catch{return!1}}function yh(t){let e=[],n=!1;for(let r of t){if(n){e.push("<redacted>"),n=!1;continue}let s=[..._h].find(i=>r.startsWith(`${i}=`));if(s){e.push(`${s}=<redacted>`);continue}e.push(r),_h.has(r)&&(n=!0)}return e}function LD(t,e){return`${t} ${yh(e).join(" ")}`}async function Sh(t){let e=await PD(),n=LD(e,t);y(`[onchainos] exec: ${n}`);let r=Date.now();try{let s=await Eh(e,t);return y(`[onchainos] exec done: ${n} (${Date.now()-r}ms, stdout=${s.stdout.length}B, stderr=${s.stderr.length}B)`),s}catch(s){throw y(`[onchainos] exec error: ${n} (${Date.now()-r}ms) code=${s.code} signal=${s.signal} killed=${s.killed} message=${s.message}`),I.error(h.ONCHAINOS_CLI_ERROR,new Error("onchainos command failed"),{component:"onchainos_cli",source:"onchainos",stage:"exec",communicationClass:"onchainos_cli_or_api_issue",operation:yh(t).slice(0,3).join(" "),reason:"exec_failed",argCount:String(t.length),exitCode:String(s?.code??""),signal:String(s?.signal??""),killed:String(s?.killed??""),stderrBytes:String(Buffer.byteLength(String(s?.stderr??""),"utf8")),stdoutBytes:String(Buffer.byteLength(String(s?.stdout??""),"utf8")),cliErrorName:s instanceof Error?s.name:"",cliErrorMessageLength:String(String(s?.message??"").length),durationMs:String(Date.now()-r)}),s}}re();var Th={OK_FALSE:"ok_false",JSON_PARSE_FAILED:"json_parse_failed"};function bh(t){let e="0";try{JSON.parse(t),e="1"}catch{e="0"}return{responseBytes:String(Buffer.byteLength(t,"utf8")),responseJson:e}}function Ih(t,e,n){return{component:"onchainos_cli",source:"onchainos",stage:"ok_false",communicationClass:"onchainos_cli_or_api_issue",operation:e,reason:Th.OK_FALSE,...bh(t),...n}}function Ah(t,e,n={}){try{return JSON.parse(t)}catch(r){let s=r instanceof Error?r:new Error(String(r));throw I.error(h.ONCHAINOS_CLI_ERROR,s,{component:"onchainos_cli",source:"onchainos",stage:"json_parse",communicationClass:"onchainos_cli_or_api_issue",operation:e,reason:Th.JSON_PARSE_FAILED,...bh(t),...n}),s}}re();var vh=/session expired/i;function ld(t){try{let e=JSON.parse(t);return e.ok===!1&&vh.test(String(e.error??""))}catch{return vh.test(t)}}function Rh(t){I.error(h.ONCHAINOS_SESSION_EXPIRED,new Error("onchainos session expired"),{component:"onchainos_cli",source:"onchainos",stage:"session_expired",operation:t,command:t,communicationClass:"onchainos_auth_issue",reason:"session_expired"})}function Ch(t,e){if(e?.notifySessionExpired){e.notifySessionExpired(t);return}Rh(t)}function qD(t,e,n){ld(t)&&Ch(e,n)}function FD(t,e,n){let r=String(t?.stdout??"");r&&ld(r)&&Ch(e,n)}async function Oh(t){y("[onchainos] fetching system-config");let e,n;try{({stdout:e,stderr:n}=await Sh(["agent","system-config"]))}catch(s){throw FD(s,"system-config",t),s}n&&y(`[onchainos] stderr (system-config): ${n}`);let r=Ah(e,"system-config");if(!r.ok){qD(e,"system-config",t);let s=new Error("onchainos agent system-config failed");throw I.error(h.ONCHAINOS_CLI_ERROR,s,Ih(e,"system-config")),s}return y(`[onchainos] fetched system-config: ${Object.keys(r.data).length} keys`),r.data}re();var GD=process.env.SENTRY_ENV==="dev"?"dev":"prod",Dh={projectName:"okx/openclaw-okx-a2a-extension",release:"0.0.15",environment:GD};var In,An,Ur;function BD(t){let e=t?.details?.requestId;return typeof e=="string"&&e.trim()?`openclaw devices approve ${e}`:"openclaw devices approve --latest"}function $D(t){let e=t?.details??{},n=td(t);return["OKX A2A plugin needs OpenClaw gateway `operator.admin` scope before it can create sessions, inject chat messages, and route XMTP conversations.","","Ask the user whether they approve granting this scope to the OKX A2A plugin.","","If the user approves, ask them to run this command on the OpenClaw host:","","```bash",BD(t),"```","",`requestId: ${e.requestId??""}`,`deviceId: ${e.deviceId??""}`,`requestedScopes: ${Array.isArray(e.requestedScopes)?e.requestedScopes.join(","):""}`,`approvedScopes: ${Array.isArray(e.approvedScopes)?e.approvedScopes.join(","):""}`,n?`hint: ${n}`:""].filter(Boolean).join(`
46
- `)}function jD(){xi({key:D_()}).then(()=>{y("[okx-a2a:service] gateway client admin precheck succeeded"),I.info(h.GATEWAY_STARTED,{source:"gateway_preconnect",outcome:"ok"})},t=>{y("[okx-a2a:service] gateway client admin precheck failed:",t),I.error(h.GATEWAY_CONNECT_FAILED,t instanceof Error?t:new Error(String(t)),{source:"gateway_preconnect",code:String(t?.gatewayCode??t?.details?.code??""),reason:String(t?.details?.reason??""),requestId:String(t?.details?.requestId??"")}),J_($D(t),{source:"gateway_preconnect"}).then(({dispatched:e,failed:n})=>{I.info(h.USER_DISPATCHED,{source:"gateway_preconnect",outcome:n.length===0?"all_ok":"partial",dispatchedChannels:e.join(","),failedChannels:n.join(","),dispatchedCount:String(e.length),failedCount:String(n.length)})},e=>{I.error(h.USER_DISPATCH_FAILED,e instanceof Error?e:new Error(String(e)),{source:"gateway_preconnect"})})})}async function HD(t){try{let e=await Oh();if(typeof e.sentryDsn=="string"&&e.sentryDsn){m_({dsn:e.sentryDsn,...Dh,agentPlatform:"openclaw"});return}hd("[okx-a2a] system-config did not return sentryDsn; Sentry not initialized \u2014 no further events will be reported to SLS"),I.error(h.SENTRY_INIT_SKIPPED,void 0,{onchainosAgentId:"*",reason:"system-config missing sentryDsn",pluginId:Gt.id,pluginVersion:Gt.version,source:t})}catch(e){y(`[okx-a2a:service] system-config fetch failed in ${t}:`,e),I.error(h.CONFIG_LOAD_FAILED,e instanceof Error?e:new Error(String(e)),{source:t})}}function Nh(t,e){let n=[t?.sessionKey,t?.context?.sessionKey,t?.ctx?.sessionKey,t?.hookContext?.sessionKey,e?.sessionKey];for(let r of n)if(typeof r=="string"&&r.trim())return r;return null}function pd(t,e){let n=t[e];if(typeof n!="string"||!n.trim())throw new Error(`Missing required param ${e}`);return n}function Ft(t,e){let n=t[e];return typeof n=="string"&&n.trim()?n:void 0}function YD(t,e){let n=t[e];if(!Array.isArray(n))return;let r=n.filter(s=>typeof s=="string"&&s.trim().length>0).map(s=>s.trim());return r.length>0?r:void 0}function KD(t,e){let n=t[e];return typeof n=="boolean"?n:void 0}var Gt={id:"okx-a2a",name:"OKX A2A Plugin",version:"0.0.15",register(t){md(t.runtime),t.registerChannel({plugin:y_}),t.registerGatewayMethod("okx-a2a.dispatch_user",async({params:e,respond:n})=>{try{let r=pd(e,"content"),s=Ft(e,"label");n(!0,await Li({content:r,label:s}))}catch(r){n(!1,void 0,{code:"INVALID_REQUEST",message:r instanceof Error?r.message:String(r)})}},{scope:"operator.admin"}),t.registerGatewayMethod("okx-a2a.prompt_user",async({params:e,respond:n})=>{try{let r=pd(e,"userContent"),s=pd(e,"llmContent");n(!0,await qi({userContent:r,llmContent:s}))}catch(r){n(!1,void 0,{code:"INVALID_REQUEST",message:r instanceof Error?r.message:String(r)})}},{scope:"operator.admin"}),t.registerGatewayMethod("okx-a2a.delete_sessions",async({params:e,respond:n})=>{try{let r=Ft(e,"sessionKey"),s=YD(e,"sessionKeys"),i=Ft(e,"jobId");if(!r&&!s&&!i)throw new Error("Missing required selector: sessionKey, sessionKeys, or jobId");let o=Ft(e,"myAgentId"),a=Ft(e,"toAgentId"),c=Ft(e,"myXmtpAddress"),u=Ft(e,"toXmtpAddress"),d=KD(e,"deleteTranscript");n(!0,await H_({...r?{sessionKey:r}:{},...s?{sessionKeys:s}:{},...i?{jobId:i}:{},...o?{myAgentId:o}:{},...a?{toAgentId:a}:{},...c?{myXmtpAddress:c}:{},...u?{toXmtpAddress:u}:{},...d!==void 0?{deleteTranscript:d}:{}}))}catch(r){n(!1,void 0,{code:"INVALID_REQUEST",message:r instanceof Error?r.message:String(r)})}},{scope:"operator.admin"}),t.registerHook("agent:bootstrap",async e=>{let n=e.context,r=n.bootstrapFiles;if(Array.isArray(r))try{let s=r.map(o=>`${o.name}(${o.missing?"missing":`${o.content?.length??0}b`})`).join(", ");y(`[okx-a2a:hook] agent:bootstrap agentId=${n.agentId??"?"} files=[${s}]`);let i=r.reduce((o,a)=>o+(a.content?.length??0),0);I.info(h.BOOTSTRAP_APPLIED,{openclawAgentId:n.agentId??"",promptSize:String(i),fileCount:String(r.length),missingCount:String(r.filter(o=>o.missing).length)})}catch(s){I.error(h.BOOTSTRAP_FAILED,s instanceof Error?s:void 0,{openclawAgentId:n.agentId??""})}},{name:"okx-a2a-agent-bootstrap"}),t.on("before_agent_run",async(e,n)=>{let r=Nh(e,n);if(!r){y("[xmtp_prompt_user:queue] before_agent_run ignored: missing sessionKey");return}sd(r)}),t.on("agent_end",async(e,n)=>{let r=Nh(e,n);if(!r){y("[xmtp_prompt_user:queue] agent_end ignored: missing sessionKey");return}id(r)}),t.registerService({id:"okx-a2a:core",start:async()=>{y("[okx-a2a:service] okx-a2a:core starting (multi-identity mode); initializing communication identities..."),Ur=Date.now(),I.info(h.GATEWAY_STARTED,{onchainosAgentId:"*",pid:String(process.pid),pluginId:Gt.id,pluginVersion:Gt.version,nodeVersion:process.version,startedAt:String(Ur)}),An&&An(),An=gh(),B_(),await ph(),jD(),In&&In(),In=eh(),await HD("openclaw_lightweight_gateway_service"),y("[okx-a2a:service] OpenClaw lightweight gateway initialized; node daemon owns XMTP receive/send/agent sync.")},stop:async()=>{In&&(In(),In=void 0),An&&(An(),An=void 0),$_(),await fh(),y("[okx-a2a:service] okx-a2a:core stopped");let e=Date.now();I.info(h.GATEWAY_STOPPED,{onchainosAgentId:"*",pid:String(process.pid),pluginId:Gt.id,pluginVersion:Gt.version,stoppedAt:String(e),uptimeMs:Ur?String(e-Ur):"unknown"}),Ur=void 0}})}},WD=Gt;
54
+ `).run(d,new Date().toISOString(),c.id),y(`[okx-a2a:outbox-drain] delivery failed id=${c.id} kind=${c.kind}: ${d}`)}return(i>0||a>0)&&b.info(h.SESSION_DISPATCHED,{onchainosAgentId:"*",source:"gateway_outbox_drain",deliveredCount:String(i),failedCount:String(a),batchSize:String(o.length)}),{delivered:i,failed:a,skipped:!1}}finally{r.close()}}function Vh(e={}){let t=e.intervalMs??YN,n=!1,r=async()=>{if(!n){n=!0;try{await JN({...e.dbPath!==void 0?{dbPath:e.dbPath}:{},...e.limit!==void 0?{limit:e.limit}:{}})}catch(o){y("[okx-a2a:outbox-drain] tick failed:",o)}finally{n=!1}}},s=setInterval(()=>{r()},t);return s.unref?.(),r(),()=>{clearInterval(s)}}te();var Hr=require("node:child_process"),xd=require("node:fs"),ni=require("node:os"),On=require("node:path"),zh=require("node:util");se();var Xh=(0,zh.promisify)(Hr.execFile),QN=12e4,Pd=3e4,Jh=5e3,Qh=[(0,On.join)((0,ni.homedir)(),".local","bin"),(0,On.join)((0,ni.homedir)(),"Library","pnpm"),(0,On.join)((0,ni.homedir)(),".npm-global","bin"),"/opt/homebrew/bin","/usr/local/bin"];function X(e,t){return{source:"openclaw_gateway",provider:"openclaw",action:e,...t??{}}}async function ri(e,t=Pd){let n=process.env.OKX_A2A_BIN?.trim();if(n)return Zh(`${n} ${e.map(rm).join(" ")}`,t,si());let r=await ZN();if(!r)return{ok:!1,stdout:"",stderr:"okx-a2a binary not found"};try{let{stdout:s,stderr:o}=await Xh(r,e,{timeout:t,env:si()});return{ok:!0,stdout:s,stderr:o}}catch(s){let o=s;return{ok:!1,stdout:String(o.stdout??""),stderr:String(o.stderr??o.message??s)}}}async function ZN(){let e=await Zh("command -v okx-a2a",Pd),t=e.stdout.trim().split(/\r?\n/)[0]?.trim();if(e.ok&&t)return t;for(let n of Qh){let r=(0,On.join)(n,"okx-a2a");if((0,xd.existsSync)(r))return r}return null}function ew(){let e=tm("command -v okx-a2a",Pd),t=e.stdout.trim().split(/\r?\n/)[0]?.trim();if(e.ok&&t)return t;for(let n of Qh){let r=(0,On.join)(n,"okx-a2a");if((0,xd.existsSync)(r))return r}return null}async function Zh(e,t,n=process.env){try{let{stdout:r,stderr:s}=await Xh(nm(),["-lc",e],{timeout:t,env:n});return{ok:!0,stdout:r,stderr:s}}catch(r){let s=r;return{ok:!1,stdout:String(s.stdout??""),stderr:String(s.stderr??s.message??r)}}}function em(e,t=Jh){let n=process.env.OKX_A2A_BIN?.trim();if(n)return tm(`${n} ${e.map(rm).join(" ")}`,t,si());let r=ew();if(!r)return{ok:!1,stdout:"",stderr:"okx-a2a binary not found"};try{return{ok:!0,stdout:(0,Hr.execFileSync)(r,e,{encoding:"utf8",stdio:["ignore","pipe","pipe"],timeout:t,env:si()}),stderr:""}}catch(s){let o=s;return{ok:!1,stdout:String(o.stdout??""),stderr:String(o.stderr??o.message??s)}}}function tm(e,t,n=process.env){try{return{ok:!0,stdout:(0,Hr.execFileSync)(nm(),["-lc",e],{encoding:"utf8",stdio:["ignore","pipe","pipe"],timeout:t,env:n}),stderr:""}}catch(r){let s=r;return{ok:!1,stdout:String(s.stdout??""),stderr:String(s.stderr??s.message??r)}}}function nm(){return process.env.SHELL||"/bin/sh"}function si(){return{...process.env,OKX_A2A_RUNTIME_CONTEXT:"openclaw-gateway",OKX_A2A_IN_GATEWAY:"1",OKX_A2A_GATEWAY_PROVIDER:"openclaw"}}function rm(e){return`'${e.replace(/'/g,"'\\''")}'`}function tw(e){let t=e.trim();return t.startsWith("running ")?"running":t.startsWith("stale ")?"stale":t==="stopped"?"stopped":"unknown"}function sm(e){let t=e.trim().split(/\r?\n/).reverse();for(let n of t){let r=n.trim();if(r.startsWith("{"))try{let s=JSON.parse(r);if(s&&typeof s=="object"&&!Array.isArray(s))return s}catch{}}return null}async function nw(){let e=await ri(["ai-provider","status","--json"]);if(!e.ok)return y("[okx-a2a:daemon] ai-provider status failed:",(e.stderr||e.stdout).trim()),b.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a ai-provider status failed"),X("provider_status",{status:"failed",stderr:e.stderr,stdout:e.stdout})),null;let n=sm(e.stdout)?.provider;return typeof n!="string"&&b.info(h.DAEMON_LIFECYCLE_SKIPPED,X("provider_status",{reason:"invalid_provider_status_output",status:"skipped",stdout:e.stdout})),typeof n=="string"?n:null}function rw(){let e=em(["ai-provider","status","--json"]);if(!e.ok)return y("[okx-a2a:daemon] ai-provider status failed during gateway signal:",(e.stderr||e.stdout).trim()),b.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a ai-provider status failed during gateway signal"),X("provider_status_signal",{status:"failed",stderr:e.stderr,stdout:e.stdout})),null;let n=sm(e.stdout)?.provider;return typeof n!="string"&&b.info(h.DAEMON_LIFECYCLE_SKIPPED,X("provider_status_signal",{reason:"invalid_provider_status_output",status:"skipped",stdout:e.stdout})),typeof n=="string"?n:null}async function om(){let e=await nw();return e!=="openclaw"?(y(`[okx-a2a:daemon] provider=${e??"(not set)"}; skipping OpenClaw-owned daemon lifecycle`),b.info(h.DAEMON_LIFECYCLE_SKIPPED,X("provider_mismatch",{selectedProvider:e??"",reason:"provider_not_openclaw",status:"skipped"})),!1):!0}function sw(){let e=rw();return e!=="openclaw"?(y(`[okx-a2a:daemon] provider=${e??"(not set)"}; skipping OpenClaw-owned daemon lifecycle during gateway signal`),b.info(h.DAEMON_LIFECYCLE_SKIPPED,X("provider_mismatch_signal",{selectedProvider:e??"",reason:"provider_not_openclaw",status:"skipped"})),!1):!0}async function im(){if(!await om())return;let e=await ri(["daemon","status"]),t=e.ok?tw(e.stdout):"unknown";e.ok||y("[okx-a2a:daemon] status failed:",(e.stderr||e.stdout).trim()),b.info(h.DAEMON_LIFECYCLE_REQUESTED,X("restart",{previousStatus:t,status:"requested"}));let n=await ri(["daemon","restart"],QN);if(!n.ok){y("[okx-a2a:daemon] restart failed:",(n.stderr||n.stdout).trim()),b.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a daemon restart failed"),X("restart",{previousStatus:t,status:"failed",stderr:n.stderr,stdout:n.stdout}));return}let r=n.stdout.trim();y(`[okx-a2a:daemon] ${r||"restart ok"} selectedProvider=openclaw previousStatus=${t}`),b.info(h.DAEMON_LIFECYCLE_REQUESTED,X("restart",{previousStatus:t,status:"ok"}))}async function am(){if(!await om())return;b.info(h.DAEMON_LIFECYCLE_REQUESTED,X("stop",{status:"requested"}));let e=await ri(["daemon","stop"]);if(!e.ok){y("[okx-a2a:daemon] stop failed:",(e.stderr||e.stdout).trim()),b.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a daemon stop failed"),X("stop",{status:"failed",stderr:e.stderr,stdout:e.stdout}));return}y(`[okx-a2a:daemon] ${e.stdout.trim()||"stop ok"}`),b.info(h.DAEMON_LIFECYCLE_REQUESTED,X("stop",{status:"ok"}))}function ow(e){if(!sw())return;b.info(h.DAEMON_LIFECYCLE_REQUESTED,X("stop_signal",{reason:e,status:"requested"}));let t=em(["daemon","stop"],Jh);if(!t.ok){y(`[okx-a2a:daemon] stop failed during ${e}:`,(t.stderr||t.stdout).trim()),b.error(h.DAEMON_LIFECYCLE_FAILED,new Error("okx-a2a daemon stop failed during gateway signal"),X("stop_signal",{reason:e,status:"failed",stderr:t.stderr,stdout:t.stdout}));return}y(`[okx-a2a:daemon] ${t.stdout.trim()||"stop ok"} reason=${e}`),b.info(h.DAEMON_LIFECYCLE_REQUESTED,X("stop_signal",{reason:e,status:"ok"}))}function cm(){let e=t=>{ow(t)};return process.on("SIGTERM",e),process.on("SIGINT",e),()=>{process.off("SIGTERM",e),process.off("SIGINT",e)}}te();se();te();var oi=require("node:fs"),dm=require("node:child_process"),lm=require("node:util");se();var pm=(0,lm.promisify)(dm.execFile),_t=null,um=new Set(["--message"]);async function iw(){if(_t)return _t;let e=process.env.ONCHAINOS_BIN;if(e)return y(`[onchainos] using ONCHAINOS_BIN=${e}`),_t=e,_t;try{let t=process.env.SHELL||"/bin/bash",{stdout:n}=await pm(t,["-lc","command -v onchainos"]),r=aw(n);if(r)return y(`[onchainos] resolved binary via shell: ${r}`),_t=r,_t}catch(t){y("[onchainos] shell resolve failed, will fallback to bare 'onchainos':",t)}return y("[onchainos] could not resolve binary path, falling back to bare 'onchainos'"),_t="onchainos",_t}function aw(e){let t=e.split(/\r?\n/).map(n=>n.trim()).filter(Boolean).reverse();for(let n of t)if(cw(n))return n;return null}function cw(e){try{return(0,oi.accessSync)(e,oi.constants.X_OK),!0}catch{return!1}}function fm(e){let t=[],n=!1;for(let r of e){if(n){t.push("<redacted>"),n=!1;continue}let s=[...um].find(o=>r.startsWith(`${o}=`));if(s){t.push(`${s}=<redacted>`);continue}t.push(r),um.has(r)&&(n=!0)}return t}function uw(e,t){return`${e} ${fm(t).join(" ")}`}async function gm(e){let t=await iw(),n=uw(t,e);y(`[onchainos] exec: ${n}`);let r=Date.now();try{let s=await pm(t,e);return y(`[onchainos] exec done: ${n} (${Date.now()-r}ms, stdout=${s.stdout.length}B, stderr=${s.stderr.length}B)`),s}catch(s){throw y(`[onchainos] exec error: ${n} (${Date.now()-r}ms) code=${s.code} signal=${s.signal} killed=${s.killed} message=${s.message}`),b.error(h.ONCHAINOS_CLI_ERROR,new Error("onchainos command failed"),{component:"onchainos_cli",source:"onchainos",stage:"exec",communicationClass:"onchainos_cli_or_api_issue",operation:fm(e).slice(0,3).join(" "),reason:"exec_failed",argCount:String(e.length),exitCode:String(s?.code??""),signal:String(s?.signal??""),killed:String(s?.killed??""),stderrBytes:String(Buffer.byteLength(String(s?.stderr??""),"utf8")),stdoutBytes:String(Buffer.byteLength(String(s?.stdout??""),"utf8")),cliErrorName:s instanceof Error?s.name:"",cliErrorMessageLength:String(String(s?.message??"").length),durationMs:String(Date.now()-r)}),s}}se();var _m={OK_FALSE:"ok_false",JSON_PARSE_FAILED:"json_parse_failed"};function hm(e){let t="0";try{JSON.parse(e),t="1"}catch{t="0"}return{responseBytes:String(Buffer.byteLength(e,"utf8")),responseJson:t}}function mm(e,t,n){return{component:"onchainos_cli",source:"onchainos",stage:"ok_false",communicationClass:"onchainos_cli_or_api_issue",operation:t,reason:_m.OK_FALSE,...hm(e),...n}}function Em(e,t,n={}){try{return JSON.parse(e)}catch(r){let s=r instanceof Error?r:new Error(String(r));throw b.error(h.ONCHAINOS_CLI_ERROR,s,{component:"onchainos_cli",source:"onchainos",stage:"json_parse",communicationClass:"onchainos_cli_or_api_issue",operation:t,reason:_m.JSON_PARSE_FAILED,...hm(e),...n}),s}}se();var ym=/session expired/i;function Ud(e){try{let t=JSON.parse(e);return t.ok===!1&&ym.test(String(t.error??""))}catch{return ym.test(e)}}function Sm(e){b.error(h.ONCHAINOS_SESSION_EXPIRED,new Error("onchainos session expired"),{component:"onchainos_cli",source:"onchainos",stage:"session_expired",operation:e,command:e,communicationClass:"onchainos_auth_issue",reason:"session_expired"})}function Tm(e,t){if(t?.notifySessionExpired){t.notifySessionExpired(e);return}Sm(e)}function dw(e,t,n){Ud(e)&&Tm(t,n)}function lw(e,t,n){let r=String(e?.stdout??"");r&&Ud(r)&&Tm(t,n)}async function bm(e){y("[onchainos] fetching system-config");let t,n;try{({stdout:t,stderr:n}=await gm(["agent","system-config"]))}catch(s){throw lw(s,"system-config",e),s}n&&y(`[onchainos] stderr (system-config): ${n}`);let r=Em(t,"system-config");if(!r.ok){dw(t,"system-config",e);let s=new Error("onchainos agent system-config failed");throw b.error(h.ONCHAINOS_CLI_ERROR,s,mm(t,"system-config")),s}return y(`[onchainos] fetched system-config: ${Object.keys(r.data).length} keys`),r.data}se();var pw=process.env.SENTRY_ENV==="dev"?"dev":"prod",Im={projectName:"okx/openclaw-okx-a2a-extension",release:"0.0.16-beta-d0ec14bc63-260623103149",environment:pw};var Cn,Dn,Yr;function fw(e){let t=e?.details?.requestId;return typeof t=="string"&&t.trim()?`openclaw devices approve ${t}`:"openclaw devices approve --latest"}function gw(e){let t=e?.details??{},n=md(e);return["OKX A2A plugin needs OpenClaw gateway `operator.admin` scope before it can create sessions, inject chat messages, and route XMTP conversations.","","Ask the user whether they approve granting this scope to the OKX A2A plugin.","","If the user approves, ask them to run this command on the OpenClaw host:","","```bash",fw(e),"```","",`requestId: ${t.requestId??""}`,`deviceId: ${t.deviceId??""}`,`requestedScopes: ${Array.isArray(t.requestedScopes)?t.requestedScopes.join(","):""}`,`approvedScopes: ${Array.isArray(t.approvedScopes)?t.approvedScopes.join(","):""}`,n?`hint: ${n}`:""].filter(Boolean).join(`
55
+ `)}function _w(){Ho({key:sh()}).then(()=>{y("[okx-a2a:service] gateway client admin precheck succeeded"),b.info(h.GATEWAY_STARTED,{source:"gateway_preconnect",outcome:"ok"})},e=>{y("[okx-a2a:service] gateway client admin precheck failed:",e),b.error(h.GATEWAY_CONNECT_FAILED,e instanceof Error?e:new Error(String(e)),{source:"gateway_preconnect",code:String(e?.gatewayCode??e?.details?.code??""),reason:String(e?.details?.reason??""),requestId:String(e?.details?.requestId??"")}),Yh(gw(e),{source:"gateway_preconnect"}).then(({dispatched:t,failed:n})=>{b.info(h.USER_DISPATCHED,{source:"gateway_preconnect",outcome:n.length===0?"all_ok":"partial",dispatchedChannels:t.join(","),failedChannels:n.join(","),dispatchedCount:String(t.length),failedCount:String(n.length)})},t=>{b.error(h.USER_DISPATCH_FAILED,t instanceof Error?t:new Error(String(t)),{source:"gateway_preconnect"})})})}async function hw(e){try{let t=await bm();if(typeof t.sentryDsn=="string"&&t.sentryDsn){H_({dsn:t.sentryDsn,...Im,agentPlatform:"openclaw"});return}$d("[okx-a2a] system-config did not return sentryDsn; Sentry not initialized \u2014 no further events will be reported to SLS"),b.error(h.SENTRY_INIT_SKIPPED,void 0,{onchainosAgentId:"*",reason:"system-config missing sentryDsn",pluginId:jt.id,pluginVersion:jt.version,source:e})}catch(t){y(`[okx-a2a:service] system-config fetch failed in ${e}:`,t),b.error(h.CONFIG_LOAD_FAILED,t instanceof Error?t:new Error(String(t)),{source:e})}}function Md(e,t){let n=[e?.sessionKey,e?.context?.sessionKey,e?.ctx?.sessionKey,e?.hookContext?.sessionKey,t?.sessionKey];for(let r of n)if(typeof r=="string"&&r.trim())return r;return null}function Ld(e,t){let n=[e?.runId,e?.agentRunId,e?.context?.runId,e?.context?.agentRunId,e?.ctx?.runId,e?.ctx?.agentRunId,e?.hookContext?.runId,e?.hookContext?.agentRunId,t?.runId,t?.agentRunId];for(let r of n)if(typeof r=="string"&&r.trim())return r;return null}function qd(e,t){let n=e[t];if(typeof n!="string"||!n.trim())throw new Error(`Missing required param ${t}`);return n}function oe(e,t){let n=e[t];return typeof n=="string"&&n.trim()?n:void 0}function Fd(e,t){let n=e[t];if(!Array.isArray(n))return;let r=n.filter(s=>typeof s=="string"&&s.trim().length>0).map(s=>s.trim());return r.length>0?r:void 0}function mw(e,t){let n=e[t];return typeof n=="boolean"?n:void 0}var jt={id:"okx-a2a",name:"OKX A2A Plugin",version:"0.0.16-beta-d0ec14bc63-260623103149",register(e){Hd(e.runtime),e.registerChannel({plugin:K_}),e.registerGatewayMethod("okx-a2a.dispatch_user",async({params:t,respond:n})=>{try{let r=qd(t,"content"),s=oe(t,"label"),o=oe(t,"sessionKey"),i=Fd(t,"sessionKeys"),a=oe(t,"jobId"),c=oe(t,"currentSessionKey");n(!0,i?await Fh({sessionKeys:i,content:r,label:s}):o?await Gh({sessionKey:o,content:r,label:s}):await ei({content:r,label:s,jobId:a,currentSessionKey:c}))}catch(r){n(!1,void 0,{code:"INVALID_REQUEST",message:r instanceof Error?r.message:String(r)})}},{scope:"operator.admin"}),e.registerGatewayMethod("okx-a2a.prompt_user",async({params:t,respond:n})=>{try{let r=qd(t,"userContent"),s=qd(t,"llmContent"),o=oe(t,"sessionKey"),i=Fd(t,"sessionKeys"),a=oe(t,"jobId"),c=oe(t,"currentSessionKey");n(!0,i?await $h({sessionKeys:i,userContent:r,llmContent:s}):o?await Hh({sessionKey:o,userContent:r,llmContent:s}):await ti({userContent:r,llmContent:s,jobId:a,currentSessionKey:c}))}catch(r){n(!1,void 0,{code:"INVALID_REQUEST",message:r instanceof Error?r.message:String(r)})}},{scope:"operator.admin"}),e.registerGatewayMethod("okx-a2a.delete_sessions",async({params:t,respond:n})=>{try{let r=oe(t,"sessionKey"),s=Fd(t,"sessionKeys"),o=oe(t,"jobId");if(!r&&!s&&!o)throw new Error("Missing required selector: sessionKey, sessionKeys, or jobId");let i=oe(t,"myAgentId"),a=oe(t,"toAgentId"),c=oe(t,"myXmtpAddress"),u=oe(t,"toXmtpAddress"),d=mw(t,"deleteTranscript");n(!0,await yh({...r?{sessionKey:r}:{},...s?{sessionKeys:s}:{},...o?{jobId:o}:{},...i?{myAgentId:i}:{},...a?{toAgentId:a}:{},...c?{myXmtpAddress:c}:{},...u?{toXmtpAddress:u}:{},...d!==void 0?{deleteTranscript:d}:{}}))}catch(r){n(!1,void 0,{code:"INVALID_REQUEST",message:r instanceof Error?r.message:String(r)})}},{scope:"operator.admin"}),e.registerHook("agent:bootstrap",async t=>{let n=t.context,r=n.bootstrapFiles;if(Array.isArray(r))try{let s=r.map(i=>`${i.name}(${i.missing?"missing":`${i.content?.length??0}b`})`).join(", ");y(`[okx-a2a:hook] agent:bootstrap agentId=${n.agentId??"?"} files=[${s}]`);let o=r.reduce((i,a)=>i+(a.content?.length??0),0);b.info(h.BOOTSTRAP_APPLIED,{openclawAgentId:n.agentId??"",promptSize:String(o),fileCount:String(r.length),missingCount:String(r.filter(i=>i.missing).length)})}catch(s){b.error(h.BOOTSTRAP_FAILED,s instanceof Error?s:void 0,{openclawAgentId:n.agentId??""})}},{name:"okx-a2a-agent-bootstrap"}),e.on("before_agent_run",async(t,n)=>{let r=Md(t,n),s=Ld(t,n);if(!r){y("[xmtp_prompt_user:queue] before_agent_run ignored: missing sessionKey");return}Ih({runId:s,sessionKey:r})&&console.log(`[okx-a2a:hook] remembered gateway route origin runId=${s} sessionKey=${r}`),Od(r)}),e.on("before_tool_call",async(t,n)=>{let r=Md(t,n),s=Ld(t,n);yd(r);let o=Ko({runId:s,sessionKey:r}),i=bh({toolName:t?.toolName,params:t?.params,sessionKey:r,routeSessionKeys:o});if(i)return console.log(`[okx-a2a:hook] injected gateway session env tool=${t?.toolName??"?"} sessionKey=${r} routeSessionKeys=${o.join(",")}`),{params:i}},{priority:50}),e.on("agent_end",async(t,n)=>{let r=Md(t,n),s=Ld(t,n);if(Ah({runId:s,sessionKey:r}),!r){y("[xmtp_prompt_user:queue] agent_end ignored: missing sessionKey");return}Cd(r)}),e.registerService({id:"okx-a2a:core",start:async()=>{y("[okx-a2a:service] okx-a2a:core starting (multi-identity mode); initializing communication identities..."),Yr=Date.now(),b.info(h.GATEWAY_STARTED,{onchainosAgentId:"*",pid:String(process.pid),pluginId:jt.id,pluginVersion:jt.version,nodeVersion:process.version,startedAt:String(Yr)}),Dn&&Dn(),Dn=cm(),hh(),await im(),_w(),Cn&&Cn(),Cn=Vh(),await hw("openclaw_lightweight_gateway_service"),y("[okx-a2a:service] OpenClaw lightweight gateway initialized; node daemon owns XMTP receive/send/agent sync.")},stop:async()=>{Cn&&(Cn(),Cn=void 0),Dn&&(Dn(),Dn=void 0),mh(),await am(),y("[okx-a2a:service] okx-a2a:core stopped");let t=Date.now();b.info(h.GATEWAY_STOPPED,{onchainosAgentId:"*",pid:String(process.pid),pluginId:jt.id,pluginVersion:jt.version,stoppedAt:String(t),uptimeMs:Yr?String(t-Yr):"unknown"}),Yr=void 0}})}},Ew=jt;
47
56
  /*! Bundled license information:
48
57
 
49
58
  cookie/index.js: