lightly-studio 0.3.4__py3-none-any.whl → 0.4.0__py3-none-any.whl
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.
Potentially problematic release.
This version of lightly-studio might be problematic. Click here for more details.
- lightly_studio/api/features.py +3 -5
- lightly_studio/api/routes/api/dataset_tag.py +10 -0
- lightly_studio/api/routes/api/embeddings2d.py +8 -37
- lightly_studio/core/dataset.py +89 -2
- lightly_studio/core/dataset_query/__init__.py +14 -0
- lightly_studio/core/sample.py +33 -1
- lightly_studio/db_manager.py +4 -2
- lightly_studio/dist_lightly_studio_view_app/_app/env.js +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/0.CN4hnTks.css +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/{Samples.CIbricz7.css → Samples.C0_eo9eP.css} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/_layout.kFFGI0zL.css +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/{transform.2jKMtOWG.css → transform.sLzR40om.css} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{qIv1kPyv.js → BOmrKuMn.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{B7302SU7.js → BPpOWbDa.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BaFFwDFr.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{CZGpyrcA.js → BiGQqqJP.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{D_JuJOO3.js → BrNKoXwc.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BsaJCCG_.js +96 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{sLqs1uaK.js → BtXGzlpP.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{Frwd2CjB.js → C3xJX0nD.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{H4l0JFh9.js → CANX9QXL.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CAPx0Bfm.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CP9M7pei.js +39 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CWuDkrMZ.js +436 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/ChlxSwqI.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{DzBTnFhV.js → Cj4nZbtb.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{Bqz7dyEC.js → ClzkJBWk.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CpbA3HU7.js +2 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{DQ8aZ1o-.js → D8ZGoCPm.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DMJzr1NB.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{CSCQddQS.js → DNJnBfHs.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{DSxvnAMh.js → DUtlYNuP.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DVxjPOJB.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DmGM9V9Q.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DoEId1MK.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DthpwYR_.js +2 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DyIcJj6J.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/SiegjVo0.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/{Dj4O-5se.js → WEyXQRi6.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/gBp1tBnA.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/xQhUoIl9.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/app.Y-sSoz5q.js +2 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/start.CvxVp0Cu.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/0.0Fm6E-5B.js +4 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{1.Cdy-7S5q.js → 1.DB-0vkHb.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/10.vaUePh5k.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/11.7i7ljNVT.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{12.DcO8wIAc.js → 13.9qy3WtZv.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{2.BIldfkxL.js → 2.Drwwdm7A.js} +95 -94
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{3.BC9z_TWM.js → 3.D3X_-Wan.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{4.D8X_Ch5n.js → 4.C9TqY3tA.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/5.iRw6HCWX.js +39 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{6.DRA5Ru_2.js → 6.fqfYR7dB.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{7.WVBsruHQ.js → 7.C7gMM-gk.js} +1 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/8.C4v1w-oS.js +20 -0
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/9.DbHcSiMn.js +1 -0
- lightly_studio/dist_lightly_studio_view_app/_app/version.json +1 -1
- lightly_studio/dist_lightly_studio_view_app/index.html +14 -14
- lightly_studio/models/caption.py +1 -0
- lightly_studio/models/sample.py +7 -0
- lightly_studio/models/settings.py +5 -0
- lightly_studio/resolvers/dataset_resolver.py +2 -4
- lightly_studio/resolvers/sample_resolver.py +1 -0
- lightly_studio/resolvers/settings_resolver.py +3 -0
- lightly_studio/resolvers/twodim_embedding_resolver.py +29 -0
- lightly_studio/selection/__init__.py +1 -0
- lightly_studio/selection/mundig.py +41 -0
- lightly_studio-0.4.0.dist-info/METADATA +78 -0
- {lightly_studio-0.3.4.dist-info → lightly_studio-0.4.0.dist-info}/RECORD +71 -69
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/0.B3oFNb6O.css +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/assets/_layout.7Ma7YdVg.css +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/-DXuGN29.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/BeWf8-vJ.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CfQ4mGwl.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/CiaNZCBa.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Cqo0Vpvt.js +0 -417
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Cy4fgWTG.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D5w4xp5l.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DD63uD-T.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/D_ynJAfY.js +0 -2
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Dafy4oEQ.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DmjAI-UV.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Dug7Bq1S.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/Dv5BSBQG.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/DzX_yyqb.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/H60ATh8g.js +0 -2
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/chunks/u-it74zV.js +0 -96
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/app.BPc0HQPq.js +0 -2
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/entry/start.SNvc2nrm.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/0.5jT7P06o.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/10.C_uoESTX.js +0 -1
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/5.CAXhxJu6.js +0 -39
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/8.BuKUrCEN.js +0 -20
- lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/9.CUIn1yCR.js +0 -1
- lightly_studio/selection/README.md +0 -6
- lightly_studio-0.3.4.dist-info/METADATA +0 -879
- /lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{11.CWG1ehzT.js → 12.CWG1ehzT.js} +0 -0
- {lightly_studio-0.3.4.dist-info → lightly_studio-0.4.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var hn=s=>{throw TypeError(s)};var fn=(s,e,t)=>e.has(s)||hn("Cannot "+t);var P=(s,e,t)=>(fn(s,e,"read from private field"),t?t.call(s):e.get(s)),Le=(s,e,t)=>e.has(s)?hn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(s):e.set(s,t),me=(s,e,t,i)=>(fn(s,e,"write to private field"),i?i.call(s,t):e.set(s,t),t);var gs=(s,e,t,i)=>({set _(r){me(s,e,r,t)},get _(){return P(s,e,i)}});import{u as il}from"../chunks/BOmrKuMn.js";import"../chunks/CWj6FrbW.js";import{b as Ta,i as sl,o as Ws,d as rl}from"../chunks/D8ZGoCPm.js";import{z as nl,L as al,b9 as ol,p as fi,ba as wt,Z as R,X as Ei,g as d,k as ut,bb as Oa,f as B,h as Tt,a as gi,t as Qe,m as ll,c as ct,r as Ye,bc as cl,aO as gn,aP as ul,al as ke,ab as Ca,u as Ut,b as Q,s as li,n as St}from"../chunks/C3xJX0nD.js";import{c as j,a as E,f as $e,t as vn,d as ds}from"../chunks/CAPx0Bfm.js";import{s as dt}from"../chunks/DoEId1MK.js";import{e as Ts,i as dl,c as re,L as hl,d as fl,k as gl,f as pn,M as vl,h as _n,j as Rt,b as Mt,l as Ne,g as pl,m as Ft,s as nr,n as _l,a as ml,S as yl,u as bl}from"../chunks/DthpwYR_.js";import{a as wl,b as xl}from"../chunks/gBp1tBnA.js";import{n as Fa,p as kr,s as Sr,i as El}from"../chunks/WEyXQRi6.js";import"../chunks/69_IOA4Y.js";import{b as kl,c as Sl,s as vs}from"../chunks/CpbA3HU7.js";import{s as Aa,i as K,a as Ra}from"../chunks/DmGM9V9Q.js";import{i as Zr}from"../chunks/Cj4nZbtb.js";import{p as ne,b as Ma,c as ri,s as ar,r as Pl}from"../chunks/xQhUoIl9.js";import{p as Pr}from"../chunks/BPpOWbDa.js";import{o as Os,e as Il,d as Tl}from"../chunks/SiegjVo0.js";import{d as Ol}from"../chunks/BaFFwDFr.js";import{S as Da,o as La,Q as Cl,e as nt,q as mn,u as yn,n as Dt,f as Fl,v as bn,a as wn,w as Al,x as xn,y as En,z as Rl,A as Ml}from"../chunks/CANX9QXL.js";const Dl=!0;function Na(s,e,t,i,r){var o;nl&&al();var n=(o=e.$$slots)==null?void 0:o[t],a=!1;n===!0&&(n=e.children,a=!0),n===void 0||n(s,a?()=>i:i)}const Ll=Dl,Nl=ol;function Bl(s,e){return s.protocol!==e.protocol?e.href:e.password||e.username?"//"+[e.username,e.password].filter(Boolean).join(":")+"@"+e.host+e.pathname+e.search+e.hash:s.host!==e.host?"//"+e.host+e.pathname+e.search+e.hash:e.pathname+e.search+e.hash}function jl(s,e,t){const i=new URL(t,e).pathname;return s.origin!==e.origin||!s.pathname.startsWith(i)}var ql=$e('<link rel="alternate"/>');function Hl(s,e){fi(e,!1);const t=()=>Aa(Pr,"$page",i),[i,r]=Ra(),n=Ei(),a=Ei(),o=Ei(),l=Fa(Ta,new URL(t().url))||"/";let c=ne(e,"availableLanguageTags",8),u=ne(e,"strategy",8),h=ne(e,"currentLang",8);const v=(m,b)=>{const I=[];for(const M of c()){const D=b.getLocalisedPath(m,M),U=Sr(D,l,void 0),C=new URL(U,new URL(t().url)).href;I.push(C)}return I};wt(()=>t(),()=>{R(n,kr(t().url.pathname,l)[0])}),wt(()=>(ut(u()),d(n),ut(h())),()=>{R(a,u().getCanonicalPath(d(n),h()))}),wt(()=>(d(a),ut(u())),()=>{R(o,v(d(a),u()))}),Oa(),Zr();var g=j(),p=B(g);{var _=m=>{var b=j(),I=B(b);Ts(I,1,()=>d(o),dl,(M,D,U)=>{var C=ql();Qe(()=>{re(C,"hreflang",(ut(c()),Tt(()=>c()[U]))),re(C,"href",d(D))}),E(M,C)}),E(m,b)};K(p,m=>{ut(c()),Tt(()=>c().length>=1)&&m(_)})}E(s,g),gi(),r()}const Ul=(s,e)=>`${hl}=${s};Path=${e};SameSite=lax;Max-Age=31557600`;function Gl(s,e){fi(e,!1);const t=()=>Aa(Pr,"$page",i),[i,r]=Ra(),n=Ei(),a=Ei(),o=Fa(Ta,new URL(t().url))||"/";let l=ne(e,"languageTag",24,()=>{}),c=ne(e,"i18n",8),u=Ei(0);function h(p,_){try{const m=new URL(ll(Pr).url),[b,I]=kr(m.pathname,o),M=c().strategy.getCanonicalPath(b,d(n)),D=new URL(m);D.pathname=Sr(M,o,I);const U=new URL(p,new URL(D));if(jl(U,m,o)||c().config.exclude(U.pathname))return p;const C=_??d(n),[ae,q]=kr(U.pathname,o),ve=c().strategy.getLocalisedPath(ae,C),ie=new URL(U);return ie.pathname=Sr(ve,o,q),Bl(m,ie)}catch{return p}}fl({translateHref:h}),wt(()=>(ut(l()),ut(c()),t()),()=>{R(n,l()??c().getLanguageFromUrl(t().url))}),wt(()=>(ut(c()),d(n)),()=>{c().config.runtime.setLanguageTag(d(n))}),wt(()=>d(n),()=>{document.documentElement.lang=d(n)}),wt(()=>(ut(c()),d(n)),()=>{document.documentElement.dir=c().config.textDirection[d(n)]??"ltr"}),wt(()=>(d(n),d(u)),()=>{d(n)&&R(u,d(u)+1)}),wt(()=>(d(n),d(u),pn),()=>{d(n)&&(d(u)>1||Nl)&&sl(pn)}),wt(()=>d(n),()=>{R(a,d(n))}),wt(()=>d(n),()=>{document.cookie=Ul(d(n),o)}),Oa(),Zr();var v=j();kl(p=>{var _=j(),m=B(_);{var b=I=>{Hl(I,{get availableLanguageTags(){return ut(c()),Tt(()=>c().config.runtime.availableLanguageTags)},get strategy(){return ut(c()),Tt(()=>c().strategy)},get currentLang(){return d(n)}})};K(m,I=>{ut(c()),t(),Tt(()=>c().config.seo.noAlternateLinks!==!0&&!c().config.exclude(t().url.pathname))&&I(b)})}E(p,_)});var g=B(v);gl(g,()=>d(a),p=>{var _=j(),m=B(_);Na(m,e,"default",{}),E(p,_)}),E(s,v),gi(),r()}const Vl=il(),Wl=async()=>({globalStorage:Vl}),_h=Object.freeze(Object.defineProperty({__proto__:null,load:Wl},Symbol.toStringTag,{value:"Module"}));var f=typeof window<"u"?window:void 0,Je=typeof globalThis<"u"?globalThis:f,Ba=Array.prototype,kn=Ba.forEach,Sn=Ba.indexOf,at=Je==null?void 0:Je.navigator,x=Je==null?void 0:Je.document,Xe=Je==null?void 0:Je.location,Ir=Je==null?void 0:Je.fetch,Tr=Je!=null&&Je.XMLHttpRequest&&"withCredentials"in new Je.XMLHttpRequest?Je.XMLHttpRequest:void 0,Pn=Je==null?void 0:Je.AbortController,Ke=at==null?void 0:at.userAgent,L=f??{},Lt={DEBUG:!1,LIB_VERSION:"1.276.0"};function In(s,e,t,i,r,n,a){try{var o=s[n](a),l=o.value}catch(c){return void t(c)}o.done?e(l):Promise.resolve(l).then(i,r)}function Tn(s){return function(){var e=this,t=arguments;return new Promise(function(i,r){var n=s.apply(e,t);function a(l){In(n,i,r,a,o,"next",l)}function o(l){In(n,i,r,a,o,"throw",l)}a(void 0)})}}function S(){return S=Object.assign?Object.assign.bind():function(s){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(s[i]=t[i])}return s},S.apply(null,arguments)}function ja(s,e){if(s==null)return{};var t={};for(var i in s)if({}.hasOwnProperty.call(s,i)){if(e.indexOf(i)!==-1)continue;t[i]=s[i]}return t}var zl=["$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 Y(s,e){return s.indexOf(e)!==-1}var zs=function(s){return s.trim()},Or=function(s){return s.replace(/^\$/,"")},Ql=Array.isArray,qa=Object.prototype,Ha=qa.hasOwnProperty,Qs=qa.toString,le=Ql||function(s){return Qs.call(s)==="[object Array]"},Zt=s=>typeof s=="function",Ue=s=>s===Object(s)&&!le(s),wi=s=>{if(Ue(s)){for(var e in s)if(Ha.call(s,e))return!1;return!0}return!1},y=s=>s===void 0,Se=s=>Qs.call(s)=="[object String]",Cr=s=>Se(s)&&s.trim().length===0,Gt=s=>s===null,ue=s=>y(s)||Gt(s),Ct=s=>Qs.call(s)=="[object Number]",$t=s=>Qs.call(s)==="[object Boolean]",Yl=s=>s instanceof FormData,Kl=s=>Y(zl,s);function Fr(s){return s===null||typeof s!="object"}function Cs(s,e){return Object.prototype.toString.call(s)==="[object "+e+"]"}function Ua(s){return!y(Event)&&function(e,t){try{return e instanceof t}catch{return!1}}(s,Event)}var Xl=[!0,"true",1,"1","yes"],or=s=>Y(Xl,s),Jl=[!1,"false",0,"0","no"];function Pt(s,e,t,i,r){return e>t&&(i.warn("min cannot be greater than max."),e=t),Ct(s)?s>t?(i.warn(" cannot be greater than max: "+t+". Using max value instead."),t):s<e?(i.warn(" cannot be less than min: "+e+". Using min value instead."),e):s:(i.warn(" must be a number. using max or fallback. max: "+t+", fallback: "+r),Pt(r||t,e,t,i))}class Zl{constructor(e){this.t=e,this.i={},this.o=()=>{Object.keys(this.i).forEach(t=>{var i=this.h(t)+this.m;i>=this.S?delete this.i[t]:this.$(t,i)})},this.h=t=>this.i[String(t)],this.$=(t,i)=>{this.i[String(t)]=i},this.consumeRateLimit=t=>{var i,r,n=(i=this.h(t))!==null&&i!==void 0?i:this.S;if((n=Math.max(n-1,0))===0)return!0;this.$(t,n);var a=n===0;return a&&((r=this.k)==null||r.call(this,t)),a},this.k=this.t.k,this.S=Pt(this.t.bucketSize,0,100,this.t.P),this.m=Pt(this.t.refillRate,0,this.S,this.t.P),this.T=Pt(this.t.refillInterval,0,864e5,this.t.P),this.I=setInterval(()=>{this.o()},this.T)}stop(){this.I&&(clearInterval(this.I),this.I=void 0)}}var ps,On,lr,$l=s=>s instanceof Error;function ec(s){var e=globalThis._posthogChunkIds;if(e){var t=Object.keys(e);return lr&&t.length===On||(On=t.length,lr=t.reduce((i,r)=>{ps||(ps={});var n=ps[r];if(n)i[n[0]]=n[1];else for(var a=s(r),o=a.length-1;o>=0;o--){var l=a[o],c=l==null?void 0:l.filename,u=e[r];if(c&&u){i[c]=u,ps[r]=[c,u];break}}return i},{})),lr}}var Fi="?";function Ar(s,e,t,i){var r={platform:"web:javascript",filename:s,function:e==="<anonymous>"?Fi:e,in_app:!0};return y(t)||(r.lineno=t),y(i)||(r.colno=i),r}var Ga=(s,e)=>{var t=s.indexOf("safari-extension")!==-1,i=s.indexOf("safari-web-extension")!==-1;return t||i?[s.indexOf("@")!==-1?s.split("@")[0]:Fi,t?"safari-extension:"+e:"safari-web-extension:"+e]:[s,e]},tc=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,ic=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,sc=/\((\S*)(?::(\d+))(?::(\d+))\)/,rc=s=>{var e=tc.exec(s);if(e){var[,t,i,r]=e;return Ar(t,Fi,+i,+r)}var n=ic.exec(s);if(n){if(n[2]&&n[2].indexOf("eval")===0){var a=sc.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}var[o,l]=Ga(n[1]||Fi,n[2]);return Ar(l,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},nc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,ac=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,oc=s=>{var e=nc.exec(s);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){var t=ac.exec(e[3]);t&&(e[1]=e[1]||"eval",e[3]=t[1],e[4]=t[2],e[5]="")}var i=e[3],r=e[1]||Fi;return[r,i]=Ga(r,i),Ar(i,r,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},Cn=/\(error: (.*)\)/,Fn=50;function lc(){for(var s=arguments.length,e=new Array(s),t=0;t<s;t++)e[t]=arguments[t];return function(i,r){r===void 0&&(r=0);for(var n=[],a=i.split(`
|
|
2
|
+
`),o=r;o<a.length;o++){var l=a[o];if(!(l.length>1024)){var c=Cn.test(l)?l.replace(Cn,"$1"):l;if(!c.match(/\S*Error: /)){for(var u of e){var h=u(c);if(h){n.push(h);break}}if(n.length>=Fn)break}}}return function(v){if(!v.length)return[];var g=Array.from(v);return g.reverse(),g.slice(0,Fn).map(p=>{return S({},p,{filename:p.filename||(_=g,_[_.length-1]||{}).filename,function:p.function||Fi});var _})}(n)}}class cc{constructor(e,t,i){e===void 0&&(e=[]),t===void 0&&(t=[]),i===void 0&&(i=[]),this.coercers=e,this.modifiers=i,this.stackParser=lc(...t)}buildFromUnknown(e,t){t===void 0&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(i,t,0).apply(e),n=this.buildParsingContext(),a=this.parseStacktrace(r,n);return{$exception_list:this.convertToExceptionList(a,i),$exception_level:"error"}}modifyFrames(e){var t=this;return Tn(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&le(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.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 i,r;return e.cause!=null&&(i=this.parseStacktrace(e.cause,t)),e.stack!=""&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?1:0),t.chunkIdMap)),S({},e,{cause:i,stack:r})}applyChunkIds(e,t){return e.map(i=>(i.filename&&t&&(i.chunk_id=t[i.filename]),i))}applyCoercers(e,t){for(var i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return Tn(function*(){var i=e;for(var r of t.modifiers)i=yield r(i);return i})()}convertToExceptionList(e,t){var i,r,n,a={type:e.type,value:e.value,mechanism:{type:(i=t.type)!==null&&i!==void 0?i:"generic",handled:(r=t.handled)===null||r===void 0||r,synthetic:(n=e.synthetic)!==null&&n!==void 0&&n}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var o=[a];return e.cause!=null&&o.push(...this.convertToExceptionList(e.cause,S({},t,{handled:!0}))),o}buildParsingContext(){return{chunkIdMap:ec(this.stackParser)}}buildCoercingContext(e,t,i){i===void 0&&(i=0);var r=(n,a)=>{if(a<=4){var o=this.buildCoercingContext(e,t,a);return this.applyCoercers(n,o)}};return S({},t,{syntheticException:i==0?t.syntheticException:void 0,mechanism:e,apply:n=>r(n,i),next:n=>r(n,i+1)})}}class uc{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=Se(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?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 Cs(e,"DOMException")}isDOMError(e){return Cs(e,"DOMError")}}class dc{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 i=e.message;return i.error&&typeof i.error.message=="string"?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}}class hc{constructor(){}match(e){return Cs(e,"ErrorEvent")&&e.error!=null}coerce(e,t){var i,r=t.apply(e.error);return r||{type:"ErrorEvent",value:e.message,stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}}var fc=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class gc{match(e){return typeof e=="string"}coerce(e,t){var i,[r,n]=this.getInfos(e);return{type:r??"Error",value:n??e,stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,r=e.match(fc);return r&&(t=r[1],i=r[2]),[t,i]}}var vc=["fatal","error","warning","log","info","debug"];function Va(s,e){e===void 0&&(e=40);var t=Object.keys(s);if(t.sort(),!t.length)return"[object has no keys]";for(var i=t.length;i>0;i--){var r=t.slice(0,i).join(", ");if(!(r.length>e))return i===t.length||r.length<=e?r:r.slice(0,e)+"..."}return""}class pc{match(e){return typeof e=="object"&&e!==null}coerce(e,t){var i,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:(i=t.syntheticException)==null?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Ua(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 i=this.getObjectClassName(e);return(i&&i!=="Object"?"'"+i+"'":"Object")+" captured as exception with keys: "+Va(e)}isSeverityLevel(e){return Se(e)&&!Cr(e)&&vc.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var i=e[t];if($l(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}}class _c{match(e){return Ua(e)}coerce(e,t){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+Va(e),stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}}class mc{match(e){return Fr(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}}class yc{match(e){return Cs(e,"PromiseRejectionEvent")}coerce(e,t){var i,r=this.getUnhandledRejectionReason(e);return Fr(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}:t.apply(r)}getUnhandledRejectionReason(e){if(Fr(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}}var Wa=s=>{var e={R:function(t){if(f&&(Lt.DEBUG||L.POSTHOG_DEBUG)&&!y(f.console)&&f.console){for(var i=("__rrweb_original__"in f.console[t])?f.console[t].__rrweb_original__:f.console[t],r=arguments.length,n=new Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];i(s,...n)}},info:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e.R("log",...i)},warn:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e.R("warn",...i)},error:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];e.R("error",...i)},critical:function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];console.error(s,...i)},uninitializedWarning:t=>{e.error("You must initialize PostHog before calling "+t)},createLogger:t=>Wa(s+" "+t)};return e},w=Wa("[PostHog.js]"),Fe=w.createLogger,bc=Fe("[ExternalScriptsLoader]"),An=(s,e,t)=>{if(s.config.disable_external_dependency_loading)return bc.warn(e+" was requested but loading of external scripts is disabled."),t("Loading of external scripts is disabled");var i=x==null?void 0:x.querySelectorAll("script");if(i){for(var r,n=function(){if(i[a].src===e){var l=i[a];return l.__posthog_loading_callback_fired?{v:t()}:(l.addEventListener("load",c=>{l.__posthog_loading_callback_fired=!0,t(void 0,c)}),l.onerror=c=>t(c),{v:void 0})}},a=0;a<i.length;a++)if(r=n())return r.v}var o=()=>{if(!x)return t("document not found");var l=x.createElement("script");if(l.type="text/javascript",l.crossOrigin="anonymous",l.src=e,l.onload=h=>{l.__posthog_loading_callback_fired=!0,t(void 0,h)},l.onerror=h=>t(h),s.config.prepare_external_dependency_script&&(l=s.config.prepare_external_dependency_script(l)),!l)return t("prepare_external_dependency_script returned null");var c,u=x.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):x.body.appendChild(l)};x!=null&&x.body?o():x==null||x.addEventListener("DOMContentLoaded",o)};L.__PosthogExtensions__=L.__PosthogExtensions__||{},L.__PosthogExtensions__.loadExternalDependency=(s,e,t)=>{var i="/static/"+e+".js?v="+s.version;if(e==="remote-config"&&(i="/array/"+s.config.token+"/config.js"),e==="toolbar"){var r=3e5;i=i+"&t="+Math.floor(Date.now()/r)*r}var n=s.requestRouter.endpointFor("assets",i);An(s,n,t)},L.__PosthogExtensions__.loadSiteApp=(s,e,t)=>{var i=s.requestRouter.endpointFor("api",e);An(s,i,t)};var Fs={};function ei(s,e,t){if(le(s)){if(kn&&s.forEach===kn)s.forEach(e,t);else if("length"in s&&s.length===+s.length){for(var i=0,r=s.length;i<r;i++)if(i in s&&e.call(t,s[i],i)===Fs)return}}}function oe(s,e,t){if(!ue(s)){if(le(s))return ei(s,e,t);if(Yl(s)){for(var i of s.entries())if(e.call(t,i[1],i[0])===Fs)return}else for(var r in s)if(Ha.call(s,r)&&e.call(t,s[r],r)===Fs)return}}var ye=function(s){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return ei(t,function(r){for(var n in r)r[n]!==void 0&&(s[n]=r[n])}),s},Di=function(s){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;i<e;i++)t[i-1]=arguments[i];return ei(t,function(r){ei(r,function(n){s.push(n)})}),s};function Ss(s){for(var e=Object.keys(s),t=e.length,i=new Array(t);t--;)i[t]=[e[t],s[e[t]]];return i}var Rn=function(s){try{return s()}catch{return}},wc=function(s){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];return s.apply(this,t)}catch(r){w.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),w.critical(r)}}},$r=function(s){var e={};return oe(s,function(t,i){(Se(t)&&t.length>0||Ct(t))&&(e[i]=t)}),e};function xc(s,e){return t=s,i=n=>Se(n)&&!Gt(e)?n.slice(0,e):n,r=new Set,function n(a,o){return a!==Object(a)?i?i(a,o):a:r.has(a)?void 0:(r.add(a),le(a)?(l=[],ei(a,c=>{l.push(n(c))})):(l={},oe(a,(c,u)=>{r.has(c)||(l[u]=n(c,u))})),l);var l}(t);var t,i,r}var Ec=["herokuapp.com","vercel.app","netlify.app"];function kc(s){var e=s==null?void 0:s.hostname;if(!Se(e))return!1;var t=e.split(".").slice(-2).join(".");for(var i of Ec)if(t===i)return!1;return!0}function za(s,e){for(var t=0;t<s.length;t++)if(e(s[t]))return s[t]}function Pe(s,e,t,i){var{capture:r=!1,passive:n=!0}=i??{};s==null||s.addEventListener(e,t,{capture:r,passive:n})}var Qa="$people_distinct_id",Yi="__alias",Ki="__timers",Mn="$autocapture_disabled_server_side",Rr="$heatmaps_enabled_server_side",Dn="$exception_capture_enabled_server_side",Mr="$error_tracking_suppression_rules",Ln="$error_tracking_capture_extension_exceptions",Nn="$web_vitals_enabled_server_side",Ya="$dead_clicks_enabled_server_side",Bn="$web_vitals_allowed_metrics",cr="$session_recording_remote_config",As="$sesid",Ka="$session_is_sampled",xi="$enabled_feature_flags",Xi="$early_access_features",Dr="$feature_flag_details",Ji="$stored_person_properties",ci="$stored_group_properties",Lr="$surveys",_s="$surveys_activated",Rs="$flag_call_reported",Nt="$user_state",Nr="$client_session_props",Br="$capture_rate_limit",jr="$initial_campaign_params",qr="$initial_referrer_info",Ms="$initial_person_info",Ds="$epp",Xa="__POSTHOG_TOOLBAR__",Hi="$posthog_cookieless",Sc=[Qa,Yi,"__cmpns",Ki,"$session_recording_enabled_server_side",Rr,As,xi,Mr,Nt,Xi,Dr,ci,Ji,Lr,Rs,Nr,Br,jr,qr,Ds,Ms];function jn(s){return s instanceof Element&&(s.id===Xa||!(s.closest==null||!s.closest(".toolbar-global-fade-container")))}function Ys(s){return!!s&&s.nodeType===1}function ti(s,e){return!!s&&!!s.tagName&&s.tagName.toLowerCase()===e.toLowerCase()}function Ja(s){return!!s&&s.nodeType===3}function Za(s){return!!s&&s.nodeType===11}function en(s){return s?zs(s).split(/\s+/):[]}function qn(s){var e=f==null?void 0:f.location.href;return!!(e&&s&&s.some(t=>e.match(t)))}function Ls(s){var e="";switch(typeof s.className){case"string":e=s.className;break;case"object":e=(s.className&&"baseVal"in s.className?s.className.baseVal:null)||s.getAttribute("class")||"";break;default:e=""}return en(e)}function $a(s){return ue(s)?null:zs(s).split(/(\s+)/).filter(e=>ss(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Ks(s){var e="";return Hr(s)&&!ro(s)&&s.childNodes&&s.childNodes.length&&oe(s.childNodes,function(t){var i;Ja(t)&&t.textContent&&(e+=(i=$a(t.textContent))!==null&&i!==void 0?i:"")}),zs(e)}function eo(s){return y(s.target)?s.srcElement||null:(e=s.target)!=null&&e.shadowRoot?s.composedPath()[0]||null:s.target||null;var e}var tn=["a","button","form","input","select","textarea","label"];function to(s,e){if(y(e))return!0;var t,i=function(n){if(e.some(a=>n.matches(a)))return{v:!0}};for(var r of s)if(t=i(r))return t.v;return!1}function io(s){var e=s.parentNode;return!(!e||!Ys(e))&&e}var Hn=[".ph-no-rageclick",".ph-no-capture"],sn=s=>!s||ti(s,"html")||!Ys(s),so=(s,e)=>{if(!f||sn(s))return{parentIsUsefulElement:!1,targetElementList:[]};for(var t=!1,i=[s],r=s;r.parentNode&&!ti(r,"body");)if(Za(r.parentNode))i.push(r.parentNode.host),r=r.parentNode.host;else{var n=io(r);if(!n)break;if(e||tn.indexOf(n.tagName.toLowerCase())>-1)t=!0;else{var a=f.getComputedStyle(n);a&&a.getPropertyValue("cursor")==="pointer"&&(t=!0)}i.push(n),r=n}return{parentIsUsefulElement:t,targetElementList:i}};function Pc(s,e,t,i,r){var n,a,o,l;if(t===void 0&&(t=void 0),!f||sn(s)||(n=t)!=null&&n.url_allowlist&&!qn(t.url_allowlist)||(a=t)!=null&&a.url_ignorelist&&qn(t.url_ignorelist))return!1;if((o=t)!=null&&o.dom_event_allowlist){var c=t.dom_event_allowlist;if(c&&!c.some(p=>e.type===p))return!1}var{parentIsUsefulElement:u,targetElementList:h}=so(s,i);if(!function(p,_){var m=_==null?void 0:_.element_allowlist;if(y(m))return!0;var b,I=function(D){if(m.some(U=>D.tagName.toLowerCase()===U))return{v:!0}};for(var M of p)if(b=I(M))return b.v;return!1}(h,t)||!to(h,(l=t)==null?void 0:l.css_selector_allowlist))return!1;var v=f.getComputedStyle(s);if(v&&v.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var g=s.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return u?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(tn.indexOf(g)>-1||s.getAttribute("contenteditable")==="true")}}function Hr(s){for(var e=s;e.parentNode&&!ti(e,"body");e=e.parentNode){var t=Ls(e);if(Y(t,"ph-sensitive")||Y(t,"ph-no-capture"))return!1}if(Y(Ls(s),"ph-include"))return!0;var i=s.type||"";if(Se(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=s.name||s.id||"";return!(Se(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function ro(s){return!!(ti(s,"input")&&!["button","checkbox","submit","reset"].includes(s.type)||ti(s,"select")||ti(s,"textarea")||s.getAttribute("contenteditable")==="true")}var no="(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})",Ic=new RegExp("^(?:"+no+")$"),Tc=new RegExp(no),ao="\\d{3}-?\\d{2}-?\\d{4}",Oc=new RegExp("^("+ao+")$"),Cc=new RegExp("("+ao+")");function ss(s,e){return e===void 0&&(e=!0),!(ue(s)||Se(s)&&(s=zs(s),(e?Ic:Tc).test((s||"").replace(/[- ]/g,""))||(e?Oc:Cc).test(s)))}function oo(s){var e=Ks(s);return ss(e=(e+" "+lo(s)).trim())?e:""}function lo(s){var e="";return s&&s.childNodes&&s.childNodes.length&&oe(s.childNodes,function(t){var i;if(t&&((i=t.tagName)==null?void 0:i.toLowerCase())==="span")try{var r=Ks(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+lo(t)).trim())}catch(n){w.error("[AutoCapture]",n)}}),e}function Fc(s){return function(e){var t=e.map(i=>{var r,n,a="";if(i.tag_name&&(a+=i.tag_name),i.attr_class)for(var o of(i.attr_class.sort(),i.attr_class))a+="."+o.replace(/"/g,"");var l=S({},i.text?{text:i.text}:{},{"nth-child":(r=i.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(n=i.nth_of_type)!==null&&n!==void 0?n:0},i.href?{href:i.href}:{},i.attr_id?{attr_id:i.attr_id}:{},i.attributes),c={};return Ss(l).sort((u,h)=>{var[v]=u,[g]=h;return v.localeCompare(g)}).forEach(u=>{var[h,v]=u;return c[Un(h.toString())]=Un(v.toString())}),a+=":",a+=Ss(c).map(u=>{var[h,v]=u;return h+'="'+v+'"'}).join("")});return t.join(";")}(function(e){return e.map(t=>{var i,r,n={text:(i=t.$el_text)==null?void 0:i.slice(0,400),tag_name:t.tag_name,href:(r=t.attr__href)==null?void 0:r.slice(0,2048),attr_class:Ac(t),attr_id:t.attr__id,nth_child:t.nth_child,nth_of_type:t.nth_of_type,attributes:{}};return Ss(t).filter(a=>{var[o]=a;return o.indexOf("attr__")===0}).forEach(a=>{var[o,l]=a;return n.attributes[o]=l}),n})}(s))}function Un(s){return s.replace(/"|\\"/g,'\\"')}function Ac(s){var e=s.attr__class;return e?le(e)?e:en(e):void 0}class co{constructor(){this.clicks=[]}isRageClick(e,t,i){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&i-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===3)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var ur="$copy_autocapture",Ht=function(s){return s.GZipJS="gzip-js",s.Base64="base64",s}({}),Ns=s=>{var e=x==null?void 0:x.createElement("a");return y(e)?null:(e.href=s,e)},Rc=function(s,e){var t,i;e===void 0&&(e="&");var r=[];return oe(s,function(n,a){y(n)||y(a)||a==="undefined"||(t=encodeURIComponent((o=>o instanceof File)(n)?n.name:n.toString()),i=encodeURIComponent(a),r[r.length]=i+"="+t)}),r.join(e)},Bs=function(s,e){for(var t,i=((s.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<i.length;r++){var n=i[r].split("=");if(n[0]===e){t=n;break}}if(!le(t)||t.length<2)return"";var a=t[1];try{a=decodeURIComponent(a)}catch{w.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},hs=function(s,e,t){if(!s||!e||!e.length)return s;for(var i=s.split("#"),r=i[0]||"",n=i[1],a=r.split("?"),o=a[1],l=a[0],c=(o||"").split("&"),u=[],h=0;h<c.length;h++){var v=c[h].split("=");le(v)&&(e.includes(v[0])?u.push(v[0]+"="+t):u.push(c[h]))}var g=l;return o!=null&&(g+="?"+u.join("&")),n!=null&&(g+="#"+n),g},js=function(s,e){var t=s.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Gn=Fe("[AutoCapture]");function dr(s,e){return e.length>s?e.slice(0,s)+"...":e}function Mc(s){if(s.previousElementSibling)return s.previousElementSibling;var e=s;do e=e.previousSibling;while(e&&!Ys(e));return e}function Dc(s,e,t,i){var r=s.tagName.toLowerCase(),n={tag_name:r};tn.indexOf(r)>-1&&!t&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?n.$el_text=dr(1024,oo(s)):n.$el_text=dr(1024,Ks(s)));var a=Ls(s);a.length>0&&(n.classes=a.filter(function(u){return u!==""})),oe(s.attributes,function(u){var h;if((!ro(s)||["name","id","class","aria-label"].indexOf(u.name)!==-1)&&(i==null||!i.includes(u.name))&&!e&&ss(u.value)&&(h=u.name,!Se(h)||h.substring(0,10)!=="_ngcontent"&&h.substring(0,7)!=="_nghost")){var v=u.value;u.name==="class"&&(v=en(v).join(" ")),n["attr__"+u.name]=dr(1024,v)}});for(var o=1,l=1,c=s;c=Mc(c);)o++,c.tagName===s.tagName&&l++;return n.nth_child=o,n.nth_of_type=l,n}function Lc(s,e){for(var t,i,{e:r,maskAllElementAttributes:n,maskAllText:a,elementAttributeIgnoreList:o,elementsChainAsString:l}=e,c=[s],u=s;u.parentNode&&!ti(u,"body");)Za(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var h,v=[],g={},p=!1,_=!1;if(oe(c,D=>{var U=Hr(D);D.tagName.toLowerCase()==="a"&&(p=D.getAttribute("href"),p=U&&p&&ss(p)&&p),Y(Ls(D),"ph-no-capture")&&(_=!0),v.push(Dc(D,n,a,o));var C=function(ae){if(!Hr(ae))return{};var q={};return oe(ae.attributes,function(ve){if(ve.name&&ve.name.indexOf("data-ph-capture-attribute")===0){var ie=ve.name.replace("data-ph-capture-attribute-",""),we=ve.value;ie&&we&&ss(we)&&(q[ie]=we)}}),q}(D);ye(g,C)}),_)return{props:{},explicitNoCapture:_};if(a||(s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?v[0].$el_text=oo(s):v[0].$el_text=Ks(s)),p){var m,b;v[0].attr__href=p;var I=(m=Ns(p))==null?void 0:m.host,M=f==null||(b=f.location)==null?void 0:b.host;I&&M&&I!==M&&(h=p)}return{props:ye({$event_type:r.type,$ce_version:1},l?{}:{$elements:v},{$elements_chain:Fc(v)},(t=v[0])!=null&&t.$el_text?{$el_text:(i=v[0])==null?void 0:i.$el_text}:{},h&&r.type==="click"?{$external_click_url:h}:{},g)}}class Nc{constructor(e){this.C=!1,this.O=null,this.rageclicks=new co,this.F=!1,this.instance=e,this.M=null}get A(){var e,t,i=Ue(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=(e=i.url_allowlist)==null?void 0:e.map(r=>new RegExp(r)),i.url_ignorelist=(t=i.url_ignorelist)==null?void 0:t.map(r=>new RegExp(r)),i}j(){if(this.isBrowserSupported()){if(f&&x){var e=i=>{i=i||(f==null?void 0:f.event);try{this.D(i)}catch(r){Gn.error("Failed to capture event",r)}};if(Pe(x,"submit",e,{capture:!0}),Pe(x,"change",e,{capture:!0}),Pe(x,"click",e,{capture:!0}),this.A.capture_copied_text){var t=i=>{i=i||(f==null?void 0:f.event),this.D(i,ur)};Pe(x,"copy",t,{capture:!0}),Pe(x,"cut",t,{capture:!0})}}}else Gn.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.C&&(this.j(),this.C=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.F=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Mn]:!!e.autocapture_opt_out}),this.O=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.M=e}getElementSelectors(e){var t,i=[];return(t=this.M)==null||t.forEach(r=>{var n=x==null?void 0:x.querySelectorAll(r);n==null||n.forEach(a=>{e===a&&i.push(r)})}),i}get isEnabled(){var e,t,i=(e=this.instance.persistence)==null?void 0:e.props[Mn],r=this.O;if(Gt(r)&&!$t(i)&&!this.instance.L())return!1;var n=(t=this.O)!==null&&t!==void 0?t:!!i;return!!this.instance.config.autocapture&&!n}D(e,t){if(t===void 0&&(t="$autocapture"),this.isEnabled){var i,r=eo(e);Ja(r)&&(r=r.parentNode||null),t==="$autocapture"&&e.type==="click"&&e instanceof MouseEvent&&this.instance.config.rageclick&&(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&function(v,g){if(!f||sn(v))return!1;var p,_;if((p=$t(g)?!!g&&Hn:(_=g==null?void 0:g.css_selector_ignorelist)!==null&&_!==void 0?_:Hn)===!1)return!1;var{targetElementList:m}=so(v,!1);return!to(m,p)}(r,this.instance.config.rageclick)&&this.D(e,"$rageclick");var n=t===ur;if(r&&Pc(r,e,this.A,n,n?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:o}=Lc(r,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.A.element_attribute_ignorelist,elementsChainAsString:this.F});if(o)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(a.$element_selectors=l),t===ur){var c,u=$a(f==null||(c=f.getSelection())==null?void 0:c.toString()),h=e.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=h}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return Zt(x==null?void 0:x.querySelectorAll)}}Math.trunc||(Math.trunc=function(s){return s<0?Math.ceil(s):Math.floor(s)}),Number.isInteger||(Number.isInteger=function(s){return Ct(s)&&isFinite(s)&&Math.floor(s)===s});var Vn="0123456789abcdef";class qs{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||e<0||t<0||i<0||r<0||e>0xffffffffffff||t>4095||i>1073741823||r>4294967295)throw new RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=e/Math.pow(2,40),n[1]=e/Math.pow(2,32),n[2]=e/Math.pow(2,24),n[3]=e/Math.pow(2,16),n[4]=e/Math.pow(2,8),n[5]=e,n[6]=112|t>>>8,n[7]=t,n[8]=128|i>>>24,n[9]=i>>>16,n[10]=i>>>8,n[11]=i,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new qs(n)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+Vn.charAt(this.bytes[t]>>>4)+Vn.charAt(15&this.bytes[t]),t!==3&&t!==5&&t!==7&&t!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new qs(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(i!==0)return Math.sign(i)}return 0}}class Bc{constructor(){this.N=0,this.U=0,this.H=new jc}generate(){var e=this.generateOrAbort();if(y(e)){this.N=0;var t=this.generateOrAbort();if(y(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.N)this.N=e,this.B();else{if(!(e+1e4>this.N))return;this.U++,this.U>4398046511103&&(this.N++,this.B())}return qs.fromFieldsV7(this.N,Math.trunc(this.U/Math.pow(2,30)),this.U&Math.pow(2,30)-1,this.H.nextUint32())}B(){this.U=1024*this.H.nextUint32()+(1023&this.H.nextUint32())}}var Wn,uo=s=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<s.length;e++)s[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return s};f&&!y(f.crypto)&&crypto.getRandomValues&&(uo=s=>crypto.getRandomValues(s));class jc{constructor(){this.q=new Uint32Array(8),this.W=1/0}nextUint32(){return this.W>=this.q.length&&(uo(this.q),this.W=0),this.q[this.W++]}}var Jt=()=>qc().toString(),qc=()=>(Wn||(Wn=new Bc)).generate(),Ui="",Hc=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Uc(s,e){if(e){var t=function(r,n){if(n===void 0&&(n=x),Ui)return Ui;if(!n||["localhost","127.0.0.1"].includes(r))return"";for(var a=r.split("."),o=Math.min(a.length,8),l="dmn_chk_"+Jt();!Ui&&o--;){var c=a.slice(o).join("."),u=l+"=1;domain=."+c+";path=/";n.cookie=u+";max-age=3",n.cookie.includes(l)&&(n.cookie=u+";max-age=0",Ui=c)}return Ui}(s);if(!t){var i=(r=>{var n=r.match(Hc);return n?n[0]:""})(s);i!==t&&w.info("Warning: cookie subdomain discovery mismatch",i,t),t=i}return t?"; domain=."+t:""}return""}var Ot={G:()=>!!x,V:function(s){w.error("cookieStore error: "+s)},J:function(s){if(x){try{for(var e=s+"=",t=x.cookie.split(";").filter(n=>n.length),i=0;i<t.length;i++){for(var r=t[i];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},K:function(s){var e;try{e=JSON.parse(Ot.J(s))||{}}catch{}return e},Y:function(s,e,t,i,r){if(x)try{var n="",a="",o=Uc(x.location.hostname,i);if(t){var l=new Date;l.setTime(l.getTime()+24*t*60*60*1e3),n="; expires="+l.toUTCString()}r&&(a="; secure");var c=s+"="+encodeURIComponent(JSON.stringify(e))+n+"; SameSite=Lax; path=/"+o+a;return c.length>3686.4&&w.warn("cookieStore warning: large cookie, len="+c.length),x.cookie=c,c}catch{return}},X:function(s,e){if(x!=null&&x.cookie)try{Ot.Y(s,"",-1,e)}catch{return}}},hr=null,he={G:function(){if(!Gt(hr))return hr;var s=!0;if(y(f))s=!1;else try{var e="__mplssupport__";he.Y(e,"xyz"),he.J(e)!=='"xyz"'&&(s=!1),he.X(e)}catch{s=!1}return s||w.error("localStorage unsupported; falling back to cookie store"),hr=s,s},V:function(s){w.error("localStorage error: "+s)},J:function(s){try{return f==null?void 0:f.localStorage.getItem(s)}catch(e){he.V(e)}return null},K:function(s){try{return JSON.parse(he.J(s))||{}}catch{}return null},Y:function(s,e){try{f==null||f.localStorage.setItem(s,JSON.stringify(e))}catch(t){he.V(t)}},X:function(s){try{f==null||f.localStorage.removeItem(s)}catch(e){he.V(e)}}},Gc=["distinct_id",As,Ka,Ds,Ms],ms=S({},he,{K:function(s){try{var e={};try{e=Ot.K(s)||{}}catch{}var t=ye(e,JSON.parse(he.J(s)||"{}"));return he.Y(s,t),t}catch{}return null},Y:function(s,e,t,i,r,n){try{he.Y(s,e,void 0,void 0,n);var a={};Gc.forEach(o=>{e[o]&&(a[o]=e[o])}),Object.keys(a).length&&Ot.Y(s,a,t,i,r,n)}catch(o){he.V(o)}},X:function(s,e){try{f==null||f.localStorage.removeItem(s),Ot.X(s,e)}catch(t){he.V(t)}}}),ys={},Vc={G:function(){return!0},V:function(s){w.error("memoryStorage error: "+s)},J:function(s){return ys[s]||null},K:function(s){return ys[s]||null},Y:function(s,e){ys[s]=e},X:function(s){delete ys[s]}},ni=null,Be={G:function(){if(!Gt(ni))return ni;if(ni=!0,y(f))ni=!1;else try{var s="__support__";Be.Y(s,"xyz"),Be.J(s)!=='"xyz"'&&(ni=!1),Be.X(s)}catch{ni=!1}return ni},V:function(s){w.error("sessionStorage error: ",s)},J:function(s){try{return f==null?void 0:f.sessionStorage.getItem(s)}catch(e){Be.V(e)}return null},K:function(s){try{return JSON.parse(Be.J(s))||null}catch{}return null},Y:function(s,e){try{f==null||f.sessionStorage.setItem(s,JSON.stringify(e))}catch(t){Be.V(t)}},X:function(s){try{f==null||f.sessionStorage.removeItem(s)}catch(e){Be.V(e)}}},Bt=function(s){return s[s.PENDING=-1]="PENDING",s[s.DENIED=0]="DENIED",s[s.GRANTED=1]="GRANTED",s}({});class Wc{constructor(e){this._instance=e}get A(){return this._instance.config}get consent(){return this.Z()?Bt.DENIED:this.tt}isOptedOut(){return this.A.cookieless_mode==="always"||this.consent===Bt.DENIED||this.consent===Bt.PENDING&&(this.A.opt_out_capturing_by_default||this.A.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===Bt.DENIED}optInOut(e){this.it.Y(this.et,e?1:0,this.A.cookie_expiration,this.A.cross_subdomain_cookie,this.A.secure_cookie)}reset(){this.it.X(this.et,this.A.cross_subdomain_cookie)}get et(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get tt(){var e=this.it.J(this.et);return or(e)?Bt.GRANTED:Y(Jl,e)?Bt.DENIED:Bt.PENDING}get it(){if(!this.rt){var e=this.A.opt_out_capturing_persistence_type;this.rt=e==="localStorage"?he:Ot;var t=e==="localStorage"?Ot:he;t.J(this.et)&&(this.rt.J(this.et)||this.optInOut(or(t.J(this.et))),t.X(this.et,this.A.cross_subdomain_cookie))}return this.rt}Z(){return!!this.A.respect_dnt&&!!za([at==null?void 0:at.doNotTrack,at==null?void 0:at.msDoNotTrack,L.doNotTrack],e=>or(e))}}var bs=Fe("[Dead Clicks]"),zc=()=>!0,Qc=s=>{var e,t=!((e=s.instance.persistence)==null||!e.get_property(Ya)),i=s.instance.config.capture_dead_clicks;return $t(i)?i:t};class ho{get lazyLoadedDeadClicksAutocapture(){return this.st}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[Ya]:e==null?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.nt(()=>{this.ot()})}nt(e){var t,i;(t=L.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(i=L.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",r=>{r?bs.error("failed to load script",r):e()})}ot(){var e;if(x){if(!this.st&&(e=L.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=Ue(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.st=L.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.st.start(x),bs.info("starting...")}}else bs.error("`document` not found. Cannot start.")}stop(){this.st&&(this.st.stop(),this.st=void 0,bs.info("stopping..."))}}var Gi=Fe("[ExceptionAutocapture]");class Yc{constructor(e){var t,i,r;this.lt=()=>{var n;if(f&&this.isEnabled&&(n=L.__PosthogExtensions__)!=null&&n.errorWrappingFunctions){var a=L.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,o=L.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=L.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ut&&this.A.capture_unhandled_errors&&(this.ut=a(this.captureException.bind(this))),!this.ht&&this.A.capture_unhandled_rejections&&(this.ht=o(this.captureException.bind(this))),!this.dt&&this.A.capture_console_errors&&(this.dt=l(this.captureException.bind(this)))}catch(c){Gi.error("failed to start",c),this.vt()}}},this._instance=e,this.ct=!((t=this._instance.persistence)==null||!t.props[Dn]),this.A=this.ft(),this.gt=new Zl({refillRate:(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&i!==void 0?i:1,bucketSize:(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&r!==void 0?r:10,refillInterval:1e4,P:Gi}),this.startIfEnabled()}ft(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Ue(e)?t=S({},t,e):(y(e)?this.ct:e)&&(t=S({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.A.capture_console_errors||this.A.capture_unhandled_errors||this.A.capture_unhandled_rejections}startIfEnabled(){this.isEnabled&&(Gi.info("enabled"),this.nt(this.lt))}nt(e){var t,i;(t=L.__PosthogExtensions__)!=null&&t.errorWrappingFunctions&&e(),(i=L.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"exception-autocapture",r=>{if(r)return Gi.error("failed to load script",r);e()})}vt(){var e,t,i;(e=this.ut)==null||e.call(this),this.ut=void 0,(t=this.ht)==null||t.call(this),this.ht=void 0,(i=this.dt)==null||i.call(this),this.dt=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.ct=!!t||!1,this.A=this.ft(),this._instance.persistence&&this._instance.persistence.register({[Dn]:this.ct}),this.startIfEnabled()}captureException(e){var t,i,r=(t=e==null||(i=e.$exception_list)==null||(i=i[0])==null?void 0:i.type)!==null&&t!==void 0?t:"Exception";this.gt.consumeRateLimit(r)?Gi.info("Skipping exception capture because of client rate limiting.",{exception:r}):this._instance.exceptions.sendExceptionEvent(e)}}function zn(s,e,t){try{if(!(e in s))return()=>{};var i=s[e],r=t(i);return Zt(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),s[e]=r,()=>{s[e]=i}}catch{return()=>{}}}class Kc{constructor(e){var t;this._instance=e,this._t=(f==null||(t=f.location)==null?void 0:t.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(w.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.yt&&this.yt(),this.yt=void 0,w.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(f&&f.history){var i=this;(e=f.history.pushState)!=null&&e.__posthog_wrapped__||zn(f.history,"pushState",r=>function(n,a,o){r.call(this,n,a,o),i.bt("pushState")}),(t=f.history.replaceState)!=null&&t.__posthog_wrapped__||zn(f.history,"replaceState",r=>function(n,a,o){r.call(this,n,a,o),i.bt("replaceState")}),this.wt()}}bt(e){try{var t,i=f==null||(t=f.location)==null?void 0:t.pathname;if(!i)return;i!==this._t&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this._t=i}catch(r){w.error("Error capturing "+e+" pageview",r)}}wt(){if(!this.yt){var e=()=>{this.bt("popstate")};Pe(f,"popstate",e),this.yt=()=>{f&&f.removeEventListener("popstate",e)}}}}var fr=Fe("[SegmentIntegration]");function Xc(s,e){var t=s.config.segment;if(!t)return e();(function(i,r){var n=i.config.segment;if(!n)return r();var a=l=>{var c=()=>l.anonymousId()||Jt();i.config.get_device_id=c,l.id()&&(i.register({distinct_id:l.id(),$device_id:c()}),i.persistence.set_property(Nt,"identified")),r()},o=n.user();"then"in o&&Zt(o.then)?o.then(l=>a(l)):a(o)})(s,()=>{t.register((i=>{Promise&&Promise.resolve||fr.warn("This browser does not have Promise support, and can not use the segment integration");var r=(n,a)=>{if(!a)return n;n.event.userId||n.event.anonymousId===i.get_distinct_id()||(fr.info("No userId set, resetting PostHog"),i.reset()),n.event.userId&&n.event.userId!==i.get_distinct_id()&&(fr.info("UserId set, identifying with PostHog"),i.identify(n.event.userId));var o=i.calculateEventProperties(a,n.event.properties);return n.event.properties=Object.assign({},o,n.event.properties),n};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:n=>r(n,n.event.event),page:n=>r(n,"$pageview"),identify:n=>r(n,"$identify"),screen:n=>r(n,"$screen")}})(s)).then(()=>{e()})})}var fo="posthog-js";function go(s,e){var{organization:t,projectId:i,prefix:r,severityAllowList:n=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return o=>{var l,c,u,h,v;if(!(n==="*"||n.includes(o.level))||!s.__loaded)return o;o.tags||(o.tags={});var g=s.requestRouter.endpointFor("ui","/project/"+s.config.token+"/person/"+s.get_distinct_id());o.tags["PostHog Person URL"]=g,s.sessionRecordingStarted()&&(o.tags["PostHog Recording URL"]=s.get_session_replay_url({withTimestamp:!0}));var p=((l=o.exception)==null?void 0:l.values)||[],_=p.map(b=>S({},b,{stacktrace:b.stacktrace?S({},b.stacktrace,{type:"raw",frames:(b.stacktrace.frames||[]).map(I=>S({},I,{platform:"web:javascript"}))}):void 0})),m={$exception_message:((c=p[0])==null?void 0:c.value)||o.message,$exception_type:(u=p[0])==null?void 0:u.type,$exception_level:o.level,$exception_list:_,$sentry_event_id:o.event_id,$sentry_exception:o.exception,$sentry_exception_message:((h=p[0])==null?void 0:h.value)||o.message,$sentry_exception_type:(v=p[0])==null?void 0:v.type,$sentry_tags:o.tags};return t&&i&&(m.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+o.event_id),a&&s.exceptions.sendExceptionEvent(m),o}}class Jc{constructor(e,t,i,r,n,a){this.name=fo,this.setupOnce=function(o){o(go(e,{organization:t,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:a==null||a}))}}}var Zc=f!=null&&f.location?js(f.location.hash,"__posthog")||js(location.hash,"state"):null,Qn="_postHogToolbarParams",Yn=Fe("[Toolbar]"),Qt=function(s){return s[s.UNINITIALIZED=0]="UNINITIALIZED",s[s.LOADING=1]="LOADING",s[s.LOADED=2]="LOADED",s}(Qt||{});class $c{constructor(e){this.instance=e}xt(e){L.ph_toolbar_state=e}St(){var e;return(e=L.ph_toolbar_state)!==null&&e!==void 0?e:Qt.UNINITIALIZED}maybeLoadToolbar(e,t,i){if(e===void 0&&(e=void 0),t===void 0&&(t=void 0),i===void 0&&(i=void 0),!f||!x)return!1;e=e??f.location,i=i??f.history;try{if(!t){try{f.localStorage.setItem("test","test"),f.localStorage.removeItem("test")}catch{return!1}t=f==null?void 0:f.localStorage}var r,n=Zc||js(e.hash,"__posthog")||js(e.hash,"state"),a=n?Rn(()=>JSON.parse(atob(decodeURIComponent(n))))||Rn(()=>JSON.parse(decodeURIComponent(n))):null;return a&&a.action==="ph_authorize"?((r=a).source="url",r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(Qn)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}Et(e){var t=L.ph_load_toolbar||L.ph_load_editor;!ue(t)&&Zt(t)?t(e,this.instance):Yn.warn("No toolbar load function found")}loadToolbar(e){var t=!(x==null||!x.getElementById(Xa));if(!f||t)return!1;var i=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=S({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(f.localStorage.setItem(Qn,JSON.stringify(S({},r,{source:void 0}))),this.St()===Qt.LOADED)this.Et(r);else if(this.St()===Qt.UNINITIALIZED){var n;this.xt(Qt.LOADING),(n=L.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this.instance,"toolbar",a=>{if(a)return Yn.error("[Toolbar] Failed to load",a),void this.xt(Qt.UNINITIALIZED);this.xt(Qt.LOADED),this.Et(r)}),Pe(f,"turbolinks:load",()=>{this.xt(Qt.UNINITIALIZED),this.loadToolbar(r)})}return!0}$t(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return e===void 0&&(e=void 0),t===void 0&&(t=void 0),i===void 0&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}var eu=Fe("[TracingHeaders]");class tu{constructor(e){this.kt=void 0,this.Pt=void 0,this.lt=()=>{var t,i;y(this.kt)&&((t=L.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),y(this.Pt)&&((i=L.__PosthogExtensions__)==null||(i=i.tracingHeadersPatchFns)==null||i._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}nt(e){var t,i;(t=L.__PosthogExtensions__)!=null&&t.tracingHeadersPatchFns&&e(),(i=L.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"tracing-headers",r=>{if(r)return eu.error("failed to load script",r);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.nt(this.lt):((e=this.kt)==null||e.call(this),(t=this.Pt)==null||t.call(this),this.kt=void 0,this.Pt=void 0)}}var ht="Mobile",Hs="iOS",It="Android",rs="Tablet",vo=It+" "+rs,po="iPad",_o="Apple",mo=_o+" Watch",ns="Safari",Ai="BlackBerry",yo="Samsung",bo=yo+"Browser",wo=yo+" Internet",di="Chrome",iu=di+" OS",xo=di+" "+Hs,rn="Internet Explorer",Eo=rn+" "+ht,nn="Opera",su=nn+" Mini",an="Edge",ko="Microsoft "+an,ki="Firefox",So=ki+" "+Hs,as="Nintendo",os="PlayStation",Si="Xbox",Po=It+" "+ht,Io=ht+" "+ns,Zi="Windows",Ur=Zi+" Phone",Kn="Nokia",Gr="Ouya",To="Generic",ru=To+" "+ht.toLowerCase(),Oo=To+" "+rs.toLowerCase(),Vr="Konqueror",Ve="(\\d+(\\.\\d+)?)",gr=new RegExp("Version/"+Ve),nu=new RegExp(Si,"i"),au=new RegExp(os+" \\w+","i"),ou=new RegExp(as+" \\w+","i"),on=new RegExp(Ai+"|PlayBook|BB10","i"),lu={"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"},cu=(s,e)=>e&&Y(e,_o)||function(t){return Y(t,ns)&&!Y(t,di)&&!Y(t,It)}(s),Co=function(s,e){return e=e||"",Y(s," OPR/")&&Y(s,"Mini")?su:Y(s," OPR/")?nn:on.test(s)?Ai:Y(s,"IE"+ht)||Y(s,"WPDesktop")?Eo:Y(s,bo)?wo:Y(s,an)||Y(s,"Edg/")?ko:Y(s,"FBIOS")?"Facebook "+ht:Y(s,"UCWEB")||Y(s,"UCBrowser")?"UC Browser":Y(s,"CriOS")?xo:Y(s,"CrMo")||Y(s,di)?di:Y(s,It)&&Y(s,ns)?Po:Y(s,"FxiOS")?So:Y(s.toLowerCase(),Vr.toLowerCase())?Vr:cu(s,e)?Y(s,ht)?Io:ns:Y(s,ki)?ki:Y(s,"MSIE")||Y(s,"Trident/")?rn:Y(s,"Gecko")?ki:""},uu={[Eo]:[new RegExp("rv:"+Ve)],[ko]:[new RegExp(an+"?\\/"+Ve)],[di]:[new RegExp("("+di+"|CrMo)\\/"+Ve)],[xo]:[new RegExp("CriOS\\/"+Ve)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+Ve)],[ns]:[gr],[Io]:[gr],[nn]:[new RegExp("(Opera|OPR)\\/"+Ve)],[ki]:[new RegExp(ki+"\\/"+Ve)],[So]:[new RegExp("FxiOS\\/"+Ve)],[Vr]:[new RegExp("Konqueror[:/]?"+Ve,"i")],[Ai]:[new RegExp(Ai+" "+Ve),gr],[Po]:[new RegExp("android\\s"+Ve,"i")],[wo]:[new RegExp(bo+"\\/"+Ve)],[rn]:[new RegExp("(rv:|MSIE )"+Ve)],Mozilla:[new RegExp("rv:"+Ve)]},du=function(s,e){var t=Co(s,e),i=uu[t];if(y(i))return null;for(var r=0;r<i.length;r++){var n=i[r],a=s.match(n);if(a)return parseFloat(a[a.length-2])}return null},Xn=[[new RegExp(Si+"; "+Si+" (.*?)[);]","i"),s=>[Si,s&&s[1]||""]],[new RegExp(as,"i"),[as,""]],[new RegExp(os,"i"),[os,""]],[on,[Ai,""]],[new RegExp(Zi,"i"),(s,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Ur,""];if(new RegExp(ht).test(e)&&!/IEMobile\b/.test(e))return[Zi+" "+ht,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=t[1],r=lu[i]||"";return/arm/i.test(e)&&(r="RT"),[Zi,r]}return[Zi,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,s=>{if(s&&s[3]){var e=[s[3],s[4],s[5]||"0"];return[Hs,e.join(".")]}return[Hs,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,s=>{var e="";return s&&s.length>=3&&(e=y(s[2])?s[3]:s[2]),["watchOS",e]}],[new RegExp("("+It+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+It+")","i"),s=>{if(s&&s[2]){var e=[s[2],s[3],s[4]||"0"];return[It,e.join(".")]}return[It,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,s=>{var e=["Mac OS X",""];if(s&&s[1]){var t=[s[1],s[2],s[3]||"0"];e[1]=t.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[iu,""]],[/Linux|debian/i,["Linux",""]]],Jn=function(s){return ou.test(s)?as:au.test(s)?os:nu.test(s)?Si:new RegExp(Gr,"i").test(s)?Gr:new RegExp("("+Ur+"|WPDesktop)","i").test(s)?Ur:/iPad/.test(s)?po:/iPod/.test(s)?"iPod Touch":/iPhone/.test(s)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(s)?mo:on.test(s)?Ai:/(kobo)\s(ereader|touch)/i.test(s)?"Kobo":new RegExp(Kn,"i").test(s)?Kn:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(s)||/(kf[a-z]+)( bui|\)).+silk\//i.test(s)?"Kindle Fire":/(Android|ZTE)/i.test(s)?!new RegExp(ht).test(s)||/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(s)?/pixel[\daxl ]{1,6}/i.test(s)&&!/pixel c/i.test(s)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(s)||/lmy47v/i.test(s)&&!/QTAQZ3/i.test(s)?It:vo:It:new RegExp("(pda|"+ht+")","i").test(s)?ru:new RegExp(rs,"i").test(s)&&!new RegExp(rs+" pc","i").test(s)?Oo:""},ws="https?://(.*)",Li=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],hu=Di(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Li),fs="<masked>",fu=["li_fat_id"];function Fo(s,e,t){if(!x)return{};var i,r=e?Di([],Li,t||[]):[],n=Ao(hs(x.URL,r,fs),s),a=(i={},oe(fu,function(o){var l=Ot.J(o);i[o]=l||null}),i);return ye(a,n)}function Ao(s,e){var t=hu.concat(e||[]),i={};return oe(t,function(r){var n=Bs(s,r);i[r]=n||null}),i}function Ro(s){var e=function(n){return n?n.search(ws+"google.([^/?]*)")===0?"google":n.search(ws+"bing.com")===0?"bing":n.search(ws+"yahoo.com")===0?"yahoo":n.search(ws+"duckduckgo.com")===0?"duckduckgo":null:null}(s),t=e!="yahoo"?"q":"p",i={};if(!Gt(e)){i.$search_engine=e;var r=x?Bs(x.referrer,t):"";r.length&&(i.ph_keyword=r)}return i}function Zn(){return navigator.language||navigator.userLanguage}function Mo(){return(x==null?void 0:x.referrer)||"$direct"}function Do(s,e){var t=s?Di([],Li,e||[]):[],i=Xe==null?void 0:Xe.href.substring(0,1e3);return{r:Mo().substring(0,1e3),u:i?hs(i,t,fs):void 0}}function Lo(s){var e,{r:t,u:i}=s,r={$referrer:t,$referring_domain:t==null?void 0:t=="$direct"?"$direct":(e=Ns(t))==null?void 0:e.host};if(i){r.$current_url=i;var n=Ns(i);r.$host=n==null?void 0:n.host,r.$pathname=n==null?void 0:n.pathname;var a=Ao(i);ye(r,a)}if(t){var o=Ro(t);ye(r,o)}return r}function No(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function gu(){try{return new Date().getTimezoneOffset()}catch{return}}function vu(s,e){if(!Ke)return{};var t,i,r,n=s?Di([],Li,e||[]):[],[a,o]=function(l){for(var c=0;c<Xn.length;c++){var[u,h]=Xn[c],v=u.exec(l),g=v&&(Zt(h)?h(v,l):h);if(g)return g}return["",""]}(Ke);return ye($r({$os:a,$os_version:o,$browser:Co(Ke,navigator.vendor),$device:Jn(Ke),$device_type:(i=Ke,r=Jn(i),r===po||r===vo||r==="Kobo"||r==="Kindle Fire"||r===Oo?rs:r===as||r===Si||r===os||r===Gr?"Console":r===mo?"Wearable":r?ht:"Desktop"),$timezone:No(),$timezone_offset:gu()}),{$current_url:hs(Xe==null?void 0:Xe.href,n,fs),$host:Xe==null?void 0:Xe.host,$pathname:Xe==null?void 0:Xe.pathname,$raw_user_agent:Ke.length>1e3?Ke.substring(0,997)+"...":Ke,$browser_version:du(Ke,navigator.vendor),$browser_language:Zn(),$browser_language_prefix:(t=Zn(),typeof t=="string"?t.split("-")[0]:void 0),$screen_height:f==null?void 0:f.screen.height,$screen_width:f==null?void 0:f.screen.width,$viewport_height:f==null?void 0:f.innerHeight,$viewport_width:f==null?void 0:f.innerWidth,$lib:"web",$lib_version:Lt.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Wt=Fe("[Web Vitals]"),$n=9e5;class pu{constructor(e){var t;this.Tt=!1,this.C=!1,this.q={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.It=()=>{clearTimeout(this.Rt),this.q.metrics.length!==0&&(this._instance.capture("$web_vitals",this.q.metrics.reduce((i,r)=>S({},i,{["$web_vitals_"+r.name+"_event"]:S({},r),["$web_vitals_"+r.name+"_value"]:r.value}),{})),this.q={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Ct=i=>{var r,n=(r=this._instance.sessionManager)==null?void 0:r.checkAndGetSessionAndWindowId(!0);if(y(n))Wt.error("Could not read session ID. Dropping metrics!");else{this.q=this.q||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var a=this.Ot();y(a)||(ue(i==null?void 0:i.name)||ue(i==null?void 0:i.value)?Wt.error("Invalid metric received",i):this.Ft&&i.value>=this.Ft?Wt.error("Ignoring metric with value >= "+this.Ft,i):(this.q.url!==a&&(this.It(),this.Rt=setTimeout(this.It,this.flushToCaptureTimeoutMs)),y(this.q.url)&&(this.q.url=a),this.q.firstMetricTimestamp=y(this.q.firstMetricTimestamp)?Date.now():this.q.firstMetricTimestamp,i.attribution&&i.attribution.interactionTargetElement&&(i.attribution.interactionTargetElement=void 0),this.q.metrics.push(S({},i,{$current_url:a,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()})),this.q.metrics.length===this.allowedMetrics.length&&this.It()))}},this.lt=()=>{var i,r,n,a,o=L.__PosthogExtensions__;y(o)||y(o.postHogWebVitalsCallbacks)||({onLCP:i,onCLS:r,onFCP:n,onINP:a}=o.postHogWebVitalsCallbacks),i&&r&&n&&a?(this.allowedMetrics.indexOf("LCP")>-1&&i(this.Ct.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&r(this.Ct.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&n(this.Ct.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&a(this.Ct.bind(this)),this.C=!0):Wt.error("web vitals callbacks not loaded - not starting")},this._instance=e,this.Tt=!((t=this._instance.persistence)==null||!t.props[Nn]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=Ue(this._instance.config.capture_performance)?(e=this._instance.config.capture_performance)==null?void 0:e.web_vitals_allowed_metrics:void 0;return y(i)?((t=this._instance.persistence)==null?void 0:t.props[Bn])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(Ue(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get Ft(){var e=Ue(this._instance.config.capture_performance)&&Ct(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:$n;return 0<e&&e<=6e4?$n:e}get isEnabled(){var e=Xe==null?void 0:Xe.protocol;if(e!=="http:"&&e!=="https:")return Wt.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Ue(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:$t(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return $t(t)?t:this.Tt}startIfEnabled(){this.isEnabled&&!this.C&&(Wt.info("enabled, starting..."),this.nt(this.lt))}onRemoteConfig(e){var t=Ue(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=Ue(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Nn]:t}),this._instance.persistence.register({[Bn]:i})),this.Tt=t,this.startIfEnabled()}nt(e){var t,i;(t=L.__PosthogExtensions__)!=null&&t.postHogWebVitalsCallbacks&&e(),(i=L.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"web-vitals",r=>{r?Wt.error("failed to load script",r):e()})}Ot(){var e=f?f.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,i=this._instance.config.custom_personal_data_properties,r=t?Di([],Li,i||[]):[];return hs(e,r,fs)}Wt.error("Could not determine current URL")}}var _u=Fe("[Heatmaps]");function ea(s){return Ue(s)&&"clientX"in s&&"clientY"in s&&Ct(s.clientX)&&Ct(s.clientY)}class mu{constructor(e){var t;this.rageclicks=new co,this.Tt=!1,this.C=!1,this.Mt=null,this.instance=e,this.Tt=!((t=this.instance.persistence)==null||!t.props[Rr])}get flushIntervalMilliseconds(){var e=5e3;return Ue(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return y(this.instance.config.capture_heatmaps)?y(this.instance.config.enable_heatmaps)?this.Tt:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.C)return;_u.info("starting..."),this.At(),this.Mt=setInterval(this.jt.bind(this),this.flushIntervalMilliseconds)}else{var e,t;clearInterval((e=this.Mt)!==null&&e!==void 0?e:void 0),(t=this.Dt)==null||t.stop(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Rr]:t}),this.Tt=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.q;return this.q=void 0,e}Lt(e){this.Nt(e.originalEvent,"deadclick")}At(){f&&x&&(Pe(f,"beforeunload",this.jt.bind(this)),Pe(x,"click",e=>this.Nt(e||(f==null?void 0:f.event)),{capture:!0}),Pe(x,"mousemove",e=>this.Ut(e||(f==null?void 0:f.event)),{capture:!0}),this.Dt=new ho(this.instance,zc,this.Lt.bind(this)),this.Dt.startIfEnabled(),this.C=!0)}zt(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),a=function(o,l,c){for(var u=o;u&&Ys(u)&&!ti(u,"body");){if(u===c)return!1;if(Y(l,f==null?void 0:f.getComputedStyle(u).position))return!0;u=io(u)}return!1}(eo(e),["fixed","sticky"],n);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:i),target_fixed:a,type:t}}Nt(e,t){var i;if(t===void 0&&(t="click"),!jn(e.target)&&ea(e)){var r=this.zt(e,t);(i=this.rageclicks)!=null&&i.isRageClick(e.clientX,e.clientY,new Date().getTime())&&this.Ht(S({},r,{type:"rageclick"})),this.Ht(r)}}Ut(e){!jn(e.target)&&ea(e)&&(clearTimeout(this.Bt),this.Bt=setTimeout(()=>{this.Ht(this.zt(e,"mousemove"))},500))}Ht(e){if(f){var t=f.location.href,i=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,n=i?Di([],Li,r||[]):[],a=hs(t,n,fs);this.q=this.q||{},this.q[a]||(this.q[a]=[]),this.q[a].push(e)}}jt(){this.q&&!wi(this.q)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class yu{constructor(e){this._instance=e}doPageView(e,t){var i,r=this.qt(e,t);return this.Wt={pathname:(i=f==null?void 0:f.location.pathname)!==null&&i!==void 0?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.qt(e,(t=this.Wt)==null?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.Wt)==null?void 0:e.pageViewId}}qt(e,t){var i=this.Wt;if(!i)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:i.pageViewId},n=this._instance.scrollManager.getContext();if(n&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:o,maxScrollY:l,maxContentHeight:c,lastContentY:u,maxContentY:h}=n;if(!(y(a)||y(o)||y(l)||y(c)||y(u)||y(h))){a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),h=Math.ceil(h);var v=a<=1?1:Pt(o/a,0,1,w),g=a<=1?1:Pt(l/a,0,1,w),p=c<=1?1:Pt(u/c,0,1,w),_=c<=1?1:Pt(h/c,0,1,w);r=ye(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:v,$prev_pageview_max_scroll:l,$prev_pageview_max_scroll_percentage:g,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:_})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}}var ft=Uint8Array,Ze=Uint16Array,Ri=Uint32Array,ln=new ft([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]),cn=new ft([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]),ta=new ft([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Bo=function(s,e){for(var t=new Ze(31),i=0;i<31;++i)t[i]=e+=1<<s[i-1];var r=new Ri(t[30]);for(i=1;i<30;++i)for(var n=t[i];n<t[i+1];++n)r[n]=n-t[i]<<5|i;return[t,r]},jo=Bo(ln,2),bu=jo[0],Wr=jo[1];bu[28]=258,Wr[258]=28;for(var ia=Bo(cn,0)[1],qo=new Ze(32768),ce=0;ce<32768;++ce){var ai=(43690&ce)>>>1|(21845&ce)<<1;ai=(61680&(ai=(52428&ai)>>>2|(13107&ai)<<2))>>>4|(3855&ai)<<4,qo[ce]=((65280&ai)>>>8|(255&ai)<<8)>>>1}var ts=function(s,e,t){for(var i=s.length,r=0,n=new Ze(e);r<i;++r)++n[s[r]-1];var a,o=new Ze(e);for(r=0;r<e;++r)o[r]=o[r-1]+n[r-1]<<1;for(a=new Ze(i),r=0;r<i;++r)a[r]=qo[o[s[r]-1]++]>>>15-s[r];return a},hi=new ft(288);for(ce=0;ce<144;++ce)hi[ce]=8;for(ce=144;ce<256;++ce)hi[ce]=9;for(ce=256;ce<280;++ce)hi[ce]=7;for(ce=280;ce<288;++ce)hi[ce]=8;var Us=new ft(32);for(ce=0;ce<32;++ce)Us[ce]=5;var wu=ts(hi,9),xu=ts(Us,5),Ho=function(s){return(s/8>>0)+(7&s&&1)},Uo=function(s,e,t){(t==null||t>s.length)&&(t=s.length);var i=new(s instanceof Ze?Ze:s instanceof Ri?Ri:ft)(t-e);return i.set(s.subarray(e,t)),i},At=function(s,e,t){t<<=7&e;var i=e/8>>0;s[i]|=t,s[i+1]|=t>>>8},Vi=function(s,e,t){t<<=7&e;var i=e/8>>0;s[i]|=t,s[i+1]|=t>>>8,s[i+2]|=t>>>16},vr=function(s,e){for(var t=[],i=0;i<s.length;++i)s[i]&&t.push({s:i,f:s[i]});var r=t.length,n=t.slice();if(!r)return[new ft(0),0];if(r==1){var a=new ft(t[0].s+1);return a[t[0].s]=1,[a,1]}t.sort(function(U,C){return U.f-C.f}),t.push({s:-1,f:25001});var o=t[0],l=t[1],c=0,u=1,h=2;for(t[0]={s:-1,f:o.f+l.f,l:o,r:l};u!=r-1;)o=t[t[c].f<t[h].f?c++:h++],l=t[c!=u&&t[c].f<t[h].f?c++:h++],t[u++]={s:-1,f:o.f+l.f,l:o,r:l};var v=n[0].s;for(i=1;i<r;++i)n[i].s>v&&(v=n[i].s);var g=new Ze(v+1),p=zr(t[u-1],g,0);if(p>e){i=0;var _=0,m=p-e,b=1<<m;for(n.sort(function(U,C){return g[C.s]-g[U.s]||U.f-C.f});i<r;++i){var I=n[i].s;if(!(g[I]>e))break;_+=b-(1<<p-g[I]),g[I]=e}for(_>>>=m;_>0;){var M=n[i].s;g[M]<e?_-=1<<e-g[M]++-1:++i}for(;i>=0&&_;--i){var D=n[i].s;g[D]==e&&(--g[D],++_)}p=e}return[new ft(g),p]},zr=function(s,e,t){return s.s==-1?Math.max(zr(s.l,e,t+1),zr(s.r,e,t+1)):e[s.s]=t},sa=function(s){for(var e=s.length;e&&!s[--e];);for(var t=new Ze(++e),i=0,r=s[0],n=1,a=function(l){t[i++]=l},o=1;o<=e;++o)if(s[o]==r&&o!=e)++n;else{if(!r&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(r),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(r);n=1,r=s[o]}return[t.subarray(0,i),e]},Wi=function(s,e){for(var t=0,i=0;i<e.length;++i)t+=s[i]*e[i];return t},Qr=function(s,e,t){var i=t.length,r=Ho(e+2);s[r]=255&i,s[r+1]=i>>>8,s[r+2]=255^s[r],s[r+3]=255^s[r+1];for(var n=0;n<i;++n)s[r+n+4]=t[n];return 8*(r+4+i)},ra=function(s,e,t,i,r,n,a,o,l,c,u){At(e,u++,t),++r[256];for(var h=vr(r,15),v=h[0],g=h[1],p=vr(n,15),_=p[0],m=p[1],b=sa(v),I=b[0],M=b[1],D=sa(_),U=D[0],C=D[1],ae=new Ze(19),q=0;q<I.length;++q)ae[31&I[q]]++;for(q=0;q<U.length;++q)ae[31&U[q]]++;for(var ve=vr(ae,7),ie=ve[0],we=ve[1],je=19;je>4&&!ie[ta[je-1]];--je);var Ie,Ge,We,Et,ot=c+5<<3,et=Wi(r,hi)+Wi(n,Us)+a,de=Wi(r,v)+Wi(n,_)+a+14+3*je+Wi(ae,ie)+(2*ae[16]+3*ae[17]+7*ae[18]);if(ot<=et&&ot<=de)return Qr(e,u,s.subarray(l,l+c));if(At(e,u,1+(de<et)),u+=2,de<et){Ie=ts(v,g),Ge=v,We=ts(_,m),Et=_;var lt=ts(ie,we);for(At(e,u,M-257),At(e,u+5,C-1),At(e,u+10,je-4),u+=14,q=0;q<je;++q)At(e,u+3*q,ie[ta[q]]);u+=3*je;for(var ze=[I,U],pe=0;pe<2;++pe){var Ae=ze[pe];for(q=0;q<Ae.length;++q){var k=31&Ae[q];At(e,u,lt[k]),u+=ie[k],k>15&&(At(e,u,Ae[q]>>>5&127),u+=Ae[q]>>>12)}}}else Ie=wu,Ge=hi,We=xu,Et=Us;for(q=0;q<o;++q)if(i[q]>255){k=i[q]>>>18&31,Vi(e,u,Ie[k+257]),u+=Ge[k+257],k>7&&(At(e,u,i[q]>>>23&31),u+=ln[k]);var A=31&i[q];Vi(e,u,We[A]),u+=Et[A],A>3&&(Vi(e,u,i[q]>>>5&8191),u+=cn[A])}else Vi(e,u,Ie[i[q]]),u+=Ge[i[q]];return Vi(e,u,Ie[256]),u+Ge[256]},Eu=new Ri([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ku=function(){for(var s=new Ri(256),e=0;e<256;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;s[e]=t}return s}(),Su=function(s,e,t,i,r){return function(n,a,o,l,c,u){var h=n.length,v=new ft(l+h+5*(1+Math.floor(h/7e3))+c),g=v.subarray(l,v.length-c),p=0;if(!a||h<8)for(var _=0;_<=h;_+=65535){var m=_+65535;m<h?p=Qr(g,p,n.subarray(_,m)):(g[_]=u,p=Qr(g,p,n.subarray(_,h)))}else{for(var b=Eu[a-1],I=b>>>13,M=8191&b,D=(1<<o)-1,U=new Ze(32768),C=new Ze(D+1),ae=Math.ceil(o/3),q=2*ae,ve=function(si){return(n[si]^n[si+1]<<ae^n[si+2]<<q)&D},ie=new Ri(25e3),we=new Ze(288),je=new Ze(32),Ie=0,Ge=0,We=(_=0,0),Et=0,ot=0;_<h;++_){var et=ve(_),de=32767&_,lt=C[et];if(U[de]=lt,C[et]=de,Et<=_){var ze=h-_;if((Ie>7e3||We>24576)&&ze>423){p=ra(n,g,0,ie,we,je,Ge,We,ot,_-ot,p),We=Ie=Ge=0,ot=_;for(var pe=0;pe<286;++pe)we[pe]=0;for(pe=0;pe<30;++pe)je[pe]=0}var Ae=2,k=0,A=M,se=de-lt&32767;if(ze>2&&et==ve(_-se))for(var gt=Math.min(I,ze)-1,tt=Math.min(32767,_),Vt=Math.min(258,ze);se<=tt&&--A&&de!=lt;){if(n[_+Ae]==n[_+Ae-se]){for(var vt=0;vt<Vt&&n[_+vt]==n[_+vt-se];++vt);if(vt>Ae){if(Ae=vt,k=se,vt>gt)break;var vi=Math.min(se,vt-2),it=0;for(pe=0;pe<vi;++pe){var st=_-se+pe+32768&32767,be=st-U[st]+32768&32767;be>it&&(it=be,lt=st)}}}se+=(de=lt)-(lt=U[de])+32768&32767}if(k){ie[We++]=268435456|Wr[Ae]<<18|ia[k];var V=31&Wr[Ae],ii=31&ia[k];Ge+=ln[V]+cn[ii],++we[257+V],++je[ii],Et=_+Ae,++Ie}else ie[We++]=n[_],++we[n[_]]}}p=ra(n,g,u,ie,we,je,Ge,We,ot,_-ot,p)}return Uo(v,0,l+Ho(p)+c)}(s,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+e.mem,t,i,!0)},pr=function(s,e,t){for(;t;++e)s[e]=t,t>>>=8};function Pu(s,e){e===void 0&&(e={});var t=function(){var o=4294967295;return{p:function(l){for(var c=o,u=0;u<l.length;++u)c=ku[255&c^l[u]]^c>>>8;o=c},d:function(){return 4294967295^o}}}(),i=s.length;t.p(s);var r,n=Su(s,e,10+((r=e).filename&&r.filename.length+1||0),8),a=n.length;return function(o,l){var c=l.filename;if(o[0]=31,o[1]=139,o[2]=8,o[8]=l.level<2?4:l.level==9?2:0,o[9]=3,l.mtime!=0&&pr(o,4,Math.floor(new Date(l.mtime||Date.now())/1e3)),c){o[3]=8;for(var u=0;u<=c.length;++u)o[u+10]=c.charCodeAt(u)}}(n,e),pr(n,a-8,t.d()),pr(n,a-4,i),n}var Iu=function(s){var e,t,i,r,n="";for(e=t=0,i=(s=(s+"").replace(/\r\n/g,`
|
|
3
|
+
`).replace(/\r/g,`
|
|
4
|
+
`)).length,r=0;r<i;r++){var a=s.charCodeAt(r),o=null;a<128?t++:o=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),Gt(o)||(t>e&&(n+=s.substring(e,t)),n+=o,e=t=r+1)}return t>e&&(n+=s.substring(e,s.length)),n},Tu=!!Tr||!!Ir,na="text/plain",Gs=(s,e)=>{var[t,i]=s.split("?"),r=S({},e);i==null||i.split("&").forEach(a=>{var[o]=a.split("=");delete r[o]});var n=Rc(r);return t+"?"+(n=n?(i?i+"&":"")+n:i)},$i=(s,e)=>JSON.stringify(s,(t,i)=>typeof i=="bigint"?i.toString():i,e),_r=s=>{var{data:e,compression:t}=s;if(e){if(t===Ht.GZipJS){var i=Pu(function(l,c){var u=l.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(l);for(var h=new ft(l.length+(l.length>>>1)),v=0,g=function(b){h[v++]=b},p=0;p<u;++p){if(v+5>h.length){var _=new ft(v+8+(u-p<<1));_.set(h),h=_}var m=l.charCodeAt(p);m<128||c?g(m):m<2048?(g(192|m>>>6),g(128|63&m)):m>55295&&m<57344?(g(240|(m=65536+(1047552&m)|1023&l.charCodeAt(++p))>>>18),g(128|m>>>12&63),g(128|m>>>6&63),g(128|63&m)):(g(224|m>>>12),g(128|m>>>6&63),g(128|63&m))}return Uo(h,0,v)}($i(e)),{mtime:0}),r=new Blob([i],{type:na});return{contentType:na,body:r,estimatedSize:r.size}}if(t===Ht.Base64){var n=function(l){var c,u,h,v,g,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_=0,m=0,b="",I=[];if(!l)return l;l=Iu(l);do c=(g=l.charCodeAt(_++)<<16|l.charCodeAt(_++)<<8|l.charCodeAt(_++))>>18&63,u=g>>12&63,h=g>>6&63,v=63&g,I[m++]=p.charAt(c)+p.charAt(u)+p.charAt(h)+p.charAt(v);while(_<l.length);switch(b=I.join(""),l.length%3){case 1:b=b.slice(0,-2)+"==";break;case 2:b=b.slice(0,-1)+"="}return b}($i(e)),a=(l=>"data="+encodeURIComponent(typeof l=="string"?l:$i(l)))(n);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var o=$i(e);return{contentType:"application/json",body:o,estimatedSize:new Blob([o]).size}}},Ps=[];Ir&&Ps.push({transport:"fetch",method:s=>{var e,t,{contentType:i,body:r,estimatedSize:n}=(e=_r(s))!==null&&e!==void 0?e:{},a=new Headers;oe(s.headers,function(u,h){a.append(h,u)}),i&&a.append("Content-Type",i);var o=s.url,l=null;if(Pn){var c=new Pn;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),s.timeout)}}Ir(o,S({method:(s==null?void 0:s.method)||"GET",headers:a,keepalive:s.method==="POST"&&(n||0)<52428.8,body:r,signal:(t=l)==null?void 0:t.signal},s.fetchOptions)).then(u=>u.text().then(h=>{var v={statusCode:u.status,text:h};if(u.status===200)try{v.json=JSON.parse(h)}catch(g){w.error(g)}s.callback==null||s.callback(v)})).catch(u=>{w.error(u),s.callback==null||s.callback({statusCode:0,text:u})}).finally(()=>l?clearTimeout(l.timeout):null)}}),Tr&&Ps.push({transport:"XHR",method:s=>{var e,t=new Tr;t.open(s.method||"GET",s.url,!0);var{contentType:i,body:r}=(e=_r(s))!==null&&e!==void 0?e:{};oe(s.headers,function(n,a){t.setRequestHeader(a,n)}),i&&t.setRequestHeader("Content-Type",i),s.timeout&&(t.timeout=s.timeout),s.disableXHRCredentials||(t.withCredentials=!0),t.onreadystatechange=()=>{if(t.readyState===4){var n={statusCode:t.status,text:t.responseText};if(t.status===200)try{n.json=JSON.parse(t.responseText)}catch{}s.callback==null||s.callback(n)}},t.send(r)}}),at!=null&&at.sendBeacon&&Ps.push({transport:"sendBeacon",method:s=>{var e=Gs(s.url,{beacon:"1"});try{var t,{contentType:i,body:r}=(t=_r(s))!==null&&t!==void 0?t:{},n=typeof r=="string"?new Blob([r],{type:i}):r;at.sendBeacon(e,n)}catch{}}});var Mi=function(s,e){if(!function(t){try{new RegExp(t)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(s)}catch{return!1}};function aa(s,e,t){return $i({distinct_id:s,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var Go={exact:(s,e)=>e.some(t=>s.some(i=>t===i)),is_not:(s,e)=>e.every(t=>s.every(i=>t!==i)),regex:(s,e)=>e.some(t=>s.some(i=>Mi(t,i))),not_regex:(s,e)=>e.every(t=>s.every(i=>!Mi(t,i))),icontains:(s,e)=>e.map(xs).some(t=>s.map(xs).some(i=>t.includes(i))),not_icontains:(s,e)=>e.map(xs).every(t=>s.map(xs).every(i=>!t.includes(i)))},xs=s=>s.toLowerCase(),oa=Fe("[Error tracking]");class Ou{constructor(e){var t,i;this.Gt=[],this.Vt=new cc([new uc,new yc,new hc,new dc,new _c,new pc,new gc,new mc],[rc,oc]),this._instance=e,this.Gt=(t=(i=this._instance.persistence)==null?void 0:i.get_property(Mr))!==null&&t!==void 0?t:[]}onRemoteConfig(e){var t,i,r,n=(t=(i=e.errorTracking)==null?void 0:i.suppressionRules)!==null&&t!==void 0?t:[],a=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.Gt=n,this._instance.persistence&&this._instance.persistence.register({[Mr]:this.Gt,[Ln]:a})}get Jt(){var e,t=!!this._instance.get_property(Ln),i=this._instance.config.error_tracking.captureExtensionExceptions;return(e=i??t)!==null&&e!==void 0&&e}buildProperties(e,t){return this.Vt.buildFromUnknown(e,{syntheticException:t==null?void 0:t.syntheticException,mechanism:{handled:t==null?void 0:t.handled}})}sendExceptionEvent(e){if(this.Kt(e))oa.info("Skipping exception capture because a suppression rule matched");else{if(this.Jt||!this.Yt(e))return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"});oa.info("Skipping exception capture because it was thrown by an extension")}}Kt(e){var t=e.$exception_list;if(!t||!le(t)||t.length===0)return!1;var i=t.reduce((r,n)=>{var{type:a,value:o}=n;return Se(a)&&a.length>0&&r.$exception_types.push(a),Se(o)&&o.length>0&&r.$exception_values.push(o),r},{$exception_types:[],$exception_values:[]});return this.Gt.some(r=>{var n=r.values.map(a=>{var o,l=Go[a.operator],c=le(a.value)?a.value:[a.value],u=(o=i[a.key])!==null&&o!==void 0?o:[];return c.length>0&&l(c,u)});return r.type==="OR"?n.some(Boolean):n.every(Boolean)})}Yt(e){var t=e.$exception_list;return!(!t||!le(t))&&t.flatMap(i=>{var r,n;return(r=(n=i.stacktrace)==null?void 0:n.frames)!==null&&r!==void 0?r:[]}).some(i=>i.filename&&i.filename.startsWith("chrome-extension://"))}}var bt=Fe("[FeatureFlags]"),mr="$active_feature_flags",yi="$override_feature_flags",la="$feature_flag_payloads",zi="$override_feature_flag_payloads",ca="$feature_flag_request_id",ua=s=>{var e={};for(var[t,i]of Ss(s||{}))i&&(e[t]=i);return e},Cu=s=>{var e=s.flags;return e?(s.featureFlags=Object.fromEntries(Object.keys(e).map(t=>{var i;return[t,(i=e[t].variant)!==null&&i!==void 0?i:e[t].enabled]})),s.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter(t=>e[t].enabled).filter(t=>{var i;return(i=e[t].metadata)==null?void 0:i.payload}).map(t=>{var i;return[t,(i=e[t].metadata)==null?void 0:i.payload]}))):bt.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),s},Fu=function(s){return s.FeatureFlags="feature_flags",s.Recordings="recordings",s}({});class Au{constructor(e){this.Xt=!1,this.Qt=!1,this.Zt=!1,this.ti=!1,this.ii=!1,this.ei=!1,this.ri=!1,this._instance=e,this.featureFlagEventHandlers=[]}si(){var e=this._instance.config.evaluation_environments;return e!=null&&e.length?e.filter(t=>{var i=t&&typeof t=="string"&&t.trim().length>0;return i||bt.error("Invalid evaluation environment found:",t,"Expected non-empty string"),i}):[]}ni(){return this.si().length>0}flags(){if(this._instance.config.__preview_remote_config)this.ei=!0;else{var e=!this.oi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.ai({disableFlags:e})}}get hasLoadedFlags(){return this.Qt}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Dr),t=this._instance.get_property(yi),i=this._instance.get_property(zi);if(!i&&!t)return e||{};var r=ye({},e||{}),n=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var a of n){var o,l,c=r[a],u=t==null?void 0:t[a],h=y(u)?(o=c==null?void 0:c.enabled)!==null&&o!==void 0&&o:!!u,v=y(u)?c.variant:typeof u=="string"?u:void 0,g=i==null?void 0:i[a],p=S({},c,{enabled:h,variant:h?v??(c==null?void 0:c.variant):void 0});h!==(c==null?void 0:c.enabled)&&(p.original_enabled=c==null?void 0:c.enabled),v!==(c==null?void 0:c.variant)&&(p.original_variant=c==null?void 0:c.variant),g&&(p.metadata=S({},c==null?void 0:c.metadata,{payload:g,original_payload:c==null||(l=c.metadata)==null?void 0:l.payload})),r[a]=p}return this.Xt||(bt.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.Xt=!0),r}getFlagVariants(){var e=this._instance.get_property(xi),t=this._instance.get_property(yi);if(!t)return e||{};for(var i=ye({},e),r=Object.keys(t),n=0;n<r.length;n++)i[r[n]]=t[r[n]];return this.Xt||(bt.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.Xt=!0),i}getFlagPayloads(){var e=this._instance.get_property(la),t=this._instance.get_property(zi);if(!t)return e||{};for(var i=ye({},e||{}),r=Object.keys(t),n=0;n<r.length;n++)i[r[n]]=t[r[n]];return this.Xt||(bt.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.Xt=!0),i}reloadFeatureFlags(){this.ti||this._instance.config.advanced_disable_feature_flags||this.oi||(this.oi=setTimeout(()=>{this.ai()},5))}li(){clearTimeout(this.oi),this.oi=void 0}ensureFlagsLoaded(){this.Qt||this.Zt||this.oi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.ti=e}ai(e){var t;if(this.li(),!this._instance.L())if(this.Zt)this.ii=!0;else{var i={token:this._instance.config.token,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:S({},((t=this._instance.persistence)==null?void 0:t.get_initial_props())||{},this._instance.get_property(Ji)||{}),group_properties:this._instance.get_property(ci)};(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.ni()&&(i.evaluation_environments=this.si());var r=this._instance.config.__preview_remote_config,n=r?"/flags/?v=2":"/flags/?v=2&config=true",a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("api",n+a);r&&(i.timezone=No()),this.Zt=!0,this._instance.ui({method:"POST",url:o,data:i,compression:this._instance.config.disable_compression?void 0:Ht.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:l=>{var c,u,h=!0;if(l.statusCode===200&&(this.ii||(this.$anon_distinct_id=void 0),h=!1),this.Zt=!1,this.ei||(this.ei=!0,this._instance.hi((u=l.json)!==null&&u!==void 0?u:{})),!i.disable_flags||this.ii)if(this.ri=!h,l.json&&(c=l.json.quotaLimited)!=null&&c.includes(Fu.FeatureFlags))bt.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.");else{var v;i.disable_flags||this.receivedFeatureFlags((v=l.json)!==null&&v!==void 0?v:{},h),this.ii&&(this.ii=!1,this.ai())}}})}}getFeatureFlag(e,t){if(t===void 0&&(t={}),this.Qt||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants()[e],r=""+i,n=this._instance.get_property(ca)||void 0,a=this._instance.get_property(Rs)||{};if((t.send_event||!("send_event"in t))&&(!(e in a)||!a[e].includes(r))){var o,l,c,u,h,v,g,p,_;le(a[e])?a[e].push(r):a[e]=[r],(o=this._instance.persistence)==null||o.register({[Rs]:a});var m=this.getFeatureFlagDetails(e),b={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:this.getFeatureFlagPayload(e)||null,$feature_flag_request_id:n,$feature_flag_bootstrapped_response:((l=this._instance.config.bootstrap)==null||(l=l.featureFlags)==null?void 0:l[e])||null,$feature_flag_bootstrapped_payload:((c=this._instance.config.bootstrap)==null||(c=c.featureFlagPayloads)==null?void 0:c[e])||null,$used_bootstrap_value:!this.ri};y(m==null||(u=m.metadata)==null?void 0:u.version)||(b.$feature_flag_version=m.metadata.version);var I,M=(h=m==null||(v=m.reason)==null?void 0:v.description)!==null&&h!==void 0?h:m==null||(g=m.reason)==null?void 0:g.code;M&&(b.$feature_flag_reason=M),m!=null&&(p=m.metadata)!=null&&p.id&&(b.$feature_flag_id=m.metadata.id),y(m==null?void 0:m.original_variant)&&y(m==null?void 0:m.original_enabled)||(b.$feature_flag_original_response=y(m.original_variant)?m.original_enabled:m.original_variant),m!=null&&(_=m.metadata)!=null&&_.original_payload&&(b.$feature_flag_original_payload=m==null||(I=m.metadata)==null?void 0:I.original_payload),this._instance.capture("$feature_flag_called",b)}return i}bt.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){return this.getFlagPayloads()[e]}getRemoteConfigPayload(e,t){var i=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.ni()&&(r.evaluation_environments=this.si()),this._instance.ui({method:"POST",url:this._instance.requestRouter.endpointFor("api","/flags/?v=2&config=true"),data:r,compression:this._instance.config.disable_compression?void 0:Ht.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:n=>{var a,o=(a=n.json)==null?void 0:a.featureFlagPayloads;t((o==null?void 0:o[e])||void 0)}})}isFeatureEnabled(e,t){if(t===void 0&&(t={}),this.Qt||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return y(i)?void 0:!!i}bt.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this.Qt=!0;var i=this.getFlagVariants(),r=this.getFlagPayloads(),n=this.getFlagsWithDetails();(function(a,o,l,c,u){l===void 0&&(l={}),c===void 0&&(c={}),u===void 0&&(u={});var h=Cu(a),v=h.flags,g=h.featureFlags,p=h.featureFlagPayloads;if(g){var _=a.requestId;if(le(g)){bt.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var m={};if(g)for(var b=0;b<g.length;b++)m[g[b]]=!0;o&&o.register({[mr]:g,[xi]:m})}else{var I=g,M=p,D=v;a.errorsWhileComputingFlags&&(I=S({},l,I),M=S({},c,M),D=S({},u,D)),o&&o.register(S({[mr]:Object.keys(ua(I)),[xi]:I||{},[la]:M||{},[Dr]:D||{}},_?{[ca]:_}:{}))}}})(e,this._instance.persistence,i,r,n),this.di(t)}}override(e,t){t===void 0&&(t=!1),bt.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return bt.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(yi),this._instance.persistence.unregister(zi),void this.di();if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var t,i=e;if(this.Xt=!!((t=i.suppressWarning)!==null&&t!==void 0&&t),"flags"in i){if(i.flags===!1)this._instance.persistence.unregister(yi);else if(i.flags)if(le(i.flags)){for(var r={},n=0;n<i.flags.length;n++)r[i.flags[n]]=!0;this._instance.persistence.register({[yi]:r})}else this._instance.persistence.register({[yi]:i.flags})}return"payloads"in i&&(i.payloads===!1?this._instance.persistence.unregister(zi):i.payloads&&this._instance.persistence.register({[zi]:i.payloads})),void this.di()}this.di()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Qt){var{flags:t,flagVariants:i}=this.vi();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var r,n=(this._instance.get_property(Xi)||[]).find(c=>c.flagKey===e),a={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:a};n&&(o.$early_access_feature_name=n.name),i&&(o.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(a,!1);var l=S({},this.getFlagVariants(),{[e]:t});(r=this._instance.persistence)==null||r.register({[mr]:Object.keys(ua(l)),[xi]:l}),this.di()}getEarlyAccessFeatures(e,t,i){t===void 0&&(t=!1);var r=this._instance.get_property(Xi),n=i?"&"+i.map(a=>"stage="+a).join("&"):"";if(r&&!t)return e(r);this._instance.ui({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+n),method:"GET",callback:a=>{var o,l;if(a.json){var c=a.json.earlyAccessFeatures;return(o=this._instance.persistence)==null||o.unregister(Xi),(l=this._instance.persistence)==null||l.register({[Xi]:c}),e(c)}}})}vi(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(i=>t[i]),flagVariants:Object.keys(t).filter(i=>t[i]).reduce((i,r)=>(i[r]=t[r],i),{})}}di(e){var{flags:t,flagVariants:i}=this.vi();this.featureFlagEventHandlers.forEach(r=>r(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0);var i=this._instance.get_property(Ji)||{};this._instance.register({[Ji]:S({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Ji)}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0);var i=this._instance.get_property(ci)||{};Object.keys(i).length!==0&&Object.keys(i).forEach(r=>{i[r]=S({},i[r],e[r]),delete e[r]}),this._instance.register({[ci]:S({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(ci)||{};this._instance.register({[ci]:S({},t,{[e]:{}})})}else this._instance.unregister(ci)}reset(){this.Qt=!1,this.Zt=!1,this.ti=!1,this.ii=!1,this.ei=!1,this.ri=!1,this.$anon_distinct_id=void 0,this.li(),this.Xt=!1}}var Ru=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class yr{constructor(e,t){this.A=e,this.props={},this.ci=!1,this.fi=(i=>{var r="";return i.token&&(r=i.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),i.persistence_name?"ph_"+i.persistence_name:"ph_"+r+"_posthog"})(e),this.it=this.pi(e),this.load(),e.debug&&w.info("Persistence loaded",e.persistence,S({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.gi}pi(e){Ru.indexOf(e.persistence.toLowerCase())===-1&&(w.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return t==="localstorage"&&he.G()?he:t==="localstorage+cookie"&&ms.G()?ms:t==="sessionstorage"&&Be.G()?Be:t==="memory"?Vc:t==="cookie"?Ot:ms.G()?ms:Ot}properties(){var e={};return oe(this.props,function(t,i){if(i===xi&&Ue(t))for(var r=Object.keys(t),n=0;n<r.length;n++)e["$feature/"+r[n]]=t[r[n]];else o=i,l=!1,(Gt(a=Sc)?l:Sn&&a.indexOf===Sn?a.indexOf(o)!=-1:(oe(a,function(c){if(l||(l=c===o))return Fs}),l))||(e[i]=t);var a,o,l}),e}load(){if(!this.gi){var e=this.it.K(this.fi);e&&(this.props=ye({},e))}}save(){this.gi||this.it.Y(this.fi,this.props,this.mi,this.yi,this.bi,this.A.debug)}remove(){this.it.X(this.fi,!1),this.it.X(this.fi,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(Ue(e)){y(t)&&(t="None"),this.mi=y(i)?this.wi:i;var r=!1;if(oe(e,(n,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==t||(this.props[a]=n,r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(Ue(e)){this.mi=y(t)?this.wi:t;var i=!1;if(oe(e,(r,n)=>{e.hasOwnProperty(n)&&this.props[n]!==r&&(this.props[n]=r,i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.ci){var e=Fo(this.A.custom_campaign_params,this.A.mask_personal_data_properties,this.A.custom_personal_data_properties);wi($r(e))||this.register(e),this.ci=!0}}update_search_keyword(){var e;this.register((e=x==null?void 0:x.referrer)?Ro(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Mo(),$referring_domain:x!=null&&x.referrer&&((e=Ns(x.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[jr]||this.props[qr]||this.register_once({[Ms]:Do(this.A.mask_personal_data_properties,this.A.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};oe([qr,jr],a=>{var o=this.props[a];o&&oe(o,function(l,c){e["$initial_"+Or(c)]=l})});var t,i,r=this.props[Ms];if(r){var n=(t=Lo(r),i={},oe(t,function(a,o){i["$initial_"+Or(o)]=a}),i);ye(e,n)}return e}safe_merge(e){return oe(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){if(this.wi=this.mi=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var r=this.pi(e),n=this.props;this.clear(),this.it=r,this.props=n,this.save()}}set_disabled(e){this.gi=e,this.gi?this.remove():this.save()}set_cross_subdomain(e){e!==this.yi&&(this.yi=e,this.remove(),this.save())}set_secure(e){e!==this.bi&&(this.bi=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[Ki]||{};i[e]=t,this.props[Ki]=i,this.save()}remove_event_timer(e){var t=(this.props[Ki]||{})[e];return y(t)||(delete this.props[Ki][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}(function(s){return s.Button="button",s.Tab="tab",s.Selector="selector",s})({});(function(s){return s.TopLeft="top_left",s.TopRight="top_right",s.TopCenter="top_center",s.MiddleLeft="middle_left",s.MiddleRight="middle_right",s.MiddleCenter="middle_center",s.Left="left",s.Center="center",s.Right="right",s.NextToTrigger="next_to_trigger",s})({});var br=function(s){return s.Popover="popover",s.API="api",s.Widget="widget",s.ExternalSurvey="external_survey",s}({});(function(s){return s.Open="open",s.MultipleChoice="multiple_choice",s.SingleChoice="single_choice",s.Rating="rating",s.Link="link",s})({});(function(s){return s.NextQuestion="next_question",s.End="end",s.ResponseBased="response_based",s.SpecificQuestion="specific_question",s})({});(function(s){return s.Once="once",s.Recurring="recurring",s.Always="always",s})({});var Is=function(s){return s.SHOWN="survey shown",s.DISMISSED="survey dismissed",s.SENT="survey sent",s}({}),da=function(s){return s.SURVEY_ID="$survey_id",s.SURVEY_NAME="$survey_name",s.SURVEY_RESPONSE="$survey_response",s.SURVEY_ITERATION="$survey_iteration",s.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",s.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",s.SURVEY_SUBMISSION_ID="$survey_submission_id",s.SURVEY_QUESTIONS="$survey_questions",s.SURVEY_COMPLETED="$survey_completed",s}({}),Vo=function(s){return s.Popover="popover",s.Inline="inline",s}({});class un{constructor(){this.xi={},this.xi={}}on(e,t){return this.xi[e]||(this.xi[e]=[]),this.xi[e].push(t),()=>{this.xi[e]=this.xi[e].filter(i=>i!==t)}}emit(e,t){for(var i of this.xi[e]||[])i(t);for(var r of this.xi["*"]||[])r(e,t)}}class ui{constructor(e){this.Si=new un,this.Ei=(t,i)=>this.$i(t,i)&&this.ki(t,i)&&this.Pi(t,i),this.$i=(t,i)=>i==null||!i.event||(t==null?void 0:t.event)===(i==null?void 0:i.event),this._instance=e,this.Ti=new Set,this.Ii=new Set}init(){var e;if(!y((e=this._instance)==null?void 0:e.Ri)){var t;(t=this._instance)==null||t.Ri((i,r)=>{this.on(i,r)})}}register(e){var t,i;if(!y((t=this._instance)==null?void 0:t.Ri)&&(e.forEach(a=>{var o,l;(o=this.Ii)==null||o.add(a),(l=a.steps)==null||l.forEach(c=>{var u;(u=this.Ti)==null||u.add((c==null?void 0:c.event)||"")})}),(i=this._instance)!=null&&i.autocapture)){var r,n=new Set;e.forEach(a=>{var o;(o=a.steps)==null||o.forEach(l=>{l!=null&&l.selector&&n.add(l==null?void 0:l.selector)})}),(r=this._instance)==null||r.autocapture.setElementSelectors(n)}}on(e,t){var i;t!=null&&e.length!=0&&(this.Ti.has(e)||this.Ti.has(t==null?void 0:t.event))&&this.Ii&&((i=this.Ii)==null?void 0:i.size)>0&&this.Ii.forEach(r=>{this.Ci(t,r)&&this.Si.emit("actionCaptured",r.name)})}Oi(e){this.onAction("actionCaptured",t=>e(t))}Ci(e,t){if((t==null?void 0:t.steps)==null)return!1;for(var i of t.steps)if(this.Ei(e,i))return!0;return!1}onAction(e,t){return this.Si.on(e,t)}ki(e,t){if(t!=null&&t.url){var i,r=e==null||(i=e.properties)==null?void 0:i.$current_url;if(!r||typeof r!="string"||!ui.Fi(r,t==null?void 0:t.url,(t==null?void 0:t.url_matching)||"contains"))return!1}return!0}static Fi(e,t,i){switch(i){case"regex":return!!f&&Mi(e,t);case"exact":return t===e;case"contains":var r=ui.Mi(t).replace(/_/g,".").replace(/%/g,".*");return Mi(e,r);default:return!1}}static Mi(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}Pi(e,t){if((t!=null&&t.href||t!=null&&t.tag_name||t!=null&&t.text)&&!this.Ai(e).some(n=>!(t!=null&&t.href&&!ui.Fi(n.href||"",t==null?void 0:t.href,(t==null?void 0:t.href_matching)||"exact"))&&(t==null||!t.tag_name||n.tag_name===(t==null?void 0:t.tag_name))&&!(t!=null&&t.text&&!ui.Fi(n.text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact")&&!ui.Fi(n.$el_text||"",t==null?void 0:t.text,(t==null?void 0:t.text_matching)||"exact"))))return!1;if(t!=null&&t.selector){var i,r=e==null||(i=e.properties)==null?void 0:i.$element_selectors;if(!r||!r.includes(t==null?void 0:t.selector))return!1}return!0}Ai(e){return(e==null?void 0:e.properties.$elements)==null?[]:e==null?void 0:e.properties.$elements}}var te=Fe("[Surveys]"),Yr="seenSurvey_",Mu=(s,e)=>{var t="$survey_"+e+"/"+s.id;return s.current_iteration&&s.current_iteration>0&&(t="$survey_"+e+"/"+s.id+"/"+s.current_iteration),t},ha=s=>{var e=""+Yr+s.id;return s.current_iteration&&s.current_iteration>0&&(e=""+Yr+s.id+"_"+s.current_iteration),e},Du=[br.Popover,br.Widget,br.API],Lu={ignoreConditions:!1,ignoreDelay:!1,displayType:Vo.Popover};class Nu{constructor(e){this._instance=e,this.ji=new Map,this.Di=new Map}register(e){var t;y((t=this._instance)==null?void 0:t.Ri)||(this.Li(e),this.Ni(e))}Ni(e){var t=e.filter(i=>{var r,n;return((r=i.conditions)==null?void 0:r.actions)&&((n=i.conditions)==null||(n=n.actions)==null||(n=n.values)==null?void 0:n.length)>0});t.length!==0&&(this.Ui==null&&(this.Ui=new ui(this._instance),this.Ui.init(),this.Ui.Oi(i=>{this.onAction(i)})),t.forEach(i=>{var r,n,a,o,l;i.conditions&&(r=i.conditions)!=null&&r.actions&&(n=i.conditions)!=null&&(n=n.actions)!=null&&n.values&&((a=i.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((o=this.Ui)==null||o.register(i.conditions.actions.values),(l=i.conditions)==null||(l=l.actions)==null||(l=l.values)==null||l.forEach(c=>{if(c&&c.name){var u=this.Di.get(c.name);u&&u.push(i.id),this.Di.set(c.name,u||[i.id])}}))}))}Li(e){var t;e.filter(i=>{var r,n;return((r=i.conditions)==null?void 0:r.events)&&((n=i.conditions)==null||(n=n.events)==null||(n=n.values)==null?void 0:n.length)>0}).length!==0&&((t=this._instance)==null||t.Ri((i,r)=>{this.onEvent(i,r)}),e.forEach(i=>{var r;(r=i.conditions)==null||(r=r.events)==null||(r=r.values)==null||r.forEach(n=>{if(n&&n.name){var a=this.ji.get(n.name);a&&a.push(i.id),this.ji.set(n.name,a||[i.id])}})}))}onEvent(e,t){var i,r,n=((i=this._instance)==null||(i=i.persistence)==null?void 0:i.props[_s])||[];if(Is.SHOWN===e&&t&&n.length>0){var a;te.info("survey event matched, removing survey from activated surveys",{event:e,eventPayload:t,existingActivatedSurveys:n});var o=t==null||(a=t.properties)==null?void 0:a.$survey_id;if(o){var l=n.indexOf(o);l>=0&&(n.splice(l,1),this.zi(n))}}else if(this.ji.has(e)){te.info("survey event name matched",{event:e,eventPayload:t,surveys:this.ji.get(e)});var c=[];(r=this._instance)==null||r.getSurveys(h=>{c=h.filter(v=>{var g;return(g=this.ji.get(e))==null?void 0:g.includes(v.id)})});var u=c.filter(h=>{var v,g=(v=h.conditions)==null||(v=v.events)==null||(v=v.values)==null?void 0:v.find(p=>p.name===e);return!!g&&(!g.propertyFilters||Object.entries(g.propertyFilters).every(p=>{var _,[m,b]=p,I=t==null||(_=t.properties)==null?void 0:_[m];if(y(I)||Gt(I))return!1;var M=[String(I)],D=Go[b.operator];return D?D(b.values,M):(te.warn("Unknown property comparison operator: "+b.operator),!1)}))});this.zi(n.concat(u.map(h=>h.id)||[]))}}onAction(e){var t,i=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[_s])||[];this.Di.has(e)&&this.zi(i.concat(this.Di.get(e)||[]))}zi(e){var t;te.info("updating activated surveys",{activatedSurveys:e}),(t=this._instance)==null||(t=t.persistence)==null||t.register({[_s]:[...new Set(e)]})}getSurveys(){var e,t=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[_s];return t||[]}getEventToSurveys(){return this.ji}Hi(){return this.Ui}}class Bu{constructor(e){this.Bi=void 0,this._surveyManager=null,this.qi=!1,this.Wi=!1,this.Gi=[],this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(ue(t))return te.warn("Flags not loaded yet. Not loading surveys.");var i=le(t);this.Bi=i?t.length>0:t,te.info("flags response received, isSurveysEnabled: "+this.Bi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(i!=null&&i.startsWith(Yr)||i!=null&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach(r=>localStorage.removeItem(r))}loadIfEnabled(){if(!this._surveyManager)if(this.Wi)te.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)te.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())te.info("Not loading surveys in cookieless mode without consent.");else{var e=L==null?void 0:L.__PosthogExtensions__;if(e){if(!y(this.Bi)||this._instance.config.advanced_enable_surveys){var t=this.Bi||this._instance.config.advanced_enable_surveys;this.Wi=!0;try{var i=e.generateSurveys;if(i)return void this.Vi(i,t);var r=e.loadExternalDependency;if(!r)return void this.Ji("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",n=>{n||!e.generateSurveys?this.Ji("Could not load surveys script",n):this.Vi(e.generateSurveys,t)})}catch(n){throw this.Ji("Error initializing surveys",n),n}finally{this.Wi=!1}}}else te.error("PostHog Extensions not found.")}}Vi(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new Nu(this._instance),te.info("Surveys loaded successfully"),this.Ki({isLoaded:!0})}Ji(e,t){te.error(e,t),this.Ki({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Gi.push(e),this._surveyManager&&this.Ki({isLoaded:!0}),()=>{this.Gi=this.Gi.filter(t=>t!==e)}}getSurveys(e,t){if(t===void 0&&(t=!1),this._instance.config.disable_surveys)return te.info("Disabled. Not loading surveys."),e([]);var i=this._instance.get_property(Lr);if(i&&!t)return e(i,{isLoaded:!0});if(this.qi)return e([],{isLoaded:!1,error:"Surveys are already being loaded"});try{this.qi=!0,this._instance.ui({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:r=>{var n;this.qi=!1;var a=r.statusCode;if(a!==200||!r.json){var o="Surveys API could not be loaded, status: "+a;return te.error(o),e([],{isLoaded:!1,error:o})}var l,c=r.json.surveys||[],u=c.filter(h=>function(v){return!(!v.start_date||v.end_date)}(h)&&(function(v){var g;return!((g=v.conditions)==null||(g=g.events)==null||(g=g.values)==null||!g.length)}(h)||function(v){var g;return!((g=v.conditions)==null||(g=g.actions)==null||(g=g.values)==null||!g.length)}(h)));return u.length>0&&((l=this._surveyEventReceiver)==null||l.register(u)),(n=this._instance.persistence)==null||n.register({[Lr]:c}),e(c,{isLoaded:!0})}})}catch(r){throw this.qi=!1,r}}Ki(e){for(var t of this.Gi)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(i){te.error("Error in survey callback",i)}}getActiveMatchingSurveys(e,t){if(t===void 0&&(t=!1),!ue(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);te.warn("init was not called")}Yi(e){var t=null;return this.getSurveys(i=>{var r;t=(r=i.find(n=>n.id===e))!==null&&r!==void 0?r:null}),t}Xi(e){if(ue(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t=typeof e=="string"?this.Yi(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(ue(this._surveyManager))return te.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.Xi(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return ue(this._surveyManager)?(te.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(i=>{this.getSurveys(r=>{var n,a=(n=r.find(l=>l.id===e))!==null&&n!==void 0?n:null;if(a){var o=this.Xi(a);i({visible:o.eligible,disabledReason:o.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t){var i;if(ue(this._surveyManager))te.warn("init was not called");else{var r=typeof e=="string"?this.Yi(e):e;if(r!=null&&r.id)if(Du.includes(r.type)){var n=x==null?void 0:x.querySelector(t);if(n)return(i=r.appearance)!=null&&i.surveyPopupDelaySeconds?(te.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var a,o;te.info("Rendering survey "+r.id+" with delay of "+((a=r.appearance)==null?void 0:a.surveyPopupDelaySeconds)+" seconds"),(o=this._surveyManager)==null||o.renderSurvey(r,n),te.info("Survey "+r.id+" rendered")},1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,n);te.warn("Survey element not found")}else te.warn("Surveys of type "+r.type+" cannot be rendered in the app");else te.warn("Survey not found")}}displaySurvey(e,t){var i;if(ue(this._surveyManager))te.warn("init was not called");else{var r=this.Yi(e);if(r){var n=r;if((i=r.appearance)!=null&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(n=S({},r,{appearance:S({},r.appearance,{surveyPopupDelaySeconds:0})})),t.ignoreConditions===!1){var a=this.canRenderSurvey(r);if(!a.visible)return void te.warn("Survey is not eligible to be displayed: ",a.disabledReason)}t.displayType!==Vo.Inline?this._surveyManager.handlePopoverSurvey(n):this.renderSurvey(n,t.selector)}else te.warn("Survey not found")}}}var fa=Fe("[RateLimiter]");class ju{constructor(e){var t,i;this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=r=>{var n=r.text;if(n&&n.length)try{(JSON.parse(n).quota_limited||[]).forEach(a=>{fa.info((a||"events")+" is quota limited."),this.serverLimits[a]=new Date().getTime()+6e4})}catch(a){return void fa.warn('could not rate limit - continuing. Error: "'+(a==null?void 0:a.message)+'"',{text:n})}},this.instance=e,this.captureEventsPerSecond=((t=e.config.rate_limiting)==null?void 0:t.events_per_second)||10,this.captureEventsBurstLimit=Math.max(((i=e.config.rate_limiting)==null?void 0:i.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}clientRateLimitContext(e){var t,i,r;e===void 0&&(e=!1);var n=new Date().getTime(),a=(t=(i=this.instance.persistence)==null?void 0:i.get_property(Br))!==null&&t!==void 0?t:{tokens:this.captureEventsBurstLimit,last:n};a.tokens+=(n-a.last)/1e3*this.captureEventsPerSecond,a.last=n,a.tokens>this.captureEventsBurstLimit&&(a.tokens=this.captureEventsBurstLimit);var o=a.tokens<1;return o||e||(a.tokens=Math.max(0,a.tokens-1)),!o||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+this.captureEventsPerSecond+" events per second and "+this.captureEventsBurstLimit+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=o,(r=this.instance.persistence)==null||r.set_property(Br,a),{isRateLimited:o,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var oi=Fe("[RemoteConfig]");class qu{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=L._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Qi(e){var t,i;(t=L.__PosthogExtensions__)!=null&&t.loadExternalDependency?(i=L.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(oi.error("PostHog Extensions not found. Cannot load remote config."),e())}Zi(e){this._instance.ui({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 oi.info("Using preloaded remote config",this.remoteConfig),void this.hi(this.remoteConfig);if(this._instance.L())return void oi.warn("Remote config is disabled. Falling back to local config.");this.Qi(e=>{if(!e)return oi.info("No config found after loading remote JS config. Falling back to JSON."),void this.Zi(t=>{this.hi(t)});this.hi(e)})}catch(e){oi.error("Error loading remote config",e)}}hi(e){e?this._instance.config.__preview_remote_config?(this._instance.hi(e),e.hasFeatureFlags!==!1&&this._instance.featureFlags.ensureFlagsLoaded()):oi.info("__preview_remote_config is disabled. Logging config instead",e):oi.error("Failed to fetch remote config from PostHog.")}}var Kr=3e3;class Hu{constructor(e,t){this.te=!0,this.ie=[],this.ee=Pt((t==null?void 0:t.flush_interval_ms)||Kr,250,5e3,w.createLogger("flush interval"),Kr),this.re=e}enqueue(e){this.ie.push(e),this.se||this.ne()}unload(){this.oe();var e=this.ie.length>0?this.ae():{},t=Object.values(e);[...t.filter(i=>i.url.indexOf("/e")===0),...t.filter(i=>i.url.indexOf("/e")!==0)].map(i=>{this.re(S({},i,{transport:"sendBeacon"}))})}enable(){this.te=!1,this.ne()}ne(){var e=this;this.te||(this.se=setTimeout(()=>{if(this.oe(),this.ie.length>0){var t=this.ae(),i=function(){var n=t[r],a=new Date().getTime();n.data&&le(n.data)&&oe(n.data,o=>{o.offset=Math.abs(o.timestamp-a),delete o.timestamp}),e.re(n)};for(var r in t)i()}},this.ee))}oe(){clearTimeout(this.se),this.se=void 0}ae(){var e={};return oe(this.ie,t=>{var i,r=t,n=(r?r.batchKey:null)||r.url;y(e[n])&&(e[n]=S({},r,{data:[]})),(i=e[n].data)==null||i.push(r.data)}),this.ie=[],e}}var Uu=["retriesPerformedSoFar"];class Gu{constructor(e){this.le=!1,this.ue=3e3,this.ie=[],this._instance=e,this.ie=[],this.he=!0,!y(f)&&"onLine"in f.navigator&&(this.he=f.navigator.onLine,Pe(f,"online",()=>{this.he=!0,this.jt()}),Pe(f,"offline",()=>{this.he=!1}))}get length(){return this.ie.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=ja(e,Uu);Ct(t)&&t>0&&(i.url=Gs(i.url,{retry_count:t})),this._instance.ui(S({},i,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(t??0)<10?this.de(S({retriesPerformedSoFar:t},i)):i.callback==null||i.callback(r)}}))}de(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(a){var o=3e3*Math.pow(2,a),l=o/2,c=Math.min(18e5,o),u=(Math.random()-.5)*(c-l);return Math.ceil(c+u)}(t),r=Date.now()+i;this.ie.push({retryAt:r,requestOptions:e});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),w.warn(n),this.le||(this.le=!0,this.ve())}ve(){this.ce&&clearTimeout(this.ce),this.ce=setTimeout(()=>{this.he&&this.ie.length>0&&this.jt(),this.ve()},this.ue)}jt(){var e=Date.now(),t=[],i=this.ie.filter(n=>n.retryAt<e||(t.push(n),!1));if(this.ie=t,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.ce&&(clearTimeout(this.ce),this.ce=void 0),this.ie))try{this._instance.ui(S({},e,{transport:"sendBeacon"}))}catch(t){w.error(t)}this.ie=[]}}class Vu{constructor(e){this.fe=()=>{var t,i,r,n;this.pe||(this.pe={});var a=this.scrollElement(),o=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=o+((a==null?void 0:a.clientHeight)||0),u=(a==null?void 0:a.scrollHeight)||0;this.pe.lastScrollY=Math.ceil(o),this.pe.maxScrollY=Math.max(o,(t=this.pe.maxScrollY)!==null&&t!==void 0?t:0),this.pe.maxScrollHeight=Math.max(l,(i=this.pe.maxScrollHeight)!==null&&i!==void 0?i:0),this.pe.lastContentY=c,this.pe.maxContentY=Math.max(c,(r=this.pe.maxContentY)!==null&&r!==void 0?r:0),this.pe.maxContentHeight=Math.max(u,(n=this.pe.maxContentHeight)!==null&&n!==void 0?n:0)},this._instance=e}getContext(){return this.pe}resetContext(){var e=this.pe;return setTimeout(this.fe,0),e}startMeasuringScrollPosition(){Pe(f,"scroll",this.fe,{capture:!0}),Pe(f,"scrollend",this.fe,{capture:!0}),Pe(f,"resize",this.fe)}scrollElement(){if(!this._instance.config.scroll_root_selector)return f==null?void 0:f.document.documentElement;var e=le(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var t of e){var i=f==null?void 0:f.document.querySelector(t);if(i)return i}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return f&&(f.scrollY||f.pageYOffset||f.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return f&&(f.scrollX||f.pageXOffset||f.document.documentElement.scrollLeft)||0}}var Wu=s=>Do(s==null?void 0:s.config.mask_personal_data_properties,s==null?void 0:s.config.custom_personal_data_properties);class ga{constructor(e,t,i,r){this.ge=n=>{var a=this._e();if(!a||a.sessionId!==n){var o={sessionId:n,props:this.me(this._instance)};this.ye.register({[Nr]:o})}},this._instance=e,this.be=t,this.ye=i,this.me=r||Wu,this.be.onSessionId(this.ge)}_e(){return this.ye.props[Nr]}getSetOnceProps(){var e,t=(e=this._e())==null?void 0:e.props;return t?"r"in t?Lo(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 oe($r(this.getSetOnceProps()),(t,i)=>{i==="$current_url"&&(i="url"),e["$session_entry_"+Or(i)]=t}),e}}var wr=Fe("[SessionId]");class va{on(e,t){return this.we.on(e,t)}constructor(e,t,i){var r;if(this.xe=[],this.Se=void 0,this.we=new un,this.Ee=(u,h)=>Math.abs(u-h)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.A=e.config,this.ye=e.persistence,this.$e=void 0,this.ke=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Pe=t||Jt,this.Te=i||Jt;var n=this.A.persistence_name||this.A.token,a=this.A.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*Pt(a,60,36e3,wr.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Ie(),this.Re="ph_"+n+"_window_id",this.Ce="ph_"+n+"_primary_window_exists",this.Oe()){var o=Be.K(this.Re),l=Be.K(this.Ce);o&&!l?this.$e=o:Be.X(this.Re),Be.Y(this.Ce,!0)}if((r=this.A.bootstrap)!=null&&r.sessionID)try{var c=(u=>{var h=u.replace(/-/g,"");if(h.length!==32)throw new Error("Not a valid UUID");if(h[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(h.substring(0,12),16)})(this.A.bootstrap.sessionID);this.Fe(this.A.bootstrap.sessionID,new Date().getTime(),c)}catch(u){wr.error("Invalid sessionID in bootstrap",u)}this.Me()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return y(this.xe)&&(this.xe=[]),this.xe.push(e),this.ke&&e(this.ke,this.$e),()=>{this.xe=this.xe.filter(t=>t!==e)}}Oe(){return this.A.persistence!=="memory"&&!this.ye.gi&&Be.G()}Ae(e){e!==this.$e&&(this.$e=e,this.Oe()&&Be.Y(this.Re,e))}je(){return this.$e?this.$e:this.Oe()?Be.K(this.Re):null}Fe(e,t,i){e===this.ke&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.ke=e,this.ye.register({[As]:[t,e,i]}))}De(){if(this.ke&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this.ke,this._sessionStartTimestamp];var e=this.ye.props[As];return le(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Fe(null,null,null)}destroy(){clearTimeout(this.Le),this.Le=void 0,this.Se&&f&&(f.removeEventListener("beforeunload",this.Se,{capture:!1}),this.Se=void 0),this.xe=[]}Me(){this.Se=()=>{this.Oe()&&Be.X(this.Ce)},Pe(f,"beforeunload",this.Se,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.A.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||new Date().getTime(),[r,n,a]=this.De(),o=this.je(),l=Ct(a)&&a>0&&Math.abs(i-a)>864e5,c=!1,u=!n,h=!e&&this.Ee(i,r);u||h||l?(n=this.Pe(),o=this.Te(),wr.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:l}}),a=i,c=!0):o||(o=this.Te(),c=!0);var v=r===0||!e||l?i:r,g=a===0?new Date().getTime():a;return this.Ae(o),this.Fe(n,v,g),e||this.Ie(),c&&this.xe.forEach(p=>p(n,o,c?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:l}:void 0)),{sessionId:n,windowId:o,sessionStartTimestamp:g,changeReason:c?{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:l}:void 0,lastActivityTimestamp:r}}Ie(){clearTimeout(this.Le),this.Le=setTimeout(()=>{var[e]=this.De();if(this.Ee(new Date().getTime(),e)){var t=this.ke;this.resetSessionId(),this.we.emit("forcedIdleReset",{idleSessionId:t})}},1.1*this.sessionTimeoutMs)}}var zu=["$set_once","$set"],zt=Fe("[SiteApps]");class Qu{constructor(e){this._instance=e,this.Ne=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Ue(e,t){if(t){var i=this.globalsForEvent(t);this.Ne.push(i),this.Ne.length>1e3&&(this.Ne=this.Ne.slice(10))}}get siteAppLoaders(){var e;return(e=L._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance.Ri(this.Ue.bind(this));this.ze=()=>{e(),this.Ne=[],this.ze=void 0}}}globalsForEvent(e){var t,i,r,n,a,o,l;if(!e)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var[v,g]of Object.entries(h))c[v]={id:u[v],type:v,properties:g};var{$set_once:p,$set:_}=e;return{event:S({},ja(e,zu),{properties:S({},e.properties,_?{$set:S({},(t=(i=e.properties)==null?void 0:i.$set)!==null&&t!==void 0?t:{},_)}:{},p?{$set_once:S({},(r=(n=e.properties)==null?void 0:n.$set_once)!==null&&r!==void 0?r:{},p)}:{}),elements_chain:(a=(o=e.properties)==null?void 0:o.$elements_chain)!==null&&a!==void 0?a:"",distinct_id:(l=e.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var o;!t.errored&&this.Ne.length&&(zt.info("Processing "+this.Ne.length+" events for site app with id "+e.id),this.Ne.forEach(l=>t.processEvent==null?void 0:t.processEvent(l)),t.processedBuffer=!0),Object.values(this.apps).every(l=>l.processedBuffer||l.errored)&&((o=this.ze)==null||o.call(this))},r=!1,n=o=>{t.errored=!o,t.loaded=!0,zt.info("Site app with id "+e.id+" "+(o?"loaded":"errored")),r&&i()};try{var{processEvent:a}=e.init({posthog:this._instance,callback:o=>{n(o)}});a&&(t.processEvent=a),r=!0}catch(o){zt.error("Error while initializing PostHog app with config id "+e.id,o),n(!1)}if(r&&t.loaded)try{i()}catch(o){zt.error("Error while processing buffered events PostHog app with config id "+e.id,o),t.errored=!0}}He(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}Be(e){if(Object.keys(this.apps).length!==0){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{i.processEvent==null||i.processEvent(t)}catch(r){zt.error("Error while processing event "+e.event+" for site app "+i.id,r)}}}onRemoteConfig(e){var t,i,r,n=this;if((t=this.siteAppLoaders)!=null&&t.length)return this.isEnabled?(this.He(),void this._instance.on("eventCaptured",c=>this.Be(c))):void zt.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((i=this.ze)==null||i.call(this),(r=e.siteApps)!=null&&r.length)if(this.isEnabled){var a=function(c){var u;L["__$$ph_site_app_"+c]=n._instance,(u=L.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(n._instance,l,h=>{if(h)return zt.error("Error while initializing PostHog app with config id "+c,h)})};for(var{id:o,url:l}of e.siteApps)a(o)}else zt.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var Yu=["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"],pa=function(s,e){if(!s)return!1;var t=s.toLowerCase();return Yu.concat(e||[]).some(i=>{var r=i.toLowerCase();return t.indexOf(r)!==-1})},Wo=function(s,e){if(!s)return!1;var t=s.userAgent;if(t&&pa(t,e))return!0;try{var i=s==null?void 0:s.userAgentData;if(i!=null&&i.brands&&i.brands.some(r=>pa(r==null?void 0:r.brand,e)))return!0}catch{}return!!s.webdriver},es=function(s){return s.US="us",s.EU="eu",s.CUSTOM="custom",s}({}),_a="i.posthog.com";class Ku{constructor(e){this.qe={},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 uiHost(){var e,t=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+_a,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.qe[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.qe[this.apiHost]=es.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.qe[this.apiHost]=es.EU:this.qe[this.apiHost]=es.CUSTOM),this.qe[this.apiHost]}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(this.region===es.CUSTOM)return this.apiHost+t;var i=_a+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var Xu={icontains:(s,e)=>!!f&&e.href.toLowerCase().indexOf(s.toLowerCase())>-1,not_icontains:(s,e)=>!!f&&e.href.toLowerCase().indexOf(s.toLowerCase())===-1,regex:(s,e)=>!!f&&Mi(e.href,s),not_regex:(s,e)=>!!f&&!Mi(e.href,s),exact:(s,e)=>e.href===s,is_not:(s,e)=>e.href!==s};class He{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(i){i===void 0&&(i=!1),t.getWebExperiments(r=>{He.We("retrieved web experiments from the server"),t.Ge=new Map,r.forEach(n=>{if(n.feature_flag_key){var a;t.Ge&&(He.We("setting flag key ",n.feature_flag_key," to web experiment ",n),(a=t.Ge)==null||a.set(n.feature_flag_key,n));var o=t._instance.getFeatureFlag(n.feature_flag_key);Se(o)&&n.variants[o]&&t.Ve(n.name,o,n.variants[o].transforms)}else if(n.variants)for(var l in n.variants){var c=n.variants[l];He.Je(c)&&t.Ve(n.name,l,c.transforms)}})},i)},this._instance=e,this._instance.onFeatureFlags(i=>{this.onFeatureFlags(i)})}onFeatureFlags(e){if(this._is_bot())He.We("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(ue(this.Ge))return this.Ge=new Map,this.loadIfEnabled(),void this.previewWebExperiment();He.We("applying feature flags",e),e.forEach(t=>{var i;if(this.Ge&&(i=this.Ge)!=null&&i.has(t)){var r,n=this._instance.getFeatureFlag(t),a=(r=this.Ge)==null?void 0:r.get(t);n&&a!=null&&a.variants[n]&&this.Ve(a.name,n,a.variants[n].transforms)}})}}previewWebExperiment(){var e=He.getWindowLocation();if(e!=null&&e.search){var t=Bs(e==null?void 0:e.search,"__experiment_id"),i=Bs(e==null?void 0:e.search,"__experiment_variant");t&&i&&(He.We("previewing web experiments "+t+" && "+i),this.getWebExperiments(r=>{this.Ke(parseInt(t),i,r)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance.ui({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:n=>{if(n.statusCode!==200||!n.json)return e([]);var a=n.json.experiments||[];return e(a)}})}Ke(e,t,i){var r=i.filter(n=>n.id===e);r&&r.length>0&&(He.We("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.Ve(r[0].name,t,r[0].variants[t].transforms))}static Je(e){return!ue(e.conditions)&&He.Ye(e)&&He.Xe(e)}static Ye(e){var t;if(ue(e.conditions)||ue((t=e.conditions)==null?void 0:t.url))return!0;var i,r,n,a=He.getWindowLocation();return!!a&&((i=e.conditions)==null||!i.url||Xu[(r=(n=e.conditions)==null?void 0:n.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,a))}static getWindowLocation(){return f==null?void 0:f.location}static Xe(e){var t;if(ue(e.conditions)||ue((t=e.conditions)==null?void 0:t.utm))return!0;var i=Fo();if(i.utm_source){var r,n,a,o,l,c,u,h,v=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((n=e.conditions)==null||(n=n.utm)==null?void 0:n.utm_campaign)==i.utm_campaign,g=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((o=e.conditions)==null||(o=o.utm)==null?void 0:o.utm_source)==i.utm_source,p=(l=e.conditions)==null||(l=l.utm)==null||!l.utm_medium||((c=e.conditions)==null||(c=c.utm)==null?void 0:c.utm_medium)==i.utm_medium,_=(u=e.conditions)==null||(u=u.utm)==null||!u.utm_term||((h=e.conditions)==null||(h=h.utm)==null?void 0:h.utm_term)==i.utm_term;return v&&p&&_&&g}return!1}static We(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;r<t;r++)i[r-1]=arguments[r];w.info("[WebExperiments] "+e,i)}Ve(e,t,i){this._is_bot()?He.We("Refusing to render web experiment since the viewer is a likely bot"):t!=="control"?i.forEach(r=>{if(r.selector){var n;He.We("applying transform of variant "+t+" for experiment "+e+" ",r);var a=(n=document)==null?void 0:n.querySelectorAll(r.selector);a==null||a.forEach(o=>{var l=o;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)})}}):He.We("Control variants leave the page unmodified.")}_is_bot(){return at&&this._instance?Wo(at,this._instance.config.custom_blocked_useragents):void 0}}var Ju=Fe("[PostHog ExternalIntegrations]"),Zu={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class $u{constructor(e){this._instance=e}nt(e,t){var i;(i=L.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,e,r=>{if(r)return Ju.error("failed to load script",r);t()})}startIfEnabledOrStop(){var e=this,t=function(a){var o,l,c;!r||(o=L.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[a]||e.nt(Zu[a],()=>{var u;(u=L.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.start(e._instance)}),!r&&(l=L.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((c=L.__PosthogExtensions__)==null||(c=c.integrations)==null||(c=c[a])==null||c.stop())};for(var[i,r]of Object.entries((n=this._instance.config.integrations)!==null&&n!==void 0?n:{})){var n;t(i)}}}var Xr="[SessionRecording]",Qi=Fe(Xr);class ma{get started(){var e;return!((e=this.Qe)==null||!e.isStarted)}get status(){return this.Qe?this.Qe.status:this.Ze&&!this.tr?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Ze=!1,this.ir=void 0,this._instance=e,!this._instance.sessionManager)throw Qi.error("started without valid sessionManager"),new Error(Xr+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Xr+' cannot be used with cookieless_mode="always"')}get tr(){var e,t=!((e=this._instance.get_property(cr))==null||!e.enabled),i=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return f&&t&&i&&!r}startIfEnabledOrStop(e){var t;if(!this.tr||(t=this.Qe)==null||!t.isStarted){var i=!y(Object.assign)&&!y(Array.from);this.tr&&i?(this.er(e),Qi.info("starting")):this.stopRecording()}}er(e){var t,i,r;this.tr&&(L!=null&&(t=L.__PosthogExtensions__)!=null&&(t=t.rrweb)!=null&&t.record&&(i=L.__PosthogExtensions__)!=null&&i.initSessionRecording?this.rr(e):(r=L.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this._instance,this.sr,n=>{if(n)return Qi.error("could not load recorder",n);this.rr(e)}))}stopRecording(){var e,t;(e=this.ir)==null||e.call(this),this.ir=void 0,(t=this.Qe)==null||t.stop()}nr(){var e;(e=this._instance.persistence)==null||e.unregister(Ka)}ar(e){if(this._instance.persistence){var t,i,r=this._instance.persistence,n=()=>{var a=e.sessionRecording===!1?void 0:e.sessionRecording,o=a==null?void 0:a.sampleRate,l=ue(o)?null:parseFloat(o);ue(l)&&this.nr();var c=a==null?void 0:a.minimumDurationMilliseconds;r.register({[cr]:S({enabled:!!a},a,{networkPayloadCapture:S({capturePerformance:e.capturePerformance},a==null?void 0:a.networkPayloadCapture),canvasRecording:{enabled:a==null?void 0:a.recordCanvas,fps:a==null?void 0:a.canvasFps,quality:a==null?void 0:a.canvasQuality},sampleRate:l,minimumDurationMilliseconds:y(c)?null:c,endpoint:a==null?void 0:a.endpoint,triggerMatchType:a==null?void 0:a.triggerMatchType,masking:a==null?void 0:a.masking,urlTriggers:a==null?void 0:a.urlTriggers})})};n(),(t=this.ir)==null||t.call(this),this.ir=(i=this._instance.sessionManager)==null?void 0:i.onSessionId(n)}}onRemoteConfig(e){"sessionRecording"in e?e.sessionRecording!==!1?(this.ar(e),this.Ze=!0,this.startIfEnabledOrStop()):this.Ze=!0:Qi.info("skipping remote config with no sessionRecording",e)}log(e,t){var i;t===void 0&&(t="log"),(i=this.Qe)!=null&&i.log?this.Qe.log(e,t):Qi.warn("log called before recorder was ready")}get sr(){var e,t,i=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.get_property(cr);return(i==null||(t=i.scriptConfig)==null?void 0:t.script)||"lazy-recorder"}rr(e){var t,i;if((t=L.__PosthogExtensions__)==null||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.Qe||(this.Qe=(i=L.__PosthogExtensions__)==null?void 0:i.initSessionRecording(this._instance),this.Qe._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Qe.start(e)}onRRwebEmit(e){var t;(t=this.Qe)==null||t.onRRwebEmit==null||t.onRRwebEmit(e)}overrideLinkedFlag(){var e;(e=this.Qe)==null||e.overrideLinkedFlag()}overrideSampling(){var e;(e=this.Qe)==null||e.overrideSampling()}overrideTrigger(e){var t;(t=this.Qe)==null||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return((e=this.Qe)==null?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!((i=this.Qe)==null||!i.tryAddCustomEvent(e,t))}}var is={},Jr=()=>{},bi="posthog",zo=!Tu&&(Ke==null?void 0:Ke.indexOf("MSIE"))===-1&&(Ke==null?void 0:Ke.indexOf("Mozilla"))===-1,ya=s=>{var e;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:kc(x==null?void 0:x.location),persistence:"localStorage+cookie",persistence_name:"",loaded:Jr,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:s!=="2025-05-24"||"history_change",capture_pageleave:"if_capture_pageview",defaults:s??"unset",debug:Xe&&Se(Xe==null?void 0:Xe.search)&&Xe.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_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(f==null||(e=f.location)==null?void 0:e.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,session_recording:{},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_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:t=>{var i="Bad HTTP status: "+t.statusCode+" "+t.text;w.error(i)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Kr},error_tracking:{},_onCapture:Jr,__preview_eager_load_replay:!1}},ba=s=>{var e={};y(s.process_person)||(e.person_profiles=s.process_person),y(s.xhr_headers)||(e.request_headers=s.xhr_headers),y(s.cookie_name)||(e.persistence_name=s.cookie_name),y(s.disable_cookie)||(e.disable_persistence=s.disable_cookie),y(s.store_google)||(e.save_campaign_params=s.store_google),y(s.verbose)||(e.debug=s.verbose);var t=ye({},e,s);return le(s.property_blacklist)&&(y(s.property_denylist)?t.property_denylist=s.property_blacklist:le(s.property_denylist)?t.property_denylist=[...s.property_blacklist,...s.property_denylist]:w.error("Invalid value for property_denylist config: "+s.property_denylist)),t};class ed{constructor(){this.__forceAllowLocalhost=!1}get lr(){return this.__forceAllowLocalhost}set lr(e){w.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Xs{get decideEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,t;return(e=(t=this.featureFlags)==null?void 0:t.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new ed,this.ur=!1,this.version=Lt.LIB_VERSION,this.hr=new un,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ya(),this.SentryIntegration=Jc,this.sentryIntegration=e=>function(t,i){var r=go(t,i);return{name:fo,processEvent:n=>r(n)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.dr=!1,this.vr=null,this.cr=null,this.pr=null,this.featureFlags=new Au(this),this.toolbar=new $c(this),this.scrollManager=new Vu(this),this.pageViewManager=new yu(this),this.surveys=new Bu(this),this.experiments=new He(this),this.exceptions=new Ou(this),this.rateLimiter=new ju(this),this.requestRouter=new Ku(this),this.consent=new Wc(this),this.externalIntegrations=new $u(this),this.people={set:(e,t,i)=>{var r=Se(e)?{[e]:t}:e;this.setPersonProperties(r),i==null||i({})},set_once:(e,t,i)=>{var r=Se(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),i==null||i({})}},this.on("eventCaptured",e=>w.info('send "'+(e==null?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==bi){var r,n=(r=is[i])!==null&&r!==void 0?r:new Xs;return n._init(e,t,i),is[i]=n,is[bi][i]=n,n}return this._init(e,t,i)}_init(e,t,i){var r,n;if(t===void 0&&(t={}),y(e)||Cr(e))return w.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={},t.debug=this.gr(t.debug),this._r=t,this.mr=[],t.person_profiles&&(this.cr=t.person_profiles),this.set_config(ye({},ya(t.defaults),ba(t),{name:i,token:e})),this.config.on_xhr_error&&w.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Ht.GZipJS;var a=this.yr();this.persistence=new yr(this.config,a),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new yr(S({},this.config,{persistence:"sessionStorage"}),a);var o=S({},this.persistence.props),l=S({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.br=new Hu(M=>this.wr(M),this.config.request_queue_config),this.Sr=new Gu(this),this.__request_queue=[];var c=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(c||(this.sessionManager=new va(this),this.sessionPropsManager=new ga(this,this.sessionManager,this.persistence)),new tu(this).startIfEnabledOrStop(),this.siteApps=new Qu(this),(r=this.siteApps)==null||r.init(),c||(this.sessionRecording=new ma(this),this.sessionRecording.startIfEnabledOrStop()),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new Nc(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new mu(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new pu(this),this.exceptionObserver=new Yc(this),this.exceptionObserver.startIfEnabled(),this.deadClicksAutocapture=new ho(this,Qc),this.deadClicksAutocapture.startIfEnabled(),this.historyAutocapture=new Kc(this),this.historyAutocapture.startIfEnabled(),Lt.DEBUG=Lt.DEBUG||this.config.debug,Lt.DEBUG&&w.info("Starting in debug mode",{this:this,config:t,thisC:S({},this.config),p:o,s:l}),((n=t.bootstrap)==null?void 0:n.distinctID)!==void 0){var u,h,v=this.config.get_device_id(Jt()),g=(u=t.bootstrap)!=null&&u.isIdentifiedID?v:t.bootstrap.distinctID;this.persistence.set_property(Nt,(h=t.bootstrap)!=null&&h.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:g})}if(this.Er()){var p,_,m=Object.keys(((p=t.bootstrap)==null?void 0:p.featureFlags)||{}).filter(M=>{var D;return!((D=t.bootstrap)==null||(D=D.featureFlags)==null||!D[M])}).reduce((M,D)=>{var U;return M[D]=((U=t.bootstrap)==null||(U=U.featureFlags)==null?void 0:U[D])||!1,M},{}),b=Object.keys(((_=t.bootstrap)==null?void 0:_.featureFlagPayloads)||{}).filter(M=>m[M]).reduce((M,D)=>{var U,C;return(U=t.bootstrap)!=null&&(U=U.featureFlagPayloads)!=null&&U[D]&&(M[D]=(C=t.bootstrap)==null||(C=C.featureFlagPayloads)==null?void 0:C[D]),M},{});this.featureFlags.receivedFeatureFlags({featureFlags:m,featureFlagPayloads:b})}if(c)this.register_once({distinct_id:Hi,$device_id:null},"");else if(!this.get_distinct_id()){var I=this.config.get_device_id(Jt());this.register_once({distinct_id:I,$device_id:I},""),this.persistence.set_property(Nt,"anonymous")}return Pe(f,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?Xc(this,()=>this.$r()):this.$r(),Zt(this.config._onCapture)&&this.config._onCapture!==Jr&&(w.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",M=>this.config._onCapture(M.event,M))),this.config.ip&&w.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}hi(e){var t,i,r,n,a,o,l,c;if(!x||!x.body)return w.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.hi(e)},500);this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Y(e.supportedCompression,Ht.GZipJS)?Ht.GZipJS:Y(e.supportedCompression,Ht.Base64)?Ht.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.cr?this.cr:"identified_only"}),(i=this.siteApps)==null||i.onRemoteConfig(e),(r=this.sessionRecording)==null||r.onRemoteConfig(e),(n=this.autocapture)==null||n.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),(o=this.webVitalsAutocapture)==null||o.onRemoteConfig(e),(l=this.exceptionObserver)==null||l.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(c=this.deadClicksAutocapture)==null||c.onRemoteConfig(e)}$r(){try{this.config.loaded(this)}catch(e){w.critical("`loaded` function failed",e)}this.kr(),this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.Pr()},1),new qu(this).load(),this.featureFlags.flags()}kr(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.br)==null||e.enable())}_dom_loaded(){this.is_capturing()&&ei(this.__request_queue,e=>this.wr(e)),this.__request_queue=[],this.kr()}_handle_unload(){var e,t;this.config.request_batching?(this.Tr()&&this.capture("$pageleave"),(e=this.br)==null||e.unload(),(t=this.Sr)==null||t.unload()):this.Tr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}ui(e){this.__loaded&&(zo?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=Gs(e.url,{ip:this.config.ip?1:0}),e.headers=S({},this.config.request_headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(t=>{var i,r,n,a=S({},t);a.timeout=a.timeout||6e4,a.url=Gs(a.url,{_:new Date().getTime().toString(),ver:Lt.LIB_VERSION,compression:a.compression});var o=(i=a.transport)!==null&&i!==void 0?i:"fetch",l=Ps.filter(u=>!a.disableTransport||!u.transport||!a.disableTransport.includes(u.transport)),c=(r=(n=za(l,u=>u.transport===o))==null?void 0:n.method)!==null&&r!==void 0?r:l[0].method;if(!c)throw new Error("No available transport method");c(a)})(S({},e,{callback:t=>{var i,r;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&((i=(r=this.config).on_request_error)==null||i.call(r,t)),e.callback==null||e.callback(t)}}))))}wr(e){this.Sr?this.Sr.retriableRequest(e):this.ui(e)}_execute_array(e){var t,i=[],r=[],n=[];ei(e,o=>{o&&(t=o[0],le(t)?n.push(o):Zt(o)?o.call(this):le(o)&&t==="alias"?i.push(o):le(o)&&t.indexOf("capture")!==-1&&Zt(this[t])?n.push(o):r.push(o))});var a=function(o,l){ei(o,function(c){if(le(c[0])){var u=l;oe(c,function(h){u=u[h[0]].apply(u,h.slice(1))})}else this[c[0]].apply(this,c.slice(1))},l)};a(i,this),a(r,this),a(n,this)}Er(){var e,t;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((t=this.config.bootstrap)==null?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.br){if(this.is_capturing())if(!y(e)&&Se(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var n=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(n==null||!n.isRateLimited){t!=null&&t.$current_url&&!Se(t==null?void 0:t.$current_url)&&(w.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),t==null||delete t.$current_url),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 a=new Date,o=(i==null?void 0:i.timestamp)||a,l=Jt(),c={uuid:l,event:e,properties:this.calculateEventProperties(e,t||{},o,l)};n&&(c.properties.$lib_rate_limit_remaining_tokens=n.remainingTokens),i!=null&&i.$set&&(c.$set=i==null?void 0:i.$set);var u,h=this.Ir(i==null?void 0:i.$set_once);if(h&&(c.$set_once=h),(c=xc(c,i!=null&&i._noTruncate?null:this.config.properties_string_max_length)).timestamp=o,y(i==null?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=a),e===Is.DISMISSED||e===Is.SENT){var v=t==null?void 0:t[da.SURVEY_ID],g=t==null?void 0:t[da.SURVEY_ITERATION];u={id:v,current_iteration:g},localStorage.getItem(ha(u))||localStorage.setItem(ha(u),"true"),c.$set=S({},c.$set,{[Mu({id:v,current_iteration:g},e===Is.SENT?"responded":"dismissed")]:!0})}var p=S({},c.properties.$set,c.$set);if(wi(p)||this.setPersonPropertiesForFlags(p),!ue(this.config.before_send)){var _=this.Rr(c);if(!_)return;c=_}this.hr.emit("eventCaptured",c);var m={method:"POST",url:(r=i==null?void 0:i._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:i==null?void 0:i._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this.wr(m):this.br.enqueue(m),c}w.critical("This capture call is ignored due to client rate limiting.")}}else w.error("No event name provided to posthog.capture")}else w.uninitializedWarning("posthog.capture")}Ri(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,r,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var a=n?void 0:this.persistence.remove_event_timer(e),o=S({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(o.$cookieless_mode=!0),e==="$snapshot"){var l=S({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!Se(o.distinct_id)&&!Ct(o.distinct_id)||Cr(o.distinct_id))&&w.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var c,u=vu(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:v}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());o.$session_id=h,o.$window_id=v}this.sessionPropsManager&&ye(o,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&ye(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(g=this.Sr)==null?void 0:g.length}catch(b){o.$sdk_debug_error_capturing_properties=String(b)}if(this.requestRouter.region===es.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),c=e!=="$pageview"||n?e!=="$pageleave"||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),o=ye(o,c),e==="$pageview"&&x&&(o.title=x.title),!y(a)){var p=i.getTime()-a;o.$duration=parseFloat((p/1e3).toFixed(3))}Ke&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=ye({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),le(this.config.property_denylist)?oe(this.config.property_denylist,function(b){delete o[b]}):w.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&(w.error("sanitize_properties is deprecated. Use before_send instead"),o=_(o,e));var m=this.Cr();return o.$process_person_profile=m,m&&!n&&this.Or("_calculate_event_properties"),o}Ir(e){var t;if(!this.persistence||!this.Cr()||this.ur)return e;var i=this.persistence.get_initial_props(),r=(t=this.sessionPropsManager)==null?void 0:t.getSetOnceProps(),n=ye({},i,r||{},e||{}),a=this.config.sanitize_properties;return a&&(w.error("sanitize_properties is deprecated. Use before_send instead"),n=a(n,"$set_once")),this.ur=!0,wi(n)?void 0:n}register(e,t){var i;(i=this.persistence)==null||i.register(e,t)}register_once(e,t,i){var r;(r=this.persistence)==null||r.register_once(e,t,i)}register_for_session(e){var t;(t=this.sessionPersistence)==null||t.register(e)}unregister(e){var t;(t=this.persistence)==null||t.unregister(e)}unregister_for_session(e){var t;(t=this.sessionPersistence)==null||t.unregister(e)}Fr(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch{return t}}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateEarlyAccessFeatureEnrollment(e,t,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){return t===void 0&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.hr.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return(t=(i=this.sessionManager)==null?void 0:i.onSessionId(e))!==null&&t!==void 0?t:()=>{}}getSurveys(e,t){t===void 0&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){t===void 0&&(t=Lu),this.surveys.displaySurvey(e,t)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return t===void 0&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return w.uninitializedWarning("posthog.identify");if(Ct(e)&&(e=e.toString(),w.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))w.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==Hi){if(this.Or("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var n=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:n},"")}e!==r&&e!==this.get_property(Yi)&&(this.unregister(Yi),this.register({distinct_id:e}));var a=(this.persistence.get_property(Nt)||"anonymous")==="anonymous";e!==r&&a?(this.persistence.set_property(Nt,"identified"),this.setPersonPropertiesForFlags(S({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.pr=aa(e,t,i),this.featureFlags.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(Rs))}}else w.critical('The string "'+Hi+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else w.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.Or("posthog.setPersonProperties")){var i=aa(this.get_distinct_id(),e,t);this.pr!==i?(this.setPersonPropertiesForFlags(S({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.pr=i):w.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){if(this.Or("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:S({},r,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),r[e]===t||i||this.reloadFeatureFlags()}}else w.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){t===void 0&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){t===void 0&&(t=!0),this.Or("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var t,i,r,n;if(w.info("reset"),!this.__loaded)return w.uninitializedWarning("posthog.reset");var a=this.get_property("$device_id");if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(i=this.sessionPersistence)==null||i.clear(),this.surveys.reset(),this.featureFlags.reset(),(r=this.persistence)==null||r.set_property(Nt,"anonymous"),(n=this.sessionManager)==null||n.resetSessionId(),this.pr=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:Hi,$device_id:null},"");else{var o=this.config.get_device_id(Jt());this.register_once({distinct_id:o,$device_id:e?o:a},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return(e=(t=this.sessionManager)==null?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(e!=null&&e.withTimestamp&&i){var n,a=(n=e.timestampLookBack)!==null&&n!==void 0?n:10;if(!i)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-i)/1e3)-a,0)}return r}alias(e,t){return e===this.get_property(Qa)?(w.critical("Attempting to create alias for existing People user - aborting."),-2):this.Or("posthog.alias")?(y(t)&&(t=this.get_distinct_id()),e!==t?(this.Fr(Yi,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(w.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=S({},this.config);if(Ue(e)){var i,r,n,a,o;ye(this.config,ba(e));var l=this.yr();(i=this.persistence)==null||i.update_config(this.config,t,l),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new yr(S({},this.config,{persistence:"sessionStorage"}),l);var c=this.gr(this.config.debug);$t(c)&&(this.config.debug=c),$t(this.config.debug)&&(this.config.debug?(Lt.DEBUG=!0,he.G()&&he.Y("ph_debug","true"),w.info("set_config",{config:e,oldConfig:t,newConfig:S({},this.config)})):(Lt.DEBUG=!1,he.G()&&he.X("ph_debug"))),(r=this.sessionRecording)==null||r.startIfEnabledOrStop(),(n=this.autocapture)==null||n.startIfEnabled(),(a=this.heatmaps)==null||a.startIfEnabled(),this.surveys.loadIfEnabled(),this.Mr(),(o=this.externalIntegrations)==null||o.startIfEnabledOrStop()}}startSessionRecording(e){var t=e===!0,i={sampling:t||!(e==null||!e.sampling),linked_flag:t||!(e==null||!e.linked_flag),url_trigger:t||!(e==null||!e.url_trigger),event_trigger:t||!(e==null||!e.event_trigger)};if(Object.values(i).some(Boolean)){var r,n,a,o,l;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),i.sampling&&((n=this.sessionRecording)==null||n.overrideSampling()),i.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),i.url_trigger&&((o=this.sessionRecording)==null||o.overrideTrigger("url")),i.event_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,t){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(S({},r,t))}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return(t=this.persistence)==null?void 0:t.props[e]}getSessionProperty(e){var t;return(t=this.sessionPersistence)==null?void 0:t.props[e]}toString(){var e,t=(e=this.config.name)!==null&&e!==void 0?e:bi;return t!==bi&&(t=bi+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)==null?void 0:e.get_property(Nt))==="identified"||((t=this.sessionPersistence)==null?void 0:t.get_property(Nt))==="identified"}Cr(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&wi(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[Yi])&&((t=this.persistence)==null||(t=t.props)==null||!t[Ds]))}Tr(){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.Cr()||this.Or("posthog.createPersonProfile")&&this.setPersonProperties({},{})}Or(e){return this.config.person_profiles==="never"?(w.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Fr(Ds,!0),!0)}yr(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!t}Mr(){var e,t,i,r,n=this.yr();return((e=this.persistence)==null?void 0:e.gi)!==n&&((i=this.persistence)==null||i.set_disabled(n)),((t=this.sessionPersistence)==null?void 0:t.gi)!==n&&((r=this.sessionPersistence)==null||r.set_disabled(n)),n}opt_in_capturing(e){if(this.config.cookieless_mode!=="always"){var t,i;this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),(t=this.sessionManager)==null||t.destroy(),this.sessionManager=new va(this),this.persistence&&(this.sessionPropsManager=new ga(this,this.sessionManager,this.persistence)),this.sessionRecording=new ma(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this.Mr(),this.kr(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(y(e==null?void 0:e.captureEventName)||e!=null&&e.captureEventName)&&this.capture((i=e==null?void 0:e.captureEventName)!==null&&i!==void 0?i:"$opt_in",e==null?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Pr()}else w.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Mr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:Hi,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(t=this.sessionRecording)==null||t.stopRecording(),this.sessionRecording=void 0,this.Pr())):w.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===Bt.GRANTED?"granted":e===Bt.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Mr()}_is_bot(){return at?Wo(at,this.config.custom_blocked_useragents):void 0}Pr(){x&&(x.visibilityState==="visible"?this.dr||(this.dr=!0,this.capture("$pageview",{title:x.title},{send_instantly:!0}),this.vr&&(x.removeEventListener("visibilitychange",this.vr),this.vr=null)):this.vr||(this.vr=this.Pr.bind(this),Pe(x,"visibilitychange",this.vr)))}debug(e){e===!1?(f==null||f.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(f==null||f.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}))}L(){var e,t,i,r,n,a,o,l=this._r||{};return"advanced_disable_flags"in l?!!l.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?(w.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):(i="advanced_disable_decide",r=!1,n=w,a=(t="advanced_disable_flags")in(e=l)&&!y(e[t]),o=i in e&&!y(e[i]),a?e[t]:o?(n&&n.warn("Config field '"+i+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[i]):r)}Rr(e){if(ue(this.config.before_send))return e;var t=le(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var r of t){if(i=r(i),ue(i)){var n="Event '"+e.event+"' was rejected in beforeSend function";return Kl(e.event)?w.warn(n+". This can cause unexpected behavior."):w.info(n),null}i.properties&&!wi(i.properties)||w.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;return(e=this.pageViewManager.Wt)==null?void 0:e.pageViewId}captureTraceFeedback(e,t){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:t})}captureTraceMetric(e,t,i){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:t,$ai_metric_value:String(i)})}gr(e){var t=$t(e)&&!e,i=he.G()&&he.J("ph_debug")==="true";return!t&&(!!i||e)}}(function(s,e){for(var t=0;t<e.length;t++)s.prototype[e[t]]=wc(s.prototype[e[t]])})(Xs,["identify"]);var wa,xa=(wa=is[bi]=new Xs,function(){function s(){s.done||(s.done=!0,zo=!1,oe(is,function(e){e._dom_loaded()}))}x!=null&&x.addEventListener?x.readyState==="complete"?s():Pe(x,"DOMContentLoaded",s,{capture:!1}):f&&w.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),wa);let xr=!1;const td=()=>({init:()=>{if(xr)return;const t=wl,i=xl;xa.init(t,{api_host:i,person_profiles:"identified_only",capture_pageview:!0,capture_pageleave:!0,capture_exceptions:!0}),xr=!0},trackEvent:(t,i)=>{xr&&xa.capture(t,i)}});var kt,Sa,id=(Sa=class extends Da{constructor(e={}){super();Le(this,kt);this.config=e,me(this,kt,new Map)}build(e,t,i){const r=t.queryKey,n=t.queryHash??La(r,t);let a=this.get(n);return a||(a=new Cl({client:e,queryKey:r,queryHash:n,options:e.defaultQueryOptions(t),state:i,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){P(this,kt).has(e.queryHash)||(P(this,kt).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=P(this,kt).get(e.queryHash);t&&(e.destroy(),t===e&&P(this,kt).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){nt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return P(this,kt).get(e)}getAll(){return[...P(this,kt).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(i=>mn(t,i))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(i=>mn(e,i)):t}notify(e){nt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){nt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){nt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},kt=new WeakMap,Sa),jt,xt,ls,Pa,sd=(Pa=class extends Da{constructor(e={}){super();Le(this,jt);Le(this,xt);Le(this,ls);this.config=e,me(this,jt,new Set),me(this,xt,new Map),me(this,ls,0)}build(e,t,i){const r=new vl({mutationCache:this,mutationId:++gs(this,ls)._,options:e.defaultMutationOptions(t),state:i});return this.add(r),r}add(e){P(this,jt).add(e);const t=Es(e);if(typeof t=="string"){const i=P(this,xt).get(t);i?i.push(e):P(this,xt).set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(P(this,jt).delete(e)){const t=Es(e);if(typeof t=="string"){const i=P(this,xt).get(t);if(i)if(i.length>1){const r=i.indexOf(e);r!==-1&&i.splice(r,1)}else i[0]===e&&P(this,xt).delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Es(e);if(typeof t=="string"){const i=P(this,xt).get(t),r=i==null?void 0:i.find(n=>n.state.status==="pending");return!r||r===e}else return!0}runNext(e){var i;const t=Es(e);if(typeof t=="string"){const r=(i=P(this,xt).get(t))==null?void 0:i.find(n=>n!==e&&n.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}else return Promise.resolve()}clear(){nt.batch(()=>{P(this,jt).forEach(e=>{this.notify({type:"removed",mutation:e})}),P(this,jt).clear(),P(this,xt).clear()})}getAll(){return Array.from(P(this,jt))}find(e){const t={exact:!0,...e};return this.getAll().find(i=>yn(t,i))}findAll(e={}){return this.getAll().filter(t=>yn(e,t))}notify(e){nt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return nt.batch(()=>Promise.all(e.map(t=>t.continue().catch(Dt))))}},jt=new WeakMap,xt=new WeakMap,ls=new WeakMap,Pa);function Es(s){var e;return(e=s.options.scope)==null?void 0:e.id}var ge,Yt,Kt,Pi,Ii,Xt,Ti,Oi,Ia,Qo=(Ia=class{constructor(s={}){Le(this,ge);Le(this,Yt);Le(this,Kt);Le(this,Pi);Le(this,Ii);Le(this,Xt);Le(this,Ti);Le(this,Oi);me(this,ge,s.queryCache||new id),me(this,Yt,s.mutationCache||new sd),me(this,Kt,s.defaultOptions||{}),me(this,Pi,new Map),me(this,Ii,new Map),me(this,Xt,0)}mount(){gs(this,Xt)._++,P(this,Xt)===1&&(me(this,Ti,Fl.subscribe(async s=>{s&&(await this.resumePausedMutations(),P(this,ge).onFocus())})),me(this,Oi,bn.subscribe(async s=>{s&&(await this.resumePausedMutations(),P(this,ge).onOnline())})))}unmount(){var s,e;gs(this,Xt)._--,P(this,Xt)===0&&((s=P(this,Ti))==null||s.call(this),me(this,Ti,void 0),(e=P(this,Oi))==null||e.call(this),me(this,Oi,void 0))}isFetching(s){return P(this,ge).findAll({...s,fetchStatus:"fetching"}).length}isMutating(s){return P(this,Yt).findAll({...s,status:"pending"}).length}getQueryData(s){var t;const e=this.defaultQueryOptions({queryKey:s});return(t=P(this,ge).get(e.queryHash))==null?void 0:t.state.data}ensureQueryData(s){const e=this.defaultQueryOptions(s),t=P(this,ge).build(this,e),i=t.state.data;return i===void 0?this.fetchQuery(s):(s.revalidateIfStale&&t.isStaleByTime(wn(e.staleTime,t))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(s){return P(this,ge).findAll(s).map(({queryKey:e,state:t})=>{const i=t.data;return[e,i]})}setQueryData(s,e,t){const i=this.defaultQueryOptions({queryKey:s}),r=P(this,ge).get(i.queryHash),n=r==null?void 0:r.state.data,a=Al(e,n);if(a!==void 0)return P(this,ge).build(this,i).setData(a,{...t,manual:!0})}setQueriesData(s,e,t){return nt.batch(()=>P(this,ge).findAll(s).map(({queryKey:i})=>[i,this.setQueryData(i,e,t)]))}getQueryState(s){var t;const e=this.defaultQueryOptions({queryKey:s});return(t=P(this,ge).get(e.queryHash))==null?void 0:t.state}removeQueries(s){const e=P(this,ge);nt.batch(()=>{e.findAll(s).forEach(t=>{e.remove(t)})})}resetQueries(s,e){const t=P(this,ge);return nt.batch(()=>(t.findAll(s).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...s},e)))}cancelQueries(s,e={}){const t={revert:!0,...e},i=nt.batch(()=>P(this,ge).findAll(s).map(r=>r.cancel(t)));return Promise.all(i).then(Dt).catch(Dt)}invalidateQueries(s,e={}){return nt.batch(()=>(P(this,ge).findAll(s).forEach(t=>{t.invalidate()}),(s==null?void 0:s.refetchType)==="none"?Promise.resolve():this.refetchQueries({...s,type:(s==null?void 0:s.refetchType)??(s==null?void 0:s.type)??"active"},e)))}refetchQueries(s,e={}){const t={...e,cancelRefetch:e.cancelRefetch??!0},i=nt.batch(()=>P(this,ge).findAll(s).filter(r=>!r.isDisabled()).map(r=>{let n=r.fetch(void 0,t);return t.throwOnError||(n=n.catch(Dt)),r.state.fetchStatus==="paused"?Promise.resolve():n}));return Promise.all(i).then(Dt)}fetchQuery(s){const e=this.defaultQueryOptions(s);e.retry===void 0&&(e.retry=!1);const t=P(this,ge).build(this,e);return t.isStaleByTime(wn(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(s){return this.fetchQuery(s).then(Dt).catch(Dt)}fetchInfiniteQuery(s){return s.behavior=_n(s.pages),this.fetchQuery(s)}prefetchInfiniteQuery(s){return this.fetchInfiniteQuery(s).then(Dt).catch(Dt)}ensureInfiniteQueryData(s){return s.behavior=_n(s.pages),this.ensureQueryData(s)}resumePausedMutations(){return bn.isOnline()?P(this,Yt).resumePausedMutations():Promise.resolve()}getQueryCache(){return P(this,ge)}getMutationCache(){return P(this,Yt)}getDefaultOptions(){return P(this,Kt)}setDefaultOptions(s){me(this,Kt,s)}setQueryDefaults(s,e){P(this,Pi).set(xn(s),{queryKey:s,defaultOptions:e})}getQueryDefaults(s){const e=[...P(this,Pi).values()],t={};return e.forEach(i=>{En(s,i.queryKey)&&Object.assign(t,i.defaultOptions)}),t}setMutationDefaults(s,e){P(this,Ii).set(xn(s),{mutationKey:s,defaultOptions:e})}getMutationDefaults(s){const e=[...P(this,Ii).values()],t={};return e.forEach(i=>{En(s,i.mutationKey)&&Object.assign(t,i.defaultOptions)}),t}defaultQueryOptions(s){if(s._defaulted)return s;const e={...P(this,Kt).queries,...this.getQueryDefaults(s.queryKey),...s,_defaulted:!0};return e.queryHash||(e.queryHash=La(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Rl&&(e.enabled=!1),e}defaultMutationOptions(s){return s!=null&&s._defaulted?s:{...P(this,Kt).mutations,...(s==null?void 0:s.mutationKey)&&this.getMutationDefaults(s.mutationKey),...s,_defaulted:!0}}clear(){P(this,ge).clear(),P(this,Yt).clear()}},ge=new WeakMap,Yt=new WeakMap,Kt=new WeakMap,Pi=new WeakMap,Ii=new WeakMap,Xt=new WeakMap,Ti=new WeakMap,Oi=new WeakMap,Ia);function rd(s,e){fi(e,!1);let t=ne(e,"client",24,()=>new Qo);Ws(()=>{t().mount()}),Ml(t()),rl(()=>{t().unmount()}),Zr();var i=j(),r=B(i);Na(r,e,"default",{}),E(s,i),gi()}const nd=Array(12).fill(0);var ad=$e('<div class="sonner-loading-bar"></div>'),od=$e('<div><div class="sonner-spinner"></div></div>');function ld(s,e){fi(e,!0);var t=od(),i=ct(t);Ts(i,23,()=>nd,(r,n)=>`spinner-bar-${n}`,(r,n)=>{var a=ad();E(r,a)}),Ye(i),Ye(t),Qe(r=>{Mt(t,1,r),re(t,"data-visible",e.visible)},[()=>Rt(["sonner-loading-wrapper",e.class].filter(Boolean).join(" "))]),E(s,t),gi()}const cd=typeof window<"u"?window:void 0;function ud(s){let e=s.activeElement;for(;e!=null&&e.shadowRoot;){const t=e.shadowRoot.activeElement;if(t===e)break;e=t}return e}var Ci,cs;class dd{constructor(e={}){Le(this,Ci);Le(this,cs);const{window:t=cd,document:i=t==null?void 0:t.document}=e;t!==void 0&&(me(this,Ci,i),me(this,cs,Sl(r=>{const n=Os(t,"focusin",r),a=Os(t,"focusout",r);return()=>{n(),a()}})))}get current(){var e;return(e=P(this,cs))==null||e.call(this),P(this,Ci)?ud(P(this,Ci)):null}}Ci=new WeakMap,cs=new WeakMap;new dd;var us,qt;class hd{constructor(e){Le(this,us);Le(this,qt);me(this,us,e),me(this,qt,Symbol(e))}get key(){return P(this,qt)}exists(){return cl(P(this,qt))}get(){const e=gn(P(this,qt));if(e===void 0)throw new Error(`Context "${P(this,us)}" not found`);return e}getOr(e){const t=gn(P(this,qt));return t===void 0?e:t}set(e){return ul(P(this,qt),e)}}us=new WeakMap,qt=new WeakMap;const fd=new hd("<Toaster/>");function Vs(s){return s.label!==void 0}function gd(){let s=ke(Ca(typeof document<"u"?document.hidden:!1));return Ut(()=>Os(document,"visibilitychange",()=>{R(s,document.hidden,!0)})),{get current(){return d(s)}}}const Ea=4e3,vd=14,pd=45,_d=200,md=.05,yd={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function bd(s){const[e,t]=s.split("-"),i=[];return e&&i.push(e),t&&i.push(t),i}function ka(s){return 1/(1.5+Math.abs(s)/20)}var wd=$e("<div><!></div>"),xd=(s,e,t,i,r)=>{var n,a;d(e)||!d(t)||(i(),(a=(n=r.toast).onDismiss)==null||a.call(n,r.toast))},Ed=$e('<button data-close-button=""><!></button>'),kd=$e('<div data-icon=""><!> <!></div>'),Sd=$e('<div data-description=""><!></div>'),Pd=(s,e,t,i)=>{var r,n;Vs(e.toast.cancel)&&d(t)&&((n=(r=e.toast.cancel)==null?void 0:r.onClick)==null||n.call(r,s),i())},Id=$e('<button data-button="" data-cancel=""> </button>'),Td=(s,e,t)=>{var i;Vs(e.toast.action)&&((i=e.toast.action)==null||i.onClick(s),!s.defaultPrevented&&t())},Od=$e('<button data-button=""> </button>'),Cd=$e('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),Fd=$e('<li data-sonner-toast=""><!> <!></li>');function Ad(s,e){fi(e,!0);const t=F=>{var N=j(),J=B(N);{var Z=W=>{var Re=wd(),rt=ct(Re);dt(rt,()=>e.loadingIcon),Ye(Re),Qe(Me=>{Mt(Re,1,Me),re(Re,"data-visible",d(C)==="loading")},[()=>{var Me,Te,G;return Rt(Ft((Me=d(de))==null?void 0:Me.loader,(G=(Te=e.toast)==null?void 0:Te.classes)==null?void 0:G.loader,"sonner-loader"))}]),E(W,Re)},$=W=>{{let Re=Q(()=>{var Me,Te;return Ft((Me=d(de))==null?void 0:Me.loader,(Te=e.toast.classes)==null?void 0:Te.loader)}),rt=Q(()=>d(C)==="loading");ld(W,{get class(){return d(Re)},get visible(){return d(rt)}})}};K(J,W=>{e.loadingIcon?W(Z):W($,!1)})}E(F,N)};let i=ne(e,"cancelButtonStyle",3,""),r=ne(e,"actionButtonStyle",3,""),n=ne(e,"descriptionClass",3,""),a=ne(e,"unstyled",3,!1),o=ne(e,"defaultRichColors",3,!1);const l={...yd};let c=ke(!1),u=ke(!1),h=ke(!1),v=ke(!1),g=ke(!1),p=ke(0),_=ke(0),m=e.toast.duration||e.duration||Ea,b=ke(void 0),I=ke(null),M=ke(null);const D=Q(()=>e.index===0),U=Q(()=>e.index+1<=e.visibleToasts),C=Q(()=>e.toast.type),ae=Q(()=>e.toast.dismissable!==!1),q=Q(()=>e.toast.class||""),ve=Q(()=>e.toast.descriptionClass||""),ie=Q(()=>Ne.heights.findIndex(F=>F.toastId===e.toast.id)||0),we=Q(()=>e.toast.closeButton??e.closeButton),je=Q(()=>e.toast.duration??e.duration??Ea);let Ie=null;const Ge=Q(()=>e.position.split("-")),We=Q(()=>Ne.heights.reduce((F,N,J)=>J>=d(ie)?F:F+N.height,0)),Et=gd(),ot=Q(()=>e.toast.invert||e.invert),et=Q(()=>d(C)==="loading"),de=Q(()=>({...l,...e.classes})),lt=Q(()=>e.toast.title),ze=Q(()=>e.toast.description);let pe=ke(0),Ae=ke(0);const k=Q(()=>Math.round(d(ie)*vd+d(We)));Ut(()=>{d(lt),d(ze);let F;e.expanded||e.expandByDefault?F=1:F=1-e.index*md;const N=Tt(()=>d(b));if(N===void 0)return;N.style.setProperty("height","auto");const J=N.offsetHeight,Z=N.getBoundingClientRect().height,$=Math.round(Z/F+Number.EPSILON&100)/100;N.style.removeProperty("height");let W;Math.abs($-J)<1?W=$:W=J,R(_,W,!0),Tt(()=>{Ne.setHeight({toastId:e.toast.id,height:W})})});function A(){R(u,!0),R(p,d(k),!0),Ne.removeHeight(e.toast.id),setTimeout(()=>{Ne.remove(e.toast.id)},_d)}let se;const gt=Q(()=>e.toast.promise&&d(C)==="loading"||e.toast.duration===Number.POSITIVE_INFINITY);function tt(){R(pe,new Date().getTime(),!0),se=setTimeout(()=>{var F,N;(N=(F=e.toast).onAutoClose)==null||N.call(F,e.toast),A()},m)}function Vt(){if(d(Ae)<d(pe)){const F=new Date().getTime()-d(pe);m=m-F}R(Ae,new Date().getTime(),!0)}Ut(()=>{e.toast.updated&&(clearTimeout(se),m=d(je),tt())}),Ut(()=>(d(gt)||(e.expanded||e.interacting||Et.current?Vt():tt()),()=>clearTimeout(se))),Ws(()=>{var N;R(c,!0);const F=(N=d(b))==null?void 0:N.getBoundingClientRect().height;return R(_,F,!0),Ne.setHeight({toastId:e.toast.id,height:F}),()=>{Ne.removeHeight(e.toast.id)}}),Ut(()=>{e.toast.delete&&Tt(()=>{var F,N;A(),(N=(F=e.toast).onDismiss)==null||N.call(F,e.toast)})});const vt=F=>{if(d(et))return;R(p,d(k),!0);const N=F.target;N.setPointerCapture(F.pointerId),N.tagName!=="BUTTON"&&(R(h,!0),Ie={x:F.clientX,y:F.clientY})},vi=()=>{var W,Re,rt,Me,Te,G;if(d(v)||!d(ae))return;Ie=null;const F=Number(((W=d(b))==null?void 0:W.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),N=Number(((Re=d(b))==null?void 0:Re.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),J=new Date().getTime()-0,Z=d(I)==="x"?F:N,$=Math.abs(Z)/J;if(Math.abs(Z)>=pd||$>.11){R(p,d(k),!0),(Me=(rt=e.toast).onDismiss)==null||Me.call(rt,e.toast),d(I)==="x"?R(M,F>0?"right":"left",!0):R(M,N>0?"down":"up",!0),A(),R(v,!0);return}else(Te=d(b))==null||Te.style.setProperty("--swipe-amount-x","0px"),(G=d(b))==null||G.style.setProperty("--swipe-amount-y","0px");R(g,!1),R(h,!1),R(I,null)},it=F=>{var Re,rt,Me;if(!Ie||!d(ae)||(((Re=window.getSelection())==null?void 0:Re.toString().length)??-1)>0)return;const J=F.clientY-Ie.y,Z=F.clientX-Ie.x,$=e.swipeDirections??bd(e.position);!d(I)&&(Math.abs(Z)>1||Math.abs(J)>1)&&R(I,Math.abs(Z)>Math.abs(J)?"x":"y",!0);let W={x:0,y:0};if(d(I)==="y"){if($.includes("top")||$.includes("bottom"))if($.includes("top")&&J<0||$.includes("bottom")&&J>0)W.y=J;else{const Te=J*ka(J);W.y=Math.abs(Te)<Math.abs(J)?Te:J}}else if(d(I)==="x"&&($.includes("left")||$.includes("right")))if($.includes("left")&&Z<0||$.includes("right")&&Z>0)W.x=Z;else{const Te=Z*ka(Z);W.x=Math.abs(Te)<Math.abs(Z)?Te:Z}(Math.abs(W.x)>0||Math.abs(W.y)>0)&&R(g,!0),(rt=d(b))==null||rt.style.setProperty("--swipe-amount-x",`${W.x}px`),(Me=d(b))==null||Me.style.setProperty("--swipe-amount-y",`${W.y}px`)},st=()=>{R(h,!1),R(I,null),Ie=null},be=Q(()=>e.toast.icon?e.toast.icon:d(C)==="success"?e.successIcon:d(C)==="error"?e.errorIcon:d(C)==="warning"?e.warningIcon:d(C)==="info"?e.infoIcon:d(C)==="loading"?e.loadingIcon:null);pl();var V=Fd();re(V,"tabindex",0);let ii;V.__pointermove=it,V.__pointerup=vi,V.__pointerdown=vt;var si=ct(V);{var Js=F=>{var N=Ed();N.__click=[xd,et,ae,A,e];var J=ct(N);dt(J,()=>e.closeIcon??St),Ye(N),Qe(Z=>{re(N,"aria-label",e.closeButtonAriaLabel),re(N,"data-disabled",d(et)),Mt(N,1,Z)},[()=>{var Z,$,W;return Rt(Ft((Z=d(de))==null?void 0:Z.closeButton,(W=($=e.toast)==null?void 0:$.classes)==null?void 0:W.closeButton))}]),E(F,N)};K(si,F=>{d(we)&&!e.toast.component&&d(C)!=="loading"&&e.closeIcon!==null&&F(Js)})}var Zs=li(si,2);{var $s=F=>{const N=Q(()=>e.toast.component);var J=j(),Z=B(J);ri(Z,()=>d(N),($,W)=>{W($,ar(()=>e.toast.componentProps,{closeToast:A}))}),E(F,J)},er=F=>{var N=Cd(),J=B(N);{var Z=X=>{var T=kd(),H=ct(T);{var ee=z=>{var fe=j(),Oe=B(fe);{var Ee=De=>{var Ce=j(),mt=B(Ce);ri(mt,()=>e.toast.icon,(yt,Ni)=>{Ni(yt,{})}),E(De,Ce)},_e=De=>{t(De)};K(Oe,De=>{e.toast.icon?De(Ee):De(_e,!1)})}E(z,fe)};K(H,z=>{(e.toast.promise||d(C)==="loading")&&z(ee)})}var xe=li(H,2);{var O=z=>{var fe=j(),Oe=B(fe);{var Ee=De=>{var Ce=j(),mt=B(Ce);ri(mt,()=>e.toast.icon,(yt,Ni)=>{Ni(yt,{})}),E(De,Ce)},_e=De=>{var Ce=j(),mt=B(Ce);{var yt=pi=>{var Bi=j(),tr=B(Bi);dt(tr,()=>e.successIcon??St),E(pi,Bi)},Ni=pi=>{var Bi=j(),tr=B(Bi);{var Xo=_i=>{var ji=j(),ir=B(ji);dt(ir,()=>e.errorIcon??St),E(_i,ji)},Jo=_i=>{var ji=j(),ir=B(ji);{var Zo=mi=>{var qi=j(),sr=B(qi);dt(sr,()=>e.warningIcon??St),E(mi,qi)},$o=mi=>{var qi=j(),sr=B(qi);{var el=rr=>{var dn=j(),tl=B(dn);dt(tl,()=>e.infoIcon??St),E(rr,dn)};K(sr,rr=>{d(C)==="info"&&rr(el)},!0)}E(mi,qi)};K(ir,mi=>{d(C)==="warning"?mi(Zo):mi($o,!1)},!0)}E(_i,ji)};K(tr,_i=>{d(C)==="error"?_i(Xo):_i(Jo,!1)},!0)}E(pi,Bi)};K(mt,pi=>{d(C)==="success"?pi(yt):pi(Ni,!1)},!0)}E(De,Ce)};K(Oe,De=>{e.toast.icon?De(Ee):De(_e,!1)})}E(z,fe)};K(xe,z=>{e.toast.type!=="loading"&&z(O)})}Ye(T),Qe(z=>Mt(T,1,z),[()=>{var z,fe,Oe;return Rt(Ft((z=d(de))==null?void 0:z.icon,(Oe=(fe=e.toast)==null?void 0:fe.classes)==null?void 0:Oe.icon))}]),E(X,T)};K(J,X=>{(d(C)||e.toast.icon||e.toast.promise)&&e.toast.icon!==null&&(d(be)!==null||e.toast.icon)&&X(Z)})}var $=li(J,2),W=ct($),Re=ct(W);{var rt=X=>{var T=j(),H=B(T);{var ee=O=>{const z=Q(()=>e.toast.title);var fe=j(),Oe=B(fe);ri(Oe,()=>d(z),(Ee,_e)=>{_e(Ee,ar(()=>e.toast.componentProps))}),E(O,fe)},xe=O=>{var z=vn();Qe(()=>vs(z,e.toast.title)),E(O,z)};K(H,O=>{typeof e.toast.title!="string"?O(ee):O(xe,!1)})}E(X,T)};K(Re,X=>{e.toast.title&&X(rt)})}Ye(W);var Me=li(W,2);{var Te=X=>{var T=Sd(),H=ct(T);{var ee=O=>{const z=Q(()=>e.toast.description);var fe=j(),Oe=B(fe);ri(Oe,()=>d(z),(Ee,_e)=>{_e(Ee,ar(()=>e.toast.componentProps))}),E(O,fe)},xe=O=>{var z=vn();Qe(()=>vs(z,e.toast.description)),E(O,z)};K(H,O=>{typeof e.toast.description!="string"?O(ee):O(xe,!1)})}Ye(T),Qe(O=>Mt(T,1,O),[()=>{var O,z;return Rt(Ft(n(),d(ve),(O=d(de))==null?void 0:O.description,(z=e.toast.classes)==null?void 0:z.description))}]),E(X,T)};K(Me,X=>{e.toast.description&&X(Te)})}Ye($);var G=li($,2);{var qe=X=>{var T=j(),H=B(T);{var ee=O=>{var z=j(),fe=B(z);ri(fe,()=>e.toast.cancel,(Oe,Ee)=>{Ee(Oe,{})}),E(O,z)},xe=O=>{var z=j(),fe=B(z);{var Oe=Ee=>{var _e=Id();_e.__click=[Pd,e,ae,A];var De=ct(_e,!0);Ye(_e),Qe(Ce=>{nr(_e,e.toast.cancelButtonStyle??i()),Mt(_e,1,Ce),vs(De,e.toast.cancel.label)},[()=>{var Ce,mt,yt;return Rt(Ft((Ce=d(de))==null?void 0:Ce.cancelButton,(yt=(mt=e.toast)==null?void 0:mt.classes)==null?void 0:yt.cancelButton))}]),E(Ee,_e)};K(fe,Ee=>{Vs(e.toast.cancel)&&Ee(Oe)},!0)}E(O,z)};K(H,O=>{typeof e.toast.cancel=="function"?O(ee):O(xe,!1)})}E(X,T)};K(G,X=>{e.toast.cancel&&X(qe)})}var pt=li(G,2);{var _t=X=>{var T=j(),H=B(T);{var ee=O=>{var z=j(),fe=B(z);ri(fe,()=>e.toast.action,(Oe,Ee)=>{Ee(Oe,{})}),E(O,z)},xe=O=>{var z=j(),fe=B(z);{var Oe=Ee=>{var _e=Od();_e.__click=[Td,e,A];var De=ct(_e,!0);Ye(_e),Qe(Ce=>{nr(_e,e.toast.actionButtonStyle??r()),Mt(_e,1,Ce),vs(De,e.toast.action.label)},[()=>{var Ce,mt,yt;return Rt(Ft((Ce=d(de))==null?void 0:Ce.actionButton,(yt=(mt=e.toast)==null?void 0:mt.classes)==null?void 0:yt.actionButton))}]),E(Ee,_e)};K(fe,Ee=>{Vs(e.toast.action)&&Ee(Oe)},!0)}E(O,z)};K(H,O=>{typeof e.toast.action=="function"?O(ee):O(xe,!1)})}E(X,T)};K(pt,X=>{e.toast.action&&X(_t)})}Qe(X=>Mt(W,1,X),[()=>{var X,T,H;return Rt(Ft((X=d(de))==null?void 0:X.title,(H=(T=e.toast)==null?void 0:T.classes)==null?void 0:H.title))}]),E(F,N)};K(Zs,F=>{e.toast.component?F($s):F(er,!1)})}Ye(V),Ma(V,F=>R(b,F),()=>d(b)),Qe((F,N,J,Z)=>{Mt(V,1,F),re(V,"data-rich-colors",e.toast.richColors??o()),re(V,"data-styled",!(e.toast.component||e.toast.unstyled||a())),re(V,"data-mounted",d(c)),re(V,"data-promise",N),re(V,"data-swiped",d(g)),re(V,"data-removed",d(u)),re(V,"data-visible",d(U)),re(V,"data-y-position",d(Ge)[0]),re(V,"data-x-position",d(Ge)[1]),re(V,"data-index",e.index),re(V,"data-front",d(D)),re(V,"data-swiping",d(h)),re(V,"data-dismissable",d(ae)),re(V,"data-type",d(C)),re(V,"data-invert",d(ot)),re(V,"data-swipe-out",d(v)),re(V,"data-swipe-direction",d(M)),re(V,"data-expanded",J),ii=nr(V,`${e.style} ${e.toast.style}`,ii,Z)},[()=>{var F,N,J,Z,$,W;return Rt(Ft(e.class,d(q),(F=d(de))==null?void 0:F.toast,(J=(N=e.toast)==null?void 0:N.classes)==null?void 0:J.toast,(Z=d(de))==null?void 0:Z[d(C)],(W=($=e.toast)==null?void 0:$.classes)==null?void 0:W[d(C)]))},()=>!!e.toast.promise,()=>!!(e.expanded||e.expandByDefault&&d(c)),()=>({"--index":e.index,"--toasts-before":e.index,"--z-index":Ne.toasts.length-e.index,"--offset":`${d(u)?d(p):d(k)}px`,"--initial-height":e.expandByDefault?"auto":`${d(_)}px`})]),Il("dragend",V,st),E(s,V),gi()}Tl(["pointermove","pointerup","pointerdown","click"]);var Rd=ds('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function Md(s){var e=Rd();E(s,e)}var Dd=ds('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function Ld(s){var e=Dd();E(s,e)}var Nd=ds('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function Bd(s){var e=Nd();E(s,e)}var jd=ds('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function qd(s){var e=jd();E(s,e)}var Hd=ds('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function Ud(s){var e=Hd();E(s,e)}const Gd=3,Yo="24px",Ko="16px",Vd=4e3,Wd=356,zd=14,Er="dark",ks="light";function Qd(s,e){const t={};return[s,e].forEach((i,r)=>{const n=r===1,a=n?"--mobile-offset":"--offset",o=n?Ko:Yo;function l(c){["top","right","bottom","left"].forEach(u=>{t[`${a}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof i=="number"||typeof i=="string"?l(i):typeof i=="object"?["top","right","bottom","left"].forEach(c=>{const u=i[c];u===void 0?t[`${a}-${c}`]=o:t[`${a}-${c}`]=typeof u=="number"?`${u}px`:u}):l(o)}),t}var Yd=$e("<ol></ol>"),Kd=$e('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-nbs0zk"><!></section>');function Xd(s,e){fi(e,!0);function t(k){return k!=="system"?k:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Er:ks}let i=ne(e,"invert",3,!1),r=ne(e,"position",3,"bottom-right"),n=ne(e,"hotkey",19,()=>["altKey","KeyT"]),a=ne(e,"expand",3,!1),o=ne(e,"closeButton",3,!1),l=ne(e,"offset",3,Yo),c=ne(e,"mobileOffset",3,Ko),u=ne(e,"theme",3,"light"),h=ne(e,"richColors",3,!1),v=ne(e,"duration",3,Vd),g=ne(e,"visibleToasts",3,Gd),p=ne(e,"toastOptions",19,()=>({})),_=ne(e,"dir",7,"auto"),m=ne(e,"gap",3,zd),b=ne(e,"containerAriaLabel",3,"Notifications"),I=ne(e,"closeButtonAriaLabel",3,"Close toast"),M=Pl(e,["$$slots","$$events","$$legacy","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function D(){if(_()!=="auto")return _();if(typeof window>"u"||typeof document>"u")return"ltr";const k=document.documentElement.getAttribute("dir");return k==="auto"||!k?(Tt(()=>_(window.getComputedStyle(document.documentElement).direction??"ltr")),_()):(Tt(()=>_(k)),k)}const U=Q(()=>Array.from(new Set([r(),...Ne.toasts.filter(k=>k.position).map(k=>k.position)].filter(Boolean))));let C=ke(!1),ae=ke(!1),q=ke(Ca(t(u()))),ve=ke(void 0),ie=ke(null),we=ke(!1);const je=Q(()=>n().join("+").replace(/Key/g,"").replace(/Digit/g,""));Ut(()=>{Ne.toasts.length<=1&&R(C,!1)}),Ut(()=>{const k=Ne.toasts.filter(A=>A.dismiss&&!A.delete);if(k.length>0){const A=Ne.toasts.map(se=>k.find(tt=>tt.id===se.id)?{...se,delete:!0}:se);Ne.toasts=A}}),Ut(()=>()=>{d(ve)&&d(ie)&&(d(ie).focus({preventScroll:!0}),R(ie,null),R(we,!1))}),Ws(()=>(Ne.reset(),Os(document,"keydown",A=>{var gt,tt;n().every(Vt=>A[Vt]||A.code===Vt)&&(R(C,!0),(gt=d(ve))==null||gt.focus()),A.code==="Escape"&&(document.activeElement===d(ve)||(tt=d(ve))!=null&&tt.contains(document.activeElement))&&R(C,!1)}))),Ut(()=>{if(u()!=="system"&&R(q,u()),typeof window<"u"){u()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?R(q,Er):R(q,ks));const k=window.matchMedia("(prefers-color-scheme: dark)"),A=({matches:se})=>{R(q,se?Er:ks,!0)};"addEventListener"in k?k.addEventListener("change",A):k.addListener(A)}});const Ie=k=>{var A;(A=e.onblur)==null||A.call(e,k),d(we)&&!k.currentTarget.contains(k.relatedTarget)&&(R(we,!1),d(ie)&&(d(ie).focus({preventScroll:!0}),R(ie,null)))},Ge=k=>{var se;(se=e.onfocus)==null||se.call(e,k),!(k.target instanceof HTMLElement&&k.target.dataset.dismissable==="false")&&(d(we)||(R(we,!0),R(ie,k.relatedTarget,!0)))},We=k=>{var se;(se=e.onpointerdown)==null||se.call(e,k),!(k.target instanceof HTMLElement&&k.target.dataset.dismissable==="false")&&R(ae,!0)},Et=k=>{var A;(A=e.onmouseenter)==null||A.call(e,k),R(C,!0)},ot=k=>{var A;(A=e.onmouseleave)==null||A.call(e,k),d(ae)||R(C,!1)},et=k=>{var A;(A=e.onmousemove)==null||A.call(e,k),R(C,!0)},de=k=>{var A;(A=e.ondragend)==null||A.call(e,k),R(C,!1)},lt=k=>{var A;(A=e.onpointerup)==null||A.call(e,k),R(ae,!1)};fd.set(new _l);var ze=Kd();re(ze,"tabindex",-1);var pe=ct(ze);{var Ae=k=>{var A=j(),se=B(A);Ts(se,18,()=>d(U),gt=>gt,(gt,tt,Vt,vt)=>{const vi=Q(()=>{const[be,V]=tt.split("-");return{y:be,x:V}}),it=Q(()=>Qd(l(),c()));var st=Yd();ml(st,(be,V)=>({tabindex:-1,dir:be,class:e.class,"data-sonner-toaster":!0,"data-sonner-theme":d(q),"data-y-position":d(vi).y,"data-x-position":d(vi).x,style:e.style,onblur:Ie,onfocus:Ge,onmouseenter:Et,onmousemove:et,onmouseleave:ot,ondragend:de,onpointerdown:We,onpointerup:lt,...M,[yl]:V}),[D,()=>{var be;return{"--front-toast-height":`${(be=Ne.heights[0])==null?void 0:be.height}px`,"--width":`${Wd}px`,"--gap":`${m()}px`,"--offset-top":d(it)["--offset-top"],"--offset-right":d(it)["--offset-right"],"--offset-bottom":d(it)["--offset-bottom"],"--offset-left":d(it)["--offset-left"],"--mobile-offset-top":d(it)["--mobile-offset-top"],"--mobile-offset-right":d(it)["--mobile-offset-right"],"--mobile-offset-bottom":d(it)["--mobile-offset-bottom"],"--mobile-offset-left":d(it)["--mobile-offset-left"]}}],void 0,"svelte-nbs0zk"),Ts(st,23,()=>Ne.toasts.filter(be=>!be.position&&d(Vt)===0||be.position===tt),be=>be.id,(be,V,ii,si)=>{{const Js=G=>{var qe=j(),pt=B(qe);{var _t=T=>{var H=j(),ee=B(H);dt(ee,()=>e.successIcon??St),E(T,H)},X=T=>{var H=j(),ee=B(H);{var xe=O=>{Md(O)};K(ee,O=>{e.successIcon!==null&&O(xe)},!0)}E(T,H)};K(pt,T=>{e.successIcon?T(_t):T(X,!1)})}E(G,qe)},Zs=G=>{var qe=j(),pt=B(qe);{var _t=T=>{var H=j(),ee=B(H);dt(ee,()=>e.errorIcon??St),E(T,H)},X=T=>{var H=j(),ee=B(H);{var xe=O=>{Ld(O)};K(ee,O=>{e.errorIcon!==null&&O(xe)},!0)}E(T,H)};K(pt,T=>{e.errorIcon?T(_t):T(X,!1)})}E(G,qe)},$s=G=>{var qe=j(),pt=B(qe);{var _t=T=>{var H=j(),ee=B(H);dt(ee,()=>e.warningIcon??St),E(T,H)},X=T=>{var H=j(),ee=B(H);{var xe=O=>{Bd(O)};K(ee,O=>{e.warningIcon!==null&&O(xe)},!0)}E(T,H)};K(pt,T=>{e.warningIcon?T(_t):T(X,!1)})}E(G,qe)},er=G=>{var qe=j(),pt=B(qe);{var _t=T=>{var H=j(),ee=B(H);dt(ee,()=>e.infoIcon??St),E(T,H)},X=T=>{var H=j(),ee=B(H);{var xe=O=>{qd(O)};K(ee,O=>{e.infoIcon!==null&&O(xe)},!0)}E(T,H)};K(pt,T=>{e.infoIcon?T(_t):T(X,!1)})}E(G,qe)},F=G=>{var qe=j(),pt=B(qe);{var _t=T=>{var H=j(),ee=B(H);dt(ee,()=>e.closeIcon??St),E(T,H)},X=T=>{var H=j(),ee=B(H);{var xe=O=>{Ud(O)};K(ee,O=>{e.closeIcon!==null&&O(xe)},!0)}E(T,H)};K(pt,T=>{e.closeIcon?T(_t):T(X,!1)})}E(G,qe)};let N=Q(()=>{var G;return((G=p())==null?void 0:G.duration)??v()}),J=Q(()=>{var G;return((G=p())==null?void 0:G.class)??""}),Z=Q(()=>{var G;return((G=p())==null?void 0:G.descriptionClass)||""}),$=Q(()=>{var G;return((G=p())==null?void 0:G.style)??""}),W=Q(()=>p().classes||{}),Re=Q(()=>p().unstyled??!1),rt=Q(()=>{var G;return((G=p())==null?void 0:G.cancelButtonStyle)??""}),Me=Q(()=>{var G;return((G=p())==null?void 0:G.actionButtonStyle)??""}),Te=Q(()=>{var G;return((G=p())==null?void 0:G.closeButtonAriaLabel)??I()});Ad(be,{get index(){return d(ii)},get toast(){return d(V)},get defaultRichColors(){return h()},get duration(){return d(N)},get class(){return d(J)},get descriptionClass(){return d(Z)},get invert(){return i()},get visibleToasts(){return g()},get closeButton(){return o()},get interacting(){return d(ae)},get position(){return tt},get style(){return d($)},get classes(){return d(W)},get unstyled(){return d(Re)},get cancelButtonStyle(){return d(rt)},get actionButtonStyle(){return d(Me)},get closeButtonAriaLabel(){return d(Te)},get expandByDefault(){return a()},get expanded(){return d(C)},get loadingIcon(){return e.loadingIcon},successIcon:Js,errorIcon:Zs,warningIcon:$s,infoIcon:er,closeIcon:F,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),Ye(st),Ma(st,be=>R(ve,be),()=>d(ve)),Qe(()=>st.dir=st.dir),E(gt,st)}),E(k,A)};K(pe,k=>{Ne.toasts.length>0&&k(Ae)})}Ye(ze),Qe(()=>re(ze,"aria-label",`${b()??""} ${d(je)??""}`)),E(s,ze),gi()}var Jd=$e('<div class="flex h-full w-full flex-col"><!> <!></div>');function mh(s,e){fi(e,!0),Ol.interceptors.error.use((i,r)=>(r&&typeof i=="object"&&i!==null&&(i.status=r.status),i));const t=new Qo({defaultOptions:{queries:{enabled:Ll,retry:(i,r)=>{const n=r==null?void 0:r.status;return n&&n>=400&&n<500?!1:i<3}}}});Ws(()=>{bl().initSettings(),td().init()}),Gl(s,{get i18n(){return El},children:(i,r)=>{rd(i,{get client(){return t},children:(n,a)=>{var o=Jd(),l=ct(o);dt(l,()=>e.children);var c=li(l,2);Xd(c,{richColors:!0}),Ye(o),E(n,o)},$$slots:{default:!0}})},$$slots:{default:!0}}),gi()}export{mh as component,_h as universal};
|
lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{1.Cdy-7S5q.js → 1.DB-0vkHb.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../chunks/CWj6FrbW.js";import"../chunks/69_IOA4Y.js";import{p as c,f as l,t as v,a as u,c as o,r as e,s as _}from"../chunks/
|
|
1
|
+
import"../chunks/CWj6FrbW.js";import"../chunks/69_IOA4Y.js";import{p as c,f as l,t as v,a as u,c as o,r as e,s as _}from"../chunks/C3xJX0nD.js";import{s as p}from"../chunks/CpbA3HU7.js";import{f as g,a as x}from"../chunks/CAPx0Bfm.js";import{i as d}from"../chunks/Cj4nZbtb.js";import{p as m}from"../chunks/DUtlYNuP.js";var b=g("<h1> </h1> <p> </p>",1);function A(i,f){c(f,!1),d();var t=b(),r=l(t),n=o(r,!0);e(r);var a=_(r,2),h=o(a,!0);e(a),v(()=>{var s;p(n,m.status),p(h,(s=m.error)==null?void 0:s.message)}),x(i,t),u()}export{A as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../chunks/CWj6FrbW.js";import{a as n,s as d}from"../chunks/DmGM9V9Q.js";import{S as g}from"../chunks/CWuDkrMZ.js";import"../chunks/BOmrKuMn.js";import"../chunks/DthpwYR_.js";import"../chunks/ClzkJBWk.js";import"../chunks/BaFFwDFr.js";import"../chunks/DUtlYNuP.js";import"../chunks/69_IOA4Y.js";import"../chunks/D8ZGoCPm.js";import"../chunks/gBp1tBnA.js";function I(e,r){const t=()=>d(a,"$sampleSize",o),[o,i]=n(),{datasetId:s,sampleSize:a,selectedAnnotationFilterIds:m,globalStorage:{textEmbedding:p}}=r.data;g(e,{get sampleHeight(){return t().height},get sampleWidth(){return t().width},get textEmbedding(){return p},get dataset_id(){return s},get selectedAnnotationFilterIds(){return m}}),i()}export{I as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../chunks/CWj6FrbW.js";import{p as S,u as $,g as r,a as _,b as o}from"../chunks/C3xJX0nD.js";import{s as i,a as h}from"../chunks/DmGM9V9Q.js";import{S as T}from"../chunks/CWuDkrMZ.js";import{u as b}from"../chunks/BOmrKuMn.js";import"../chunks/DthpwYR_.js";import"../chunks/ClzkJBWk.js";import"../chunks/BaFFwDFr.js";import"../chunks/DUtlYNuP.js";import"../chunks/69_IOA4Y.js";import"../chunks/D8ZGoCPm.js";import{u as G}from"../chunks/DMJzr1NB.js";import"../chunks/gBp1tBnA.js";function q(p,t){S(t,!0);const m=()=>i(u,"$lastGridType",s),e=()=>i(n,"$sampleSize",s),[s,d]=h(),{datasetId:a,sampleSize:n,selectedAnnotationFilterIds:l,globalStorage:{textEmbedding:g}}=t.data,{lastGridType:u}=b(),c=o(()=>G({dataset_id:a})),f=o(()=>r(c).clearTagsSelected);$(()=>{m()!=="samples"&&r(f)()}),T(p,{get sampleHeight(){return e().height},get sampleWidth(){return e().width},get textEmbedding(){return g},get dataset_id(){return a},get selectedAnnotationFilterIds(){return l}}),_(),d()}export{q as component};
|
lightly_studio/dist_lightly_studio_view_app/_app/immutable/nodes/{12.DcO8wIAc.js → 13.9qy3WtZv.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as I,m as r,p as $,f as j,a as y,$ as N,g as h,b as v}from"../chunks/
|
|
1
|
+
import{w as I,m as r,p as $,f as j,a as y,$ as N,g as h,b as v}from"../chunks/C3xJX0nD.js";import{c as P}from"../chunks/BaFFwDFr.js";import{c as L}from"../chunks/DyIcJj6J.js";import{u as A}from"../chunks/BOmrKuMn.js";import"../chunks/CWj6FrbW.js";import"../chunks/69_IOA4Y.js";import{e as k}from"../chunks/SiegjVo0.js";import{c as E,a as T}from"../chunks/CAPx0Bfm.js";import{i as D,a as O,s as F}from"../chunks/DmGM9V9Q.js";import{p as x}from"../chunks/DUtlYNuP.js";import{g as b}from"../chunks/D8ZGoCPm.js";import{r as w}from"../chunks/ChlxSwqI.js";import{S as M}from"../chunks/DNJnBfHs.js";const z=({dataset_id:n,sampleIndex:s,tagIds:a,annotationLabelIds:u,min_width:f,max_width:l,min_height:o,max_height:p,textEmbedding:m,metadataValues:c})=>{const i=I({isLoading:!1});return(async()=>{i.update(e=>({...e,isLoading:!0,error:void 0}));try{const{data:e}=await P({path:{dataset_id:n},body:{pagination:{offset:s<1?0:s-1,limit:3},filters:{annotation_label_ids:u,tag_ids:a,width:{min:f,max:l},height:{min:o,max:p},metadata_filters:c?L(c):void 0},text_embedding:m},throwOnError:!0}),{setSamplesTotalCount:t}=A();t(e==null?void 0:e.total_count);let d;const g=s>0?e.data[0]:void 0;e.data.length>2&&(d=s==0?e.data[1]:e.data[2]),i.update(S=>({...S,isLoading:!1,sampleNext:d,samplePrevious:g,error:void 0}))}catch(e){i.update(t=>({...t,isLoading:!1,error:e.message||"Failed to load adjacent samples"}))}})(),i},C=async({parent:n,params:{dataset_id:s,sampleId:a,sampleIndex:u}})=>{var _,e,t,d,g;const{samplesSelectedTagsIds:f,samplesSelectedAnnotationLabelsIds:l,samplesDimensions:o,samplesTextEmbedding:p}=await n(),m=parseInt(u,10),{metadataValues:c}=A();return{sampleAdjacents:z({dataset_id:s,sampleIndex:m,tagIds:Array.from(r(f)),annotationLabelIds:Array.from(r(l)),min_width:(_=r(o))==null?void 0:_.min_width,max_width:(e=r(o))==null?void 0:e.max_width,min_height:(t=r(o))==null?void 0:t.min_height,max_height:(d=r(o))==null?void 0:d.max_height,textEmbedding:(g=r(p))==null?void 0:g.embedding,metadataValues:r(c)}),sampleIndex:m}},ee=Object.freeze(Object.defineProperty({__proto__:null,load:C},Symbol.toStringTag,{value:"Module"}));function G(n,s){$(s,!0);const a=()=>F(h(o),"$sampleAdjacents",u),[u,f]=O(),l=v(()=>x.data.sampleIndex),o=v(()=>x.data.sampleAdjacents),p=()=>{a().sampleNext&&b(w.toSample({sampleId:a().sampleNext.sample_id,datasetId:a().sampleNext.dataset_id,sampleIndex:h(l)+1}),{invalidateAll:!0})},m=()=>{a().samplePrevious&&b(w.toSample({sampleId:a().samplePrevious.sample_id,datasetId:a().samplePrevious.dataset_id,sampleIndex:h(l)-1}),{invalidateAll:!0})},c=t=>{switch(t.key){case"ArrowRight":p();break;case"ArrowLeft":m();break}};var i=E();k("keydown",N,c);var _=j(i);{var e=t=>{{let d=v(()=>!!a().samplePrevious),g=v(()=>!!a().sampleNext);M(t,{get hasPrevious(){return h(d)},get hasNext(){return h(g)},onPrevious:m,onNext:p})}};D(_,t=>{a()&&t(e)})}T(n,i),y(),f()}function ae(n){G(n,{})}export{ae as component,ee as universal};
|