db-studio 1.13.0 → 1.14.1

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 (70) hide show
  1. package/dist/index.js +105 -84
  2. package/dist/index.js.map +1 -1
  3. package/dist/web-dist/assets/{_pathlessLayout-zxU06-pr.js → _pathlessLayout-BYQmoqT2.js} +61 -61
  4. package/dist/web-dist/assets/_pathlessLayout-CdSIARYp.js +1 -0
  5. package/dist/web-dist/assets/_queryId-IoOxUaz6.js +1 -0
  6. package/dist/web-dist/assets/_table-BI9E6-Je.js +1 -0
  7. package/dist/web-dist/assets/_table-ClkqBjYZ.js +1 -0
  8. package/dist/web-dist/assets/badge-SEQODpjR.js +1 -0
  9. package/dist/web-dist/assets/browser-CHG4p052.js +1 -0
  10. package/dist/web-dist/assets/{bundle-mjs-uZfDJfiH.js → bundle-mjs-BZOM22--.js} +1 -1
  11. package/dist/web-dist/assets/code-editor-BIfiMFMb.js +9 -0
  12. package/dist/web-dist/assets/database.store-OsasuLJl.js +1 -0
  13. package/dist/web-dist/assets/{dist-BeZAMt_p.js → dist-D_0esNxp.js} +1 -1
  14. package/dist/web-dist/assets/{format-cell-value-wHw1lD8Z.js → format-cell-value-D41tFXxV.js} +1 -1
  15. package/dist/web-dist/assets/highlighted-body-OFNGDK62-DBl3trdK.js +1 -0
  16. package/dist/web-dist/assets/icons-rRDRsZcq.js +1 -0
  17. package/dist/web-dist/assets/index-Be5YdcX5.css +2 -0
  18. package/dist/web-dist/assets/index-CJ2YPwW4.js +36 -0
  19. package/dist/web-dist/assets/indexes-DMAVA8iJ.js +1 -0
  20. package/dist/web-dist/assets/logs-DCMuv22K.js +1 -0
  21. package/dist/web-dist/assets/mermaid-GHXKKRXX-DJ7TvQxw.js +1 -0
  22. package/dist/web-dist/assets/{middleware-CPy2Suyk.js → middleware-Y6OdmOWR.js} +1 -1
  23. package/dist/web-dist/assets/{monaco-editor-VzUhCCqE.js → monaco-editor-BO3WVEVM.js} +280 -280
  24. package/dist/web-dist/assets/monaco-editor-IL9D_L0g.css +1 -0
  25. package/dist/web-dist/assets/monitoring-BtlIcl3k.js +22 -0
  26. package/dist/web-dist/assets/overlay.store-DjYsesE7.js +11 -0
  27. package/dist/web-dist/assets/{queries.store-DFbzjjlv.js → queries.store-CxkLh1ra.js} +1 -1
  28. package/dist/web-dist/assets/query-runner-keHo7IiI.js +17 -0
  29. package/dist/web-dist/assets/radix-ui-C1Z_SoKk.js +51 -0
  30. package/dist/web-dist/assets/react-1gU4DcpZ.js +1 -0
  31. package/dist/web-dist/assets/{react-dom-t511kH7T.js → react-dom-DkH0eaTq.js} +1 -1
  32. package/dist/web-dist/assets/redis-value-BmLGJf9X.js +1 -0
  33. package/dist/web-dist/assets/{rolldown-runtime-Bc_uOZR3.js → rolldown-runtime-DY1mqKjv.js} +1 -1
  34. package/dist/web-dist/assets/runner-CvUPs6q4.js +1 -0
  35. package/dist/web-dist/assets/schema-9nf0q_01.js +57 -0
  36. package/dist/web-dist/assets/schema-C-10JjXl.js +1 -0
  37. package/dist/web-dist/assets/table-C75Kr4aI.js +1 -0
  38. package/dist/web-dist/assets/tanstack-C3XvOIUf.js +11 -0
  39. package/dist/web-dist/assets/visualizer-CiiH2acP.js +1 -0
  40. package/dist/web-dist/index.html +19 -19
  41. package/package.json +4 -4
  42. package/dist/web-dist/assets/_pathlessLayout-GynxlRL_.js +0 -1
  43. package/dist/web-dist/assets/_queryId-BRuHa3fh.js +0 -1
  44. package/dist/web-dist/assets/_table-8IAksPyY.js +0 -1
  45. package/dist/web-dist/assets/_table-CtfVc03T.js +0 -1
  46. package/dist/web-dist/assets/ai-assistant-CpA6z3NH.js +0 -1
  47. package/dist/web-dist/assets/browser-BGLz7ANr.js +0 -1
  48. package/dist/web-dist/assets/code-editor-CuKFGk5C.js +0 -9
  49. package/dist/web-dist/assets/database.store-B5cSp4MJ.js +0 -1
  50. package/dist/web-dist/assets/highlighted-body-OFNGDK62-BQA5yQZx.js +0 -1
  51. package/dist/web-dist/assets/icons-DMY0-Mbl.js +0 -1
  52. package/dist/web-dist/assets/index-BsliTpNZ.js +0 -35
  53. package/dist/web-dist/assets/index-Cyl_0l9I.css +0 -2
  54. package/dist/web-dist/assets/indexes-CNKwQMi3.js +0 -1
  55. package/dist/web-dist/assets/logs-BYKvN4gr.js +0 -1
  56. package/dist/web-dist/assets/mermaid-GHXKKRXX-BKNFWsy1.js +0 -1
  57. package/dist/web-dist/assets/monaco-editor-DcHpHuJd.css +0 -1
  58. package/dist/web-dist/assets/monitoring-B3eHd8rg.js +0 -22
  59. package/dist/web-dist/assets/popover-C6AOV9WB.js +0 -1
  60. package/dist/web-dist/assets/query-runner-RUXGiIf2.js +0 -17
  61. package/dist/web-dist/assets/radix-ui-CCBRgLy1.js +0 -51
  62. package/dist/web-dist/assets/react-frqLVtia.js +0 -1
  63. package/dist/web-dist/assets/redis-value-Lhzkhu4Q.js +0 -1
  64. package/dist/web-dist/assets/runner-lxnLCgPi.js +0 -1
  65. package/dist/web-dist/assets/schema-Bv15Fk7L.js +0 -1
  66. package/dist/web-dist/assets/schema-By474UiK.js +0 -64
  67. package/dist/web-dist/assets/table-B-C0yxvL.js +0 -1
  68. package/dist/web-dist/assets/tanstack-BfT_e-Qv.js +0 -10
  69. package/dist/web-dist/assets/tooltip-Dd1J4hNt.js +0 -9
  70. package/dist/web-dist/assets/visualizer-DOCDtIMq.js +0 -1
@@ -1,22 +0,0 @@
1
- import{r as Jp}from"./rolldown-runtime-Bc_uOZR3.js";import{ut as Zp}from"./icons-DMY0-Mbl.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.13.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="04d02b40-8bf0-475d-ac3f-9486d1aaf482",e._sentryDebugIdIdentifier="sentry-dbid-04d02b40-8bf0-475d-ac3f-9486d1aaf482")}catch{}})();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 Fe=ge?.navigator,I=ge?.document,me=ge?.location,Hs=ge?.fetch,js=ge!=null&&ge.XMLHttpRequest&&"withCredentials"in new ge.XMLHttpRequest?ge.XMLHttpRequest:void 0,Ha=ge?.AbortController,Qp=ge?.CompressionStream,Oe=Fe?.userAgent,F=_??{},ja="1.372.10",Pe={DEBUG:!1,LIB_VERSION:ja,LIB_NAME:"web",JS_SDK_VERSION:ja};function Ba(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){Ba(s,n,i,o,a,"next",c)}function a(c){Ba(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 Xu(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 Bs(){return Bs=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}})),Bs.apply(this,arguments)}var eh=["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"],Wa=function(e,t){if(t===void 0&&(t=[]),!e)return!1;var r=e.toLowerCase();return eh.concat(t).some((n=>{var i=n.toLowerCase();return r.indexOf(i)!==-1}))},th=["$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 Wi=function(e){return e.trim()},Ws=function(e){return e.replace(/^\$/,"")},Ku=Object.prototype,Ju=Ku.hasOwnProperty,zi=Ku.toString,G=Array.isArray||function(e){return zi.call(e)==="[object Array]"},ct=e=>typeof e=="function",de=e=>e===Object(e)&&!G(e),mr=e=>{if(de(e)){for(var t in e)if(Ju.call(e,t))return!1;return!0}return!1},k=e=>e===void 0,ce=e=>zi.call(e)=="[object String]",ni=e=>ce(e)&&e.trim().length===0,yt=e=>e===null,B=e=>k(e)||yt(e),Ge=e=>zi.call(e)=="[object Number]"&&e==e,fr=e=>Ge(e)&&e>0,et=e=>zi.call(e)==="[object Boolean]",rh=e=>e instanceof FormData,nh=e=>j(th,e);function Zu(e){return e===null||typeof e!="object"}function gi(e,t){return{}.toString.call(e)==="[object "+t+"]"}function ra(e){return typeof Event<"u"&&(function(t,r){try{return t instanceof r}catch{return!1}})(e,Event)}var ih=[!0,"true",1,"1","yes"],is=e=>j(ih,e),sh=[!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 oh=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={}}},Bn,za,ss,Le="Mobile",_i="iOS",lt="Android",xr="Tablet",Qu=lt+" "+xr,el="iPad",tl="Apple",rl=tl+" Watch",on="Safari",kr="BlackBerry",nl="Samsung",il=nl+"Browser",sl=nl+" Internet",Gt="Chrome",ah=Gt+" OS",ol=Gt+" "+_i,na="Internet Explorer",al=na+" "+Le,ia="Opera",ch=ia+" Mini",sa="Edge",cl="Microsoft "+sa,Er="Firefox",ul=Er+" "+_i,gn="Nintendo",_n="PlayStation",wr="Xbox",ll=lt+" "+Le,dl=Le+" "+on,Jr="Windows",zs=Jr+" Phone",Ga="Nokia",Gs="Ouya",pl="Generic",uh=pl+" "+Le.toLowerCase(),hl=pl+" "+xr.toLowerCase(),Vs="Konqueror",xe="(\\d+(\\.\\d+)?)",os=new RegExp("Version/"+xe),lh=new RegExp(wr,"i"),dh=new RegExp(_n+" \\w+","i"),ph=new RegExp(gn+" \\w+","i"),oa=new RegExp(kr+"|PlayBook|BB10","i"),hh={"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"},fl=function(e,t){return t=t||"",j(e," OPR/")&&j(e,"Mini")?ch:j(e," OPR/")?ia:oa.test(e)?kr:j(e,"IE"+Le)||j(e,"WPDesktop")?al:j(e,il)?sl:j(e,sa)||j(e,"Edg/")?cl:j(e,"FBIOS")?"Facebook "+Le:j(e,"UCWEB")||j(e,"UCBrowser")?"UC Browser":j(e,"CriOS")?ol:j(e,"CrMo")||j(e,Gt)?Gt:j(e,lt)&&j(e,on)?ll:j(e,"FxiOS")?ul:j(e.toLowerCase(),Vs.toLowerCase())?Vs:((r,n)=>n&&j(n,tl)||(function(i){return j(i,on)&&!j(i,Gt)&&!j(i,lt)})(r))(e,t)?j(e,Le)?dl:on:j(e,Er)?Er:j(e,"MSIE")||j(e,"Trident/")?na:j(e,"Gecko")?Er:""},fh={[al]:[new RegExp("rv:"+xe)],[cl]:[new RegExp(sa+"?\\/"+xe)],[Gt]:[new RegExp("("+Gt+"|CrMo)\\/"+xe)],[ol]:[new RegExp("CriOS\\/"+xe)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+xe)],[on]:[os],[dl]:[os],[ia]:[new RegExp("(Opera|OPR)\\/"+xe)],[Er]:[new RegExp(Er+"\\/"+xe)],[ul]:[new RegExp("FxiOS\\/"+xe)],[Vs]:[new RegExp("Konqueror[:/]?"+xe,"i")],[kr]:[new RegExp(kr+" "+xe),os],[ll]:[new RegExp("android\\s"+xe,"i")],[sl]:[new RegExp(il+"\\/"+xe)],[na]:[new RegExp("(rv:|MSIE )"+xe)],Mozilla:[new RegExp("rv:"+xe)]},gh=function(e,t){var r=fh[fl(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},Va=[[new RegExp(wr+"; "+wr+" (.*?)[);]","i"),e=>[wr,e&&e[1]||""]],[new RegExp(gn,"i"),[gn,""]],[new RegExp(_n,"i"),[_n,""]],[oa,[kr,""]],[new RegExp(Jr,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[zs,""];if(new RegExp(Le).test(t)&&!/IEMobile\b/.test(t))return[Jr+" "+Le,""];var r=/Windows NT ([0-9.]+)/i.exec(t);if(r&&r[1]){var n=hh[r[1]]||"";return/arm/i.test(t)&&(n="RT"),[Jr,n]}return[Jr,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[_i,[e[3],e[4],e[5]||"0"].join(".")]:[_i,""]],[/(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/,[ah,""]],[/Linux|debian/i,["Linux",""]]],Ya=function(e){return ph.test(e)?gn:dh.test(e)?_n:lh.test(e)?wr:new RegExp(Gs,"i").test(e)?Gs:new RegExp("("+zs+"|WPDesktop)","i").test(e)?zs:/iPad/.test(e)?el:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?rl:oa.test(e)?kr:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Ga,"i").test(e)?Ga:/(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(Le).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:Qu:new RegExp("(pda|"+Le+")","i").test(e)?uh:new RegExp(xr,"i").test(e)&&!new RegExp(xr+" pc","i").test(e)?hl:""},_h=e=>e instanceof Error,gl={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}},vh=gl.info;function _l(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=>_l(t)))}};try{return{stringValue:JSON.stringify(e)}}catch{return{stringValue:String(e)}}}function Xa(e){var t=[];for(var r in e){var n=e[r];yt(n)||k(n)||t.push({key:r,value:_l(n)})}return t}function mh(e){var t=globalThis._posthogChunkIds;if(t){var r=Object.keys(t);return ss&&r.length===za||(za=r.length,ss=r.reduce(((n,i)=>{Bn||(Bn={});var s=Bn[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,Bn[i]=[u,l];break}}return n}),{})),ss}}var yh=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:mh(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)})}},Rr="?";function Ys(e,t,r,n,i){var s={platform:e,filename:t,function:r==="<anonymous>"?Rr:r,in_app:!0};return k(n)||(s.lineno=n),k(i)||(s.colno=i),s}var vl=(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]:Rr,r?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},bh=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Sh=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Eh=/\((\S*)(?::(\d+))(?::(\d+))\)/,wh=(e,t)=>{var r=bh.exec(e);if(r){var[,n,i,s]=r;return Ys(t,n,Rr,+i,+s)}var o=Sh.exec(e);if(o){if(o[2]&&o[2].indexOf("eval")===0){var a=Eh.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[c,u]=vl(o[1]||Rr,o[2]);return Ys(t,u,c,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},Th=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ih=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,xh=(e,t)=>{var r=Th.exec(e);if(r){if(r[3]&&r[3].indexOf(" > eval")>-1){var n=Ih.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]||Rr;return[s,i]=vl(s,i),Ys(t,i,s,r[4]?+r[4]:void 0,r[5]?+r[5]:void 0)}},Ka=/\(error: (.*)\)/,kh=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 gi(e,"DOMException")}isDOMError(e){return gi(e,"DOMError")}},Rh=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}},Ph=class{constructor(){}match(e){return gi(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}}},Ch=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,Ah=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(Ch);return n&&(t=n[1],r=n[2]),[t,r]}},Oh=["fatal","error","warning","log","info","debug"];function ml(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 $h=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 ra(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: "+ml(e)}isSeverityLevel(e){return ce(e)&&!ni(e)&&Oh.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var r=e[t];if(_h(r))return r}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}},Nh=class{match(e){return ra(e)}coerce(e,t){var r,n=e.constructor.name;return{type:n,value:n+" captured as exception with keys: "+ml(e),stack:(r=t.syntheticException)==null?void 0:r.stack,synthetic:!0}}},Fh=class{match(e){return Zu(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}}},Mh=class{match(e){return gi(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!ra(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 Zu(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}},vi="$message",mi="$timestamp",Lh=new Set([vi,mi]),as={enabled:!0,max_bytes:32768};function yi(e){var t;return e?{enabled:(t=e.enabled)!==null&&t!==void 0?t:as.enabled,max_bytes:qh(e.max_bytes,as.max_bytes)}:S({},as)}var Dh=class{constructor(e){this.Yt=[],this.Xt=0,this.qt=yi(e)}setConfig(e){this.qt=yi(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[vi],c=o[mi];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 qh(e,t){if(!Ge(e)||e===1/0||e===-1/0)return t;var r=Math.floor(e);return 0>r?t:r}var yl=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)=>yl(e+" "+i,s)};return n},x=yl("[PostHog.js]"),oe=x.createLogger,Uh=oe("[ExternalScriptsLoader]"),cs=(e,t,r)=>{if(e.config.disable_external_dependency_loading)return Uh.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)}cs(e,n,r)}else cs(e,e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js"),r)},F.__PosthogExtensions__.loadSiteApp=(e,t,r)=>{cs(e,e.requestRouter.endpointFor("api",t),r)};var bl="$people_distinct_id",bi="$device_id",Zr="__alias",Qr="__timers",Xs="$autocapture_disabled_server_side",Ks="$heatmaps_enabled_server_side",Js="$exception_capture_enabled_server_side",Zs="$error_tracking_suppression_rules",Qs="$error_tracking_capture_extension_exceptions",eo="$web_vitals_enabled_server_side",aa="$dead_clicks_enabled_server_side",to="$product_tours_enabled_server_side",ro="$web_vitals_allowed_metrics",en="$session_recording_remote_config",Sl="$replay_override_sampling",El="$replay_override_linked_flag",wl="$replay_override_url_trigger",Tl="$replay_override_event_trigger",Si="$sesid",ca="$session_is_sampled",yr="$enabled_feature_flags",ii="$active_feature_flags",tn="$early_access_features",no="$feature_flag_details",io="$feature_flag_payloads",so="$feature_flag_request_id",ot="$override_feature_flags",gr="$override_feature_flag_payloads",rn="$stored_person_properties",jt="$stored_group_properties",oo="$surveys",ao="$surveys_activated",si="ph_product_tours",an="$flag_call_reported",co="$flag_call_reported_session_id",uo="$feature_flag_errors",Ei="$feature_flag_evaluated_at",Ve="$user_state",lo="$client_session_props",po="$capture_rate_limit",ho="$initial_campaign_params",fo="$initial_referrer_info",wi="$initial_person_info",Ti="$epp",Il="__POSTHOG_TOOLBAR__",Wn="$posthog_cookieless",xl="$sdk_debug_extensions_init_method",kl="$sdk_debug_extensions_init_time_ms",Rl="$sdk_debug_recording_script_not_loaded",go="PostHog loadExternalDependency extension not found.",Bt="on_reject",ut="always",ar="anonymous",cr="identified",_o="identified_only",Ii="visibilitychange",xi="beforeunload",_r="$pageview",us="$pageleave",ls="$identify",Ja="$groupidentify";function zn(e,t){G(e)&&e.forEach(t)}function ne(e,t){if(!B(e))if(G(e))e.forEach(t);else if(rh(e))e.forEach(((n,i)=>t(n,i)));else for(var r in e)Ju.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 oi(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 Za=function(e){try{return e()}catch{return}},Hh=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)}}},ua=function(e){var t={};return ne(e,(function(r,n){(ce(r)&&r.length>0||Ge(r))&&(t[n]=r)})),t},jh=["herokuapp.com","vercel.app","netlify.app"];function Bh(e){var t=e?.hostname;if(!ce(t))return!1;var r=t.split(".").slice(-2).join(".");for(var n of jh)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 Pl(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 Wh=class vo{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 vo(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 vo(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}},zh=class{constructor(){this.S=0,this.C=0,this.I=new Gh}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 Wh.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())}},Qa,Cl=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&&(Cl=e=>crypto.getRandomValues(e));var Gh=class{constructor(){this.M=new Uint32Array(8),this.O=1/0}nextUint32(){return this.M.length>this.O||(Cl(this.M),this.O=0),this.M[this.O++]}},kt=()=>Vh().toString(),Vh=()=>(Qa||(Qa=new zh)).generate(),jr="",Yh=/[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),jr)return jr;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();!jr&&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",jr=A)}return jr})(l);if(!p){var f=(h=>{var g=h.match(Yh);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}}},ds=null,ae={R(){if(!yt(ds))return ds;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"),ds=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)}}},Xh=[bi,"distinct_id",Si,ca,Ti,wi,Ve],Gn={},Kh={R:()=>!0,D(e){x.error("memoryStorage error: "+e)},A:e=>Gn[e]||null,F:e=>Gn[e]||null,N(e,t){Gn[e]=t},q(e){delete Gn[e]}},Dt=null,ye={R(){if(!yt(Dt))return Dt;if(Dt=!0,k(_))Dt=!1;else try{var e="__support__";ye.N(e,"xyz"),ye.A(e)!=='"xyz"'&&(Dt=!1),ye.q(e)}catch{Dt=!1}return Dt},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)}}},Jh=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 is(e)?1:j(sh,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(is(r.A(this.sr))),r.q(this.sr,this.qt.cross_subdomain_cookie))}return this.ar}rr(){return!!this.qt.respect_dnt&&[Fe?.doNotTrack,Fe?.msDoNotTrack,F.doNotTrack].some((e=>is(e)))}},Vn=oe("[Dead Clicks]"),Zh=()=>!0,Qh=e=>{var t,r=!((t=e.instance.persistence)==null||!t.get_property(aa)),n=e.instance.config.capture_dead_clicks;return et(n)?n:!!de(n)||r},ec=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({[aa]: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?Vn.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),Vn.info("starting...")}}else Vn.error("`document` not found. Cannot start.")}stop(){this.ur&&(this.ur.stop(),this.ur=void 0,Vn.info("stopping..."))}},ps=oe("[SegmentIntegration]"),Al="posthog-js";function Ol(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 ef=class{constructor(e,t,r,n,i,s){this.name=Al,this.setupOnce=function(o){o(Ol(e,{organization:t,projectId:r,prefix:n,severityAllowList:i,sendExceptionsToPostHog:s==null||s}))}}},tc=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}},tf={[bl]:{exposure:"hidden"},[Zr]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Qr]:{exposure:"hidden"},[Xs]:{exposure:"event"},[Ks]:{exposure:"hidden"},[Js]:{exposure:"event"},[Zs]:{exposure:"hidden"},[Qs]:{exposure:"event"},[eo]:{exposure:"event"},[aa]:{exposure:"event"},[to]:{exposure:"hidden"},[ro]:{exposure:"event"},[en]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[Si]:{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"},[yr]:{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}},[ii]:{exposure:"event"},[tn]:{exposure:"hidden"},[no]:{exposure:"hidden"},[io]:{exposure:"event"},[so]:{exposure:"event"},[ot]:{exposure:"event"},[gr]:{exposure:"hidden"},[rn]:{exposure:"hidden"},[jt]:{exposure:"hidden"},[oo]:{exposure:"hidden"},[ao]:{exposure:"event"},[si]:{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"},[an]:{exposure:"hidden"},[co]:{exposure:"hidden"},[uo]:{exposure:"hidden"},[Ei]:{exposure:"hidden"},[Ve]:{exposure:"hidden"},[lo]:{exposure:"hidden"},[po]:{exposure:"hidden"},[ho]:{exposure:"hidden"},[fo]:{exposure:"hidden"},[wi]:{exposure:"hidden"},[Ti]:{exposure:"hidden"},[Sl]:{exposure:"event"},[El]:{exposure:"event"},[wl]:{exposure:"event"},[Tl]:{exposure:"event"},[xl]:{exposure:"event"},[kl]:{exposure:"event"},[Rl]:{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"}},rf=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],ki=e=>{var t=I?.createElement("a");return k(t)?null:(t.href=e,t)},Ri=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," ")},vn=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},Pi=function(e,t){var r=e.match(new RegExp(t+"=([^&]*)"));return r?r[1]:null},Yn="https?://(.*)",Pr=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],nf=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...Pr],mn="<masked>",sf=["li_fat_id"];function $l(e,t,r){if(!I)return{};var n,i=t?[...Pr,...r||[]]:[],s=Nl(vn(I.URL,i,mn),e);return le((n={},ne(sf,(function(o){var a=Qe.A(o);n[o]=a||null})),n),s)}function Nl(e,t){var r=nf.concat(t||[]),n={};return ne(r,(function(i){n[i]=Ri(e,i)||null})),n}function Fl(e){var t=(function(s){return s?s.search(Yn+"google.([^/?]*)")===0?"google":s.search(Yn+"bing.com")===0?"bing":s.search(Yn+"yahoo.com")===0?"yahoo":s.search(Yn+"duckduckgo.com")===0?"duckduckgo":null:null})(e),r=t!="yahoo"?"q":"p",n={};if(!yt(t)){n.$search_engine=t;var i=I?Ri(I.referrer,r):"";i.length&&(n.ph_keyword=i)}return n}function rc(){return navigator.language||navigator.userLanguage}var Ci="$direct";function Ml(){return I?.referrer||Ci}function Ll(e,t){var r=e?[...Pr,...t||[]]:[],n=me?.href.substring(0,1e3);return{r:Ml().substring(0,1e3),u:n?vn(n,r,mn):void 0}}function Dl(e){var t,{r,u:n}=e,i={$referrer:r,$referring_domain:r==null?void 0:r==Ci?Ci:(t=ki(r))==null?void 0:t.host};if(n){i.$current_url=n;var s=ki(n);i.$host=s?.host,i.$pathname=s?.pathname,le(i,Nl(n))}return r&&le(i,Fl(r)),i}function ql(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function of(){try{return new Date().getTimezoneOffset()}catch{return}}var af=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],hs=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){af.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=[...Xh,...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"?Kh: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[Ei];return!r||typeof r!="number"||Date.now()-r>t}properties(){var e={};return ne(this.props,((t,r)=>{var n=(i=>{var s=tf[i];if(s)return s;for(var[o,a]of rf)if(i.indexOf(o)===0)return a})(r);if(n?.exposure==="derived"){if(n.shouldSkipFromEventProperties!=null&&n.shouldSkipFromEventProperties(t,r===yr?()=>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=$l(this.qt.custom_campaign_params,this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties);mr(ua(e))||this.register(e),this.mr=!0}}update_search_keyword(){var e;this.register((e=I?.referrer)?Fl(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Ml(),$referring_domain:I!=null&&I.referrer&&((e=ki(I.referrer))==null?void 0:e.host)||Ci},void 0)}set_initial_person_info(){this.props[ho]||this.props[fo]||this.register_once({[wi]:Ll(this.qt.mask_personal_data_properties,this.qt.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};ne([fo,ho],(i=>{var s=this.props[i];s&&ne(s,(function(o,a){e["$initial_"+Ws(a)]=o}))}));var t,r,n=this.props[wi];return n&&le(e,(t=Dl(n),r={},ne(t,(function(i,s){r["$initial_"+Ws(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[Qr]||{};r[e]=t,this.Tr(Qr,r),this.save()}remove_event_timer(e){var t=this.props[Qr]||{},r=t[e];return k(r)||(delete t[e],this.Tr(Qr,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]}},Br={Activation:"events",Cancellation:"cancelEvents"},fs={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},nn={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},gs={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"},mo={Popover:"popover",Inline:"inline"},cf={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"},nc={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"},ic=oe("[RateLimiter]"),uf=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=>{ic.info((n||"events")+" is quota limited."),this.serverLimits[n]=new Date().getTime()+6e4}))}catch(n){ic.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(po))!==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(po,a),{isRateLimited:c,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}},Wr=oe("[RemoteConfig]"),Ul=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 Wr.info("Using preloaded remote config",this.remoteConfig),this.Rr(this.remoteConfig),void this.Or();if(this._instance.Lr())return void Wr.warn("Remote config is disabled. Falling back to local config.");this.Mr((e=>{if(!e)return Wr.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){Wr.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||Wr.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"},Be=Uint8Array,Ce=Uint16Array,Cr=Uint32Array,la=new Be([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]),da=new Be([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]),sc=new Be([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Hl=function(e,t){for(var r=new Ce(31),n=0;31>n;++n)r[n]=t+=1<<e[n-1];var i=new Cr(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]},jl=Hl(la,2),yo=jl[1];jl[0][28]=258,yo[258]=28;for(var oc=Hl(da,0)[1],bo=new Ce(32768),ie=0;32768>ie;++ie){var ur=(43690&ie)>>>1|(21845&ie)<<1;bo[ie]=((65280&(ur=(61680&(ur=(52428&ur)>>>2|(13107&ur)<<2))>>>4|(3855&ur)<<4))>>>8|(255&ur)<<8)>>>1}var cn=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[bo[d]>>>c]=u}else for(o=new Ce(n),i=0;n>i;++i)o[i]=bo[a[e[i]-1]++]>>>15-e[i];return o},Kt=new Be(288);for(ie=0;144>ie;++ie)Kt[ie]=8;for(ie=144;256>ie;++ie)Kt[ie]=9;for(ie=256;280>ie;++ie)Kt[ie]=7;for(ie=280;288>ie;++ie)Kt[ie]=8;var Ai=new Be(32);for(ie=0;32>ie;++ie)Ai[ie]=5;var lf=cn(Kt,9,0),df=cn(Ai,5,0),Bl=function(e){return(e/8>>0)+(7&e&&1)},Wl=function(e,t,r){(r==null||r>e.length)&&(r=e.length);var n=new(e instanceof Ce?Ce:e instanceof Cr?Cr:Be)(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},zr=function(e,t,r){var n=t/8>>0;e[n]|=r<<=7&t,e[n+1]|=r>>>8,e[n+2]|=r>>>16},_s=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 Be(0),0];if(i==1){var o=new Be(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=So(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 Be(f),h]},So=function(e,t,r){return e.s==-1?Math.max(So(e.l,t,r+1),So(e.r,t,r+1)):t[e.s]=r},ac=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]},Gr=function(e,t){for(var r=0,n=0;t.length>n;++n)r+=e[n]*t[n];return r},Eo=function(e,t,r){var n=r.length,i=Bl(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)},cc=function(e,t,r,n,i,s,o,a,c,u,l){it(t,l++,r),++i[256];for(var d=_s(i,15),p=d[0],f=d[1],h=_s(s,15),g=h[0],m=h[1],w=ac(p),P=w[0],A=w[1],$=ac(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=_s(v,7),C=T[0],L=T[1],D=19;D>4&&!C[sc[D-1]];--D);var N,q,Z,J,ue=u+5<<3,M=Gr(i,Kt)+Gr(s,Ai)+o,z=Gr(i,p)+Gr(s,g)+o+14+3*D+Gr(v,C)+(2*v[16]+3*v[17]+7*v[18]);if(M>=ue&&z>=ue)return Eo(t,l,e.subarray(c,c+u));if(it(t,l,1+(M>z)),l+=2,M>z){N=cn(p,f,0),q=p,Z=cn(g,m,0),J=g;var X=cn(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[sc[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=lf,q=Kt,Z=df,J=Ai;for(b=0;a>b;++b)if(n[b]>255){var he;zr(t,l,N[257+(he=n[b]>>>18&31)]),l+=q[he+257],he>7&&(it(t,l,n[b]>>>23&31),l+=la[he]);var fe=31&n[b];zr(t,l,Z[fe]),l+=J[fe],fe>3&&(zr(t,l,n[b]>>>5&8191),l+=da[fe])}else zr(t,l,N[n[b]]),l+=q[n[b]];return zr(t,l,N[256]),l+q[256]},pf=new Cr([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),hf=(function(){for(var e=new Cr(256),t=0;256>t;++t){for(var r=t,n=9;--n;)r=(1&r&&3988292384)^r>>>1;e[t]=r}return e})(),vs=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function ff(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=hf[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 Be(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?$=Eo(A,$,d.subarray(y,R)):(A[y]=!0,$=Eo(A,$,d.subarray(y,w)))}else{for(var v=pf[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 Cr(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){$=cc(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|yo[Je]<<18|oc[or];var qa=31&yo[Je],Ua=31&oc[or];X+=la[qa]+da[Ua],++ue[257+qa],++M[Ua],re=y+Je,++z}else J[W++]=d[y],++ue[d[y]]}}$=cc(d,A,!0,J,ue,M,X,W,Q,y-Q,$)}return Wl(P,0,h+Bl($)+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&&vs(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),vs(u,l-8,r.d()),vs(u,l-4,n),u}var gf=!!js||!!Hs,zl="text/plain",uc=!1,Gi=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("&")},br=(e,t)=>JSON.stringify(e,((r,n)=>typeof n=="bigint"?n.toString():n),t),ms=e=>{if(e.tr)return e.tr;var{data:t,compression:r}=e;if(t){if(r===Ze.GZipJS){var n=ff((function(o,a){var c=o.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(o);for(var u=new Be(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 Be(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 Wl(u,0,l)})(br(t)),{mtime:0});return{contentType:zl,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:br(o)))((function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,((a,c)=>String.fromCharCode(parseInt(c,16)))))})(br(t)));return{contentType:"application/x-www-form-urlencoded",body:i,estimatedSize:new Blob([i]).size}}var s=br(t);return{contentType:"application/json",body:s,estimatedSize:new Blob([s]).size}}},_f=(function(){var e=je((function*(t){var r=yield(function(i,s,o){return Bs.apply(this,arguments)})(br(t.data),Pe.DEBUG,{rethrow:!0});if(!r)return t;var n=yield r.arrayBuffer();return S({},t,{tr:{contentType:zl,body:n,estimatedSize:n.byteLength}})}));return function(t){return e.apply(this,arguments)}})(),lc=(e,t)=>Gi(e,{_:new Date().getTime().toString(),ver:Pe.JS_SDK_VERSION,compression:t}),ai=[];Hs&&ai.push({transport:"fetch",method(e){var t,r,{contentType:n,body:i,estimatedSize:s}=(t=ms(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(Ha){var u=new Ha;c={signal:u.signal,timeout:setTimeout((()=>u.abort()),e.timeout)}}Hs(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))}}),js&&ai.push({transport:"XHR",method(e){var t,r=new js;r.open(e.method||"GET",e.url,!0);var{contentType:n,body:i}=(t=ms(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)}}),Fe!=null&&Fe.sendBeacon&&ai.push({transport:"sendBeacon",method(e){var t=Gi(e.url,{beacon:"1"});try{var r,{contentType:n,body:i}=(r=ms(e))!==null&&r!==void 0?r:{};if(!i)return;var s=i instanceof Blob?i:new Blob([i],{type:n});Fe.sendBeacon(t,s)}catch{}}});var wo=3e3,vf=class{constructor(e,t){this.Ar=!0,this.Nr=[],this.$r=tt(t?.flush_interval_ms||wo,250,5e3,x.createLogger("flush interval"),wo),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}},mf=["retriesPerformedSoFar"],yf=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=Xu(e,mf);fr(t)&&(r.url=Gi(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=[]}},bf=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}},Sf=e=>Ll(e?.config.mask_personal_data_properties,e?.config.custom_personal_data_properties),dc=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||Sf,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?Dl(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(ua(this.getSetOnceProps()),((t,r)=>{r==="$current_url"&&(r="url"),e["$session_entry_"+Ws(r)]=t})),e}},pa=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)}},ys=oe("[SessionId]"),pc=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 pa,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,ys.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){ys.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({[Si]:[t,e,r]}))}ki(){var e=this.ni.props[Si];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(xi,this.li,{capture:!1}),this.li=void 0),this.ui=[]}wi(){this.li=()=>{this.yi()&&ye.q(this.mi)},pe(_,xi,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(),ys.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)}},Gl=function(e,t){if(!e)return!1;var r=e.userAgent;if(r&&Wa(r,t))return!0;try{var n=e?.userAgentData;if(n!=null&&n.brands&&n.brands.some((i=>Wa(i?.brand,t))))return!0}catch{}return!!e.webdriver},Oi=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 hc(e,t,r){return br({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:r})}var Vl={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=>Oi(r,n))))),not_regex:(e,t)=>t.every((r=>e.every((n=>!Oi(r,n))))),icontains:(e,t)=>t.map(Xn).some((r=>e.map(Xn).some((n=>r.includes(n))))),not_icontains:(e,t)=>t.map(Xn).every((r=>e.map(Xn).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)))}))},Xn=e=>e.toLowerCase();function Yl(e,t){return!e||Object.entries(e).every((r=>{var[n,i]=r,s=t?.[n];if(k(s)||yt(s))return!1;var o=[String(s)],a=Vl[i.operator];return!!a&&a(i.values,o)}))}var To="custom",fc="i.posthog.com",Ef=/^\/static\//,wf=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("."+fc,".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":To),this.Ii[this.apiHost]}Ti(e){var t=this.instance.config.__preview_external_dependency_versioned_paths;if(typeof t=="string"&&Ef.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===To)return this.apiHost+t;var n=fc+t;switch(e){case"assets":return"https://"+this.region+"-assets."+n;case"api":return"https://"+this.region+"."+n}}},ee=oe("[Surveys]"),Io="seenSurvey_",Tf=[fs.Popover,fs.Widget,fs.API],If={ignoreConditions:!1,ignoreDelay:!1,displayType:mo.Popover},xf=oe("[PostHog ExternalIntegrations]"),kf={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},Rf=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 xf.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(kf[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)}}},lr,un={},bs=0,xo=()=>{},gc='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',Vr="Surveys module not available",_c="sanitize_properties is deprecated. Use before_send instead",Xl="Invalid value for property_denylist config: ",vr="posthog",Kl=!gf&&Oe?.indexOf("MSIE")===-1&&Oe?.indexOf("Mozilla")===-1,vc=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:Bh(I?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:xo,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:_o,before_send:void 0,request_queue_config:{flush_interval_ms:wo},error_tracking:{},_onCapture:xo,__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))},Pf=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],mc=e=>{var t={};for(var[r,n]of Pf)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(Xl+e.property_denylist)),i},Cf=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}},ln=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 Cf,this.Oi=!1,this.version=Pe.LIB_VERSION,this.Li=new pa,this.Pi=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=vc(),this.SentryIntegration=ef,this.sentryIntegration=n=>(function(i,s){var o=Ol(i,s);return{name:Al,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 bf(this),this.pageViewManager=new tc(this),this.rateLimiter=new uf(this),this.requestRouter=new wf(this),this.consent=new Jh(this),this.externalIntegrations=new Rf(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=un[n])!==null&&i!==void 0?i:new Wt;return s._init(t,r,n),un[n]=s,un[vr][n]=s,s}return this._init(t,r,n)}_init(t,r,n){var i,s;if(r===void 0&&(r={}),k(t)||ni(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({},vc(r.defaults),mc(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 hs(this.config,o),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new hs(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 vf((m=>this.Bi(m)),this.config.request_queue_config),this.zi=new yf(this),this.__request_queue=[];var u=this.Ri();if(u||(this.sessionManager=new pc(this),this.sessionPropsManager=new dc(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===ar)this.identify(l);else if(r.bootstrap.isIdentifiedID&&d!=null&&d!==l&&p===cr)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?cr:ar),this.register({distinct_id:l,$device_id:h})}}if(u)this.register_once({distinct_id:Wn,$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,ar)}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,cr)),$()},v=y.user();"then"in v&&ct(v.then)?v.then(R):R(v)})(m,(()=>{P.register((A=>{Promise&&Promise.resolve||ps.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()||(ps.info("No userId set, resetting PostHog"),A.reset()),y.event.userId&&y.event.userId!==A.get_distinct_id()&&(ps.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,ls),screen:y=>$(y,"$screen")}})(m)).then((()=>{w()}))}))})(this,(()=>this.Wi())):this.Wi(),ct(this.config._onCapture)&&this.config._onCapture!==xo&&(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,Qh)),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({[xl]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[kl]: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:_o}),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 Ul(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()&&zn(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(us),(r=this.logs)==null||r.flushLogs("sendBeacon"),(n=this.Ui)==null||n.unload(),(i=this.zi)==null||i.unload()):this.Xi()&&this.capture(us,null,{transport:"sendBeacon"})}_send_request(t){this.__loaded&&(Kl?this.__request_queue.push(t):this.rateLimiter.isServerRateLimited(t.batchKey)||(t.transport=t.transport||this.config.api_transport,t.url=Gi(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=lc(o.url,o.compression);var a=(n=o.transport)!==null&&n!==void 0?n:"fetch",c=ai.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&&Qp&&!uc?_f(o).then((l=>{u(l)})).catch((l=>{if((d=>!(!d||typeof d!="object")&&("name"in d?String(d.name):"")==="NotReadableError")(l))return uc=!0,void u(S({},o,{compression:void 0,url:lc(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){bs++;try{var r,n=[],i=[],s=[];zn(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){zn(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{bs--}}push(t){if(bs>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!==Ja,t===ls);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=[],zn(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===nn.DISMISSED||t===nn.SENT){var A=r?.[gs.SURVEY_ID],$=r?.[gs.SURVEY_ITERATION];(T=>{try{var C=(L=>((D,N)=>{var q=""+Io+N.id;return N.current_iteration&&N.current_iteration>0&&(q=""+Io+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===nn.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===nn.SHOWN&&(h.$set=S({},h.$set,{[gs.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(t===cf.SHOWN){var y=r?.[nc.TOUR_TYPE];y&&(h.$set=S({},h.$set,{[nc.TOUR_LAST_SEEN_DATE+"/"+y]:new Date().toISOString()}))}var R=S({},h.properties.$set,h.$set);if(mr(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)||ni(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?[...Pr,...P||[]]:[],[J,ue]=(function(M){for(var z=0;Va.length>z;z++){var[X,W]=Va[z],re=X.exec(M),Q=re&&(ct(W)?W(re,M):W);if(Q)return Q}return["",""]})(Oe);return le(ua({$os:J,$os_version:ue,$browser:fl(Oe,navigator.vendor),$device:Ya(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=Ya(b),q===el||q===Qu||q==="Kobo"||q==="Kindle Fire"||q===hl?xr:q===gn||q===wr||q===_n||q===Gs?"Console":q===rl?"Wearable":q?Le: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)?Le:xr:"Desktop"),$timezone:ql(),$timezone_offset:of()}),{$current_url:vn(me?.href,Z,mn),$host:me?.host,$pathname:me?.pathname,$raw_user_agent:Oe.length>1e3?Oe.substring(0,997)+"...":Oe,$browser_version:gh(Oe,navigator.vendor),$browser_language:rc(),$browser_language_prefix:(v=rc(),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===To&&(a.$lib_custom_api_host=this.config.api_host),u=t!==_r||s?t!==us||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(Xl+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var g=this.config.sanitize_properties;g&&(x.error(_c),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(_c),s=o(s,"$set_once")),r&&(this.Oi=!0),mr(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:Vr}),()=>{})}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:Vr})}getActiveMatchingSurveys(t,r){r===void 0&&(r=!1),this.surveys?this.surveys.getActiveMatchingSurveys(t,r):t([],{isLoaded:!1,error:Vr})}renderSurvey(t,r){var n;(n=this.surveys)==null||n.renderSurvey(t,r)}displaySurvey(t,r){var n;r===void 0&&(r=If),(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:Vr}}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:Vr})}un(t){return!t||ni(t)?(x.critical("Unique user id has not been set in posthog.identify"),!1):t===Wn?(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(bi)||this.register_once({$had_persisted_distinct_id:!0,$device_id:i},""),t!==i&&t!==this.get_property(Zr)&&(this.unregister(Zr),this.register({distinct_id:t}));var s,o=(this.persistence.get_property(Ve)||ar)===ar;t!==i&&o?(this.persistence.set_property(Ve,cr),this.setPersonPropertiesForFlags({$set:r||{},$set_once:n||{}},!1),this.capture(ls,{distinct_id:t,$anon_distinct_id:i},{$set:r||{},$set_once:n||{}}),this.$i=hc(t,r,n),(s=this.featureFlags)==null||s.setAnonymousDistinctId(i)):(r||n)&&this.setPersonProperties(r,n),t!==i&&(this.reloadFeatureFlags(),this.unregister(an))}}setPersonProperties(t,r){if((t||r)&&this.sn("posthog.setPersonProperties")){var n=hc(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(Ja,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(bi);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,ar),(u=this.sessionManager)==null||u.resetSessionId(),this.$i=null,this.config.cookieless_mode===ut)this.register_once({distinct_id:Wn,$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(bl)?(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(Zr,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,mc(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 hs(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))===cr||((r=this.sessionPersistence)==null?void 0:r.get_property(Ve))===cr}nn(){var t,r;return!(this.config.person_profiles==="never"||this.config.person_profiles===_o&&!this._isIdentified()&&mr(this.getGroups())&&((t=this.persistence)==null||(t=t.props)==null||!t[Zr])&&((r=this.persistence)==null||(r=r.props)==null||!r[Ti]))}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(Ti,!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 pc(this),this.pageViewManager=new tc(this),this.persistence&&(this.sessionPropsManager=new dc(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(gc)}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:Wn,$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(gc)}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 Fe?Gl(Fe,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(Ii,this.Ai),this.Ai=null)):this.Ai||(this.Ai=this.Ki.bind(this),pe(I,Ii,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 nh(t.event)?x.warn(s+". This can cause unexpected behavior."):x.info(s),null}n.properties&&!mr(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)}};ln.__defaultExtensionClasses={},ln.dn={trace:lr=()=>{},debug:lr,info:lr,warn:lr,error:lr,fatal:lr},(function(e,t){for(var r=0;t.length>r;r++)e.prototype[t[r]]=Hh(e.prototype[t[r]])})(ln,["identify"]);var Af=1,Of=3,$f=11;function yc(e){return e instanceof Element&&(e.id===Il||!(e.closest==null||!e.closest(".toolbar-global-fade-container")))}function Jt(e){return!!e&&e.nodeType===Af}function Ye(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function Jl(e){return!!e&&e.nodeType===Of}function Zl(e){return!!e&&e.nodeType===$f&&Jt(e.host)}function ha(e){return e?Wi(e).split(/\s+/):[]}function bc(e){var t=_?.location.href;return!!(t&&e&&e.some((r=>t.match(r))))}function $i(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 ha(t)}function Ql(e){return B(e)?null:Wi(e).split(/(\s+)/).filter((t=>dn(t))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function yn(e){var t="";return Ro(e)&&!td(e)&&e.childNodes&&e.childNodes.length&&ne(e.childNodes,(function(r){var n;Jl(r)&&r.textContent&&(t+=(n=Ql(r.textContent))!==null&&n!==void 0?n:"")})),Wi(t)}function Sc(e){return k(e.target)?e.srcElement||null:(t=e.target)!=null&&t.shadowRoot?e.composedPath()[0]||null:e.target||null;var t}var fa=["a","button","form","input","select","textarea","label"];function Ec(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 ed(e){var t=e.parentNode;return!(!t||!Jt(t))&&t}var Nf=["next","previous","prev",">","<"],wc=[".ph-no-rageclick",".ph-no-capture"],ko=e=>!e||Ye(e,"html")||!Jt(e),Tc=(e,t)=>{if(!_||ko(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var r=!1,n=[e],i=e;i.parentNode&&!Ye(i,"body");)if(Zl(i.parentNode))n.push(i.parentNode.host),i=i.parentNode.host;else{var s=ed(i);if(!s)break;if(t||fa.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 Ro(e){for(var t=e;t.parentNode&&!Ye(t,"body");t=t.parentNode){var r=$i(t);if(j(r,"ph-sensitive")||j(r,"ph-no-capture"))return!1}if(j($i(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 td(e){return!!(Ye(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||Ye(e,"select")||Ye(e,"textarea")||e.getAttribute("contenteditable")==="true")}var rd="(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})",Ff=new RegExp("^(?:"+rd+")$"),Mf=new RegExp(rd),nd="\\d{3}-?\\d{2}-?\\d{4}",Lf=new RegExp("^("+nd+")$"),Df=new RegExp("("+nd+")");function dn(e,t){return t===void 0&&(t=!0),!(B(e)||ce(e)&&(e=Wi(e),(t?Ff:Mf).test((e||"").replace(/[- ]/g,""))||(t?Lf:Df).test(e)))}function Ic(e){var t=yn(e);return dn(t=(t+" "+id(e)).trim())?t:""}function id(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=yn(r);t=(t+" "+i).trim(),r.childNodes&&r.childNodes.length&&(t=(t+" "+id(r)).trim())}catch(s){x.error("[AutoCapture]",s)}})),t}function xc(e){return e.replace(/"|\\"/g,'\\"')}function qf(e){var t=e.attr__class;return t?G(t)?t:ha(t):void 0}var kc=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}},Ss="$copy_autocapture",Es=oe("[AutoCapture]");function ws(e,t){return t.length>e?t.slice(0,e)+"...":t}function Uf(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!Jt(t));return t}function Hf(e,t){var r,n,{e:i,maskAllElementAttributes:s,maskAllText:o,elementAttributeIgnoreList:a,elementsChainAsString:c}=t;if(!Jt(e))return{props:{}};for(var u=[e],l=e;l.parentNode&&!Ye(l,"body");)if(Zl(l.parentNode))u.push(l.parentNode.host),l=l.parentNode.host;else{if(!Jt(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=Ro(y);if(Ye(y,"a")){var v=y.getAttribute("href");g=R&&!!v&&dn(v)&&v}j($i(y),"ph-no-capture")&&(m=!0),f.push((function(b,T,C,L){var D=b.tagName.toLowerCase(),N={tag_name:D};fa.indexOf(D)>-1&&!C&&(N.$el_text=D.toLowerCase()==="a"||D.toLowerCase()==="button"?ws(1024,Ic(b)):ws(1024,yn(b)));var q=$i(b);q.length>0&&(N.classes=q.filter((function(M){return M!==""}))),ne(b.attributes,(function(M){var z;if((!td(b)||["name","id","class","aria-label"].indexOf(M.name)!==-1)&&(L==null||!L.includes(M.name))&&!T&&dn(M.value)&&(!ce(z=M.name)||z.substring(0,10)!=="_ngcontent"&&z.substring(0,7)!=="_nghost")){var X=M.value;M.name==="class"&&(X=ha(X).join(" ")),N["attr__"+M.name]=ws(1024,X)}}));for(var Z=1,J=1,ue=b;ue=Uf(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(!Ro(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&&dn(D)&&(T[L]=D)}})),T})(y))})),m)return{props:{},explicitNoCapture:m};if(o||(f[0].$el_text=Ye(e,"a")||Ye(e,"button")?Ic(e):yn(e)),g){var w,P;f[0].attr__href=g;var A=(w=ki(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 oi(L).sort(((N,q)=>{var[Z]=N,[J]=q;return Z.localeCompare(J)})).forEach((N=>{var[q,Z]=N;return D[xc(q.toString())]=xc(Z.toString())})),(T+=":")+oi(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:qf(R),attr_id:R.attr__id,nth_child:R.nth_child,nth_of_type:R.nth_of_type,attributes:{}};return oi(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 Yr=oe("[ExceptionAutocapture]");function Rc(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 jf=oe("[TracingHeaders]"),wt=oe("[Web Vitals]"),Pc=9e5,Cc="disabled",Ac="lazy_loading",Xr="awaiting_config",Kn="missing_config";oe("[SessionRecording]"),oe("[SessionRecording]");var Po="[SessionRecording]",Tt=oe(Po),Bf=oe("[Heatmaps]");function Oc(e){return de(e)&&"clientX"in e&&"clientY"in e&&Ge(e.clientX)&&Ge(e.clientY)}var $c=oe("[Product Tours]"),Wf=["$set_once","$set"],It=oe("[SiteApps]"),Nc="Error while initializing PostHog app with config id ";function dr(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 zf=class{constructor(e){this.vn=new pa,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"||!dr(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=>dr(o.href,t.href,t.href_matching||"exact")));var i,s=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";return!!s&&dr((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=>dr(c.text,t.text,t.text_matching||"exact")||dr(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=>dr(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||Yl(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)}},Gf=class{constructor(e){this._instance=e,this.Tn=new Map,this.En=new Map,this.Mn=new Map}Pn(e,t){return!!e&&Yl(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===Br.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 zf(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,Br.Activation),this.En=this.Rn(e,Br.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,Br.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,Br.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}},Vf=class extends Gf{constructor(e){super(e)}$n(){return ao}Dn(){return nn.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({[ao]:e})}Hn(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},Ts="SDK is not enabled or survey functionality is not yet loaded",Fc="Disabled. Not loading surveys.",Yf=_!=null&&_.location?Pi(_.location.hash,"__posthog")||Pi(location.hash,"state"):null,Mc="_postHogToolbarParams",Lc=oe("[Toolbar]"),Ie=oe("[FeatureFlags]"),qt=oe("[FeatureFlags]",{debugEnabled:!0}),Is=`" failed. Feature flags didn't load in time.`,Dc=e=>{for(var t={},r=0;e.length>r;r++)t[e[r]]=!0;return t},qc=e=>{var t={};for(var[r,n]of oi(e||{}))n&&(t[r]=n);return t},st=oe("[Error tracking]"),Uc="Refusing to render web experiment since the viewer is a likely bot",Xf={icontains:(e,t)=>!!_&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!_&&t.href.toLowerCase().indexOf(e.toLowerCase())===-1,regex:(e,t)=>!!_&&Oi(t.href,e),not_regex:(e,t)=>!!_&&!Oi(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e},Kf=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(Uc);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=Ri(t?.search,"__experiment_id"),n=Ri(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||Xf[(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=$l();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(Uc):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 Fe&&this._instance?Gl(Fe,this.qt.custom_blocked_useragents):void 0}},Ue=oe("[Conversations]"),Ut="Conversations not available yet.",Vi={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(no),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(yr),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(io),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(bi),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(rn)||{}),group_properties:this.os(jt),timezone:ql()};yt(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({[uo]: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+Is)}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(so)||void 0,c=this.os(Ei)||void 0,u=this.os(an)||{};if(this.qt.advanced_feature_flags_dedup_per_session){var l,d=this._instance.get_session_id(),p=this.os(co);d&&d!==p&&(u={},(l=this.ni)==null||l.register({[an]:u,[co]: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({[an]:u});var v=this.getFeatureFlagDetails(e),b=[...(h=this.os(uo))!==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+Is)}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+Is)}}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({[ii]:h,[yr]: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({[ii]:Object.keys(qc($)),[yr]:$||{},[io]:y||{},[no]:R||{}},m?{[so]:m}:{},w?{[Ei]: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(),qt.info("All overrides cleared");if(G(e)){var t=Dc(e);return this.ni.register({[ot]:t}),this.ps(),qt.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),qt.info("Flag overrides cleared");else if(n.flags){if(G(n.flags)){var i=Dc(n.flags);this.ni.register({[ot]:i})}else this.ni.register({[ot]:n.flags});qt.info("Flag overrides set",{flags:n.flags})}}"payloads"in n&&(n.payloads===!1?(this.ni.unregister(gr),qt.info("Payload overrides cleared")):n.payloads&&(this.ni.register({[gr]:n.payloads}),qt.info("Payload overrides set",{payloads:n.payloads}))),this.ps();return}if(e&&typeof e=="object")return this.ni.register({[ot]:e}),this.ps(),qt.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(tn)||[]).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({[ii]:Object.keys(qc(a)),[yr]:a}),this.ps()}getEarlyAccessFeatures(e,t,r){t===void 0&&(t=!1);var n=this.os(tn),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(tn),(a=this.ni)==null||a.register({[tn]: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(rn)||{},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({[rn]:S({},r,s,n)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(rn)}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}}},Jf={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===Xr||this.bs===Kn?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=Cc,this._s=void 0,this._instance=e,!this._instance.sessionManager)throw Tt.error("started without valid sessionManager"),new Error(Po+" started without valid sessionManager. This is a bug.");if(this.qt.cookieless_mode===ut)throw new Error(Po+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get ws(){var e,t=!((e=this._instance.get_property(en))==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),Tt.info("starting")):(this.bs=Cc,this.stopRecording())}}xs(e){var t,r,n;this.ws&&(this.bs!==Xr&&this.bs!==Kn&&(this.bs=Ac),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 Tt.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?(Tt.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({[en]: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===Xr&&(this.bs=Kn,Tt.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):Tt.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(en);return(r==null||(t=r.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}Ms(){var e,t=this._instance.get_property(en);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 Tt.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[Rl]:!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===Kn||this.bs===Xr)return;this.bs=Xr,Tt.info("persisted remote config is stale, requesting fresh config before starting"),new Ul(this._instance).load();return}this.bs=Ac,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({[El]:!0}),(e=this.ys)==null||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.ys||(t=this.ni)==null||t.register({[Sl]:!0}),(e=this.ys)==null||e.overrideSampling()}overrideTrigger(e){var t,r;this.ys||(r=this.ni)==null||r.register({[e==="url"?wl:Tl]:!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))}}},Zf={autocapture:class{constructor(e){this.Ps=!1,this.Rs=null,this.Os=!1,this.instance=e,this.rageclicks=new kc(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){Es.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,Ss)}catch(n){Es.error("Failed to capture copy/cut event",n)}};pe(I,"copy",t,{capture:!0}),pe(I,"cut",t,{capture:!0})}}}else Es.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({[Xs]:!!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[Xs];if(yt(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=Sc(e);Jl(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(!_||ko(d))return!1;var f,h,g;if(et(p)?(f=!!p&&wc,h=void 0):(f=(g=p?.css_selector_ignorelist)!==null&&g!==void 0?g:wc,h=p?.content_ignorelist),f===!1)return!1;var{targetElementList:m}=Tc(d,!1);return!(function(w,P){if(w===!1||k(w))return!1;var A;if(w===!0)A=Nf;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:yn(w).toLowerCase(),ariaLabel:((P=w.getAttribute("aria-label"))==null?void 0:P.toLowerCase().trim())||""}})))&&!Ec(m,f)})(n,this.instance.config.rageclick)&&this.As(e,"$rageclick");var i=t===Ss;if(n&&(function(d,p,f,h,g){var m,w,P,A;if(f===void 0&&(f=void 0),!_||ko(d)||(m=f)!=null&&m.url_allowlist&&!bc(f.url_allowlist)||(w=f)!=null&&w.url_ignorelist&&bc(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}=Tc(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)||!Ec(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&&(fa.indexOf(b)>-1||d.getAttribute("contenteditable")==="true")}})(n,e,this.qt,i,i?["copy","cut"]:void 0)){var{props:s,explicitNoCapture:o}=Hf(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===Ss){var c,u=Ql(_==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__||Rc(_.history,"pushState",(n=>function(i,s,o){n.call(this,i,s,o),r.Ds("pushState")})),(t=_.history.replaceState)!=null&&t.__posthog_wrapped__||Rc(_.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[Ks]),this.rageclicks=new kc(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;Bf.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({[Ks]: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(_,xi,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 ec(this.instance,Zh,this.zs.bind(this)),this.Qs.startIfEnabledOrStop(),this.Js=this.At.bind(this),pe(I,Ii,this.Js),this.Ps=!0)}Bs(){var e;_&&I&&(this.Vs&&_.removeEventListener(xi,this.Vs),this.Ws&&I.removeEventListener("click",this.Ws,{capture:!0}),this.Zs&&I.removeEventListener("mousemove",this.Zs,{capture:!0}),this.Js&&I.removeEventListener(Ii,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&&Jt(u)&&!Ye(u,"body");){if(u===c)return!1;if(j(a,_?.getComputedStyle(u).position))return!0;u=ed(u)}return!1})(Sc(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"),!yc(e.target)&&Oc(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){!yc(e.target)&&Oc(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=vn(t,this.qt.mask_personal_data_properties?[...Pr,...r||[]]:[],mn);this.M=this.M||{},this.M[n]||(this.M[n]=[]),this.M[n].push(e)}}Zr(){this.M&&!mr(this.M)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:ec,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))wt.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)?wt.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()):wt.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):wt.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.js=!((t=this._instance.persistence)==null||!t.props[eo]),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[ro])||["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:Pc;return e>0&&6e4>=e?Pc:e}get isEnabled(){var e=me?.protocol;if(e!=="http:"&&e!=="https:")return wt.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&&(wt.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({[eo]:t}),this._instance.persistence.register({[ro]: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?wt.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 vn(e,this._instance.config.mask_personal_data_properties?[...Pr,...t||[]]:[],mn)}wt.error("Could not determine current URL")}}},Qf={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){Yr.error("failed to start",c),this.ho()}}},this._instance=e,this.co=!((t=this._instance.persistence)==null||!t.props[Js]),this.do=new oh({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:Yr}),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?(Yr.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 Yr.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({[Js]: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)?Yr.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 yh([new kh,new Mh,new Ph,new Rh,new Nh,new $h,new Ah,new Fh],(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(`
2
- `),d=c;l.length>d;d++){var p=l[d];if(1024>=p.length){var f=Ka.test(p)?p.replace(Ka,"$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||Rr});var A}))})(u)}})("web:javascript",wh,xh)),this._instance=e,this.fo=(t=(r=this._instance.persistence)==null?void 0:r.get_property(Zs))!==null&&t!==void 0?t:[],this.mo=yi(this.yo()),this.bo=new Dh(this.mo)}onConfigChange(){this.mo=yi(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({[Zs]:this.fo,[Qs]:s})}}get _o(){var e,t=!!this._instance.get_property(Qs),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)=>Lh.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({[vi]:e,[mi]: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({[vi]:e,[mi]: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=Vl[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)}}},eg=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({[to]:!!e.productTours}),this.loadIfEnabled())}loadIfEnabled(){var e,t;this.Eo||(e=this._instance).config.disable_product_tours||(t=e.persistence)==null||!t.get_property(to)||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?$c.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[si];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;$c.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({[si]: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(si)}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)}}},Vi),tg={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({},Xu(e,Wf),{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&&(It.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,It.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){It.error(Nc+e.id,o),i(!1)}if(n&&t.loaded)try{r()}catch(o){It.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){It.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 It.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 It.error(Nc+c,l)}))};for(var{id:o,url:a}of e.siteApps)s(o)}else It.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},rg={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 jf.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)}}},ng=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(Io)||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(Fc);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(go);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 Vf(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(Fc),e([]);var r,n=this._instance.get_property(oo);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({[oo]: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:Ts};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:Ts};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:Ts})):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(Tf.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!==mo.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!==mo.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()}}},Vi),ig={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),Pl(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=Yf||Pi(e.hash,"__posthog")||Pi(e.hash,"state"),s=i?Za((()=>JSON.parse(atob(decodeURIComponent(i)))))||Za((()=>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(Mc)||"{}")).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):Lc.warn("No toolbar load function found")}loadToolbar(e){var t=!(I==null||!I.getElementById(Il));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(Mc,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 Lc.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)}}},sg=S({experiments:Kf},Vi),og=S({},Vi,Jf,Zf,Qf,eg,tg,ng,rg,ig,sg,{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||Pl(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(go);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 Ue.error("Conversations enabled but missing token in remote config.")}}ta(e){if(this.ea)try{this._conversationsManager=e(this.ea,this._instance),Ue.info("Conversations loaded successfully")}catch(t){this.ra("Error completing conversations initialization",t)}else Ue.error("Cannot complete initialization: remote config is null")}ra(e,t){Ue.error(e,t),this._conversationsManager=null,this.Xo=!1}show(){this._conversationsManager?this._conversationsManager.show():Ue.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Yo===!0&&!yt(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):(Ue.warn(Ut),null)}))()}getMessages(e,t){var r=this;return je((function*(){return r._conversationsManager?r._conversationsManager.getMessages(e,t):(Ue.warn(Ut),null)}))()}markAsRead(e){var t=this;return je((function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(Ue.warn(Ut),null)}))()}getTickets(e){var t=this;return je((function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(Ue.warn(Ut),null)}))()}requestRestoreLink(e){var t=this;return je((function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(Ue.warn(Ut),null)}))()}restoreFromToken(e){var t=this;return je((function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(Ue.warn(Ut),null)}))()}restoreFromUrlToken(){var e=this;return je((function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Ue.warn(Ut),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(go)}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}=gl[d.level||"info"]||vh,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:Xa(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:Xa(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}}});ln.__defaultExtensionClasses=S({},og);var Hc,Vt=(Hc=un[vr]=new ln,(function(){function e(){e.done||(e.done=!0,Kl=!1,ne(un,(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")})(),Hc),ag="phc_nxaQk54MWAehmL72J4gjVbrQCpbSTedMyHn3PvFxAhkd",Se,Tr=!1,jc=!1,sd=()=>navigator.globalPrivacyControl===!0,ES=()=>Se,cg=async()=>{try{Se=(await(await fetch("/api/telemetry/config",{headers:sd()?{"x-db-studio-gpc":"1"}:void 0})).json()).data}catch{return}const e=ag;return!Se?.enabled||Tr?Se:jc?(Vt.opt_in_capturing(),Vt.identify(Se.installationId),Tr=!0,Se):(Vt.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)}}),Tr=!0,jc=!0,Se)},wS=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?sd()||await cg():(Vt.opt_out_capturing(),Tr=!1),r.data},TS=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}),Tr&&(Vt.reset(),Vt.identify(t.data.installationId))},IS={capture(e,t){!Tr||!Se?.enabled||Vt.capture(e,{...t,source:"client",app_version:Se.appVersion,$geoip_disable:!1})}},O=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,V=globalThis,Ni="10.52.0";function er(){return Yi(V),V}function Yi(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||"10.52.0",t[Ni]=t["10.52.0"]||{}}function Mr(e,t,r=V){const n=r.__SENTRY__=r.__SENTRY__||{},i=n[Ni]=n["10.52.0"]||{};return i[e]||(i[e]=t())}var ug=["debug","info","warn","error","log","assert","trace"],lg="Sentry Logger ",Fi={};function tr(e){if(!("console"in V))return e();const t=V.console,r={},n=Object.keys(Fi);n.forEach(i=>{const s=Fi[i];r[i]=t[i],t[i]=s});try{return e()}finally{n.forEach(i=>{t[i]=r[i]})}}function dg(){_a().enabled=!0}function pg(){_a().enabled=!1}function od(){return _a().enabled}function hg(...e){ga("log",...e)}function fg(...e){ga("warn",...e)}function gg(...e){ga("error",...e)}function ga(e,...t){O&&od()&&tr(()=>{V.console[e](`${lg}[${e}]:`,...t)})}function _a(){return O?Mr("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var E={enable:dg,disable:pg,isEnabled:od,log:hg,warn:fg,error:gg},ad=50;var Bc=/\(error: (.*)\)/,Wc=/captureMessage|captureException/;function cd(...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(`
3
- `);for(let a=n;a<o.length;a++){let c=o[a];c.length>1024&&(c=c.slice(0,1024));const u=Bc.test(c)?c.replace(Bc,"$1"):c;if(!u.includes("Error: ")){for(const l of t){const d=l(u);if(d){s.push(d);break}}if(s.length>=ad+i)break}}return vg(s.slice(i))}}function _g(e){return Array.isArray(e)?cd(...e):e}function vg(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Jn(t).function||"")&&t.pop(),t.reverse(),Wc.test(Jn(t).function||"")&&(t.pop(),Wc.test(Jn(t).function||"")&&t.pop()),t.slice(0,ad).map(r=>({...r,filename:r.filename||Jn(t).filename,function:r.function||"?"}))}function Jn(e){return e[e.length-1]||{}}var xs="<anonymous>";function ft(e){try{return!e||typeof e!="function"?xs:e.name||xs}catch{return xs}}function zc(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 ud(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}var sn={},Gc={};function Ft(e,t){return sn[e]=sn[e]||[],sn[e].push(t),()=>{const r=sn[e];if(r){const n=r.indexOf(t);n!==-1&&r.splice(n,1)}}}function Mt(e,t){if(!Gc[e]){Gc[e]=!0;try{t()}catch(r){O&&E.error(`Error while instrumenting ${e}`,r)}}}function We(e,t){const r=e&&sn[e];if(r)for(const n of r)try{n(t)}catch(i){O&&E.error(`Error while triggering instrumentation handler.
4
- Type: ${e}
5
- Name: ${ft(n)}
6
- Error:`,i)}}var ks=null;function ld(e){const t="error";Ft(t,e),Mt(t,mg)}function mg(){ks=V.onerror,V.onerror=function(e,t,r,n,i){return We("error",{column:n,error:i,line:r,msg:e,url:t}),ks?ks.apply(this,arguments):!1},V.onerror.__SENTRY_INSTRUMENTED__=!0}var Rs=null;function dd(e){const t="unhandledrejection";Ft(t,e),Mt(t,yg)}function yg(){Rs=V.onunhandledrejection,V.onunhandledrejection=function(e){return We("unhandledrejection",e),Rs?Rs.apply(this,arguments):!0},V.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var pd=Object.prototype.toString;function Xi(e){switch(pd.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 pd.call(e)===`[object ${t}]`}function hd(e){return Lr(e,"ErrorEvent")}function Vc(e){return Lr(e,"DOMError")}function bg(e){return Lr(e,"DOMException")}function dt(e){return Lr(e,"String")}function va(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Ar(e){return e===null||va(e)||typeof e!="object"&&typeof e!="function"}function bn(e){return Lr(e,"Object")}function Ki(e){return typeof Event<"u"&&gt(e,Event)}function Sg(e){return typeof Element<"u"&&gt(e,Element)}function Eg(e){return Lr(e,"RegExp")}function Rn(e){return!!(e?.then&&typeof e.then=="function")}function wg(e){return bn(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function gt(e,t){try{return e instanceof t}catch{return!1}}function fd(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function ma(e){return typeof Request<"u"&&gt(e,Request)}var ya=V,Tg=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||Tg;for(;r&&s++<n&&(u=Ig(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 Ig(e,t){const r=e,n=[];if(!r?.tagName)return"";if(ya.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 ya.document.location.href}catch{return""}}function gd(e,t=5){if(!ya.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 Me(e,t,r){if(!(t in e))return;const n=e[t];if(typeof n!="function")return;const i=r(n);typeof i=="function"&&_d(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 _d(e,t){try{e.prototype=t.prototype=t.prototype||{},$e(e,"__sentry_original__",t)}catch{}}function ba(e){return e.__sentry_original__}function vd(e){if(Xi(e))return{message:e.message,name:e.name,stack:e.stack,...Xc(e)};if(Ki(e)){const t={type:e.type,target:Yc(e.target),currentTarget:Yc(e.currentTarget),...Xc(e)};return typeof CustomEvent<"u"&&gt(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Yc(e){try{return Sg(e)?be(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Xc(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function xg(e){const t=Object.keys(vd(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}var pr;function Cn(e){if(pr!==void 0)return pr?pr(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),r=V;return t in r&&typeof r[t]=="function"?(pr=r[t],pr(e)):(pr=null,e())}function Pt(){return Cn(()=>Math.random())}function An(){return Cn(()=>Date.now())}function Co(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Kc(e,t){if(!Array.isArray(e))return"";const r=[];for(let n=0;n<e.length;n++){const i=e[n];try{fd(i)?r.push(ud(i)):r.push(String(i))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function pn(e,t,r=!1){return dt(e)?Eg(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=>pn(e,n,r))}function kg(){const e=V;return e.crypto||e.msCrypto}var Ps;function Rg(){return Pt()*16}function ze(e=kg()){try{if(e?.randomUUID)return Cn(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Ps||(Ps="10000000100040008000100000000000"),Ps.replace(/[018]/g,t=>(t^(Rg()&15)>>t/4).toString(16))}function md(e){return e.exception?.values?.[0]}function zt(e){const{message:t,event_id:r}=e;if(t)return t;const n=md(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function Ao(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 Or(e,t){const r=md(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 Jc(e){if(Pg(e))return!0;try{$e(e,"__sentry_captured__",!0)}catch{}return!1}function Pg(e){try{return e.__sentry_captured__}catch{}}var yd=1e3;function rr(){return An()/yd}function Cg(){const{performance:e}=V;if(!e?.now||!e.timeOrigin)return rr;const t=e.timeOrigin;return()=>(t+Cn(()=>e.now()))/yd}var Zc;function _e(){return(Zc??(Zc=Cg()))()}var Cs=null;function Ag(){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=Ag()),Cs}function Og(e){const t=_e(),r={sid:ze(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Ng(r)};return e&&$r(r,e),r}function $r(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:ze()),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 $g(e,t){let r={};t?r={status:t}:e.status==="ok"&&(r={status:"exited"}),$r(e,r)}function Ng(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 ze()}function pt(){return ze().substring(16)}var Oo="_sentrySpan";function Sn(e,t){t?$e(e,Oo,t):delete e[Oo]}function Mi(e){return e[Oo]}var Fg=100,Zt=class $o{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 $o;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,Sn(t,Mi(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&&$r(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 $o?r.getScopeData():bn(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,Sn(this,void 0),this._attachments=[],this.setPropagationContext({traceId:_t(),sampleRand:Pt()}),this._notifyScopeListeners(),this}addBreadcrumb(t,r){const n=typeof r=="number"?r:Fg;if(n<=0)return this;const i={timestamp:rr(),...t,message:t.message?Co(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:Mi(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||ze();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||ze();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||ze();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 Mg(){return Mr("defaultCurrentScope",()=>new Zt)}function Lg(){return Mr("defaultIsolationScope",()=>new Zt)}var Qc=e=>e instanceof Promise&&!e[bd],bd=Symbol("chained PromiseLike"),Dg=(e,t,r)=>{const n=e.then(i=>(t(i),i),i=>{throw r(i),i});return Qc(n)&&Qc(e)?n:qg(e,n)},qg=(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,{[bd]:!0}),t},Ug=class{constructor(e,t){let r;e?r=e:r=new Zt;let n;t?n=t:n=new Zt,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)?Dg(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 Nr(){const e=er(),t=Yi(e);return t.stack=t.stack||new Ug(Mg(),Lg())}function Hg(e){return Nr().withScope(e)}function jg(e,t){const r=Nr();return r.withScope(()=>(r.getStackTop().scope=e,t(e)))}function eu(e){return Nr().withScope(()=>e(Nr().getIsolationScope()))}function Bg(){return{withIsolationScope:eu,withScope:Hg,withSetScope:jg,withSetIsolationScope:(e,t)=>eu(t),getCurrentScope:()=>Nr().getScope(),getIsolationScope:()=>Nr().getIsolationScope()}}function Dr(e){const t=Yi(e);return t.acs?t.acs:Bg()}var Sd;function Wg(){return Sd?.()}function zg(){return Sd!==void 0}function te(){const e=er();return Dr(e).getCurrentScope()}function nt(){const e=er();return Dr(e).getIsolationScope()}function Gg(){return Mr("globalScope",()=>new Zt)}function Sa(...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 Vg(e){const t=Wg();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",Yg="sentry.sample_rate",Xg="sentry.previous_trace_sample_rate",vt="sentry.op",ve="sentry.origin",Li="sentry.idle_span_finish_reason",$n="sentry.measurement_unit",Nn="sentry.measurement_value",tu="sentry.custom_span_name",Ed="sentry.profile_id",nr="sentry.exclusive_time",Kg="sentry.link.type",Jg="gen_ai.conversation.id";function Zg(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 wd(e,t){e.setAttribute("http.response.status_code",t);const r=Zg(t);r.message!=="unknown_error"&&e.setStatus(r)}function Qg(e){try{const t=V.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function e_(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var Td="_sentryScope",Id="_sentryIsolationScope";function t_(e,t,r){e&&($e(e,Id,Qg(r)),$e(e,Td,t))}function Di(e){const t=e;return{scope:t[Td],isolationScope:e_(t[Id])}}var xd="sentry-";function kd(e){const t=n_(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 r_(e){if(e)return i_(Object.entries(e).reduce((t,[r,n])=>(n&&(t[`${xd}${r}`]=n),t),{}))}function n_(e){if(!(!e||!dt(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,r)=>{const n=ru(r);return Object.entries(n).forEach(([i,s])=>{t[i]=s}),t},{}):ru(e)}function ru(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 i_(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 s_=/^o(\d+)\./,o_=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function a_(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 c_(e){const t=o_.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 Rd({host:s,pass:i,path:c,projectId:u,port:o,protocol:r,publicKey:n})}function Rd(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function u_(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+$/)?a_(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 l_(e){return e.match(s_)?.[1]}function d_(e){const t=e.getOptions(),{host:r}=e.getDsn()||{};let n;return t.orgId?n=String(t.orgId):r&&(n=l_(r)),n}function p_(e){const t=typeof e=="string"?c_(e):Rd(e);if(!(!t||!u_(t)))return t}function En(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 Pd=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function h_(e){if(!e)return;const t=e.match(Pd);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 f_(e,t){const r=h_(e),n=kd(t);if(!r?.traceId)return{traceId:_t(),sampleRand:Pt()};const i=g_(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 Cd(e=_t(),t=pt(),r){let n="";return r!==void 0&&(n=r?"-1":"-0"),`${e}-${t}${n}`}function Ad(e=_t(),t=pt(),r){return`00-${e}-${t}-${r?"01":"00"}`}function g_(e,t){const r=En(t?.sample_rand);if(r!==void 0)return r;const n=En(t?.sample_rate);return n&&e?.parentSampled!==void 0?e.parentSampled?Pt()*n:n+Pt()*(1-n):Pt()}var nu=!1;function __(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 v_(e){const{spanId:t,traceId:r,isRemote:n}=e.spanContext(),i=n?t:K(e).parent_span_id,s=Di(e).scope;return{parent_span_id:i,span_id:n?s?.getPropagationContext().propagationSpanId||pt():t,trace_id:r}}function m_(e){const{traceId:t,spanId:r}=e.spanContext(),n=Lt(e);return Cd(t,r,n)}function y_(e){const{traceId:t,spanId:r}=e.spanContext(),n=Lt(e);return Ad(t,r,n)}function Od(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 $d(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"?iu(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?iu(e.getTime()):_e()}function iu(e){return e>9999999999?e/1e3:e}function K(e){if(Ld(e))return e.getSpanJSON();const{spanId:t,traceId:r}=e.spanContext();if(Md(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:Fd(e),start_timestamp:ht(i),timestamp:ht(o)||void 0,status:Dd(a),op:n[vt],origin:n[ve],links:Od(c)}}return{span_id:t,trace_id:r,start_timestamp:0,data:{}}}function Nd(e){if(Ld(e))return e.getStreamedSpanJSON();const{spanId:t,traceId:r}=e.spanContext();if(Md(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:Fd(e),start_timestamp:ht(i),end_timestamp:ht(o),is_segment:e===Fo(e),status:qd(a),attributes:n,links:$d(c)}}return{span_id:t,trace_id:r,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===Fo(e)}}function Fd(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function Md(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Ld(e){return typeof e.getSpanJSON=="function"}function Lt(e){const{traceFlags:t}=e.spanContext();return t===1}function Dd(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function qd(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}var Yt="_sentryChildSpans",No="_sentryRootSpan";function Ud(e,t){const r=e[No]||e;$e(t,No,r),e[Yt]?e[Yt].add(t):$e(e,Yt,new Set([t]))}function b_(e,t){e[Yt]&&e[Yt].delete(t)}function ci(e){const t=new Set;function r(n){if(!t.has(n)&&Lt(n)){t.add(n);const i=n[Yt]?Array.from(n[Yt]):[];for(const s of i)r(s)}}return r(e),Array.from(t)}var Ee=Fo;function Fo(e){return e[No]||e}function qe(){const e=er(),t=Dr(e);return t.getActiveSpan?t.getActiveSpan():Mi(te())}function Mo(){nu||(tr(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),nu=!0)}var su=!1;function S_(){if(su)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",su=!0,ld(e),dd(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 ou(e){E.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function wn(e,t){if(!t?.length)return!1;for(const r of t){if(T_(r)){if(e.description&&pn(e.description,r))return O&&ou(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&&pn(e.description,r.name):!0,s=r.op?e.op&&pn(e.op,r.op):!0,o=r.attributes?Object.entries(r.attributes).every(([a,c])=>E_(e.attributes?.[a],c)):!0;if(i&&s&&o)return O&&ou(e),!0}return!1}function E_(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?pn(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((r,n)=>r===t[n]):e===t}function w_(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 T_(e){return typeof e=="string"||e instanceof RegExp}var I_="production",Hd="_frozenDsc";function ui(e,t){$e(e,Hd,t)}function jd(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:d_(t)};return t.emit("createDsc",i),i}function Bd(e,t){const r=t.getPropagationContext();return r.dsc||jd(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[Hd];if(c)return a(c);const u=s?.get("sentry.dsc"),l=u&&kd(u);if(l)return a(l);const d=jd(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")??Di(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 Wd(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}var x_=Symbol.for("sentry.skipNormalization"),k_=Symbol.for("sentry.overrideNormalizationDepth");function R_(e){return!!e[x_]}function P_(e){const t=e[k_];return typeof t=="number"?t:void 0}function at(e,t=100,r=1/0){try{return Lo("",e,t,r)}catch(n){return{ERROR:`**non-serializable** (${n})`}}}function zd(e,t=3,r=102400){const n=at(e,t);return $_(n)>r?zd(e,t-1,r):n}function Lo(e,t,r=1/0,n=1/0,i=N_()){const[s,o]=i;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const a=C_(e,t);if(!a.startsWith("[object "))return a;if(R_(t))return t;const c=P_(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 Lo("",l.toJSON(),u-1,n,i)}catch{}const d=Array.isArray(t)?[]:{};let p=0;const f=vd(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]=Lo(h,g,u-1,n,i),p++}return o(t),d}function C_(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(fd(t))return ud(t);if(wg(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=A_(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}}function A_(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function O_(e){return~-encodeURI(e).split(/%..|./).length}function $_(e){return O_(JSON.stringify(e))}function N_(){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 F_(e,t){const[r,n]=e;return[r,[...n,t]]}function Do(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 M_(e,t){return Do(e,(r,n)=>t.includes(n))}function qo(e){const t=Yi(V);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function L_(e){const[t,r]=e;let n=JSON.stringify(t);function i(s){typeof n=="string"?n=typeof s=="string"?n+s:[qo(n),s]:n.push(typeof s=="string"?qo(s):s)}for(const s of r){const[o,a]=s;if(i(`
7
- ${JSON.stringify(o)}
8
- `),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:D_(n)}function D_(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 q_(e){return[{type:"span"},e]}function U_(e){const t=typeof e.data=="string"?qo(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var Gd={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 H_(e){return e in Gd}function au(e){return H_(e)?Gd[e]:e}function Vd(e){if(!e?.sdk)return;const{name:t,version:r}=e.sdk;return{name:t,version:r}}function j_(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 B_(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 W_(e,t,r,n){const i=Vd(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 z_(e,t,r,n){const i=Vd(r),s=e.type&&e.type!=="replay_event"?e.type:"event";B_(e,r?.sdk);const o=j_(e,i,n,t);return delete e.sdkProcessingMetadata,ir(o,[[{type:s},e]])}function G_(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!wn({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=Wd(a)?h:a(h);return g||(Mo(),h)}:K,p=[];for(const f of u){const h=d(f);h&&p.push(q_(h))}return ir(o,p)}function V_(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}
9
- ${u.join(`
10
- `)}`)}function Y_(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 X_(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 cu(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 uu=1e3,Ji=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),Y_(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:Dd(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[ve],profile_id:this._attributes[Ed],exclusive_time:this._attributes[nr],measurements:cu(this._events),is_segment:this._isStandaloneSpan&&Ee(this)===this||void 0,segment_id:this._isStandaloneSpan?Ee(this).spanContext().spanId:void 0,links:Od(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:qd(this._status),attributes:this._attributes,links:$d(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,r){O&&E.log("[Tracing] Adding an event to span:",e);const n=lu(t)?t:r||_e(),i=lu(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?J_(G_([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&&(Di(this).scope||te()).captureEvent(t)}_convertSpanToTransaction(){if(!du(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}=Di(this),r=e?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;const n=ci(this).filter(a=>a!==this&&!K_(a)).map(a=>K(a)).filter(du),i=this._attributes[Rt];delete this._attributes[tu],n.forEach(a=>{delete a.data[tu]});const s={contexts:{trace:__(this)},spans:n.length>uu?n.sort((a,c)=>a.start_timestamp-c.start_timestamp).slice(0,uu):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=cu(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 lu(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function du(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function K_(e){return e instanceof Ji&&e.isStandaloneSpan()}function J_(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 Z_(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=En(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 Q_="__SENTRY_SUPPRESS_TRACING__";function sr(e){const t=Xd();if(t.startInactiveSpan)return t.startInactiveSpan(e);const r=tv(e),{forceTransaction:n,parentSpan:i}=e;return(e.scope?s=>Sa(e.scope,s):i!==void 0?s=>Yd(i,s):s=>s())(()=>{const s=te(),o=nv(s,i),a=Y();return e.onlyIfParent&&!o?(a?.recordDroppedEvent("no_parent_span","span"),new rt):ev({parentSpan:o,spanArguments:r,forceTransaction:n,scope:s})})}function Yd(e,t){const r=Xd();return r.withActiveSpan?r.withActiveSpan(e,t):Sa(n=>(Sn(n,e||void 0),t(n)))}function ev({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)};ui(a,c)}return a}const i=Y();if(iv(i,t))return Ea(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=rv(e,n,t),Ud(e,o);else if(e){const a=$t(e),{traceId:c,spanId:u}=e.spanContext(),l=Lt(e);o=pu({traceId:c,parentSpanId:u,...t},n,l),ui(o,a)}else{const{traceId:a,dsc:c,parentSpanId:u,sampled:l}={...s.getPropagationContext(),...n.getPropagationContext()};o=pu({traceId:a,parentSpanId:u,...t},n,l),c&&ui(o,c)}return V_(o),t_(o,n,s),o}function tv(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 Xd(){const e=er();return Dr(e)}function pu(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=Ea(t),[d,p,f]=l?[!1]:Z_(i,{name:s,parentSampled:a,attributes:c,parentSampleRate:En(u.dsc?.sample_rate)},u.sampleRand),h=new Ji({...e,attributes:{[Rt]:"custom",[Yg]: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 rv(e,t,r){const{spanId:n,traceId:i}=e.spanContext(),s=Ea(t),o=s?!1:Lt(e),a=o?new Ji({...r,parentSpanId:n,traceId:i,sampled:o}):new rt({traceId:i});Ud(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 nv(e,t){if(t)return t;if(t===null)return;const r=Mi(e);if(!r)return;const n=Y();return(n?n.getOptions():{}).parentSpanIsAlwaysRootSpan?Ee(r):r}function iv(e,t){const r=e?.getOptions().ignoreSpans;return!e||!mt(e)||!r?.length?!1:wn({description:t.name||"",op:t.attributes?.["sentry.op"]||t.op,attributes:t.attributes},r)}function Ea(e){return e.getScopeData().sdkProcessingMetadata[Q_]===!0}var li={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},sv="heartbeatFailed",ov="idleTimeout",av="finalTimeout",cv="externalFinish";function Kd(e,t={}){const r=new Map;let n=!1,i,s=cv,o=!t.disableAutoFinish;const a=[],{idleTimeout:c=li.idleTimeout,finalTimeout:u=li.finalTimeout,childSpanTimeout:l=li.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 ui(v,b),v}const h=te(),g=qe(),m=uv(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=ci(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&&wn({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=ov,m.end(v))},c)}function A(v){i=setTimeout(()=>{!n&&o&&(s=sv,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()),Sn(h,g);const b=K(m),{start_timestamp:T}=b;if(!T)return;b.data["sentry.idle_span_finish_reason"]||m.setAttribute(Li,s);const C=b.status;(!C||C==="unknown")&&m.setStatus({code:1}),E.log(`[Tracing] Idle span "${b.op}" finished`);const L=ci(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)&&(b_(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 Ji&&v.isStandaloneSpan()||ci(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=av,m.end())},u),m}function uv(e){const t=sr(e);return Sn(te(),t),O&&E.log("[Tracing] Started span is an idle span"),t}function lv(e,t){const{fingerprint:r,span:n,breadcrumbs:i,sdkProcessingMetadata:s}=t;dv(e,t),n&&fv(e,n),gv(e,r),pv(e,i),hv(e,s)}function hu(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;Kr(e,"extra",r),Kr(e,"tags",n),Kr(e,"attributes",i),Kr(e,"user",s),Kr(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 Kr(e,t,r){e[t]=On(e[t],r,1)}function Jd(e,t){const r=Gg().getScopeData();return e&&hu(r,e.getScopeData()),t&&hu(r,t.getScopeData()),r}function dv(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 pv(e,t){const r=[...e.breadcrumbs||[],...t];e.breadcrumbs=r.length?r:void 0}function hv(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function fv(e,t){e.contexts={trace:v_(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 gv(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 _v="thismessage:/";function Zd(e){return"isRelative"in e}function Qd(e,t){const r=e.indexOf("://")<=0&&e.indexOf("//")!==0,n=t??(r?_v: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 vv(e){if(Zd(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 Xt(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 mv(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 ep(e,t){const r=e.attributes??(e.attributes={});Object.entries(t).forEach(([n,i])=>{i!=null&&!(n in r)&&(r[n]=i)})}var As=0,fu=1,gu=2;function Fn(e){return new tp(t=>{t(e)})}function wa(e){return new tp((t,r)=>{r(e)})}var tp=class Uo{constructor(t){this._state=As,this._handlers=[],this._runExecutor(t)}then(t,r){return new Uo((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 Uo((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===As)return;const t=this._handlers.slice();this._handlers=[],t.forEach(r=>{r[0]||(this._state===fu&&r[1](this._value),this._state===gu&&r[2](this._value),r[0]=!0)})}_runExecutor(t){const r=(s,o)=>{if(this._state===As){if(Rn(o)){o.then(n,i);return}this._state=s,this._value=o,this._executeHandlers()}},n=s=>{r(fu,s)},i=s=>{r(gu,s)};try{t(n,i)}catch(s){i(s)}}};function yv(e,t,r,n=0){try{const i=Ho(t,r,e,n);return Rn(i)?i:Fn(i)}catch(i){return wa(i)}}function Ho(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=>Ho(o,t,r,n+1)):Ho(s,t,r,n+1)}var Ht,_u,vu,xt;function bv(e){const t=V._sentryDebugIds,r=V._debugIds;if(!t&&!r)return{};const n=t?Object.keys(t):[],i=r?Object.keys(r):[];if(xt&&n.length===_u&&i.length===vu)return xt;_u=n.length,vu=i.length,xt={},Ht||(Ht={});const s=(o,a)=>{for(const c of o){const u=a[c],l=Ht?.[c];if(l&&xt&&u)xt[l[0]]=u,Ht&&(Ht[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&&xt&&Ht){xt[f]=u,Ht[c]=[f,u];break}}}}};return t&&s(n,t),r&&s(i,r),xt}function Sv(e,t,r,n,i,s){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||r.event_id||ze(),timestamp:t.timestamp||rr()},u=r.integrations||e.integrations.map(g=>g.name);Ev(c,e),Iv(c,u),i&&i.emit("applyFrameMetadata",t),t.type===void 0&&wv(c,e.stackParser);const l=kv(n,r.captureContext);r.mechanism&&Or(c,r.mechanism);const d=i?i.getEventProcessors():[],p=Jd(s,l),f=[...r.attachments||[],...p.attachments];f.length&&(r.attachments=f),lv(c,p);const h=[...d,...p.eventProcessors];return(r.data&&r.data.__sentry__===!0?Fn(c):yv(h,c,r)).then(g=>(g&&Tv(g),typeof o=="number"&&o>0?xv(g,o,a):g))}function Ev(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=Co(o.url,s)),s&&e.exception?.values?.forEach(a=>{a.value&&(a.value=Co(a.value,s))})}function wv(e,t){const r=bv(t);e.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(i=>{i.filename&&(i.debug_id=r[i.filename])})})}function Tv(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 Iv(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function xv(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 kv(e,t){if(!t)return e;const r=e?e.clone():new Zt;return r.update(t),r}function Rv(e){if(e)return Pv(e)?{captureContext:e}:Av(e)?{captureContext:e}:e}function Pv(e){return e instanceof Zt||typeof e=="function"}var Cv=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Av(e){return Object.keys(e).some(t=>Cv.includes(t))}function Ov(e,t){return te().captureException(e,Rv(t))}function rp(e,t){return te().captureEvent(e,t)}function $v(e,t){nt().setContext(e,t)}async function xS(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 Nv(){const e=Y();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function mu(e){const t=nt(),{user:r}=Jd(t,te()),{userAgent:n}=V.navigator||{},i=Og({user:r,...n&&{userAgent:n},...e}),s=t.getSession();return s?.status==="ok"&&$r(s,{status:"exited"}),np(),t.setSession(i),i}function np(){const e=nt(),t=te().getSession()||e.getSession();t&&$g(t),ip(),e.setSession()}function ip(){const e=nt(),t=Y(),r=e.getSession();r&&t&&t.captureSession(r)}function Os(e=!1){if(e){np();return}ip()}function Fv(e){const t=e.protocol?`${e.protocol}:`:"",r=e.port?`:${e.port}`:"";return`${t}//${e.host}${r}${e.path?`/${e.path}`:""}/api/`}function Mv(e){return`${Fv(e)}${e.projectId}/envelope/`}function Lv(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 Dv(e,t,r){return t||`${Mv(e)}?${Lv(e,r)}`}var yu=[];function qv(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 Uv(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 qv(n)}function Hv(e,t){const r={};return t.forEach(n=>{n?.beforeSetup&&n.beforeSetup(e)}),t.forEach(n=>{n&&sp(e,n,r)}),r}function bu(e,t){for(const r of t)r?.afterAllSetup&&r.afterAllSetup(e)}function sp(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,!yu.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),yu.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 jv(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Bv(){return"npm"}function Wv(){return!jv()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Ta(){return typeof window<"u"&&(!Wv()||zv())}function zv(){return V.process?.type==="renderer"}function Gv(e,t){const r=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...Ta()&&{ingest_settings:{infer_ip:r,infer_user_agent:r}},items:e}]}function Vv(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,[Gv(e,i)])}function jo(e,t){const r=t??Yv(e)??[];if(r.length===0)return;const n=e.getOptions(),i=Vv(r,n._metadata,n.tunnel,e.getDsn(),n.sendDefaultPii);op().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(i)}function Yv(e){return op().get(e)}function op(){return Mr("clientToLogBufferMap",()=>new WeakMap)}function Xv(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,...Ta()&&{ingest_settings:{infer_ip:r,infer_user_agent:r}},items:e}]}function Kv(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,[Xv(e,i)])}function ap(e,t){const r=t??Jv(e)??[];if(r.length===0)return;const n=e.getOptions(),i=Kv(r,n._metadata,n.tunnel,e.getDsn(),n.sendDefaultPii);cp().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(i)}function Jv(e){return cp().get(e)}function cp(){return Mr("clientToMetricBufferMap",()=>new WeakMap)}function up(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var Ia=Symbol.for("SentryBufferFullError");function xa(e=100){const t=new Set;function r(){return t.size<e}function n(o){t.delete(o)}function i(o){if(!r())return wa(Ia);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=>up(setTimeout(()=>u(!1),o)))];return Promise.race(c)}return{get $(){return Array.from(t)},add:i,drain:s}}var Zv=6e4;function Qv(e,t=An()){const r=parseInt(`${e}`,10);if(!isNaN(r))return r*1e3;const n=Date.parse(`${e}`);return isNaN(n)?Zv:n-t}function em(e,t){return e[t]||e.all||0}function tm(e,t,r=An()){return em(e,t)>r}function rm(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+Qv(o,n):t===429&&(i.all=n+6e4);return i}function nm(e,t,r=xa(e.bufferSize||64)){let n={};const i=o=>r.drain(o);function s(o){const a=[];if(Do(o,(d,p)=>{const f=au(p);tm(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(M_(c,["client_report"])){O&&E.warn(`Dropping client report. Will not send outcomes (reason: ${d}).`);return}Do(c,(p,f)=>{e.recordDroppedEvent(d,au(f))})},l=()=>t({body:L_(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=rm(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===Ia)return O&&E.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw d})}return{send:s,flush:i}}function im(e,t,r){const n=[{type:"client_report"},{timestamp:r||rr(),discarded_events:e}];return ir(t?{dsn:t}:{},[n])}function lp(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 sm(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?.[Ed],exclusive_time:o?.[nr],measurements:e.measurements,is_segment:!0}}function om(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 Su="Not capturing exception because it's already been captured.",Eu="Discarded session because of missing or non-string release",dp=Symbol.for("SentryInternalError"),pp=Symbol.for("SentryDoNotSendEventError"),am=5e3;function di(e){return{message:e,[dp]:!0}}function $s(e){return{message:e,[pp]:!0}}function wu(e){return!!e&&typeof e=="object"&&dp in e}function Tu(e){return!!e&&typeof e=="object"&&pp in e}function Iu(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=up(setTimeout(()=>{i(e)},am)))}),e.on("flush",()=>{i(e)})}var cm=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=xa(e.transportOptions?.bufferSize??64),e.dsn?this._dsn=p_(e.dsn):O&&E.warn("No DSN provided, client will not send events."),this._dsn){const t=Dv(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&&Iu(this,"afterCaptureLog","flushLogs",pm,jo),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Iu(this,"afterCaptureMetric","flushMetrics",dm,ap)}captureException(e,t,r){const n=ze();if(Jc(e))return O&&E.log(Su),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:ze(),...r},s=va(e)?e:String(e),o=Ar(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=ze();if(t?.originalException&&Jc(t.originalException))return O&&E.log(Su),n;const i={event_id:n,...t},s=e.sdkProcessingMetadata||{},o=s.capturedSpanScope,a=s.capturedSpanIsolationScope,c=xu(e.type);return this._process(()=>this._captureEvent(e,i,o||r,a),c),i.event_id}captureSession(e){this.sendSession(e),$r(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){jo(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),sp(this,e,this._integrations),t||bu(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let r=z_(e,this._dsn,this._options._metadata,this._options.tunnel);for(const n of t.attachments||[])r=F_(r,U_(n));this.sendEnvelope(r).then(n=>this.emit("afterSendEvent",e,n))}sendSession(e){const{release:t,environment:r=I_}=this._options;if("aggregates"in e){const i=e.attrs||{};if(!i.release&&!t){O&&E.warn(Eu);return}i.release=i.release||t,i.environment=i.environment||r,e.attrs=i}else{if(!e.release&&!t){O&&E.warn(Eu);return}e.release=e.release||t,e.environment=e.environment||r}this.emit("beforeSendSession",e);const n=W_(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=Hv(this,e),bu(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)&&($r(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),Sv(i,e,t,r,this,n).then(o=>(o===null||(this.emit("postprocessEvent",o,t),o.contexts={trace:{...o.contexts?.trace,...Vg(r)},...o.contexts},o.sdkProcessingMetadata={dynamicSamplingContext:Bd(this,r),...o.sdkProcessingMetadata}),o))}_captureEvent(e,t={},r=te(),n=nt()){return O&&Bo(e)&&E.log(`Captured error event \`${lp(e)[0]||"<unknown>"}\``),this._processEvent(e,t,r,n).then(i=>i.event_id,i=>{O&&(Tu(i)?E.log(i.message):wu(i)?E.warn(i.message):E.warn(i))})}_processEvent(e,t,r,n){const i=this.getOptions(),{sampleRate:s}=i,o=hp(e),a=Bo(e),c=`before send for type \`${e.type||"error"}\``,u=typeof s>"u"?void 0:En(s);if(a&&typeof u=="number"&&Pt()>u)return this.recordDroppedEvent("sample_rate","error"),wa($s(`Discarding event because it's not included in the random sample (sampling rate = ${s})`));const l=xu(e.type);return this._prepareEvent(e,t,r,n).then(d=>{if(d===null)throw this.recordDroppedEvent("event_processor",l),$s("An event processor returned `null`, will not send event.");return t.data?.__sentry__===!0?d:um(lm(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 $s(`${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 Tu(d)||wu(d)?d:(this.captureException(d,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:d}),di(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
11
- Reason: ${d}`))})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===Ia&&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=im(e,this._options.tunnel&&qr(this._dsn));this.sendEnvelope(t)}};function xu(e){return e==="replay_event"?"replay":e||"error"}function um(e,t){const r=`${t} must return \`null\` or a valid event.`;if(Rn(e))return e.then(n=>{if(!bn(n)&&n!==null)throw di(r);return n},n=>{throw di(`${t} rejected with ${n}`)});if(!bn(e)&&e!==null)throw di(r);return e}function lm(e,t,r,n){const{beforeSend:i,beforeSendTransaction:s,ignoreSpans:o}=t,a=!Wd(t.beforeSendSpan)&&t.beforeSendSpan;let c=r;if(Bo(c)&&i)return i(c,n);if(hp(c)){if(a||o){const u=sm(c);if(o?.length&&wn({description:u.description,op:u.op,attributes:u.data},o))return null;if(a){const l=a(u);l?c=On(r,om(l)):Mo()}if(c.spans){const l=[],d=c.spans;for(const f of d){if(o?.length&&wn({description:f.description,op:f.op,attributes:f.data},o)){w_(d,f);continue}if(a){const h=a(f);h?l.push(h):(Mo(),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 Bo(e){return e.type===void 0}function hp(e){return e.type==="transaction"}function dm(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+fp(e.attributes)}function pm(e){let t=0;return e.message&&(t+=e.message.length*2),t+fp(e.attributes)}function fp(e){if(!e)return 0;let t=0;return Object.values(e).forEach(r=>{Array.isArray(r)?t+=r.length*ku(r[0]):Ar(r)?t+=ku(r):t+=100}),t}function ku(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function hm(e){return Xi(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Ru(e){return hm(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function fm(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 gm(r),r.init(),r}function gm(e){te().setClient(e)}function _m(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 gp(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:Ni})),i.version=Ni)}function _p(e={}){const t=e.client||Y();if(!Nv()||!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&&zg())return{};const o=s?m_(s):vm(i),a=s?$t(s):Bd(t,i),c=r_(a);if(!Pd.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?y_(s):mm(i)),u}function vm(e){const{traceId:t,sampled:r,propagationSpanId:n}=e.getPropagationContext();return Cd(t,n,r)}function mm(e){const{traceId:t,sampled:r,propagationSpanId:n}=e.getPropagationContext();return Ad(t,n,r)}var ym=100;function Qt(e,t){const r=Y(),n=nt();if(!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:s=ym}=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 Pu,bm="FunctionToString",Cu=new WeakMap,Sm=(()=>({name:bm,setupOnce(){Pu=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=ba(this),r=Cu.has(Y())&&t!==void 0?t:this;return Pu.apply(r,e)}}catch{}},setup(e){Cu.set(e,!0)}})),Em=Sm,wm=[/^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$/],Tm="EventFilters",Im=(e={})=>{let t;return{name:Tm,setup(r){t=Au(e,r.getOptions())},processEvent(r,n,i){return t||(t=Au(e,i.getOptions())),km(r,t)?null:r}}},xm=((e={})=>({...Im(e),name:"InboundFilters"}));function Au(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:wm],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function km(e,t){if(e.type){if(e.type==="transaction"&&Pm(e,t.ignoreTransactions))return O&&E.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
12
- Event: ${zt(e)}`),!0}else{if(Rm(e,t.ignoreErrors))return O&&E.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
13
- Event: ${zt(e)}`),!0;if($m(e))return O&&E.warn(`Event dropped due to not having an error message, error type or stacktrace.
14
- Event: ${zt(e)}`),!0;if(Cm(e,t.denyUrls))return O&&E.warn(`Event dropped due to being matched by \`denyUrls\` option.
15
- Event: ${zt(e)}.
16
- Url: ${qi(e)}`),!0;if(!Am(e,t.allowUrls))return O&&E.warn(`Event dropped due to not being matched by \`allowUrls\` option.
17
- Event: ${zt(e)}.
18
- Url: ${qi(e)}`),!0}return!1}function Rm(e,t){return t?.length?lp(e).some(r=>Ct(r,t)):!1}function Pm(e,t){if(!t?.length)return!1;const r=e.transaction;return r?Ct(r,t):!1}function Cm(e,t){if(!t?.length)return!1;const r=qi(e);return r?Ct(r,t):!1}function Am(e,t){if(!t?.length)return!0;const r=qi(e);return r?Ct(r,t):!0}function Om(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 qi(e){try{const t=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return t?Om(t):null}catch{return O&&E.error(`Cannot extract url for event ${zt(e)}`),null}}function $m(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function Nm(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=Wo(e,t,n,s.originalException,r,i.exception.values,o,0))}function Wo(e,t,r,n,i,s,o,a){if(s.length>=r+1)return s;let c=[...s];if(gt(n[i],Error)){Ou(o,a,n);const u=e(t,n[i]),l=c.length;$u(u,i,l,a),c=Wo(e,t,r,n[i],i,[u,...c],u,l)}return vp(n)&&n.errors.forEach((u,l)=>{if(gt(u,Error)){Ou(o,a,n);const d=e(t,u),p=c.length;$u(d,`errors[${l}]`,p,a),c=Wo(e,t,r,u,i,[d,...c],d,p)}}),c}function vp(e){return Array.isArray(e.errors)}function Ou(e,t,r){e.mechanism={handled:!0,type:"auto.core.linked_errors",...vp(r)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function $u(e,t,r,n){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:r,parent_id:n}}function Fm(e){const t="console",r=Ft(t,e);return Mt(t,Mm),r}function Mm(){"console"in V&&ug.forEach(function(e){e in V.console&&Me(V.console,e,function(t){return Fi[e]=t,function(...r){We("console",{args:r,level:e}),Fi[e]?.apply(V.console,r)}})})}function Lm(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var Dm="Dedupe",qm=(()=>{let e;return{name:Dm,processEvent(t){if(t.type)return t;try{if(Hm(t,e))return O&&E.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),Um=qm;function Hm(e,t){return t?!!(jm(e,t)||Bm(e,t)):!1}function jm(e,t){const r=e.message,n=t.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!yp(e,t)||!mp(e,t))}function Bm(e,t){const r=Nu(t),n=Nu(e);return!(!r||!n||r.type!==n.type||r.value!==n.value||!yp(e,t)||!mp(e,t))}function mp(e,t){let r=zc(e),n=zc(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 yp(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 Nu(e){return e.exception?.values?.[0]}var Wm="ConversationId",zm=(()=>({name:Wm,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(Jg,i)}})}})),Gm=zm;function bp(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}function Vm(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&&(Km(h,e),Ym(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(Qm(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=Xm(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 Ym(e,t,r){(typeof r=="object"&&r!==null?r.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function Xm(e,t,r,n){const i=_p({span:r,propagateTraceparent:n}),s=i["sentry-trace"],o=i.baggage,a=i.traceparent;if(!s)return;const c=t.headers||(ma(e)?e.headers:void 0);if(c)if(Jm(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?Zn(l)||u.set("baggage",`${l},${o}`):u.set("baggage",o)}return u}else if(Zm(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"&&Zn(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=>Zn(g)):Zn(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 Km(e,t){if(t.response){wd(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 Zn(e){return typeof e!="string"?!1:e.split(",").some(t=>t.trim().startsWith(xd))}function Jm(e){return typeof Headers<"u"&&gt(e,Headers)}function Zm(e){return Array.isArray(e)?e.every(t=>Array.isArray(t)&&t.length===2&&typeof t[0]=="string"):!1}function Qm(e,t,r){if(e.startsWith("data:"))return{name:`${t} ${At(e)}`,attributes:Fu(e,void 0,t,r)};const n=Qd(e);return{name:`${t} ${n?vv(n):e}`,attributes:Fu(e,n,t,r)}}function Fu(e,t,r,n){const i={url:At(e),type:"fetch","http.method":r,[ve]:n,[vt]:"http.client"};return t&&(Zd(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 Tn=V;function ey(){return"history"in Tn&&!!Tn.history}function ty(){if(!("fetch"in Tn))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function zo(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function ry(){if(typeof EdgeRuntime=="string")return!0;if(!ty())return!1;if(zo(Tn.fetch))return!0;let e=!1;const t=Tn.document;if(t&&typeof t.createElement=="function")try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),r.contentWindow?.fetch&&(e=zo(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 Sp(e,t){const r="fetch",n=Ft(r,e);return Mt(r,()=>Ep(void 0,t)),n}function ny(e){const t="fetch-body-resolved",r=Ft(t,e);return Mt(t,()=>Ep(sy)),r}function Ep(e,t=!1){t&&!ry()||Me(V,"fetch",function(r){return function(...n){const i=new Error,{method:s,url:o}=oy(n),a={args:n,fetchData:{method:s,url:o},startTimestamp:_e()*1e3,virtualError:i,headers:ay(n)};return e||We("fetch",{...a}),r.apply(V,n).then(async c=>(e?e(c):We("fetch",{...a,endTimestamp:_e()*1e3,response:c}),c),c=>{We("fetch",{...a,endTimestamp:_e()*1e3,error:c}),Xi(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 iy(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 sy(e){let t;try{t=e.clone()}catch{return}iy(t,()=>{We("fetch-body-resolved",{endTimestamp:_e()*1e3,response:e})})}function pi(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Mu(e){return typeof e=="string"?e:e?pi(e,"url")?e.url:e.toString?e.toString():"":""}function oy(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[r,n]=e;return{url:Mu(r),method:pi(n,"method")?String(n.method).toUpperCase():ma(r)&&pi(r,"method")?String(r.method).toUpperCase():"GET"}}const t=e[0];return{url:Mu(t),method:pi(t,"method")?String(t.method).toUpperCase():"GET"}}function ay(e){const[t,r]=e;try{if(typeof r=="object"&&r!==null&&"headers"in r&&r.headers)return new Headers(r.headers);if(ma(t))return new Headers(t.headers)}catch{}}var H=V,Go=0;function wp(){return Go>0}function cy(){Go++,setTimeout(()=>{Go--})}function Fr(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(ba(e))return e}catch{return e}const n=function(...i){try{const s=i.map(o=>Fr(o,t));return e.apply(this,s)}catch(s){throw cy(),Sa(o=>{o.addEventProcessor(a=>(t.mechanism&&(Ao(a,void 0,void 0),Or(a,t.mechanism)),a.extra={...a.extra,arguments:i},a)),Ov(s)}),s}};try{for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}catch{}_d(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 Ui(){const e=Pn(),{referrer:t}=H.document||{},{userAgent:r}=H.navigator||{};return{url:e,headers:{...t&&{Referer:t},...r&&{"User-Agent":r}}}}function ka(e,t){const r=Ra(e,t),n={type:hy(t),value:fy(t)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function uy(e,t,r,n){const i=Y()?.getOptions().normalizeDepth,s=yy(t),o={__serialized__:zd(t,i)};if(s)return{exception:{values:[ka(e,s)]},extra:o};const a={exception:{values:[{type:Ki(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:vy(t,{isUnhandledRejection:n})}]},extra:o};if(r){const c=Ra(e,r);c.length&&(a.exception.values[0].stacktrace={frames:c})}return a}function Ns(e,t){return{exception:{values:[ka(e,t)]}}}function Ra(e,t){const r=t.stacktrace||t.stack||"",n=dy(t),i=py(t);try{return e(r,n,i)}catch{}return[]}var ly=/Minified React error #\d+;/i;function dy(e){return e&&ly.test(e.message)?1:0}function py(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Tp(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function hy(e){const t=e?.name;return!t&&Tp(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function fy(e){const t=e?.message;return Tp(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?Ru(t.error):Ru(e):"No error message"}function gy(e,t,r,n){const i=Pa(e,t,r?.syntheticException||void 0,n);return Or(i),i.level="error",r?.event_id&&(i.event_id=r.event_id),Fn(i)}function _y(e,t,r="info",n,i){const s=Vo(e,t,n?.syntheticException||void 0,i);return s.level=r,n?.event_id&&(s.event_id=n.event_id),Fn(s)}function Pa(e,t,r,n,i){let s;if(hd(t)&&t.error)return Ns(e,t.error);if(Vc(t)||bg(t)){const o=t;if("stack"in t)s=Ns(e,t);else{const a=o.name||(Vc(o)?"DOMError":"DOMException"),c=o.message?`${a}: ${o.message}`:a;s=Vo(e,c,r,n),Ao(s,c)}return"code"in o&&(s.tags={...s.tags,"DOMException.code":`${o.code}`}),s}return Xi(t)?Ns(e,t):bn(t)||Ki(t)?(s=uy(e,t,r,i),Or(s,{synthetic:!0}),s):(s=Vo(e,t,r,n),Ao(s,`${t}`,void 0),Or(s,{synthetic:!0}),s)}function Vo(e,t,r,n){const i={};if(n&&r){const s=Ra(e,r);s.length&&(i.exception={values:[{value:t,stacktrace:{frames:s}}]}),Or(i,{synthetic:!0})}if(va(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 vy(e,{isUnhandledRejection:t}){const r=xg(e),n=t?"promise rejection":"exception";return hd(e)?`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``:Ki(e)?`Event \`${my(e)}\` (type=${e.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function my(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function yy(e){return Object.values(e).find(t=>t instanceof Error)}var by=class extends cm{constructor(e){const t=Sy(e),r=H.SENTRY_SDK_SOURCE||Bv();gp(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&&jo(this),c&&ap(this))}),n&&this.on("beforeSendSession",_m)}eventFromException(e,t){return gy(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return _y(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 Sy(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:H.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var bt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,U=V,Ey=(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=Ey(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 Hi(e,t,r){U.document&&U.removeEventListener(e,t,r)}var Ir=-1,Ip=new Set,wy=()=>U.document?.visibilityState==="hidden"&&!U.document?.prerendering?0:1/0,hi=e=>{if(Ty(e)&&Ir>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of Ip)t();isFinite(Ir)||(Ir=e.type==="visibilitychange"?e.timeStamp:0,Hi("prerenderingchange",hi,!0))}},Dn=()=>{if(U.document&&Ir<0){const e=Ur();Ir=(U.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>t.name==="hidden"&&t.startTime>e)[0]?.startTime)??wy(),Ot("visibilitychange",hi,!0),Ot("pagehide",hi,!0),Ot("prerenderingchange",hi,!0)}return{get firstHiddenTime(){return Ir},onHidden(e){Ip.add(e)}}};function Ty(e){return e.type==="pagehide"||U.document?.visibilityState==="hidden"}var Iy=()=>`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:Iy(),navigationType:n}},Fs=new WeakMap;function Ca(e,t){try{return Fs.get(e)||Fs.set(e,new t),Fs.get(e)}catch{return new t}}var xy=class Yo{constructor(){Yo.prototype.__init.call(this),Yo.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{}},Aa=e=>{let t=!1;return()=>{t||(e(),t=!0)}},Zi=e=>{U.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},ky=[1800,3e3],Ry=(e,t={})=>{Zi(()=>{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,ky,t.reportAllChanges))})},Py=[.1,.25],Cy=(e,t={})=>{Ry(Aa(()=>{const r=qn("CLS",0);let n;const i=Dn(),s=Ca(t,xy),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,Py,t.reportAllChanges),i.onHidden(()=>{o(a.takeRecords()),n(!0)}),U?.setTimeout?.(n))}))},xp=0,Ms=1/0,Qn=0,Ay=e=>{e.forEach(t=>{t.interactionId&&(Ms=Math.min(Ms,t.interactionId),Qn=Math.max(Qn,t.interactionId),xp=Qn?(Qn-Ms)/7+1:0)})},Xo,kp=()=>Xo?xp:performance.interactionCount||0,Oy=()=>{"interactionCount"in performance||Xo||(Xo=Hr("event",Ay,{type:"event",buffered:!0,durationThreshold:0}))},Ls=10,Rp=0,$y=()=>kp()-Rp,Ny=class Ko{constructor(){Ko.prototype.__init.call(this),Ko.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){Rp=kp(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor($y()/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<Ls||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>Ls){const i=this._longestInteractionList.splice(Ls);for(const s of i)this._longestInteractionMap.delete(s.id)}this._onAfterProcessingINPCandidate?.(n)}}},Pp=e=>{const t=U.requestIdleCallback||U.setTimeout;U.document?.visibilityState==="hidden"?e():(e=Aa(e),Ot("visibilitychange",e,{once:!0,capture:!0}),Ot("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),Hi("visibilitychange",e,{capture:!0}),Hi("pagehide",e,{capture:!0})}))},Fy=[200,500],My=40,Ly=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const r=Dn();Zi(()=>{Oy();const n=qn("INP");let i;const s=Ca(t,Ny),o=c=>{Pp(()=>{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??My});i=Mn(e,n,Fy,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),r.onHidden(()=>{o(a.takeRecords()),i(!0)}))})},Dy=class{_processEntry(e){this._onBeforeProcessingEntry?.(e)}},qy=[2500,4e3],Uy=(e,t={})=>{Zi(()=>{const r=Dn(),n=qn("LCP");let i;const s=Ca(t,Dy),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,qy,t.reportAllChanges);const c=Aa(()=>{o(a.takeRecords()),a.disconnect(),i(!0)}),u=l=>{l.isTrusted&&(Pp(c),Hi(l.type,u,{capture:!0}))};for(const l of["keydown","click","visibilitychange"])Ot(l,u,{capture:!0})}})},Hy=[800,1800],Jo=e=>{U.document?.prerendering?Zi(()=>Jo(e)):U.document?.readyState!=="complete"?addEventListener("load",()=>Jo(e),!0):setTimeout(e)},jy=(e,t={})=>{const r=qn("TTFB"),n=Mn(e,r,Hy,t.reportAllChanges);Jo(()=>{const i=Ln();i&&(r.value=Math.max(i.responseStart-Ur(),0),r.entries=[i],n(!0))})},hn={},ji={},Cp,Ap,Op,$p;function Oa(e,t=!1){return Qi("cls",e,Wy,Cp,t)}function $a(e,t=!1){return Qi("lcp",e,zy,Ap,t)}function By(e){return Qi("ttfb",e,Gy,Op)}function Np(e){return Qi("inp",e,Vy,$p)}function In(e,t){return Fp(e,t),ji[e]||(Yy(e),ji[e]=!0),Mp(e,t)}function Un(e,t){const r=hn[e];if(r?.length)for(const n of r)try{n(t)}catch(i){bt&&E.error(`Error while triggering instrumentation handler.
19
- Type: ${e}
20
- Name: ${ft(n)}
21
- Error:`,i)}}function Wy(){return Cy(e=>{Un("cls",{metric:e}),Cp=e},{reportAllChanges:!0})}function zy(){return Uy(e=>{Un("lcp",{metric:e}),Ap=e},{reportAllChanges:!0})}function Gy(){return jy(e=>{Un("ttfb",{metric:e}),Op=e})}function Vy(){return Ly(e=>{Un("inp",{metric:e}),$p=e})}function Qi(e,t,r,n,i=!1){Fp(e,t);let s;return ji[e]||(s=r(),ji[e]=!0),n&&t({metric:n}),Mp(e,t,i?s:void 0)}function Yy(e){const t={};e==="event"&&(t.durationThreshold=0),Hr(e,r=>{Un(e,{entries:r})},t)}function Fp(e,t){hn[e]=hn[e]||[],hn[e].push(t)}function Mp(e,t,r){return()=>{r&&r();const n=hn[e];if(!n)return;const i=n.indexOf(t);i!==-1&&n.splice(i,1)}}function Xy(e){return"duration"in e}var Ky=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 Ds(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),Yd(e,()=>{const s=sr({startTime:t,...n});return s&&s.end(r),s})}function Na(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 Jy(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 es(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function ts(e,t){let r,n=!1;function i(a){!n&&r&&t(a,r.spanContext().spanId,r),n=!0}Ky(()=>{i("pagehide")});const s=e.on("beforeStartNavigationSpan",(a,c)=>{c?.isRedirect||(i("navigation"),s(),o())}),o=e.on("afterStartPageLoadSpan",a=>{r=a,o()})}function Zy(e){let t=0,r;if(!es("layout-shift"))return;const n=Oa(({metric:i})=>{const s=i.entries[i.entries.length-1];s&&(t=i.value,r=s)},!0);ts(e,(i,s)=>{Qy(t,r,s,i),n()})}function Qy(e,t,r,n){bt&&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=Na({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 eb(e){let t=0,r;if(!es("largest-contentful-paint"))return;const n=$a(({metric:i})=>{const s=i.entries[i.entries.length-1];!s||!jn(i.value)||(t=i.value,r=s)},!0);ts(e,(i,s)=>{tb(t,r,s,i),n()})}function tb(e,t,r,n){if(!jn(e))return;bt&&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=Na({name:o,transaction:s,attributes:a,startTime:i});c&&(c.addEvent("lcp",{[$n]:"millisecond",[Nn]:e}),c.end(i))}function He(e){return e&&((we()||performance.timeOrigin)+e)/1e3}function Lp(e){const t={};if(e.nextHopProtocol!=null){const{name:r,version:n}=Jy(e.nextHopProtocol);t["network.protocol.version"]=n,t["network.protocol.name"]=r}return we()||Hn()?.timeOrigin?rb({...t,"http.request.redirect_start":He(e.redirectStart),"http.request.redirect_end":He(e.redirectEnd),"http.request.worker_start":He(e.workerStart),"http.request.fetch_start":He(e.fetchStart),"http.request.domain_lookup_start":He(e.domainLookupStart),"http.request.domain_lookup_end":He(e.domainLookupEnd),"http.request.connect_start":He(e.connectStart),"http.request.secure_connection_start":He(e.secureConnectionStart),"http.request.connection_end":He(e.connectEnd),"http.request.request_start":He(e.requestStart),"http.request.response_start":He(e.responseStart),"http.request.response_end":He(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function rb(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}var nb=2147483647,Lu=0,Re={},Ae,Bi;function ib({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:r}){const n=Hn();if(n&&we()){n.mark&&U.performance.mark("sentry-tracing-init");const i=t?eb(r):t===!1?ub():void 0,s=e?Zy(r):e===!1?cb():void 0,o=lb();return()=>{o(),i?.(),s?.()}}return()=>{}}function sb(){In("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 ob(){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 ab(){In("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=gd(r.target);o&&(s.attributes["ui.component_name"]=o),Nt(t,n,n+i,s)}}})}function cb(){return Oa(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Re.cls={value:e.value,unit:""},Bi=t)},!0)}function ub(){return $a(({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 lb(){return By(({metric:e})=>{e.entries[e.entries.length-1]&&(Re.ttfb={value:e.value,unit:"millisecond"})})}function db(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(Lu).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":gb(e,f,u);break;case"mark":case"paint":case"measure":{hb(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":mb(e,f,f.name,h,g,u,o)}}),Lu=Math.max(l.length-1,0),yb(e,i),d==="pageload"){if(Eb(Re),i){const f=(h,g,m)=>{const w=m??`browser.web_vital.${h}.value`;e.setAttribute(w,g),bt&&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])=>{X_(f,h.value,h.unit)}),bb(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,Bi=void 0,Re={}}function pb(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function hb(e,t,r,n,i,s){if(pb(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),fb(d,t),c<=l&&Nt(e,c,l,{name:t.name,op:t.entryType,attributes:d})}function fb(e,t){try{const r=t.detail;if(!r)return;if(typeof r=="object"){for(const[n,i]of Object.entries(r))if(i&&Ar(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(Ar(r)){e["sentry.browser.measure.detail"]=r;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(r)}catch{}}catch{}}function gb(e,t,r){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(n=>{ei(e,t,n,r)}),ei(e,t,"secureConnection",r,"TLS/SSL"),ei(e,t,"fetch",r,"cache"),ei(e,t,"domainLookup",r,"DNS"),vb(e,t,r)}function ei(e,t,r,n,i=r){const s=t[_b(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 _b(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function vb(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 mb(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=Xt(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),Sb(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,...Lp(t)},d=s+n,p=d+i;Nt(e,d,p,{name:r.replace(U.location.origin,""),op:a,attributes:l})}function yb(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),Ds(n.rtt)&&(Re["connection.rtt"]={value:n.rtt,unit:"millisecond"},t&&e.setAttribute("network.connection.rtt",n.rtt))),Ds(r.deviceMemory)&&(t?e.setAttribute("device.memory.estimated_capacity",r.deviceMemory):e.setAttribute("deviceMemory",`${r.deviceMemory} GB`)),Ds(r.hardwareConcurrency)&&(t?e.setAttribute("device.processor_count",r.hardwareConcurrency):e.setAttribute("hardwareConcurrency",String(r.hardwareConcurrency)))}function bb(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)),Bi?.sources&&t.recordClsOnPageloadSpan&&Bi.sources.forEach((r,n)=>e.setAttribute(`cls.source.${n+1}`,be(r.node)))}function Sb(e,t,r){r.forEach(([n,i])=>{const s=e[n];s!=null&&(typeof s=="number"&&s<nb||typeof s=="string")&&(t[i]=s)})}function Eb(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 qs=[],fn=new Map,hr=new Map;function wb(){if(Hn()&&we()){const e=Tb();return()=>{e()}}return()=>{}}var xn={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 Tb(){return Np(Ib)}var Ib=({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&&xn[h.name]);if(!r)return;const{interactionId:n}=r,i=xn[r.name],s=se(we()+r.startTime),o=qe(),a=o?Ee(o):void 0,c=n!=null?fn.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=Na({name:d,transaction:l,attributes:p,startTime:s});f&&(f.addEvent("inp",{[$n]:"millisecond",[Nn]:e.value}),f.end(s+t))};function xb(e){return e!=null?fn.get(e):void 0}function kb(){const e=Object.keys(xn);Ta()&&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(hr.set(a,o),hr.size>50){const c=hr.keys().next().value;c!==void 0&&hr.delete(c)}}function r(i){const s=Math.round(i.startTime);let o=hr.get(s);if(!o)for(let a=-5;a<=5;a++){const c=hr.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(!Xy(a))return;const c=a.interactionId;if(c==null||fn.has(c))return;const u=a.target?be(a.target):r(a);if(qs.length>10){const l=qs.shift();fn.delete(l)}qs.push(c),fn.set(c,{span:o,elementName:u})})};In("event",n),In("first-input",n)}function Fa(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&&Nd(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 Rb(e){let t=0,r;if(!es("largest-contentful-paint"))return;const n=$a(({metric:i})=>{const s=i.entries[i.entries.length-1];!s||!jn(i.value)||(t=i.value,r=s)},!0);ts(e,(i,s,o)=>{Pb(t,r,o,i),n()})}function Pb(e,t,r,n){if(!jn(e))return;bt&&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),Fa({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 Cb(e){let t=0,r;if(!es("layout-shift"))return;const n=Oa(({metric:i})=>{const s=i.entries[i.entries.length-1];s&&(t=i.value,r=s)},!0);ts(e,(i,s,o)=>{Ab(t,r,o,i),n()})}function Ab(e,t,r,n){bt&&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)}),Fa({name:s,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:e,attributes:o,parentSpan:r,reportEvent:n,startTime:i})}function Ob(){if(!Hn()||!we())return;Np(({metric:t})=>{if(t.value==null||se(t.value)>60)return;const r=t.entries.find(n=>n.duration===t.value&&xn[n.name]);r&&$b(t.value,r)})}function $b(e,t){bt&&E.log(`Sending INP span (${e})`);const r=se(we()+t.startTime),n=se(e),i=xn[t.name],s=xb(t.interactionId),o=qe(),a=o?Ee(o):void 0,c=s?.span||a,u=c?Nd(c).name:te().getScopeData().transactionName;Fa({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 Nb=1e3,Du,Zo,Qo;function Fb(e){Ft("dom",e),Mt("dom",Mb)}function Mb(){if(!U.document)return;const e=We.bind(null,"dom"),t=qu(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")&&(Me(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=qu(e);u.handler=l,i.call(this,s,l,a)}u.refCount++}catch{}return i.call(this,s,o,a)}}),Me(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 Lb(e){if(e.type!==Zo)return!1;try{if(!e.target||e.target._sentryId!==Qo)return!1}catch{}return!0}function Db(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function qu(e,t=!1){return r=>{if(!r||r._sentryCaptured)return;const n=qb(r);if(Db(r.type,n))return;$e(r,"_sentryCaptured",!0),n&&!n._sentryId&&$e(n,"_sentryId",ze());const i=r.type==="keypress"?"input":r.type;Lb(r)||(e({event:r,name:i,global:t}),Zo=r.type,Qo=n?n._sentryId:void 0),clearTimeout(Du),Du=U.setTimeout(()=>{Qo=void 0,Zo=void 0},Nb)}}function qb(e){try{return e.target}catch{return null}}var ti;function Ma(e){const t="history";Ft(t,e),Mt(t,Ub)}function Ub(){if(U.addEventListener("popstate",()=>{const t=U.location.href,r=ti;ti=t,r!==t&&We("history",{from:r,to:t})}),!ey())return;function e(t){return function(...r){const n=r.length>2?r[2]:void 0;if(n){const i=ti,s=Hb(String(n));if(ti=s,i===s)return t.apply(this,r);We("history",{from:i,to:s})}return t.apply(this,r)}}Me(U.history,"pushState",e),Me(U.history,"replaceState",e)}function Hb(e){try{return new URL(e,U.location.origin).toString()}catch{return e}}var fi={};function jb(e){const t=fi[e];if(t)return t;let r=U[e];if(zo(r))return fi[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){bt&&E.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return r&&(fi[e]=r.bind(U))}function Bb(e){fi[e]=void 0}var Sr="__sentry_xhr_v3__";function Dp(e){Ft("xhr",e),Mt("xhr",Wb)}function Wb(){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=zb(n[1]);if(!o||!a)return t.apply(r,n);r[Sr]={method:o,url:a,request_headers:{}},o==="POST"&&a.match(/sentry_key/)&&(r.__sentry_own_request__=!0);const c=()=>{const u=r[Sr];if(u&&r.readyState===4){try{u.status_code=r.status}catch{}const l={endTimestamp:_e()*1e3,startTimestamp:s,xhr:r,virtualError:i};We("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[Sr];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[Sr];if(!i)return t.apply(r,n);n[0]!==void 0&&(i.body=n[0]);const s={startTimestamp:_e()*1e3,xhr:r};return We("xhr",s),t.apply(r,n)}})}function zb(e){if(dt(e))return e;try{return e.toString()}catch{}}function Gb(e){let t;try{t=e.getAllResponseHeaders()}catch(r){return bt&&E.error(r,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
22
- `).reduce((r,n)=>{const[i,s]=n.split(": ");return s&&(r[i.toLowerCase()]=s),r},{}):{}}var Vb=40;function Yb(e,t=jb("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 Bb("fetch"),c}finally{r-=o,n--}}return nm(e,i,xa(e.bufferSize||Vb))}var De=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Xb=30,Kb=50;function ea(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 Jb=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Zb=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Qb=/\((\S*)(?::(\d+))(?::(\d+))\)/,e0=/at (.+?) ?\(data:(.+?),/,t0=e=>{const t=e.match(e0);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const r=Jb.exec(e);if(r){const[,i,s,o]=r;return ea(i,"?",+s,+o)}const n=Zb.exec(e);if(n){if(n[2]?.indexOf("eval")===0){const o=Qb.exec(n[2]);o&&(n[2]=o[1],n[3]=o[2],n[4]=o[3])}const[i,s]=qp(n[1]||"?",n[2]);return ea(s,i,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},r0=[Xb,t0],n0=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,i0=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,s0=e=>{const t=n0.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=i0.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]=qp(n,r),ea(r,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},o0=[Kb,s0],a0=[r0,o0],c0=cd(...a0),qp=(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]},ri=1024,u0="Breadcrumbs",l0=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:u0,setup(r){t.console&&Fm(f0(r)),t.dom&&Fb(h0(r,t.dom)),t.xhr&&Dp(g0(r)),t.fetch&&Sp(_0(r)),t.history&&Ma(v0(r)),t.sentry&&r.on("beforeSendEvent",p0(r))}}}),d0=l0;function p0(e){return function(r){Y()===e&&Qt({category:`sentry.${r.type==="transaction"?"transaction":"event"}`,event_id:r.event_id,level:r.level,message:zt(r)},{event:r})}}function h0(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>ri&&(De&&E.warn(`\`dom.maxStringLength\` cannot exceed ${ri}, but a value of ${a} was configured. Sentry will use ${ri} instead.`),a=ri),typeof o=="string"&&(o=[o]);try{const u=n.event,l=m0(u)?u.target:u;i=be(l,{keyAttrs:o,maxStringLength:a}),s=gd(l)}catch{i="<unknown>"}if(i.length===0)return;const c={category:`ui.${n.name}`,message:i};s&&(c.data={"ui.component_name":s}),Qt(c,{event:n.event,name:n.name,global:n.global})}}function f0(e){return function(r){if(Y()!==e)return;const n={category:"console",data:{arguments:r.args,logger:"console"},level:Lm(r.level),message:Kc(r.args," ")};if(r.level==="assert")if(r.args[0]===!1)n.message=`Assertion failed: ${Kc(r.args.slice(1)," ")||"console.assert"}`,n.data.arguments=r.args.slice(1);else return;Qt(n,{input:r.args,level:r.level})}}function g0(e){return function(r){if(Y()!==e)return;const{startTimestamp:n,endTimestamp:i}=r,s=r.xhr[Sr];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:bp(c)};e.emit("beforeOutgoingRequestBreadcrumb",p,d),Qt(p,d)}}function _0(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),Qt(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:bp(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",c,a),Qt(c,a)}}}function v0(e){return function(r){if(Y()!==e)return;let n=r.from,i=r.to;const s=Xt(H.location.href);let o=n?Xt(n):void 0;const a=Xt(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),Qt({category:"navigation",data:{from:n,to:i}})}}function m0(e){return!!e&&!!e.target}var y0="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(","),b0="BrowserApiErrors",S0=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:b0,setupOnce(){t.setTimeout&&Me(H,"setTimeout",Uu),t.setInterval&&Me(H,"setInterval",Uu),t.requestAnimationFrame&&Me(H,"requestAnimationFrame",w0),t.XMLHttpRequest&&"XMLHttpRequest"in H&&Me(XMLHttpRequest.prototype,"send",T0);const r=t.eventTarget;r&&(Array.isArray(r)?r:y0).forEach(n=>I0(n,t))}}}),E0=S0;function Uu(e){return function(...t){const r=t[0];return t[0]=Fr(r,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${ft(e)}`}}),e.apply(this,t)}}function w0(e){return function(t){return e.apply(this,[Fr(t,{mechanism:{data:{handler:ft(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function T0(e){return function(...t){const r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(n=>{n in r&&typeof r[n]=="function"&&Me(r,n,function(i){const s={mechanism:{data:{handler:ft(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${n}`}},o=ba(i);return o&&(s.mechanism.data.handler=ft(o)),Fr(i,s)})}),e.apply(this,t)}}function I0(e,t){const r=H[e]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(Me(r,"addEventListener",function(n){return function(i,s,o){try{x0(s)&&(s.handleEvent=Fr(s.handleEvent,{mechanism:{data:{handler:ft(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&k0(this,i,s),n.apply(this,[i,Fr(s,{mechanism:{data:{handler:ft(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),o])}}),Me(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 x0(e){return typeof e.handleEvent=="function"}function k0(e,t,r){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,r)}var R0=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof H.document>"u"){De&&E.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}mu({ignoreDuration:!0}),Os();const r=nt();let n=r.getUser();r.addScopeListener(i=>{const s=i.getUser();(n?.id!==s?.id||n?.ip_address!==s?.ip_address)&&(Os(),n=s)}),t==="route"&&Ma(({from:i,to:s})=>{i!==s&&(mu({ignoreDuration:!0}),Os())})}}},P0="CultureContext",C0=(()=>({name:P0,preprocessEvent(e){const t=Hu();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})},processSegmentSpan(e){const t=Hu();t&&ep(e,{"culture.locale":t.locale,"culture.timezone":t.timezone,"culture.calendar":t.calendar})}})),A0=C0;function Hu(){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 O0="GlobalHandlers",$0=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:O0,setupOnce(){Error.stackTraceLimit=50},setup(r){t.onerror&&(F0(r),ju("onerror")),t.onunhandledrejection&&(M0(r),ju("onunhandledrejection"))}}}),N0=$0;function F0(e){ld(t=>{const{stackParser:r,attachStacktrace:n}=Up();if(Y()!==e||wp())return;const{msg:i,url:s,line:o,column:a,error:c}=t,u=q0(Pa(r,c||i,void 0,n,!1),s,o,a);u.level="error",rp(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function M0(e){dd(t=>{const{stackParser:r,attachStacktrace:n}=Up();if(Y()!==e||wp())return;const i=L0(t),s=Ar(i)?D0(i):Pa(r,i,void 0,n,!0);s.level="error",rp(s,{originalException:i,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function L0(e){if(Ar(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 D0(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function q0(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:U0(t)??Pn(),function:"?",in_app:!0}),e}function ju(e){De&&E.log(`Global Handler attached: ${e}`)}function Up(){return Y()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function U0(e){if(!(!dt(e)||e.length===0))return e.startsWith("data:")?`<${At(e,!1)}>`:e}var H0=()=>({name:"HttpContext",preprocessEvent(e){if(!H.navigator&&!H.location&&!H.document)return;const t=Ui(),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=Ui();ep(e,{"url.full":t.url||void 0,"http.request.header.user_agent":t.headers["User-Agent"],"http.request.header.referer":t.headers.Referer})}}),j0="cause",B0=5,W0="LinkedErrors",z0=((e={})=>{const t=e.limit||B0,r=e.key||j0;return{name:W0,preprocessEvent(n,i,s){const o=s.getOptions();Nm(ka,o.stackParser,r,t,n,i)}}}),G0=z0;function V0(){return Y0()?(De&&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 Y0(){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 X0(e){return[xm(),Em(),Gm(),E0(),d0(),N0(),G0(),Um(),H0(),A0(),R0()]}function K0(e={}){const t=!e.skipBrowserExtensionCheck&&V0();let r=e.defaultIntegrations==null?X0():e.defaultIntegrations;const n={...e,enabled:t?!1:e.enabled,stackParser:_g(e.stackParser||c0),integrations:Uv({integrations:e.integrations,defaultIntegrations:r}),transport:e.transport||Yb};return fm(by,n)}function J0(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function Hp(e){try{return new URL(e,H.location.origin).href}catch{return}}function Z0(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function jp(e){try{return new Headers(e)}catch{return}}var Bu=new WeakMap,Us=new Map,Bp={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function Q0(e,t){const{traceFetch:r,traceXHR:n,trackFetchStreamPerformance:i,shouldCreateSpanForRequest:s,enableHTTPTimings:o,tracePropagationTargets:a,onRequestSpanStart:c,onRequestSpanEnd:u}={...Bp,...t},l=typeof s=="function"?s:h=>!0,d=h=>tS(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=Us.get(g.span_id);m&&(g.timestamp=m/1e3,Us.delete(g.span_id))}}),h)),i&&ny(h=>{if(h.response){const g=Bu.get(h.response);g&&h.endTimestamp&&Us.set(g,h.endTimestamp)}}),Sp(h=>{const g=Vm(h,l,d,p,{propagateTraceparent:f,onRequestSpanEnd:u});if(h.response&&h.fetchData.__span&&Bu.set(h.response,h.fetchData.__span),g){const m=Hp(h.fetchData.url),w=m?Xt(m).host:void 0;g.setAttributes({"http.url":m?At(m):void 0,"server.address":w}),o&&Wu(g,e),c?.(g,{headers:h.headers})}})),n&&Dp(h=>{const g=rS(h,l,d,p,f,u);g&&(o&&Wu(g,e),c?.(g,{headers:jp(h.xhr.__sentry_xhr_v3__?.request_headers)}))})}var eS=300;function Wu(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,eS)}}const i=In("resource",({entries:s})=>{s.forEach(o=>{Z0(o)&&o.name.endsWith(r)&&(e.setAttributes(Lp(o)),n())})})}function tS(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 rS(e,t,r,n,i,s){const o=e.xhr,a=o?.[Sr];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&&(wd(P,a.status_code),P.end(),s?.(P,{headers:jp(Gb(o)),error:e.error})),delete n[w]);return}const d=Hp(c),p=Xt(d||c),f=At(mv(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)&&nS(o,Xe()&&g?m:void 0,i),h&&h.emit("beforeOutgoingRequestSpan",m,e),m}function nS(e,t,r){const{"sentry-trace":n,baggage:i,traceparent:s}=_p({span:t,propagateTraceparent:r});n&&iS(e,n,i,s)}function iS(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||!J0(s))&&e.setRequestHeader("baggage",r)}}catch{}}function sS(){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);De&&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()}}):De&&E.warn("[Tracing] Could not set up background tab detection due to lack of global document")}var Wp="sentry_previous_trace",oS="sentry.previous_trace";function aS(e,{linkPreviousTrace:t,consistentTraceSampling:r}){const n=t==="session-storage";let i=n?lS():void 0;e.on("spanStart",o=>{if(Ee(o)!==o)return;const a=te().getPropagationContext();i=cS(i,o,a),n&&uS(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(ta(i.spanContext))},sampleRand:i.sampleRand}),o.parentSampled=ta(i.spanContext),o.parentSampleRate=i.sampleRate,o.spanAttributes={...o.spanAttributes,[Xg]:i.sampleRate}})}function cS(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&&(De&&E.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:n.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[Kg]:"previous_trace"}}),t.setAttribute(oS,`${o.traceId}-${o.spanId}-${ta(o)?1:0}`)),s)}function uS(e){try{H.sessionStorage.setItem(Wp,JSON.stringify(e))}catch(t){De&&E.warn("Could not store previous trace in sessionStorage",t)}}function lS(){try{const e=H.sessionStorage?.getItem(Wp);return JSON.parse(e)}catch{return}}function ta(e){return e.traceFlags===1}var dS="BrowserTracing",pS=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function hS(){const e=H.navigator;return e?.userAgent?pS.test(e.userAgent):!1}var fS={...li,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...Bp},kS=((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}={...fS,...e},N=hS();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=Kd(Q,{idleTimeout:l,finalTimeout:d,childSpanTimeout:p,disableAutoFinish:W,beforeSpanEnd:Ke=>{q?.();const Te=mt(M);db(Ke,{recordClsOnPageloadSpan:!Te&&!a,recordLcpOnPageloadSpan:!Te&&!c,ignoreResourceSpans:A,ignorePerformanceApiSpans:$,spanStreamingEnabled:Te}),Vu(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),Vu(M,fe);function Ne(){r&&["interactive","complete"].includes(r.readyState)&&M.emit("idleSpanEnableAutoFinish",fe)}W&&!C&&r&&(r.addEventListener("readystatechange",()=>{Ne()}),Ne())}return{name:dS,setup(M){if(N){De&&E.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}S_();const z=mt(M);if(q=ib({recordClsStandaloneSpans:z?void 0:a||!1,recordLcpStandaloneSpans:z?void 0:c||!1,client:M}),z?(Rb(M),Cb(M),n&&Ob()):n&&wb(),s&&V.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?ob():i&&sb(),o&&ab(),v&&r){const W=()=>{Z=_e()};addEventListener("click",W,{capture:!0}),addEventListener("keydown",W,{capture:!0,passive:!0})}function X(){const W=kn(M);W&&!K(W).timestamp&&(De&&E.log(`[Tracing] Finishing current active span with op: ${K(W).op}`),W.setAttribute(Li,"cancelled"),W.end())}M.on("startNavigationSpan",(W,re)=>{if(Y()!==M)return;if(re?.isRedirect){De&&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||zu("sentry-trace")||Gu("sentry-trace"),he=re.baggage||zu("baggage")||Gu("baggage"),fe=f_(Q,he),Ne=te();Ne.setPropagationContext(fe),Xe()||(Ne.getPropagationContext().propagationSpanId=pt()),Ne.setSDKProcessingMetadata({normalizedRequest:Ui()}),ue(M,{op:"pageload",...W})}),M.on("endPageloadSpan",()=>{C&&J&&(J.setAttribute(Li,"reportPageLoaded"),J.end())})},afterAllSetup(M){if(N)return;let z=Pn();if(b!=="off"&&aS(M,{linkPreviousTrace:b,consistentTraceSampling:T}),H.location){if(y){const X=we();gS(M,{name:H.location.pathname,startTime:X?X/1e3:void 0,attributes:{[Rt]:"url",[ve]:"auto.pageload.browser"}})}R&&Ma(({to:X,from:W})=>{if(W===void 0&&z?.indexOf(X)!==-1){z=void 0;return}z=void 0;const re=Qd(X),Q=kn(M),he=Q&&v&&mS(Q,Z);_S(M,{name:re?.pathname||H.location.pathname,attributes:{[Rt]:"url",[ve]:"auto.navigation.browser"}},{url:X,isRedirect:he})})}f&&sS(),o&&vS(M,l,d,p,t),n&&kb(),Q0(M,{traceFetch:h,traceXHR:g,trackFetchStreamPerformance:m,tracePropagationTargets:M.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:w,enableHTTPTimings:P,onRequestSpanStart:L,onRequestSpanEnd:D})}}});function gS(e,t,r){e.emit("startPageLoadSpan",t,r),te().setTransactionName(t.name);const n=kn(e);return n&&e.emit("afterStartPageLoadSpan",n),n}function _S(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:{...Ui(),url:n}}),kn(e)}function zu(e){return H.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function Gu(e){return H.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(t=>t.name===e)?.description}function vS(e,t,r,n,i){const s=H.document;let o;const a=()=>{const c="ui.action.click",u=kn(e);if(u){const l=K(u).op;if(["navigation","pageload"].includes(l)){De&&E.warn(`[Tracing] Did not create ${c} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(Li,"interactionInterrupted"),o.end(),o=void 0),!i.name){De&&E.warn(`[Tracing] Did not create ${c} transaction because _latestRouteName is missing.`);return}o=Kd({name:i.name,op:c,attributes:{[Rt]:i.source||"url"}},{idleTimeout:t,finalTimeout:r,childSpanTimeout:n})};s&&addEventListener("click",a,{capture:!0})}var zp="_sentry_idleSpan";function kn(e){return e[zp]}function Vu(e,t){$e(e,zp,t)}var Yu=1.5;function mS(e,t){const r=K(e),n=rr();return!(n-r.start_timestamp>Yu||t&&n-t<=Yu)}var yS=Jp(Zp());function RS(e){const t={...e};return gp(t,"react"),$v("react",{version:yS.version}),K0(t)}export{xS as a,IS as c,Ov as i,TS as l,kS as n,ES as o,Qt as r,cg as s,RS as t,wS as u};