db-studio 1.13.0 → 1.14.0

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.
Files changed (62) hide show
  1. package/dist/index.js +105 -84
  2. package/dist/index.js.map +1 -1
  3. package/dist/web-dist/assets/_pathlessLayout-BXxEoaJK.js +1 -0
  4. package/dist/web-dist/assets/{_pathlessLayout-zxU06-pr.js → _pathlessLayout-wBh7gK9q.js} +61 -61
  5. package/dist/web-dist/assets/_queryId-CZGDd4fs.js +1 -0
  6. package/dist/web-dist/assets/_table-DZOIq7aF.js +1 -0
  7. package/dist/web-dist/assets/_table-j-6h6Om5.js +1 -0
  8. package/dist/web-dist/assets/badge-DiSuKlwP.js +1 -0
  9. package/dist/web-dist/assets/browser-DdWTHJJW.js +1 -0
  10. package/dist/web-dist/assets/{bundle-mjs-uZfDJfiH.js → bundle-mjs-5mNXw8Uh.js} +1 -1
  11. package/dist/web-dist/assets/{code-editor-CuKFGk5C.js → code-editor-BXm3myTR.js} +2 -2
  12. package/dist/web-dist/assets/database.store-DzuxpP71.js +1 -0
  13. package/dist/web-dist/assets/{dist-BeZAMt_p.js → dist-Bcrd0PtF.js} +1 -1
  14. package/dist/web-dist/assets/{format-cell-value-wHw1lD8Z.js → format-cell-value-lejp1lDf.js} +1 -1
  15. package/dist/web-dist/assets/highlighted-body-OFNGDK62-Cb34z6at.js +1 -0
  16. package/dist/web-dist/assets/icons-D6bNpzOL.js +1 -0
  17. package/dist/web-dist/assets/index-B_H1M603.js +36 -0
  18. package/dist/web-dist/assets/index-DHb8byer.css +2 -0
  19. package/dist/web-dist/assets/{indexes-CNKwQMi3.js → indexes-DecPH1pX.js} +1 -1
  20. package/dist/web-dist/assets/{logs-BYKvN4gr.js → logs-CXbJheYV.js} +1 -1
  21. package/dist/web-dist/assets/mermaid-GHXKKRXX-B5pqoNgJ.js +1 -0
  22. package/dist/web-dist/assets/{middleware-CPy2Suyk.js → middleware-CYbbS--7.js} +1 -1
  23. package/dist/web-dist/assets/{monaco-editor-VzUhCCqE.js → monaco-editor-C-DV5CL8.js} +36 -36
  24. package/dist/web-dist/assets/monitoring-DWzrlTkx.js +22 -0
  25. package/dist/web-dist/assets/overlay.store-TOgdd28d.js +11 -0
  26. package/dist/web-dist/assets/{queries.store-DFbzjjlv.js → queries.store-Cul86O-l.js} +1 -1
  27. package/dist/web-dist/assets/query-runner-BhGrHn5P.js +17 -0
  28. package/dist/web-dist/assets/radix-ui-CtzftI1z.js +51 -0
  29. package/dist/web-dist/assets/react-B3nJmLdO.js +1 -0
  30. package/dist/web-dist/assets/{react-dom-t511kH7T.js → react-dom-DOIt489g.js} +1 -1
  31. package/dist/web-dist/assets/redis-value-B1T4ApeG.js +1 -0
  32. package/dist/web-dist/assets/{rolldown-runtime-Bc_uOZR3.js → rolldown-runtime-D2WZefnn.js} +1 -1
  33. package/dist/web-dist/assets/runner-BI316iCf.js +1 -0
  34. package/dist/web-dist/assets/schema-CwD_s_ox.js +64 -0
  35. package/dist/web-dist/assets/{schema-Bv15Fk7L.js → schema-D9V1P9K2.js} +1 -1
  36. package/dist/web-dist/assets/{table-B-C0yxvL.js → table-DbvYpea0.js} +1 -1
  37. package/dist/web-dist/assets/tanstack-DQKs7SF9.js +11 -0
  38. package/dist/web-dist/assets/{visualizer-DOCDtIMq.js → visualizer-7aPZoUCc.js} +1 -1
  39. package/dist/web-dist/index.html +18 -18
  40. package/package.json +3 -3
  41. package/dist/web-dist/assets/_pathlessLayout-GynxlRL_.js +0 -1
  42. package/dist/web-dist/assets/_queryId-BRuHa3fh.js +0 -1
  43. package/dist/web-dist/assets/_table-8IAksPyY.js +0 -1
  44. package/dist/web-dist/assets/_table-CtfVc03T.js +0 -1
  45. package/dist/web-dist/assets/ai-assistant-CpA6z3NH.js +0 -1
  46. package/dist/web-dist/assets/browser-BGLz7ANr.js +0 -1
  47. package/dist/web-dist/assets/database.store-B5cSp4MJ.js +0 -1
  48. package/dist/web-dist/assets/highlighted-body-OFNGDK62-BQA5yQZx.js +0 -1
  49. package/dist/web-dist/assets/icons-DMY0-Mbl.js +0 -1
  50. package/dist/web-dist/assets/index-BsliTpNZ.js +0 -35
  51. package/dist/web-dist/assets/index-Cyl_0l9I.css +0 -2
  52. package/dist/web-dist/assets/mermaid-GHXKKRXX-BKNFWsy1.js +0 -1
  53. package/dist/web-dist/assets/monitoring-B3eHd8rg.js +0 -22
  54. package/dist/web-dist/assets/popover-C6AOV9WB.js +0 -1
  55. package/dist/web-dist/assets/query-runner-RUXGiIf2.js +0 -17
  56. package/dist/web-dist/assets/radix-ui-CCBRgLy1.js +0 -51
  57. package/dist/web-dist/assets/react-frqLVtia.js +0 -1
  58. package/dist/web-dist/assets/redis-value-Lhzkhu4Q.js +0 -1
  59. package/dist/web-dist/assets/runner-lxnLCgPi.js +0 -1
  60. package/dist/web-dist/assets/schema-By474UiK.js +0 -64
  61. package/dist/web-dist/assets/tanstack-BfT_e-Qv.js +0 -10
  62. package/dist/web-dist/assets/tooltip-Dd1J4hNt.js +0 -9
@@ -0,0 +1,22 @@
1
+ import{r as Jp}from"./rolldown-runtime-D2WZefnn.js";import{xt as Zp}from"./icons-D6bNpzOL.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.14.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e8852f5d-d7cb-429d-a79c-d28595413a79",e._sentryDebugIdIdentifier="sentry-dbid-e8852f5d-d7cb-429d-a79c-d28595413a79")}catch{}})();var O=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,V=globalThis,gi="10.52.0";function er(){return Wi(V),V}function Wi(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||"10.52.0",t[gi]=t["10.52.0"]||{}}function Mr(e,t,r=V){const n=r.__SENTRY__=r.__SENTRY__||{},i=n[gi]=n["10.52.0"]||{};return i[e]||(i[e]=t())}var Qp=["debug","info","warn","error","log","assert","trace"],eh="Sentry Logger ",_i={};function tr(e){if(!("console"in V))return e();const t=V.console,r={},n=Object.keys(_i);n.forEach(i=>{const s=_i[i];r[i]=t[i],t[i]=s});try{return e()}finally{n.forEach(i=>{t[i]=r[i]})}}function th(){na().enabled=!0}function rh(){na().enabled=!1}function Xu(){return na().enabled}function nh(...e){ra("log",...e)}function ih(...e){ra("warn",...e)}function sh(...e){ra("error",...e)}function ra(e,...t){O&&Xu()&&tr(()=>{V.console[e](`${eh}[${e}]:`,...t)})}function na(){return O?Mr("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var E={enable:th,disable:rh,isEnabled:Xu,log:nh,warn:ih,error:sh},Ku=50;var Ha=/\(error: (.*)\)/,ja=/captureMessage|captureException/;function Ju(...e){const t=e.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0,i=0)=>{const s=[],o=r.split(`
2
+ `);for(let a=n;a<o.length;a++){let c=o[a];c.length>1024&&(c=c.slice(0,1024));const u=Ha.test(c)?c.replace(Ha,"$1"):c;if(!u.includes("Error: ")){for(const l of t){const d=l(u);if(d){s.push(d);break}}if(s.length>=Ku+i)break}}return ah(s.slice(i))}}function oh(e){return Array.isArray(e)?Ju(...e):e}function ah(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Bn(t).function||"")&&t.pop(),t.reverse(),ja.test(Bn(t).function||"")&&(t.pop(),ja.test(Bn(t).function||"")&&t.pop()),t.slice(0,Ku).map(r=>({...r,filename:r.filename||Bn(t).filename,function:r.function||"?"}))}function Bn(e){return e[e.length-1]||{}}var is="<anonymous>";function ft(e){try{return!e||typeof e!="function"?is:e.name||is}catch{return is}}function Ba(e){const t=e.exception;if(t){const r=[];try{return t.values.forEach(n=>{n.stacktrace.frames&&r.push(...n.stacktrace.frames)}),r}catch{return}}}function Zu(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}var Jr={},Wa={};function Ft(e,t){return Jr[e]=Jr[e]||[],Jr[e].push(t),()=>{const r=Jr[e];if(r){const n=r.indexOf(t);n!==-1&&r.splice(n,1)}}}function Mt(e,t){if(!Wa[e]){Wa[e]=!0;try{t()}catch(r){O&&E.error(`Error while instrumenting ${e}`,r)}}}function Be(e,t){const r=e&&Jr[e];if(r)for(const n of r)try{n(t)}catch(i){O&&E.error(`Error while triggering instrumentation handler.
3
+ Type: ${e}
4
+ Name: ${ft(n)}
5
+ Error:`,i)}}var ss=null;function Qu(e){const t="error";Ft(t,e),Mt(t,ch)}function ch(){ss=V.onerror,V.onerror=function(e,t,r,n,i){return Be("error",{column:n,error:i,line:r,msg:e,url:t}),ss?ss.apply(this,arguments):!1},V.onerror.__SENTRY_INSTRUMENTED__=!0}var os=null;function el(e){const t="unhandledrejection";Ft(t,e),Mt(t,uh)}function uh(){os=V.onunhandledrejection,V.onunhandledrejection=function(e){return Be("unhandledrejection",e),os?os.apply(this,arguments):!0},V.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var tl=Object.prototype.toString;function zi(e){switch(tl.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return gt(e,Error)}}function Lr(e,t){return tl.call(e)===`[object ${t}]`}function rl(e){return Lr(e,"ErrorEvent")}function za(e){return Lr(e,"DOMError")}function lh(e){return Lr(e,"DOMException")}function dt(e){return Lr(e,"String")}function ia(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function xr(e){return e===null||ia(e)||typeof e!="object"&&typeof e!="function"}function gn(e){return Lr(e,"Object")}function Gi(e){return typeof Event<"u"&&gt(e,Event)}function dh(e){return typeof Element<"u"&&gt(e,Element)}function ph(e){return Lr(e,"RegExp")}function Rn(e){return!!(e?.then&&typeof e.then=="function")}function hh(e){return gn(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function gt(e,t){try{return e instanceof t}catch{return!1}}function nl(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function sa(e){return typeof Request<"u"&&gt(e,Request)}var oa=V,fh=80;function be(e,t={}){if(!e)return"<unknown>";try{let r=e;const n=5,i=[];let s=0,o=0;const a=" > ",c=3;let u;const l=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||fh;for(;r&&s++<n&&(u=gh(r,l),!(u==="html"||s>1&&o+i.length*c+u.length>=d));)i.push(u),o+=u.length,r=r.parentNode;return i.reverse().join(a)}catch{return"<unknown>"}}function gh(e,t){const r=e,n=[];if(!r?.tagName)return"";if(oa.HTMLElement&&r instanceof HTMLElement&&r.dataset){if(r.dataset.sentryComponent)return r.dataset.sentryComponent;if(r.dataset.sentryElement)return r.dataset.sentryElement}n.push(r.tagName.toLowerCase());const i=t?.length?t.filter(s=>r.getAttribute(s)).map(s=>[s,r.getAttribute(s)]):null;if(i?.length)i.forEach(s=>{n.push(`[${s[0]}="${s[1]}"]`)});else{r.id&&n.push(`#${r.id}`);const s=r.className;if(s&&dt(s)){const o=s.split(/\s+/);for(const a of o)n.push(`.${a}`)}}for(const s of["aria-label","type","name","title","alt"]){const o=r.getAttribute(s);o&&n.push(`[${s}="${o}"]`)}return n.join("")}function Pn(){try{return oa.document.location.href}catch{return""}}function il(e,t=5){if(!oa.HTMLElement)return null;let r=e;for(let n=0;n<t;n++){if(!r)return null;if(r instanceof HTMLElement){if(r.dataset.sentryComponent)return r.dataset.sentryComponent;if(r.dataset.sentryElement)return r.dataset.sentryElement}r=r.parentNode}return null}function Fe(e,t,r){if(!(t in e))return;const n=e[t];if(typeof n!="function")return;const i=r(n);typeof i=="function"&&sl(i,n);try{e[t]=i}catch{O&&E.log(`Failed to replace method "${t}" in object`,e)}}function $e(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{O&&E.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function sl(e,t){try{e.prototype=t.prototype=t.prototype||{},$e(e,"__sentry_original__",t)}catch{}}function aa(e){return e.__sentry_original__}function ol(e){if(zi(e))return{message:e.message,name:e.name,stack:e.stack,...Va(e)};if(Gi(e)){const t={type:e.type,target:Ga(e.target),currentTarget:Ga(e.currentTarget),...Va(e)};return typeof CustomEvent<"u"&&gt(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Ga(e){try{return dh(e)?be(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Va(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function _h(e){const t=Object.keys(ol(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}var ar;function Cn(e){if(ar!==void 0)return ar?ar(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),r=V;return t in r&&typeof r[t]=="function"?(ar=r[t],ar(e)):(ar=null,e())}function Pt(){return Cn(()=>Math.random())}function An(){return Cn(()=>Date.now())}function Hs(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Ya(e,t){if(!Array.isArray(e))return"";const r=[];for(let n=0;n<e.length;n++){const i=e[n];try{nl(i)?r.push(Zu(i)):r.push(String(i))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function on(e,t,r=!1){return dt(e)?ph(t)?t.test(e):dt(t)?r?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function Ct(e,t=[],r=!1){return t.some(n=>on(e,n,r))}function vh(){const e=V;return e.crypto||e.msCrypto}var as;function mh(){return Pt()*16}function We(e=vh()){try{if(e?.randomUUID)return Cn(()=>e.randomUUID()).replace(/-/g,"")}catch{}return as||(as="10000000100040008000100000000000"),as.replace(/[018]/g,t=>(t^(mh()&15)>>t/4).toString(16))}function al(e){return e.exception?.values?.[0]}function zt(e){const{message:t,event_id:r}=e;if(t)return t;const n=al(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function js(e,t,r){const n=e.exception=e.exception||{},i=n.values=n.values||[],s=i[0]=i[0]||{};s.value||(s.value=t||""),s.type||(s.type=r||"Error")}function kr(e,t){const r=al(e);if(!r)return;const n={type:"generic",handled:!0},i=r.mechanism;if(r.mechanism={...n,...i,...t},t&&"data"in t){const s={...i?.data,...t.data};r.mechanism.data=s}}function Xa(e){if(yh(e))return!0;try{$e(e,"__sentry_captured__",!0)}catch{}return!1}function yh(e){try{return e.__sentry_captured__}catch{}}var cl=1e3;function rr(){return An()/cl}function bh(){const{performance:e}=V;if(!e?.now||!e.timeOrigin)return rr;const t=e.timeOrigin;return()=>(t+Cn(()=>e.now()))/cl}var Ka;function _e(){return(Ka??(Ka=bh()))()}var cs=null;function Sh(){const{performance:e}=V;if(!e?.now)return;const t=3e5,r=Cn(()=>e.now()),n=An(),i=e.timeOrigin;if(typeof i=="number"&&Math.abs(i+r-n)<t)return i;const s=e.timing?.navigationStart;return typeof s=="number"&&Math.abs(s+r-n)<t?s:n-r}function we(){return cs===null&&(cs=Sh()),cs}function Eh(e){const t=_e(),r={sid:We(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Th(r)};return e&&Rr(r,e),r}function Rr(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||_e(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:We()),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{const r=e.timestamp-e.started;e.duration=r>=0?r: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 wh(e,t){let r={};t?r={status:t}:e.status==="ok"&&(r={status:"exited"}),Rr(e,r)}function Th(e){return{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,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function On(e,t,r=2){if(!t||typeof t!="object"||r<=0)return t;if(e&&Object.keys(t).length===0)return e;const n={...e};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=On(n[i],t[i],r-1));return n}function _t(){return We()}function pt(){return We().substring(16)}var Bs="_sentrySpan";function _n(e,t){t?$e(e,Bs,t):delete e[Bs]}function vi(e){return e[Bs]}var Ih=100,Kt=class Ws{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:_t(),sampleRand:Pt()}}clone(){const t=new Ws;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,_n(t,vi(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Rr(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,r){return this.setTags({[t]:r})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,r){return this.setAttributes({[t]:r})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,r){return this._extra={...this._extra,[t]:r},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,r){return r===null?delete this._contexts[t]:this._contexts[t]=r,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const r=typeof t=="function"?t(this):t,{tags:n,attributes:i,extra:s,user:o,contexts:a,level:c,fingerprint:u=[],propagationContext:l,conversationId:d}=(r instanceof Ws?r.getScopeData():gn(r)?t:void 0)||{};return this._tags={...this._tags,...n},this._attributes={...this._attributes,...i},this._extra={...this._extra,...s},this._contexts={...this._contexts,...a},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),u.length&&(this._fingerprint=u),l&&(this._propagationContext=l),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,_n(this,void 0),this._attachments=[],this.setPropagationContext({traceId:_t(),sampleRand:Pt()}),this._notifyScopeListeners(),this}addBreadcrumb(t,r){const n=typeof r=="number"?r:Ih;if(n<=0)return this;const i={timestamp:rr(),...t,message:t.message?Hs(t.message,2048):t.message};return this._breadcrumbs.push(i),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent("buffer_overflow","log_item")),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}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:vi(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=On(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,r){const n=r?.event_id||We();if(!this._client)return O&&E.warn("No client configured on scope - will not capture exception!"),n;const i=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:i,...r,event_id:n},this),n}captureMessage(t,r,n){const i=n?.event_id||We();if(!this._client)return O&&E.warn("No client configured on scope - will not capture message!"),i;const s=n?.syntheticException??new Error(t);return this._client.captureMessage(t,r,{originalException:t,syntheticException:s,...n,event_id:i},this),i}captureEvent(t,r){const n=t.event_id||r?.event_id||We();return this._client?(this._client.captureEvent(t,{...r,event_id:n},this),n):(O&&E.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}};function xh(){return Mr("defaultCurrentScope",()=>new Kt)}function kh(){return Mr("defaultIsolationScope",()=>new Kt)}var Ja=e=>e instanceof Promise&&!e[ul],ul=Symbol("chained PromiseLike"),Rh=(e,t,r)=>{const n=e.then(i=>(t(i),i),i=>{throw r(i),i});return Ja(n)&&Ja(e)?n:Ph(e,n)},Ph=(e,t)=>{if(!t)return e;let r=!1;for(const n in e){if(n in t)continue;r=!0;const i=e[n];typeof i=="function"?Object.defineProperty(t,n,{value:(...s)=>i.apply(e,s),enumerable:!0,configurable:!0,writable:!0}):t[n]=i}return r&&Object.assign(t,{[ul]:!0}),t},Ch=class{constructor(e,t){let r;e?r=e:r=new Kt;let n;t?n=t:n=new Kt,this._stack=[{scope:r}],this._isolationScope=n}withScope(e){const t=this._pushScope();let r;try{r=e(t)}catch(n){throw this._popScope(),n}return Rn(r)?Rh(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Pr(){const e=er(),t=Wi(e);return t.stack=t.stack||new Ch(xh(),kh())}function Ah(e){return Pr().withScope(e)}function Oh(e,t){const r=Pr();return r.withScope(()=>(r.getStackTop().scope=e,t(e)))}function Za(e){return Pr().withScope(()=>e(Pr().getIsolationScope()))}function $h(){return{withIsolationScope:Za,withScope:Ah,withSetScope:Oh,withSetIsolationScope:(e,t)=>Za(t),getCurrentScope:()=>Pr().getScope(),getIsolationScope:()=>Pr().getIsolationScope()}}function Dr(e){const t=Wi(e);return t.acs?t.acs:$h()}var ll;function Nh(){return ll?.()}function Fh(){return ll!==void 0}function te(){const e=er();return Dr(e).getCurrentScope()}function nt(){const e=er();return Dr(e).getIsolationScope()}function Mh(){return Mr("globalScope",()=>new Kt)}function ca(...e){const t=er(),r=Dr(t);if(e.length===2){const[n,i]=e;return n?r.withSetScope(n,i):r.withScope(i)}return r.withScope(e[0])}function Y(){return te().getClient()}function Lh(e){const t=Nh();if(t)return{trace_id:t.traceId,span_id:t.spanId};const{traceId:r,parentSpanId:n,propagationSpanId:i}=e.getPropagationContext(),s={trace_id:r,span_id:i||pt()};return n&&(s.parent_span_id=n),s}var Rt="sentry.source",Dh="sentry.sample_rate",qh="sentry.previous_trace_sample_rate",vt="sentry.op",ve="sentry.origin",mi="sentry.idle_span_finish_reason",$n="sentry.measurement_unit",Nn="sentry.measurement_value",Qa="sentry.custom_span_name",dl="sentry.profile_id",nr="sentry.exclusive_time",Uh="sentry.link.type",Hh="gen_ai.conversation.id";function jh(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:"unauthenticated"};case 403:return{code:2,message:"permission_denied"};case 404:return{code:2,message:"not_found"};case 409:return{code:2,message:"already_exists"};case 413:return{code:2,message:"failed_precondition"};case 429:return{code:2,message:"resource_exhausted"};case 499:return{code:2,message:"cancelled"};default:return{code:2,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:"unimplemented"};case 503:return{code:2,message:"unavailable"};case 504:return{code:2,message:"deadline_exceeded"};default:return{code:2,message:"internal_error"}}return{code:2,message:"internal_error"}}function pl(e,t){e.setAttribute("http.response.status_code",t);const r=jh(t);r.message!=="unknown_error"&&e.setStatus(r)}function Bh(e){try{const t=V.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function Wh(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var hl="_sentryScope",fl="_sentryIsolationScope";function zh(e,t,r){e&&($e(e,fl,Bh(r)),$e(e,hl,t))}function yi(e){const t=e;return{scope:t[hl],isolationScope:Wh(t[fl])}}var gl="sentry-";function _l(e){const t=Vh(e);if(!t)return;const r=Object.entries(t).reduce((n,[i,s])=>{if(i.startsWith("sentry-")){const o=i.slice(7);n[o]=s}return n},{});if(Object.keys(r).length>0)return r}function Gh(e){if(e)return Yh(Object.entries(e).reduce((t,[r,n])=>(n&&(t[`${gl}${r}`]=n),t),{}))}function Vh(e){if(!(!e||!dt(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,r)=>{const n=ec(r);return Object.entries(n).forEach(([i,s])=>{t[i]=s}),t},{}):ec(e)}function ec(e){return e.split(",").map(t=>{const r=t.indexOf("=");return r===-1?[]:[t.slice(0,r),t.slice(r+1)].map(n=>{try{return decodeURIComponent(n.trim())}catch{return}})}).reduce((t,[r,n])=>(r&&n&&(t[r]=n),t),{})}function Yh(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[r,n],i)=>{const s=`${encodeURIComponent(r)}=${encodeURIComponent(n)}`,o=i===0?s:`${t},${s}`;return o.length>8192?(O&&E.warn(`Not adding key: ${r} with val: ${n} to baggage header due to exceeding baggage size limits.`),t):o},"")}var Xh=/^o(\d+)\./,Kh=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Jh(e){return e==="http"||e==="https"}function qr(e,t=!1){const{host:r,path:n,pass:i,port:s,projectId:o,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&i?`:${i}`:""}@${r}${s?`:${s}`:""}/${n&&`${n}/`}${o}`}function Zh(e){const t=Kh.exec(e);if(!t){tr(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[r,n,i="",s="",o="",a=""]=t.slice(1);let c="",u=a;const l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){const d=u.match(/^\d+/);d&&(u=d[0])}return vl({host:s,pass:i,path:c,projectId:u,port:o,protocol:r,publicKey:n})}function vl(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Qh(e){if(!O)return!0;const{port:t,projectId:r,protocol:n}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(E.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:r.match(/^\d+$/)?Jh(n)?t&&isNaN(parseInt(t,10))?(E.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(E.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(E.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function ef(e){return e.match(Xh)?.[1]}function tf(e){const t=e.getOptions(),{host:r}=e.getDsn()||{};let n;return t.orgId?n=String(t.orgId):r&&(n=ef(r)),n}function rf(e){const t=typeof e=="string"?Zh(e):vl(e);if(!(!t||!Qh(t)))return t}function vn(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}var ml=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function nf(e){if(!e)return;const t=e.match(ml);if(!t)return;let r;return t[3]==="1"?r=!0:t[3]==="0"&&(r=!1),{traceId:t[1],parentSampled:r,parentSpanId:t[2]}}function sf(e,t){const r=nf(e),n=_l(t);if(!r?.traceId)return{traceId:_t(),sampleRand:Pt()};const i=of(r,n);n&&(n.sample_rand=i.toString());const{traceId:s,parentSpanId:o,parentSampled:a}=r;return{traceId:s,parentSpanId:o,sampled:a,dsc:n||{},sampleRand:i}}function yl(e=_t(),t=pt(),r){let n="";return r!==void 0&&(n=r?"-1":"-0"),`${e}-${t}${n}`}function bl(e=_t(),t=pt(),r){return`00-${e}-${t}-${r?"01":"00"}`}function of(e,t){const r=vn(t?.sample_rand);if(r!==void 0)return r;const n=vn(t?.sample_rate);return n&&e?.parentSampled!==void 0?e.parentSampled?Pt()*n:n+Pt()*(1-n):Pt()}var tc=!1;function af(e){const{spanId:t,traceId:r}=e.spanContext(),{data:n,op:i,parent_span_id:s,status:o,origin:a,links:c}=K(e);return{parent_span_id:s,span_id:t,trace_id:r,data:n,op:i,status:o,origin:a,links:c}}function cf(e){const{spanId:t,traceId:r,isRemote:n}=e.spanContext(),i=n?t:K(e).parent_span_id,s=yi(e).scope;return{parent_span_id:i,span_id:n?s?.getPropagationContext().propagationSpanId||pt():t,trace_id:r}}function uf(e){const{traceId:t,spanId:r}=e.spanContext(),n=Lt(e);return yl(t,r,n)}function lf(e){const{traceId:t,spanId:r}=e.spanContext(),n=Lt(e);return bl(t,r,n)}function Sl(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:r,traceFlags:n,...i},attributes:s})=>({span_id:t,trace_id:r,sampled:n===1,attributes:s,...i}))}function El(e){if(e?.length)return e.map(({context:{spanId:t,traceId:r,traceFlags:n},attributes:i})=>({span_id:t,trace_id:r,sampled:n===1,attributes:i}))}function ht(e){return typeof e=="number"?rc(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?rc(e.getTime()):_e()}function rc(e){return e>9999999999?e/1e3:e}function K(e){if(xl(e))return e.getSpanJSON();const{spanId:t,traceId:r}=e.spanContext();if(Il(e)){const{attributes:n,startTime:i,name:s,endTime:o,status:a,links:c}=e;return{span_id:t,trace_id:r,data:n,description:s,parent_span_id:Tl(e),start_timestamp:ht(i),timestamp:ht(o)||void 0,status:kl(a),op:n[vt],origin:n[ve],links:Sl(c)}}return{span_id:t,trace_id:r,start_timestamp:0,data:{}}}function wl(e){if(xl(e))return e.getStreamedSpanJSON();const{spanId:t,traceId:r}=e.spanContext();if(Il(e)){const{attributes:n,startTime:i,name:s,endTime:o,status:a,links:c}=e;return{name:s,span_id:t,trace_id:r,parent_span_id:Tl(e),start_timestamp:ht(i),end_timestamp:ht(o),is_segment:e===Gs(e),status:Rl(a),attributes:n,links:El(c)}}return{span_id:t,trace_id:r,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===Gs(e)}}function Tl(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function Il(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function xl(e){return typeof e.getSpanJSON=="function"}function Lt(e){const{traceFlags:t}=e.spanContext();return t===1}function kl(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function Rl(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}var Gt="_sentryChildSpans",zs="_sentryRootSpan";function Pl(e,t){const r=e[zs]||e;$e(t,zs,r),e[Gt]?e[Gt].add(t):$e(e,Gt,new Set([t]))}function df(e,t){e[Gt]&&e[Gt].delete(t)}function ni(e){const t=new Set;function r(n){if(!t.has(n)&&Lt(n)){t.add(n);const i=n[Gt]?Array.from(n[Gt]):[];for(const s of i)r(s)}}return r(e),Array.from(t)}var Ee=Gs;function Gs(e){return e[zs]||e}function qe(){const e=er(),t=Dr(e);return t.getActiveSpan?t.getActiveSpan():vi(te())}function Vs(){tc||(tr(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),tc=!0)}var nc=!1;function pf(){if(nc)return;function e(){const t=qe(),r=t&&Ee(t);if(r){const n="internal_error";O&&E.log(`[Tracing] Root span: ${n} -> Global error occurred`),r.setStatus({code:2,message:n})}}e.tag="sentry_tracingErrorCallback",nc=!0,Qu(e),el(e)}function Xe(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||Y()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function ic(e){E.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function mn(e,t){if(!t?.length)return!1;for(const r of t){if(gf(r)){if(e.description&&on(e.description,r))return O&&ic(e),!0;continue}const n=!!r.attributes&&Object.keys(r.attributes).length>0;if(!r.name&&!r.op&&!n)continue;const i=r.name?e.description&&on(e.description,r.name):!0,s=r.op?e.op&&on(e.op,r.op):!0,o=r.attributes?Object.entries(r.attributes).every(([a,c])=>hf(e.attributes?.[a],c)):!0;if(i&&s&&o)return O&&ic(e),!0}return!1}function hf(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?on(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((r,n)=>r===t[n]):e===t}function ff(e,t){const r=t.parent_span_id,n=t.span_id;if(r)for(const i of e)i.parent_span_id===n&&(i.parent_span_id=r)}function gf(e){return typeof e=="string"||e instanceof RegExp}var _f="production",Cl="_frozenDsc";function ii(e,t){$e(e,Cl,t)}function Al(e,t){const r=t.getOptions(),{publicKey:n}=t.getDsn()||{},i={environment:r.environment||"production",release:r.release,public_key:n,trace_id:e,org_id:tf(t)};return t.emit("createDsc",i),i}function Ol(e,t){const r=t.getPropagationContext();return r.dsc||Al(r.traceId,e)}function $t(e){const t=Y();if(!t)return{};const r=Ee(e),n=K(r),i=n.data,s=r.spanContext().traceState,o=s?.get("sentry.sample_rate")??i["sentry.sample_rate"]??i["sentry.previous_trace_sample_rate"];function a(h){return(typeof o=="number"||typeof o=="string")&&(h.sample_rate=`${o}`),h}const c=r[Cl];if(c)return a(c);const u=s?.get("sentry.dsc"),l=u&&_l(u);if(l)return a(l);const d=Al(e.spanContext().traceId,t),p=i["sentry.source"]??i["sentry.span.source"],f=n.description;return p!=="url"&&f&&(d.transaction=f),Xe()&&(d.sampled=String(Lt(r)),d.sample_rand=s?.get("sentry.sample_rand")??yi(r).scope?.getPropagationContext().sampleRand.toString()),a(d),t.emit("createDsc",d,r),d}var rt=class{constructor(e={}){this._traceId=e.traceId||_t(),this._spanId=e.spanId||pt(),this.dropReason=e.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,r){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}};function $l(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}var vf=Symbol.for("sentry.skipNormalization"),mf=Symbol.for("sentry.overrideNormalizationDepth");function yf(e){return!!e[vf]}function bf(e){const t=e[mf];return typeof t=="number"?t:void 0}function at(e,t=100,r=1/0){try{return Ys("",e,t,r)}catch(n){return{ERROR:`**non-serializable** (${n})`}}}function Nl(e,t=3,r=102400){const n=at(e,t);return Tf(n)>r?Nl(e,t-1,r):n}function Ys(e,t,r=1/0,n=1/0,i=If()){const[s,o]=i;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const a=Sf(e,t);if(!a.startsWith("[object "))return a;if(yf(t))return t;const c=bf(t),u=c!==void 0?c:r;if(u===0)return a.replace("object ","");if(s(t))return"[Circular ~]";const l=t;if(l&&typeof l.toJSON=="function")try{return Ys("",l.toJSON(),u-1,n,i)}catch{}const d=Array.isArray(t)?[]:{};let p=0;const f=ol(t);for(const h in f){if(!Object.prototype.hasOwnProperty.call(f,h))continue;if(p>=n){d[h]="[MaxProperties ~]";break}const g=f[h];d[h]=Ys(h,g,u-1,n,i),p++}return o(t),d}function Sf(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(nl(t))return Zu(t);if(hh(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${ft(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const r=Ef(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}}function Ef(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function wf(e){return~-encodeURI(e).split(/%..|./).length}function Tf(e){return wf(JSON.stringify(e))}function If(){const e=new WeakSet;function t(n){return e.has(n)?!0:(e.add(n),!1)}function r(n){e.delete(n)}return[t,r]}function ir(e,t=[]){return[e,t]}function xf(e,t){const[r,n]=e;return[r,[...n,t]]}function Xs(e,t){const r=e[1];for(const n of r){const i=n[0].type;if(t(n,i))return!0}return!1}function kf(e,t){return Xs(e,(r,n)=>t.includes(n))}function Ks(e){const t=Wi(V);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Rf(e){const[t,r]=e;let n=JSON.stringify(t);function i(s){typeof n=="string"?n=typeof s=="string"?n+s:[Ks(n),s]:n.push(typeof s=="string"?Ks(s):s)}for(const s of r){const[o,a]=s;if(i(`
6
+ ${JSON.stringify(o)}
7
+ `),typeof a=="string"||a instanceof Uint8Array)i(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(at(a))}i(c)}}return typeof n=="string"?n:Pf(n)}function Pf(e){const t=e.reduce((i,s)=>i+s.length,0),r=new Uint8Array(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return r}function Cf(e){return[{type:"span"},e]}function Af(e){const t=typeof e.data=="string"?Ks(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var Fl={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function Of(e){return e in Fl}function sc(e){return Of(e)?Fl[e]:e}function Ml(e){if(!e?.sdk)return;const{name:t,version:r}=e.sdk;return{name:t,version:r}}function $f(e,t,r,n){const i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!r&&n&&{dsn:qr(n)},...i&&{trace:i}}}function Nf(e,t){if(!t)return e;const r=e.sdk||{};return e.sdk={...r,name:r.name||t.name,version:r.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function Ff(e,t,r,n){const i=Ml(r),s={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!n&&t&&{dsn:qr(t)}},o="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return ir(s,[o])}function Mf(e,t,r,n){const i=Ml(r),s=e.type&&e.type!=="replay_event"?e.type:"event";Nf(e,r?.sdk);const o=$f(e,i,n,t);return delete e.sdkProcessingMetadata,ir(o,[[{type:s},e]])}function Lf(e,t){function r(f){return!!f.trace_id&&!!f.public_key}const n=$t(e[0]),i=t?.getDsn(),s=t?.getOptions().tunnel,o={sent_at:new Date().toISOString(),...r(n)&&{trace:n},...!!s&&i&&{dsn:qr(i)}},{beforeSendSpan:a,ignoreSpans:c}=t?.getOptions()||{},u=c?.length?e.filter(f=>{const h=K(f);return!mn({description:h.description,op:h.op,attributes:h.data},c)}):e,l=e.length-u.length;l&&t?.recordDroppedEvent("before_send","span",l);const d=a?f=>{const h=K(f),g=$l(a)?h:a(h);return g||(Vs(),h)}:K,p=[];for(const f of u){const h=d(f);h&&p.push(Cf(h))}return ir(o,p)}function Df(e){if(!O)return;const{description:t="< unknown name >",op:r="< unknown op >",parent_span_id:n}=K(e),{spanId:i}=e.spanContext(),s=Lt(e),o=Ee(e),a=o===e,c=`[Tracing] Starting ${s?"sampled":"unsampled"} ${a?"root ":""}span`,u=[`op: ${r}`,`name: ${t}`,`ID: ${i}`];if(n&&u.push(`parent ID: ${n}`),!a){const{op:l,description:d}=K(o);u.push(`root ID: ${o.spanContext().spanId}`),l&&u.push(`root op: ${l}`),d&&u.push(`root description: ${d}`)}E.log(`${c}
8
+ ${u.join(`
9
+ `)}`)}function qf(e){if(!O)return;const{description:t="< unknown name >",op:r="< unknown op >"}=K(e),{spanId:n}=e.spanContext(),i=`[Tracing] Finishing "${r}" ${Ee(e)===e?"root ":""}span "${t}" with ID ${n}`;E.log(i)}function Uf(e,t,r,n=qe()){const i=n&&Ee(n);i&&(O&&E.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${r}`),i.addEvent(e,{[Nn]:t,[$n]:r}))}function oc(e){if(!e||e.length===0)return;const t={};return e.forEach(r=>{const n=r.attributes||{},i=n[$n],s=n[Nn];typeof i=="string"&&typeof s=="number"&&(t[r.name]={value:s,unit:i})}),t}function mt(e){return e.getOptions().traceLifecycle==="stream"}var ac=1e3,Vi=class{constructor(e={}){this._traceId=e.traceId||_t(),this._spanId=e.spanId||pt(),this._startTime=e.startTimestamp||_e(),this._links=e.links,this._attributes={},this.setAttributes({[ve]:"manual",[vt]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,t){}spanContext(){const{_spanId:e,_traceId:t,_sampled:r}=this;return{spanId:e,traceId:t,traceFlags:r?1:0}}setAttribute(e,t){return t===void 0?delete this._attributes[e]:this._attributes[e]=t,this}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._startTime=ht(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(Rt,"custom"),this}end(e){this._endTime||(this._endTime=ht(e),qf(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[vt],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:kl(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[ve],profile_id:this._attributes[dl],exclusive_time:this._attributes[nr],measurements:oc(this._events),is_segment:this._isStandaloneSpan&&Ee(this)===this||void 0,segment_id:this._isStandaloneSpan?Ee(this).spanContext().spanId:void 0,links:Sl(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===Ee(this),status:Rl(this._status),attributes:this._attributes,links:El(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,r){O&&E.log("[Tracing] Adding an event to span:",e);const n=cc(t)?t:r||_e(),i=cc(t)?{}:t||{},s={name:e,time:ht(n),attributes:i};return this._events.push(s),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const e=Y();if(e&&(e.emit("spanEnd",this),this._isStandaloneSpan||e.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===Ee(this)))return;if(this._isStandaloneSpan){this._sampled?jf(Lf([this],e)):(O&&E.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span"));return}else if(e&&mt(e)){e.emit("afterSegmentSpanEnd",this);return}const t=this._convertSpanToTransaction();t&&(yi(this).scope||te()).captureEvent(t)}_convertSpanToTransaction(){if(!uc(K(this)))return;this._name||(O&&E.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:e,isolationScope:t}=yi(this),r=e?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;const n=ni(this).filter(a=>a!==this&&!Hf(a)).map(a=>K(a)).filter(uc),i=this._attributes[Rt];delete this._attributes[Qa],n.forEach(a=>{delete a.data[Qa]});const s={contexts:{trace:af(this)},spans:n.length>ac?n.sort((a,c)=>a.start_timestamp-c.start_timestamp).slice(0,ac):n,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:t,dynamicSamplingContext:$t(this)},request:r,...i&&{transaction_info:{source:i}}},o=oc(this._events);return o&&Object.keys(o).length&&(O&&E.log("[Measurements] Adding measurements to transaction event",JSON.stringify(o,void 0,2)),s.measurements=o),s}};function cc(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function uc(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function Hf(e){return e instanceof Vi&&e.isStandaloneSpan()}function jf(e){const t=Y();if(!t)return;const r=e[1];if(!r||r.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function Bf(e,t,r){if(!Xe(e))return[!1];let n,i;typeof e.tracesSampler=="function"?(i=e.tracesSampler({...t,inheritOrSampleWith:a=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):a}),n=!0):t.parentSampled!==void 0?i=t.parentSampled:typeof e.tracesSampleRate<"u"&&(i=e.tracesSampleRate,n=!0);const s=vn(i);if(s===void 0)return O&&E.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(i)} of type ${JSON.stringify(typeof i)}.`),[!1];if(!s)return O&&E.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"}`),[!1,s,n];const o=r<s;return o||O&&E.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[o,s,n]}var Wf="__SENTRY_SUPPRESS_TRACING__";function sr(e){const t=Dl();if(t.startInactiveSpan)return t.startInactiveSpan(e);const r=Gf(e),{forceTransaction:n,parentSpan:i}=e;return(e.scope?s=>ca(e.scope,s):i!==void 0?s=>Ll(i,s):s=>s())(()=>{const s=te(),o=Yf(s,i),a=Y();return e.onlyIfParent&&!o?(a?.recordDroppedEvent("no_parent_span","span"),new rt):zf({parentSpan:o,spanArguments:r,forceTransaction:n,scope:s})})}function Ll(e,t){const r=Dl();return r.withActiveSpan?r.withActiveSpan(e,t):ca(n=>(_n(n,e||void 0),t(n)))}function zf({parentSpan:e,spanArguments:t,forceTransaction:r,scope:n}){if(!Xe()){const a=new rt;if(r||!e){const c={sampled:"false",sample_rate:"0",transaction:t.name,...$t(a)};ii(a,c)}return a}const i=Y();if(Xf(i,t))return ua(n)||i?.recordDroppedEvent("ignored","span"),new rt({dropReason:"ignored",traceId:e?.spanContext().traceId??n.getPropagationContext().traceId});const s=nt();let o;if(e&&!r)o=Vf(e,n,t),Pl(e,o);else if(e){const a=$t(e),{traceId:c,spanId:u}=e.spanContext(),l=Lt(e);o=lc({traceId:c,parentSpanId:u,...t},n,l),ii(o,a)}else{const{traceId:a,dsc:c,parentSpanId:u,sampled:l}={...s.getPropagationContext(),...n.getPropagationContext()};o=lc({traceId:a,parentSpanId:u,...t},n,l),c&&ii(o,c)}return Df(o),zh(o,n,s),o}function Gf(e){const t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...t};return r.startTimestamp=ht(e.startTime),delete r.startTime,r}return t}function Dl(){const e=er();return Dr(e)}function lc(e,t,r){const n=Y(),i=n?.getOptions()||{},{name:s=""}=e,o={spanAttributes:{...e.attributes},spanName:s,parentSampled:r};n?.emit("beforeSampling",o,{decision:!1});const a=o.parentSampled??r,c=o.spanAttributes,u=t.getPropagationContext(),l=ua(t),[d,p,f]=l?[!1]:Bf(i,{name:s,parentSampled:a,attributes:c,parentSampleRate:vn(u.dsc?.sample_rate)},u.sampleRand),h=new Vi({...e,attributes:{[Rt]:"custom",[Dh]:p!==void 0&&f?p:void 0,...c},sampled:d});return!d&&n&&!l&&(O&&E.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),n.recordDroppedEvent("sample_rate",mt(n)?"span":"transaction")),n&&n.emit("spanStart",h),h}function Vf(e,t,r){const{spanId:n,traceId:i}=e.spanContext(),s=ua(t),o=s?!1:Lt(e),a=o?new Vi({...r,parentSpanId:n,traceId:i,sampled:o}):new rt({traceId:i});Pl(e,a);const c=Y();return c&&(mt(c)&&a instanceof rt&&(e instanceof rt&&e.dropReason?(a.dropReason=e.dropReason,c.recordDroppedEvent(e.dropReason,"span")):s||(a.dropReason="sample_rate",c.recordDroppedEvent("sample_rate","span"))),c.emit("spanStart",a),r.endTimestamp&&(c.emit("spanEnd",a),c.emit("afterSpanEnd",a))),a}function Yf(e,t){if(t)return t;if(t===null)return;const r=vi(e);if(!r)return;const n=Y();return(n?n.getOptions():{}).parentSpanIsAlwaysRootSpan?Ee(r):r}function Xf(e,t){const r=e?.getOptions().ignoreSpans;return!e||!mt(e)||!r?.length?!1:mn({description:t.name||"",op:t.attributes?.["sentry.op"]||t.op,attributes:t.attributes},r)}function ua(e){return e.getScopeData().sdkProcessingMetadata[Wf]===!0}var si={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},Kf="heartbeatFailed",Jf="idleTimeout",Zf="finalTimeout",Qf="externalFinish";function ql(e,t={}){const r=new Map;let n=!1,i,s=Qf,o=!t.disableAutoFinish;const a=[],{idleTimeout:c=si.idleTimeout,finalTimeout:u=si.finalTimeout,childSpanTimeout:l=si.childSpanTimeout,beforeSpanEnd:d,trimIdleSpanEndTimestamp:p=!0}=t,f=Y();if(!f||!Xe()){const v=new rt,b={sample_rate:"0",sampled:"false",...$t(v)};return ii(v,b),v}const h=te(),g=qe(),m=eg(e);m.end=new Proxy(m.end,{apply(v,b,T){if(d&&d(m),b instanceof rt)return;const[C,...L]=T,D=C||_e(),N=ht(D),q=ni(m).filter(X=>X!==m),Z=K(m);if(!q.length||!p)return R(N),Reflect.apply(v,b,[N,...L]);const J=f.getOptions().ignoreSpans,ue=q?.reduce((X,W)=>{const re=K(W);return!re.timestamp||J&&mn({description:re.description,op:re.op,attributes:re.data},J)?X:X?Math.max(X,re.timestamp):re.timestamp},void 0),M=Z.start_timestamp,z=Math.min(M?M+u/1e3:1/0,Math.max(M||-1/0,Math.min(N,ue||1/0)));return R(z),Reflect.apply(v,b,[z,...L])}});function w(){i&&(clearTimeout(i),i=void 0)}function P(v){w(),i=setTimeout(()=>{!n&&r.size===0&&o&&(s=Jf,m.end(v))},c)}function A(v){i=setTimeout(()=>{!n&&o&&(s=Kf,m.end(v))},l)}function $(v){w(),r.set(v,!0),A(_e()+l/1e3)}function y(v){r.has(v)&&r.delete(v),r.size===0&&P(_e()+c/1e3)}function R(v){n=!0,r.clear(),a.forEach(N=>N()),_n(h,g);const b=K(m),{start_timestamp:T}=b;if(!T)return;b.data["sentry.idle_span_finish_reason"]||m.setAttribute(mi,s);const C=b.status;(!C||C==="unknown")&&m.setStatus({code:1}),E.log(`[Tracing] Idle span "${b.op}" finished`);const L=ni(m).filter(N=>N!==m);let D=0;L.forEach(N=>{N.isRecording()&&(N.setStatus({code:2,message:"cancelled"}),N.end(v),O&&E.log("[Tracing] Cancelling span since span ended early",JSON.stringify(N,void 0,2)));const{timestamp:q=0,start_timestamp:Z=0}=K(N),J=Z<=v,ue=(u+c)/1e3,M=q-Z<=ue;if(O){const z=JSON.stringify(N,void 0,2);J?M||E.log("[Tracing] Discarding span since it finished after idle span final timeout",z):E.log("[Tracing] Discarding span since it happened after idle span was finished",z)}(!M||!J)&&(df(m,N),D++)}),D>0&&m.setAttribute("sentry.idle_span_discarded_spans",D)}return a.push(f.on("spanStart",v=>{n||v===m||K(v).timestamp||v instanceof Vi&&v.isStandaloneSpan()||ni(m).includes(v)&&$(v.spanContext().spanId)})),a.push(f.on("spanEnd",v=>{n||y(v.spanContext().spanId)})),a.push(f.on("idleSpanEnableAutoFinish",v=>{v===m&&(o=!0,P(),r.size&&A())})),t.disableAutoFinish||P(),setTimeout(()=>{n||(m.setStatus({code:2,message:"deadline_exceeded"}),s=Zf,m.end())},u),m}function eg(e){const t=sr(e);return _n(te(),t),O&&E.log("[Tracing] Started span is an idle span"),t}function tg(e,t){const{fingerprint:r,span:n,breadcrumbs:i,sdkProcessingMetadata:s}=t;rg(e,t),n&&sg(e,n),og(e,r),ng(e,i),ig(e,s)}function dc(e,t){const{extra:r,tags:n,attributes:i,user:s,contexts:o,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:l,eventProcessors:d,attachments:p,propagationContext:f,transactionName:h,span:g}=t;jr(e,"extra",r),jr(e,"tags",n),jr(e,"attributes",i),jr(e,"user",s),jr(e,"contexts",o),e.sdkProcessingMetadata=On(e.sdkProcessingMetadata,c,2),a&&(e.level=a),h&&(e.transactionName=h),g&&(e.span=g),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),l.length&&(e.fingerprint=[...e.fingerprint,...l]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),p.length&&(e.attachments=[...e.attachments,...p]),e.propagationContext={...e.propagationContext,...f}}function jr(e,t,r){e[t]=On(e[t],r,1)}function Ul(e,t){const r=Mh().getScopeData();return e&&dc(r,e.getScopeData()),t&&dc(r,t.getScopeData()),r}function rg(e,t){const{extra:r,tags:n,user:i,contexts:s,level:o,transactionName:a}=t;Object.keys(r).length&&(e.extra={...r,...e.extra}),Object.keys(n).length&&(e.tags={...n,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(s).length&&(e.contexts={...s,...e.contexts}),o&&(e.level=o),a&&e.type!=="transaction"&&(e.transaction=a)}function ng(e,t){const r=[...e.breadcrumbs||[],...t];e.breadcrumbs=r.length?r:void 0}function ig(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function sg(e,t){e.contexts={trace:cf(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:$t(t),...e.sdkProcessingMetadata};const r=Ee(t),n=K(r).description;n&&!e.transaction&&e.type==="transaction"&&(e.transaction=n)}function og(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}var ag="thismessage:/";function Hl(e){return"isRelative"in e}function jl(e,t){const r=e.indexOf("://")<=0&&e.indexOf("//")!==0,n=t??(r?ag:void 0);try{if("canParse"in URL&&!URL.canParse(e,n))return;const i=new URL(e,n);return r?{isRelative:r,pathname:i.pathname,search:i.search,hash:i.hash}:i}catch{}}function cg(e){if(Hl(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function Vt(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const r=t[6]||"",n=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:r,hash:n,relative:t[5]+r+n}}function ug(e){return e.split(/[?#]/,1)[0]}function At(e,t=!0){if(e.startsWith("data:")){const r=e.match(/^data:([^;,]+)/),n=r?r[1]:"text/plain",i=e.includes(";base64,"),s=e.indexOf(",");let o="";if(t&&s!==-1){const a=e.slice(s+1);o=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${n}${i?",base64":""}${o?`,${o}`:""}`}return e}function Bl(e,t){const r=e.attributes??(e.attributes={});Object.entries(t).forEach(([n,i])=>{i!=null&&!(n in r)&&(r[n]=i)})}var us=0,pc=1,hc=2;function Fn(e){return new Wl(t=>{t(e)})}function la(e){return new Wl((t,r)=>{r(e)})}var Wl=class Js{constructor(t){this._state=us,this._handlers=[],this._runExecutor(t)}then(t,r){return new Js((n,i)=>{this._handlers.push([!1,s=>{if(!t)n(s);else try{n(t(s))}catch(o){i(o)}},s=>{if(!r)i(s);else try{n(r(s))}catch(o){i(o)}}]),this._executeHandlers()})}catch(t){return this.then(r=>r,t)}finally(t){return new Js((r,n)=>{let i,s;return this.then(o=>{s=!1,i=o,t&&t()},o=>{s=!0,i=o,t&&t()}).then(()=>{if(s){n(i);return}r(i)})})}_executeHandlers(){if(this._state===us)return;const t=this._handlers.slice();this._handlers=[],t.forEach(r=>{r[0]||(this._state===pc&&r[1](this._value),this._state===hc&&r[2](this._value),r[0]=!0)})}_runExecutor(t){const r=(s,o)=>{if(this._state===us){if(Rn(o)){o.then(n,i);return}this._state=s,this._value=o,this._executeHandlers()}},n=s=>{r(pc,s)},i=s=>{r(hc,s)};try{t(n,i)}catch(s){i(s)}}};function lg(e,t,r,n=0){try{const i=Zs(t,r,e,n);return Rn(i)?i:Fn(i)}catch(i){return la(i)}}function Zs(e,t,r,n){const i=r[n];if(!e||!i)return e;const s=i({...e},t);return O&&s===null&&E.log(`Event processor "${i.id||"?"}" dropped event`),Rn(s)?s.then(o=>Zs(o,t,r,n+1)):Zs(s,t,r,n+1)}var Dt,fc,gc,wt;function dg(e){const t=V._sentryDebugIds,r=V._debugIds;if(!t&&!r)return{};const n=t?Object.keys(t):[],i=r?Object.keys(r):[];if(wt&&n.length===fc&&i.length===gc)return wt;fc=n.length,gc=i.length,wt={},Dt||(Dt={});const s=(o,a)=>{for(const c of o){const u=a[c],l=Dt?.[c];if(l&&wt&&u)wt[l[0]]=u,Dt&&(Dt[c]=[l[0],u]);else if(u){const d=e(c);for(let p=d.length-1;p>=0;p--){const f=d[p]?.filename;if(f&&wt&&Dt){wt[f]=u,Dt[c]=[f,u];break}}}}};return t&&s(n,t),r&&s(i,r),wt}function pg(e,t,r,n,i,s){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||r.event_id||We(),timestamp:t.timestamp||rr()},u=r.integrations||e.integrations.map(g=>g.name);hg(c,e),_g(c,u),i&&i.emit("applyFrameMetadata",t),t.type===void 0&&fg(c,e.stackParser);const l=mg(n,r.captureContext);r.mechanism&&kr(c,r.mechanism);const d=i?i.getEventProcessors():[],p=Ul(s,l),f=[...r.attachments||[],...p.attachments];f.length&&(r.attachments=f),tg(c,p);const h=[...d,...p.eventProcessors];return(r.data&&r.data.__sentry__===!0?Fn(c):lg(h,c,r)).then(g=>(g&&gg(g),typeof o=="number"&&o>0?vg(g,o,a):g))}function hg(e,t){const{environment:r,release:n,dist:i,maxValueLength:s}=t;e.environment=e.environment||r||"production",!e.release&&n&&(e.release=n),!e.dist&&i&&(e.dist=i);const o=e.request;o?.url&&s&&(o.url=Hs(o.url,s)),s&&e.exception?.values?.forEach(a=>{a.value&&(a.value=Hs(a.value,s))})}function fg(e,t){const r=dg(t);e.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(i=>{i.filename&&(i.debug_id=r[i.filename])})})}function gg(e){const t={};if(e.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(i=>{i.debug_id&&(i.abs_path?t[i.abs_path]=i.debug_id:i.filename&&(t[i.filename]=i.debug_id),delete i.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const r=e.debug_meta.images;Object.entries(t).forEach(([n,i])=>{r.push({type:"sourcemap",code_file:n,debug_id:i})})}function _g(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function vg(e,t,r){if(!e)return null;const n={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>({...i,...i.data&&{data:at(i.data,t,r)}}))},...e.user&&{user:at(e.user,t,r)},...e.contexts&&{contexts:at(e.contexts,t,r)},...e.extra&&{extra:at(e.extra,t,r)}};return e.contexts?.trace&&n.contexts&&(n.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(n.contexts.trace.data=at(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map(i=>({...i,...i.data&&{data:at(i.data,t,r)}}))),e.contexts?.flags&&n.contexts&&(n.contexts.flags=at(e.contexts.flags,3,r)),n}function mg(e,t){if(!t)return e;const r=e?e.clone():new Kt;return r.update(t),r}function yg(e){if(e)return bg(e)?{captureContext:e}:Eg(e)?{captureContext:e}:e}function bg(e){return e instanceof Kt||typeof e=="function"}var Sg=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Eg(e){return Object.keys(e).some(t=>Sg.includes(t))}function wg(e,t){return te().captureException(e,yg(t))}function zl(e,t){return te().captureEvent(e,t)}function Tg(e,t){nt().setContext(e,t)}async function ES(e){const t=Y();return t?t.close(e):(O&&E.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function Ig(){const e=Y();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function _c(e){const t=nt(),{user:r}=Ul(t,te()),{userAgent:n}=V.navigator||{},i=Eh({user:r,...n&&{userAgent:n},...e}),s=t.getSession();return s?.status==="ok"&&Rr(s,{status:"exited"}),Gl(),t.setSession(i),i}function Gl(){const e=nt(),t=te().getSession()||e.getSession();t&&wh(t),Vl(),e.setSession()}function Vl(){const e=nt(),t=Y(),r=e.getSession();r&&t&&t.captureSession(r)}function ls(e=!1){if(e){Gl();return}Vl()}function xg(e){const t=e.protocol?`${e.protocol}:`:"",r=e.port?`:${e.port}`:"";return`${t}//${e.host}${r}${e.path?`/${e.path}`:""}/api/`}function kg(e){return`${xg(e)}${e.projectId}/envelope/`}function Rg(e,t){const r={sentry_version:"7"};return e.publicKey&&(r.sentry_key=e.publicKey),t&&(r.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(r).toString()}function Pg(e,t,r){return t||`${kg(e)}?${Rg(e,r)}`}var vc=[];function Cg(e){const t={};return e.forEach(r=>{const{name:n}=r,i=t[n];i&&!i.isDefaultInstance&&r.isDefaultInstance||(t[n]=r)}),Object.values(t)}function Ag(e){const t=e.defaultIntegrations||[],r=e.integrations;t.forEach(i=>{i.isDefaultInstance=!0});let n;if(Array.isArray(r))n=[...t,...r];else if(typeof r=="function"){const i=r(t);n=Array.isArray(i)?i:[i]}else n=t;return Cg(n)}function Og(e,t){const r={};return t.forEach(n=>{n?.beforeSetup&&n.beforeSetup(e)}),t.forEach(n=>{n&&Yl(e,n,r)}),r}function mc(e,t){for(const r of t)r?.afterAllSetup&&r.afterAllSetup(e)}function Yl(e,t,r){if(r[t.name]){O&&E.log(`Integration skipped because it was already installed: ${t.name}`);return}if(r[t.name]=t,!vc.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),vc.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(i,s)=>n(i,s,e))}if(typeof t.processEvent=="function"){const n=t.processEvent.bind(t),i=Object.assign((s,o)=>n(s,o,e),{id:t.name});e.addEventProcessor(i)}["processSpan","processSegmentSpan"].forEach(n=>{const i=t[n];typeof i=="function"&&e.on(n,s=>i.call(t,s,e))}),O&&E.log(`Integration installed: ${t.name}`)}function $g(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Ng(){return"npm"}function Fg(){return!$g()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function da(){return typeof window<"u"&&(!Fg()||Mg())}function Mg(){return V.process?.type==="renderer"}function Lg(e,t){const r=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...da()&&{ingest_settings:{infer_ip:r,infer_user_agent:r}},items:e}]}function Dg(e,t,r,n,i){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),r&&n&&(s.dsn=qr(n)),ir(s,[Lg(e,i)])}function Qs(e,t){const r=t??qg(e)??[];if(r.length===0)return;const n=e.getOptions(),i=Dg(r,n._metadata,n.tunnel,e.getDsn(),n.sendDefaultPii);Xl().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(i)}function qg(e){return Xl().get(e)}function Xl(){return Mr("clientToLogBufferMap",()=>new WeakMap)}function Ug(e,t){const r=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...da()&&{ingest_settings:{infer_ip:r,infer_user_agent:r}},items:e}]}function Hg(e,t,r,n,i){const s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),r&&n&&(s.dsn=qr(n)),ir(s,[Ug(e,i)])}function Kl(e,t){const r=t??jg(e)??[];if(r.length===0)return;const n=e.getOptions(),i=Hg(r,n._metadata,n.tunnel,e.getDsn(),n.sendDefaultPii);Jl().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(i)}function jg(e){return Jl().get(e)}function Jl(){return Mr("clientToMetricBufferMap",()=>new WeakMap)}function Zl(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var pa=Symbol.for("SentryBufferFullError");function ha(e=100){const t=new Set;function r(){return t.size<e}function n(o){t.delete(o)}function i(o){if(!r())return la(pa);const a=o();return t.add(a),a.then(()=>n(a),()=>n(a)),a}function s(o){if(!t.size)return Fn(!0);const a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!o)return a;const c=[a,new Promise(u=>Zl(setTimeout(()=>u(!1),o)))];return Promise.race(c)}return{get $(){return Array.from(t)},add:i,drain:s}}var Bg=6e4;function Wg(e,t=An()){const r=parseInt(`${e}`,10);if(!isNaN(r))return r*1e3;const n=Date.parse(`${e}`);return isNaN(n)?Bg:n-t}function zg(e,t){return e[t]||e.all||0}function Gg(e,t,r=An()){return zg(e,t)>r}function Vg(e,{statusCode:t,headers:r},n=An()){const i={...e},s=r?.["x-sentry-rate-limits"],o=r?.["retry-after"];if(s)for(const a of s.trim().split(",")){const[c,u,,,l]=a.split(":",5),d=parseInt(c,10),p=(isNaN(d)?60:d)*1e3;if(!u)i.all=n+p;else for(const f of u.split(";"))f==="metric_bucket"?(!l||l.split(";").includes("custom"))&&(i[f]=n+p):i[f]=n+p}else o?i.all=n+Wg(o,n):t===429&&(i.all=n+6e4);return i}function Yg(e,t,r=ha(e.bufferSize||64)){let n={};const i=o=>r.drain(o);function s(o){const a=[];if(Xs(o,(d,p)=>{const f=sc(p);Gg(n,f)?e.recordDroppedEvent("ratelimit_backoff",f):a.push(d)}),a.length===0)return Promise.resolve({});const c=ir(o[0],a),u=d=>{if(kf(c,["client_report"])){O&&E.warn(`Dropping client report. Will not send outcomes (reason: ${d}).`);return}Xs(c,(p,f)=>{e.recordDroppedEvent(d,sc(f))})},l=()=>t({body:Rf(c)}).then(d=>d.statusCode===413?(O&&E.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),d):(O&&d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&E.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),n=Vg(n,d),d),d=>{throw u("network_error"),O&&E.error("Encountered error running transport request:",d),d});return r.add(l).then(d=>d,d=>{if(d===pa)return O&&E.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw d})}return{send:s,flush:i}}function Xg(e,t,r){const n=[{type:"client_report"},{timestamp:r||rr(),discarded_events:e}];return ir(t?{dsn:t}:{},[n])}function Ql(e){const t=[];e.message&&t.push(e.message);try{const r=e.exception.values[e.exception.values.length-1];r?.value&&(t.push(r.value),r.type&&t.push(`${r.type}: ${r.value}`))}catch{}return t}function Kg(e){const{trace_id:t,parent_span_id:r,span_id:n,status:i,origin:s,data:o,op:a}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:a,parent_span_id:r,span_id:n??"",start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:o?.[dl],exclusive_time:o?.[nr],measurements:e.measurements,is_segment:!0}}function Jg(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{"sentry.profile_id":e.profile_id},...e.exclusive_time&&{"sentry.exclusive_time":e.exclusive_time}}}},measurements:e.measurements}}var yc="Not capturing exception because it's already been captured.",bc="Discarded session because of missing or non-string release",ed=Symbol.for("SentryInternalError"),td=Symbol.for("SentryDoNotSendEventError"),Zg=5e3;function oi(e){return{message:e,[ed]:!0}}function ds(e){return{message:e,[td]:!0}}function Sc(e){return!!e&&typeof e=="object"&&ed in e}function Ec(e){return!!e&&typeof e=="object"&&td in e}function wc(e,t,r,n,i){let s=0,o,a=!1;e.on(r,()=>{s=0,clearTimeout(o),a=!1}),e.on(t,c=>{s+=n(c),s>=8e5?i(e):a||(a=!0,o=Zl(setTimeout(()=>{i(e)},Zg)))}),e.on("flush",()=>{i(e)})}var Qg=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=ha(e.transportOptions?.bufferSize??64),e.dsn?this._dsn=rf(e.dsn):O&&E.warn("No DSN provided, client will not send events."),this._dsn){const t=Pg(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&wc(this,"afterCaptureLog","flushLogs",n_,Qs),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&wc(this,"afterCaptureMetric","flushMetrics",r_,Kl)}captureException(e,t,r){const n=We();if(Xa(e))return O&&E.log(yc),n;const i={event_id:n,...t};return this._process(()=>this.eventFromException(e,i).then(s=>this._captureEvent(s,i,r)).then(s=>s),"error"),i.event_id}captureMessage(e,t,r,n){const i={event_id:We(),...r},s=ia(e)?e:String(e),o=xr(e),a=o?this.eventFromMessage(s,t,i):this.eventFromException(e,i);return this._process(()=>a.then(c=>this._captureEvent(c,i,n)),o?"unknown":"error"),i.event_id}captureEvent(e,t,r){const n=We();if(t?.originalException&&Xa(t.originalException))return O&&E.log(yc),n;const i={event_id:n,...t},s=e.sdkProcessingMetadata||{},o=s.capturedSpanScope,a=s.capturedSpanIsolationScope,c=Tc(e.type);return this._process(()=>this._captureEvent(e,i,o||r,a),c),i.event_id}captureSession(e){this.sendSession(e),Rr(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const t=this._transport;if(this.emit("flush"),!t)return!0;const r=await this._isClientDoneProcessing(e),n=await t.flush(e);return r&&n}async close(e){Qs(this);const t=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),Yl(this,e,this._integrations),t||mc(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let r=Mf(e,this._dsn,this._options._metadata,this._options.tunnel);for(const n of t.attachments||[])r=xf(r,Af(n));this.sendEnvelope(r).then(n=>this.emit("afterSendEvent",e,n))}sendSession(e){const{release:t,environment:r=_f}=this._options;if("aggregates"in e){const i=e.attrs||{};if(!i.release&&!t){O&&E.warn(bc);return}i.release=i.release||t,i.environment=i.environment||r,e.attrs=i}else{if(!e.release&&!t){O&&E.warn(bc);return}e.release=e.release||t,e.environment=e.environment||r}this.emit("beforeSendSession",e);const n=Ff(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(n)}recordDroppedEvent(e,t,r=1){if(this._options.sendClientReports){const n=`${e}:${t}`;O&&E.log(`Recording outcome: "${n}"${r>1?` (${r} times)`:""}`),this._outcomes[n]=(this._outcomes[n]||0)+r}}on(e,t){const r=this._hooks[e]=this._hooks[e]||new Set,n=(...i)=>t(...i);return r.add(n),()=>{r.delete(n)}}emit(e,...t){const r=this._hooks[e];r&&r.forEach(n=>n(...t))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(t){return O&&E.error("Error while sending envelope:",t),{}}return O&&E.error("Transport disabled"),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=Og(this,e),mc(this,e)}_updateSessionFromEvent(e,t){let r=t.level==="fatal",n=!1;const i=t.exception?.values;if(i){n=!0,r=!1;for(const o of i)if(o.mechanism?.handled===!1){r=!0;break}}const s=e.status==="ok";(s&&e.errors===0||s&&r)&&(Rr(e,{...r&&{status:"crashed"},errors:e.errors||Number(n||r)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,r,n){const i=this.getOptions(),s=Object.keys(this._integrations);return!t.integrations&&s?.length&&(t.integrations=s),this.emit("preprocessEvent",e,t),e.type||n.setLastEventId(e.event_id||t.event_id),pg(i,e,t,r,this,n).then(o=>(o===null||(this.emit("postprocessEvent",o,t),o.contexts={trace:{...o.contexts?.trace,...Lh(r)},...o.contexts},o.sdkProcessingMetadata={dynamicSamplingContext:Ol(this,r),...o.sdkProcessingMetadata}),o))}_captureEvent(e,t={},r=te(),n=nt()){return O&&eo(e)&&E.log(`Captured error event \`${Ql(e)[0]||"<unknown>"}\``),this._processEvent(e,t,r,n).then(i=>i.event_id,i=>{O&&(Ec(i)?E.log(i.message):Sc(i)?E.warn(i.message):E.warn(i))})}_processEvent(e,t,r,n){const i=this.getOptions(),{sampleRate:s}=i,o=rd(e),a=eo(e),c=`before send for type \`${e.type||"error"}\``,u=typeof s>"u"?void 0:vn(s);if(a&&typeof u=="number"&&Pt()>u)return this.recordDroppedEvent("sample_rate","error"),la(ds(`Discarding event because it's not included in the random sample (sampling rate = ${s})`));const l=Tc(e.type);return this._prepareEvent(e,t,r,n).then(d=>{if(d===null)throw this.recordDroppedEvent("event_processor",l),ds("An event processor returned `null`, will not send event.");return t.data?.__sentry__===!0?d:e_(t_(this,i,d,t),c)}).then(d=>{if(d===null){if(this.recordDroppedEvent("before_send",l),o){const h=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",h)}throw ds(`${c} returned \`null\`, will not send event.`)}const p=r.getSession()||n.getSession();if(a&&p&&this._updateSessionFromEvent(p,d),o){const h=(d.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(d.spans?d.spans.length:0);h>0&&this.recordDroppedEvent("before_send","span",h)}const f=d.transaction_info;if(o&&f&&d.transaction!==e.transaction){const h="custom";d.transaction_info={...f,source:h}}return this.sendEvent(d,t),d}).then(null,d=>{throw Ec(d)||Sc(d)?d:(this.captureException(d,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:d}),oi(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
10
+ Reason: ${d}`))})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===pa&&this.recordDroppedEvent("queue_overflow",t),r))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([t,r])=>{const[n,i]=t.split(":");return{reason:n,category:i,quantity:r}})}_flushOutcomes(){O&&E.log("Flushing outcomes...");const e=this._clearOutcomes();if(e.length===0){O&&E.log("No outcomes to send");return}if(!this._dsn){O&&E.log("No dsn provided, will not send outcomes");return}O&&E.log("Sending outcomes:",e);const t=Xg(e,this._options.tunnel&&qr(this._dsn));this.sendEnvelope(t)}};function Tc(e){return e==="replay_event"?"replay":e||"error"}function e_(e,t){const r=`${t} must return \`null\` or a valid event.`;if(Rn(e))return e.then(n=>{if(!gn(n)&&n!==null)throw oi(r);return n},n=>{throw oi(`${t} rejected with ${n}`)});if(!gn(e)&&e!==null)throw oi(r);return e}function t_(e,t,r,n){const{beforeSend:i,beforeSendTransaction:s,ignoreSpans:o}=t,a=!$l(t.beforeSendSpan)&&t.beforeSendSpan;let c=r;if(eo(c)&&i)return i(c,n);if(rd(c)){if(a||o){const u=Kg(c);if(o?.length&&mn({description:u.description,op:u.op,attributes:u.data},o))return null;if(a){const l=a(u);l?c=On(r,Jg(l)):Vs()}if(c.spans){const l=[],d=c.spans;for(const f of d){if(o?.length&&mn({description:f.description,op:f.op,attributes:f.data},o)){ff(d,f);continue}if(a){const h=a(f);h?l.push(h):(Vs(),l.push(f))}else l.push(f)}const p=c.spans.length-l.length;p&&e.recordDroppedEvent("before_send","span",p),c.spans=l}}if(s){if(c.spans){const u=c.spans.length;c.sdkProcessingMetadata={...r.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return s(c,n)}}return c}function eo(e){return e.type===void 0}function rd(e){return e.type==="transaction"}function r_(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+nd(e.attributes)}function n_(e){let t=0;return e.message&&(t+=e.message.length*2),t+nd(e.attributes)}function nd(e){if(!e)return 0;let t=0;return Object.values(e).forEach(r=>{Array.isArray(r)?t+=r.length*Ic(r[0]):xr(r)?t+=Ic(r):t+=100}),t}function Ic(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function i_(e){return zi(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function xc(e){return i_(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function s_(e,t){t.debug===!0&&(O?E.enable():tr(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),te().update(t.initialScope);const r=new e(t);return o_(r),r.init(),r}function o_(e){te().setClient(e)}function a_(e){"aggregates"in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function id(e,t,r=[t],n="npm"){const i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=r.map(s=>({name:`${n}:@sentry/${s}`,version:gi})),i.version=gi)}function sd(e={}){const t=e.client||Y();if(!Ig()||!t)return{};const r=er(),n=Dr(r);if(n.getTraceData)return n.getTraceData(e);const i=e.scope||te(),s=e.span||qe();if(!s&&Fh())return{};const o=s?uf(s):c_(i),a=s?$t(s):Ol(t,i),c=Gh(a);if(!ml.test(o))return E.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const u={"sentry-trace":o,baggage:c};return e.propagateTraceparent&&(u.traceparent=s?lf(s):u_(i)),u}function c_(e){const{traceId:t,sampled:r,propagationSpanId:n}=e.getPropagationContext();return yl(t,n,r)}function u_(e){const{traceId:t,sampled:r,propagationSpanId:n}=e.getPropagationContext();return bl(t,n,r)}var l_=100;function Jt(e,t){const r=Y(),n=nt();if(!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:s=l_}=r.getOptions();if(s<=0)return;const o={timestamp:rr(),...e},a=i?tr(()=>i(o,t)):o;a!==null&&(r.emit&&r.emit("beforeAddBreadcrumb",a,t),n.addBreadcrumb(a,s))}var kc,d_="FunctionToString",Rc=new WeakMap,p_=(()=>({name:d_,setupOnce(){kc=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=aa(this),r=Rc.has(Y())&&t!==void 0?t:this;return kc.apply(r,e)}}catch{}},setup(e){Rc.set(e,!0)}})),h_=p_,f_=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],g_="EventFilters",__=(e={})=>{let t;return{name:g_,setup(r){t=Pc(e,r.getOptions())},processEvent(r,n,i){return t||(t=Pc(e,i.getOptions())),m_(r,t)?null:r}}},v_=((e={})=>({...__(e),name:"InboundFilters"}));function Pc(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:f_],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function m_(e,t){if(e.type){if(e.type==="transaction"&&b_(e,t.ignoreTransactions))return O&&E.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
11
+ Event: ${zt(e)}`),!0}else{if(y_(e,t.ignoreErrors))return O&&E.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
12
+ Event: ${zt(e)}`),!0;if(T_(e))return O&&E.warn(`Event dropped due to not having an error message, error type or stacktrace.
13
+ Event: ${zt(e)}`),!0;if(S_(e,t.denyUrls))return O&&E.warn(`Event dropped due to being matched by \`denyUrls\` option.
14
+ Event: ${zt(e)}.
15
+ Url: ${bi(e)}`),!0;if(!E_(e,t.allowUrls))return O&&E.warn(`Event dropped due to not being matched by \`allowUrls\` option.
16
+ Event: ${zt(e)}.
17
+ Url: ${bi(e)}`),!0}return!1}function y_(e,t){return t?.length?Ql(e).some(r=>Ct(r,t)):!1}function b_(e,t){if(!t?.length)return!1;const r=e.transaction;return r?Ct(r,t):!1}function S_(e,t){if(!t?.length)return!1;const r=bi(e);return r?Ct(r,t):!1}function E_(e,t){if(!t?.length)return!0;const r=bi(e);return r?Ct(r,t):!0}function w_(e=[]){for(let t=e.length-1;t>=0;t--){const r=e[t];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function bi(e){try{const t=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return t?w_(t):null}catch{return O&&E.error(`Cannot extract url for event ${zt(e)}`),null}}function T_(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function I_(e,t,r,n,i,s){if(!i.exception?.values||!s||!gt(s.originalException,Error))return;const o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=to(e,t,n,s.originalException,r,i.exception.values,o,0))}function to(e,t,r,n,i,s,o,a){if(s.length>=r+1)return s;let c=[...s];if(gt(n[i],Error)){Cc(o,a,n);const u=e(t,n[i]),l=c.length;Ac(u,i,l,a),c=to(e,t,r,n[i],i,[u,...c],u,l)}return od(n)&&n.errors.forEach((u,l)=>{if(gt(u,Error)){Cc(o,a,n);const d=e(t,u),p=c.length;Ac(d,`errors[${l}]`,p,a),c=to(e,t,r,u,i,[d,...c],d,p)}}),c}function od(e){return Array.isArray(e.errors)}function Cc(e,t,r){e.mechanism={handled:!0,type:"auto.core.linked_errors",...od(r)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Ac(e,t,r,n){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:r,parent_id:n}}function x_(e){const t="console",r=Ft(t,e);return Mt(t,k_),r}function k_(){"console"in V&&Qp.forEach(function(e){e in V.console&&Fe(V.console,e,function(t){return _i[e]=t,function(...r){Be("console",{args:r,level:e}),_i[e]?.apply(V.console,r)}})})}function R_(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var P_="Dedupe",C_=(()=>{let e;return{name:P_,processEvent(t){if(t.type)return t;try{if(O_(t,e))return O&&E.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),A_=C_;function O_(e,t){return t?!!($_(e,t)||N_(e,t)):!1}function $_(e,t){const r=e.message,n=t.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!cd(e,t)||!ad(e,t))}function N_(e,t){const r=Oc(t),n=Oc(e);return!(!r||!n||r.type!==n.type||r.value!==n.value||!cd(e,t)||!ad(e,t))}function ad(e,t){let r=Ba(e),n=Ba(t);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let i=0;i<n.length;i++){const s=n[i],o=r[i];if(s.filename!==o.filename||s.lineno!==o.lineno||s.colno!==o.colno||s.function!==o.function)return!1}return!0}function cd(e,t){let r=e.fingerprint,n=t.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return r.join("")===n.join("")}catch{return!1}}function Oc(e){return e.exception?.values?.[0]}var F_="ConversationId",M_=(()=>({name:F_,setup(e){e.on("spanStart",t=>{const r=te().getScopeData(),n=nt().getScopeData(),i=r.conversationId||n.conversationId;if(i){const{op:s,data:o,description:a}=K(t);if(!s?.startsWith("gen_ai.")&&!o["ai.operationId"]&&!a?.startsWith("ai."))return;t.setAttribute(Hh,i)}})}})),L_=M_;function ud(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}function D_(e,t,r,n,i){if(!e.fetchData)return;const{method:s,url:o}=e.fetchData,a=Xe()&&t(o);if(e.endTimestamp){const f=e.fetchData.__span;if(!f)return;const h=n[f];h&&(a&&(H_(h,e),q_(h,e,i)),delete n[f]);return}const{spanOrigin:c="auto.http.browser",propagateTraceparent:u=!1}=typeof i=="object"?i:{spanOrigin:i},l=Y(),d=!!qe()||!!l&&mt(l),p=a&&d?sr(W_(o,s,c)):new rt;if(a&&!d&&l?.recordDroppedEvent("no_parent_span","span"),e.fetchData.__span=p.spanContext().spanId,n[p.spanContext().spanId]=p,r(e.fetchData.url)){const f=e.args[0],h={...e.args[1]||{}},g=U_(f,h,Xe()&&d?p:void 0,u);g&&(e.args[1]=h,h.headers=g)}if(l){const f={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};l.emit("beforeOutgoingRequestSpan",p,f)}return p}function q_(e,t,r){(typeof r=="object"&&r!==null?r.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function U_(e,t,r,n){const i=sd({span:r,propagateTraceparent:n}),s=i["sentry-trace"],o=i.baggage,a=i.traceparent;if(!s)return;const c=t.headers||(sa(e)?e.headers:void 0);if(c)if(j_(c)){const u=new Headers(c);if(u.get("sentry-trace")||u.set("sentry-trace",s),n&&a&&!u.get("traceparent")&&u.set("traceparent",a),o){const l=u.get("baggage");l?Wn(l)||u.set("baggage",`${l},${o}`):u.set("baggage",o)}return u}else if(B_(c)){const u=[...c];u.find(d=>d[0]==="sentry-trace")||u.push(["sentry-trace",s]),n&&a&&!u.find(d=>d[0]==="traceparent")&&u.push(["traceparent",a]);const l=c.find(d=>d[0]==="baggage"&&typeof d[1]=="string"&&Wn(d[1]));return o&&!l&&u.push(["baggage",o]),u}else{const u="sentry-trace"in c?c["sentry-trace"]:void 0,l="traceparent"in c?c.traceparent:void 0,d="baggage"in c?c.baggage:void 0,p=d?Array.isArray(d)?[...d]:[d]:[],f=d&&(Array.isArray(d)?d.find(g=>Wn(g)):Wn(d));o&&!f&&p.push(o);const h=Object.assign({},c,{"sentry-trace":u??s,baggage:p.length>0?p.join(","):void 0});return n&&a&&!l&&(h.traceparent=a),h}else return{...i}}function H_(e,t){if(t.response){pl(e,t.response.status);const r=t.response?.headers?.get("content-length");if(r){const n=parseInt(r);n>0&&e.setAttribute("http.response_content_length",n)}}else t.error&&e.setStatus({code:2,message:"internal_error"});e.end()}function Wn(e){return typeof e!="string"?!1:e.split(",").some(t=>t.trim().startsWith(gl))}function j_(e){return typeof Headers<"u"&&gt(e,Headers)}function B_(e){return Array.isArray(e)?e.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"):!1}function W_(e,t,r){if(e.startsWith("data:"))return{name:`${t} ${At(e)}`,attributes:$c(e,void 0,t,r)};const n=jl(e);return{name:`${t} ${n?cg(n):e}`,attributes:$c(e,n,t,r)}}function $c(e,t,r,n){const i={url:At(e),type:"fetch","http.method":r,[ve]:n,[vt]:"http.client"};return t&&(Hl(t)||(i["http.url"]=At(t.href),i["server.address"]=t.host),t.search&&(i["http.query"]=t.search),t.hash&&(i["http.fragment"]=t.hash)),i}var yn=V;function z_(){return"history"in yn&&!!yn.history}function G_(){if(!("fetch"in yn))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function ro(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function V_(){if(typeof EdgeRuntime=="string")return!0;if(!G_())return!1;if(ro(yn.fetch))return!0;let e=!1;const t=yn.document;if(t&&typeof t.createElement=="function")try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),r.contentWindow?.fetch&&(e=ro(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){O&&E.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}function ld(e,t){const r="fetch",n=Ft(r,e);return Mt(r,()=>dd(void 0,t)),n}function Y_(e){const t="fetch-body-resolved",r=Ft(t,e);return Mt(t,()=>dd(K_)),r}function dd(e,t=!1){t&&!V_()||Fe(V,"fetch",function(r){return function(...n){const i=new Error,{method:s,url:o}=J_(n),a={args:n,fetchData:{method:s,url:o},startTimestamp:_e()*1e3,virtualError:i,headers:Z_(n)};return e||Be("fetch",{...a}),r.apply(V,n).then(async c=>(e?e(c):Be("fetch",{...a,endTimestamp:_e()*1e3,response:c}),c),c=>{Be("fetch",{...a,endTimestamp:_e()*1e3,error:c}),zi(c)&&c.stack===void 0&&(c.stack=i.stack,$e(c,"framesToPop",1));const u=Y()?.getOptions().enhanceFetchErrorMessages??"always";if(u!==!1&&c instanceof TypeError&&(c.message==="Failed to fetch"||c.message==="Load failed"||c.message==="NetworkError when attempting to fetch resource."))try{const l=new URL(a.fetchData.url).host;u==="always"?c.message=`${c.message} (${l})`:$e(c,"__sentry_fetch_url_host__",l)}catch{}throw c})}})}async function X_(e,t){if(e?.body){const r=e.body,n=r.getReader(),i=setTimeout(()=>{r.cancel().then(null,()=>{})},9e4);let s=!0;for(;s;){let o;try{o=setTimeout(()=>{r.cancel().then(null,()=>{})},5e3);const{done:a}=await n.read();clearTimeout(o),a&&(t(),s=!1)}catch{s=!1}finally{clearTimeout(o)}}clearTimeout(i),n.releaseLock(),r.cancel().then(null,()=>{})}}function K_(e){let t;try{t=e.clone()}catch{return}X_(t,()=>{Be("fetch-body-resolved",{endTimestamp:_e()*1e3,response:e})})}function ai(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Nc(e){return typeof e=="string"?e:e?ai(e,"url")?e.url:e.toString?e.toString():"":""}function J_(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[r,n]=e;return{url:Nc(r),method:ai(n,"method")?String(n.method).toUpperCase():sa(r)&&ai(r,"method")?String(r.method).toUpperCase():"GET"}}const t=e[0];return{url:Nc(t),method:ai(t,"method")?String(t.method).toUpperCase():"GET"}}function Z_(e){const[t,r]=e;try{if(typeof r=="object"&&r!==null&&"headers"in r&&r.headers)return new Headers(r.headers);if(sa(t))return new Headers(t.headers)}catch{}}var H=V,no=0;function pd(){return no>0}function Q_(){no++,setTimeout(()=>{no--})}function Cr(e,t={}){function r(i){return typeof i=="function"}if(!r(e))return e;try{const i=e.__sentry_wrapped__;if(i)return typeof i=="function"?i:e;if(aa(e))return e}catch{return e}const n=function(...i){try{const s=i.map(o=>Cr(o,t));return e.apply(this,s)}catch(s){throw Q_(),ca(o=>{o.addEventProcessor(a=>(t.mechanism&&(js(a,void 0,void 0),kr(a,t.mechanism)),a.extra={...a.extra,arguments:i},a)),wg(s)}),s}};try{for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}catch{}sl(n,e),$e(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return e.name}})}catch{}return n}function Si(){const e=Pn(),{referrer:t}=H.document||{},{userAgent:r}=H.navigator||{};return{url:e,headers:{...t&&{Referer:t},...r&&{"User-Agent":r}}}}function fa(e,t){const r=ga(e,t),n={type:iv(t),value:sv(t)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function ev(e,t,r,n){const i=Y()?.getOptions().normalizeDepth,s=lv(t),o={__serialized__:Nl(t,i)};if(s)return{exception:{values:[fa(e,s)]},extra:o};const a={exception:{values:[{type:Gi(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:cv(t,{isUnhandledRejection:n})}]},extra:o};if(r){const c=ga(e,r);c.length&&(a.exception.values[0].stacktrace={frames:c})}return a}function ps(e,t){return{exception:{values:[fa(e,t)]}}}function ga(e,t){const r=t.stacktrace||t.stack||"",n=rv(t),i=nv(t);try{return e(r,n,i)}catch{}return[]}var tv=/Minified React error #\d+;/i;function rv(e){return e&&tv.test(e.message)?1:0}function nv(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function hd(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function iv(e){const t=e?.name;return!t&&hd(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function sv(e){const t=e?.message;return hd(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?xc(t.error):xc(e):"No error message"}function ov(e,t,r,n){const i=_a(e,t,r?.syntheticException||void 0,n);return kr(i),i.level="error",r?.event_id&&(i.event_id=r.event_id),Fn(i)}function av(e,t,r="info",n,i){const s=io(e,t,n?.syntheticException||void 0,i);return s.level=r,n?.event_id&&(s.event_id=n.event_id),Fn(s)}function _a(e,t,r,n,i){let s;if(rl(t)&&t.error)return ps(e,t.error);if(za(t)||lh(t)){const o=t;if("stack"in t)s=ps(e,t);else{const a=o.name||(za(o)?"DOMError":"DOMException"),c=o.message?`${a}: ${o.message}`:a;s=io(e,c,r,n),js(s,c)}return"code"in o&&(s.tags={...s.tags,"DOMException.code":`${o.code}`}),s}return zi(t)?ps(e,t):gn(t)||Gi(t)?(s=ev(e,t,r,i),kr(s,{synthetic:!0}),s):(s=io(e,t,r,n),js(s,`${t}`,void 0),kr(s,{synthetic:!0}),s)}function io(e,t,r,n){const i={};if(n&&r){const s=ga(e,r);s.length&&(i.exception={values:[{value:t,stacktrace:{frames:s}}]}),kr(i,{synthetic:!0})}if(ia(t)){const{__sentry_template_string__:s,__sentry_template_values__:o}=t;return i.logentry={message:s,params:o},i}return i.message=t,i}function cv(e,{isUnhandledRejection:t}){const r=_h(e),n=t?"promise rejection":"exception";return rl(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:Gi(e)?`Event \`${uv(e)}\` (type=${e.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function uv(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function lv(e){return Object.values(e).find(t=>t instanceof Error)}var dv=class extends Qg{constructor(e){const t=pv(e),r=H.SENTRY_SDK_SOURCE||Ng();id(t,"browser",["browser"],r),t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:t.sendDefaultPii?"auto":"never",...t._metadata.sdk.settings}),super(t);const{sendDefaultPii:n,sendClientReports:i,enableLogs:s,_experiments:o,enableMetrics:a}=this._options,c=a??o?.enableMetrics??!0;H.document&&(i||s||c)&&H.document.addEventListener("visibilitychange",()=>{H.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),s&&Qs(this),c&&Kl(this))}),n&&this.on("beforeSendSession",a_)}eventFromException(e,t){return ov(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return av(this._options.stackParser,e,t,r,this._options.attachStacktrace)}_prepareEvent(e,t,r,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,r,n)}};function pv(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:H.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var yt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,U=V,hv=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Mn=(e,t,r,n)=>{let i,s;return o=>{t.value>=0&&(o||n)&&(s=t.value-(i??0),(s||i===void 0)&&(i=t.value,t.delta=s,t.rating=hv(t.value,r),e(t)))}},Ln=(e=!0)=>{const t=U.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Ur=()=>Ln()?.activationStart??0;function Ot(e,t,r){U.document&&U.addEventListener(e,t,r)}function Ei(e,t,r){U.document&&U.removeEventListener(e,t,r)}var Er=-1,fd=new Set,fv=()=>U.document?.visibilityState==="hidden"&&!U.document?.prerendering?0:1/0,ci=e=>{if(gv(e)&&Er>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of fd)t();isFinite(Er)||(Er=e.type==="visibilitychange"?e.timeStamp:0,Ei("prerenderingchange",ci,!0))}},Dn=()=>{if(U.document&&Er<0){const e=Ur();Er=(U.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>t.name==="hidden"&&t.startTime>e)[0]?.startTime)??fv(),Ot("visibilitychange",ci,!0),Ot("pagehide",ci,!0),Ot("prerenderingchange",ci,!0)}return{get firstHiddenTime(){return Er},onHidden(e){fd.add(e)}}};function gv(e){return e.type==="pagehide"||U.document?.visibilityState==="hidden"}var _v=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,qn=(e,t=-1)=>{const r=Ln();let n="navigate";return r&&(U.document?.prerendering||Ur()>0?n="prerender":U.document?.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:_v(),navigationType:n}},hs=new WeakMap;function va(e,t){try{return hs.get(e)||hs.set(e,new t),hs.get(e)}catch{return new t}}var vv=class so{constructor(){so.prototype.__init.call(this),so.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){if(t.hadRecentInput)return;const r=this._sessionEntries[0],n=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&r&&n&&t.startTime-n.startTime<1e3&&t.startTime-r.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),this._onAfterProcessingUnexpectedShift?.(t)}},Hr=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver(i=>{Promise.resolve().then(()=>{t(i.getEntries())})});return n.observe({type:e,buffered:!0,...r}),n}}catch{}},ma=e=>{let t=!1;return()=>{t||(e(),t=!0)}},Yi=e=>{U.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},mv=[1800,3e3],yv=(e,t={})=>{Yi(()=>{const r=Dn(),n=qn("FCP");let i;const o=Hr("paint",a=>{for(const c of a)c.name==="first-contentful-paint"&&(o.disconnect(),c.startTime<r.firstHiddenTime&&(n.value=Math.max(c.startTime-Ur(),0),n.entries.push(c),i(!0)))});o&&(i=Mn(e,n,mv,t.reportAllChanges))})},bv=[.1,.25],Sv=(e,t={})=>{yv(ma(()=>{const r=qn("CLS",0);let n;const i=Dn(),s=va(t,vv),o=c=>{for(const u of c)s._processEntry(u);s._sessionValue>r.value&&(r.value=s._sessionValue,r.entries=s._sessionEntries,n())},a=Hr("layout-shift",o);a&&(n=Mn(e,r,bv,t.reportAllChanges),i.onHidden(()=>{o(a.takeRecords()),n(!0)}),U?.setTimeout?.(n))}))},gd=0,fs=1/0,zn=0,Ev=e=>{e.forEach(t=>{t.interactionId&&(fs=Math.min(fs,t.interactionId),zn=Math.max(zn,t.interactionId),gd=zn?(zn-fs)/7+1:0)})},oo,_d=()=>oo?gd:performance.interactionCount||0,wv=()=>{"interactionCount"in performance||oo||(oo=Hr("event",Ev,{type:"event",buffered:!0,durationThreshold:0}))},gs=10,vd=0,Tv=()=>_d()-vd,Iv=class ao{constructor(){ao.prototype.__init.call(this),ao.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){vd=_d(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(Tv()/50));return this._longestInteractionList[t]}_processEntry(t){if(this._onBeforeProcessingEntry?.(t),!(t.interactionId||t.entryType==="first-input"))return;const r=this._longestInteractionList.at(-1);let n=this._longestInteractionMap.get(t.interactionId);if(n||this._longestInteractionList.length<gs||t.duration>r._latency){if(n?t.duration>n._latency?(n.entries=[t],n._latency=t.duration):t.duration===n._latency&&t.startTime===n.entries[0].startTime&&n.entries.push(t):(n={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(n.id,n),this._longestInteractionList.push(n)),this._longestInteractionList.sort((i,s)=>s._latency-i._latency),this._longestInteractionList.length>gs){const i=this._longestInteractionList.splice(gs);for(const s of i)this._longestInteractionMap.delete(s.id)}this._onAfterProcessingINPCandidate?.(n)}}},md=e=>{const t=U.requestIdleCallback||U.setTimeout;U.document?.visibilityState==="hidden"?e():(e=ma(e),Ot("visibilitychange",e,{once:!0,capture:!0}),Ot("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),Ei("visibilitychange",e,{capture:!0}),Ei("pagehide",e,{capture:!0})}))},xv=[200,500],kv=40,Rv=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const r=Dn();Yi(()=>{wv();const n=qn("INP");let i;const s=va(t,Iv),o=c=>{md(()=>{for(const l of c)s._processEntry(l);const u=s._estimateP98LongestInteraction();u&&u._latency!==n.value&&(n.value=u._latency,n.entries=u.entries,i())})},a=Hr("event",o,{durationThreshold:t.durationThreshold??kv});i=Mn(e,n,xv,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),r.onHidden(()=>{o(a.takeRecords()),i(!0)}))})},Pv=class{_processEntry(e){this._onBeforeProcessingEntry?.(e)}},Cv=[2500,4e3],Av=(e,t={})=>{Yi(()=>{const r=Dn(),n=qn("LCP");let i;const s=va(t,Pv),o=c=>{t.reportAllChanges||(c=c.slice(-1));for(const u of c)s._processEntry(u),u.startTime<r.firstHiddenTime&&(n.value=Math.max(u.startTime-Ur(),0),n.entries=[u],i())},a=Hr("largest-contentful-paint",o);if(a){i=Mn(e,n,Cv,t.reportAllChanges);const c=ma(()=>{o(a.takeRecords()),a.disconnect(),i(!0)}),u=l=>{l.isTrusted&&(md(c),Ei(l.type,u,{capture:!0}))};for(const l of["keydown","click","visibilitychange"])Ot(l,u,{capture:!0})}})},Ov=[800,1800],co=e=>{U.document?.prerendering?Yi(()=>co(e)):U.document?.readyState!=="complete"?addEventListener("load",()=>co(e),!0):setTimeout(e)},$v=(e,t={})=>{const r=qn("TTFB"),n=Mn(e,r,Ov,t.reportAllChanges);co(()=>{const i=Ln();i&&(r.value=Math.max(i.responseStart-Ur(),0),r.entries=[i],n(!0))})},an={},wi={},yd,bd,Sd,Ed;function ya(e,t=!1){return Xi("cls",e,Fv,yd,t)}function ba(e,t=!1){return Xi("lcp",e,Mv,bd,t)}function Nv(e){return Xi("ttfb",e,Lv,Sd)}function wd(e){return Xi("inp",e,Dv,Ed)}function bn(e,t){return Td(e,t),wi[e]||(qv(e),wi[e]=!0),Id(e,t)}function Un(e,t){const r=an[e];if(r?.length)for(const n of r)try{n(t)}catch(i){yt&&E.error(`Error while triggering instrumentation handler.
18
+ Type: ${e}
19
+ Name: ${ft(n)}
20
+ Error:`,i)}}function Fv(){return Sv(e=>{Un("cls",{metric:e}),yd=e},{reportAllChanges:!0})}function Mv(){return Av(e=>{Un("lcp",{metric:e}),bd=e},{reportAllChanges:!0})}function Lv(){return $v(e=>{Un("ttfb",{metric:e}),Sd=e})}function Dv(){return Rv(e=>{Un("inp",{metric:e}),Ed=e})}function Xi(e,t,r,n,i=!1){Td(e,t);let s;return wi[e]||(s=r(),wi[e]=!0),n&&t({metric:n}),Id(e,t,i?s:void 0)}function qv(e){const t={};e==="event"&&(t.durationThreshold=0),Hr(e,r=>{Un(e,{entries:r})},t)}function Td(e,t){an[e]=an[e]||[],an[e].push(t)}function Id(e,t,r){return()=>{r&&r();const n=an[e];if(!n)return;const i=n.indexOf(t);i!==-1&&n.splice(i,1)}}function Uv(e){return"duration"in e}var Hv=e=>{const t=r=>{(r.type==="pagehide"||U.document?.visibilityState==="hidden")&&e(r)};Ot("visibilitychange",t,{capture:!0,once:!0}),Ot("pagehide",t,{capture:!0,once:!0})};function _s(e){return typeof e=="number"&&isFinite(e)}function Nt(e,t,r,{...n}){const i=K(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),Ll(e,()=>{const s=sr({startTime:t,...n});return s&&s.end(r),s})}function Sa(e){const t=Y();if(!t)return;const{name:r,transaction:n,attributes:i,startTime:s}=e,{release:o,environment:a,sendDefaultPii:c}=t.getOptions(),u=t.getIntegrationByName("Replay")?.getReplayId(),l=te(),d=l.getUser(),p=d!==void 0?d.email||d.id||d.ip_address:void 0;let f;try{f=l.getScopeData().contexts.profile.profile_id}catch{}const h={release:o,environment:a,user:p||void 0,profile_id:f||void 0,replay_id:u||void 0,transaction:n,"user_agent.original":U.navigator?.userAgent,"client.address":c?"{{auto}}":void 0,...i};return sr({name:r,attributes:h,startTime:s,experimental:{standalone:!0}})}function Hn(){return U.addEventListener&&U.performance}function se(e){return e/1e3}function jv(e){let t="unknown",r="unknown",n="";for(const i of e){if(i==="/"){[t,r]=e.split("/");break}if(!isNaN(Number(i))){t=n==="h"?"http":n,r=e.split(n)[1];break}n+=i}return n===e&&(t=n),{name:t,version:r}}function Ki(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function Ji(e,t){let r,n=!1;function i(a){!n&&r&&t(a,r.spanContext().spanId,r),n=!0}Hv(()=>{i("pagehide")});const s=e.on("beforeStartNavigationSpan",(a,c)=>{c?.isRedirect||(i("navigation"),s(),o())}),o=e.on("afterStartPageLoadSpan",a=>{r=a,o()})}function Bv(e){let t=0,r;if(!Ki("layout-shift"))return;const n=ya(({metric:i})=>{const s=i.entries[i.entries.length-1];s&&(t=i.value,r=s)},!0);Ji(e,(i,s)=>{Wv(t,r,s,i),n()})}function Wv(e,t,r,n){yt&&E.log(`Sending CLS span (${e})`);const i=t?se((we()||0)+t.startTime):_e(),s=te().getScopeData().transactionName,o=t?be(t.sources[0]?.node):"Layout shift",a={[ve]:"auto.http.browser.cls",[vt]:"ui.webvital.cls",[nr]:0,"sentry.pageload.span_id":r,"sentry.report_event":n};t?.sources&&t.sources.forEach((u,l)=>{a[`cls.source.${l+1}`]=be(u.node)});const c=Sa({name:o,transaction:s,attributes:a,startTime:i});c&&(c.addEvent("cls",{[$n]:"",[Nn]:e}),c.end(i))}function jn(e){return e!=null&&e>0&&e<=6e4}function zv(e){let t=0,r;if(!Ki("largest-contentful-paint"))return;const n=ba(({metric:i})=>{const s=i.entries[i.entries.length-1];!s||!jn(i.value)||(t=i.value,r=s)},!0);Ji(e,(i,s)=>{Gv(t,r,s,i),n()})}function Gv(e,t,r,n){if(!jn(e))return;yt&&E.log(`Sending LCP span (${e})`);const i=se((we()||0)+(t?.startTime||0)),s=te().getScopeData().transactionName,o=t?be(t.element):"Largest contentful paint",a={[ve]:"auto.http.browser.lcp",[vt]:"ui.webvital.lcp",[nr]:0,"sentry.pageload.span_id":r,"sentry.report_event":n};t&&(t.element&&(a["lcp.element"]=be(t.element)),t.id&&(a["lcp.id"]=t.id),t.url&&(a["lcp.url"]=t.url),t.loadTime!=null&&(a["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(a["lcp.renderTime"]=t.renderTime),t.size!=null&&(a["lcp.size"]=t.size));const c=Sa({name:o,transaction:s,attributes:a,startTime:i});c&&(c.addEvent("lcp",{[$n]:"millisecond",[Nn]:e}),c.end(i))}function Ue(e){return e&&((we()||performance.timeOrigin)+e)/1e3}function xd(e){const t={};if(e.nextHopProtocol!=null){const{name:r,version:n}=jv(e.nextHopProtocol);t["network.protocol.version"]=n,t["network.protocol.name"]=r}return we()||Hn()?.timeOrigin?Vv({...t,"http.request.redirect_start":Ue(e.redirectStart),"http.request.redirect_end":Ue(e.redirectEnd),"http.request.worker_start":Ue(e.workerStart),"http.request.fetch_start":Ue(e.fetchStart),"http.request.domain_lookup_start":Ue(e.domainLookupStart),"http.request.domain_lookup_end":Ue(e.domainLookupEnd),"http.request.connect_start":Ue(e.connectStart),"http.request.secure_connection_start":Ue(e.secureConnectionStart),"http.request.connection_end":Ue(e.connectEnd),"http.request.request_start":Ue(e.requestStart),"http.request.response_start":Ue(e.responseStart),"http.request.response_end":Ue(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function Vv(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}var Yv=2147483647,Fc=0,Re={},Ae,Ti;function Xv({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:r}){const n=Hn();if(n&&we()){n.mark&&U.performance.mark("sentry-tracing-init");const i=t?zv(r):t===!1?em():void 0,s=e?Bv(r):e===!1?Qv():void 0,o=tm();return()=>{o(),i?.(),s?.()}}return()=>{}}function Kv(){bn("longtask",({entries:e})=>{const t=qe();if(!t)return;const{op:r,start_timestamp:n}=K(t);for(const i of e){const s=se(we()+i.startTime),o=se(i.duration);r==="navigation"&&n&&s<n||Nt(t,s,s+o,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[ve]:"auto.ui.browser.metrics"}})}})}function Jv(){new PerformanceObserver(e=>{const t=qe();if(t)for(const r of e.getEntries()){if(!r.scripts[0])continue;const n=se(we()+r.startTime),{start_timestamp:i,op:s}=K(t);if(s==="navigation"&&i&&n<i)continue;const o=se(r.duration),a={[ve]:"auto.ui.browser.metrics"},{invoker:c,invokerType:u,sourceURL:l,sourceFunctionName:d,sourceCharPosition:p}=r.scripts[0];a["browser.script.invoker"]=c,a["browser.script.invoker_type"]=u,l&&(a["code.filepath"]=l),d&&(a["code.function"]=d),p!==-1&&(a["browser.script.source_char_position"]=p),Nt(t,n,n+o,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:a})}}).observe({type:"long-animation-frame",buffered:!0})}function Zv(){bn("event",({entries:e})=>{const t=qe();if(t){for(const r of e)if(r.name==="click"){const n=se(we()+r.startTime),i=se(r.duration),s={name:be(r.target),op:`ui.interaction.${r.name}`,startTime:n,attributes:{[ve]:"auto.ui.browser.metrics"}},o=il(r.target);o&&(s.attributes["ui.component_name"]=o),Nt(t,n,n+i,s)}}})}function Qv(){return ya(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Re.cls={value:e.value,unit:""},Ti=t)},!0)}function em(){return ba(({metric:e})=>{const t=e.entries[e.entries.length-1];!t||!jn(e.value)||(Re.lcp={value:e.value,unit:"millisecond"},Ae=t)},!0)}function tm(){return Nv(({metric:e})=>{e.entries[e.entries.length-1]&&(Re.ttfb={value:e.value,unit:"millisecond"})})}function rm(e,t){const r=Hn(),n=we();if(!r?.getEntries||!n)return;const{spanStreamingEnabled:i,ignorePerformanceApiSpans:s,ignoreResourceSpans:o,recordClsOnPageloadSpan:a,recordLcpOnPageloadSpan:c}=t,u=se(n),l=r.getEntries(),{op:d,start_timestamp:p}=K(e);if(l.slice(Fc).forEach(f=>{const h=se(f.startTime),g=se(Math.max(0,f.duration));if(!(d==="navigation"&&p&&u+h<p))switch(f.entryType){case"navigation":om(e,f,u);break;case"mark":case"paint":case"measure":{im(e,f,h,g,u,s);const m=Dn(),w=f.startTime<m.firstHiddenTime;f.name==="first-paint"&&w&&(Re.fp={value:f.startTime,unit:"millisecond"}),f.name==="first-contentful-paint"&&w&&(Re.fcp={value:f.startTime,unit:"millisecond"});break}case"resource":um(e,f,f.name,h,g,u,o)}}),Fc=Math.max(l.length-1,0),lm(e,i),d==="pageload"){if(hm(Re),i){const f=(h,g,m)=>{const w=m??`browser.web_vital.${h}.value`;e.setAttribute(w,g),yt&&E.log("Setting web vital attribute",{[w]:g},"on pageload span")};["ttfb","fp","fcp"].forEach(h=>{Re[h]&&f(h,Re[h].value)}),Re["ttfb.requestTime"]&&f("ttfb.requestTime",Re["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else a||delete Re.cls,c||delete Re.lcp,Object.entries(Re).forEach(([f,h])=>{Uf(f,h.value,h.unit)}),dm(e,t);e.setAttribute(i?"browser.performance.time_origin":"performance.timeOrigin",u),e.setAttribute(i?"browser.performance.navigation.activation_start":"performance.activationStart",Ur())}Ae=void 0,Ti=void 0,Re={}}function nm(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function im(e,t,r,n,i,s){if(nm(t)||["mark","measure"].includes(t.entryType)&&Ct(t.name,s))return;const o=Ln(!1),a=se(o?o.requestStart:0),c=i+Math.max(r,a),u=i+r,l=u+n,d={[ve]:"auto.resource.browser.metrics"};c!==u&&(d["sentry.browser.measure_happened_before_request"]=!0,d["sentry.browser.measure_start_time"]=c),sm(d,t),c<=l&&Nt(e,c,l,{name:t.name,op:t.entryType,attributes:d})}function sm(e,t){try{const r=t.detail;if(!r)return;if(typeof r=="object"){for(const[n,i]of Object.entries(r))if(i&&xr(i))e[`sentry.browser.measure.detail.${n}`]=i;else if(i!==void 0)try{e[`sentry.browser.measure.detail.${n}`]=JSON.stringify(i)}catch{}return}if(xr(r)){e["sentry.browser.measure.detail"]=r;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(r)}catch{}}catch{}}function om(e,t,r){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(n=>{Gn(e,t,n,r)}),Gn(e,t,"secureConnection",r,"TLS/SSL"),Gn(e,t,"fetch",r,"cache"),Gn(e,t,"domainLookup",r,"DNS"),cm(e,t,r)}function Gn(e,t,r,n,i=r){const s=t[am(r)],o=t[`${r}Start`];!o||!s||Nt(e,n+se(o),n+se(s),{op:`browser.${i}`,name:t.name,attributes:{[ve]:"auto.ui.browser.metrics",...r==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function am(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function cm(e,t,r){const n=r+se(t.requestStart),i=r+se(t.responseEnd),s=r+se(t.responseStart);t.responseEnd&&(Nt(e,n,i,{op:"browser.request",name:t.name,attributes:{[ve]:"auto.ui.browser.metrics"}}),Nt(e,s,i,{op:"browser.response",name:t.name,attributes:{[ve]:"auto.ui.browser.metrics"}}))}function um(e,t,r,n,i,s,o){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const a=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(o?.includes(a))return;const c={[ve]:"auto.resource.browser.metrics"},u=Vt(r);u.protocol&&(c["url.scheme"]=u.protocol.split(":").pop()),u.host&&(c["server.address"]=u.host),c["url.same_origin"]=r.includes(U.location.origin),pm(t,c,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const l={...c,...xd(t)},d=s+n,p=d+i;Nt(e,d,p,{name:r.replace(U.location.origin,""),op:a,attributes:l})}function lm(e,t){const r=U.navigator;if(!r)return;const n=r.connection;n&&(n.effectiveType&&e.setAttribute(t?"network.connection.effective_type":"effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute(t?"network.connection.type":"connectionType",n.type),_s(n.rtt)&&(Re["connection.rtt"]={value:n.rtt,unit:"millisecond"},t&&e.setAttribute("network.connection.rtt",n.rtt))),_s(r.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",r.deviceMemory):e.setAttribute("deviceMemory",`${r.deviceMemory} GB`)),_s(r.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",r.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(r.hardwareConcurrency)))}function dm(e,t){Ae&&t.recordLcpOnPageloadSpan&&(Ae.element&&e.setAttribute("lcp.element",be(Ae.element)),Ae.id&&e.setAttribute("lcp.id",Ae.id),Ae.url&&e.setAttribute("lcp.url",Ae.url.trim().slice(0,200)),Ae.loadTime!=null&&e.setAttribute("lcp.loadTime",Ae.loadTime),Ae.renderTime!=null&&e.setAttribute("lcp.renderTime",Ae.renderTime),e.setAttribute("lcp.size",Ae.size)),Ti?.sources&&t.recordClsOnPageloadSpan&&Ti.sources.forEach((r,n)=>e.setAttribute(`cls.source.${n+1}`,be(r.node)))}function pm(e,t,r){r.forEach(([n,i])=>{const s=e[n];s!=null&&(typeof s=="number"&&s<Yv||typeof s=="string")&&(t[i]=s)})}function hm(e){const t=Ln(!1);if(!t)return;const{responseStart:r,requestStart:n}=t;n<=r&&(e["ttfb.requestTime"]={value:r-n,unit:"millisecond"})}var vs=[],cn=new Map,cr=new Map;function fm(){if(Hn()&&we()){const e=gm();return()=>{e()}}return()=>{}}var Sn={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function gm(){return wd(_m)}var _m=({metric:e})=>{if(e.value==null)return;const t=se(e.value);if(t>60)return;const r=e.entries.find(h=>h.duration===e.value&&Sn[h.name]);if(!r)return;const{interactionId:n}=r,i=Sn[r.name],s=se(we()+r.startTime),o=qe(),a=o?Ee(o):void 0,c=n!=null?cn.get(n):void 0,u=c?.span||a,l=u?K(u).description:te().getScopeData().transactionName,d=c?.elementName||be(r.target),p={[ve]:"auto.http.browser.inp",[vt]:`ui.interaction.${i}`,[nr]:r.duration},f=Sa({name:d,transaction:l,attributes:p,startTime:s});f&&(f.addEvent("inp",{[$n]:"millisecond",[Nn]:e.value}),f.end(s+t))};function vm(e){return e!=null?cn.get(e):void 0}function mm(){const e=Object.keys(Sn);da()&&e.forEach(i=>{U.addEventListener(i,t,{capture:!0,passive:!0})});function t(i){const s=i.target;if(!s)return;const o=be(s),a=Math.round(i.timeStamp);if(cr.set(a,o),cr.size>50){const c=cr.keys().next().value;c!==void 0&&cr.delete(c)}}function r(i){const s=Math.round(i.startTime);let o=cr.get(s);if(!o)for(let a=-5;a<=5;a++){const c=cr.get(s+a);if(c){o=c;break}}return o||"<unknown>"}const n=({entries:i})=>{const s=qe(),o=s&&Ee(s);i.forEach(a=>{if(!Uv(a))return;const c=a.interactionId;if(c==null||cn.has(c))return;const u=a.target?be(a.target):r(a);if(vs.length>10){const l=vs.shift();cn.delete(l)}vs.push(c),cn.set(c,{span:o,elementName:u})})};bn("event",n),bn("first-input",n)}function Ea(e){const{name:t,op:r,origin:n,metricName:i,value:s,attributes:o,parentSpan:a,reportEvent:c,startTime:u,endTime:l}=e,d=te().getScopeData().transactionName,p={[ve]:n,[vt]:r,[nr]:0,[`browser.web_vital.${i}.value`]:s,"sentry.transaction":d,"user_agent.original":U.navigator?.userAgent,...o};a&&wl(a).attributes?.["sentry.op"]==="pageload"&&(p["sentry.pageload.span_id"]=a.spanContext().spanId),c&&(p[`browser.web_vital.${i}.report_event`]=c);const f=sr({name:t,attributes:p,startTime:u,parentSpan:a});f&&f.end(l??u)}function ym(e){let t=0,r;if(!Ki("largest-contentful-paint"))return;const n=ba(({metric:i})=>{const s=i.entries[i.entries.length-1];!s||!jn(i.value)||(t=i.value,r=s)},!0);Ji(e,(i,s,o)=>{bm(t,r,o,i),n()})}function bm(e,t,r,n){if(!jn(e))return;yt&&E.log(`Sending LCP span (${e})`);const i=we()||0,s=se(i),o=se(i+(t?.startTime||0)),a=t?be(t.element):"Largest contentful paint",c={};t?.element&&(c["browser.web_vital.lcp.element"]=be(t.element)),t?.id&&(c["browser.web_vital.lcp.id"]=t.id),t?.url&&(c["browser.web_vital.lcp.url"]=t.url),t?.loadTime!=null&&(c["browser.web_vital.lcp.load_time"]=t.loadTime),t?.renderTime!=null&&(c["browser.web_vital.lcp.render_time"]=t.renderTime),t?.size!=null&&(c["browser.web_vital.lcp.size"]=t.size),Ea({name:a,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:e,attributes:c,parentSpan:r,reportEvent:n,startTime:s,endTime:o})}function Sm(e){let t=0,r;if(!Ki("layout-shift"))return;const n=ya(({metric:i})=>{const s=i.entries[i.entries.length-1];s&&(t=i.value,r=s)},!0);Ji(e,(i,s,o)=>{Em(t,r,o,i),n()})}function Em(e,t,r,n){yt&&E.log(`Sending CLS span (${e})`);const i=t?se((we()||0)+t.startTime):_e(),s=t?be(t.sources[0]?.node):"Layout shift",o={};t?.sources&&t.sources.forEach((a,c)=>{o[`browser.web_vital.cls.source.${c+1}`]=be(a.node)}),Ea({name:s,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:o,parentSpan:r,reportEvent:n,startTime:i})}function wm(){if(!Hn()||!we())return;wd(({metric:t})=>{if(t.value==null||se(t.value)>60)return;const r=t.entries.find(n=>n.duration===t.value&&Sn[n.name]);r&&Tm(t.value,r)})}function Tm(e,t){yt&&E.log(`Sending INP span (${e})`);const r=se(we()+t.startTime),n=se(e),i=Sn[t.name],s=vm(t.interactionId),o=qe(),a=o?Ee(o):void 0,c=s?.span||a,u=c?wl(c).name:te().getScopeData().transactionName;Ea({name:s?.elementName||be(t.target),op:`ui.interaction.${i}`,origin:"auto.http.browser.inp",metricName:"inp",value:e,attributes:{[nr]:t.duration,"sentry.transaction":u},startTime:r,endTime:r+n,parentSpan:c})}var Im=1e3,Mc,uo,lo;function xm(e){Ft("dom",e),Mt("dom",km)}function km(){if(!U.document)return;const e=Be.bind(null,"dom"),t=Lc(e,!0);U.document.addEventListener("click",t,!1),U.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(r=>{const n=U[r]?.prototype;n?.hasOwnProperty?.("addEventListener")&&(Fe(n,"addEventListener",function(i){return function(s,o,a){if(s==="click"||s=="keypress")try{const c=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},u=c[s]=c[s]||{refCount:0};if(!u.handler){const l=Lc(e);u.handler=l,i.call(this,s,l,a)}u.refCount++}catch{}return i.call(this,s,o,a)}}),Fe(n,"removeEventListener",function(i){return function(s,o,a){if(s==="click"||s=="keypress")try{const c=this.__sentry_instrumentation_handlers__||{},u=c[s];u&&(u.refCount--,u.refCount<=0&&(i.call(this,s,u.handler,a),u.handler=void 0,delete c[s]),Object.keys(c).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,o,a)}}))})}function Rm(e){if(e.type!==uo)return!1;try{if(!e.target||e.target._sentryId!==lo)return!1}catch{}return!0}function Pm(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function Lc(e,t=!1){return r=>{if(!r||r._sentryCaptured)return;const n=Cm(r);if(Pm(r.type,n))return;$e(r,"_sentryCaptured",!0),n&&!n._sentryId&&$e(n,"_sentryId",We());const i=r.type==="keypress"?"input":r.type;Rm(r)||(e({event:r,name:i,global:t}),uo=r.type,lo=n?n._sentryId:void 0),clearTimeout(Mc),Mc=U.setTimeout(()=>{lo=void 0,uo=void 0},Im)}}function Cm(e){try{return e.target}catch{return null}}var Vn;function wa(e){const t="history";Ft(t,e),Mt(t,Am)}function Am(){if(U.addEventListener("popstate",()=>{const t=U.location.href,r=Vn;Vn=t,r!==t&&Be("history",{from:r,to:t})}),!z_())return;function e(t){return function(...r){const n=r.length>2?r[2]:void 0;if(n){const i=Vn,s=Om(String(n));if(Vn=s,i===s)return t.apply(this,r);Be("history",{from:i,to:s})}return t.apply(this,r)}}Fe(U.history,"pushState",e),Fe(U.history,"replaceState",e)}function Om(e){try{return new URL(e,U.location.origin).toString()}catch{return e}}var ui={};function $m(e){const t=ui[e];if(t)return t;let r=U[e];if(ro(r))return ui[e]=r.bind(U);const n=U.document;if(n&&typeof n.createElement=="function")try{const i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);const s=i.contentWindow;s?.[e]&&(r=s[e]),n.head.removeChild(i)}catch(i){yt&&E.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return r&&(ui[e]=r.bind(U))}function Nm(e){ui[e]=void 0}var mr="__sentry_xhr_v3__";function kd(e){Ft("xhr",e),Mt("xhr",Fm)}function Fm(){if(!U.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,r,n){const i=new Error,s=_e()*1e3,o=dt(n[0])?n[0].toUpperCase():void 0,a=Mm(n[1]);if(!o||!a)return t.apply(r,n);r[mr]={method:o,url:a,request_headers:{}},o==="POST"&&a.match(/sentry_key/)&&(r.__sentry_own_request__=!0);const c=()=>{const u=r[mr];if(u&&r.readyState===4){try{u.status_code=r.status}catch{}const l={endTimestamp:_e()*1e3,startTimestamp:s,xhr:r,virtualError:i};Be("xhr",l)}};return"onreadystatechange"in r&&typeof r.onreadystatechange=="function"?r.onreadystatechange=new Proxy(r.onreadystatechange,{apply(u,l,d){return c(),u.apply(l,d)}}):r.addEventListener("readystatechange",c),r.setRequestHeader=new Proxy(r.setRequestHeader,{apply(u,l,d){const[p,f]=d,h=l[mr];return h&&dt(p)&&dt(f)&&(h.request_headers[p.toLowerCase()]=f),u.apply(l,d)}}),t.apply(r,n)}}),e.send=new Proxy(e.send,{apply(t,r,n){const i=r[mr];if(!i)return t.apply(r,n);n[0]!==void 0&&(i.body=n[0]);const s={startTimestamp:_e()*1e3,xhr:r};return Be("xhr",s),t.apply(r,n)}})}function Mm(e){if(dt(e))return e;try{return e.toString()}catch{}}function Lm(e){let t;try{t=e.getAllResponseHeaders()}catch(r){return yt&&E.error(r,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
21
+ `).reduce((r,n)=>{const[i,s]=n.split(": ");return s&&(r[i.toLowerCase()]=s),r},{}):{}}var Dm=40;function qm(e,t=$m("fetch")){let r=0,n=0;async function i(s){const o=s.body.length;r+=o,n++;const a={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:r<=6e4&&n<15,...e.fetchOptions};try{const c=await t(e.url,a);return{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}}catch(c){throw Nm("fetch"),c}finally{r-=o,n--}}return Yg(e,i,ha(e.bufferSize||Dm))}var Le=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Um=30,Hm=50;function po(e,t,r,n){const i={filename:e,function:t==="<anonymous>"?"?":t,in_app:!0};return r!==void 0&&(i.lineno=r),n!==void 0&&(i.colno=n),i}var jm=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Bm=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Wm=/\((\S*)(?::(\d+))(?::(\d+))\)/,zm=/at (.+?) ?\(data:(.+?),/,Gm=e=>{const t=e.match(zm);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const r=jm.exec(e);if(r){const[,i,s,o]=r;return po(i,"?",+s,+o)}const n=Bm.exec(e);if(n){if(n[2]?.indexOf("eval")===0){const o=Wm.exec(n[2]);o&&(n[2]=o[1],n[3]=o[2],n[4]=o[3])}const[i,s]=Rd(n[1]||"?",n[2]);return po(s,i,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},Vm=[Um,Gm],Ym=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Xm=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Km=e=>{const t=Ym.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=Xm.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],n=t[1]||"?";return[n,r]=Rd(n,r),po(r,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Jm=[Hm,Km],Zm=[Vm,Jm],Qm=Ju(...Zm),Rd=(e,t)=>{const r=e.indexOf("safari-extension")!==-1,n=e.indexOf("safari-web-extension")!==-1;return r||n?[e.indexOf("@")!==-1?e.split("@")[0]:"?",r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Yn=1024,ey="Breadcrumbs",ty=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:ey,setup(r){t.console&&x_(sy(r)),t.dom&&xm(iy(r,t.dom)),t.xhr&&kd(oy(r)),t.fetch&&ld(ay(r)),t.history&&wa(cy(r)),t.sentry&&r.on("beforeSendEvent",ny(r))}}}),ry=ty;function ny(e){return function(r){Y()===e&&Jt({category:`sentry.${r.type==="transaction"?"transaction":"event"}`,event_id:r.event_id,level:r.level,message:zt(r)},{event:r})}}function iy(e,t){return function(n){if(Y()!==e)return;let i,s,o=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>Yn&&(Le&&E.warn(`\`dom.maxStringLength\` cannot exceed ${Yn}, but a value of ${a} was configured. Sentry will use ${Yn} instead.`),a=Yn),typeof o=="string"&&(o=[o]);try{const u=n.event,l=uy(u)?u.target:u;i=be(l,{keyAttrs:o,maxStringLength:a}),s=il(l)}catch{i="<unknown>"}if(i.length===0)return;const c={category:`ui.${n.name}`,message:i};s&&(c.data={"ui.component_name":s}),Jt(c,{event:n.event,name:n.name,global:n.global})}}function sy(e){return function(r){if(Y()!==e)return;const n={category:"console",data:{arguments:r.args,logger:"console"},level:R_(r.level),message:Ya(r.args," ")};if(r.level==="assert")if(r.args[0]===!1)n.message=`Assertion failed: ${Ya(r.args.slice(1)," ")||"console.assert"}`,n.data.arguments=r.args.slice(1);else return;Jt(n,{input:r.args,level:r.level})}}function oy(e){return function(r){if(Y()!==e)return;const{startTimestamp:n,endTimestamp:i}=r,s=r.xhr[mr];if(!n||!i||!s)return;const{method:o,url:a,status_code:c,body:u}=s,l={method:o,url:a,status_code:c},d={xhr:r.xhr,input:u,startTimestamp:n,endTimestamp:i},p={category:"xhr",data:l,type:"http",level:ud(c)};e.emit("beforeOutgoingRequestBreadcrumb",p,d),Jt(p,d)}}function ay(e){return function(r){if(Y()!==e)return;const{startTimestamp:n,endTimestamp:i}=r;if(i&&!(r.fetchData.url.match(/sentry_key/)&&r.fetchData.method==="POST"))if(r.error){const s={data:r.error,input:r.args,startTimestamp:n,endTimestamp:i},o={category:"fetch",data:r.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",o,s),Jt(o,s)}else{const s=r.response,o={...r.fetchData,status_code:s?.status},a={input:r.args,response:s,startTimestamp:n,endTimestamp:i},c={category:"fetch",data:o,type:"http",level:ud(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",c,a),Jt(c,a)}}}function cy(e){return function(r){if(Y()!==e)return;let n=r.from,i=r.to;const s=Vt(H.location.href);let o=n?Vt(n):void 0;const a=Vt(i);o?.path||(o=s),s.protocol===a.protocol&&s.host===a.host&&(i=a.relative),s.protocol===o.protocol&&s.host===o.host&&(n=o.relative),Jt({category:"navigation",data:{from:n,to:i}})}}function uy(e){return!!e&&!!e.target}var ly="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),dy="BrowserApiErrors",py=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:dy,setupOnce(){t.setTimeout&&Fe(H,"setTimeout",Dc),t.setInterval&&Fe(H,"setInterval",Dc),t.requestAnimationFrame&&Fe(H,"requestAnimationFrame",fy),t.XMLHttpRequest&&"XMLHttpRequest"in H&&Fe(XMLHttpRequest.prototype,"send",gy);const r=t.eventTarget;r&&(Array.isArray(r)?r:ly).forEach(n=>_y(n,t))}}}),hy=py;function Dc(e){return function(...t){const r=t[0];return t[0]=Cr(r,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${ft(e)}`}}),e.apply(this,t)}}function fy(e){return function(t){return e.apply(this,[Cr(t,{mechanism:{data:{handler:ft(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function gy(e){return function(...t){const r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(n=>{n in r&&typeof r[n]=="function"&&Fe(r,n,function(i){const s={mechanism:{data:{handler:ft(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${n}`}},o=aa(i);return o&&(s.mechanism.data.handler=ft(o)),Cr(i,s)})}),e.apply(this,t)}}function _y(e,t){const r=H[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Fe(r,"addEventListener",function(n){return function(i,s,o){try{vy(s)&&(s.handleEvent=Cr(s.handleEvent,{mechanism:{data:{handler:ft(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&my(this,i,s),n.apply(this,[i,Cr(s,{mechanism:{data:{handler:ft(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),o])}}),Fe(r,"removeEventListener",function(n){return function(i,s,o){try{const a=s.__sentry_wrapped__;a&&n.call(this,i,a,o)}catch{}return n.call(this,i,s,o)}}))}function vy(e){return typeof e.handleEvent=="function"}function my(e,t,r){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,r)}var yy=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof H.document>"u"){Le&&E.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}_c({ignoreDuration:!0}),ls();const r=nt();let n=r.getUser();r.addScopeListener(i=>{const s=i.getUser();(n?.id!==s?.id||n?.ip_address!==s?.ip_address)&&(ls(),n=s)}),t==="route"&&wa(({from:i,to:s})=>{i!==s&&(_c({ignoreDuration:!0}),ls())})}}},by="CultureContext",Sy=(()=>({name:by,preprocessEvent(e){const t=qc();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){const t=qc();t&&Bl(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})),Ey=Sy;function qc(){try{const e=H.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var wy="GlobalHandlers",Ty=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:wy,setupOnce(){Error.stackTraceLimit=50},setup(r){t.onerror&&(xy(r),Uc("onerror")),t.onunhandledrejection&&(ky(r),Uc("onunhandledrejection"))}}}),Iy=Ty;function xy(e){Qu(t=>{const{stackParser:r,attachStacktrace:n}=Pd();if(Y()!==e||pd())return;const{msg:i,url:s,line:o,column:a,error:c}=t,u=Cy(_a(r,c||i,void 0,n,!1),s,o,a);u.level="error",zl(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function ky(e){el(t=>{const{stackParser:r,attachStacktrace:n}=Pd();if(Y()!==e||pd())return;const i=Ry(t),s=xr(i)?Py(i):_a(r,i,void 0,n,!0);s.level="error",zl(s,{originalException:i,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function Ry(e){if(xr(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function Py(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function Cy(e,t,r,n){const i=e.exception=e.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},a=o.stacktrace=o.stacktrace||{},c=a.frames=a.frames||[];return c.length===0&&c.push({colno:n,lineno:r,filename:Ay(t)??Pn(),function:"?",in_app:!0}),e}function Uc(e){Le&&E.log(`Global Handler attached: ${e}`)}function Pd(){return Y()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function Ay(e){if(!(!dt(e)||e.length===0))return e.startsWith("data:")?`<${At(e,!1)}>`:e}var Oy=()=>({name:"HttpContext",preprocessEvent(e){if(!H.navigator&&!H.location&&!H.document)return;const t=Si(),r={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:r}},processSegmentSpan(e){if(!H.navigator&&!H.location&&!H.document)return;const t=Si();Bl(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers["User-Agent"],"http.request.header.referer":t.headers.Referer})}}),$y="cause",Ny=5,Fy="LinkedErrors",My=((e={})=>{const t=e.limit||Ny,r=e.key||$y;return{name:Fy,preprocessEvent(n,i,s){const o=s.getOptions();I_(fa,o.stackParser,r,t,n,i)}}}),Ly=My;function Dy(){return qy()?(Le&&tr(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function qy(){if(typeof H.window>"u")return!1;const e=H;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const t=Pn();return!(H===H.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(t))}function Uy(e){return[v_(),h_(),L_(),hy(),ry(),Iy(),Ly(),A_(),Oy(),Ey(),yy()]}function Hy(e={}){const t=!e.skipBrowserExtensionCheck&&Dy();let r=e.defaultIntegrations==null?Uy():e.defaultIntegrations;const n={...e,enabled:t?!1:e.enabled,stackParser:oh(e.stackParser||Qm),integrations:Ag({integrations:e.integrations,defaultIntegrations:r}),transport:e.transport||qm};return s_(dv,n)}function jy(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function Cd(e){try{return new URL(e,H.location.origin).href}catch{return}}function By(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function Ad(e){try{return new Headers(e)}catch{return}}var Hc=new WeakMap,ms=new Map,Od={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function Wy(e,t){const{traceFetch:r,traceXHR:n,trackFetchStreamPerformance:i,shouldCreateSpanForRequest:s,enableHTTPTimings:o,tracePropagationTargets:a,onRequestSpanStart:c,onRequestSpanEnd:u}={...Od,...t},l=typeof s=="function"?s:h=>!0,d=h=>Gy(h,a),p={},f=e.getOptions().propagateTraceparent;r&&(e.addEventProcessor(h=>(h.type==="transaction"&&h.spans&&h.spans.forEach(g=>{if(g.op==="http.client"){const m=ms.get(g.span_id);m&&(g.timestamp=m/1e3,ms.delete(g.span_id))}}),h)),i&&Y_(h=>{if(h.response){const g=Hc.get(h.response);g&&h.endTimestamp&&ms.set(g,h.endTimestamp)}}),ld(h=>{const g=D_(h,l,d,p,{propagateTraceparent:f,onRequestSpanEnd:u});if(h.response&&h.fetchData.__span&&Hc.set(h.response,h.fetchData.__span),g){const m=Cd(h.fetchData.url),w=m?Vt(m).host:void 0;g.setAttributes({"http.url":m?At(m):void 0,"server.address":w}),o&&jc(g,e),c?.(g,{headers:h.headers})}})),n&&kd(h=>{const g=Vy(h,l,d,p,f,u);g&&(o&&jc(g,e),c?.(g,{headers:Ad(h.xhr.__sentry_xhr_v3__?.request_headers)}))})}var zy=300;function jc(e,t){const{url:r}=K(e).data;if(!r||typeof r!="string")return;let n=()=>{setTimeout(i)};if(mt(t)){const s=e.end.bind(e);e.end=o=>{const a=o??_e();let c=!1;const u=()=>{c||(c=!0,setTimeout(i),s(a),clearTimeout(l))};n=u;const l=setTimeout(u,zy)}}const i=bn("resource",({entries:s})=>{s.forEach(o=>{By(o)&&o.name.endsWith(r)&&(e.setAttributes(xd(o)),n())})})}function Gy(e,t){const r=Pn();if(r){let n,i;try{n=new URL(e,r),i=new URL(r).origin}catch{return!1}const s=n.origin===i;return t?Ct(n.toString(),t)||s&&Ct(n.pathname,t):s}else{const n=!!e.match(/^\/(?!\/)/);return t?Ct(e,t):n}}function Vy(e,t,r,n,i,s){const o=e.xhr,a=o?.[mr];if(!o||o.__sentry_own_request__||!a)return;const{url:c,method:u}=a,l=Xe()&&t(c);if(e.endTimestamp){const w=o.__sentry_xhr_span_id__;if(!w)return;const P=n[w];P&&(l&&a.status_code!==void 0&&(pl(P,a.status_code),P.end(),s?.(P,{headers:Ad(Lm(o)),error:e.error})),delete n[w]);return}const d=Cd(c),p=Vt(d||c),f=At(ug(c)),h=Y(),g=!!qe()||!!h&&mt(h),m=l&&g?sr({name:`${u} ${f}`,attributes:{url:At(c),type:"xhr","http.method":u,"http.url":d?At(d):void 0,"server.address":p?.host,[ve]:"auto.http.browser",[vt]:"http.client",...p?.search&&{"http.query":p?.search},...p?.hash&&{"http.fragment":p?.hash}}}):new rt;return l&&!g&&h?.recordDroppedEvent("no_parent_span","span"),o.__sentry_xhr_span_id__=m.spanContext().spanId,n[o.__sentry_xhr_span_id__]=m,r(c)&&Yy(o,Xe()&&g?m:void 0,i),h&&h.emit("beforeOutgoingRequestSpan",m,e),m}function Yy(e,t,r){const{"sentry-trace":n,baggage:i,traceparent:s}=sd({span:t,propagateTraceparent:r});n&&Xy(e,n,i,s)}function Xy(e,t,r,n){const i=e.__sentry_xhr_v3__?.request_headers;if(!(i?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),n&&!i?.traceparent&&e.setRequestHeader("traceparent",n),r){const s=i?.baggage;(!s||!jy(s))&&e.setRequestHeader("baggage",r)}}catch{}}function Ky(){H.document?H.document.addEventListener("visibilitychange",()=>{const e=qe();if(!e)return;const t=Ee(e);if(H.document.hidden&&t){const r="cancelled",{op:n,status:i}=K(t);Le&&E.log(`[Tracing] Transaction: ${r} -> since tab moved to the background, op: ${n}`),i||t.setStatus({code:2,message:r}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Le&&E.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var $d="sentry_previous_trace",Jy="sentry.previous_trace";function Zy(e,{linkPreviousTrace:t,consistentTraceSampling:r}){const n=t==="session-storage";let i=n?tb():void 0;e.on("spanStart",o=>{if(Ee(o)!==o)return;const a=te().getPropagationContext();i=Qy(i,o,a),n&&eb(i)});let s=!0;r&&e.on("beforeSampling",o=>{if(!i)return;const a=te(),c=a.getPropagationContext();if(s&&c.parentSpanId){s=!1;return}a.setPropagationContext({...c,dsc:{...c.dsc,sample_rate:String(i.sampleRate),sampled:String(ho(i.spanContext))},sampleRand:i.sampleRand}),o.parentSampled=ho(i.spanContext),o.parentSampleRate=i.sampleRate,o.spanAttributes={...o.spanAttributes,[qh]:i.sampleRate}})}function Qy(e,t,r){const n=K(t);function i(){try{return Number(r.dsc?.sample_rate)??Number(n.data?.["sentry.sample_rate"])}catch{return 0}}const s={spanContext:t.spanContext(),startTimestamp:n.start_timestamp,sampleRate:i(),sampleRand:r.sampleRand};if(!e)return s;const o=e.spanContext;return o.traceId===n.trace_id?e:(Date.now()/1e3-e.startTimestamp<=3600&&(Le&&E.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:n.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[Uh]:"previous_trace"}}),t.setAttribute(Jy,`${o.traceId}-${o.spanId}-${ho(o)?1:0}`)),s)}function eb(e){try{H.sessionStorage.setItem($d,JSON.stringify(e))}catch(t){Le&&E.warn("Could not store previous trace in sessionStorage",t)}}function tb(){try{const e=H.sessionStorage?.getItem($d);return JSON.parse(e)}catch{return}}function ho(e){return e.traceFlags===1}var rb="BrowserTracing",nb=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function ib(){const e=H.navigator;return e?.userAgent?nb.test(e.userAgent):!1}var sb={...si,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...Od},wS=((e={})=>{"enableElementTiming"in e&&tr(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const t={name:void 0,source:void 0},r=H.document,{enableInp:n,enableLongTask:i,enableLongAnimationFrame:s,_experiments:{enableInteractions:o,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:c},beforeStartSpan:u,idleTimeout:l,finalTimeout:d,childSpanTimeout:p,markBackgroundSpan:f,traceFetch:h,traceXHR:g,trackFetchStreamPerformance:m,shouldCreateSpanForRequest:w,enableHTTPTimings:P,ignoreResourceSpans:A,ignorePerformanceApiSpans:$,instrumentPageLoad:y,instrumentNavigation:R,detectRedirects:v,linkPreviousTrace:b,consistentTraceSampling:T,enableReportPageLoaded:C,onRequestSpanStart:L,onRequestSpanEnd:D}={...sb,...e},N=ib();let q,Z,J;function ue(M,z,X=!0){const W=z.op==="pageload",re=z.name,Q=u?u(z):z,he=Q.attributes||{};if(re!==Q.name&&(he[Rt]="custom",Q.attributes=he),!X){const Ke=rr();sr({...Q,startTime:Ke}).end(Ke);return}t.name=Q.name,t.source=he[Rt];const fe=ql(Q,{idleTimeout:l,finalTimeout:d,childSpanTimeout:p,disableAutoFinish:W,beforeSpanEnd:Ke=>{q?.();const Te=mt(M);rm(Ke,{recordClsOnPageloadSpan:!Te&&!a,recordLcpOnPageloadSpan:!Te&&!c,ignoreResourceSpans:A,ignorePerformanceApiSpans:$,spanStreamingEnabled:Te}),zc(M,void 0);const Je=te(),or=Je.getPropagationContext();Je.setPropagationContext({...or,traceId:fe.spanContext().traceId,sampled:Lt(fe),dsc:$t(Ke)}),W&&(J=void 0)},trimIdleSpanEndTimestamp:!C});W&&C&&(J=fe),zc(M,fe);function Ne(){r&&["interactive","complete"].includes(r.readyState)&&M.emit("idleSpanEnableAutoFinish",fe)}W&&!C&&r&&(r.addEventListener("readystatechange",()=>{Ne()}),Ne())}return{name:rb,setup(M){if(N){Le&&E.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}pf();const z=mt(M);if(q=Xv({recordClsStandaloneSpans:z?void 0:a||!1,recordLcpStandaloneSpans:z?void 0:c||!1,client:M}),z?(ym(M),Sm(M),n&&wm()):n&&fm(),s&&V.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?Jv():i&&Kv(),o&&Zv(),v&&r){const W=()=>{Z=_e()};addEventListener("click",W,{capture:!0}),addEventListener("keydown",W,{capture:!0,passive:!0})}function X(){const W=En(M);W&&!K(W).timestamp&&(Le&&E.log(`[Tracing] Finishing current active span with op: ${K(W).op}`),W.setAttribute(mi,"cancelled"),W.end())}M.on("startNavigationSpan",(W,re)=>{if(Y()!==M)return;if(re?.isRedirect){Le&&E.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),ue(M,{op:"navigation.redirect",...W},!1);return}Z=void 0,X(),nt().setPropagationContext({traceId:_t(),sampleRand:Math.random(),propagationSpanId:Xe()?void 0:pt()});const Q=te();Q.setPropagationContext({traceId:_t(),sampleRand:Math.random(),propagationSpanId:Xe()?void 0:pt()}),Q.setSDKProcessingMetadata({normalizedRequest:void 0}),ue(M,{op:"navigation",...W,parentSpan:null,forceTransaction:!0})}),M.on("startPageLoadSpan",(W,re={})=>{if(Y()!==M)return;X();const Q=re.sentryTrace||Bc("sentry-trace")||Wc("sentry-trace"),he=re.baggage||Bc("baggage")||Wc("baggage"),fe=sf(Q,he),Ne=te();Ne.setPropagationContext(fe),Xe()||(Ne.getPropagationContext().propagationSpanId=pt()),Ne.setSDKProcessingMetadata({normalizedRequest:Si()}),ue(M,{op:"pageload",...W})}),M.on("endPageloadSpan",()=>{C&&J&&(J.setAttribute(mi,"reportPageLoaded"),J.end())})},afterAllSetup(M){if(N)return;let z=Pn();if(b!=="off"&&Zy(M,{linkPreviousTrace:b,consistentTraceSampling:T}),H.location){if(y){const X=we();ob(M,{name:H.location.pathname,startTime:X?X/1e3:void 0,attributes:{[Rt]:"url",[ve]:"auto.pageload.browser"}})}R&&wa(({to:X,from:W})=>{if(W===void 0&&z?.indexOf(X)!==-1){z=void 0;return}z=void 0;const re=jl(X),Q=En(M),he=Q&&v&&ub(Q,Z);ab(M,{name:re?.pathname||H.location.pathname,attributes:{[Rt]:"url",[ve]:"auto.navigation.browser"}},{url:X,isRedirect:he})})}f&&Ky(),o&&cb(M,l,d,p,t),n&&mm(),Wy(M,{traceFetch:h,traceXHR:g,trackFetchStreamPerformance:m,tracePropagationTargets:M.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:w,enableHTTPTimings:P,onRequestSpanStart:L,onRequestSpanEnd:D})}}});function ob(e,t,r){e.emit("startPageLoadSpan",t,r),te().setTransactionName(t.name);const n=En(e);return n&&e.emit("afterStartPageLoadSpan",n),n}function ab(e,t,r){const{url:n,isRedirect:i}=r||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:i}),e.emit("startNavigationSpan",t,{isRedirect:i});const s=te();return s.setTransactionName(t.name),n&&!i&&s.setSDKProcessingMetadata({normalizedRequest:{...Si(),url:n}}),En(e)}function Bc(e){return H.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function Wc(e){return H.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(t=>t.name===e)?.description}function cb(e,t,r,n,i){const s=H.document;let o;const a=()=>{const c="ui.action.click",u=En(e);if(u){const l=K(u).op;if(["navigation","pageload"].includes(l)){Le&&E.warn(`[Tracing] Did not create ${c} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(mi,"interactionInterrupted"),o.end(),o=void 0),!i.name){Le&&E.warn(`[Tracing] Did not create ${c} transaction because _latestRouteName is missing.`);return}o=ql({name:i.name,op:c,attributes:{[Rt]:i.source||"url"}},{idleTimeout:t,finalTimeout:r,childSpanTimeout:n})};s&&addEventListener("click",a,{capture:!0})}var Nd="_sentry_idleSpan";function En(e){return e[Nd]}function zc(e,t){$e(e,Nd,t)}var Gc=1.5;function ub(e,t){const r=K(e),n=rr();return!(n-r.start_timestamp>Gc||t&&n-t<=Gc)}var lb=Jp(Zp());function TS(e){const t={...e};return id(t,"react"),Tg("react",{version:lb.version}),Hy(t)}var _=typeof window<"u"?window:void 0,ge=typeof globalThis<"u"?globalThis:_;typeof self>"u"&&(ge.self=ge),typeof File>"u"&&(ge.File=function(){});var Me=ge?.navigator,I=ge?.document,me=ge?.location,fo=ge?.fetch,go=ge!=null&&ge.XMLHttpRequest&&"withCredentials"in new ge.XMLHttpRequest?ge.XMLHttpRequest:void 0,Vc=ge?.AbortController,db=ge?.CompressionStream,Oe=Me?.userAgent,F=_??{},Yc="1.372.10",Pe={DEBUG:!1,LIB_VERSION:Yc,LIB_NAME:"web",JS_SDK_VERSION:Yc};function Xc(e,t,r,n,i,s,o){try{var a=e[s](o),c=a.value}catch(u){r(u);return}a.done?t(c):Promise.resolve(c).then(n,i)}function je(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var s=e.apply(t,r);function o(c){Xc(s,n,i,o,a,"next",c)}function a(c){Xc(s,n,i,o,a,"throw",c)}o(void 0)}))}}function S(){return S=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},S.apply(null,arguments)}function Fd(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function _o(){return _o=je((function*(e,t,r){t===void 0&&(t=!0);try{var n=new CompressionStream("gzip"),i=n.writable.getWriter(),s=i.write(new TextEncoder().encode(e)).then((()=>i.close())).catch((function(){var c=je((function*(u){try{yield i.abort(u)}catch{}throw u}));return function(u){return c.apply(this,arguments)}})()),o=new Response(n.readable).blob(),[a]=yield Promise.all([o,s]);return a}catch(c){if(r!=null&&r.rethrow)throw c;return t&&console.error("Failed to gzip compress data",c),null}})),_o.apply(this,arguments)}var pb=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Kc=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var r=e.toLowerCase();return pb.concat(t).some((n=>{var i=n.toLowerCase();return r.indexOf(i)!==-1}))},hb=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function j(e,t){return e.indexOf(t)!==-1}var Zi=function(e){return e.trim()},vo=function(e){return e.replace(/^\$/,"")},Md=Object.prototype,Ld=Md.hasOwnProperty,Qi=Md.toString,G=Array.isArray||function(e){return Qi.call(e)==="[object Array]"},ct=e=>typeof e=="function",de=e=>e===Object(e)&&!G(e),yr=e=>{if(de(e)){for(var t in e)if(Ld.call(e,t))return!1;return!0}return!1},k=e=>e===void 0,ce=e=>Qi.call(e)=="[object String]",li=e=>ce(e)&&e.trim().length===0,bt=e=>e===null,B=e=>k(e)||bt(e),Ge=e=>Qi.call(e)=="[object Number]"&&e==e,fr=e=>Ge(e)&&e>0,et=e=>Qi.call(e)==="[object Boolean]",fb=e=>e instanceof FormData,gb=e=>j(hb,e);function Dd(e){return e===null||typeof e!="object"}function Ii(e,t){return{}.toString.call(e)==="[object "+t+"]"}function Ta(e){return typeof Event<"u"&&(function(t,r){try{return t instanceof r}catch{return!1}})(e,Event)}var _b=[!0,"true",1,"1","yes"],ys=e=>j(_b,e),vb=[!1,"false",0,"0","no"];function tt(e,t,r,n,i){return t>r&&(n.warn("min cannot be greater than max."),t=r),Ge(e)?e>r?(n.warn(" cannot be greater than max: "+r+". Using max value instead."),r):t>e?(n.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(n.warn(" must be a number. using max or fallback. max: "+r+", fallback: "+i),tt(i||r,t,r,n))}var mb=class{constructor(e){this.$t={},this.zt=e.zt,this.Zt=tt(e.bucketSize,0,100,e.Gt),this.Qt=tt(e.refillRate,0,this.Zt,e.Gt),this.Jt=tt(e.refillInterval,0,864e5,e.Gt)}Kt(e,t){var r=Math.floor((t-e.lastAccess)/this.Jt);r>0&&(e.tokens=Math.min(e.tokens+r*this.Qt,this.Zt),e.lastAccess=e.lastAccess+r*this.Jt)}consumeRateLimit(e){var t,r=Date.now(),n=String(e),i=this.$t[n];return i?this.Kt(i,r):this.$t[n]=i={tokens:this.Zt,lastAccess:r},i.tokens===0||(i.tokens--,i.tokens===0&&((t=this.zt)==null||t.call(this,e)),i.tokens===0)}stop(){this.$t={}}},Xn,Jc,bs,De="Mobile",xi="iOS",lt="Android",Ar="Tablet",qd=lt+" "+Ar,Ud="iPad",Hd="Apple",jd=Hd+" Watch",un="Safari",Or="BlackBerry",Bd="Samsung",Wd=Bd+"Browser",zd=Bd+" Internet",Yt="Chrome",yb=Yt+" OS",Gd=Yt+" "+xi,Ia="Internet Explorer",Vd=Ia+" "+De,xa="Opera",bb=xa+" Mini",ka="Edge",Yd="Microsoft "+ka,wr="Firefox",Xd=wr+" "+xi,wn="Nintendo",Tn="PlayStation",Tr="Xbox",Kd=lt+" "+De,Jd=De+" "+un,Zr="Windows",mo=Zr+" Phone",Zc="Nokia",yo="Ouya",Zd="Generic",Sb=Zd+" "+De.toLowerCase(),Qd=Zd+" "+Ar.toLowerCase(),bo="Konqueror",xe="(\\d+(\\.\\d+)?)",Ss=new RegExp("Version/"+xe),Eb=new RegExp(Tr,"i"),wb=new RegExp(Tn+" \\w+","i"),Tb=new RegExp(wn+" \\w+","i"),Ra=new RegExp(Or+"|PlayBook|BB10","i"),Ib={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},ep=function(e,t){return t=t||"",j(e," OPR/")&&j(e,"Mini")?bb:j(e," OPR/")?xa:Ra.test(e)?Or:j(e,"IE"+De)||j(e,"WPDesktop")?Vd:j(e,Wd)?zd:j(e,ka)||j(e,"Edg/")?Yd:j(e,"FBIOS")?"Facebook "+De:j(e,"UCWEB")||j(e,"UCBrowser")?"UC Browser":j(e,"CriOS")?Gd:j(e,"CrMo")||j(e,Yt)?Yt:j(e,lt)&&j(e,un)?Kd:j(e,"FxiOS")?Xd:j(e.toLowerCase(),bo.toLowerCase())?bo:((r,n)=>n&&j(n,Hd)||(function(i){return j(i,un)&&!j(i,Yt)&&!j(i,lt)})(r))(e,t)?j(e,De)?Jd:un:j(e,wr)?wr:j(e,"MSIE")||j(e,"Trident/")?Ia:j(e,"Gecko")?wr:""},xb={[Vd]:[new RegExp("rv:"+xe)],[Yd]:[new RegExp(ka+"?\\/"+xe)],[Yt]:[new RegExp("("+Yt+"|CrMo)\\/"+xe)],[Gd]:[new RegExp("CriOS\\/"+xe)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+xe)],[un]:[Ss],[Jd]:[Ss],[xa]:[new RegExp("(Opera|OPR)\\/"+xe)],[wr]:[new RegExp(wr+"\\/"+xe)],[Xd]:[new RegExp("FxiOS\\/"+xe)],[bo]:[new RegExp("Konqueror[:/]?"+xe,"i")],[Or]:[new RegExp(Or+" "+xe),Ss],[Kd]:[new RegExp("android\\s"+xe,"i")],[zd]:[new RegExp(Wd+"\\/"+xe)],[Ia]:[new RegExp("(rv:|MSIE )"+xe)],Mozilla:[new RegExp("rv:"+xe)]},kb=function(e,t){var r=xb[ep(e,t)];if(k(r))return null;for(var n=0;r.length>n;n++){var i=e.match(r[n]);if(i)return parseFloat(i[i.length-2])}return null},Qc=[[new RegExp(Tr+"; "+Tr+" (.*?)[);]","i"),e=>[Tr,e&&e[1]||""]],[new RegExp(wn,"i"),[wn,""]],[new RegExp(Tn,"i"),[Tn,""]],[Ra,[Or,""]],[new RegExp(Zr,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[mo,""];if(new RegExp(De).test(t)&&!/IEMobile\b/.test(t))return[Zr+" "+De,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var n=Ib[r[1]]||"";return/arm/i.test(t)&&(n="RT"),[Zr,n]}return[Zr,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[xi,[e[3],e[4],e[5]||"0"].join(".")]:[xi,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=k(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+lt+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+lt+")","i"),e=>e&&e[2]?[lt,[e[2],e[3],e[4]||"0"].join(".")]:[lt,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[yb,""]],[/Linux|debian/i,["Linux",""]]],eu=function(e){return Tb.test(e)?wn:wb.test(e)?Tn:Eb.test(e)?Tr:new RegExp(yo,"i").test(e)?yo:new RegExp("("+mo+"|WPDesktop)","i").test(e)?mo:/iPad/.test(e)?Ud:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?jd:Ra.test(e)?Or:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Zc,"i").test(e)?Zc:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(De).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?lt:qd:new RegExp("(pda|"+De+")","i").test(e)?Sb:new RegExp(Ar,"i").test(e)&&!new RegExp(Ar+" pc","i").test(e)?Qd:""},Rb=e=>e instanceof Error,tp={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},Pb=tp.info;function rp(e){if(et(e))return{boolValue:e};if(typeof e=="number")return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if(typeof e=="string")return{stringValue:e};if(G(e))return{arrayValue:{values:e.map((t=>rp(t)))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function tu(e){var t=[];for(var r in e){var n=e[r];bt(n)||k(n)||t.push({key:r,value:rp(n)})}return t}function Cb(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return bs&&r.length===Jc||(Jc=r.length,bs=r.reduce(((n,i)=>{Xn||(Xn={});var s=Xn[i];if(s)n[s[0]]=s[1];else for(var o=e(i),a=o.length-1;a>=0;a--){var c=o[a],u=c?.filename,l=t[i];if(u&&l){n[u]=l,Xn[i]=[u,l];break}}return n}),{})),bs}}var Ab=class{constructor(e,t,r){r===void 0&&(r=[]),this.coercers=e,this.stackParser=t,this.modifiers=r}buildFromUnknown(e,t){t===void 0&&(t={});var r=t&&t.mechanism||{handled:!0,type:"generic"},n=this.buildCoercingContext(r,t,0).apply(e),i=this.buildParsingContext(t),s=this.parseStacktrace(n,i);return{$exception_list:this.convertToExceptionList(s,r),$exception_level:"error"}}modifyFrames(e){var t=this;return je((function*(){for(var r of e)r.stacktrace&&r.stacktrace.frames&&G(r.stacktrace.frames)&&(r.stacktrace.frames=yield t.applyModifiers(r.stacktrace.frames));return e}))()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:(t=e.syntheticException)==null?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var r,n;return e.cause!=null&&(r=this.parseStacktrace(e.cause,t)),e.stack!=""&&e.stack!=null&&(n=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),S({},e,{cause:r,stack:n})}applyChunkIds(e,t){return e.map((r=>(r.filename&&t&&(r.chunk_id=t[r.filename]),r)))}applyCoercers(e,t){for(var r of this.coercers)if(r.match(e))return r.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return je((function*(){var r=e;for(var n of t.modifiers)r=yield n(r);return r}))()}convertToExceptionList(e,t){var r,n,i,s={type:e.type,value:e.value,mechanism:{type:(r=t.type)!==null&&r!==void 0?r:"generic",handled:(n=t.handled)===null||n===void 0||n,synthetic:(i=e.synthetic)!==null&&i!==void 0&&i}};e.stack&&(s.stacktrace={type:"raw",frames:e.stack});var o=[s];return e.cause!=null&&o.push(...this.convertToExceptionList(e.cause,S({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:Cb(this.stackParser),skipFirstLines:(t=e.skipFirstLines)!==null&&t!==void 0?t:1}}buildCoercingContext(e,t,r){r===void 0&&(r=0);var n=(i,s)=>{if(4>=s){var o=this.buildCoercingContext(e,t,s);return this.applyCoercers(i,o)}};return S({},t,{syntheticException:r==0?t.syntheticException:void 0,mechanism:e,apply:i=>n(i,r),next:i=>n(i,r+1)})}},$r="?";function So(e,t,r,n,i){var s={platform:e,filename:t,function:r==="<anonymous>"?$r:r,in_app:!0};return k(n)||(s.lineno=n),k(i)||(s.colno=i),s}var np=(e,t)=>{var r=e.indexOf("safari-extension")!==-1,n=e.indexOf("safari-web-extension")!==-1;return r||n?[e.indexOf("@")!==-1?e.split("@")[0]:$r,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Ob=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,$b=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Nb=/\((\S*)(?::(\d+))(?::(\d+))\)/,Fb=(e,t)=>{var r=Ob.exec(e);if(r){var[,n,i,s]=r;return So(t,n,$r,+i,+s)}var o=$b.exec(e);if(o){if(o[2]&&o[2].indexOf("eval")===0){var a=Nb.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[c,u]=np(o[1]||$r,o[2]);return So(t,u,c,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Mb=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Lb=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Db=(e,t)=>{var r=Mb.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var n=Lb.exec(r[3]);n&&(r[1]=r[1]||"eval",r[3]=n[1],r[4]=n[2],r[5]="")}var i=r[3],s=r[1]||$r;return[s,i]=np(s,i),So(t,i,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},ru=/\(error: (.*)\)/,qb=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var r=ce(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:r?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return Ii(e,"DOMException")}isDOMError(e){return Ii(e,"DOMError")}},Ub=class{match(e){return(t=>t instanceof Error)(e)}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var r=e.message;return String(r.error&&typeof r.error.message=="string"?r.error.message:r)}getStack(e){return e.stacktrace||e.stack||void 0}},Hb=class{constructor(){}match(e){return Ii(e,"ErrorEvent")&&e.error!=null}coerce(e,t){var r;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:(r=t.syntheticException)==null?void 0:r.stack,synthetic:!0}}},jb=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Bb=class{match(e){return typeof e=="string"}coerce(e,t){var r,[n,i]=this.getInfos(e);return{type:n??"Error",value:i??e,stack:(r=t.syntheticException)==null?void 0:r.stack,synthetic:!0}}getInfos(e){var t="Error",r=e,n=e.match(jb);return n&&(t=n[1],r=n[2]),[t,r]}},Wb=["fatal","error","warning","log","info","debug"];function ip(e,t){t===void 0&&(t=40);var r=Object.keys(e);if(r.sort(),!r.length)return"[object has no keys]";for(var n=r.length;n>0;n--){var i=r.slice(0,n).join(", ");if(t>=i.length)return n===r.length?i:i.length>t?i.slice(0,t)+"...":i}return""}var zb=class{match(e){return typeof e=="object"&&e!==null}coerce(e,t){var r,n=this.getErrorPropertyFromObject(e);return n?t.apply(n):{type:this.getType(e),value:this.getValue(e),stack:(r=t.syntheticException)==null?void 0:r.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Ta(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var t="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&typeof e.message=="string")return e.message;var r=this.getObjectClassName(e);return(r&&r!=="Object"?"'"+r+"'":"Object")+" captured as exception with keys: "+ip(e)}isSeverityLevel(e){return ce(e)&&!li(e)&&Wb.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(Rb(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},Gb=class{match(e){return Ta(e)}coerce(e,t){var r,n=e.constructor.name;return{type:n,value:n+" captured as exception with keys: "+ip(e),stack:(r=t.syntheticException)==null?void 0:r.stack,synthetic:!0}}},Vb=class{match(e){return Dd(e)}coerce(e,t){var r;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(r=t.syntheticException)==null?void 0:r.stack,synthetic:!0}}},Yb=class{match(e){return Ii(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!Ta(e))return!1;try{var t=e.detail;return t!=null&&typeof t=="object"&&"reason"in t}catch{return!1}}coerce(e,t){var r,n=this.getUnhandledRejectionReason(e);return Dd(n)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(n),stack:(r=t.syntheticException)==null?void 0:r.stack,synthetic:!0}:t.apply(n)}getUnhandledRejectionReason(e){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}},ki="$message",Ri="$timestamp",Xb=new Set([ki,Ri]),Es={enabled:!0,max_bytes:32768};function Pi(e){var t;return e?{enabled:(t=e.enabled)!==null&&t!==void 0?t:Es.enabled,max_bytes:Jb(e.max_bytes,Es.max_bytes)}:S({},Es)}var Kb=class{constructor(e){this.Yt=[],this.Xt=0,this.qt=Pi(e)}setConfig(e){this.qt=Pi(e),this.er()}add(e){var t=(function(n){var i=(function(u){var l=new WeakSet;try{return JSON.stringify(u,((d,p)=>{if(typeof p=="bigint")return p.toString();if(typeof p!="function"&&typeof p!="symbol"){if(p instanceof Date)return p.toISOString();if(p instanceof Error)return{name:p.name,message:p.message,stack:p.stack};if(p&&typeof p=="object"){if(l.has(p))return"[Circular]";l.add(p)}return p}}))}catch{return}})(n);if(i)try{var s=JSON.parse(i);if(!de(s))return;var o=s,a=o[ki],c=o[Ri];return!ce(a)||a.trim().length===0||!ce(c)&&!Ge(c)?void 0:{step:o,json:i}}catch{return}})(e);if(t){var r=(function(n){if(typeof TextEncoder<"u")return new TextEncoder().encode(n).length;for(var i=encodeURIComponent(n),s=0,o=0;i.length>o;o++)i[o]==="%"?(s+=1,o+=2):s+=1;return s})(t.json);r>this.qt.max_bytes||(this.Yt.push({step:t.step,bytes:r}),this.Xt+=r,this.er())}}getAttachable(){return this.Yt.map((e=>e.step))}clear(){this.Yt=[],this.Xt=0}size(){return this.Yt.length}er(){for(;this.Xt>this.qt.max_bytes&&this.Yt.length>0;){var e=this.Yt.shift();e&&(this.Xt-=e.bytes)}}};function Jb(e,t){if(!Ge(e)||e===1/0||e===-1/0)return t;var r=Math.floor(e);return 0>r?t:r}var sp=function(e,t){var{debugEnabled:r}=t===void 0?{}:t,n={k(i){if(_&&(Pe.DEBUG||F.POSTHOG_DEBUG||r)&&!k(_.console)&&_.console){for(var s=("__rrweb_original__"in _.console[i])?_.console[i].__rrweb_original__:_.console[i],o=arguments.length,a=new Array(o>1?o-1:0),c=1;o>c;c++)a[c-1]=arguments[c];s(e,...a)}},debug(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];n.k("debug",...s)},info(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];n.k("log",...s)},warn(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];n.k("warn",...s)},error(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];n.k("error",...s)},critical(){for(var i=arguments.length,s=new Array(i),o=0;i>o;o++)s[o]=arguments[o];console.error(e,...s)},uninitializedWarning(i){n.error("You must initialize PostHog before calling "+i)},createLogger:(i,s)=>sp(e+" "+i,s)};return n},x=sp("[PostHog.js]"),oe=x.createLogger,Zb=oe("[ExternalScriptsLoader]"),ws=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return Zb.warn(t+" was requested but loading of external scripts is disabled."),r("Loading of external scripts is disabled");var n=I?.querySelectorAll("script");if(n){for(var i,s=function(){if(n[o].src===t){var c=n[o];return c.__posthog_loading_callback_fired?{v:r()}:(c.addEventListener("load",(u=>{c.__posthog_loading_callback_fired=!0,r(void 0,u)})),c.onerror=u=>r(u),{v:void 0})}},o=0;n.length>o;o++)if(i=s())return i.v}var a=()=>{if(!I)return r("document not found");var c=I.createElement("script");if(c.type="text/javascript",c.crossOrigin="anonymous",c.src=t,c.onload=d=>{c.__posthog_loading_callback_fired=!0,r(void 0,d)},c.onerror=d=>r(d),e.config.prepare_external_dependency_script&&(c=e.config.prepare_external_dependency_script(c)),!c)return r("prepare_external_dependency_script returned null");if(e.config.external_scripts_inject_target==="head")I.head.appendChild(c);else{var u,l=I.querySelectorAll("body > script");l.length>0?(u=l[0].parentNode)==null||u.insertBefore(c,l[0]):I.body.appendChild(c)}};I!=null&&I.body?a():I?.addEventListener("DOMContentLoaded",a)};F.__PosthogExtensions__=F.__PosthogExtensions__||{},F.__PosthogExtensions__.loadExternalDependency=(e,t,r)=>{if(t!=="remote-config"){var n;if(e.config.__preview_external_dependency_versioned_paths)n=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var i="/static/"+t+".js?v="+e.version;if(t==="toolbar"){var s=3e5;i=i+"&t="+Math.floor(Date.now()/s)*s}n=e.requestRouter.endpointFor("assets",i)}ws(e,n,r)}else ws(e,e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js"),r)},F.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{ws(e,e.requestRouter.endpointFor("api",t),r)};var op="$people_distinct_id",Ci="$device_id",Qr="__alias",en="__timers",Eo="$autocapture_disabled_server_side",wo="$heatmaps_enabled_server_side",To="$exception_capture_enabled_server_side",Io="$error_tracking_suppression_rules",xo="$error_tracking_capture_extension_exceptions",ko="$web_vitals_enabled_server_side",Pa="$dead_clicks_enabled_server_side",Ro="$product_tours_enabled_server_side",Po="$web_vitals_allowed_metrics",tn="$session_recording_remote_config",ap="$replay_override_sampling",cp="$replay_override_linked_flag",up="$replay_override_url_trigger",lp="$replay_override_event_trigger",Ai="$sesid",Ca="$session_is_sampled",br="$enabled_feature_flags",di="$active_feature_flags",rn="$early_access_features",Co="$feature_flag_details",Ao="$feature_flag_payloads",Oo="$feature_flag_request_id",ot="$override_feature_flags",gr="$override_feature_flag_payloads",nn="$stored_person_properties",jt="$stored_group_properties",$o="$surveys",No="$surveys_activated",pi="ph_product_tours",ln="$flag_call_reported",Fo="$flag_call_reported_session_id",Mo="$feature_flag_errors",Oi="$feature_flag_evaluated_at",Ve="$user_state",Lo="$client_session_props",Do="$capture_rate_limit",qo="$initial_campaign_params",Uo="$initial_referrer_info",$i="$initial_person_info",Ni="$epp",dp="__POSTHOG_TOOLBAR__",Kn="$posthog_cookieless",pp="$sdk_debug_extensions_init_method",hp="$sdk_debug_extensions_init_time_ms",fp="$sdk_debug_recording_script_not_loaded",Ho="PostHog loadExternalDependency extension not found.",Bt="on_reject",ut="always",ur="anonymous",lr="identified",jo="identified_only",Fi="visibilitychange",Mi="beforeunload",_r="$pageview",Ts="$pageleave",Is="$identify",nu="$groupidentify";function Jn(e,t){G(e)&&e.forEach(t)}function ne(e,t){if(!B(e))if(G(e))e.forEach(t);else if(fb(e))e.forEach(((n,i)=>t(n,i)));else for(var r in e)Ld.call(e,r)&&t(e[r],r)}var le=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;t>n;n++)r[n-1]=arguments[n];for(var i of r)for(var s in i)i[s]!==void 0&&(e[s]=i[s]);return e};function hi(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n}var iu=function(e){try{return e()}catch{return}},Qb=function(e){return function(){try{for(var t=arguments.length,r=new Array(t),n=0;t>n;n++)r[n]=arguments[n];return e.apply(this,r)}catch(i){x.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),x.critical(i)}}},Aa=function(e){var t={};return ne(e,(function(r,n){(ce(r)&&r.length>0||Ge(r))&&(t[n]=r)})),t},e0=["herokuapp.com","vercel.app","netlify.app"];function t0(e){var t=e?.hostname;if(!ce(t))return!1;var r=t.split(".").slice(-2).join(".");for(var n of e0)if(r===n)return!1;return!0}function pe(e,t,r,n){var{capture:i=!1,passive:s=!0}=n??{};e?.addEventListener(t,r,{capture:i,passive:s})}function gp(e){return e.name==="ph_toolbar_internal"}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return Ge(e)&&isFinite(e)&&Math.floor(e)===e});var r0=class Bo{constructor(t){if(this.bytes=t,t.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(t,r,n,i){if(!Number.isInteger(t)||!Number.isInteger(r)||!Number.isInteger(n)||!Number.isInteger(i)||0>t||0>r||0>n||0>i||t>0xffffffffffff||r>4095||n>1073741823||i>4294967295)throw new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/Math.pow(2,40),s[1]=t/Math.pow(2,32),s[2]=t/Math.pow(2,24),s[3]=t/Math.pow(2,16),s[4]=t/Math.pow(2,8),s[5]=t,s[6]=112|r>>>8,s[7]=r,s[8]=128|n>>>24,s[9]=n>>>16,s[10]=n>>>8,s[11]=n,s[12]=i>>>24,s[13]=i>>>16,s[14]=i>>>8,s[15]=i,new Bo(s)}toString(){for(var t="",r=0;this.bytes.length>r;r++)t=t+(this.bytes[r]>>>4).toString(16)+(15&this.bytes[r]).toString(16),r!==3&&r!==5&&r!==7&&r!==9||(t+="-");if(t.length!==36)throw new Error("Invalid UUIDv7 was generated");return t}clone(){return new Bo(this.bytes.slice(0))}equals(t){return this.compareTo(t)===0}compareTo(t){for(var r=0;16>r;r++){var n=this.bytes[r]-t.bytes[r];if(n!==0)return Math.sign(n)}return 0}},n0=class{constructor(){this.S=0,this.C=0,this.I=new i0}generate(){var e=this.generateOrAbort();if(k(e)){this.S=0;var t=this.generateOrAbort();if(k(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.T();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.T())}return r0.fromFieldsV7(this.S,Math.trunc(this.C/Math.pow(2,30)),this.C&Math.pow(2,30)-1,this.I.nextUint32())}T(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}},su,_p=e=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};_&&!k(_.crypto)&&crypto.getRandomValues&&(_p=e=>crypto.getRandomValues(e));var i0=class{constructor(){this.M=new Uint32Array(8),this.O=1/0}nextUint32(){return this.M.length>this.O||(_p(this.M),this.O=0),this.M[this.O++]}},kt=()=>s0().toString(),s0=()=>(su||(su=new n0)).generate(),Br="",o0=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Qe={R:()=>!!I,D(e){x.error("cookieStore error: "+e)},A(e){if(I){try{for(var t=e+"=",r=I.cookie.split(";").filter((s=>s.length)),n=0;r.length>n;n++){for(var i=r[n];i.charAt(0)==" ";)i=i.substring(1,i.length);if(i.indexOf(t)===0)return decodeURIComponent(i.substring(t.length,i.length))}}catch{}return null}},F(e){var t;try{t=JSON.parse(Qe.A(e))||{}}catch{}return t},N(e,t,r,n,i){if(I)try{var s="",o="",a=(function(l,d){if(d){var p=(function(h,g){if(g===void 0&&(g=I),Br)return Br;if(!g||["localhost","127.0.0.1"].includes(h))return"";for(var m=h.split("."),w=Math.min(m.length,8),P="dmn_chk_"+kt();!Br&&w--;){var A=m.slice(w).join("."),$=P+"=1;domain=."+A+";path=/";g.cookie=$+";max-age=3",g.cookie.includes(P)&&(g.cookie=$+";max-age=0",Br=A)}return Br})(l);if(!p){var f=(h=>{var g=h.match(o0);return g?g[0]:""})(l);f!==p&&x.info("Warning: cookie subdomain discovery mismatch",f,p),p=f}return p?"; domain=."+p:""}return""})(I.location.hostname,n);if(r){var c=new Date;c.setTime(c.getTime()+864e5*r),s="; expires="+c.toUTCString()}i&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&x.warn("cookieStore warning: large cookie, len="+u.length),I.cookie=u,u}catch{return}},q(e,t){if(I!=null&&I.cookie)try{Qe.N(e,"",-1,t)}catch{return}}},xs=null,ae={R(){if(!bt(xs))return xs;var e=!0;if(k(_))e=!1;else try{var t="__mplssupport__";ae.N(t,"xyz"),ae.A(t)!=='"xyz"'&&(e=!1),ae.q(t)}catch{e=!1}return e||x.error("localStorage unsupported; falling back to cookie store"),xs=e,e},D(e){x.error("localStorage error: "+e)},A(e){try{return _?.localStorage.getItem(e)}catch(t){ae.D(t)}return null},F(e){try{return JSON.parse(ae.A(e))||{}}catch{}return null},N(e,t){try{_?.localStorage.setItem(e,JSON.stringify(t))}catch(r){ae.D(r)}},q(e){try{_?.localStorage.removeItem(e)}catch(t){ae.D(t)}}},a0=[Ci,"distinct_id",Ai,Ca,Ni,$i,Ve],Zn={},c0={R:()=>!0,D(e){x.error("memoryStorage error: "+e)},A:e=>Zn[e]||null,F:e=>Zn[e]||null,N(e,t){Zn[e]=t},q(e){delete Zn[e]}},qt=null,ye={R(){if(!bt(qt))return qt;if(qt=!0,k(_))qt=!1;else try{var e="__support__";ye.N(e,"xyz"),ye.A(e)!=='"xyz"'&&(qt=!1),ye.q(e)}catch{qt=!1}return qt},D(e){x.error("sessionStorage error: ",e)},A(e){try{return _?.sessionStorage.getItem(e)}catch(t){ye.D(t)}return null},F(e){try{return JSON.parse(ye.A(e))||null}catch{}return null},N(e,t){try{_?.sessionStorage.setItem(e,JSON.stringify(t))}catch(r){ye.D(r)}},q(e){try{_?.sessionStorage.removeItem(e)}catch(t){ye.D(t)}}},u0=class{constructor(e){this._instance=e}get qt(){return this._instance.config}get consent(){return this.rr()?0:this.ir}isOptedOut(){return this.qt.cookieless_mode===ut||this.isRejected()||this.consent===-1&&this.qt.cookieless_mode===Bt}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}isRejected(){return this.consent===0||this.consent===-1&&this.qt.opt_out_capturing_by_default}optInOut(e){this.nr.N(this.sr,e?1:0,this.qt.cookie_expiration,this.qt.cross_subdomain_cookie,this.qt.secure_cookie)}reset(){this.nr.q(this.sr,this.qt.cross_subdomain_cookie)}get sr(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:r}=this._instance.config;return r||(t?t+e:"__ph_opt_in_out_"+e)}get ir(){var e=this.nr.A(this.sr);return ys(e)?1:j(vb,e)?0:-1}get nr(){var e=this.qt.opt_out_capturing_persistence_type,t=e==="localStorage"?ae:Qe;if(!this.ar||this.ar!==t){this.ar=t;var r=e==="localStorage"?Qe:ae;r.A(this.sr)&&(this.ar.A(this.sr)||this.optInOut(ys(r.A(this.sr))),r.q(this.sr,this.qt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.qt.respect_dnt&&[Me?.doNotTrack,Me?.msDoNotTrack,F.doNotTrack].some((e=>ys(e)))}},Qn=oe("[Dead Clicks]"),l0=()=>!0,d0=e=>{var t,r=!((t=e.instance.persistence)==null||!t.get_property(Pa)),n=e.instance.config.capture_dead_clicks;return et(n)?n:!!de(n)||r},ou=class{get lazyLoadedDeadClicksAutocapture(){return this.ur}constructor(e,t,r){this.instance=e,this.isEnabled=t,this.onCapture=r,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[Pa]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.lr((()=>{this.hr()})):this.stop()}lr(e){var t,r;(t=F.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(r=F.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"dead-clicks-autocapture",(n=>{n?Qn.error("failed to load script",n):e()}))}hr(){var e;if(I){if(!this.ur&&(e=F.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=de(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.ur=F.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.ur.start(I),Qn.info("starting...")}}else Qn.error("`document` not found. Cannot start.")}stop(){this.ur&&(this.ur.stop(),this.ur=void 0,Qn.info("stopping..."))}},ks=oe("[SegmentIntegration]"),vp="posthog-js";function mp(e,t){var{organization:r,projectId:n,prefix:i,severityAllowList:s=["error"],sendExceptionsToPostHog:o=!0}=t===void 0?{}:t;return a=>{var c,u,l,d,p;if(s!=="*"&&!s.includes(a.level)||!e.__loaded)return a;a.tags||(a.tags={});var f=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());a.tags["PostHog Person URL"]=f,e.sessionRecordingStarted()&&(a.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var h,g=((c=a.exception)==null?void 0:c.values)||[],m=g.map((P=>S({},P,{stacktrace:P.stacktrace?S({},P.stacktrace,{type:"raw",frames:(P.stacktrace.frames||[]).map((A=>S({},A,{platform:"web:javascript"})))}):void 0}))),w={$exception_message:((u=g[0])==null?void 0:u.value)||a.message,$exception_type:(l=g[0])==null?void 0:l.type,$exception_level:a.level,$exception_list:m,$sentry_event_id:a.event_id,$sentry_exception:a.exception,$sentry_exception_message:((d=g[0])==null?void 0:d.value)||a.message,$sentry_exception_type:(p=g[0])==null?void 0:p.type,$sentry_tags:a.tags};return r&&n&&(w.$sentry_url=(i||"https://sentry.io/organizations/")+r+"/issues/?project="+n+"&query="+a.event_id),o&&((h=e.exceptions)==null||h.sendExceptionEvent(w)),a}}var p0=class{constructor(e,t,r,n,i,s){this.name=vp,this.setupOnce=function(o){o(mp(e,{organization:t,projectId:r,prefix:n,severityAllowList:i,sendExceptionsToPostHog:s==null||s}))}}},au=class{constructor(e){this.cr=(t,r,n)=>{n&&(n.noSessionId||n.activityTimeout||n.sessionPastMaximumLength)&&(x.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:n}),this.dr=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.vr()}vr(){var e;this.pr=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.cr)}destroy(){var e;(e=this.pr)==null||e.call(this),this.pr=void 0}doPageView(e,t){var r,n=this.gr(e,t);return this.dr={pathname:(r=_?.location.pathname)!==null&&r!==void 0?r:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),n}doPageLeave(e){var t;return this.gr(e,(t=this.dr)==null?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.dr)==null?void 0:e.pageViewId}}gr(e,t){var r=this.dr;if(!r)return{$pageview_id:t};var n={$pageview_id:t,$prev_pageview_id:r.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:s,lastScrollY:o,maxScrollY:a,maxContentHeight:c,lastContentY:u,maxContentY:l}=i;if(!(k(s)||k(o)||k(a)||k(c)||k(u)||k(l))){s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),c=Math.ceil(c),u=Math.ceil(u),l=Math.ceil(l);var d=s>1?tt(o/s,0,1,x):1,p=s>1?tt(a/s,0,1,x):1,f=c>1?tt(u/c,0,1,x):1,h=c>1?tt(l/c,0,1,x):1;n=le(n,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:d,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:p,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:f,$prev_pageview_max_content:l,$prev_pageview_max_content_percentage:h})}}return r.pathname&&(n.$prev_pageview_pathname=r.pathname),r.timestamp&&(n.$prev_pageview_duration=(e.getTime()-r.timestamp.getTime())/1e3),n}},h0={[op]:{exposure:"hidden"},[Qr]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[en]:{exposure:"hidden"},[Eo]:{exposure:"event"},[wo]:{exposure:"hidden"},[To]:{exposure:"event"},[Io]:{exposure:"hidden"},[xo]:{exposure:"event"},[ko]:{exposure:"event"},[Pa]:{exposure:"event"},[Ro]:{exposure:"hidden"},[Po]:{exposure:"event"},[tn]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Ai]:{exposure:"hidden"},[Ca]:{exposure:"event"},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},[br]:{exposure:"derived",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!de(e))return{};for(var t={},r=Object.keys(e),n=0;r.length>n;n++)t["$feature/"+r[n]]=e[r[n]];return t}},[di]:{exposure:"event"},[rn]:{exposure:"hidden"},[Co]:{exposure:"hidden"},[Ao]:{exposure:"event"},[Oo]:{exposure:"event"},[ot]:{exposure:"event"},[gr]:{exposure:"hidden"},[nn]:{exposure:"hidden"},[jt]:{exposure:"hidden"},[$o]:{exposure:"hidden"},[No]:{exposure:"event"},[pi]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[ln]:{exposure:"hidden"},[Fo]:{exposure:"hidden"},[Mo]:{exposure:"hidden"},[Oi]:{exposure:"hidden"},[Ve]:{exposure:"hidden"},[Lo]:{exposure:"hidden"},[Do]:{exposure:"hidden"},[qo]:{exposure:"hidden"},[Uo]:{exposure:"hidden"},[$i]:{exposure:"hidden"},[Ni]:{exposure:"hidden"},[ap]:{exposure:"event"},[cp]:{exposure:"event"},[up]:{exposure:"event"},[lp]:{exposure:"event"},[pp]:{exposure:"event"},[hp]:{exposure:"event"},[fp]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},f0=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],Li=e=>{var t=I?.createElement("a");return k(t)?null:(t.href=e,t)},Di=function(e,t){for(var r,n=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),i=0;n.length>i;i++){var s=n[i].split("=");if(s[0]===t){r=s;break}}if(!G(r)||2>r.length)return"";var o=r[1];try{o=decodeURIComponent(o)}catch{x.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},In=function(e,t,r){if(!e||!t||!t.length)return e;for(var n=e.split("#"),i=n[1],s=(n[0]||"").split("?"),o=s[1],a=s[0],c=(o||"").split("&"),u=[],l=0;c.length>l;l++){var d=c[l].split("=");G(d)&&(t.includes(d[0])?u.push(d[0]+"="+r):u.push(c[l]))}var p=a;return o!=null&&(p+="?"+u.join("&")),i!=null&&(p+="#"+i),p},qi=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null},ei="https?://(.*)",Nr=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],g0=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Nr],xn="<masked>",_0=["li_fat_id"];function yp(e,t,r){if(!I)return{};var n,i=t?[...Nr,...r||[]]:[],s=bp(In(I.URL,i,xn),e);return le((n={},ne(_0,(function(o){var a=Qe.A(o);n[o]=a||null})),n),s)}function bp(e,t){var r=g0.concat(t||[]),n={};return ne(r,(function(i){n[i]=Di(e,i)||null})),n}function Sp(e){var t=(function(s){return s?s.search(ei+"google.([^/?]*)")===0?"google":s.search(ei+"bing.com")===0?"bing":s.search(ei+"yahoo.com")===0?"yahoo":s.search(ei+"duckduckgo.com")===0?"duckduckgo":null:null})(e),r=t!="yahoo"?"q":"p",n={};if(!bt(t)){n.$search_engine=t;var i=I?Di(I.referrer,r):"";i.length&&(n.ph_keyword=i)}return n}function cu(){return navigator.language||navigator.userLanguage}var Ui="$direct";function Ep(){return I?.referrer||Ui}function wp(e,t){var r=e?[...Nr,...t||[]]:[],n=me?.href.substring(0,1e3);return{r:Ep().substring(0,1e3),u:n?In(n,r,xn):void 0}}function Tp(e){var t,{r,u:n}=e,i={$referrer:r,$referring_domain:r==null?void 0:r==Ui?Ui:(t=Li(r))==null?void 0:t.host};if(n){i.$current_url=n;var s=Li(n);i.$host=s?.host,i.$pathname=s?.pathname,le(i,bp(n))}return r&&le(i,Sp(r)),i}function Ip(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function v0(){try{return new Date().getTimezoneOffset()}catch{return}}var m0=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],Rs=class{constructor(e,t){this.qt=e,this.props={},this.mr=!1,this.yr=(r=>{var n="";return r.token&&(n=r.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),r.persistence_name?"ph_"+r.persistence_name:"ph_"+n+"_posthog"})(e),this.nr=this.br(e),this.load(),e.debug&&x.info("Persistence loaded",e.persistence,S({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this._r}br(e){m0.indexOf(e.persistence.toLowerCase())===-1&&(x.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=(function(n){n===void 0&&(n=[]);var i=[...a0,...n];return S({},ae,{F(s){try{var o={};try{o=Qe.F(s)||{}}catch{}var a=le(o,JSON.parse(ae.A(s)||"{}"));return ae.N(s,a),a}catch{}return null},N(s,o,a,c,u,l){try{ae.N(s,o,void 0,void 0,l);var d={};i.forEach((p=>{o[p]&&(d[p]=o[p])})),Object.keys(d).length&&Qe.N(s,d,a,c,u,l)}catch(p){ae.D(p)}},q(s,o){try{_?.localStorage.removeItem(s),Qe.q(s,o)}catch(a){ae.D(a)}}})})(e.cookie_persisted_properties||[]),r=e.persistence.toLowerCase();return r==="localstorage"&&ae.R()?ae:r==="localstorage+cookie"&&t.R()?t:r==="sessionstorage"&&ye.R()?ye:r==="memory"?c0:r==="cookie"?Qe:t.R()?t:Qe}wr(e){var t=e??this.qt.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var r=this.props[Oi];return!r||typeof r!="number"||Date.now()-r>t}properties(){var e={};return ne(this.props,((t,r)=>{var n=(i=>{var s=h0[i];if(s)return s;for(var[o,a]of f0)if(i.indexOf(o)===0)return a})(r);if(n?.exposure==="derived"){if(n.shouldSkipFromEventProperties!=null&&n.shouldSkipFromEventProperties(t,r===br?()=>this.wr():()=>!1))return;n.transformToEventProperties&&le(e,n.transformToEventProperties(t))}else n&&n.exposure!=="event"||(e[r]=t)})),e}load(){if(!this._r){var e=this.nr.F(this.yr);e&&(this.props=le({},e))}}save(){this._r||this.nr.N(this.yr,this.props,this.Sr,this.kr,this.Cr,this.qt.debug)}remove(){this.nr.q(this.yr,!1),this.nr.q(this.yr,!0)}clear(){this.remove(),this.props={}}register_once(e,t,r){if(de(e)){k(t)&&(t="None"),this.Sr=k(r)?this.Ir:r;var n=!1;if(ne(e,((i,s)=>{this.props.hasOwnProperty(s)&&this.props[s]!==t||(this.Tr(s,i),n=!0)})),n)return this.save(),!0}return!1}register(e,t){if(de(e)){this.Sr=k(t)?this.Ir:t;var r=!1;if(ne(e,((n,i)=>{e.hasOwnProperty(i)&&this.props[i]!==n&&(this.Tr(i,n),r=!0)})),r)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Er(e),this.save())}update_campaign_params(){if(!this.mr){var e=yp(this.qt.custom_campaign_params,this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties);yr(Aa(e))||this.register(e),this.mr=!0}}update_search_keyword(){var e;this.register((e=I?.referrer)?Sp(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Ep(),$referring_domain:I!=null&&I.referrer&&((e=Li(I.referrer))==null?void 0:e.host)||Ui},void 0)}set_initial_person_info(){this.props[qo]||this.props[Uo]||this.register_once({[$i]:wp(this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};ne([Uo,qo],(i=>{var s=this.props[i];s&&ne(s,(function(o,a){e["$initial_"+vo(a)]=o}))}));var t,r,n=this.props[$i];return n&&le(e,(t=Tp(n),r={},ne(t,(function(i,s){r["$initial_"+vo(s)]=i})),r)),e}safe_merge(e){return ne(this.props,(function(t,r){r in e||(e[r]=t)})),e}update_config(e,t,r){if(this.Ir=this.Sr=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!r),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence||!((s,o)=>{if(s.length!==o.length)return!1;var a=[...s].sort(),c=[...o].sort();return a.every(((u,l)=>u===c[l]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var n=this.br(e),i=this.props;this.clear(),this.nr=n,this.props=i,this.save()}}set_disabled(e){this._r=e,this._r?this.remove():this.save()}set_cross_subdomain(e){e!==this.kr&&(this.kr=e,this.remove(),this.save())}set_secure(e){e!==this.Cr&&(this.Cr=e,this.remove(),this.save())}set_event_timer(e,t){var r=this.props[en]||{};r[e]=t,this.Tr(en,r),this.save()}remove_event_timer(e){var t=this.props[en]||{},r=t[e];return k(r)||(delete t[e],this.Tr(en,t),this.save()),r}get_property(e){return this.props[e]}set_property(e,t){this.Tr(e,t),this.save()}Tr(e,t){this.props[e]=t}Er(e){delete this.props[e]}},Wr={Activation:"events",Cancellation:"cancelEvents"},Ps={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},sn={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},Cs={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},Wo={Popover:"popover",Inline:"inline"},y0={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},uu={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},lu=oe("[RateLimiter]"),b0=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var r=t.text;if(r&&r.length)try{(JSON.parse(r).quota_limited||[]).forEach((n=>{lu.info((n||"events")+" is quota limited."),this.serverLimits[n]=new Date().getTime()+6e4}))}catch(n){lu.warn('could not rate limit - continuing. Error: "'+n?.message+'"',{text:r});return}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,r,n;e===void 0&&(e=!1);var{captureEventsBurstLimit:i,captureEventsPerSecond:s}=this,o=new Date().getTime(),a=(t=(r=this.instance.persistence)==null?void 0:r.get_property(Do))!==null&&t!==void 0?t:{tokens:i,last:o};a.tokens+=(o-a.last)/1e3*s,a.last=o,a.tokens>i&&(a.tokens=i);var c=1>a.tokens;return c||e||(a.tokens=Math.max(0,a.tokens-1)),!c||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+s+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=c,(n=this.instance.persistence)==null||n.set_property(Do,a),{isRateLimited:c,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}},zr=oe("[RemoteConfig]"),xp=class{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=F._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Mr(e){var t,r;(t=F.__PosthogExtensions__)!=null&&t.loadExternalDependency?(r=F.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}Pr(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return zr.info("Using preloaded remote config",this.remoteConfig),this.Rr(this.remoteConfig),void this.Or();if(this._instance.Lr())return void zr.warn("Remote config is disabled. Falling back to local config.");this.Mr((e=>{if(!e)return zr.info("No config found after loading remote JS config. Falling back to JSON."),void this.Pr((t=>{this.Rr(t),this.Or()}));this.Rr(e),this.Or()}))}catch(e){zr.error("Error loading remote config",e)}}stop(){this.Fr&&(clearInterval(this.Fr),this.Fr=void 0)}refresh(){this._instance.Lr()||I?.visibilityState==="hidden"||this._instance.reloadFeatureFlags()}Or(){var e;if(!this.Fr){var t=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;t!==0&&(this.Fr=setInterval((()=>{this.refresh()}),t))}}Rr(e){var t;e||zr.error("Failed to fetch remote config from PostHog."),this._instance.Rr(e??{}),e?.hasFeatureFlags!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(t=this._instance.featureFlags)==null||t.ensureFlagsLoaded())}},Ze={GZipJS:"gzip-js",Base64:"base64"},ze=Uint8Array,Ce=Uint16Array,Fr=Uint32Array,Oa=new ze([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),$a=new ze([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),du=new ze([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),kp=function(e,t){for(var r=new Ce(31),n=0;31>n;++n)r[n]=t+=1<<e[n-1];var i=new Fr(r[30]);for(n=1;30>n;++n)for(var s=r[n];r[n+1]>s;++s)i[s]=s-r[n]<<5|n;return[r,i]},Rp=kp(Oa,2),zo=Rp[1];Rp[0][28]=258,zo[258]=28;for(var pu=kp($a,0)[1],Go=new Ce(32768),ie=0;32768>ie;++ie){var dr=(43690&ie)>>>1|(21845&ie)<<1;Go[ie]=((65280&(dr=(61680&(dr=(52428&dr)>>>2|(13107&dr)<<2))>>>4|(3855&dr)<<4))>>>8|(255&dr)<<8)>>>1}var dn=function(e,t,r){for(var n=e.length,i=0,s=new Ce(t);n>i;++i)++s[e[i]-1];var o,a=new Ce(t);for(i=0;t>i;++i)a[i]=a[i-1]+s[i-1]<<1;if(r){o=new Ce(1<<t);var c=15-t;for(i=0;n>i;++i)if(e[i])for(var u=i<<4|e[i],l=t-e[i],d=a[e[i]-1]++<<l,p=d|(1<<l)-1;p>=d;++d)o[Go[d]>>>c]=u}else for(o=new Ce(n),i=0;n>i;++i)o[i]=Go[a[e[i]-1]++]>>>15-e[i];return o},Zt=new ze(288);for(ie=0;144>ie;++ie)Zt[ie]=8;for(ie=144;256>ie;++ie)Zt[ie]=9;for(ie=256;280>ie;++ie)Zt[ie]=7;for(ie=280;288>ie;++ie)Zt[ie]=8;var Hi=new ze(32);for(ie=0;32>ie;++ie)Hi[ie]=5;var S0=dn(Zt,9,0),E0=dn(Hi,5,0),Pp=function(e){return(e/8>>0)+(7&e&&1)},Cp=function(e,t,r){(r==null||r>e.length)&&(r=e.length);var n=new(e instanceof Ce?Ce:e instanceof Fr?Fr:ze)(r-t);return n.set(e.subarray(t,r)),n},it=function(e,t,r){var n=t/8>>0;e[n]|=r<<=7&t,e[n+1]|=r>>>8},Gr=function(e,t,r){var n=t/8>>0;e[n]|=r<<=7&t,e[n+1]|=r>>>8,e[n+2]|=r>>>16},As=function(e,t){for(var r=[],n=0;e.length>n;++n)e[n]&&r.push({s:n,f:e[n]});var i=r.length,s=r.slice();if(!i)return[new ze(0),0];if(i==1){var o=new ze(r[0].s+1);return o[r[0].s]=1,[o,1]}r.sort((function(y,R){return y.f-R.f})),r.push({s:-1,f:25001});var a=r[0],c=r[1],u=0,l=1,d=2;for(r[0]={s:-1,f:a.f+c.f,l:a,r:c};l!=i-1;)a=r[r[d].f>r[u].f?u++:d++],c=r[u!=l&&r[d].f>r[u].f?u++:d++],r[l++]={s:-1,f:a.f+c.f,l:a,r:c};var p=s[0].s;for(n=1;i>n;++n)s[n].s>p&&(p=s[n].s);var f=new Ce(p+1),h=Vo(r[l-1],f,0);if(h>t){n=0;var g=0,m=h-t,w=1<<m;for(s.sort((function(y,R){return f[R.s]-f[y.s]||y.f-R.f}));i>n;++n){var P=s[n].s;if(t>=f[P])break;g+=w-(1<<h-f[P]),f[P]=t}for(g>>>=m;g>0;){var A=s[n].s;t>f[A]?g-=1<<t-f[A]++-1:++n}for(;n>=0&&g;--n){var $=s[n].s;f[$]==t&&(--f[$],++g)}h=t}return[new ze(f),h]},Vo=function(e,t,r){return e.s==-1?Math.max(Vo(e.l,t,r+1),Vo(e.r,t,r+1)):t[e.s]=r},hu=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new Ce(++t),n=0,i=e[0],s=1,o=function(c){r[n++]=c},a=1;t>=a;++a)if(e[a]==i&&a!=t)++s;else{if(!i&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(i),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(i);s=1,i=e[a]}return[r.subarray(0,n),t]},Vr=function(e,t){for(var r=0,n=0;t.length>n;++n)r+=e[n]*t[n];return r},Yo=function(e,t,r){var n=r.length,i=Pp(t+2);e[i]=255&n,e[i+1]=n>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var s=0;n>s;++s)e[i+s+4]=r[s];return 8*(i+4+n)},fu=function(e,t,r,n,i,s,o,a,c,u,l){it(t,l++,r),++i[256];for(var d=As(i,15),p=d[0],f=d[1],h=As(s,15),g=h[0],m=h[1],w=hu(p),P=w[0],A=w[1],$=hu(g),y=$[0],R=$[1],v=new Ce(19),b=0;P.length>b;++b)v[31&P[b]]++;for(b=0;y.length>b;++b)v[31&y[b]]++;for(var T=As(v,7),C=T[0],L=T[1],D=19;D>4&&!C[du[D-1]];--D);var N,q,Z,J,ue=u+5<<3,M=Vr(i,Zt)+Vr(s,Hi)+o,z=Vr(i,p)+Vr(s,g)+o+14+3*D+Vr(v,C)+(2*v[16]+3*v[17]+7*v[18]);if(M>=ue&&z>=ue)return Yo(t,l,e.subarray(c,c+u));if(it(t,l,1+(M>z)),l+=2,M>z){N=dn(p,f,0),q=p,Z=dn(g,m,0),J=g;var X=dn(C,L,0);for(it(t,l,A-257),it(t,l+5,R-1),it(t,l+10,D-4),l+=14,b=0;D>b;++b)it(t,l+3*b,C[du[b]]);l+=3*D;for(var W=[P,y],re=0;2>re;++re){var Q=W[re];for(b=0;Q.length>b;++b)it(t,l,X[he=31&Q[b]]),l+=C[he],he>15&&(it(t,l,Q[b]>>>5&127),l+=Q[b]>>>12)}}else N=S0,q=Zt,Z=E0,J=Hi;for(b=0;a>b;++b)if(n[b]>255){var he;Gr(t,l,N[257+(he=n[b]>>>18&31)]),l+=q[he+257],he>7&&(it(t,l,n[b]>>>23&31),l+=Oa[he]);var fe=31&n[b];Gr(t,l,Z[fe]),l+=J[fe],fe>3&&(Gr(t,l,n[b]>>>5&8191),l+=$a[fe])}else Gr(t,l,N[n[b]]),l+=q[n[b]];return Gr(t,l,N[256]),l+q[256]},w0=new Fr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),T0=(function(){for(var e=new Fr(256),t=0;256>t;++t){for(var r=t,n=9;--n;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e})(),Os=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function I0(e,t){t===void 0&&(t={});var r=(function(){var d=4294967295;return{p(p){for(var f=d,h=0;p.length>h;++h)f=T0[255&f^p[h]]^f>>>8;d=f},d(){return 4294967295^d}}})(),n=e.length;r.p(e);var i,s,o,a,c,u=(a=10+((i=t).filename&&i.filename.length+1||0),c=8,(function(d,p,f,h,g,m){var w=d.length,P=new ze(h+w+5*(1+Math.floor(w/7e3))+g),A=P.subarray(h,P.length-g),$=0;if(!p||8>w)for(var y=0;w>=y;y+=65535){var R=y+65535;w>R?$=Yo(A,$,d.subarray(y,R)):(A[y]=!0,$=Yo(A,$,d.subarray(y,w)))}else{for(var v=w0[p-1],b=v>>>13,T=8191&v,C=(1<<f)-1,L=new Ce(32768),D=new Ce(C+1),N=Math.ceil(f/3),q=2*N,Z=function(ns){return(d[ns]^d[ns+1]<<N^d[ns+2]<<q)&C},J=new Fr(25e3),ue=new Ce(288),M=new Ce(32),z=0,X=0,W=(y=0,0),re=0,Q=0;w>y;++y){var he=Z(y),fe=32767&y,Ne=D[he];if(L[fe]=Ne,D[he]=fe,y>=re){var Ke=w-y;if((z>7e3||W>24576)&&Ke>423){$=fu(d,A,0,J,ue,M,X,W,Q,y-Q,$),W=z=X=0,Q=y;for(var Te=0;286>Te;++Te)ue[Te]=0;for(Te=0;30>Te;++Te)M[Te]=0}var Je=2,or=0,Gp=T,St=fe-Ne&32767;if(Ke>2&&he==Z(y-St))for(var Vp=Math.min(b,Ke)-1,Yp=Math.min(32767,y),Xp=Math.min(258,Ke);Yp>=St&&--Gp&&fe!=Ne;){if(d[y+Je]==d[y+Je-St]){for(var Et=0;Xp>Et&&d[y+Et]==d[y+Et-St];++Et);if(Et>Je){if(Je=Et,or=St,Et>Vp)break;var Kp=Math.min(St,Et-2),La=0;for(Te=0;Kp>Te;++Te){var rs=y-St+Te+32768&32767,Da=rs-L[rs]+32768&32767;Da>La&&(La=Da,Ne=rs)}}}St+=(fe=Ne)-(Ne=L[fe])+32768&32767}if(or){J[W++]=268435456|zo[Je]<<18|pu[or];var qa=31&zo[Je],Ua=31&pu[or];X+=Oa[qa]+$a[Ua],++ue[257+qa],++M[Ua],re=y+Je,++z}else J[W++]=d[y],++ue[d[y]]}}$=fu(d,A,!0,J,ue,M,X,W,Q,y-Q,$)}return Cp(P,0,h+Pp($)+g)})(s=e,(o=t).level==null?6:o.level,o.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+o.mem,a,c)),l=u.length;return(function(d,p){var f=p.filename;if(d[0]=31,d[1]=139,d[2]=8,d[8]=2>p.level?4:p.level==9?2:0,d[9]=3,p.mtime!=0&&Os(d,4,Math.floor(new Date(p.mtime||Date.now())/1e3)),f){d[3]=8;for(var h=0;f.length>=h;++h)d[h+10]=f.charCodeAt(h)}})(u,t),Os(u,l-8,r.d()),Os(u,l-4,n),u}var x0=!!go||!!fo,Ap="text/plain",gu=!1,es=function(e,t,r){var n;r===void 0&&(r=!0);var[i,s]=e.split("?"),o=S({},t),a=(n=s?.split("&").map((u=>{var l,[d,p]=u.split("="),f=r&&(l=o[d])!==null&&l!==void 0?l:p;return delete o[d],d+"="+f})))!==null&&n!==void 0?n:[],c=(function(u,l){var d,p;l===void 0&&(l="&");var f=[];return ne(u,(function(h,g){k(h)||k(g)||g==="undefined"||(d=encodeURIComponent((m=>m instanceof File)(h)?h.name:h.toString()),p=encodeURIComponent(g),f[f.length]=p+"="+d)})),f.join(l)})(o);return c&&a.push(c),i+"?"+a.join("&")},Sr=(e,t)=>JSON.stringify(e,((r,n)=>typeof n=="bigint"?n.toString():n),t),$s=e=>{if(e.tr)return e.tr;var{data:t,compression:r}=e;if(t){if(r===Ze.GZipJS){var n=I0((function(o,a){var c=o.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(o);for(var u=new ze(o.length+(o.length>>>1)),l=0,d=function(g){u[l++]=g},p=0;c>p;++p){if(l+5>u.length){var f=new ze(l+8+(c-p<<1));f.set(u),u=f}var h=o.charCodeAt(p);128>h?d(h):2048>h?(d(192|h>>>6),d(128|63&h)):h>55295&&57344>h?(d(240|(h=65536+(1047552&h)|1023&o.charCodeAt(++p))>>>18),d(128|h>>>12&63),d(128|h>>>6&63),d(128|63&h)):(d(224|h>>>12),d(128|h>>>6&63),d(128|63&h))}return Cp(u,0,l)})(Sr(t)),{mtime:0});return{contentType:Ap,body:n.buffer.slice(n.byteOffset,n.byteOffset+n.byteLength),estimatedSize:n.byteLength}}if(r===Ze.Base64){var i=(o=>"data="+encodeURIComponent(typeof o=="string"?o:Sr(o)))((function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,((a,c)=>String.fromCharCode(parseInt(c,16)))))})(Sr(t)));return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var s=Sr(t);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},k0=(function(){var e=je((function*(t){var r=yield(function(i,s,o){return _o.apply(this,arguments)})(Sr(t.data),Pe.DEBUG,{rethrow:!0});if(!r)return t;var n=yield r.arrayBuffer();return S({},t,{tr:{contentType:Ap,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}})(),_u=(e,t)=>es(e,{_:new Date().getTime().toString(),ver:Pe.JS_SDK_VERSION,compression:t}),fi=[];fo&&fi.push({transport:"fetch",method(e){var t,r,{contentType:n,body:i,estimatedSize:s}=(t=$s(e))!==null&&t!==void 0?t:{},o=new Headers;ne(e.headers,(function(l,d){o.append(d,l)})),n&&o.append("Content-Type",n);var a=e.url,c=null;if(Vc){var u=new Vc;c={signal:u.signal,timeout:setTimeout((()=>u.abort()),e.timeout)}}fo(a,S({method:e?.method||"GET",headers:o,keepalive:e.method==="POST"&&52428.8>(s||0),body:i,signal:(r=c)==null?void 0:r.signal},e.fetchOptions)).then((l=>l.text().then((d=>{var p={statusCode:l.status,text:d};if(l.status===200)try{p.json=JSON.parse(d)}catch(f){x.error(f)}e.callback==null||e.callback(p)})))).catch((l=>{x.error(l),e.callback==null||e.callback({statusCode:0,error:l})})).finally((()=>c?clearTimeout(c.timeout):null))}}),go&&fi.push({transport:"XHR",method(e){var t,r=new go;r.open(e.method||"GET",e.url,!0);var{contentType:n,body:i}=(t=$s(e))!==null&&t!==void 0?t:{};ne(e.headers,(function(s,o){r.setRequestHeader(o,s)})),n&&r.setRequestHeader("Content-Type",n),e.timeout&&(r.timeout=e.timeout),e.disableXHRCredentials||(r.withCredentials=!0),r.onreadystatechange=()=>{if(r.readyState===4){var s={statusCode:r.status,text:r.responseText};if(r.status===200)try{s.json=JSON.parse(r.responseText)}catch{}e.callback==null||e.callback(s)}},r.send(i)}}),Me!=null&&Me.sendBeacon&&fi.push({transport:"sendBeacon",method(e){var t=es(e.url,{beacon:"1"});try{var r,{contentType:n,body:i}=(r=$s(e))!==null&&r!==void 0?r:{};if(!i)return;var s=i instanceof Blob?i:new Blob([i],{type:n});Me.sendBeacon(t,s)}catch{}}});var Xo=3e3,R0=class{constructor(e,t){this.Ar=!0,this.Nr=[],this.$r=tt(t?.flush_interval_ms||Xo,250,5e3,x.createLogger("flush interval"),Xo),this.Dr=e}enqueue(e){this.Nr.push(e),this.qr||this.jr()}unload(){this.Hr();var e=this.Nr.length>0?this.Ur():{},t=Object.values(e);[...t.filter((r=>r.url.indexOf("/e")===0)),...t.filter((r=>r.url.indexOf("/e")!==0))].map((r=>{this.Dr(S({},r,{transport:"sendBeacon"}))}))}enable(){this.Ar=!1,this.jr()}jr(){var e=this;this.Ar||(this.qr=setTimeout((()=>{if(this.Hr(),this.Nr.length>0){var t=this.Ur(),r=function(){var i=t[n],s=new Date().getTime();i.data&&G(i.data)&&ne(i.data,(o=>{o.offset=Math.abs(o.timestamp-s),delete o.timestamp})),e.Dr(i)};for(var n in t)r()}}),this.$r))}Hr(){clearTimeout(this.qr),this.qr=void 0}Ur(){var e={};return ne(this.Nr,(t=>{var r,n=t,i=(n?n.batchKey:null)||n.url;k(e[i])&&(e[i]=S({},n,{data:[]})),(r=e[i].data)==null||r.push(n.data)})),this.Nr=[],e}},P0=["retriesPerformedSoFar"],C0=class{constructor(e){this.Br=!1,this.zr=3e3,this.Nr=[],this._instance=e,this.Nr=[],this.Vr=!0,!k(_)&&"onLine"in _.navigator&&(this.Vr=_.navigator.onLine,this.Wr=()=>{this.Vr=!0,this.Zr()},this.Gr=()=>{this.Vr=!1},pe(_,"online",this.Wr),pe(_,"offline",this.Gr))}get length(){return this.Nr.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,r=Fd(e,P0);fr(t)&&(r.url=es(r.url,{retry_count:t})),this._instance._send_request(S({},r,{callback:n=>{n.statusCode===200||n.statusCode>=400&&500>n.statusCode||(t??0)>=10?r.callback==null||r.callback(n):this.Qr(S({retriesPerformedSoFar:t},r))}}))}Qr(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var r=(function(s){var o=3e3*Math.pow(2,s),a=o/2,c=Math.min(18e5,o),u=Math.random()-.5;return Math.ceil(c+u*(c-a))})(t),n=Date.now()+r;this.Nr.push({retryAt:n,requestOptions:e});var i="Enqueued failed request for retry in "+r;navigator.onLine||(i+=" (Browser is offline)"),x.warn(i),this.Br||(this.Br=!0,this.Jr())}Jr(){if(this.Kr&&clearTimeout(this.Kr),this.Nr.length===0)return this.Br=!1,void(this.Kr=void 0);this.Kr=setTimeout((()=>{this.Vr&&this.Nr.length>0&&this.Zr(),this.Jr()}),this.zr)}Zr(){var e=Date.now(),t=[],r=this.Nr.filter((i=>e>i.retryAt||(t.push(i),!1)));if(this.Nr=t,r.length>0)for(var{requestOptions:n}of r)this.retriableRequest(n)}unload(){for(var{requestOptions:e}of(this.Kr&&(clearTimeout(this.Kr),this.Kr=void 0),this.Br=!1,k(_)||(this.Wr&&(_.removeEventListener("online",this.Wr),this.Wr=void 0),this.Gr&&(_.removeEventListener("offline",this.Gr),this.Gr=void 0)),this.Nr))try{this._instance._send_request(S({},e,{transport:"sendBeacon"}))}catch(t){x.error(t)}this.Nr=[]}},A0=class{constructor(e){this.Yr=()=>{var t,r,n,i;this.Xr||(this.Xr={});var s=this.scrollElement(),o=this.scrollY(),a=s?Math.max(0,s.scrollHeight-s.clientHeight):0,c=o+(s?.clientHeight||0),u=s?.scrollHeight||0;this.Xr.lastScrollY=Math.ceil(o),this.Xr.maxScrollY=Math.max(o,(t=this.Xr.maxScrollY)!==null&&t!==void 0?t:0),this.Xr.maxScrollHeight=Math.max(a,(r=this.Xr.maxScrollHeight)!==null&&r!==void 0?r:0),this.Xr.lastContentY=c,this.Xr.maxContentY=Math.max(c,(n=this.Xr.maxContentY)!==null&&n!==void 0?n:0),this.Xr.maxContentHeight=Math.max(u,(i=this.Xr.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=e}get ei(){return this._instance.config.scroll_root_selector}getContext(){return this.Xr}resetContext(){var e=this.Xr;return setTimeout(this.Yr,0),e}startMeasuringScrollPosition(){pe(_,"scroll",this.Yr,{capture:!0}),pe(_,"scrollend",this.Yr,{capture:!0}),pe(_,"resize",this.Yr)}scrollElement(){if(!this.ei)return _?.document.documentElement;for(var e of G(this.ei)?this.ei:[this.ei]){var t=_?.document.querySelector(e);if(t)return t}}scrollY(){if(this.ei){var e=this.scrollElement();return e&&e.scrollTop||0}return _&&(_.scrollY||_.pageYOffset||_.document.documentElement.scrollTop)||0}scrollX(){if(this.ei){var e=this.scrollElement();return e&&e.scrollLeft||0}return _&&(_.scrollX||_.pageXOffset||_.document.documentElement.scrollLeft)||0}},O0=e=>wp(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties),vu=class{constructor(e,t,r,n){this.ti=i=>{var s=this.ri();if(!s||s.sessionId!==i){var o={sessionId:i,props:this.ii(this._instance)};this.ni.register({[Lo]:o})}},this._instance=e,this.si=t,this.ni=r,this.ii=n||O0,this.si.onSessionId(this.ti)}ri(){return this.ni.props[Lo]}getSetOnceProps(){var e,t=(e=this.ri())==null?void 0:e.props;return t?"r"in t?Tp(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return ne(Aa(this.getSetOnceProps()),((t,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+vo(r)]=t})),e}},Na=class{constructor(){this.oi={}}on(e,t){return this.oi[e]||(this.oi[e]=[]),this.oi[e].push(t),()=>{this.oi[e]=this.oi[e].filter((r=>r!==t))}}emit(e,t){for(var r of this.oi[e]||[])r(t);for(var n of this.oi["*"]||[])n(e,t)}},Ns=oe("[SessionId]"),mu=class{on(e,t){return this.ai.on(e,t)}constructor(e,t,r){var n;if(this.ui=[],this.li=void 0,this.ai=new Na,this.hi=(c,u)=>!(!fr(c)||!fr(u))&&Math.abs(c-u)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===ut)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.qt=e.config,this.ni=e.persistence,this.ci=void 0,this.di=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.vi=t||kt,this.fi=r||kt;var i=this.qt.persistence_name||this.qt.token;if(this._sessionTimeoutMs=1e3*tt(this.qt.session_idle_timeout_seconds||1800,60,36e3,Ns.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.pi(),this.gi="ph_"+i+"_window_id",this.mi="ph_"+i+"_primary_window_exists",this.yi()){var s=ye.F(this.gi),o=ye.F(this.mi);s&&!o?this.ci=s:ye.q(this.gi),ye.N(this.mi,!0)}if((n=this.qt.bootstrap)!=null&&n.sessionID)try{var a=(c=>{var u=this.qt.bootstrap.sessionID.replace(/-/g,"");if(u.length!==32)throw new Error("Not a valid UUID");if(u[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(u.substring(0,12),16)})();this.bi(this.qt.bootstrap.sessionID,new Date().getTime(),a)}catch(c){Ns.error("Invalid sessionID in bootstrap",c)}this.wi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return k(this.ui)&&(this.ui=[]),this.ui.push(e),this.di&&e(this.di,this.ci),()=>{this.ui=this.ui.filter((t=>t!==e))}}yi(){return this.qt.persistence!=="memory"&&!this.ni._r&&ye.R()}xi(e){e!==this.ci&&(this.ci=e,this.yi()&&ye.N(this.gi,e))}Si(){return this.ci?this.ci:this.yi()?ye.F(this.gi):null}bi(e,t,r){e===this.di&&t===this._sessionActivityTimestamp&&r===this._sessionStartTimestamp||(this._sessionStartTimestamp=r,this._sessionActivityTimestamp=t,this.di=e,this.ni.register({[Ai]:[t,e,r]}))}ki(){var e=this.ni.props[Ai];return G(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.bi(null,null,null)}destroy(){clearTimeout(this.Ci),this.Ci=void 0,this.li&&_&&(_.removeEventListener(Mi,this.li,{capture:!1}),this.li=void 0),this.ui=[]}wi(){this.li=()=>{this.yi()&&ye.q(this.mi)},pe(_,Mi,this.li,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.qt.cookieless_mode===ut)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var r=t||new Date().getTime(),[n,i,s]=this.ki(),o=this.Si(),a=fr(s)&&Math.abs(r-s)>864e5,c=!1,u=!i,l=!u&&!e&&this.hi(r,n);u||l||a?(i=this.vi(),o=this.fi(),Ns.info("new session ID generated",{sessionId:i,windowId:o,changeReason:{noSessionId:u,activityTimeout:l,sessionPastMaximumLength:a}}),s=r,c=!0):o||(o=this.fi(),c=!0);var d=fr(n)&&e&&!a?n:r,p=fr(s)?s:new Date().getTime();return this.xi(o),this.bi(i,d,p),e||this.pi(),c&&this.ui.forEach((f=>f(i,o,c?{noSessionId:u,activityTimeout:l,sessionPastMaximumLength:a}:void 0))),{sessionId:i,windowId:o,sessionStartTimestamp:p,changeReason:c?{noSessionId:u,activityTimeout:l,sessionPastMaximumLength:a}:void 0,lastActivityTimestamp:n}}pi(){clearTimeout(this.Ci),this.Ci=setTimeout((()=>{var[e]=this.ki();if(this.hi(new Date().getTime(),e)){var t=this.di;this.resetSessionId(),this.ai.emit("forcedIdleReset",{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}},Op=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&Kc(r,t))return!0;try{var n=e?.userAgentData;if(n!=null&&n.brands&&n.brands.some((i=>Kc(i?.brand,t))))return!0}catch{}return!!e.webdriver},ji=function(e,t){if(!(function(r){try{new RegExp(r)}catch{return!1}return!0})(t))return!1;try{return new RegExp(t).test(e)}catch{return!1}};function yu(e,t,r){return Sr({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var $p={exact:(e,t)=>t.some((r=>e.some((n=>r===n)))),is_not:(e,t)=>t.every((r=>e.every((n=>r!==n)))),regex:(e,t)=>t.some((r=>e.some((n=>ji(r,n))))),not_regex:(e,t)=>t.every((r=>e.every((n=>!ji(r,n))))),icontains:(e,t)=>t.map(ti).some((r=>e.map(ti).some((n=>r.includes(n))))),not_icontains:(e,t)=>t.map(ti).every((r=>e.map(ti).every((n=>!r.includes(n))))),gt:(e,t)=>t.some((r=>{var n=parseFloat(r);return!isNaN(n)&&e.some((i=>n>parseFloat(i)))})),lt:(e,t)=>t.some((r=>{var n=parseFloat(r);return!isNaN(n)&&e.some((i=>n<parseFloat(i)))}))},ti=e=>e.toLowerCase();function Np(e,t){return!e||Object.entries(e).every((r=>{var[n,i]=r,s=t?.[n];if(k(s)||bt(s))return!1;var o=[String(s)],a=$p[i.operator];return!!a&&a(i.values,o)}))}var Ko="custom",bu="i.posthog.com",$0=/^\/static\//,N0=class{constructor(e){this.Ii={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+bu,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.Ii[this.apiHost]||(this.Ii[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":Ko),this.Ii[this.apiHost]}Ti(e){var t=this.instance.config.__preview_external_dependency_versioned_paths;if(typeof t=="string"&&$0.test(e))return t.trim().replace(/\/$/,"")||void 0}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(e==="flags")return this.flagsApiHost+t;if(e==="assets"){var r=this.Ti(t);if(r)return""+r+t}if(this.region===Ko)return this.apiHost+t;var n=bu+t;switch(e){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}}},ee=oe("[Surveys]"),Jo="seenSurvey_",F0=[Ps.Popover,Ps.Widget,Ps.API],M0={ignoreConditions:!1,ignoreDelay:!1,displayType:Wo.Popover},L0=oe("[PostHog ExternalIntegrations]"),D0={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},q0=class{constructor(e){this._instance=e}lr(e,t){var r;(r=F.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,e,(n=>{if(n)return L0.error("failed to load script",n);t()}))}startIfEnabledOrStop(){var e=this,t=function(s){var o,a,c;!n||(o=F.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[s]||e.lr(D0[s],(()=>{var u;(u=F.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[s])==null||u.start(e._instance)})),!n&&(a=F.__PosthogExtensions__)!=null&&(a=a.integrations)!=null&&a[s]&&((c=F.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[s])==null||c.stop())};for(var[r,n]of Object.entries((i=this._instance.config.integrations)!==null&&i!==void 0?i:{})){var i;t(r)}}},pr,pn={},Fs=0,Zo=()=>{},Su='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Yr="Surveys module not available",Eu="sanitize_properties is deprecated. Use before_send instead",Fp="Invalid value for property_denylist config: ",vr="posthog",Mp=!x0&&Oe?.indexOf("MSIE")===-1&&Oe?.indexOf("Mozilla")===-1,wu=e=>{var t;return S({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:t0(I?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Zo,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:e??"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,debug:me&&ce(me?.search)&&me.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(_==null||(t=_.location)==null?void 0:t.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(r){x.error("Bad HTTP status: "+r.statusCode+" "+r.text)},get_device_id:r=>r,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:jo,before_send:void 0,request_queue_config:{flush_interval_ms:Xo},error_tracking:{},_onCapture:Zo,__preview_eager_load_replay:!1},(r=>({rageclick:!r||"2025-11-30">r||{content_ignorelist:!0},capture_pageview:!r||"2025-05-24">r||"history_change",session_recording:r&&r>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:r&&r>="2026-01-30"?"head":"body",internal_or_test_user_hostname:r&&r>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(e))},U0=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],Tu=e=>{var t={};for(var[r,n]of U0)k(e[r])||(t[n]=e[r]);var i=le({},t,e);return G(e.property_blacklist)&&(k(e.property_denylist)?i.property_denylist=e.property_blacklist:G(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:x.error(Fp+e.property_denylist)),i},H0=class{constructor(){this.__forceAllowLocalhost=!1}get Ei(){return this.__forceAllowLocalhost}set Ei(e){x.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},hn=class Wt{Mi(t,r){if(t){var n=this.Pi.indexOf(t);n!==-1&&this.Pi.splice(n,1)}return this.Pi.push(r),r.initialize==null||r.initialize(),r}Ri(){return this.config.cookieless_mode===ut||this.config.cookieless_mode===Bt&&this.consent.isRejected()}get decideEndpointWasHit(){var t,r;return(t=(r=this.featureFlags)==null?void 0:r.hasLoadedFlags)!==null&&t!==void 0&&t}get flagsEndpointWasHit(){var t,r;return(t=(r=this.featureFlags)==null?void 0:r.hasLoadedFlags)!==null&&t!==void 0&&t}constructor(){var t;this.webPerformance=new H0,this.Oi=!1,this.version=Pe.LIB_VERSION,this.Li=new Na,this.Pi=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=wu(),this.SentryIntegration=p0,this.sentryIntegration=n=>(function(i,s){var o=mp(i,s);return{name:vp,processEvent:a=>o(a)}})(this,n),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Fi=!1,this.Ai=null,this.Ni=null,this.$i=null,this.scrollManager=new A0(this),this.pageViewManager=new au(this),this.rateLimiter=new b0(this),this.requestRouter=new N0(this),this.consent=new u0(this),this.externalIntegrations=new q0(this);var r=(t=Wt.__defaultExtensionClasses)!==null&&t!==void 0?t:{};this.featureFlags=r.featureFlags&&new r.featureFlags(this),this.toolbar=r.toolbar&&new r.toolbar(this),this.surveys=r.surveys&&new r.surveys(this),this.conversations=r.conversations&&new r.conversations(this),this.logs=r.logs&&new r.logs(this),this.experiments=r.experiments&&new r.experiments(this),this.exceptions=r.exceptions&&new r.exceptions(this),this.people={set:(n,i,s)=>{var o=ce(n)?{[n]:i}:n;this.setPersonProperties(o),s?.({})},set_once:(n,i,s)=>{var o=ce(n)?{[n]:i}:n;this.setPersonProperties(void 0,o),s?.({})}},this.on("eventCaptured",(n=>x.info('send "'+n?.event+'"',n)))}init(t,r,n){if(n&&n!==vr){var i,s=(i=pn[n])!==null&&i!==void 0?i:new Wt;return s._init(t,r,n),pn[n]=s,pn[vr][n]=s,s}return this._init(t,r,n)}_init(t,r,n){var i,s;if(r===void 0&&(r={}),k(t)||li(t))return x.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},r.debug=this.Di(r.debug),this.qi=r,this.ji=[],r.person_profiles?this.Ni=r.person_profiles:r.process_person&&(this.Ni=r.process_person),this.set_config(le({},wu(r.defaults),Tu(r),{name:n,token:t})),this.config.on_xhr_error&&x.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=r.disable_compression?void 0:Ze.GZipJS;var o=this.Hi();this.persistence=new Rs(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Rs(S({},this.config,{persistence:"sessionStorage"}),o);var a=S({},this.persistence.props),c=S({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Ui=new R0((m=>this.Bi(m)),this.config.request_queue_config),this.zi=new C0(this),this.__request_queue=[];var u=this.Ri();if(u||(this.sessionManager=new mu(this),this.sessionPropsManager=new vu(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(x.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Vi(u)}),0)):(x.info("Initializing extensions synchronously"),this.Vi(u)),Pe.DEBUG=Pe.DEBUG||this.config.debug,Pe.DEBUG&&x.info("Starting in debug mode",{this:this,config:r,thisC:S({},this.config),p:a,s:c}),!this.config.identity_distinct_id||(i=r.bootstrap)!=null&&i.distinctID||(r.bootstrap=S({},r.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),((s=r.bootstrap)==null?void 0:s.distinctID)!==void 0){var l=r.bootstrap.distinctID,d=this.get_distinct_id(),p=this.persistence.get_property(Ve);if(r.bootstrap.isIdentifiedID&&d!=null&&d!==l&&p===ur)this.identify(l);else if(r.bootstrap.isIdentifiedID&&d!=null&&d!==l&&p===lr)x.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var f=this.config.get_device_id(kt()),h=r.bootstrap.isIdentifiedID?f:l;this.persistence.set_property(Ve,r.bootstrap.isIdentifiedID?lr:ur),this.register({distinct_id:l,$device_id:h})}}if(u)this.register_once({distinct_id:Kn,$device_id:null},"");else if(!this.get_distinct_id()){var g=this.config.get_device_id(kt());this.register_once({distinct_id:g,$device_id:g},""),this.persistence.set_property(Ve,ur)}return pe(_,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),r.segment?(function(m,w){var P=m.config.segment;if(!P)return w();(function(A,$){var y=A.config.segment;if(!y)return $();var R=b=>{var T=()=>b.anonymousId()||kt();A.config.get_device_id=T,b.id()&&(A.register({distinct_id:b.id(),$device_id:T()}),A.persistence.set_property(Ve,lr)),$()},v=y.user();"then"in v&&ct(v.then)?v.then(R):R(v)})(m,(()=>{P.register((A=>{Promise&&Promise.resolve||ks.warn("This browser does not have Promise support, and can not use the segment integration");var $=(y,R)=>{if(!R)return y;y.event.userId||y.event.anonymousId===A.get_distinct_id()||(ks.info("No userId set, resetting PostHog"),A.reset()),y.event.userId&&y.event.userId!==A.get_distinct_id()&&(ks.info("UserId set, identifying with PostHog"),A.identify(y.event.userId));var v=A.calculateEventProperties(R,y.event.properties);return y.event.properties=Object.assign({},v,y.event.properties),y};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:y=>$(y,y.event.event),page:y=>$(y,_r),identify:y=>$(y,Is),screen:y=>$(y,"$screen")}})(m)).then((()=>{w()}))}))})(this,(()=>this.Wi())):this.Wi(),ct(this.config._onCapture)&&this.config._onCapture!==Zo&&(x.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(m=>this.config._onCapture(m.event,m)))),this.config.ip&&x.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Vi(t){var r,n,i,s,o,a,c,u=performance.now(),l=S({},Wt.__defaultExtensionClasses,this.config.__extensionClasses),d=[];l.featureFlags&&this.Pi.push(this.featureFlags=(r=this.featureFlags)!==null&&r!==void 0?r:new l.featureFlags(this)),l.exceptions&&this.Pi.push(this.exceptions=(n=this.exceptions)!==null&&n!==void 0?n:new l.exceptions(this)),l.historyAutocapture&&this.Pi.push(this.historyAutocapture=new l.historyAutocapture(this)),l.tracingHeaders&&this.Pi.push(new l.tracingHeaders(this)),l.siteApps&&this.Pi.push(this.siteApps=new l.siteApps(this)),l.sessionRecording&&!t&&this.Pi.push(this.sessionRecording=new l.sessionRecording(this)),this.config.disable_scroll_properties||d.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),l.autocapture&&this.Pi.push(this.autocapture=new l.autocapture(this)),l.surveys&&this.Pi.push(this.surveys=(i=this.surveys)!==null&&i!==void 0?i:new l.surveys(this)),l.logs&&this.Pi.push(this.logs=(s=this.logs)!==null&&s!==void 0?s:new l.logs(this)),l.conversations&&this.Pi.push(this.conversations=(o=this.conversations)!==null&&o!==void 0?o:new l.conversations(this)),l.productTours&&this.Pi.push(this.productTours=new l.productTours(this)),l.heatmaps&&this.Pi.push(this.heatmaps=new l.heatmaps(this)),l.webVitalsAutocapture&&this.Pi.push(this.webVitalsAutocapture=new l.webVitalsAutocapture(this)),l.exceptionObserver&&this.Pi.push(this.exceptionObserver=new l.exceptionObserver(this)),l.deadClicksAutocapture&&this.Pi.push(this.deadClicksAutocapture=new l.deadClicksAutocapture(this,d0)),l.toolbar&&this.Pi.push(this.toolbar=(a=this.toolbar)!==null&&a!==void 0?a:new l.toolbar(this)),l.experiments&&this.Pi.push(this.experiments=(c=this.experiments)!==null&&c!==void 0?c:new l.experiments(this)),this.Pi.forEach((p=>{p.initialize&&d.push((()=>{p.initialize==null||p.initialize()}))})),d.push((()=>{if(this.Zi){var p=this.Zi;this.Zi=void 0,this.Rr(p)}})),this.Gi(d,u)}Gi(t,r){for(;t.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-r>=30&&t.length>0)return void setTimeout((()=>{this.Gi(t,r)}),0);var n=t.shift();if(n)try{n()}catch(s){x.error("Error initializing extension:",s)}}var i=Math.round(performance.now()-r);this.register_for_session({[pp]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[hp]:i}),this.config.__preview_deferred_init_extensions&&x.info("PostHog extensions initialized ("+i+"ms)")}Rr(t){var r;if(!I||!I.body)return x.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.Rr(t)}),500);this.config.__preview_deferred_init_extensions&&(this.Zi=t),this.Qi=t,this.compression=void 0,t.supportedCompression&&!this.config.disable_compression&&(this.compression=j(t.supportedCompression,Ze.GZipJS)?Ze.GZipJS:j(t.supportedCompression,Ze.Base64)?Ze.Base64:void 0),(r=t.analytics)!=null&&r.endpoint&&(this.analyticsDefaultEndpoint=t.analytics.endpoint),this.set_config({person_profiles:this.Ni?this.Ni:jo}),this.Pi.forEach((n=>n.onRemoteConfig==null?void 0:n.onRemoteConfig(t)))}Wi(){try{this.config.loaded(this)}catch(n){x.critical("`loaded` function failed",n)}if(this.Ji(),this.config.internal_or_test_user_hostname&&me!=null&&me.hostname){var t=me.hostname,r=this.config.internal_or_test_user_hostname;(typeof r=="string"?t===r:r.test(t))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.Ri())&&this.Ki()}),1),this.Yi=new xp(this),this.Yi.load()}Ji(){var t;this.is_capturing()&&this.config.request_batching&&((t=this.Ui)==null||t.enable())}_dom_loaded(){this.is_capturing()&&Jn(this.__request_queue,(t=>this.Bi(t))),this.__request_queue=[],this.Ji()}_handle_unload(){var t,r,n,i;(t=this.surveys)==null||t.handlePageUnload(),this.config.request_batching?(this.Xi()&&this.capture(Ts),(r=this.logs)==null||r.flushLogs("sendBeacon"),(n=this.Ui)==null||n.unload(),(i=this.zi)==null||i.unload()):this.Xi()&&this.capture(Ts,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(Mp?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=es(t.url,{ip:this.config.ip?1:0}),t.headers=S({},this.config.request_headers,t.headers),t.compression=t.compression==="best-available"?this.compression:t.compression,t.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(t.disableTransport=["sendBeacon"]),t.fetchOptions=t.fetchOptions||this.config.fetch_options,(r=>{var n,i,s,o=S({},r);o.timeout=o.timeout||6e4,o.url=_u(o.url,o.compression);var a=(n=o.transport)!==null&&n!==void 0?n:"fetch",c=fi.filter((l=>!o.disableTransport||!l.transport||!o.disableTransport.includes(l.transport))),u=(i=(s=(function(l,d){for(var p=0;l.length>p;p++)if(l[p].transport===a)return l[p]})(c))==null?void 0:s.method)!==null&&i!==void 0?i:c[0].method;if(!u)throw new Error("No available transport method");a!=="sendBeacon"&&o.data&&o.compression===Ze.GZipJS&&db&&!gu?k0(o).then((l=>{u(l)})).catch((l=>{if((d=>!(!d||typeof d!="object")&&("name"in d?String(d.name):"")==="NotReadableError")(l))return gu=!0,void u(S({},o,{compression:void 0,url:_u(r.url,void 0)}));u(o)})):u(o)})(S({},t,{callback:r=>{var n,i;this.rateLimiter.checkForLimiting(r),400>r.statusCode||(n=(i=this.config).on_request_error)==null||n.call(i,r),t.callback==null||t.callback(r)}}))))}Bi(t){this.zi?this.zi.retriableRequest(t):this._send_request(t)}_execute_array(t){Fs++;try{var r,n=[],i=[],s=[];Jn(t,(a=>{a&&(G(r=a[0])?s.push(a):ct(a)?a.call(this):G(a)&&r==="alias"?n.push(a):G(a)&&r.indexOf("capture")!==-1&&ct(this[r])?s.push(a):i.push(a))}));var o=function(a,c){Jn(a,(function(u){if(G(u[0])){var l=c;ne(u,(function(d){l=l[d[0]].apply(l,d.slice(1))}))}else c[u[0]].apply(c,u.slice(1))}))};o(n,this),o(i,this),o(s,this)}finally{Fs--}}push(t){if(Fs>0&&G(t)&&ce(t[0])){var r=Wt.prototype[t[0]];ct(r)&&r.apply(this,t.slice(1))}else this._execute_array([t])}capture(t,r,n){var i,s,o,a,c;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Ui){if(this.is_capturing())if(!k(t)&&ce(t)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var l=n!=null&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(l==null||!l.isRateLimited){r!=null&&r.$current_url&&!ce(r?.$current_url)&&(x.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),r==null||delete r.$current_url),t!=="$exception"||n!=null&&n.en||x.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var d=new Date,p=n?.timestamp||d,f=kt(),h={uuid:f,event:t,properties:this.calculateEventProperties(t,r||{},p,f)};t===_r&&this.config.__preview_capture_bot_pageviews&&u&&(h.event="$bot_pageview",h.properties.$browser_type="bot"),l&&(h.properties.$lib_rate_limit_remaining_tokens=l.remainingTokens),n!=null&&n.$set&&(h.$set=n?.$set);var g,m,w,P=this.tn(n?.$set_once,t!==nu,t===Is);if(P&&(h.$set_once=P),n!=null&&n._noTruncate||(s=this.config.properties_string_max_length,o=h,a=T=>ce(T)?T.slice(0,s):T,c=new Set,h=(function T(C,L){return C!==Object(C)?a?a(C):C:c.has(C)?void 0:(c.add(C),G(C)?(D=[],Jn(C,(N=>{D.push(T(N))}))):(D={},ne(C,((N,q)=>{c.has(N)||(D[q]=T(N,q))}))),D);var D})(o)),h.timestamp=p,k(n?.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=d),t===sn.DISMISSED||t===sn.SENT){var A=r?.[Cs.SURVEY_ID],$=r?.[Cs.SURVEY_ITERATION];(T=>{try{var C=(L=>((D,N)=>{var q=""+Jo+N.id;return N.current_iteration&&N.current_iteration>0&&(q=""+Jo+N.id+"_"+N.current_iteration),q})(0,L))(T);if(localStorage.getItem(C))return;localStorage.setItem(C,"true")}catch(L){ee.error("Failed to persist survey seen state",L)}})({id:A,current_iteration:$}),h.$set=S({},h.$set,{[(g={id:A,current_iteration:$},m=t===sn.SENT?"responded":"dismissed",w="$survey_"+m+"/"+g.id,g.current_iteration&&g.current_iteration>0&&(w="$survey_"+m+"/"+g.id+"/"+g.current_iteration),w)]:!0})}else t===sn.SHOWN&&(h.$set=S({},h.$set,{[Cs.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===y0.SHOWN){var y=r?.[uu.TOUR_TYPE];y&&(h.$set=S({},h.$set,{[uu.TOUR_LAST_SEEN_DATE+"/"+y]:new Date().toISOString()}))}var R=S({},h.properties.$set,h.$set);if(yr(R)||this.setPersonPropertiesForFlags(R),!B(this.config.before_send)){var v=this.rn(h);if(!v)return;h=v}this.Li.emit("eventCaptured",h);var b={method:"POST",url:(i=n?._url)!==null&&i!==void 0?i:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:h,compression:"best-available",batchKey:n?._batchKey};return!this.config.request_batching||n&&(n==null||!n._batchKey)||n!=null&&n.send_instantly?this.Bi(b):this.Ui.enqueue(b),h}x.critical("This capture call is ignored due to client rate limiting.")}}else x.error("No event name provided to posthog.capture")}else x.uninitializedWarning("posthog.capture")}_addCaptureHook(t){return this.on("eventCaptured",(r=>t(r.event,r)))}calculateEventProperties(t,r,n,i,s){if(n=n||new Date,!this.persistence||!this.sessionPersistence)return r;var o=s?void 0:this.persistence.remove_event_timer(t),a=S({},r);if(a.token=this.config.token,a.$config_defaults=this.config.defaults,this.Ri()&&(a.$cookieless_mode=!0),t==="$snapshot"){var c=S({},this.persistence.properties(),this.sessionPersistence.properties());return a.distinct_id=c.distinct_id,(!ce(a.distinct_id)&&!Ge(a.distinct_id)||li(a.distinct_id))&&x.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),a}var u,l=(function(w,P){var A,$,y,R;if(!Oe)return{};var v,b,T,C,L,D,N,q,Z=w?[...Nr,...P||[]]:[],[J,ue]=(function(M){for(var z=0;Qc.length>z;z++){var[X,W]=Qc[z],re=X.exec(M),Q=re&&(ct(W)?W(re,M):W);if(Q)return Q}return["",""]})(Oe);return le(Aa({$os:J,$os_version:ue,$browser:ep(Oe,navigator.vendor),$device:eu(Oe),$device_type:(b=Oe,T={userAgentDataPlatform:(A=navigator)==null||(A=A.userAgentData)==null?void 0:A.platform,maxTouchPoints:($=navigator)==null?void 0:$.maxTouchPoints,screenWidth:_==null||(y=_.screen)==null?void 0:y.width,screenHeight:_==null||(R=_.screen)==null?void 0:R.height,devicePixelRatio:_?.devicePixelRatio},q=eu(b),q===Ud||q===qd||q==="Kobo"||q==="Kindle Fire"||q===Qd?Ar:q===wn||q===Tr||q===Tn||q===yo?"Console":q===jd?"Wearable":q?De:T?.userAgentDataPlatform==="Android"&&((C=T?.maxTouchPoints)!==null&&C!==void 0?C:0)>0?600>Math.min((L=T?.screenWidth)!==null&&L!==void 0?L:0,(D=T?.screenHeight)!==null&&D!==void 0?D:0)/((N=T?.devicePixelRatio)!==null&&N!==void 0?N:1)?De:Ar:"Desktop"),$timezone:Ip(),$timezone_offset:v0()}),{$current_url:In(me?.href,Z,xn),$host:me?.host,$pathname:me?.pathname,$raw_user_agent:Oe.length>1e3?Oe.substring(0,997)+"...":Oe,$browser_version:kb(Oe,navigator.vendor),$browser_language:cu(),$browser_language_prefix:(v=cu(),typeof v=="string"?v.split("-")[0]:void 0),$screen_height:_?.screen.height,$screen_width:_?.screen.width,$viewport_height:_?.innerHeight,$viewport_width:_?.innerWidth,$lib:Pe.LIB_NAME,$lib_version:Pe.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:d,windowId:p}=this.sessionManager.checkAndGetSessionAndWindowId(s,n.getTime());a.$session_id=d,a.$window_id=p}this.sessionPropsManager&&le(a,this.sessionPropsManager.getSessionProps());try{var f;this.sessionRecording&&le(a,this.sessionRecording.sdkDebugProperties),a.$sdk_debug_retry_queue_size=(f=this.zi)==null?void 0:f.length}catch(w){a.$sdk_debug_error_capturing_properties=String(w)}if(this.requestRouter.region===Ko&&(a.$lib_custom_api_host=this.config.api_host),u=t!==_r||s?t!==Ts||s?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(n):this.pageViewManager.doPageView(n,i),a=le(a,u),t===_r&&I&&(a.title=I.title),!k(o)){var h=n.getTime()-o;a.$duration=parseFloat((h/1e3).toFixed(3))}Oe&&this.config.opt_out_useragent_filter&&(a.$browser_type=this._is_bot()?"bot":"browser"),(a=le({},l,this.persistence.properties(),this.sessionPersistence.properties(),a)).$is_identified=this._isIdentified(),G(this.config.property_denylist)?ne(this.config.property_denylist,(function(w){delete a[w]})):x.error(Fp+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(x.error(Eu),a=g(a,t));var m=this.nn();return a.$process_person_profile=m,m&&!s&&this.sn("_calculate_event_properties"),a}tn(t,r,n){var i;if(r===void 0&&(r=!0),n===void 0&&(n=!1),!this.persistence||!this.nn()||this.Oi&&!n)return t;var s=le({},this.persistence.get_initial_props(),((i=this.sessionPropsManager)==null?void 0:i.getSetOnceProps())||{},t||{}),o=this.config.sanitize_properties;return o&&(x.error(Eu),s=o(s,"$set_once")),r&&(this.Oi=!0),yr(s)?void 0:s}register(t,r){var n;(n=this.persistence)==null||n.register(t,r)}register_once(t,r,n){var i;(i=this.persistence)==null||i.register_once(t,r,n)}register_for_session(t){var r;(r=this.sessionPersistence)==null||r.register(t)}unregister(t){var r;(r=this.persistence)==null||r.unregister(t)}unregister_for_session(t){var r;(r=this.sessionPersistence)==null||r.unregister(t)}an(t,r){this.register({[t]:r})}getFeatureFlag(t,r){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlag(t,r)}getFeatureFlagPayload(t){var r;return(r=this.featureFlags)==null?void 0:r.getFeatureFlagPayload(t)}getFeatureFlagResult(t,r){var n;return(n=this.featureFlags)==null?void 0:n.getFeatureFlagResult(t,r)}isFeatureEnabled(t,r){var n;return(n=this.featureFlags)==null?void 0:n.isFeatureEnabled(t,r)}reloadFeatureFlags(){var t;(t=this.featureFlags)==null||t.reloadFeatureFlags()}updateFlags(t,r,n){var i;(i=this.featureFlags)==null||i.updateFlags(t,r,n)}updateEarlyAccessFeatureEnrollment(t,r,n){var i;(i=this.featureFlags)==null||i.updateEarlyAccessFeatureEnrollment(t,r,n)}getEarlyAccessFeatures(t,r,n){var i;return r===void 0&&(r=!1),(i=this.featureFlags)==null?void 0:i.getEarlyAccessFeatures(t,r,n)}on(t,r){return this.Li.on(t,r)}onFeatureFlags(t){return this.featureFlags?this.featureFlags.onFeatureFlags(t):(t([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(t){return this.surveys?this.surveys.onSurveysLoaded(t):(t([],{isLoaded:!1,error:Yr}),()=>{})}onSessionId(t){var r,n;return(r=(n=this.sessionManager)==null?void 0:n.onSessionId(t))!==null&&r!==void 0?r:()=>{}}getSurveys(t,r){r===void 0&&(r=!1),this.surveys?this.surveys.getSurveys(t,r):t([],{isLoaded:!1,error:Yr})}getActiveMatchingSurveys(t,r){r===void 0&&(r=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,r):t([],{isLoaded:!1,error:Yr})}renderSurvey(t,r){var n;(n=this.surveys)==null||n.renderSurvey(t,r)}displaySurvey(t,r){var n;r===void 0&&(r=M0),(n=this.surveys)==null||n.displaySurvey(t,r)}cancelPendingSurvey(t){var r;(r=this.surveys)==null||r.cancelPendingSurvey(t)}canRenderSurvey(t){var r,n;return(r=(n=this.surveys)==null?void 0:n.canRenderSurvey(t))!==null&&r!==void 0?r:{visible:!1,disabledReason:Yr}}canRenderSurveyAsync(t,r){var n,i;return r===void 0&&(r=!1),(n=(i=this.surveys)==null?void 0:i.canRenderSurveyAsync(t,r))!==null&&n!==void 0?n:Promise.resolve({visible:!1,disabledReason:Yr})}un(t){return!t||li(t)?(x.critical("Unique user id has not been set in posthog.identify"),!1):t===Kn?(x.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(t.toLowerCase())&&!["undefined","null"].includes(t.toLowerCase())||(x.critical('The string "'+t+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(t,r,n){if(!this.__loaded||!this.persistence)return x.uninitializedWarning("posthog.identify");if(Ge(t)&&(t=t.toString(),x.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.un(t)&&this.sn("posthog.identify")){var i=this.get_distinct_id();this.register({$user_id:t}),this.get_property(Ci)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),t!==i&&t!==this.get_property(Qr)&&(this.unregister(Qr),this.register({distinct_id:t}));var s,o=(this.persistence.get_property(Ve)||ur)===ur;t!==i&&o?(this.persistence.set_property(Ve,lr),this.setPersonPropertiesForFlags({$set:r||{},$set_once:n||{}},!1),this.capture(Is,{distinct_id:t,$anon_distinct_id:i},{$set:r||{},$set_once:n||{}}),this.$i=yu(t,r,n),(s=this.featureFlags)==null||s.setAnonymousDistinctId(i)):(r||n)&&this.setPersonProperties(r,n),t!==i&&(this.reloadFeatureFlags(),this.unregister(ln))}}setPersonProperties(t,r){if((t||r)&&this.sn("posthog.setPersonProperties")){var n=yu(this.get_distinct_id(),t,r);this.$i!==n?(this.setPersonPropertiesForFlags({$set:t||{},$set_once:r||{}},!0),this.capture("$set",{$set:t||{},$set_once:r||{}}),this.$i=n):x.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(t,r,n){if(t&&r){var i=this.getGroups(),s=i[t]!==r;if(s&&this.resetGroupPropertiesForFlags(t),this.register({$groups:S({},i,{[t]:r})}),s||n){var o={$group_type:t,$group_key:r};n&&(o.$group_set=n),this.capture(nu,o)}n&&this.setGroupPropertiesForFlags({[t]:n}),s&&!n&&this.reloadFeatureFlags()}else x.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(t,r){var n;r===void 0&&(r=!0),(n=this.featureFlags)==null||n.setPersonPropertiesForFlags(t,r)}resetPersonPropertiesForFlags(){var t;(t=this.featureFlags)==null||t.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(t,r){var n;r===void 0&&(r=!0),this.sn("posthog.setGroupPropertiesForFlags")&&((n=this.featureFlags)==null||n.setGroupPropertiesForFlags(t,r))}resetGroupPropertiesForFlags(t){var r;(r=this.featureFlags)==null||r.resetGroupPropertiesForFlags(t)}reset(t){var r,n,i,s,o,a,c,u;if(x.info("reset"),!this.__loaded)return x.uninitializedWarning("posthog.reset");var l=this.get_property(Ci);if(this.consent.reset(),(r=this.persistence)==null||r.clear(),(n=this.sessionPersistence)==null||n.clear(),(i=this.surveys)==null||i.reset(),(s=this.Yi)==null||s.stop(),(o=this.featureFlags)==null||o.reset(),(a=this.conversations)==null||a.reset(),(c=this.persistence)==null||c.set_property(Ve,ur),(u=this.sessionManager)==null||u.resetSessionId(),this.$i=null,this.config.cookieless_mode===ut)this.register_once({distinct_id:Kn,$device_id:null},"");else{var d=this.config.get_device_id(kt());this.register_once({distinct_id:d,$device_id:t?d:l},"")}this.register({$last_posthog_reset:new Date().toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(t,r){var n;this.config.identity_distinct_id=t,this.config.identity_hash=r,this.alias(t),(n=this.conversations)==null||n.ln()}clearIdentity(){var t;delete this.config.identity_distinct_id,delete this.config.identity_hash,(t=this.conversations)==null||t.hn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var t,r;return(t=(r=this.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&t!==void 0?t:""}get_session_replay_url(t){if(!this.sessionManager)return"";var{sessionId:r,sessionStartTimestamp:n}=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+r);if(t!=null&&t.withTimestamp&&n){var s,o=(s=t.timestampLookBack)!==null&&s!==void 0?s:10;if(!n)return i;i+="?t="+Math.max(Math.floor((new Date().getTime()-n)/1e3)-o,0)}return i}alias(t,r){return t===this.get_property(op)?(x.critical("Attempting to create alias for existing People user - aborting."),-2):this.sn("posthog.alias")?(k(r)&&(r=this.get_distinct_id()),t!==r?(this.an(Qr,t),this.capture("$create_alias",{alias:t,distinct_id:r})):(x.warn("alias matches current distinct_id - skipping api call."),this.identify(t),-1)):void 0}set_config(t){var r=S({},this.config);if(de(t)){var n,i,s,o,a,c,u,l,d,p;le(this.config,Tu(t));var f=this.Hi();(n=this.persistence)==null||n.update_config(this.config,r,f),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Rs(S({},this.config,{persistence:"sessionStorage"}),f);var h=this.Di(this.config.debug);et(h)&&(this.config.debug=h),et(this.config.debug)&&(this.config.debug?(Pe.DEBUG=!0,ae.R()&&ae.N("ph_debug",!0),x.info("set_config",{config:t,oldConfig:r,newConfig:S({},this.config)})):(Pe.DEBUG=!1,ae.R()&&ae.q("ph_debug"))),(i=this.exceptionObserver)==null||i.onConfigChange(),(s=this.exceptions)==null||s.onConfigChange(),(o=this.sessionRecording)==null||o.startIfEnabledOrStop(),(a=this.autocapture)==null||a.startIfEnabled(),(c=this.heatmaps)==null||c.startIfEnabled(),(u=this.exceptionObserver)==null||u.startIfEnabledOrStop(),(l=this.deadClicksAutocapture)==null||l.startIfEnabledOrStop(),(d=this.surveys)==null||d.loadIfEnabled(),this.cn(),(p=this.externalIntegrations)==null||p.startIfEnabledOrStop()}}_overrideSDKInfo(t,r){Pe.LIB_NAME=t,Pe.LIB_VERSION=r}startSessionRecording(t){var r,n,i,s,o,a=t===!0,c={sampling:a||!(t==null||!t.sampling),linked_flag:a||!(t==null||!t.linked_flag),url_trigger:a||!(t==null||!t.url_trigger),event_trigger:a||!(t==null||!t.event_trigger)};Object.values(c).some(Boolean)&&((r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),c.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),c.linked_flag&&((i=this.sessionRecording)==null||i.overrideLinkedFlag()),c.url_trigger&&((s=this.sessionRecording)==null||s.overrideTrigger("url")),c.event_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var t;return!((t=this.sessionRecording)==null||!t.started)}captureException(t,r){if(this.exceptions){var n=new Error("PostHog syntheticException"),i=this.exceptions.buildProperties(t,{handled:!0,syntheticException:n});return this.exceptions.sendExceptionEvent(S({},i,r))}}addExceptionStep(t,r){var n;(n=this.exceptions)==null||n.addExceptionStep(t,r)}captureLog(t){var r;(r=this.logs)==null||r.captureLog(t)}get logger(){var t,r;return(t=(r=this.logs)==null?void 0:r.logger)!==null&&t!==void 0?t:Wt.dn}startExceptionAutocapture(t){this.set_config({capture_exceptions:t==null||t})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(t){var r,n;return(r=(n=this.toolbar)==null?void 0:n.loadToolbar(t))!==null&&r!==void 0&&r}get_property(t){var r;return(r=this.persistence)==null?void 0:r.props[t]}getSessionProperty(t){var r;return(r=this.sessionPersistence)==null?void 0:r.props[t]}toString(){var t,r=(t=this.config.name)!==null&&t!==void 0?t:vr;return r!==vr&&(r=vr+"."+r),r}_isIdentified(){var t,r;return((t=this.persistence)==null?void 0:t.get_property(Ve))===lr||((r=this.sessionPersistence)==null?void 0:r.get_property(Ve))===lr}nn(){var t,r;return!(this.config.person_profiles==="never"||this.config.person_profiles===jo&&!this._isIdentified()&&yr(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[Qr])&&((r=this.persistence)==null||(r=r.props)==null||!r[Ni]))}Xi(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.nn()||this.sn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.sn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}sn(t){return this.config.person_profiles==="never"?(x.error(t+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.an(Ni,!0),!0)}Hi(){if(this.config.cookieless_mode==="always")return!0;var t=this.consent.isOptedOut();return this.config.disable_persistence||t&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Bt)}cn(){var t,r,n,i,s=this.Hi();return((t=this.persistence)==null?void 0:t._r)!==s&&((n=this.persistence)==null||n.set_disabled(s)),((r=this.sessionPersistence)==null?void 0:r._r)!==s&&((i=this.sessionPersistence)==null||i.set_disabled(s)),s}opt_in_capturing(t){var r;if(this.config.cookieless_mode!==ut){if(this.Ri()){var n,i,s,o,a;this.reset(!0),(n=this.sessionManager)==null||n.destroy(),(i=this.pageViewManager)==null||i.destroy(),this.sessionManager=new mu(this),this.pageViewManager=new au(this),this.persistence&&(this.sessionPropsManager=new vu(this,this.sessionManager,this.persistence));var c,u=(s=(o=this.config.__extensionClasses)==null?void 0:o.sessionRecording)!==null&&s!==void 0?s:(a=Wt.__defaultExtensionClasses)==null?void 0:a.sessionRecording;u&&(this.sessionRecording=this.Mi(this.sessionRecording,new u(this)),this.Qi&&((c=this.sessionRecording)==null||c.onRemoteConfig==null||c.onRemoteConfig(this.Qi)))}var l,d;this.consent.optInOut(!0),this.cn(),this.Ji(),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),this.config.cookieless_mode==Bt&&((l=this.surveys)==null||l.loadIfEnabled()),(k(t?.captureEventName)||t!=null&&t.captureEventName)&&this.capture((d=t?.captureEventName)!==null&&d!==void 0?d:"$opt_in",t?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ki()}else x.warn(Su)}opt_out_capturing(){var t,r,n;this.config.cookieless_mode!==ut?(this.config.cookieless_mode===Bt&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.cn(),this.config.cookieless_mode===Bt&&(this.register({distinct_id:Kn,$device_id:null}),(t=this.sessionRecording)==null||t.stopRecording(),this.sessionRecording=void 0,(r=this.sessionManager)==null||r.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.Ki())):x.warn(Su)}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var t=this.consent.consent;return t===1?"granted":t===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===ut||(this.config.cookieless_mode===Bt?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.cn()}_is_bot(){return Me?Op(Me,this.config.custom_blocked_useragents):void 0}Ki(){I&&(I.visibilityState==="visible"?this.Fi||(this.Fi=!0,this.capture(_r,{title:I.title},{send_instantly:!0}),this.Ai&&(I.removeEventListener(Fi,this.Ai),this.Ai=null)):this.Ai||(this.Ai=this.Ki.bind(this),pe(I,Fi,this.Ai)))}debug(t){t===!1?(_?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(_?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Lr(){var t,r,n,i,s,o,a=this.qi||{};return"advanced_disable_flags"in a?!!a.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(x.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(n="advanced_disable_decide",i=x,s=(r="advanced_disable_flags")in(t=a)&&!B(t[r]),o=n in t&&!B(t[n]),s?t[r]:!!o&&(i&&i.warn("Config field '"+n+"' is deprecated. Please use '"+r+"' instead. The old field will be removed in a future major version."),t[n]))}rn(t){if(B(this.config.before_send))return t;var r=G(this.config.before_send)?this.config.before_send:[this.config.before_send],n=t;for(var i of r){if(n=i(n),B(n)){var s="Event '"+t.event+"' was rejected in beforeSend function";return gb(t.event)?x.warn(s+". This can cause unexpected behavior."):x.info(s),null}n.properties&&!yr(n.properties)||x.warn("Event '"+t.event+"' has no properties after beforeSend function, this is likely an error.")}return n}getPageViewId(){var t;return(t=this.pageViewManager.dr)==null?void 0:t.pageViewId}captureTraceFeedback(t,r){this.capture("$ai_feedback",{$ai_trace_id:String(t),$ai_feedback_text:r})}captureTraceMetric(t,r,n){this.capture("$ai_metric",{$ai_trace_id:String(t),$ai_metric_name:r,$ai_metric_value:String(n)})}Di(t){var r=et(t)&&!t,n=ae.R()&&ae.A("ph_debug")==="true";return!r&&(!!n||t)}};hn.__defaultExtensionClasses={},hn.dn={trace:pr=()=>{},debug:pr,info:pr,warn:pr,error:pr,fatal:pr},(function(e,t){for(var r=0;t.length>r;r++)e.prototype[t[r]]=Qb(e.prototype[t[r]])})(hn,["identify"]);var j0=1,B0=3,W0=11;function Iu(e){return e instanceof Element&&(e.id===dp||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function Qt(e){return!!e&&e.nodeType===j0}function Ye(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Lp(e){return!!e&&e.nodeType===B0}function Dp(e){return!!e&&e.nodeType===W0&&Qt(e.host)}function Fa(e){return e?Zi(e).split(/\s+/):[]}function xu(e){var t=_?.location.href;return!!(t&&e&&e.some((r=>t.match(r))))}function Bi(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return Fa(t)}function qp(e){return B(e)?null:Zi(e).split(/(\s+)/).filter((t=>fn(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function kn(e){var t="";return ea(e)&&!Hp(e)&&e.childNodes&&e.childNodes.length&&ne(e.childNodes,(function(r){var n;Lp(r)&&r.textContent&&(t+=(n=qp(r.textContent))!==null&&n!==void 0?n:"")})),Zi(t)}function ku(e){return k(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var Ma=["a","button","form","input","select","textarea","label"];function Ru(e,t){if(k(t))return!0;var r,n=function(s){if(t.some((o=>s.matches(o))))return{v:!0}};for(var i of e)if(r=n(i))return r.v;return!1}function Up(e){var t=e.parentNode;return!(!t||!Qt(t))&&t}var z0=["next","previous","prev",">","<"],Pu=[".ph-no-rageclick",".ph-no-capture"],Qo=e=>!e||Ye(e,"html")||!Qt(e),Cu=(e,t)=>{if(!_||Qo(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[e],i=e;i.parentNode&&!Ye(i,"body");)if(Dp(i.parentNode))n.push(i.parentNode.host),i=i.parentNode.host;else{var s=Up(i);if(!s)break;if(t||Ma.indexOf(s.tagName.toLowerCase())>-1)r=!0;else{var o=_.getComputedStyle(s);o&&o.getPropertyValue("cursor")==="pointer"&&(r=!0)}n.push(s),i=s}return{parentIsUsefulElement:r,targetElementList:n}};function ea(e){for(var t=e;t.parentNode&&!Ye(t,"body");t=t.parentNode){var r=Bi(t);if(j(r,"ph-sensitive")||j(r,"ph-no-capture"))return!1}if(j(Bi(e),"ph-include"))return!0;var n=e.type||"";if(ce(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return!ce(i)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,""))}function Hp(e){return!!(Ye(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Ye(e,"select")||Ye(e,"textarea")||e.getAttribute("contenteditable")==="true")}var jp="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",G0=new RegExp("^(?:"+jp+")$"),V0=new RegExp(jp),Bp="\\d{3}-?\\d{2}-?\\d{4}",Y0=new RegExp("^("+Bp+")$"),X0=new RegExp("("+Bp+")");function fn(e,t){return t===void 0&&(t=!0),!(B(e)||ce(e)&&(e=Zi(e),(t?G0:V0).test((e||"").replace(/[- ]/g,""))||(t?Y0:X0).test(e)))}function Au(e){var t=kn(e);return fn(t=(t+" "+Wp(e)).trim())?t:""}function Wp(e){var t="";return e&&e.childNodes&&e.childNodes.length&&ne(e.childNodes,(function(r){var n;if(r&&((n=r.tagName)==null?void 0:n.toLowerCase())==="span")try{var i=kn(r);t=(t+" "+i).trim(),r.childNodes&&r.childNodes.length&&(t=(t+" "+Wp(r)).trim())}catch(s){x.error("[AutoCapture]",s)}})),t}function Ou(e){return e.replace(/"|\\"/g,'\\"')}function K0(e){var t=e.attr__class;return t?G(t)?t:Fa(t):void 0}var $u=class{constructor(e){this.disabled=e===!1;var t=de(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,r){if(this.disabled)return!1;var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(t-n.y)<this.thresholdPx&&this.timeoutMs>r-n.timestamp){if(this.clicks.push({x:e,y:t,timestamp:r}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:r}];return!1}},Ms="$copy_autocapture",Ls=oe("[AutoCapture]");function Ds(e,t){return t.length>e?t.slice(0,e)+"...":t}function J0(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!Qt(t));return t}function Z0(e,t){var r,n,{e:i,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:c}=t;if(!Qt(e))return{props:{}};for(var u=[e],l=e;l.parentNode&&!Ye(l,"body");)if(Dp(l.parentNode))u.push(l.parentNode.host),l=l.parentNode.host;else{if(!Qt(l.parentNode))break;u.push(l.parentNode),l=l.parentNode}var d,p,f=[],h={},g=!1,m=!1;if(ne(u,(y=>{var R=ea(y);if(Ye(y,"a")){var v=y.getAttribute("href");g=R&&!!v&&fn(v)&&v}j(Bi(y),"ph-no-capture")&&(m=!0),f.push((function(b,T,C,L){var D=b.tagName.toLowerCase(),N={tag_name:D};Ma.indexOf(D)>-1&&!C&&(N.$el_text=D.toLowerCase()==="a"||D.toLowerCase()==="button"?Ds(1024,Au(b)):Ds(1024,kn(b)));var q=Bi(b);q.length>0&&(N.classes=q.filter((function(M){return M!==""}))),ne(b.attributes,(function(M){var z;if((!Hp(b)||["name","id","class","aria-label"].indexOf(M.name)!==-1)&&(L==null||!L.includes(M.name))&&!T&&fn(M.value)&&(!ce(z=M.name)||z.substring(0,10)!=="_ngcontent"&&z.substring(0,7)!=="_nghost")){var X=M.value;M.name==="class"&&(X=Fa(X).join(" ")),N["attr__"+M.name]=Ds(1024,X)}}));for(var Z=1,J=1,ue=b;ue=J0(ue);)Z++,ue.tagName===b.tagName&&J++;return N.nth_child=Z,N.nth_of_type=J,N})(y,s,o,a)),le(h,(function(b){if(!ea(b))return{};var T={};return ne(b.attributes,(function(C){if(C.name&&C.name.indexOf("data-ph-capture-attribute")===0){var L=C.name.replace("data-ph-capture-attribute-",""),D=C.value;L&&D&&fn(D)&&(T[L]=D)}})),T})(y))})),m)return{props:{},explicitNoCapture:m};if(o||(f[0].$el_text=Ye(e,"a")||Ye(e,"button")?Au(e):kn(e)),g){var w,P;f[0].attr__href=g;var A=(w=Li(g))==null?void 0:w.host,$=_==null||(P=_.location)==null?void 0:P.host;A&&$&&A!==$&&(d=g)}return{props:le({$event_type:i.type,$ce_version:1},c?{}:{$elements:f},{$elements_chain:(p=f,(function(y){return y.map((R=>{var v,b,T="";if(R.tag_name&&(T+=R.tag_name),R.attr_class)for(var C of(R.attr_class.sort(),R.attr_class))T+="."+C.replace(/"/g,"");var L=S({},R.text?{text:R.text}:{},{"nth-child":(v=R.nth_child)!==null&&v!==void 0?v:0,"nth-of-type":(b=R.nth_of_type)!==null&&b!==void 0?b:0},R.href?{href:R.href}:{},R.attr_id?{attr_id:R.attr_id}:{},R.attributes),D={};return hi(L).sort(((N,q)=>{var[Z]=N,[J]=q;return Z.localeCompare(J)})).forEach((N=>{var[q,Z]=N;return D[Ou(q.toString())]=Ou(Z.toString())})),(T+=":")+hi(D).map((N=>{var[q,Z]=N;return q+'="'+Z+'"'})).join("")})).join(";")})((function(y){return y.map((R=>{var v,b,T={text:(v=R.$el_text)==null?void 0:v.slice(0,400),tag_name:R.tag_name,href:(b=R.attr__href)==null?void 0:b.slice(0,2048),attr_class:K0(R),attr_id:R.attr__id,nth_child:R.nth_child,nth_of_type:R.nth_of_type,attributes:{}};return hi(R).filter((C=>{var[L]=C;return L.indexOf("attr__")===0})).forEach((C=>{var[L,D]=C;return T.attributes[L]=D})),T}))})(p)))},(r=f[0])!=null&&r.$el_text?{$el_text:(n=f[0])==null?void 0:n.$el_text}:{},d&&i.type==="click"?{$external_click_url:d}:{},h)}}var Xr=oe("[ExceptionAutocapture]");function Nu(e,t,r){try{if(!(t in e))return()=>{};var n=e[t],i=r(n);return ct(i)&&(i.prototype=i.prototype||{},Object.defineProperties(i,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=i,()=>{e[t]=n}}catch{return()=>{}}}var Q0=oe("[TracingHeaders]"),Tt=oe("[Web Vitals]"),Fu=9e5,Mu="disabled",Lu="lazy_loading",Kr="awaiting_config",ri="missing_config";oe("[SessionRecording]"),oe("[SessionRecording]");var ta="[SessionRecording]",It=oe(ta),eS=oe("[Heatmaps]");function Du(e){return de(e)&&"clientX"in e&&"clientY"in e&&Ge(e.clientX)&&Ge(e.clientY)}var qu=oe("[Product Tours]"),tS=["$set_once","$set"],xt=oe("[SiteApps]"),Uu="Error while initializing PostHog app with config id ";function hr(e,t,r){if(B(e))return!1;switch(r){case"exact":return e===t;case"contains":var n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(n,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch{return!1}default:return!1}}var rS=class{constructor(e){this.vn=new Na,this.fn=(t,r)=>this.pn(t,r)&&this.gn(t,r)&&this.mn(t,r)&&this.yn(t,r),this.pn=(t,r)=>r==null||!r.event||t?.event===r?.event,this._instance=e,this.bn=new Set,this._n=new Set}init(){var e,t;k((e=this._instance)==null?void 0:e._addCaptureHook)||(t=this._instance)==null||t._addCaptureHook(((r,n)=>{this.on(r,n)}))}register(e){var t,r;if(!k((t=this._instance)==null?void 0:t._addCaptureHook)&&(e.forEach((s=>{var o,a;(o=this._n)==null||o.add(s),(a=s.steps)==null||a.forEach((c=>{var u;(u=this.bn)==null||u.add(c?.event||"")}))})),(r=this._instance)!=null&&r.autocapture)){var n,i=new Set;e.forEach((s=>{var o;(o=s.steps)==null||o.forEach((a=>{a!=null&&a.selector&&i.add(a?.selector)}))})),(n=this._instance)==null||n.autocapture.setElementSelectors(i)}}on(e,t){var r;t!=null&&e.length!=0&&(this.bn.has(e)||this.bn.has(t?.event))&&this._n&&((r=this._n)==null?void 0:r.size)>0&&this._n.forEach((n=>{this.wn(t,n)&&this.vn.emit("actionCaptured",n.name)}))}xn(e){this.onAction("actionCaptured",(t=>e(t)))}wn(e,t){if(t?.steps==null)return!1;for(var r of t.steps)if(this.fn(e,r))return!0;return!1}onAction(e,t){return this.vn.on(e,t)}gn(e,t){if(t!=null&&t.url){var r,n=e==null||(r=e.properties)==null?void 0:r.$current_url;if(!n||typeof n!="string"||!hr(n,t.url,t.url_matching||"contains"))return!1}return!0}mn(e,t){return!!this.Sn(e,t)&&!!this.kn(e,t)&&!!this.Cn(e,t)}Sn(e,t){var r;if(t==null||!t.href)return!0;var n=this.In(e);if(n.length>0)return n.some((o=>hr(o.href,t.href,t.href_matching||"exact")));var i,s=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!s&&hr((i=s.match(/(?::|")href="(.*?)"/))?i[1]:"",t.href,t.href_matching||"exact")}kn(e,t){var r;if(t==null||!t.text)return!0;var n=this.In(e);if(n.length>0)return n.some((c=>hr(c.text,t.text,t.text_matching||"exact")||hr(c.$el_text,t.text,t.text_matching||"exact")));var i,s,o,a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!a&&(i=(function(c){for(var u,l=[],d=/(?::|")text="(.*?)"/g;!B(u=d.exec(c));)l.includes(u[1])||l.push(u[1]);return l})(a),s=t.text,o=t.text_matching||"exact",i.some((c=>hr(c,s,o))))}Cn(e,t){var r,n;if(t==null||!t.selector)return!0;var i=e==null||(r=e.properties)==null?void 0:r.$element_selectors;if(i!=null&&i.includes(t.selector))return!0;var s=(e==null||(n=e.properties)==null?void 0:n.$elements_chain)||"";if(t.selector_regex&&s)try{return new RegExp(t.selector_regex).test(s)}catch{return!1}return!1}In(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e?.properties.$elements}yn(e,t){return t==null||!t.properties||t.properties.length===0||Np(t.properties.reduce(((r,n)=>{var i=G(n.value)?n.value.map(String):n.value!=null?[String(n.value)]:[];return r[n.key]={values:i,operator:n.operator||"exact"},r}),{}),e?.properties)}},nS=class{constructor(e){this._instance=e,this.Tn=new Map,this.En=new Map,this.Mn=new Map}Pn(e,t){return!!e&&Np(e.propertyFilters,t?.properties)}Rn(e,t){var r=new Map;return e.forEach((n=>{var i;(i=n.conditions)==null||(i=i[t])==null||(i=i.values)==null||i.forEach((s=>{if(s!=null&&s.name){var o=r.get(s.name)||[];o.push(n.id),r.set(s.name,o)}}))})),r}On(e,t,r){var n=(r===Wr.Activation?this.Tn:this.En).get(e),i=[];return this.Ln((s=>{i=s.filter((o=>n?.includes(o.id)))})),i.filter((s=>{var o,a=(o=s.conditions)==null||(o=o[r])==null||(o=o.values)==null?void 0:o.find((c=>c.name===e));return this.Pn(a,t)}))}register(e){var t;k((t=this._instance)==null?void 0:t._addCaptureHook)||(this.Fn(e),this.An(e))}An(e){var t=e.filter((r=>{var n,i;return((n=r.conditions)==null?void 0:n.actions)&&((i=r.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0}));t.length!==0&&(this.Nn??(this.Nn=new rS(this._instance),this.Nn.init(),this.Nn.xn((r=>{this.onAction(r)}))),t.forEach((r=>{var n,i,s,o,a;r.conditions&&(n=r.conditions)!=null&&n.actions&&(i=r.conditions)!=null&&(i=i.actions)!=null&&i.values&&((s=r.conditions)==null||(s=s.actions)==null||(s=s.values)==null?void 0:s.length)>0&&((o=this.Nn)==null||o.register(r.conditions.actions.values),(a=r.conditions)==null||(a=a.actions)==null||(a=a.values)==null||a.forEach((c=>{if(c&&c.name){var u=this.Mn.get(c.name);u&&u.push(r.id),this.Mn.set(c.name,u||[r.id])}})))})))}Fn(e){var t,r=e.filter((i=>{var s,o;return((s=i.conditions)==null?void 0:s.events)&&((o=i.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0})),n=e.filter((i=>{var s,o;return((s=i.conditions)==null?void 0:s.cancelEvents)&&((o=i.conditions)==null||(o=o.cancelEvents)==null||(o=o.values)==null?void 0:o.length)>0}));r.length===0&&n.length===0||((t=this._instance)==null||t._addCaptureHook(((i,s)=>{this.onEvent(i,s)})),this.Tn=this.Rn(e,Wr.Activation),this.En=this.Rn(e,Wr.Cancellation))}onEvent(e,t){var r,n=this.le(),i=this.$n(),s=this.Dn(),o=((r=this._instance)==null||(r=r.persistence)==null?void 0:r.props[i])||[];if(s===e&&t&&o.length>0){var a,c;n.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:o});var u=(t==null||(a=t.properties)==null?void 0:a.$survey_id)||(t==null||(c=t.properties)==null?void 0:c.$product_tour_id);if(u){var l=o.indexOf(u);0>l||(o.splice(l,1),this.qn(o))}}else{if(this.En.has(e)){var d=this.On(e,t,Wr.Cancellation);d.length>0&&(n.info("cancel event matched, cancelling items",{event:e,itemsToCancel:d.map((f=>f.id))}),d.forEach((f=>{var h=o.indexOf(f.id);0>h||o.splice(h,1),this.jn(f.id)})),this.qn(o))}if(this.Tn.has(e)){n.info("event name matched",{event:e,eventPayload:t,items:this.Tn.get(e)});var p=this.On(e,t,Wr.Activation);this.qn(o.concat(p.map((f=>f.id))||[]))}}}onAction(e){var t,r=this.$n(),n=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[r])||[];this.Mn.has(e)&&this.qn(n.concat(this.Mn.get(e)||[]))}qn(e){var t=this.le(),r=[...new Set(e)].filter((n=>!this.Hn(n)));t.info("updating activated items",{activatedItems:r}),this.Un(r)}getActivatedIds(){var e,t=this.$n();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t])||[]}getEventToItemsMap(){return this.Tn}Bn(){return this.Nn}},iS=class extends nS{constructor(e){super(e)}$n(){return No}Dn(){return sn.SHOWN}Ln(e){var t;(t=this._instance)==null||t.getSurveys(e)}jn(e){var t;(t=this._instance)==null||t.cancelPendingSurvey(e)}le(){return ee}Un(e){var t;(t=this._instance)==null||(t=t.persistence)==null||t.register({[No]:e})}Hn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},qs="SDK is not enabled or survey functionality is not yet loaded",Hu="Disabled. Not loading surveys.",sS=_!=null&&_.location?qi(_.location.hash,"__posthog")||qi(location.hash,"state"):null,ju="_postHogToolbarParams",Bu=oe("[Toolbar]"),Ie=oe("[FeatureFlags]"),Ut=oe("[FeatureFlags]",{debugEnabled:!0}),Us=`" failed. Feature flags didn't load in time.`,Wu=e=>{for(var t={},r=0;e.length>r;r++)t[e[r]]=!0;return t},zu=e=>{var t={};for(var[r,n]of hi(e||{}))n&&(t[r]=n);return t},st=oe("[Error tracking]"),Gu="Refusing to render web experiment since the viewer is a likely bot",oS={icontains:(e,t)=>!!_&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!_&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!_&&ji(t.href,e),not_regex:(e,t)=>!!_&&!ji(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e},aS=class ke{get qt(){return this._instance.config}constructor(t){var r=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(n){n===void 0&&(n=!1),r.getWebExperiments((i=>{ke.zn("retrieved web experiments from the server"),r.Vn=new Map,i.forEach((s=>{if(s.feature_flag_key){var o;r.Vn&&(ke.zn("setting flag key ",s.feature_flag_key," to web experiment ",s),(o=r.Vn)==null||o.set(s.feature_flag_key,s));var a=r._instance.getFeatureFlag(s.feature_flag_key);ce(a)&&s.variants[a]&&r.Wn(s.name,a,s.variants[a].transforms)}else if(s.variants)for(var c in s.variants){var u=s.variants[c];ke.Zn(u)&&r.Wn(s.name,c,u.transforms)}}))}),n)},this._instance=t,this._instance.onFeatureFlags((n=>{this.onFeatureFlags(n)}))}initialize(){}onFeatureFlags(t){if(this._is_bot())ke.zn(Gu);else if(!this.qt.disable_web_experiments){if(B(this.Vn))return this.Vn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ke.zn("applying feature flags",t),t.forEach((r=>{var n;if(this.Vn&&(n=this.Vn)!=null&&n.has(r)){var i,s=this._instance.getFeatureFlag(r),o=(i=this.Vn)==null?void 0:i.get(r);s&&o!=null&&o.variants[s]&&this.Wn(o.name,s,o.variants[s].transforms)}}))}}previewWebExperiment(){var t=ke.getWindowLocation();if(t!=null&&t.search){var r=Di(t?.search,"__experiment_id"),n=Di(t?.search,"__experiment_variant");r&&n&&(ke.zn("previewing web experiments "+r+" && "+n),this.getWebExperiments((i=>{this.Gn(parseInt(r),n,i)}),!1,!0))}}loadIfEnabled(){this.qt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(t,r,n){if(this.qt.disable_web_experiments&&!n)return t([]);var i=this._instance.get_property("$web_experiments");if(i&&!r)return t(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.qt.token),method:"GET",callback:s=>t(s.statusCode===200&&s.json&&s.json.experiments||[])})}Gn(t,r,n){var i=n.filter((s=>s.id===t));i&&i.length>0&&(ke.zn("Previewing web experiment ["+i[0].name+"] with variant ["+r+"]"),this.Wn(i[0].name,r,i[0].variants[r].transforms))}static Zn(t){return!B(t.conditions)&&ke.Qn(t)&&ke.Jn(t)}static Qn(t){var r;if(B(t.conditions)||B((r=t.conditions)==null?void 0:r.url))return!0;var n,i,s,o=ke.getWindowLocation();return!!o&&((n=t.conditions)==null||!n.url||oS[(i=(s=t.conditions)==null?void 0:s.urlMatchType)!==null&&i!==void 0?i:"icontains"](t.conditions.url,o))}static getWindowLocation(){return _?.location}static Jn(t){var r;if(B(t.conditions)||B((r=t.conditions)==null?void 0:r.utm))return!0;var n=yp();if(n.utm_source){var i,s,o,a,c,u,l,d,p=(i=t.conditions)==null||(i=i.utm)==null||!i.utm_campaign||((s=t.conditions)==null||(s=s.utm)==null?void 0:s.utm_campaign)==n.utm_campaign,f=(o=t.conditions)==null||(o=o.utm)==null||!o.utm_source||((a=t.conditions)==null||(a=a.utm)==null?void 0:a.utm_source)==n.utm_source,h=(c=t.conditions)==null||(c=c.utm)==null||!c.utm_medium||((u=t.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==n.utm_medium,g=(l=t.conditions)==null||(l=l.utm)==null||!l.utm_term||((d=t.conditions)==null||(d=d.utm)==null?void 0:d.utm_term)==n.utm_term;return p&&h&&g&&f}return!1}static zn(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;r>i;i++)n[i-1]=arguments[i];x.info("[WebExperiments] "+t,n)}Wn(t,r,n){this._is_bot()?ke.zn(Gu):r!=="control"?n.forEach((i=>{if(i.selector){var s;ke.zn("applying transform of variant "+r+" for experiment "+t+" ",i),((s=document)==null?void 0:s.querySelectorAll(i.selector))?.forEach((o=>{var a=o;i.html&&(a.innerHTML=i.html),i.css&&a.setAttribute("style",i.css)}))}})):ke.zn("Control variants leave the page unmodified.")}_is_bot(){return Me&&this._instance?Op(Me,this.qt.custom_blocked_useragents):void 0}},He=oe("[Conversations]"),Ht="Conversations not available yet.",ts={featureFlags:class{constructor(e){this.Kn=!1,this.Yn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=!1,this._instance=e,this.featureFlagEventHandlers=[]}get qt(){return this._instance.config}get ni(){return this._instance.persistence}os(e){return this._instance.get_property(e)}us(){var e,t;return(e=(t=this.ni)==null?void 0:t.wr(this.qt.feature_flag_cache_ttl_ms))!==null&&e!==void 0&&e}ls(){return!!this.us()&&(this.ss||this.Xn||(this.ss=!0,Ie.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}hs(){var e,t=(e=this.qt.evaluation_contexts)!==null&&e!==void 0?e:this.qt.evaluation_environments;return!this.qt.evaluation_environments||this.qt.evaluation_contexts||this.ns||(Ie.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ns=!0),t!=null&&t.length?t.filter((r=>{var n=r&&typeof r=="string"&&r.trim().length>0;return n||Ie.error("Invalid evaluation context found:",r,"Expected non-empty string"),n})):[]}cs(){return this.hs().length>0}initialize(){var e,t,{config:r}=this._instance,n=(e=(t=r.bootstrap)==null?void 0:t.featureFlags)!==null&&e!==void 0?e:{};if(Object.keys(n).length){var i,s,o=(i=(s=r.bootstrap)==null?void 0:s.featureFlagPayloads)!==null&&i!==void 0?i:{},a=Object.keys(n).filter((u=>!!n[u])).reduce(((u,l)=>(u[l]=n[l]||!1,u)),{}),c=Object.keys(o).filter((u=>a[u])).reduce(((u,l)=>(o[l]&&(u[l]=o[l]),u)),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:c})}}updateFlags(e,t,r){var n=r!=null&&r.merge?this.getFlagVariants():{},i=r!=null&&r.merge?this.getFlagPayloads():{},s=S({},n,e),o=S({},i,t),a={};for(var[c,u]of Object.entries(s)){var l=typeof u=="string";a[c]={key:c,enabled:!!l||!!u,variant:l?u:void 0,reason:void 0,metadata:k(o?.[c])?void 0:{id:0,version:void 0,description:void 0,payload:o[c]}}}this.receivedFeatureFlags({flags:a})}get hasLoadedFlags(){return this.Yn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.os(Co),t=this.os(ot),r=this.os(gr);if(!r&&!t)return e||{};var n=le({},e||{});for(var i of[...new Set([...Object.keys(r||{}),...Object.keys(t||{})])]){var s,o,a=n[i],c=t?.[i],u=k(c)?(s=a?.enabled)!==null&&s!==void 0&&s:!!c,l=k(c)?a.variant:typeof c=="string"?c:void 0,d=r?.[i],p=S({},a,{enabled:u,variant:u?l??a?.variant:void 0});u!==a?.enabled&&(p.original_enabled=a?.enabled),l!==a?.variant&&(p.original_variant=a?.variant),d&&(p.metadata=S({},a?.metadata,{payload:d,original_payload:a==null||(o=a.metadata)==null?void 0:o.payload})),n[i]=p}return this.Kn||(Ie.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:r,finalDetails:n}),this.Kn=!0),n}getFlagVariants(){var e=this.os(br),t=this.os(ot);if(!t)return e||{};for(var r=le({},e),n=Object.keys(t),i=0;n.length>i;i++)r[n[i]]=t[n[i]];return this.Kn||(Ie.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:r}),this.Kn=!0),r}getFlagPayloads(){var e=this.os(Ao),t=this.os(gr);if(!t)return e||{};for(var r=le({},e||{}),n=Object.keys(t),i=0;n.length>i;i++)r[n[i]]=t[n[i]];return this.Kn||(Ie.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:r}),this.Kn=!0),r}reloadFeatureFlags(){this.es||this.qt.advanced_disable_feature_flags||this.ds||(this._instance.Li.emit("featureFlagsReloading",!0),this.ds=setTimeout((()=>{this.vs()}),5))}fs(){clearTimeout(this.ds),this.ds=void 0}ensureFlagsLoaded(){this.Yn||this.Xn||this.ds||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.es=e}vs(e){var t;if(this.fs(),!this._instance.Lr())if(this.Xn)this.ts=!0;else{var r=this.qt.token,n=this.os(Ci),i={token:r,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:S({},((t=this.ni)==null?void 0:t.get_initial_props())||{},this.os(nn)||{}),group_properties:this.os(jt),timezone:Ip()};bt(n)||k(n)||(i.$device_id=n),(e!=null&&e.disableFlags||this.qt.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.cs()&&(i.evaluation_contexts=this.hs());var s=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.qt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Xn=!0,this._instance._send_request({method:"POST",url:s,data:i,compression:this.qt.disable_compression?void 0:Ze.Base64,timeout:this.qt.feature_flag_request_timeout_ms,callback:o=>{var a,c,u,l=!0;if(o.statusCode===200&&(this.ts||(this.$anon_distinct_id=void 0),l=!1),this.Xn=!1,!i.disable_flags||this.ts){this.rs=!l;var d=[];o.error?o.error instanceof Error?d.push(o.error.name==="AbortError"?"timeout":"connection_error"):d.push("unknown_error"):o.statusCode!==200&&d.push("api_error_"+o.statusCode),(a=o.json)!=null&&a.errorsWhileComputingFlags&&d.push("errors_while_computing_flags");var p,f=!((c=o.json)==null||(c=c.quotaLimited)==null||!c.includes("feature_flags"));f&&d.push("quota_limited"),(u=this.ni)==null||u.register({[Mo]:d}),f?Ie.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(i.disable_flags||this.receivedFeatureFlags((p=o.json)!==null&&p!==void 0?p:{},l,{partialResponse:!!this.qt.advanced_only_evaluate_survey_feature_flags}),this.ts&&(this.ts=!1,this.vs()))}}})}}getFeatureFlag(e,t){var r;if(t===void 0&&(t={}),!t.fresh||this.rs)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var n=this.getFeatureFlagResult(e,t);return(r=n?.variant)!==null&&r!==void 0?r:n?.enabled}}else Ie.warn('getFeatureFlag for key "'+e+Us)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return t?.payload}getFeatureFlagResult(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs)if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ls()){var r=this.getFlagVariants(),n=e in r,i=r[e],s=this.getFlagPayloads()[e],o=String(i),a=this.os(Oo)||void 0,c=this.os(Oi)||void 0,u=this.os(ln)||{};if(this.qt.advanced_feature_flags_dedup_per_session){var l,d=this._instance.get_session_id(),p=this.os(Fo);d&&d!==p&&(u={},(l=this.ni)==null||l.register({[ln]:u,[Fo]:d}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){var f,h,g,m,w,P,A,$,y,R;G(u[e])?u[e].push(o):u[e]=[o],(f=this.ni)==null||f.register({[ln]:u});var v=this.getFeatureFlagDetails(e),b=[...(h=this.os(Mo))!==null&&h!==void 0?h:[]];k(i)&&b.push("flag_missing");var T={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:s||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:c,$feature_flag_bootstrapped_response:((g=this.qt.bootstrap)==null||(g=g.featureFlags)==null?void 0:g[e])||null,$feature_flag_bootstrapped_payload:((m=this.qt.bootstrap)==null||(m=m.featureFlagPayloads)==null?void 0:m[e])||null,$used_bootstrap_value:!this.rs};k(v==null||(w=v.metadata)==null?void 0:w.version)||(T.$feature_flag_version=v.metadata.version);var C,L=(P=v==null||(A=v.reason)==null?void 0:A.description)!==null&&P!==void 0?P:v==null||($=v.reason)==null?void 0:$.code;L&&(T.$feature_flag_reason=L),v!=null&&(y=v.metadata)!=null&&y.id&&(T.$feature_flag_id=v.metadata.id),k(v?.original_variant)&&k(v?.original_enabled)||(T.$feature_flag_original_response=k(v.original_variant)?v.original_enabled:v.original_variant),v!=null&&(R=v.metadata)!=null&&R.original_payload&&(T.$feature_flag_original_payload=v==null||(C=v.metadata)==null?void 0:C.original_payload),b.length&&(T.$feature_flag_error=b.join(",")),this._instance.capture("$feature_flag_called",T)}if(n){var D=s;if(!k(s))try{D=JSON.parse(s)}catch{}return{key:e,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:D}}}}else Ie.warn('getFeatureFlagResult for key "'+e+Us)}getRemoteConfigPayload(e,t){var r=this.qt.token,n={distinct_id:this._instance.get_distinct_id(),token:r};this.cs()&&(n.evaluation_contexts=this.hs()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:n,compression:this.qt.disable_compression?void 0:Ze.Base64,timeout:this.qt.feature_flag_request_timeout_ms,callback(i){var s,o=(s=i.json)==null?void 0:s.featureFlagPayloads;t(o?.[e]||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),!t.fresh||this.rs){if(this.Yn||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlag(e,t);return k(r)?void 0:!!r}Ie.warn('isFeatureEnabled for key "'+e+Us)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((t=>t!==e))}receivedFeatureFlags(e,t,r){if(this.ni){this.Yn=!0;var n=this.getFlagVariants(),i=this.getFlagPayloads(),s=this.getFlagsWithDetails();(function(o,a,c,u,l,d){c===void 0&&(c={}),u===void 0&&(u={}),l===void 0&&(l={});var p=(b=>{var T=b.flags;return T?(b.featureFlags=Object.fromEntries(Object.keys(T).map((C=>{var L;return[C,(L=T[C].variant)!==null&&L!==void 0?L:T[C].enabled]}))),b.featureFlagPayloads=Object.fromEntries(Object.keys(T).filter((C=>T[C].enabled)).filter((C=>{var L;return(L=T[C].metadata)==null?void 0:L.payload})).map((C=>{var L;return[C,(L=T[C].metadata)==null?void 0:L.payload]})))):Ie.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),b})(o),f=p.flags,h=p.featureFlags,g=p.featureFlagPayloads;if(h){var m=o.requestId,w=o.evaluatedAt;if(G(h)){Ie.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var P={};if(h)for(var A=0;h.length>A;A++)P[h[A]]=!0;a&&a.register({[di]:h,[br]:P})}else{var $=h,y=g,R=f;if(d!=null&&d.partialResponse)$=S({},c,$),y=S({},u,y),R=S({},l,R);else if(o.errorsWhileComputingFlags)if(f){var v=new Set(Object.keys(f).filter((b=>{var T;return!((T=f[b])!=null&&T.failed)})));$=S({},c,Object.fromEntries(Object.entries($).filter((b=>{var[T]=b;return v.has(T)})))),y=S({},u,Object.fromEntries(Object.entries(y||{}).filter((b=>{var[T]=b;return v.has(T)})))),R=S({},l,Object.fromEntries(Object.entries(R||{}).filter((b=>{var[T]=b;return v.has(T)}))))}else $=S({},c,$),y=S({},u,y),R=S({},l,R);a&&a.register(S({[di]:Object.keys(zu($)),[br]:$||{},[Ao]:y||{},[Co]:R||{}},m?{[Oo]:m}:{},w?{[Oi]:w}:{}))}}})(e,this.ni,n,i,s,r),t||(this.ss=!1),this.ps(t)}}override(e,t){t===void 0&&(t=!1),Ie.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.ni)return Ie.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this.ni.unregister(ot),this.ni.unregister(gr),this.ps(),Ut.info("All overrides cleared");if(G(e)){var t=Wu(e);return this.ni.register({[ot]:t}),this.ps(),Ut.info("Flag overrides set",{flags:e})}if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var r,n=e;if(this.Kn=!!((r=n.suppressWarning)!==null&&r!==void 0&&r),"flags"in n){if(n.flags===!1)this.ni.unregister(ot),Ut.info("Flag overrides cleared");else if(n.flags){if(G(n.flags)){var i=Wu(n.flags);this.ni.register({[ot]:i})}else this.ni.register({[ot]:n.flags});Ut.info("Flag overrides set",{flags:n.flags})}}"payloads"in n&&(n.payloads===!1?(this.ni.unregister(gr),Ut.info("Payload overrides cleared")):n.payloads&&(this.ni.register({[gr]:n.payloads}),Ut.info("Payload overrides set",{payloads:n.payloads}))),this.ps();return}if(e&&typeof e=="object")return this.ni.register({[ot]:e}),this.ps(),Ut.info("Flag overrides set",{flags:e});Ie.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Yn){var{flags:t,flagVariants:r}=this.gs();e(t,r)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,r){var n,i=(this.os(rn)||[]).find((c=>c.flagKey===e)),s={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:s};i&&(o.$early_access_feature_name=i.name),r&&(o.$feature_enrollment_stage=r),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(s,!1);var a=S({},this.getFlagVariants(),{[e]:t});(n=this.ni)==null||n.register({[di]:Object.keys(zu(a)),[br]:a}),this.ps()}getEarlyAccessFeatures(e,t,r){t===void 0&&(t=!1);var n=this.os(rn),i=r?"&"+r.map((s=>"stage="+s)).join("&"):"";if(n&&!t)return e(n);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.qt.token+i),method:"GET",callback:s=>{var o,a;if(s.json){var c=s.json.earlyAccessFeatures;return(o=this.ni)==null||o.unregister(rn),(a=this.ni)==null||a.register({[rn]:c}),e(c)}}})}gs(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter((r=>t[r])),flagVariants:Object.keys(t).filter((r=>t[r])).reduce(((r,n)=>(r[n]=t[n],r)),{})}}ps(e){var{flags:t,flagVariants:r}=this.gs();this.featureFlagEventHandlers.forEach((n=>n(t,r,{errorsLoading:e})))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var r=this.os(nn)||{},n=e?.$set||(e!=null&&e.$set_once?{}:e),i=e?.$set_once,s={};if(i)for(var o in i)({}).hasOwnProperty.call(i,o)&&(o in r||(s[o]=i[o]));this._instance.register({[nn]:S({},r,s,n)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(nn)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var r=this.os(jt)||{};Object.keys(r).length!==0&&Object.keys(r).forEach((n=>{r[n]=S({},r[n],e[n]),delete e[n]})),this._instance.register({[jt]:S({},r,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.os(jt)||{};this._instance.register({[jt]:S({},t,{[e]:{}})})}else this._instance.unregister(jt)}reset(){this.Yn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.$anon_distinct_id=void 0,this.fs(),this.Kn=!1}}},cS={sessionRecording:class{get qt(){return this._instance.config}get ni(){return this._instance.persistence}get started(){var e;return!((e=this.ys)==null||!e.isStarted)}get status(){var e,t;return this.bs===Kr||this.bs===ri?this.bs:(e=(t=this.ys)==null?void 0:t.status)!==null&&e!==void 0?e:this.bs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.bs=Mu,this._s=void 0,this._instance=e,!this._instance.sessionManager)throw It.error("started without valid sessionManager"),new Error(ta+" started without valid sessionManager. This is a bug.");if(this.qt.cookieless_mode===ut)throw new Error(ta+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get ws(){var e,t=!((e=this._instance.get_property(tn))==null||!e.enabled),r=!this.qt.disable_session_recording,n=this.qt.disable_session_recording||this._instance.consent.isOptedOut();return _&&t&&r&&!n}startIfEnabledOrStop(e){var t;if(!this.ws||(t=this.ys)==null||!t.isStarted){var r=!k(Object.assign)&&!k(Array.from);this.ws&&r?(this.xs(e),It.info("starting")):(this.bs=Mu,this.stopRecording())}}xs(e){var t,r,n;this.ws&&(this.bs!==Kr&&this.bs!==ri&&(this.bs=Lu),F!=null&&(t=F.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(r=F.__PosthogExtensions__)!=null&&r.initSessionRecording?this.Ss(e):(n=F.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,this.ks,(i=>{if(i)return It.error("could not load recorder",i);this.Ss(e)})))}stopRecording(){var e,t;(e=this._s)==null||e.call(this),this._s=void 0,(t=this.ys)==null||t.stop()}Cs(){var e,t;(e=this._s)==null||e.call(this),this._s=void 0,(t=this.ys)==null||t.discard()}Is(){var e;(e=this.ni)==null||e.unregister(Ca)}Ts(e,t){if(B(e))return null;var r,n=Ge(e)?e:parseFloat(e);return typeof(r=n)!="number"||!Number.isFinite(r)||0>r||r>1?(It.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):n}Es(e){if(this.ni){var t,r,n=this.ni,i=()=>{var s,o=e.sessionRecording===!1?void 0:e.sessionRecording,a=this.Ts((s=this.qt.session_recording)==null?void 0:s.sampleRate,"session_recording.sampleRate"),c=this.Ts(o?.sampleRate,"remote config sampleRate"),u=a??c;B(u)&&this.Is();var l=o?.minimumDurationMilliseconds;n.register({[tn]:S({cache_timestamp:Date.now(),enabled:!!o},o,{networkPayloadCapture:S({capturePerformance:e.capturePerformance},o?.networkPayloadCapture),canvasRecording:{enabled:o?.recordCanvas,fps:o?.canvasFps,quality:o?.canvasQuality},sampleRate:u,minimumDurationMilliseconds:k(l)?null:l,endpoint:o?.endpoint,triggerMatchType:o?.triggerMatchType,masking:o?.masking,urlTriggers:o?.urlTriggers,version:o?.version,triggerGroups:o?.triggerGroups})})};i(),(t=this._s)==null||t.call(this),this._s=(r=this._instance.sessionManager)==null?void 0:r.onSessionId(i)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording===!1?(this.Es(e),this.Cs()):(this.Es(e),this.startIfEnabledOrStop()):(this.bs===Kr&&(this.bs=ri,It.warn("config refresh failed, recording will not start until page reload")),this.startIfEnabledOrStop())}log(e,t){var r;t===void 0&&(t="log"),(r=this.ys)!=null&&r.log?this.ys.log(e,t):It.warn("log called before recorder was ready")}get ks(){var e,t,r=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(tn);return(r==null||(t=r.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}Ms(){var e,t=this._instance.get_property(tn);if(!t)return!1;var r=(e=(typeof t=="object"?t:JSON.parse(t)).cache_timestamp)!==null&&e!==void 0?e:Date.now();return 36e5>=Date.now()-r}Ss(e){var t,r;if((t=F.__PosthogExtensions__)==null||!t.initSessionRecording)return It.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[fp]:!0});if(this.ys||(this.ys=(r=F.__PosthogExtensions__)==null?void 0:r.initSessionRecording(this._instance),this.ys._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ms()){if(this.bs===ri||this.bs===Kr)return;this.bs=Kr,It.info("persisted remote config is stale, requesting fresh config before starting"),new xp(this._instance).load();return}this.bs=Lu,this.ys.start(e)}onRRwebEmit(e){var t;(t=this.ys)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.ys||(t=this.ni)==null||t.register({[cp]:!0}),(e=this.ys)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ys||(t=this.ni)==null||t.register({[ap]:!0}),(e=this.ys)==null||e.overrideSampling()}overrideTrigger(e){var t,r;this.ys||(r=this.ni)==null||r.register({[e==="url"?up:lp]:!0}),(t=this.ys)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.ys)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var r;return!((r=this.ys)==null||!r.tryAddCustomEvent(e,t))}}},uS={autocapture:class{constructor(e){this.Ps=!1,this.Rs=null,this.Os=!1,this.instance=e,this.rageclicks=new $u(e.config.rageclick),this.Ls=null}initialize(){this.startIfEnabled()}get qt(){var e,t,r=de(this.instance.config.autocapture)?this.instance.config.autocapture:{};return r.url_allowlist=(e=r.url_allowlist)==null?void 0:e.map((n=>new RegExp(n))),r.url_ignorelist=(t=r.url_ignorelist)==null?void 0:t.map((n=>new RegExp(n))),r}Fs(){if(this.isBrowserSupported()){if(_&&I){var e=r=>{r=r||_?.event;try{this.As(r)}catch(n){Ls.error("Failed to capture event",n)}};if(pe(I,"submit",e,{capture:!0}),pe(I,"change",e,{capture:!0}),pe(I,"click",e,{capture:!0}),this.qt.capture_copied_text){var t=r=>{r=r||_?.event;try{this.As(r,Ms)}catch(n){Ls.error("Failed to capture copy/cut event",n)}};pe(I,"copy",t,{capture:!0}),pe(I,"cut",t,{capture:!0})}}}else Ls.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Ps&&(this.Fs(),this.Ps=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Os=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Eo]:!!e.autocapture_opt_out}),this.Rs=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Ls=e}getElementSelectors(e){var t,r=[];return(t=this.Ls)==null||t.forEach((n=>{I?.querySelectorAll(n)?.forEach((i=>{e===i&&r.push(n)}))})),r}get isEnabled(){var e,t,r=(e=this.instance.persistence)==null?void 0:e.props[Eo];if(bt(this.Rs)&&!et(r)&&!this.instance.Lr())return!1;var n=(t=this.Rs)!==null&&t!==void 0?t:!!r;return!!this.instance.config.autocapture&&!n}As(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var r,n=ku(e);Lp(n)&&(n=n.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||new Date().getTime())&&(function(d,p){if(!_||Qo(d))return!1;var f,h,g;if(et(p)?(f=!!p&&Pu,h=void 0):(f=(g=p?.css_selector_ignorelist)!==null&&g!==void 0?g:Pu,h=p?.content_ignorelist),f===!1)return!1;var{targetElementList:m}=Cu(d,!1);return!(function(w,P){if(w===!1||k(w))return!1;var A;if(w===!0)A=z0;else{if(!G(w))return!1;if(w.length>10)return x.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;A=w.map(($=>$.toLowerCase()))}return P.some(($=>{var{safeText:y,ariaLabel:R}=$;return A.some((v=>y.includes(v)||R.includes(v)))}))})(h,m.map((w=>{var P;return{safeText:kn(w).toLowerCase(),ariaLabel:((P=w.getAttribute("aria-label"))==null?void 0:P.toLowerCase().trim())||""}})))&&!Ru(m,f)})(n,this.instance.config.rageclick)&&this.As(e,"$rageclick");var i=t===Ms;if(n&&(function(d,p,f,h,g){var m,w,P,A;if(f===void 0&&(f=void 0),!_||Qo(d)||(m=f)!=null&&m.url_allowlist&&!xu(f.url_allowlist)||(w=f)!=null&&w.url_ignorelist&&xu(f.url_ignorelist))return!1;if((P=f)!=null&&P.dom_event_allowlist){var $=f.dom_event_allowlist;if($&&!$.some((T=>p.type===T)))return!1}var{parentIsUsefulElement:y,targetElementList:R}=Cu(d,h);if(!(function(T,C){var L=C?.element_allowlist;if(k(L))return!0;var D,N=function(Z){if(L.some((J=>Z.tagName.toLowerCase()===J)))return{v:!0}};for(var q of T)if(D=N(q))return D.v;return!1})(R,f)||!Ru(R,(A=f)==null?void 0:A.css_selector_allowlist))return!1;var v=_.getComputedStyle(d);if(v&&v.getPropertyValue("cursor")==="pointer"&&p.type==="click")return!0;var b=d.tagName.toLowerCase();switch(b){case"html":return!1;case"form":return(g||["submit"]).indexOf(p.type)>=0;case"input":case"select":case"textarea":return(g||["change","click"]).indexOf(p.type)>=0;default:return y?(g||["click"]).indexOf(p.type)>=0:(g||["click"]).indexOf(p.type)>=0&&(Ma.indexOf(b)>-1||d.getAttribute("contenteditable")==="true")}})(n,e,this.qt,i,i?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=Z0(n,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.qt.element_attribute_ignorelist,elementsChainAsString:this.Os});if(o)return!1;var a=this.getElementSelectors(n);if(a&&a.length>0&&(s.$element_selectors=a),t===Ms){var c,u=qp(_==null||(c=_.getSelection())==null?void 0:c.toString()),l=e.type||"clipboard";if(!u)return!1;s.$selected_content=u,s.$copy_type=l}return this.instance.capture(t,s),!0}}}isBrowserSupported(){return ct(I?.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Ns=(_==null||(t=_.location)==null?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(x.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.$s&&this.$s(),this.$s=void 0,x.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(_&&_.history){var r=this;(e=_.history.pushState)!=null&&e.__posthog_wrapped__||Nu(_.history,"pushState",(n=>function(i,s,o){n.call(this,i,s,o),r.Ds("pushState")})),(t=_.history.replaceState)!=null&&t.__posthog_wrapped__||Nu(_.history,"replaceState",(n=>function(i,s,o){n.call(this,i,s,o),r.Ds("replaceState")})),this.qs()}}Ds(e){try{var t,r=_==null||(t=_.location)==null?void 0:t.pathname;if(!r)return;r!==this.Ns&&this.isEnabled&&this._instance.capture(_r,{navigation_type:e}),this.Ns=r}catch(n){x.error("Error capturing "+e+" pageview",n)}}qs(){if(!this.$s){var e=()=>{this.Ds("popstate")};pe(_,"popstate",e),this.$s=()=>{_&&_.removeEventListener("popstate",e)}}}},heatmaps:class{get qt(){return this.instance.config}constructor(e){var t;this.js=!1,this.Ps=!1,this.Hs=null,this.instance=e,this.js=!((t=this.instance.persistence)==null||!t.props[wo]),this.rageclicks=new $u(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return de(this.qt.capture_heatmaps)&&this.qt.capture_heatmaps.flush_interval_milliseconds&&(e=this.qt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return B(this.qt.capture_heatmaps)?B(this.qt.enable_heatmaps)?this.js:this.qt.enable_heatmaps:this.qt.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.Ps)return;eS.info("starting..."),this.Us(),this.At()}else{var e;clearInterval((e=this.Hs)!==null&&e!==void 0?e:void 0),this.Bs(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[wo]:t}),this.js=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.M;return this.M=void 0,e}zs(e){this.Mt(e.originalEvent,"deadclick")}At(){this.Hs&&clearInterval(this.Hs),this.Hs=I?.visibilityState==="visible"?setInterval(this.Zr.bind(this),this.flushIntervalMilliseconds):null}Us(){_&&I&&(this.Vs=this.Zr.bind(this),pe(_,Mi,this.Vs),this.Ws=e=>this.Mt(e||_?.event),pe(I,"click",this.Ws,{capture:!0}),this.Zs=e=>this.Gs(e||_?.event),pe(I,"mousemove",this.Zs,{capture:!0}),this.Qs=new ou(this.instance,l0,this.zs.bind(this)),this.Qs.startIfEnabledOrStop(),this.Js=this.At.bind(this),pe(I,Fi,this.Js),this.Ps=!0)}Bs(){var e;_&&I&&(this.Vs&&_.removeEventListener(Mi,this.Vs),this.Ws&&I.removeEventListener("click",this.Ws,{capture:!0}),this.Zs&&I.removeEventListener("mousemove",this.Zs,{capture:!0}),this.Js&&I.removeEventListener(Fi,this.Js),clearTimeout(this.Ks),(e=this.Qs)==null||e.stop(),this.Ps=!1)}Ys(e,t){var r=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),s=(function(o,a,c){for(var u=o;u&&Qt(u)&&!Ye(u,"body");){if(u===c)return!1;if(j(a,_?.getComputedStyle(u).position))return!0;u=Up(u)}return!1})(ku(e),["fixed","sticky"],i);return{x:e.clientX+(s?0:n),y:e.clientY+(s?0:r),target_fixed:s,type:t}}Mt(e,t){var r;if(t===void 0&&(t="click"),!Iu(e.target)&&Du(e)){var n=this.Ys(e,t);(r=this.rageclicks)!=null&&r.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Xs(S({},n,{type:"rageclick"})),this.Xs(n)}}Gs(e){!Iu(e.target)&&Du(e)&&(clearTimeout(this.Ks),this.Ks=setTimeout((()=>{this.Xs(this.Ys(e,"mousemove"))}),500))}Xs(e){if(_){var t=_.location.href,r=this.qt.custom_personal_data_properties,n=In(t,this.qt.mask_personal_data_properties?[...Nr,...r||[]]:[],xn);this.M=this.M||{},this.M[n]||(this.M[n]=[]),this.M[n].push(e)}}Zr(){this.M&&!yr(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:ou,webVitalsAutocapture:class{constructor(e){var t;this.js=!1,this.Ps=!1,this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.eo=()=>{clearTimeout(this.ro),this.M.metrics.length!==0&&(this._instance.capture("$web_vitals",this.M.metrics.reduce(((r,n)=>S({},r,{["$web_vitals_"+n.name+"_event"]:S({},n),["$web_vitals_"+n.name+"_value"]:n.value})),{})),this.M={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ht=r=>{var n,i=(n=this._instance.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0);if(k(i))Tt.error("Could not read session ID. Dropping metrics!");else{this.M=this.M||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.io();k(s)||(B(r?.name)||B(r?.value)?Tt.error("Invalid metric received",r):!this.no||this.no>r.value?(this.M.url!==s&&(this.eo(),this.ro=setTimeout(this.eo,this.flushToCaptureTimeoutMs)),k(this.M.url)&&(this.M.url=s),this.M.firstMetricTimestamp=k(this.M.firstMetricTimestamp)?Date.now():this.M.firstMetricTimestamp,r.attribution&&r.attribution.interactionTargetElement&&(r.attribution.interactionTargetElement=void 0),this.M.metrics.push(S({},r,{$current_url:s,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.M.metrics.length===this.allowedMetrics.length&&this.eo()):Tt.error("Ignoring metric with value >= "+this.no,r))}},this.so=()=>{if(!this.Ps){var r,n,i,s,o=F.__PosthogExtensions__;k(o)||k(o.postHogWebVitalsCallbacks)||({onLCP:r,onCLS:n,onFCP:i,onINP:s}=o.postHogWebVitalsCallbacks),r&&n&&i&&s?(this.allowedMetrics.indexOf("LCP")>-1&&r(this.ht.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&n(this.ht.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.ht.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.ht.bind(this)),this.Ps=!0):Tt.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.js=!((t=this._instance.persistence)==null||!t.props[ko]),this.startIfEnabled()}get oo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,r=de(this.oo)?(e=this.oo)==null?void 0:e.web_vitals_allowed_metrics:void 0;return B(r)?((t=this._instance.persistence)==null?void 0:t.props[Po])||["CLS","FCP","INP","LCP"]:r}get flushToCaptureTimeoutMs(){return(de(this.oo)?this.oo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=de(this.oo)?this.oo.web_vitals_attribution:void 0;return e!=null&&e}get no(){var e=de(this.oo)&&Ge(this.oo.__web_vitals_max_value)?this.oo.__web_vitals_max_value:Fu;return e>0&&6e4>=e?Fu:e}get isEnabled(){var e=me?.protocol;if(e!=="http:"&&e!=="https:")return Tt.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=de(this.oo)?this.oo.web_vitals:et(this.oo)?this.oo:void 0;return et(t)?t:this.js}startIfEnabled(){this.isEnabled&&!this.Ps&&(Tt.info("enabled, starting..."),this.lr(this.so))}onRemoteConfig(e){if("capturePerformance"in e){var t=de(e.capturePerformance)&&!!e.capturePerformance.web_vitals,r=de(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[ko]:t}),this._instance.persistence.register({[Po]:r})),this.js=t,this.startIfEnabled()}}lr(e){var t,r;(t=F.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks?e():(r=F.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(n=>{n?Tt.error("failed to load script",n):e()}))}io(){var e=_?_.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return In(e,this._instance.config.mask_personal_data_properties?[...Nr,...t||[]]:[],xn)}Tt.error("Could not determine current URL")}}},lS={exceptionObserver:class{constructor(e){var t,r,n;this.so=()=>{var i;if(_&&this.isEnabled&&(i=F.__PosthogExtensions__)!=null&&i.errorWrappingFunctions){var s=F.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=F.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,a=F.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ao&&this.qt.capture_unhandled_errors&&(this.ao=s(this.captureException.bind(this))),!this.uo&&this.qt.capture_unhandled_rejections&&(this.uo=o(this.captureException.bind(this))),!this.lo&&this.qt.capture_console_errors&&(this.lo=a(this.captureException.bind(this)))}catch(c){Xr.error("failed to start",c),this.ho()}}},this._instance=e,this.co=!((t=this._instance.persistence)==null||!t.props[To]),this.do=new mb({refillRate:(r=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&r!==void 0?r:1,bucketSize:(n=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&n!==void 0?n:10,refillInterval:1e4,Gt:Xr}),this.qt=this.vo(),this.startIfEnabledOrStop()}vo(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return de(e)?t=S({},t,e):(k(e)?this.co:e)&&(t=S({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.qt.capture_console_errors||this.qt.capture_unhandled_errors||this.qt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Xr.info("enabled"),this.ho(),this.lr(this.so)):this.ho()}lr(e){var t,r;(t=F.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(r=F.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"exception-autocapture",(n=>{if(n)return Xr.error("failed to load script",n);e()}))}ho(){var e,t,r;(e=this.ao)==null||e.call(this),this.ao=void 0,(t=this.uo)==null||t.call(this),this.uo=void 0,(r=this.lo)==null||r.call(this),this.lo=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.co=!!e.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[To]:this.co}),this.qt=this.vo(),this.startIfEnabledOrStop())}onConfigChange(){this.qt=this.vo()}captureException(e){var t,r,n,i=(t=e==null||(r=e.$exception_list)==null||(r=r[0])==null?void 0:r.type)!==null&&t!==void 0?t:"Exception";this.do.consumeRateLimit(i)?Xr.info("Skipping exception capture because of client rate limiting.",{exception:i}):(n=this._instance.exceptions)==null||n.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,r;this.fo=[],this.po=new Ab([new qb,new Yb,new Hb,new Ub,new Gb,new zb,new Bb,new Vb],(function(n){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;i>o;o++)s[o-1]=arguments[o];return function(a,c){c===void 0&&(c=0);for(var u=[],l=a.split(`
22
+ `),d=c;l.length>d;d++){var p=l[d];if(1024>=p.length){var f=ru.test(p)?p.replace(ru,"$1"):p;if(!f.match(/\S*Error: /)){for(var h of s){var g=h(f,n);if(g){u.push(g);break}}if(u.length>=50)break}}}return(function(m){if(!m.length)return[];var w=Array.from(m);return w.reverse(),w.slice(0,50).map((P=>{return S({},P,{filename:P.filename||(A=w,A[A.length-1]||{}).filename,function:P.function||$r});var A}))})(u)}})("web:javascript",Fb,Db)),this._instance=e,this.fo=(t=(r=this._instance.persistence)==null?void 0:r.get_property(Io))!==null&&t!==void 0?t:[],this.mo=Pi(this.yo()),this.bo=new Kb(this.mo)}onConfigChange(){this.mo=Pi(this.yo()),this.bo.setConfig(this.mo)}onRemoteConfig(e){var t,r,n;if("errorTracking"in e){var i=(t=(r=e.errorTracking)==null?void 0:r.suppressionRules)!==null&&t!==void 0?t:[],s=(n=e.errorTracking)==null?void 0:n.captureExtensionExceptions;this.fo=i,this._instance.persistence&&this._instance.persistence.register({[Io]:this.fo,[xo]:s})}}get _o(){var e,t=!!this._instance.get_property(xo),r=this._instance.config.error_tracking.captureExtensionExceptions;return(e=r??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.po.buildFromUnknown(e,{syntheticException:t?.syntheticException,mechanism:{handled:t?.handled}})}addExceptionStep(e,t){if(this.mo.enabled)try{if(!ce(e)||e.trim().length===0)return void st.warn("Ignoring exception step because message must be a non-empty string");var{sanitizedProperties:r,droppedKeys:n}=(function(i){if(!i)return{sanitizedProperties:{},droppedKeys:[]};var s=[];return{sanitizedProperties:Object.keys(i).reduce(((o,a)=>Xb.has(a)?(s.push(a),o):(o[a]=i[a],o)),{}),droppedKeys:s}})(this.wo(t));n.length>0&&st.warn("Ignoring reserved exception step fields",{droppedKeys:n}),this.bo.add(S({[ki]:e,[Ri]:new Date().toISOString()},r))}catch(i){st.error("Failed to add exception step. Ignoring breadcrumb.",i)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.xo(t)){if(this.So(t))return this.ko("Exception dropped: matched a suppression rule"),void st.info("Skipping exception capture because a suppression rule matched");if(!this._o&&this.Co(t))return this.ko("Exception dropped: thrown by a browser extension"),void st.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Io(t))return this.ko("Exception dropped: thrown by the PostHog SDK"),void st.info("Skipping exception capture because it was thrown by the PostHog SDK")}var r=this.mo.enabled&&B(e.$exception_steps)?this.To(e):e;try{var n=this._instance.capture("$exception",r,{_noTruncate:!0,_batchKey:"exceptionEvent",en:!0});return n&&this.bo.clear(),n}catch(i){st.error("Failed to capture exception event. Dropping this exception.",i),this.bo.clear();return}}catch(i){st.error("Failed to process exception event. Ignoring this exception.",i);return}}To(e){try{var t=this.bo.getAttachable();return t.length===0?e:S({},e,{$exception_steps:t})}catch(r){return st.error("Failed to read buffered exception steps. Capturing exception without steps.",r),e}}ko(e){this.mo.enabled&&this.bo.add({[ki]:e,[Ri]:new Date().toISOString()})}wo(e){return de(e)?S({},e):{}}yo(){var e,t;return(e=(t=this._instance.config.error_tracking)==null?void 0:t.exception_steps)!==null&&e!==void 0?e:{}}So(e){if(e.length===0)return!1;var t=e.reduce(((r,n)=>{var{type:i,value:s}=n;return ce(i)&&i.length>0&&r.$exception_types.push(i),ce(s)&&s.length>0&&r.$exception_values.push(s),r}),{$exception_types:[],$exception_values:[]});return this.fo.some((r=>{var n=r.values.map((i=>{var s,o=$p[i.operator],a=G(i.value)?i.value:[i.value],c=(s=t[i.key])!==null&&s!==void 0?s:[];return a.length>0&&o(a,c)}));return r.type==="OR"?n.some(Boolean):n.every(Boolean)}))}Co(e){return e.flatMap((t=>{var r,n;return(r=(n=t.stacktrace)==null?void 0:n.frames)!==null&&r!==void 0?r:[]})).some((t=>t.filename&&t.filename.startsWith("chrome-extension://")))}Io(e){if(e.length>0){var t,r,n,i,s=(t=(r=e[0].stacktrace)==null?void 0:r.frames)!==null&&t!==void 0?t:[],o=s[s.length-1];return(n=o==null||(i=o.filename)==null?void 0:i.includes("posthog.com/static"))!==null&&n!==void 0&&n}return!1}xo(e){return!B(e)&&G(e)}}},dS=S({productTours:class{get ni(){return this._instance.persistence}constructor(e){this.Eo=null,this.Mo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){"productTours"in e&&(this.ni&&this.ni.register({[Ro]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Eo||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(Ro)||this.lr((()=>this.Po()))}lr(e){var t,r;(t=F.__PosthogExtensions__)!=null&&t.generateProductTours?e():(r=F.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"product-tours",(n=>{n?qu.error("Could not load product tours script",n):e()}))}Po(){var e;!this.Eo&&(e=F.__PosthogExtensions__)!=null&&e.generateProductTours&&(this.Eo=F.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(t===void 0&&(t=!1),!G(this.Mo)||t){var r=this.ni;if(r){var n=r.props[pi];if(G(n)&&!t)return this.Mo=n,void e(n,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:i=>{var s=i.statusCode;if(s!==200||!i.json){var o="Product Tours API could not be loaded, status: "+s;qu.error(o),e([],{isLoaded:!1,error:o});return}var a=G(i.json.product_tours)?i.json.product_tours:[];this.Mo=a,r&&r.register({[pi]:a}),e(a,{isLoaded:!0})}})}else e(this.Mo,{isLoaded:!0})}getActiveProductTours(e){B(this.Eo)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Eo.getActiveProductTours(e)}showProductTour(e){var t;(t=this.Eo)==null||t.showTourById(e)}previewTour(e){this.Eo?this.Eo.previewTour(e):this.lr((()=>{var t;this.Po(),(t=this.Eo)==null||t.previewTour(e)}))}dismissProductTour(){var e;(e=this.Eo)==null||e.dismissTour("user_clicked_skip")}nextStep(){var e;(e=this.Eo)==null||e.nextStep()}previousStep(){var e;(e=this.Eo)==null||e.previousStep()}clearCache(){var e;this.Mo=null,(e=this.ni)==null||e.unregister(pi)}resetTour(e){var t;(t=this.Eo)==null||t.resetTour(e)}resetAllTours(){var e;(e=this.Eo)==null||e.resetAllTours()}cancelPendingTour(e){var t;(t=this.Eo)==null||t.cancelPendingTour(e)}}},ts),pS={siteApps:class{constructor(e){this._instance=e,this.Ro=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Oo(e,t){if(t){var r=this.globalsForEvent(t);this.Ro.push(r),this.Ro.length>1e3&&(this.Ro=this.Ro.slice(10))}}get siteAppLoaders(){var e;return(e=F._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Oo.bind(this));this.Lo=()=>{e(),this.Ro=[],this.Lo=void 0}}}globalsForEvent(e){var t,r,n,i,s,o,a;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],l=this._instance.get_property("$stored_group_properties")||{};for(var[d,p]of Object.entries(l))c[d]={id:u[d],type:d,properties:p};var{$set_once:f,$set:h}=e;return{event:S({},Fd(e,tS),{properties:S({},e.properties,h?{$set:S({},(t=(r=e.properties)==null?void 0:r.$set)!==null&&t!==void 0?t:{},h)}:{},f?{$set_once:S({},(n=(i=e.properties)==null?void 0:i.$set_once)!==null&&n!==void 0?n:{},f)}:{}),elements_chain:(s=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&s!==void 0?s:"",distinct_id:(a=e.properties)==null?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],r=()=>{var o;!t.errored&&this.Ro.length&&(xt.info("Processing "+this.Ro.length+" events for site app with id "+e.id),this.Ro.forEach((a=>t.processEvent==null?void 0:t.processEvent(a))),t.processedBuffer=!0),Object.values(this.apps).every((a=>a.processedBuffer||a.errored))&&((o=this.Lo)==null||o.call(this))},n=!1,i=o=>{t.errored=!o,t.loaded=!0,xt.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),n&&r()};try{var{processEvent:s}=e.init({posthog:this._instance,callback(o){i(o)}});s&&(t.processEvent=s),n=!0}catch(o){xt.error(Uu+e.id,o),i(!1)}if(n&&t.loaded)try{r()}catch(o){xt.error("Error while processing buffered events PostHog app with config id "+e.id,o),t.errored=!0}}Fo(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var r of e)this.setupSiteApp(r)}Ao(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var r of Object.values(this.apps))try{r.processEvent==null||r.processEvent(t)}catch(n){xt.error("Error while processing event "+e.event+" for site app "+r.id,n)}}}onRemoteConfig(e){var t,r,n,i=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.Fo(),void this._instance.on("eventCaptured",(c=>this.Ao(c)))):void xt.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((r=this.Lo)==null||r.call(this),(n=e.siteApps)!=null&&n.length)if(this.isEnabled){var s=function(c){var u;F["__$$ph_site_app_"+c]=i._instance,(u=F.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(i._instance,a,(l=>{if(l)return xt.error(Uu+c,l)}))};for(var{id:o,url:a}of e.siteApps)s(o)}else xt.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},hS={tracingHeaders:class{constructor(e){this.No=void 0,this.$o=void 0,this.so=()=>{var t,r,n=this.Do()||[];k(this.No)&&((t=F.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(n,this._instance.get_distinct_id(),this._instance.sessionManager)),k(this.$o)&&((r=F.__PosthogExtensions__)==null||(r=r.tracingHeadersPatchFns)==null||r._patchFetch(n,this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}initialize(){this.startIfEnabledOrStop()}lr(e){var t,r;(t=F.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(r=F.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,"tracing-headers",(n=>{if(n)return Q0.error("failed to load script",n);e()}))}Do(){var e;return(e=this._instance.config.addTracingHeaders)!==null&&e!==void 0?e:this._instance.config.__add_tracing_headers}startIfEnabledOrStop(){var e,t;this.Do()?this.lr(this.so):((e=this.No)==null||e.call(this),(t=this.$o)==null||t.call(this),this.No=void 0,this.$o=void 0)}}},fS=S({surveys:class{get qt(){return this._instance.config}constructor(e){this.qo=void 0,this._surveyManager=null,this.jo=!1,this.Ho=[],this.Uo=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.qt.disable_surveys){var t=e.surveys;if(B(t))return ee.warn("Flags not loaded yet. Not loading surveys.");var r=G(t);this.qo=r?t.length>0:t,ee.info("flags response received, isSurveysEnabled: "+this.qo),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var r=localStorage.key(t);(r!=null&&r.startsWith(Jo)||r!=null&&r.startsWith("inProgressSurvey_"))&&e.push(r)}e.forEach((n=>localStorage.removeItem(n)))}loadIfEnabled(){if(!this._surveyManager)if(this.jo)ee.info("Already initializing surveys, skipping...");else if(this.qt.disable_surveys)ee.info(Hu);else if(this.qt.cookieless_mode&&this._instance.consent.isOptedOut())ee.info("Not loading surveys in cookieless mode without consent.");else{var e=F?.__PosthogExtensions__;if(e){if(!k(this.qo)||this.qt.advanced_enable_surveys){var t=this.qo||this.qt.advanced_enable_surveys;this.jo=!0;try{var r=e.generateSurveys;if(r)return void this.Bo(r,t);var n=e.loadExternalDependency;if(!n)return void this.zo(Ho);n(this._instance,"surveys",(i=>{i||!e.generateSurveys?this.zo("Could not load surveys script",i):this.Bo(e.generateSurveys,t)}))}catch(i){throw this.zo("Error initializing surveys",i),i}finally{this.jo=!1}}}else ee.error("PostHog Extensions not found.")}}Bo(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new iS(this._instance),ee.info("Surveys loaded successfully"),this.Vo({isLoaded:!0})}zo(e,t){ee.error(e,t),this.Vo({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Ho.push(e),this._surveyManager&&this.Vo({isLoaded:!0}),()=>{this.Ho=this.Ho.filter((t=>t!==e))}}getSurveys(e,t){if(t===void 0&&(t=!1),this.qt.disable_surveys)return ee.info(Hu),e([]);var r,n=this._instance.get_property($o);if(n&&!t)return e(n,{isLoaded:!0});typeof Promise<"u"&&this.Uo?this.Uo.then((i=>{var{surveys:s,context:o}=i;return e(s,o)})):(typeof Promise<"u"&&(this.Uo=new Promise((i=>{r=i}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.qt.token),method:"GET",timeout:this.qt.surveys_request_timeout_ms,callback:i=>{var s;this.Uo=null;var o=i.statusCode;if(o!==200||!i.json){var a="Surveys API could not be loaded, status: "+o;ee.error(a);var c={isLoaded:!1,error:a};e([],c),r?.({surveys:[],context:c});return}var u,l=i.json.surveys||[],d=l.filter((f=>(function(h){return!(!h.start_date||h.end_date)})(f)&&((function(h){var g;return!((g=h.conditions)==null||(g=g.events)==null||(g=g.values)==null||!g.length)})(f)||(function(h){var g;return!((g=h.conditions)==null||(g=g.actions)==null||(g=g.values)==null||!g.length)})(f))));d.length>0&&((u=this._surveyEventReceiver)==null||u.register(d)),(s=this._instance.persistence)==null||s.register({[$o]:l});var p={isLoaded:!0};e(l,p),r?.({surveys:l,context:p})}}))}Vo(e){for(var t of this.Ho)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(r){ee.error("Error in survey callback",r)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!B(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);ee.warn("init was not called")}Wo(e){var t=null;return this.getSurveys((r=>{var n;t=(n=r.find((i=>i.id===e)))!==null&&n!==void 0?n:null})),t}Zo(e){if(B(this._surveyManager))return{eligible:!1,reason:qs};var t=typeof e=="string"?this.Wo(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(B(this._surveyManager))return ee.warn("init was not called"),{visible:!1,disabledReason:qs};var t=this.Zo(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return B(this._surveyManager)?(ee.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:qs})):new Promise((r=>{this.getSurveys((n=>{var i,s=(i=n.find((a=>a.id===e)))!==null&&i!==void 0?i:null;if(s){var o=this.Zo(s);r({visible:o.eligible,disabledReason:o.reason})}else r({visible:!1,disabledReason:"Survey not found"})}),t)}))}renderSurvey(e,t,r){var n;if(B(this._surveyManager))ee.warn("init was not called");else{var i=typeof e=="string"?this.Wo(e):e;if(i!=null&&i.id)if(F0.includes(i.type)){var s=I?.querySelector(t);if(s)return(n=i.appearance)!=null&&n.surveyPopupDelaySeconds?(ee.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var o,a;ee.info("Rendering survey "+i.id+" with delay of "+((o=i.appearance)==null?void 0:o.surveyPopupDelaySeconds)+" seconds"),(a=this._surveyManager)==null||a.renderSurvey(i,s,r),ee.info("Survey "+i.id+" rendered")}),1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,s,r);ee.warn("Survey element not found")}else ee.warn("Surveys of type "+i.type+" cannot be rendered in the app");else ee.warn("Survey not found")}}displaySurvey(e,t){var r;if(B(this._surveyManager))ee.warn("init was not called");else{var n=this.Wo(e);if(n){var i=n;if((r=n.appearance)!=null&&r.surveyPopupDelaySeconds&&t.ignoreDelay&&(i=S({},n,{appearance:S({},n.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==Wo.Popover&&t.initialResponses&&ee.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),t.ignoreConditions===!1){var s=this.canRenderSurvey(n);if(!s.visible)return void ee.warn("Survey is not eligible to be displayed: ",s.disabledReason)}t.displayType!==Wo.Inline?this._surveyManager.handlePopoverSurvey(i,t):this.renderSurvey(i,t.selector,t.properties)}else ee.warn("Survey not found")}}cancelPendingSurvey(e){B(this._surveyManager)?ee.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}},ts),gS={toolbar:class{constructor(e){this.instance=e}Go(e){F.ph_toolbar_state=e}Qo(){var e;return(e=F.ph_toolbar_state)!==null&&e!==void 0?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,r){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),r===void 0&&(r=void 0),gp(this.instance.config)||!_||!I)return!1;e=e??_.location,r=r??_.history;try{if(!t){try{_.localStorage.setItem("test","test"),_.localStorage.removeItem("test")}catch{return!1}t=_?.localStorage}var n,i=sS||qi(e.hash,"__posthog")||qi(e.hash,"state"),s=i?iu((()=>JSON.parse(atob(decodeURIComponent(i)))))||iu((()=>JSON.parse(decodeURIComponent(i)))):null;return s&&s.action==="ph_authorize"?((n=s).source="url",n&&Object.keys(n).length>0&&(s.desiredHash?e.hash=s.desiredHash:r?r.replaceState(r.state,"",e.pathname+e.search):e.hash="")):((n=JSON.parse(t.getItem(ju)||"{}")).source="localstorage",delete n.userIntent),!(!n.token||this.instance.config.token!==n.token||(this.loadToolbar(n),0))}catch{return!1}}Jo(e){var t=F.ph_load_toolbar||F.ph_load_editor;!B(t)&&ct(t)?t(e,this.instance):Bu.warn("No toolbar load function found")}loadToolbar(e){var t=!(I==null||!I.getElementById(dp));if(!_||t)return!1;var r=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,n=S({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(_.localStorage.setItem(ju,JSON.stringify(S({},n,{source:void 0}))),this.Qo()===2)this.Jo(n);else if(this.Qo()===0){var i;this.Go(1),(i=F.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"toolbar",(s=>{if(s)return Bu.error("[Toolbar] Failed to load",s),void this.Go(0);this.Go(2),this.Jo(n)})),pe(_,"turbolinks:load",(()=>{this.Go(0),this.loadToolbar(n)}))}return!0}Ko(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,r){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),r===void 0&&(r=void 0),this.maybeLoadToolbar(e,t,r)}}},_S=S({experiments:aS},ts),vS=S({},ts,cS,uS,lS,dS,pS,fS,hS,gS,_S,{conversations:class{constructor(e){this.Yo=void 0,this._conversationsManager=null,this.Xo=!1,this.ea=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;B(t)||(et(t)?this.Yo=t:(this.Yo=t.enabled,this.ea=t),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.Yo=void 0,this.ea=null}loadIfEnabled(){if(!(this._conversationsManager||this.Xo||this._instance.config.disable_conversations||gp(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=F?.__PosthogExtensions__;if(e&&!k(this.Yo)&&this.Yo)if(this.ea&&this.ea.token){this.Xo=!0;try{var t=e.initConversations;if(t)return this.ta(t),void(this.Xo=!1);var r=e.loadExternalDependency;if(!r)return void this.ra(Ho);r(this._instance,"conversations",(n=>{n||!e.initConversations?this.ra("Could not load conversations script",n):this.ta(e.initConversations),this.Xo=!1}))}catch(n){this.ra("Error initializing conversations",n),this.Xo=!1}}else He.error("Conversations enabled but missing token in remote config.")}}ta(e){if(this.ea)try{this._conversationsManager=e(this.ea,this._instance),He.info("Conversations loaded successfully")}catch(t){this.ra("Error completing conversations initialization",t)}else He.error("Cannot complete initialization: remote config is null")}ra(e,t){He.error(e,t),this._conversationsManager=null,this.Xo=!1}show(){this._conversationsManager?this._conversationsManager.show():He.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Yo===!0&&!bt(this._conversationsManager)}isVisible(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.isVisible())!==null&&e!==void 0&&e}sendMessage(e,t,r){var n=this;return je((function*(){return n._conversationsManager?n._conversationsManager.sendMessage(e,t,r):(He.warn(Ht),null)}))()}getMessages(e,t){var r=this;return je((function*(){return r._conversationsManager?r._conversationsManager.getMessages(e,t):(He.warn(Ht),null)}))()}markAsRead(e){var t=this;return je((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(He.warn(Ht),null)}))()}getTickets(e){var t=this;return je((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(He.warn(Ht),null)}))()}requestRestoreLink(e){var t=this;return je((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(He.warn(Ht),null)}))()}restoreFromToken(e){var t=this;return je((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(He.warn(Ht),null)}))()}restoreFromUrlToken(){var e=this;return je((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(He.warn(Ht),null)}))()}getCurrentTicketId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,t;return(e=(t=this._conversationsManager)==null?void 0:t.getWidgetSessionId())!==null&&e!==void 0?e:null}ln(){var e;(e=this._conversationsManager)==null||e.setIdentity()}hn(){var e;(e=this._conversationsManager)==null||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.ia=!1,this.na=!1,this.Gt=oe("[logs]"),this.sa=[],this.oa=0,this.aa=0,this.ua=!1,this._instance=e,this._instance&&(t=this._instance.config.logs)!=null&&t.captureConsoleLogs&&(this.ia=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,r=(t=e.logs)==null?void 0:t.captureConsoleLogs;!B(r)&&r&&(this.ia=!0,this.loadIfEnabled())}reset(){this.sa=[],this.qr&&(clearTimeout(this.qr),this.qr=void 0),this.oa=0,this.aa=0,this.ua=!1}loadIfEnabled(){if(this.ia&&!this.na){var e=F?.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",(r=>{var n;r||(n=e.logs)==null||!n.initializeLogs?this.Gt.error("Could not load logs script",r):(e.logs.initializeLogs(this._instance),this.na=!0)})):this.Gt.error(Ho)}else this.Gt.error("PostHog Extensions not found.")}}captureLog(e){var t,r,n,i,s,o;if(this._instance.is_capturing())if(e&&e.body){var a=(t=(r=this._instance.config.logs)==null?void 0:r.flushIntervalMs)!==null&&t!==void 0?t:3e3,c=(n=(i=this._instance.config.logs)==null?void 0:i.maxLogsPerInterval)!==null&&n!==void 0?n:1e3,u=Date.now();if(a>u-this.aa||(this.aa=u,this.oa=0,this.ua=!1),c>this.oa){this.oa++;var l=(function(d,p){var{text:f,number:h}=tp[d.level||"info"]||Pb,g=String(Date.now())+"000000",m={};p.distinctId&&(m.posthogDistinctId=p.distinctId),p.sessionId&&(m.sessionId=p.sessionId),p.currentUrl&&(m["url.full"]=p.currentUrl),p.screenName&&(m["screen.name"]=p.screenName),p.appState&&(m["app.state"]=p.appState),p.activeFeatureFlags&&p.activeFeatureFlags.length>0&&(m.feature_flags=p.activeFeatureFlags);var w=S({},m,d.attributes||{}),P={timeUnixNano:g,observedTimeUnixNano:g,severityNumber:h,severityText:f,body:{stringValue:d.body},attributes:tu(w)};return d.trace_id&&(P.traceId=d.trace_id),d.span_id&&(P.spanId=d.span_id),k(d.trace_flags)||(P.flags=d.trace_flags),P})(e,this.la());this.sa.push({record:l}),((s=(o=this._instance.config.logs)==null?void 0:o.maxBufferSize)!==null&&s!==void 0?s:100)>this.sa.length?this.ha():this.flushLogs()}else this.ua||(this.Gt.warn("captureLog dropping logs: exceeded "+c+" logs per "+a+"ms"),this.ua=!0)}else this.Gt.warn("captureLog requires a body")}get logger(){return this.ca||(this.ca={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.ca}flushLogs(e){if(this.qr&&(clearTimeout(this.qr),this.qr=void 0),this.sa.length!==0){var t=this.sa;this.sa=[];var r=this._instance.config.logs,n=S({"service.name":r?.serviceName||"unknown_service"},r?.environment&&{"deployment.environment":r.environment},r?.serviceVersion&&{"service.version":r.serviceVersion},r?.resourceAttributes),i=(function(o,a,c,u){return{resourceLogs:[{resource:{attributes:tu(a)},scopeLogs:[{scope:{name:c,version:u},logRecords:o}]}]}})(t.map((o=>o.record)),n,Pe.LIB_NAME,Pe.LIB_VERSION),s=this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token);this._instance.Bi({method:"POST",url:s,data:i,compression:"best-available",batchKey:"logs",transport:e})}}ha(){var e,t;this.qr||(this.qr=setTimeout((()=>{this.qr=void 0,this.flushLogs()}),(e=(t=this._instance.config.logs)==null?void 0:t.flushIntervalMs)!==null&&e!==void 0?e:3e3))}la(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:r}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=r}if(F!=null&&(e=F.location)!=null&&e.href&&(t.currentUrl=F.location.href),this._instance.featureFlags){var n=this._instance.featureFlags.getFlags();n&&n.length>0&&(t.activeFeatureFlags=n)}return t}}});hn.__defaultExtensionClasses=S({},vS);var Vu,Xt=(Vu=pn[vr]=new hn,(function(){function e(){e.done||(e.done=!0,Mp=!1,ne(pn,(function(t){t._dom_loaded()})))}I!=null&&I.addEventListener?I.readyState==="complete"?e():pe(I,"DOMContentLoaded",e,{capture:!1}):_&&x.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),Vu),mS="phc_nxaQk54MWAehmL72J4gjVbrQCpbSTedMyHn3PvFxAhkd",Se,Ir=!1,Yu=!1,zp=()=>navigator.globalPrivacyControl===!0,IS=()=>Se,yS=async()=>{try{Se=(await(await fetch("/api/telemetry/config",{headers:zp()?{"x-db-studio-gpc":"1"}:void 0})).json()).data}catch{return}const e=mS;return!Se?.enabled||Ir?Se:Yu?(Xt.opt_in_capturing(),Xt.identify(Se.installationId),Ir=!0,Se):(Xt.init(e,{api_host:"https://eu.i.posthog.com",person_profiles:"identified_only",autocapture:!1,capture_pageview:!1,capture_pageleave:!1,disable_session_recording:!0,persistence:"memory",loaded(t){Se&&t.identify(Se.installationId)}}),Ir=!0,Yu=!0,Se)},xS=async e=>{const t=await fetch("/api/telemetry/preference",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({enabled:e})});if(!t.ok)throw new Error("Could not update telemetry preference");const r=await t.json();return Se=r.data,e?zp()||await yS():(Xt.opt_out_capturing(),Ir=!1),r.data},kS=async()=>{const e=await fetch("/api/telemetry/reset",{method:"POST"});if(!e.ok)throw new Error("Could not reset analytics identifier");const t=await e.json();Se&&(Se={...Se,installationId:t.data.installationId}),Ir&&(Xt.reset(),Xt.identify(t.data.installationId))},RS={capture(e,t){!Ir||!Se?.enabled||Xt.capture(e,{...t,source:"client",app_version:Se.appVersion,$geoip_disable:!1})}};export{xS as a,Jt as c,kS as i,wg as l,yS as n,TS as o,RS as r,wS as s,IS as t,ES as u};