1import{e as aa}from"../chunks/CMb4_sAc.js";import"../chunks/DsnmJJEf.js";import{p as oa,ah as la,a as ji,aq as ua,b as Hi,c as ca,f as ha,s as ge,an as da,t as pa,O as ue,ai as et,aI as va,aJ as ga}from"../chunks/BN1SZ1vA.js";import{h as fa}from"../chunks/pBEQZU1u.js";import{s as ce}from"../chunks/qsbTZ_ho.js";import{p as Be}from"../chunks/Ks26yRyA.js";var d=typeof window<"u"?window:void 0,ee=typeof globalThis<"u"?globalThis:d;typeof self>"u"&&(ee.self=ee),typeof File>"u"&&(ee.File=function(){});var he=ee?.navigator,b=ee?.document,Z=ee?.location,Ys=ee?.fetch,Js=ee!=null&&ee.XMLHttpRequest&&"withCredentials"in new ee.XMLHttpRequest?ee.XMLHttpRequest:void 0,Ui=ee?.AbortController,ae=he?.userAgent,O=d??{},Vi="1.363.5",_e={DEBUG:!1,LIB_VERSION:Vi,LIB_NAME:"web",JS_SDK_VERSION:Vi};function zi(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 Ce(s){return function(){var e=this,t=arguments;return new Promise((function(i,r){var n=s.apply(e,t);function a(l){zi(n,i,r,a,o,"next",l)}function o(l){zi(n,i,r,a,o,"throw",l)}a(void 0)}))}}function y(){return y=Object.assign?Object.assign.bind():function(s){for(var e=1;arguments.length>e;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(s[i]=t[i])}return s},y.apply(null,arguments)}function Kr(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 _a=["$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"],ma=["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"],Wi=function(s,e){if(e===void 0&&(e=[]),!s)return!1;var t=s.toLowerCase();return ma.concat(e).some((i=>{var r=i.toLowerCase();return t.indexOf(r)!==-1}))};function R(s,e){return s.indexOf(e)!==-1}var bs=function(s){return s.trim()},Xs=function(s){return s.replace(/^\$/,"")},Zr=Object.prototype,Qr=Zr.hasOwnProperty,ws=Zr.toString,L=Array.isArray||function(s){return ws.call(s)==="[object Array]"},Te=s=>typeof s=="function",X=s=>s===Object(s)&&!L(s),lt=s=>{if(X(s)){for(var e in s)if(Qr.call(s,e))return!1;return!0}return!1},k=s=>s===void 0,Y=s=>ws.call(s)=="[object String]",Ks=s=>Y(s)&&s.trim().length===0,Ae=s=>s===null,M=s=>k(s)||Ae(s),Fe=s=>ws.call(s)=="[object Number]"&&s==s,nt=s=>Fe(s)&&s>0,Me=s=>ws.call(s)==="[object Boolean]",ya=s=>s instanceof FormData,ba=s=>R(_a,s);function en(s){return s===null||typeof s!="object"}function ss(s,e){return{}.toString.call(s)==="[object "+e+"]"}function ki(s){return!k(Event)&&(function(e,t){try{return e instanceof t}catch{return!1}})(s,Event)}var wa=[!0,"true",1,"1","yes"],Ps=s=>R(wa,s),Ea=[!1,"false",0,"0","no"];function Pe(s,e,t,i,r){return e>t&&(i.warn("min cannot be greater than max."),e=t),Fe(s)?s>t?(i.warn(" cannot be greater than max: "+t+". Using max value instead."),t):e>s?(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),Pe(r||t,e,t,i))}class xa{constructor(e){this.t={},this.i=e.i,this.o=Pe(e.bucketSize,0,100,e.h),this.m=Pe(e.refillRate,0,this.o,e.h),this.S=Pe(e.refillInterval,0,864e5,e.h)}T(e,t){var i=Math.floor((t-e.lastAccess)/this.S);i>0&&(e.tokens=Math.min(e.tokens+i*this.m,this.o),e.lastAccess=e.lastAccess+i*this.S)}consumeRateLimit(e){var t,i=Date.now(),r=String(e),n=this.t[r];return n?this.T(n,i):this.t[r]=n={tokens:this.o,lastAccess:i},n.tokens===0||(n.tokens--,n.tokens===0&&((t=this.i)==null||t.call(this,e)),n.tokens===0)}stop(){this.t={}}}var Bt,Bi,Fs,de="Mobile",is="iOS",Ne="Android",dt="Tablet",tn=Ne+" "+dt,sn="iPad",rn="Apple",nn=rn+" Watch",Mt="Safari",pt="BlackBerry",an="Samsung",on=an+"Browser",ln=an+" Internet",Ke="Chrome",ka=Ke+" OS",un=Ke+" "+is,Si="Internet Explorer",cn=Si+" "+de,Pi="Opera",Sa=Pi+" Mini",Fi="Edge",hn="Microsoft "+Fi,ct="Firefox",dn=ct+" "+is,qt="Nintendo",jt="PlayStation",ht="Xbox",pn=Ne+" "+de,vn=de+" "+Mt,Ft="Windows",Zs=Ft+" Phone",Gi="Nokia",Qs="Ouya",gn="Generic",Pa=gn+" "+de.toLowerCase(),fn=gn+" "+dt.toLowerCase(),ei="Konqueror",re="(\\d+(\\.\\d+)?)",$s=new RegExp("Version/"+re),Fa=new RegExp(ht,"i"),$a=new RegExp(jt+" \\w+","i"),Ia=new RegExp(qt+" \\w+","i"),$i=new RegExp(pt+"|PlayBook|BB10","i"),Oa={"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"},_n=function(s,e){return e=e||"",R(s," OPR/")&&R(s,"Mini")?Sa:R(s," OPR/")?Pi:$i.test(s)?pt:R(s,"IE"+de)||R(s,"WPDesktop")?cn:R(s,on)?ln:R(s,Fi)||R(s,"Edg/")?hn:R(s,"FBIOS")?"Facebook "+de:R(s,"UCWEB")||R(s,"UCBrowser")?"UC Browser":R(s,"CriOS")?un:R(s,"CrMo")||R(s,Ke)?Ke:R(s,Ne)&&R(s,Mt)?pn:R(s,"FxiOS")?dn:R(s.toLowerCase(),ei.toLowerCase())?ei:((t,i)=>
1i&&R(i,rn)||(function(r){return R(r,Mt)&&!R(r,Ke)&&!R(r,Ne)})(t))(s,e)?R(s,de)?vn:Mt:R(s,ct)?ct:R(s,"MSIE")||R(s,"Trident/")?Si:R(s,"Gecko")?ct:""},Ca={[cn]:[new RegExp("rv:"+re)],[hn]:[new RegExp(Fi+"?\\/"+re)],[Ke]:[new RegExp("("+Ke+"|CrMo)\\/"+re)],[un]:[new RegExp("CriOS\\/"+re)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+re)],[Mt]:[$s],[vn]:[$s],[Pi]:[new RegExp("(Opera|OPR)\\/"+re)],[ct]:[new RegExp(ct+"\\/"+re)],[dn]:[new RegExp("FxiOS\\/"+re)],[ei]:[new RegExp("Konqueror[:/]?"+re,"i")],[pt]:[new RegExp(pt+" "+re),$s],[pn]:[new RegExp("android\\s"+re,"i")],[ln]:[new RegExp(on+"\\/"+re)],[Si]:[new RegExp("(rv:|MSIE )"+re)],Mozilla:[new RegExp("rv:"+re)]},Ta=function(s,e){var t=_n(s,e),i=Ca[t];if(k(i))return null;for(var r=0;i.length>r;r++){var n=s.match(i[r]);if(n)return parseFloat(n[n.length-2])}return null},Yi=[[new RegExp(ht+"; "+ht+" (.*?)[);]","i"),s=>[ht,s&&s[1]||""]],[new RegExp(qt,"i"),[qt,""]],[new RegExp(jt,"i"),[jt,""]],[$i,[pt,""]],[new RegExp(Ft,"i"),(s,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[Zs,""];if(new RegExp(de).test(e)&&!/IEMobile\b/.test(e))return[Ft+" "+de,""];var t=/Windows NT ([0-9.]+)/i.exec(e);if(t&&t[1]){var i=Oa[t[1]]||"";return/arm/i.test(e)&&(i="RT"),[Ft,i]}return[Ft,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,s=>s&&s[3]?[is,[s[3],s[4],s[5]||"0"].join(".")]:[is,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,s=>{var e="";return s&&s.length>=3&&(e=k(s[2])?s[3]:s[2]),["watchOS",e]}],[new RegExp("("+Ne+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+Ne+")","i"),s=>s&&s[2]?[Ne,[s[2],s[3],s[4]||"0"].join(".")]:[Ne,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,s=>{var e=["Mac OS X",""];return s&&s[1]&&(e[1]=[s[1],s[2],s[3]||"0"].join(".")),e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ka,""]],[/Linux|debian/i,["Linux",""]]],Ji=function(s){return Ia.test(s)?qt:$a.test(s)?jt:Fa.test(s)?ht:new RegExp(Qs,"i").test(s)?Qs:new RegExp("("+Zs+"|WPDesktop)","i").test(s)?Zs:/iPad/.test(s)?sn:/iPod/.test(s)?"iPod Touch":/iPhone/.test(s)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(s)?nn:$i.test(s)?pt:/(kobo)\s(ereader|touch)/i.test(s)?"Kobo":new RegExp(Gi,"i").test(s)?Gi:/(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(de).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)?Ne:tn:new RegExp("(pda|"+de+")","i").test(s)?Pa:new RegExp(dt,"i").test(s)&&!new RegExp(dt+" pc","i").test(s)?fn:""},Ra=s=>s instanceof Error;function Ma(s){var e=globalThis._posthogChunkIds;if(e){var t=Object.keys(e);return Fs&&t.length===Bi||(Bi=t.length,Fs=t.reduce(((i,r)=>{Bt||(Bt={});var n=Bt[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?.filename,u=e[r];if(c&&u){i[c]=u,Bt[r]=[c,u];break}}return i}),{})),Fs}}class Na{constructor(e,t,i){i===void 0&&(i=[]),this.coercers=e,this.stackParser=t,this.modifiers=i}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(t),a=this.parseStacktrace(r,n);return{$exception_list:this.convertToExceptionList(a,i),$exception_level:"error"}}modifyFrames(e){var t=this;return Ce((function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&L(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?t.skipFirstLines:0),t.chunkIdMap)),y({},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 Ce((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,y({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:Ma(this.stackParser),skipFirstLines:(t=e.skipFirstLines)!==null&&t!==void 0?t:1}}buildCoercingContext(e,t,i){i===void 0&&(i=0);var r=(n,a)=>
1{if(4>=a){var o=this.buildCoercingContext(e,t,a);return this.applyCoercers(n,o)}};return y({},t,{syntheticException:i==0?t.syntheticException:void 0,mechanism:e,apply:n=>r(n,i),next:n=>r(n,i+1)})}}var vt="?";function ti(s,e,t,i,r){var n={platform:s,filename:e,function:t==="<anonymous>"?vt:t,in_app:!0};return k(i)||(n.lineno=i),k(r)||(n.colno=r),n}var mn=(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]:vt,t?"safari-extension:"+e:"safari-web-extension:"+e]:[s,e]},Aa=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,La=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Da=/\((\S*)(?::(\d+))(?::(\d+))\)/,qa=(s,e)=>{var t=Aa.exec(s);if(t){var[,i,r,n]=t;return ti(e,i,vt,+r,+n)}var a=La.exec(s);if(a){if(a[2]&&a[2].indexOf("eval")===0){var o=Da.exec(a[2]);o&&(a[2]=o[1],a[3]=o[2],a[4]=o[3])}var[l,c]=mn(a[1]||vt,a[2]);return ti(e,c,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},ja=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ha=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ua=(s,e)=>{var t=ja.exec(s);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){var i=Ha.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}var r=t[3],n=t[1]||vt;return[n,r]=mn(n,r),ti(e,r,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Xi=/\(error: (.*)\)/;class Va{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=Y(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 ss(e,"DOMException")}isDOMError(e){return ss(e,"DOMError")}}class za{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 String(i.error&&typeof i.error.message=="string"?i.error.message:i)}getStack(e){return e.stacktrace||e.stack||void 0}}class Wa{constructor(){}match(e){return ss(e,"ErrorEvent")&&e.error!=null}coerce(e,t){var i;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}}var Ba=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class Ga{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(Ba);return r&&(t=r[1],i=r[2]),[t,i]}}var Ya=["fatal","error","warning","log","info","debug"];function yn(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(e>=r.length)return i===t.length?r:r.length>e?r.slice(0,e)+"...":r}return""}class Ja{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 ki(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: "+yn(e)}isSeverityLevel(e){return Y(e)&&!Ks(e)&&Ya.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var i=e[t];if(Ra(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{return}}}class Xa{match(e){return ki(e)}coerce(e,t){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+yn(e),stack:(i=t.syntheticException)==null?void 0:i.stack,synthetic:!0}}}class Ka{match(e){return en(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 Za{match(e){return ss(e,"PromiseRejectionEvent")||this.isCu
1stomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!ki(e))return!1;try{var t=e.detail;return t!=null&&typeof t=="object"&&"reason"in t}catch{return!1}}coerce(e,t){var i,r=this.getUnhandledRejectionReason(e);return en(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){try{if("reason"in e)return e.reason;if("detail"in e&&e.detail!=null&&typeof e.detail=="object"&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var bn=function(s,e){var{debugEnabled:t}=e===void 0?{}:e,i={$(r){if(d&&(_e.DEBUG||O.POSTHOG_DEBUG||t)&&!k(d.console)&&d.console){for(var n=("__rrweb_original__"in d.console[r])?d.console[r].__rrweb_original__:d.console[r],a=arguments.length,o=new Array(a>1?a-1:0),l=1;a>l;l++)o[l-1]=arguments[l];n(s,...o)}},info(){for(var r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];i.$("log",...n)},warn(){for(var r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];i.$("warn",...n)},error(){for(var r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];i.$("error",...n)},critical(){for(var r=arguments.length,n=new Array(r),a=0;r>a;a++)n[a]=arguments[a];console.error(s,...n)},uninitializedWarning(r){i.error("You must initialize PostHog before calling "+r)},createLogger:(r,n)=>bn(s+" "+r,n)};return i},w=bn("[PostHog.js]"),z=w.createLogger,Qa=z("[ExternalScriptsLoader]"),Ki=(s,e,t)=>{if(s.config.disable_external_dependency_loading)return Qa.warn(e+" was requested but loading of external scripts is disabled."),t("Loading of external scripts is disabled");var i=b?.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;i.length>a;a++)if(r=n())return r.v}var o=()=>{if(!b)return t("document not found");var l=b.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");if(s.config.external_scripts_inject_target==="head")b.head.appendChild(l);else{var c,u=b.querySelectorAll("body > script");u.length>0?(c=u[0].parentNode)==null||c.insertBefore(l,u[0]):b.body.appendChild(l)}};b!=null&&b.body?o():b?.addEventListener("DOMContentLoaded",o)};O.__PosthogExtensions__=O.__PosthogExtensions__||{},O.__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);Ki(s,n,t)},O.__PosthogExtensions__.loadSiteApp=(s,e,t)=>{var i=s.requestRouter.endpointFor("api",e);Ki(s,i,t)};
1var wn="$people_distinct_id",rs="$device_id",$t="__alias",It="__timers",Zi="$autocapture_disabled_server_side",si="$heatmaps_enabled_server_side",Qi="$exception_capture_enabled_server_side",ii="$error_tracking_suppression_rules",er="$error_tracking_capture_extension_exceptions",tr="$web_vitals_enabled_server_side",En="$dead_clicks_enabled_server_side",sr="$product_tours_enabled_server_side",ir="$web_vitals_allowed_metrics",Gt="$session_recording_remote_config",ns="$sesid",xn="$session_is_sampled",ut="$enabled_feature_flags",Ot="$early_access_features",ri="$feature_flag_details",Ct="$stored_person_properties",Xe="$stored_group_properties",ni="$surveys",Nt="$flag_call_reported",ai="$flag_call_reported_session_id",oi="$feature_flag_errors",as="$feature_flag_evaluated_at",Ee="$user_state",li="$client_session_props",ui="$capture_rate_limit",ci="$initial_campaign_params",hi="$initial_referrer_info",os="$initial_person_info",ls="$epp",kn="__POSTHOG_TOOLBAR__",_t="$posthog_cookieless",eo=[wn,$t,"__cmpns",It,"$session_recording_enabled_server_side",si,ns,ut,ii,Ee,Ot,ri,Xe,Ct,ni,Nt,ai,oi,as,li,ui,ci,hi,ls,os],Ii="PostHog loadExternalDependency extension not found.",Oe="on_reject",xe="always",tt="anonymous",st="identified",di="identified_only",us="visibilitychange",cs="beforeunload",at="$pageview",Is="$pageleave",Os="$identify",rr="$groupidentify";function Yt(s,e){L(s)&&s.forEach(e)}function H(s,e){if(!M(s))if(L(s))s.forEach(e);else if(ya(s))s.forEach(((i,r)=>e(i,r)));else for(var t in s)Qr.call(s,t)&&e(s[t],t)}var B=function(s){for(var e=arguments.length,t=new Array(e>1?e-1:0),i=1;e>i;i++)t[i-1]=arguments[i];for(var r of t)for(var n in r)r[n]!==void 0&&(s[n]=r[n]);return s};function es(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 nr=function(s){try{return s()}catch{return}},to=function(s){return function(){try{for(var e=arguments.length,t=new Array(e),i=0;e>i;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)}}},Oi=function(s){var e={};return H(s,(function(t,i){(Y(t)&&t.length>0||Fe(t))&&(e[i]=t)})),e},so=["herokuapp.com","vercel.app","netlify.app"];function io(s){var e=s?.hostname;if(!Y(e))return!1;var t=e.split(".").slice(-2).join(".");for(var i of so)if(t===i)return!1;return!0}function G(s,e,t,i){var{capture:r=!1,passive:n=!0}=i??{};s?.addEventListener(e,t,{capture:r,passive:n})}function Sn(s){return s.name==="ph_toolbar_internal"}Math.trunc||(Math.trunc=function(s){return 0>s?Math.ceil(s):Math.floor(s)}),Number.isInteger||(Number.isInteger=function(s){return Fe(s)&&isFinite(s)&&Math.floor(s)===s});class hs{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)||0>e||0>t||0>i||0>r||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 hs(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),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 hs(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var t=0;16>t;t++){var i=this.bytes[t]-e.bytes[t];if(i!==0)return Math.sign(i)}return 0}}class ro{constructor(){this.k=0,this.R=0,this.P=new no}generate(){var e=this.generateOrAbort();if(k(e)){this.k=0;var t=this.generateOrAbort();if(k(t))throw new Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.k)this.k=e,this.O();else{if(this.k>=e+1e4)return;this.R++,this.R>4398046511103&&(this.k++,this.O())}return hs.fromFieldsV7(this.k,Math.trunc(this.R/Math.pow(2,30)),this.R&Math.pow(2,30)-1,this.P.nextUint32())}O(){this.R=1024*this.P.nextUint32()+(1023&this.P.nextUint32())}}var ar,Pn=s=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;s.length>e;e++)s[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return s};d&&!k(d.crypto)&&crypto.getRandomValues&&(Pn=s=>crypto.getRandomValues(s));
1class no{constructor(){this.I=new Uint32Array(8),this.C=1/0}nextUint32(){return this.I.length>this.C||(Pn(this.I),this.C=0),this.I[this.C++]}}var Ve=()=>ao().toString(),ao=()=>(ar||(ar=new ro)).generate(),mt="",oo=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,ke={F:()=>!!b,A(s){w.error("cookieStore error: "+s)},M(s){if(b){try{for(var e=s+"=",t=b.cookie.split(";").filter((n=>n.length)),i=0;t.length>i;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}},D(s){var e;try{e=JSON.parse(ke.M(s))||{}}catch{}return e},L(s,e,t,i,r){if(b)try{var n="",a="",o=(function(u,h){if(h){var v=(function(f,p){if(p===void 0&&(p=b),mt)return mt;if(!p||["localhost","127.0.0.1"].includes(f))return"";for(var C=f.split("."),$=Math.min(C.length,8),P="dmn_chk_"+Ve();!mt&&$--;){var I=C.slice($).join("."),S=P+"=1;domain=."+I+";path=/";p.cookie=S+";max-age=3",p.cookie.includes(P)&&(p.cookie=S+";max-age=0",mt=I)}return mt})(u);if(!v){var g=(f=>{var p=f.match(oo);return p?p[0]:""})(u);g!==v&&w.info("Warning: cookie subdomain discovery mismatch",g,v),v=g}return v?"; domain=."+v:""}return""})(b.location.hostname,i);if(t){var l=new Date;l.setTime(l.getTime()+864e5*t),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),b.cookie=c,c}catch{return}},U(s,e){if(b!=null&&b.cookie)try{ke.L(s,"",-1,e)}catch{return}}},Cs=null,V={F(){if(!Ae(Cs))return Cs;var s=!0;if(k(d))s=!1;else try{var e="__mplssupport__";V.L(e,"xyz"),V.M(e)!=='"xyz"'&&(s=!1),V.U(e)}catch{s=!1}return s||w.error("localStorage unsupported; falling back to cookie store"),Cs=s,s},A(s){w.error("localStorage error: "+s)},M(s){try{return d?.localStorage.getItem(s)}catch(e){V.A(e)}return null},D(s){try{return JSON.parse(V.M(s))||{}}catch{}return null},L(s,e){try{d?.localStorage.setItem(s,JSON.stringify(e))}catch(t){V.A(t)}},U(s){try{d?.localStorage.removeItem(s)}catch(e){V.A(e)}}},lo=[rs,"distinct_id",ns,xn,ls,os,Ee],Jt={},uo={F:()=>!0,A(s){w.error("memoryStorage error: "+s)},M:s=>Jt[s]||null,D:s=>Jt[s]||null,L(s,e){Jt[s]=e},U(s){delete Jt[s]}},Ge=null,Q={F(){if(!Ae(Ge))return Ge;if(Ge=!0,k(d))Ge=!1;else try{var s="__support__";Q.L(s,"xyz"),Q.M(s)!=='"xyz"'&&(Ge=!1),Q.U(s)}catch{Ge=!1}return Ge},A(s){w.error("sessionStorage error: ",s)},M(s){try{return d?.sessionStorage.getItem(s)}catch(e){Q.A(e)}return null},D(s){try{return JSON.parse(Q.M(s))||null}catch{}return null},L(s,e){try{d?.sessionStorage.setItem(s,JSON.stringify(e))}catch(t){Q.A(t)}},U(s){try{d?.sessionStorage.removeItem(s)}catch(e){Q.A(e)}}};class co{constructor(e){this._instance=e}get N(){return this._instance.config}get consent(){return this.j()?0:this.B}isOptedOut(){return this.N.cookieless_mode===xe||this.consent===0||this.consent===-1&&(this.N.opt_out_capturing_by_default||this.N.cookieless_mode===Oe)}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===0}optInOut(e){this.H.L(this.q,e?1:0,this.N.cookie_expiration,this.N.cross_subdomain_cookie,this.N.secure_cookie)}reset(){this.H.U(this.q,this.N.cross_subdomain_cookie)}get q(){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 B(){var e=this.H.M(this.q);return Ps(e)?1:R(Ea,e)?0:-1}get H(){if(!this.W){var e=this.N.opt_out_capturing_persistence_type;this.W=e==="localStorage"?V:ke;var t=e==="localStorage"?ke:V;t.M(this.q)&&(this.W.M(this.q)||this.optInOut(Ps(t.M(this.q))),t.U(this.q,this.N.cross_subdomain_cookie))}return this.W}j(){return!!this.N.respect_dnt&&[he?.doNotTrack,he?.msDoNotTrack,O.doNotTrack].some((e=>Ps(e)))}}var Xt=z("[Dead Clicks]"),ho=()=>!0,po=s=>{var e,t=!((e=s.instance.persistence)==null||!e.get_property(En)),i=s.instance.config.capture_dead_clicks;return Me(i)?i:!!X(i)||t};class or{get lazyLoadedDeadClicksAutocapture(){return this.V}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[En]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Y((()=>{this.G()})):this.stop()}Y(e){var t,i;(t=O.__PosthogExtensions__)!=null&&t.initDeadClicksAutocapture&&e(),(i=O.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",(r=>{r?Xt.error("failed to load script",r):e()}))}G(){var e;if(b){if(!this.V&&(e=O.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var t=X(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.V=O.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.V.start(b),Xt.info("starting...")}}else Xt.error("`document` not found. Cannot start.")}
1stop(){this.V&&(this.V.stop(),this.V=void 0,Xt.info("stopping..."))}}var Ts=z("[SegmentIntegration]"),Fn="posthog-js";function $n(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 f,p=((l=o.exception)==null?void 0:l.values)||[],C=p.map((P=>y({},P,{stacktrace:P.stacktrace?y({},P.stacktrace,{type:"raw",frames:(P.stacktrace.frames||[]).map((I=>y({},I,{platform:"web:javascript"})))}):void 0}))),$={$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:C,$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&&($.$sentry_url=(r||"https://sentry.io/organizations/")+t+"/issues/?project="+i+"&query="+o.event_id),a&&((f=s.exceptions)==null||f.sendExceptionEvent($)),o}}class vo{constructor(e,t,i,r,n,a){this.name=Fn,this.setupOnce=function(o){o($n(e,{organization:t,projectId:i,prefix:r,severityAllowList:n,sendExceptionsToPostHog:a==null||a}))}}}class lr{constructor(e){this.J=(t,i,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&(w.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:t,changeReason:r}),this.K=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.X()}X(){var e;this.Z=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.J)}destroy(){var e;(e=this.Z)==null||e.call(this),this.Z=void 0}doPageView(e,t){var i,r=this.tt(e,t);return this.K={pathname:(i=d?.location.pathname)!==null&&i!==void 0?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.tt(e,(t=this.K)==null?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.K)==null?void 0:e.pageViewId}}tt(e,t){var i=this.K;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(!(k(a)||k(o)||k(l)||k(c)||k(u)||k(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?Pe(o/a,0,1,w):1,g=a>1?Pe(l/a,0,1,w):1,f=c>1?Pe(u/c,0,1,w):1,p=c>1?Pe(h/c,0,1,w):1;r=B(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:f,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:p})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}}var ds=s=>{var e=b?.createElement("a");return k(e)?null:(e.href=s,e)},ps=function(s,e){for(var t,i=((s.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;i.length>r;r++){var n=i[r].split("=");if(n[0]===e){t=n;break}}if(!L(t)||2>t.length)return"";var a=t[1];try{a=decodeURIComponent(a)}catch{w.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Ht=function(s,e,t){if(!s||!e||!e.length)return s;for(var i=s.split("#"),r=i[1],n=(i[0]||"").split("?"),a=n[1],o=n[0],l=(a||"").split("&"),c=[],u=0;l.length>u;u++){var h=l[u].split("=");L(h)&&(e.includes(h[0])?c.push(h[0]+"="+t):c.push(l[u]))}var v=o;return a!=null&&(v+="?"+c.join("&")),r!=null&&(v+="#"+r),v},vs=function(s,e){var t=s.match(new RegExp(e+"=([^&]*)"));return t?t[1]:null},Kt="https?://(.*)",gt=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],go=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...gt],Ut="<masked>",fo=["li_fat_id"];function In(s,e,t){if(!b)return{};
1var i,r=e?[...gt,...t||[]]:[],n=On(Ht(b.URL,r,Ut),s),a=(i={},H(fo,(function(o){var l=ke.M(o);i[o]=l||null})),i);return B(a,n)}function On(s,e){var t=go.concat(e||[]),i={};return H(t,(function(r){var n=ps(s,r);i[r]=n||null})),i}function Cn(s){var e=(function(n){return n?n.search(Kt+"google.([^/?]*)")===0?"google":n.search(Kt+"bing.com")===0?"bing":n.search(Kt+"yahoo.com")===0?"yahoo":n.search(Kt+"duckduckgo.com")===0?"duckduckgo":null:null})(s),t=e!="yahoo"?"q":"p",i={};if(!Ae(e)){i.$search_engine=e;var r=b?ps(b.referrer,t):"";r.length&&(i.ph_keyword=r)}return i}function ur(){return navigator.language||navigator.userLanguage}var gs="$direct";function Tn(){return b?.referrer||gs}function Rn(s,e){var t=s?[...gt,...e||[]]:[],i=Z?.href.substring(0,1e3);return{r:Tn().substring(0,1e3),u:i?Ht(i,t,Ut):void 0}}function Mn(s){var e,{r:t,u:i}=s,r={$referrer:t,$referring_domain:t==null?void 0:t==gs?gs:(e=ds(t))==null?void 0:e.host};if(i){r.$current_url=i;var n=ds(i);r.$host=n?.host,r.$pathname=n?.pathname;var a=On(i);B(r,a)}if(t){var o=Cn(t);B(r,o)}return r}function Nn(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function _o(){try{return new Date().getTimezoneOffset()}catch{return}}var mo=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Rs{constructor(e,t){this.N=e,this.props={},this.it=!1,this.et=(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.H=this.rt(e),this.load(),e.debug&&w.info("Persistence loaded",e.persistence,y({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.st}rt(e){mo.indexOf(e.persistence.toLowerCase())===-1&&(w.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=(function(r){r===void 0&&(r=[]);var n=[...lo,...r];return y({},V,{D(a){try{var o={};try{o=ke.D(a)||{}}catch{}var l=B(o,JSON.parse(V.M(a)||"{}"));return V.L(a,l),l}catch{}return null},L(a,o,l,c,u,h){try{V.L(a,o,void 0,void 0,h);var v={};n.forEach((g=>{o[g]&&(v[g]=o[g])})),Object.keys(v).length&&ke.L(a,v,l,c,u,h)}catch(g){V.A(g)}},U(a,o){try{d?.localStorage.removeItem(a),ke.U(a,o)}catch(l){V.A(l)}}})})(e.cookie_persisted_properties||[]),i=e.persistence.toLowerCase();return i==="localstorage"&&V.F()?V:i==="localstorage+cookie"&&t.F()?t:i==="sessionstorage"&&Q.F()?Q:i==="memory"?uo:i==="cookie"?ke:t.F()?t:ke}nt(e){var t=e??this.N.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var i=this.props[as];return!i||typeof i!="number"||Date.now()-i>t}properties(){var e={};return H(this.props,((t,i)=>{if(i===ut&&X(t)){if(!this.nt())for(var r=Object.keys(t),n=0;r.length>n;n++)e["$feature/"+r[n]]=t[r[n]]}else eo.indexOf(i)===-1&&(e[i]=t)})),e}load(){if(!this.st){var e=this.H.D(this.et);e&&(this.props=B({},e))}}save(){this.st||this.H.L(this.et,this.props,this.ot,this.ut,this.ht,this.N.debug)}remove(){this.H.U(this.et,!1),this.H.U(this.et,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(X(e)){k(t)&&(t="None"),this.ot=k(i)?this.dt:i;var r=!1;if(H(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(X(e)){this.ot=k(t)?this.dt:t;var i=!1;if(H(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.it){var e=In(this.N.custom_campaign_params,this.N.mask_personal_data_properties,this.N.custom_personal_data_properties);lt(Oi(e))||this.register(e),this.it=!0}}update_search_keyword(){var e;this.register((e=b?.referrer)?Cn(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Tn(),$referring_domain:b!=null&&b.referrer&&((e=ds(b.referrer))==null?void 0:e.host)||gs},void 0)}set_initial_person_info(){this.props[ci]||this.props[hi]||this.register_once({[os]:Rn(this.N.mask_personal_data_properties,this.N.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};H([hi,ci],(a=>{var o=this.props[a];o&&H(o,(function(l,c){e["$initial_"+Xs(c)]=l}))}));var t,i,r=this.props[os];if(r){var n=(t=Mn(r),i={},H(t,(function(a,o){i["$initial_"+Xs(o)]=a})),i);B(e,n)}return e}safe_merge(e){return H(this.props,(function(t,i){i in e||(e[i]=t)})),e}
1update_config(e,t,i){if(this.dt=this.ot=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||!((a,o)=>{if(a.length!==o.length)return!1;var l=[...a].sort(),c=[...o].sort();return l.every(((u,h)=>u===c[h]))})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var r=this.rt(e),n=this.props;this.clear(),this.H=r,this.props=n,this.save()}}set_disabled(e){this.st=e,this.st?this.remove():this.save()}set_cross_subdomain(e){e!==this.ut&&(this.ut=e,this.remove(),this.save())}set_secure(e){e!==this.ht&&(this.ht=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[It]||{};i[e]=t,this.props[It]=i,this.save()}remove_event_timer(e){var t=(this.props[It]||{})[e];return k(t)||(delete this.props[It][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}var yt={Activation:"events",Cancellation:"cancelEvents"},Ms={Popover:"popover",API:"api",Widget:"widget"},Tt={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},Ns={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},pi={Popover:"popover",Inline:"inline"},yo={SHOWN:"product tour shown"},cr={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},hr=z("[RateLimiter]");class bo{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=t=>{var i=t.text;if(i&&i.length)try{(JSON.parse(i).quota_limited||[]).forEach((r=>{hr.info((r||"events")+" is quota limited."),this.serverLimits[r]=new Date().getTime()+6e4}))}catch(r){return void hr.warn('could not rate limit - continuing. Error: "'+r?.message+'"',{text:i})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var t,i,r;e===void 0&&(e=!1);var{captureEventsBurstLimit:n,captureEventsPerSecond:a}=this,o=new Date().getTime(),l=(t=(i=this.instance.persistence)==null?void 0:i.get_property(ui))!==null&&t!==void 0?t:{tokens:n,last:o};l.tokens+=(o-l.last)/1e3*a,l.last=o,l.tokens>n&&(l.tokens=n);var c=1>l.tokens;return c||e||(l.tokens=Math.max(0,l.tokens-1)),!c||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+a+" events per second and "+n+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=c,(r=this.instance.persistence)==null||r.set_property(ui,l),{isRateLimited:c,remainingTokens:l.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return t!==!1&&new Date().getTime()<t}}var bt=z("[RemoteConfig]");class An{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=O._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}vt(e){var t,i;(t=O.__PosthogExtensions__)!=null&&t.loadExternalDependency?(i=O.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,"remote-config",(()=>e(this.remoteConfig))):e()}ct(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return bt.info("Using preloaded remote config",this.remoteConfig),this.ft(this.remoteConfig),void this._t();if(this._instance.bt())return void bt.warn("Remote config is disabled. Falling back to local config.");this.vt((e=>{if(!e)return bt.info("No config found after loading remote JS config. Falling back to JSON."),void this.ct((t=>{this.ft(t),this._t()}));this.ft(e),this._t()}))}catch(e){bt.error("Error loading remote config",e)}}stop(){this.yt&&(clearInterval(this.yt),this.yt=void 0)}refresh(){this._instance.bt()||b?.visibilityState==="hidden"||this._instance.reloadFeatureFlags()}_t(){var e;if(!this.yt){var t=(e=this._instance.config.remote_config_refresh_interval_ms)!==null&&e!==void 0?e:3e5;t!==0&&(this.yt=setInterval((()=>{this.refresh()}),t))}}ft(e){var t;e||bt.error("Failed to fetch remote config from PostHog."),this._instance.ft(e??{}),e?.hasFeatureFlags!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||(t=this._instance.featureFlags)==null||t.ensureFlagsLoaded())}}var Re={GZipJS:"gzip-js",Base64:"base64"},me=Uint8Array,oe=Uint16Array,ft=Uint32Array,Ci=new me([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]),Ti=new me([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]),dr=new me([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Ln=function(s,e){for(var t=new oe(31),i=0;31>i;++i)t[i]=e+=1<<s[i-1];var r=new ft(t[30]);for(i=1;30>i;++i)for(var n=t[i];t[i+1]>n;++n)r[n]=n-t[i]<<5|i;return[t,r]},Dn=Ln(Ci,2),vi=Dn[1];Dn[0][28]=258,vi[258]=28;for(var pr=Ln(Ti,0)[1],qn=new oe(32768),U=0;32768>U;++U){var it=(43690&U)>>>1|(21845&U)<<1;qn[U]=((65280&(it=(61680&(it=(52428&it)>>>2|(13107&it)<<2))>>>4|(3855&it)<<4))>>>8|(255&it)<<8)>>>1}var At=function(s,e,t){for(var i=s.length,r=0,n=new oe(e);i>r;++r)++n[s[r]-1];var a,o=new oe(e);for(r=0;e>r;++r)o[r]=o[r-1]+n[r-1]<<1;for(a=new oe(i),r=0;i>r;++r)a[r]=qn[o[s[r]-1]++]>>>15-s[r];return a},Ze=new me(288);for(U=0;144>U;++U)Ze[U]=8;for(U=144;256>U;++U)Ze[U]=9;for(U=256;280>U;++U)Ze[U]=7;for(U=280;288>U;++U)Ze[U]=8;var fs=new me(32);for(U=0;32>U;++U)fs[U]=5;var wo=At(Ze,9),Eo=At(fs,5),jn=function(s){return(s/8>>0)+(7&s&&1)},Hn=function(s,e,t){(t==null||t>s.length)&&(t=s.length);var i=new(s instanceof oe?oe:s instanceof ft?ft:me)(t-e);return i.set(s.subarray(e,t)),i},Ie=function(s,e,t){var i=e/8>>0;s[i]|=t<<=7&e,s[i+1]|=t>>>8},wt=function(s,e,t){var i=e/8>>0;s[i]|=t<<=7&e,s[i+1]|=t>>>8,s[i+2]|=t>>>16},As=function(s,e){for(var t=[],i=0;s.length>i;++i)s[i]&&t.push({s:i,f:s[i]});var r=t.length,n=t.slice();if(!r)return[new me(0),0];if(r==1){var a=new me(t[0].s+1);return a[t[0].s]=1,[a,1]}t.sort((function(E,x){return E.f-x.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[h].f>t[c].f?c++:h++],l=t[c!=u&&t[h].f>t[c].f?c++:h++],t[u++]={s:-1,f:o.f+l.f,l:o,r:l};var v=n[0].s;for(i=1;r>i;++i)n[i].s>v&&(v=n[i].s);var g=new oe(v+1),f=gi(t[u-1],g,0);if(f>e){i=0;var p=0,C=f-e,$=1<<C;for(n.sort((function(E,x){return g[x.s]-g[E.s]||E.f-x.f}));r>i;++i){var P=n[i].s;if(e>=g[P])break;p+=$-(1<<f-g[P]),g[P]=e}for(p>>>=C;p>0;){var I=n[i].s;e>g[I]?p-=1<<e-g[I]++-1:++i}for(;i>=0&&p;--i){var S=n[i].s;g[S]==e&&(--g[S],++p)}f=e}return[new me(g),f]},gi=function(s,e,t){return s.s==-1?Math.max(gi(s.l,e,t+1),gi(s.r,e,t+1)):e[s.s]=t},vr=function(s){for(var e=s.length;e&&!s[--e];);for(var t=new oe(++e),i=0,r=s[0],n=1,a=function(l){t[i++]=l},o=1;e>=o;++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]},Et=function(s,e){for(var t=0,i=0;e.length>i;++i)t+=s[i]*e[i];return t},fi=function(s,e,t){var i=t.length,r=jn(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;i>n;++n)s[r+n+4]=t[n];return 8*(r+4+i)},gr=function(s,e,t,i,r,n,a,o,l,c,u){Ie(e,u++,t),++r[256];for(var h=As(r,15),v=h[0],g=h[1],f=As(n,15),p=f[0],C=f[1],$=vr(v),P=$[0],I=$[1],S=vr(p),E=S[0],x=S[1],m=new oe(19),_=0;P.length>_;++_)m[31&P[_]]++;for(_=0;E.length>_;++_)m[31&E[_]]++;for(var F=As(m,7),A=F[0],N=F[1],T=19;T>4&&!A[dr[T-1]];--T);var q,D,J,K,ne=c+5<<3,W=Et(r,Ze)+Et(n,fs)+a,se=Et(r,v)+Et(n,p)+a+14+3*T+Et(m,A)+(2*m[16]+3*m[17]+7*m[18]);if(W>=ne&&se>=ne)return fi(e,u,s.subarray(l,l+c));if(Ie(e,u,1+(W>se)),u+=2,W>se){q=At(v,g),D=v,J=At(p,C),K=p;var pe=At(A,N);for(Ie(e,u,I-257),Ie(e,u+5,x-1),Ie(e,u+10,T-4),u+=14,_=0;T>_;++_)Ie(e,u+3*_,A[dr[_]]);u+=3*T;for(var ve=[P,E],$e=0;2>$e;
1++$e){var le=ve[$e];for(_=0;le.length>_;++_)Ie(e,u,pe[ye=31&le[_]]),u+=A[ye],ye>15&&(Ie(e,u,le[_]>>>5&127),u+=le[_]>>>12)}}else q=wo,D=Ze,J=Eo,K=fs;for(_=0;o>_;++_)if(i[_]>255){var ye;wt(e,u,q[257+(ye=i[_]>>>18&31)]),u+=D[ye+257],ye>7&&(Ie(e,u,i[_]>>>23&31),u+=Ci[ye]);var be=31&i[_];wt(e,u,J[be]),u+=K[be],be>3&&(wt(e,u,i[_]>>>5&8191),u+=Ti[be])}else wt(e,u,q[i[_]]),u+=D[i[_]];return wt(e,u,q[256]),u+D[256]},xo=new ft([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ko=(function(){for(var s=new ft(256),e=0;256>e;++e){for(var t=e,i=9;--i;)t=(1&t&&3988292384)^t>>>1;s[e]=t}return s})(),Ls=function(s,e,t){for(;t;++e)s[e]=t,t>>>=8};function So(s,e){e===void 0&&(e={});var t=(function(){var h=4294967295;return{p(v){for(var g=h,f=0;v.length>f;++f)g=ko[255&g^v[f]]^g>>>8;h=g},d(){return 4294967295^h}}})(),i=s.length;t.p(s);var r,n,a,o,l,c=(o=10+((r=e).filename&&r.filename.length+1||0),l=8,(function(h,v,g,f,p,C){var $=h.length,P=new me(f+$+5*(1+Math.floor($/7e3))+p),I=P.subarray(f,P.length-p),S=0;if(!v||8>$)for(var E=0;$>=E;E+=65535){var x=E+65535;$>x?S=fi(I,S,h.subarray(E,x)):(I[E]=!0,S=fi(I,S,h.subarray(E,$)))}else{for(var m=xo[v-1],_=m>>>13,F=8191&m,A=(1<<g)-1,N=new oe(32768),T=new oe(A+1),q=Math.ceil(g/3),D=2*q,J=function(Ss){return(h[Ss]^h[Ss+1]<<q^h[Ss+2]<<D)&A},K=new ft(25e3),ne=new oe(288),W=new oe(32),se=0,pe=0,ve=(E=0,0),$e=0,le=0;$>E;++E){var ye=J(E),be=32767&E,Qe=T[ye];if(N[be]=Qe,T[ye]=be,E>=$e){var zt=$-E;if((se>7e3||ve>24576)&&zt>423){S=gr(h,I,0,K,ne,W,pe,ve,le,E-le,S),ve=se=pe=0,le=E;for(var we=0;286>we;++we)ne[we]=0;for(we=0;30>we;++we)W[we]=0}var We=2,Wt=0,ta=F,Le=be-Qe&32767;if(zt>2&&ye==J(E-Le))for(var sa=Math.min(_,zt)-1,ia=Math.min(32767,E),ra=Math.min(258,zt);ia>=Le&&--ta&&be!=Qe;){if(h[E+We]==h[E+We-Le]){for(var De=0;ra>De&&h[E+De]==h[E+De-Le];++De);if(De>We){if(We=De,Wt=Le,De>sa)break;var na=Math.min(Le,De-2),Ai=0;for(we=0;na>we;++we){var ks=E-Le+we+32768&32767,Li=ks-N[ks]+32768&32767;Li>Ai&&(Ai=Li,Qe=ks)}}}Le+=(be=Qe)-(Qe=N[be])+32768&32767}if(Wt){K[ve++]=268435456|vi[We]<<18|pr[Wt];var Di=31&vi[We],qi=31&pr[Wt];pe+=Ci[Di]+Ti[qi],++ne[257+Di],++W[qi],$e=E+We,++se}else K[ve++]=h[E],++ne[h[E]]}}S=gr(h,I,!0,K,ne,W,pe,ve,le,E-le,S)}return Hn(P,0,f+jn(S)+p)})(n=s,(a=e).level==null?6:a.level,a.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+a.mem,o,l)),u=c.length;return(function(h,v){var g=v.filename;if(h[0]=31,h[1]=139,h[2]=8,h[8]=2>v.level?4:v.level==9?2:0,h[9]=3,v.mtime!=0&&Ls(h,4,Math.floor(new Date(v.mtime||Date.now())/1e3)),g){h[3]=8;for(var f=0;g.length>=f;++f)h[f+10]=g.charCodeAt(f)}})(c,e),Ls(c,u-8,t.d()),Ls(c,u-4,i),c}var Po=!!Js||!!Ys,_s=function(s,e,t){var i;t===void 0&&(t=!0);var[r,n]=s.split("?"),a=y({},e),o=(i=n?.split("&").map((c=>{var u,[h,v]=c.split("="),g=t&&(u=a[h])!==null&&u!==void 0?u:v;return delete a[h],h+"="+g})))!==null&&i!==void 0?i:[],l=(function(c,u){var h,v;u===void 0&&(u="&");var g=[];return H(c,(function(f,p){k(f)||k(p)||p==="undefined"||(h=encodeURIComponent((C=>C instanceof File)(f)?f.name:f.toString()),v=encodeURIComponent(p),g[g.length]=v+"="+h)})),g.join(u)})(a);return l&&o.push(l),r+"?"+o.join("&")},Rt=(s,e)=>JSON.stringify(s,((t,i)=>typeof i=="bigint"?i.toString():i),e),Ds=s=>{var{data:e,compression:t}=s;if(e){if(t===Re.GZipJS){var i=So((function(o,l){var c=o.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(o);for(var u=new me(o.length+(o.length>>>1)),h=0,v=function(C){u[h++]=C},g=0;c>g;++g){if(h+5>u.length){var f=new me(h+8+(c-g<<1));f.set(u),u=f}var p=o.charCodeAt(g);128>p?v(p):2048>p?(v(192|p>>>6),v(128|63&p)):p>55295&&57344>p?(v(240|(p=65536+(1047552&p)|1023&o.charCodeAt(++g))>>>18),v(128|p>>>12&63),v(128|p>>>6&63),v(128|63&p)):(v(224|p>>>12),v(128|p>>>6&63),v(128|63&p))}return Hn(u,0,h)})(Rt(e)),{mtime:0});return{contentType:"text/plain",body:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),estimatedSize:i.byteLength}}if(t===Re.Base64){var r=(function(o){return o&&btoa(encodeURIComponent(o).replace(/%([0-9A-F]{2})/g,((l,c)=>String.fromCharCode(parseInt(c,16)))))})(Rt(e)),n=(o=>
1"data="+encodeURIComponent(typeof o=="string"?o:Rt(o)))(r);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var a=Rt(e);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},ts=[];Ys&&ts.push({transport:"fetch",method(s){var e,t,{contentType:i,body:r,estimatedSize:n}=(e=Ds(s))!==null&&e!==void 0?e:{},a=new Headers;H(s.headers,(function(u,h){a.append(h,u)})),i&&a.append("Content-Type",i);var o=s.url,l=null;if(Ui){var c=new Ui;l={signal:c.signal,timeout:setTimeout((()=>c.abort()),s.timeout)}}Ys(o,y({method:s?.method||"GET",headers:a,keepalive:s.method==="POST"&&52428.8>(n||0),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,error:u})})).finally((()=>l?clearTimeout(l.timeout):null))}}),Js&&ts.push({transport:"XHR",method(s){var e,t=new Js;t.open(s.method||"GET",s.url,!0);var{contentType:i,body:r}=(e=Ds(s))!==null&&e!==void 0?e:{};H(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)}}),he!=null&&he.sendBeacon&&ts.push({transport:"sendBeacon",method(s){var e=_s(s.url,{beacon:"1"});try{var t,{contentType:i,body:r}=(t=Ds(s))!==null&&t!==void 0?t:{},n=typeof r=="string"?new Blob([r],{type:i}):r;he.sendBeacon(e,n)}catch{}}});var _i=3e3;class Fo{constructor(e,t){this.wt=!0,this.Et=[],this.St=Pe(t?.flush_interval_ms||_i,250,5e3,w.createLogger("flush interval"),_i),this.xt=e}enqueue(e){this.Et.push(e),this.Tt||this.$t()}unload(){this.kt();var e=this.Et.length>0?this.Rt():{},t=Object.values(e);[...t.filter((i=>i.url.indexOf("/e")===0)),...t.filter((i=>i.url.indexOf("/e")!==0))].map((i=>{this.xt(y({},i,{transport:"sendBeacon"}))}))}enable(){this.wt=!1,this.$t()}$t(){var e=this;this.wt||(this.Tt=setTimeout((()=>{if(this.kt(),this.Et.length>0){var t=this.Rt(),i=function(){var n=t[r],a=new Date().getTime();n.data&&L(n.data)&&H(n.data,(o=>{o.offset=Math.abs(o.timestamp-a),delete o.timestamp})),e.xt(n)};for(var r in t)i()}}),this.St))}kt(){clearTimeout(this.Tt),this.Tt=void 0}Rt(){var e={};return H(this.Et,(t=>{var i,r=t,n=(r?r.batchKey:null)||r.url;k(e[n])&&(e[n]=y({},r,{data:[]})),(i=e[n].data)==null||i.push(r.data)})),this.Et=[],e}}var $o=["retriesPerformedSoFar"];class Io{constructor(e){this.Pt=!1,this.Ot=3e3,this.Et=[],this._instance=e,this.Et=[],this.It=!0,!k(d)&&"onLine"in d.navigator&&(this.It=d.navigator.onLine,this.Ct=()=>{this.It=!0,this.Ft()},this.At=()=>{this.It=!1},G(d,"online",this.Ct),G(d,"offline",this.At))}get length(){return this.Et.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=Kr(e,$o);nt(t)&&(i.url=_s(i.url,{retry_count:t})),this._instance._send_request(y({},i,{callback:r=>{r.statusCode===200||r.statusCode>=400&&500>r.statusCode||(t??0)>=10?i.callback==null||i.callback(r):this.Mt(y({retriesPerformedSoFar:t},i))}}))}Mt(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;return Math.ceil(c+u*(c-l))})(t),r=Date.now()+i;this.Et.push({retryAt:r,requestOptions:e});var n="Enqueued failed request for retry in "+i;navigator.onLine||(n+=" (Browser is offline)"),w.warn(n),this.Pt||(this.Pt=!0,this.Dt())}Dt(){if(this.Lt&&clearTimeout(this.Lt),this.Et.length===0)return this.Pt=!1,void(this.Lt=void 0);this.Lt=setTimeout((()=>{this.It&&this.Et.length>0&&this.Ft(),this.Dt()}),this.Ot)}Ft(){var e=Date.now(),t=[],i=this.Et.filter((n=>e>n.retryAt||(t.push(n),!1)));if(this.Et=t,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Lt&&(clearTimeout(this.Lt),this.Lt=void 0),this.Pt=!1,k(d)||(this.Ct&&(d.removeEventListener("online",this.Ct),this.Ct=void 0),this.At&&(d.removeEventListener("offline",this.At),this.At=void 0)),this.Et))try{this._instance._send_request(y({},e,{transport:"sendBeacon"}))}catch(t){w.error(t)}this.Et=[]}}class Oo{constructor(e){this.Ut=()=>{var t,i,r,n;this.Nt||(this.Nt={});var a=this.scrollElement(),o=this.scrollY(),l=a?Math.max(0,a.scrollHeight-a.clientHeight):0,c=o+(a?.clientHeight||0),u=a?.scrollHeight||0;this.Nt.lastScrollY=Math.ceil(o),this.Nt.maxScrollY=Math.max(o,(t=this.Nt.maxScrollY)!==null&&t!==void 0?t:0),this.Nt.maxScrollHeight=Math.max(l,(i=this.Nt.maxScrollHeight)!==null&&i!==void 0?i:0),this.Nt.lastContentY=c,this.Nt.maxContentY=Math.max(c,(r=this.Nt.maxContentY)!==null&&r!==void 0?r:0),this.Nt.maxContentHeight=Math.max(u,(n=this.Nt.maxContentHeight)!==null&&n!==void 0?n:0)},this._instance=e}get jt(){return this._instance.config.scroll_root_selector}getContext(){return this.Nt}resetContext(){var e=this.Nt;return setTimeout(this.Ut,0),e}startMeasuringScrollPosition(){G(d,"scroll",this.Ut,{capture:!0}),G(d,"scrollend",this.Ut,{capture:!0}),G(d,"resize",this.Ut)}scrollElement(){if(!this.jt)return d?.document.documentElement;var e=L(this.jt)?this.jt:[this.jt];for(var t of e){var i=d?.document.querySelector(t);if(i)return i}}scrollY(){if(this.jt){var e=this.scrollElement();return e&&e.scrollTop||0}return d&&(d.scrollY||d.pageYOffset||d.document.documentElement.scrollTop)||0}scrollX(){if(this.jt){var e=this.scrollElement();return e&&e.scrollLeft||0}return d&&(d.scrollX||d.pageXOffset||d.document.documentElement.scrollLeft)||0}}var Co=s=>Rn(s?.config.mask_personal_data_properties,s?.config.custom_personal_data_properties);
1class fr{constructor(e,t,i,r){this.zt=n=>{var a=this.Bt();if(!a||a.sessionId!==n){var o={sessionId:n,props:this.Ht(this._instance)};this.qt.register({[li]:o})}},this._instance=e,this.Wt=t,this.qt=i,this.Ht=r||Co,this.Wt.onSessionId(this.zt)}Bt(){return this.qt.props[li]}getSetOnceProps(){var e,t=(e=this.Bt())==null?void 0:e.props;return t?"r"in t?Mn(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 H(Oi(this.getSetOnceProps()),((t,i)=>{i==="$current_url"&&(i="url"),e["$session_entry_"+Xs(i)]=t})),e}}class Ri{constructor(){this.Vt={}}on(e,t){return this.Vt[e]||(this.Vt[e]=[]),this.Vt[e].push(t),()=>{this.Vt[e]=this.Vt[e].filter((i=>i!==t))}}emit(e,t){for(var i of this.Vt[e]||[])i(t);for(var r of this.Vt["*"]||[])r(e,t)}}var qs=z("[SessionId]");class _r{on(e,t){return this.Yt.on(e,t)}constructor(e,t,i){var r;if(this.Gt=[],this.Jt=void 0,this.Yt=new Ri,this.Kt=(c,u)=>!(!nt(c)||!nt(u))&&Math.abs(c-u)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===xe)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.N=e.config,this.qt=e.persistence,this.Xt=void 0,this.Qt=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Zt=t||Ve,this.ti=i||Ve;var n=this.N.persistence_name||this.N.token;if(this._sessionTimeoutMs=1e3*Pe(this.N.session_idle_timeout_seconds||1800,60,36e3,qs.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ii(),this.ei="ph_"+n+"_window_id",this.ri="ph_"+n+"_primary_window_exists",this.si()){var a=Q.D(this.ei),o=Q.D(this.ri);a&&!o?this.Xt=a:Q.U(this.ei),Q.L(this.ri,!0)}if((r=this.N.bootstrap)!=null&&r.sessionID)try{var l=(c=>{var u=this.N.bootstrap.sessionID.replace(/-/g,"");if(u.length!==32)throw new Error("Not a valid UUID");if(u[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(u.substring(0,12),16)})();this.ni(this.N.bootstrap.sessionID,new Date().getTime(),l)}catch(c){qs.error("Invalid sessionID in bootstrap",c)}this.oi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return k(this.Gt)&&(this.Gt=[]),this.Gt.push(e),this.Qt&&e(this.Qt,this.Xt),()=>{this.Gt=this.Gt.filter((t=>t!==e))}}si(){return this.N.persistence!=="memory"&&!this.qt.st&&Q.F()}ai(e){e!==this.Xt&&(this.Xt=e,this.si()&&Q.L(this.ei,e))}li(){return this.Xt?this.Xt:this.si()?Q.D(this.ei):null}ni(e,t,i){e===this.Qt&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Qt=e,this.qt.register({[ns]:[t,e,i]}))}ui(){var e=this.qt.props[ns];return L(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.ni(null,null,null)}destroy(){clearTimeout(this.hi),this.hi=void 0,this.Jt&&d&&(d.removeEventListener(cs,this.Jt,{capture:!1}),this.Jt=void 0),this.Gt=[]}oi(){this.Jt=()=>{this.si()&&Q.U(this.ri)},G(d,cs,this.Jt,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(e===void 0&&(e=!1),t===void 0&&(t=null),this.N.cookieless_mode===xe)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||new Date().getTime(),[r,n,a]=this.ui(),o=this.li(),l=nt(a)&&Math.abs(i-a)>864e5,c=!1,u=!n,h=!u&&!e&&this.Kt(i,r);u||h||l?(n=this.Zt(),o=this.ti(),qs.info("new session ID generated",{sessionId:n,windowId:o,changeReason:{noSessionId:u,activityTimeout:h,sessionPastMaximumLength:l}}),a=i,c=!0):o||(o=this.ti(),c=!0);var v=nt(r)&&e&&!l?r:i,g=nt(a)?a:new Date().getTime();return this.ai(o),this.ni(n,v,g),e||this.ii(),c&&this.Gt.forEach((f=>f(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}}ii(){clearTimeout(this.hi),this.hi=setTimeout((()=>{var[e]=this.ui();if(this.Kt(new Date().getTime(),e)){var t=this.Qt;this.resetSessionId(),this.Yt.emit("forcedIdleReset",{idleSessionId:t})}}),1.1*this.sessionTimeoutMs)}}var Un=function(s,e){if(!s)return!1;var t=s.userAgent;if(t&&Wi(t,e))return!0;try{var i=s?.userAgentData;if(i!=null&&i.brands&&i.brands.some((r=>Wi(r?.brand,e))))return!0}catch{}return!!s.webdriver},ms=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 mr(s,e,t){return Rt({distinct_id:s,userPropertiesToSet:e,userPropertiesToSetOnce:t})}var Vn={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=>ms(t,i))))),not_regex:(s,e)=>e.every((t=>s.every((i=>!ms(t,i))))),icontains:(s,e)=>e.map(Zt).some((t=>s.map(Zt).some((i=>t.includes(i))))),not_icontains:(s,e)=>e.map(Zt).every((t=>s.map(Zt).every((i=>!t.includes(i))))),gt:(s,e)=>e.some((t=>{var i=parseFloat(t);return!isNaN(i)&&s.some((r=>i>parseFloat(r)))})),lt:(s,e)=>e.some((t=>{var i=parseFloat(t);return!isNaN(i)&&s.some((r=>i<parseFloat(r)))}))},Zt=s=>s.toLowerCase();function zn(s,e){return!s||Object.entries(s).every((t=>{var[i,r]=t,n=e?.[i];if(k(n)||Ae(n))return!1;var a=[String(n)],o=Vn[r.operator];return!!o&&o(r.values,a)}))}var mi="custom",yr="i.posthog.com";class To{constructor(e){this.di={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,t=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+yr,".posthog.com")),t==="https://app.posthog.com"?"https://us.posthog.com":t}get region(){return this.di[this.apiHost]||(this.di[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":mi),this.di[this.apiHost]}endpointFor(e,t){if(t===void 0&&(t=""),t&&(t=t[0]==="/"?t:"/"+t),e==="ui")return this.uiHost+t;if(e==="flags")return this.flagsApiHost+t;if(this.region===mi)return this.apiHost+t;var i=yr+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var j=z("[Surveys]"),yi="seenSurvey_",Ro=(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},br=s=>((e,t)=>{var i=""+yi+t.id;return t.current_iteration&&t.current_iteration>0&&(i=""+yi+t.id+"_"+t.current_iteration),i})(0,s),Mo=[Ms.Popover,Ms.Widget,Ms.API],No={ignoreConditions:!1,ignoreDelay:!1,displayType:pi.Popover}
1,Ao=z("[PostHog ExternalIntegrations]"),Lo={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class Do{constructor(e){this._instance=e}Y(e,t){var i;(i=O.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,e,(r=>{if(r)return Ao.error("failed to load script",r);t()}))}startIfEnabledOrStop(){var e=this,t=function(a){var o,l,c;!r||(o=O.__PosthogExtensions__)!=null&&(o=o.integrations)!=null&&o[a]||e.Y(Lo[a],(()=>{var u;(u=O.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.start(e._instance)})),!r&&(l=O.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]&&((c=O.__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 Lt={},js=0,bi=()=>{},wr='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',xt="Surveys module not available",Er="sanitize_properties is deprecated. Use before_send instead",Wn="Invalid value for property_denylist config: ",ot="posthog",Bn=!Po&&ae?.indexOf("MSIE")===-1&&ae?.indexOf("Mozilla")===-1,xr=s=>{var e;return y({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:io(b?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:bi,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:s??"unset",__preview_deferred_init_extensions:!1,debug:Z&&Y(Z?.search)&&Z.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(d==null||(e=d.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,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(t){w.error("Bad HTTP status: "+t.statusCode+" "+t.text)},get_device_id:t=>t,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:di,before_send:void 0,request_queue_config:{flush_interval_ms:_i},error_tracking:{},_onCapture:bi,__preview_eager_load_replay:!1},(t=>({rageclick:!t||"2025-11-30">t||{content_ignorelist:!0},capture_pageview:!t||"2025-05-24">t||"history_change",session_recording:t&&t>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:t&&t>="2026-01-30"?"head":"body",internal_or_test_user_hostname:t&&t>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(s))},qo=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["store_google","save_campaign_params"],["verbose","debug"]],kr=s=>{var e={};for(var[t,i]of qo)k(s[t])||(e[i]=s[t]);var r=B({},e,s);return L(s.property_blacklist)&&(k(s.property_denylist)?r.property_denylist=s.property_blacklist:L(s.property_denylist)?r.property_denylist=[...s.property_blacklist,...s.property_denylist]:w.error(Wn+s.property_denylist)),r};class jo{constructor(){this.__forceAllowLocalhost=!1}get vi(){return this.__forceAllowLocalhost}set vi(e){w.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class Se{ci(e,t){if(e){var i=this.fi.indexOf(e);i!==-1&&this.fi.splice(i,1)}return this.fi.push(t),t.initialize==null||t.initialize(),t}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(){var e;this.webPerformance=new jo,this.pi=!1,this.version=_e.LIB_VERSION,this.gi=new Ri,this.fi=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=xr(),this.SentryIntegration=vo,this.sentryIntegration=i=>(function(r,n){var a=$n(r,n);return{name:Fn,processEvent:o=>a(o)}})(this,i),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.mi=!1,this.bi=null,this.yi=null,this.wi=null,this.scrollManager=new Oo(this),this.pageViewM
1anager=new lr(this),this.rateLimiter=new bo(this),this.requestRouter=new To(this),this.consent=new co(this),this.externalIntegrations=new Do(this);var t=(e=Se.__defaultExtensionClasses)!==null&&e!==void 0?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(i,r,n)=>{var a=Y(i)?{[i]:r}:i;this.setPersonProperties(a),n?.({})},set_once:(i,r,n)=>{var a=Y(i)?{[i]:r}:i;this.setPersonProperties(void 0,a),n?.({})}},this.on("eventCaptured",(i=>w.info('send "'+i?.event+'"',i)))}init(e,t,i){if(i&&i!==ot){var r,n=(r=Lt[i])!==null&&r!==void 0?r:new Se;return n._init(e,t,i),Lt[i]=n,Lt[ot][i]=n,n}return this._init(e,t,i)}_init(e,t,i){var r;if(t===void 0&&(t={}),k(e)||Ks(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.Ei(t.debug),this.Si=t,this.xi=[],t.person_profiles?this.yi=t.person_profiles:t.process_person&&(this.yi=t.process_person),this.set_config(B({},xr(t.defaults),kr(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:Re.GZipJS;var n=this.Ti();this.persistence=new Rs(this.config,n),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Rs(y({},this.config,{persistence:"sessionStorage"}),n);var a=y({},this.persistence.props),o=y({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.$i=new Fo((p=>this.ki(p)),this.config.request_queue_config),this.Ri=new Io(this),this.__request_queue=[];var l=this.config.cookieless_mode===xe||this.config.cookieless_mode===Oe&&this.consent.isExplicitlyOptedOut();if(l||(this.sessionManager=new _r(this),this.sessionPropsManager=new fr(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(w.info("Deferring extension initialization to improve startup performance"),setTimeout((()=>{this.Pi(l)}),0)):(w.info("Initializing extensions synchronously"),this.Pi(l)),_e.DEBUG=_e.DEBUG||this.config.debug,_e.DEBUG&&w.info("Starting in debug mode",{this:this,config:t,thisC:y({},this.config),p:a,s:o}),((r=t.bootstrap)==null?void 0:r.distinctID)!==void 0){var c=t.bootstrap.distinctID,u=this.get_distinct_id(),h=this.persistence.get_property(Ee);if(t.bootstrap.isIdentifiedID&&u!=null&&u!==c&&h===tt)this.identify(c);else if(t.bootstrap.isIdentifiedID&&u!=null&&u!==c&&h===st)w.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var v=this.config.get_device_id(Ve()),g=t.bootstrap.isIdentifiedID?v:c;this.persistence.set_property(Ee,t.bootstrap.isIdentifiedID?st:tt),this.register({distinct_id:c,$device_id:g})}}if(l)this.register_once({distinct_id:_t,$device_id:null},"");else if(!this.get_distinct_id()){var f=this.config.get_device_id(Ve());this.register_once({distinct_id:f,$device_id:f},""),this.persistence.set_property(Ee,tt)}return G(d,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?(function(p,C){var $=p.config.segment;if(!$)return C();(function(P,I){var S=P.config.segment;if(!S)return I();var E=m=>{var _=()=>m.anonymousId()||Ve();P.config.get_device_id=_,m.id()&&(P.register({distinct_id:m.id(),$device_id:_()}),P.persistence.set_property(Ee,st)),I()},x=S.user();"then"in x&&Te(x.then)?x.then(E):E(x)})(p,(()=>{$.register((P=>{Promise&&Promise.resolve||Ts.warn("This browser does not have Promise support, and can not use the segment integration");var I=(S,E)=>{if(!E)return S;S.event.userId||S.event.anonymousId===P.get_distinct_id()||(Ts.info("No userId set, resetting PostHog"),P.reset()),S.event.userId&&S.event.userId!==P.get_distinct_id()&&(Ts.info("UserId set, identifying with PostHog"),P.identify(S.event.userId)
1);var x=P.calculateEventProperties(E,S.event.properties);return S.event.properties=Object.assign({},x,S.event.properties),S};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:S=>I(S,S.event.event),page:S=>I(S,at),identify:S=>I(S,Os),screen:S=>I(S,"$screen")}})(p)).then((()=>{C()}))}))})(this,(()=>this.Oi())):this.Oi(),Te(this.config._onCapture)&&this.config._onCapture!==bi&&(w.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",(p=>this.config._onCapture(p.event,p)))),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}Pi(e){var t,i,r,n,a,o,l,c=performance.now(),u=y({},Se.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.featureFlags&&this.fi.push(this.featureFlags=(t=this.featureFlags)!==null&&t!==void 0?t:new u.featureFlags(this)),u.exceptions&&this.fi.push(this.exceptions=(i=this.exceptions)!==null&&i!==void 0?i:new u.exceptions(this)),u.historyAutocapture&&this.fi.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.fi.push(new u.tracingHeaders(this)),u.siteApps&&this.fi.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!e&&this.fi.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push((()=>{this.scrollManager.startMeasuringScrollPosition()})),u.autocapture&&this.fi.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.fi.push(this.surveys=(r=this.surveys)!==null&&r!==void 0?r:new u.surveys(this)),u.logs&&this.fi.push(this.logs=(n=this.logs)!==null&&n!==void 0?n:new u.logs(this)),u.conversations&&this.fi.push(this.conversations=(a=this.conversations)!==null&&a!==void 0?a:new u.conversations(this)),u.productTours&&this.fi.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.fi.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.fi.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.fi.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.fi.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,po)),u.toolbar&&this.fi.push(this.toolbar=(o=this.toolbar)!==null&&o!==void 0?o:new u.toolbar(this)),u.experiments&&this.fi.push(this.experiments=(l=this.experiments)!==null&&l!==void 0?l:new u.experiments(this)),this.fi.forEach((v=>{v.initialize&&h.push((()=>{v.initialize==null||v.initialize()}))})),h.push((()=>{if(this.Ii){var v=this.Ii;this.Ii=void 0,this.ft(v)}})),this.Ci(h,c)}Ci(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout((()=>{this.Ci(e,t)}),0);var i=e.shift();if(i)try{i()}catch(n){w.error("Error initializing extension:",n)}}var r=Math.round(performance.now()-t);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&w.info("PostHog extensions initialized ("+r+"ms)")}ft(e){var t;if(!b||!b.body)return w.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout((()=>{this.ft(e)}),500);this.config.__preview_deferred_init_extensions&&(this.Ii=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=R(e.supportedCompression,Re.GZipJS)?Re.GZipJS:R(e.supportedCompression,Re.Base64)?Re.Base64:void 0),(t=e.analytics)!=null&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.yi?this.yi:di}),this.fi.forEach((i=>i.onRemoteConfig==null?void 0:i.onRemoteConfig(e)))}Oi(){try{this.config.loaded(this)}catch(i){w.critical("`loaded` function failed",i)}if(this.Fi(),this.config.internal_or_test_user_hostname&&Z!=null&&Z.hostname){var e=Z.hostname,t=this.config.internal_or_test_user_hostname;(typeof t=="string"?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout((()=>{(this.consent.isOptedIn()||this.config.cookieless_mode===xe)&&this.Ai()}),1),this.Mi=new An(this),this.Mi.load()}Fi(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.$i)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Yt(this.__request_queue,(e=>this.ki(e))),this.__request_queue=[],this.Fi()}_handle_unload(){var e,t,i;(e=this.surveys)==null||e.handlePageUnload(),this.config.request_batching?(this.Di()&&this.capture(Is),(t=this.$i)==null||t.unload(),(i=this.Ri)==null||i.unload()):this.Di()&&this.capture(Is,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(Bn?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=_s(e.url,{ip:this.config.ip?1:0}),e.headers=y({},this.config.request_headers,e.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,
1(t=>{var i,r,n,a=y({},t);a.timeout=a.timeout||6e4,a.url=_s(a.url,{_:new Date().getTime().toString(),ver:_e.JS_SDK_VERSION,compression:a.compression});var o=(i=a.transport)!==null&&i!==void 0?i:"fetch",l=ts.filter((u=>!a.disableTransport||!u.transport||!a.disableTransport.includes(u.transport))),c=(r=(n=(function(u,h){for(var v=0;u.length>v;v++)if(u[v].transport===o)return u[v]})(l))==null?void 0:n.method)!==null&&r!==void 0?r:l[0].method;if(!c)throw new Error("No available transport method");c(a)})(y({},e,{callback:t=>{var i,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||(i=(r=this.config).on_request_error)==null||i.call(r,t),e.callback==null||e.callback(t)}}))))}ki(e){this.Ri?this.Ri.retriableRequest(e):this._send_request(e)}_execute_array(e){js++;try{var t,i=[],r=[],n=[];Yt(e,(o=>{o&&(L(t=o[0])?n.push(o):Te(o)?o.call(this):L(o)&&t==="alias"?i.push(o):L(o)&&t.indexOf("capture")!==-1&&Te(this[t])?n.push(o):r.push(o))}));var a=function(o,l){Yt(o,(function(c){if(L(c[0])){var u=l;H(c,(function(h){u=u[h[0]].apply(u,h.slice(1))}))}else l[c[0]].apply(l,c.slice(1))}))};a(i,this),a(r,this),a(n,this)}finally{js--}}push(e){if(js>0&&L(e)&&Y(e[0])){var t=Se.prototype[e[0]];Te(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var r,n,a,o,l,c;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$i){if(this.is_capturing())if(!k(e)&&Y(e)){var u=!this.config.opt_out_useragent_filter&&this._is_bot();if(!u||this.config.__preview_capture_bot_pageviews){var h=i!=null&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(h==null||!h.isRateLimited){t!=null&&t.$current_url&&!Y(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),e!=="$exception"||i!=null&&i.Li||w.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var v=new Date,g=i?.timestamp||v,f=Ve(),p={uuid:f,event:e,properties:this.calculateEventProperties(e,t||{},g,f)};e===at&&this.config.__preview_capture_bot_pageviews&&u&&(p.event="$bot_pageview",p.properties.$browser_type="bot"),h&&(p.properties.$lib_rate_limit_remaining_tokens=h.remainingTokens),i?.$set&&(p.$set=i?.$set);var C,$=this.Ui(i?.$set_once,e!==rr,e===Os);if($&&(p.$set_once=$),(n=p,a=i!=null&&i._noTruncate?null:this.config.properties_string_max_length,o=n,l=_=>Y(_)&&!Ae(a)?_.slice(0,a):_,c=new Set,p=(function _(F,A){return F!==Object(F)?l?l(F):F:c.has(F)?void 0:(c.add(F),L(F)?(N=[],Yt(F,(T=>{N.push(_(T))}))):(N={},H(F,((T,q)=>{c.has(T)||(N[q]=_(T))}))),N);var N})(o)).timestamp=g,k(i?.timestamp)||(p.properties.$event_time_override_provided=!0,p.properties.$event_time_override_system_time=v),e===Tt.DISMISSED||e===Tt.SENT){var P=t?.[Ns.SURVEY_ID],I=t?.[Ns.SURVEY_ITERATION];C={id:P,current_iteration:I},localStorage.getItem(br(C))||localStorage.setItem(br(C),"true"),p.$set=y({},p.$set,{[Ro({id:P,current_iteration:I},e===Tt.SENT?"responded":"dismissed")]:!0})}else e===Tt.SHOWN&&(p.$set=y({},p.$set,{[Ns.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));if(e===yo.SHOWN){var S=t?.[cr.TOUR_TYPE];S&&(p.$set=y({},p.$set,{[cr.TOUR_LAST_SEEN_DATE+"/"+S]:new Date().toISOString()}))}var E=y({},p.properties.$set,p.$set);if(lt(E)||this.setPersonPropertiesForFlags(E),!M(this.config.before_send)){var x=this.Ni(p);if(!x)return;p=x}this.gi.emit("eventCaptured",p);var m={method:"POST",url:(r=i?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:p,compression:"best-available",batchKey:i?._batchKey};return!this.config.request_batching||i&&(i==null||!i._batchKey)||i!=null&&i.send_instantly?this.ki(m):this.$i.enqueue(m),p}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")}_addCaptureHook(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=y({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,(this.config.cookieless_mode==xe||this.config.cookieless_mode==Oe&&this.consent.isExplicitlyOptedOut())&&(o.$cookieless_mode=!0),e==="$snapshot"){var l=y({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!Y(o.distinct_id)&&!Fe(o.distinct_id)||Ks(o.distinct_id))&&w.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var c,u=(function($,P){var I,S,E,x;if(!ae)return{};var m,_,F,A,N,T,q,D,J=$?[...gt,...P||[]]:[],[K,ne]=(function(W){for(var se=0;Yi.length>se;se++){var[pe,ve]=Yi[se],$e=pe.exec(W),le=$e&&(Te(ve)?ve($e,W):ve);if(le)return le}return["",""]})(ae);return B(Oi({$os:K,$os_version:ne,$browser:_n(ae,navigator.vendor),$device:Ji(ae),$device_type:(_=ae,F={userAgentDataPlatform:(I=navigator)==null||(I=I.userAgentData)==null?void 0:I.platform,maxTouchPoints:(S=navigator)==null?void 0:S.maxTouchPoints,screenWidth:d==null||(E=d.screen)==null?void 0:E.width,screenHeight:d==null||(x=d.screen)==null?void 0:x.height,devicePixelRatio:d?.devicePixelRatio},D=Ji(_),D===sn||D===tn||D==="Kobo"||D==="Kindle Fire"||D===fn?dt:D===qt||D===ht||D===jt||D===Qs?"Console":D===nn?"Wearable":D?de:F?.userAgentDataPlatform==="Android"&&((A=F?.maxTouchPoints)!==null&&A!==void 0?A:0)>0?600>Math.min((N=F?.screenWidth)!==null&&N!==void 0?N:0,(T=F?.screenHeight)!==null&&T!==void 0?T:0)/((q=F?.devicePixelRatio)!==null&&q!==void 0?q:1)?de:dt:"Desktop"),$timezone:Nn(),$timezone_offset:_o()}),{$current_url:Ht(Z?.href,J,Ut),$host:Z?.host,$pathname:Z?.pathname,$raw_user_agent:ae.length>1e3?ae.substring(0,997)+"...":ae,$browser_version:Ta(ae,navigator.vendor),$browser_language:ur(),$browser_language_prefix:(m=ur(),typeof m=="string"?m.split("-")[0]:void 0),$screen_height:d?.screen.height,$screen_width:d?.screen.width,$viewport_height:d?.innerHe
1ight,$viewport_width:d?.innerWidth,$lib:_e.LIB_NAME,$lib_version:_e.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})})(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:v}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());o.$session_id=h,o.$window_id=v}this.sessionPropsManager&&B(o,this.sessionPropsManager.getSessionProps());try{var g;this.sessionRecording&&B(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=(g=this.Ri)==null?void 0:g.length}catch($){o.$sdk_debug_error_capturing_properties=String($)}if(this.requestRouter.region===mi&&(o.$lib_custom_api_host=this.config.api_host),c=e!==at||n?e!==Is||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),o=B(o,c),e===at&&b&&(o.title=b.title),!k(a)){var f=i.getTime()-a;o.$duration=parseFloat((f/1e3).toFixed(3))}ae&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser"),(o=B({},u,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),L(this.config.property_denylist)?H(this.config.property_denylist,(function($){delete o[$]})):w.error(Wn+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;p&&(w.error(Er),o=p(o,e));var C=this.ji();return o.$process_person_profile=C,C&&!n&&this.zi("_calculate_event_properties"),o}Ui(e,t,i){var r;if(t===void 0&&(t=!0),i===void 0&&(i=!1),!this.persistence||!this.ji()||this.pi&&!i)return e;var n=this.persistence.get_initial_props(),a=(r=this.sessionPropsManager)==null?void 0:r.getSetOnceProps(),o=B({},n,a||{},e||{}),l=this.config.sanitize_properties;return l&&(w.error(Er),o=l(o,"$set_once")),t&&(this.pi=!0),lt(o)?void 0:o}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)}Bi(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var i;return(i=this.featureFlags)==null?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return(t=this.featureFlags)==null?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return(i=this.featureFlags)==null?void 0:i.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){var i;return(i=this.featureFlags)==null?void 0:i.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;(e=this.featureFlags)==null||e.reloadFeatureFlags()}updateFlags(e,t,i){var r;(r=this.featureFlags)==null||r.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var r;(r=this.featureFlags)==null||r.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){var r;return t===void 0&&(t=!1),(r=this.featureFlags)==null?void 0:r.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.gi.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:xt}),()=>{})}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?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:xt})}getActiveMatchingSurveys(e,t){t===void 0&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:xt})}renderSurvey(e,t){var i;(i=this.surveys)==null||i.renderSurvey(e,t)}displaySurvey(e,t){var i;t===void 0&&(t=No),(i=this.surveys)==null||i.displaySurvey(e,t)}cancelPendingSurvey(e){var t;(t=this.surveys)==null||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,i;return(t=(i=this.surveys)==null?void 0:i.canRenderSurvey(e))!==null&&t!==void 0?t:{visible:!1,disabledReason:xt}}canRenderSurveyAsync(e,t){var i,r;return t===void 0&&(t=!1),(i=(r=this.surveys)==null?void 0:r.canRenderSurveyAsync(e,t))!==null&&i!==void 0?i:Promise.resolve({visible:!1,disabledReason:xt})}identify(e,t,i){if(!this.__loaded||!this.persistence)return w.uninitializedWarning("posthog.identify");if(Fe(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 n
1ot a hardcoded string.');else if(e!==_t){if(this.zi("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(rs)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property($t)&&(this.unregister($t),this.register({distinct_id:e}));var n,a=(this.persistence.get_property(Ee)||tt)===tt;e!==r&&a?(this.persistence.set_property(Ee,st),this.setPersonPropertiesForFlags(y({},i||{},t||{}),!1),this.capture(Os,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.wi=mr(e,t,i),(n=this.featureFlags)==null||n.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(Nt))}}else w.critical('The string "'+_t+'" 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.zi("posthog.setPersonProperties")){var i=mr(this.get_distinct_id(),e,t);this.wi!==i?(this.setPersonPropertiesForFlags(y({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.wi=i):w.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:y({},r,{[e]:t})}),i&&(this.capture(rr,{$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){var i;t===void 0&&(t=!0),(i=this.featureFlags)==null||i.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){var e;(e=this.featureFlags)==null||e.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){var i;t===void 0&&(t=!0),this.zi("posthog.setGroupPropertiesForFlags")&&((i=this.featureFlags)==null||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;(t=this.featureFlags)==null||t.resetGroupPropertiesForFlags(e)}reset(e){var t,i,r,n,a,o,l;if(w.info("reset"),!this.__loaded)return w.uninitializedWarning("posthog.reset");var c=this.get_property(rs);if(this.consent.reset(),(t=this.persistence)==null||t.clear(),(i=this.sessionPersistence)==null||i.clear(),(r=this.surveys)==null||r.reset(),(n=this.Mi)==null||n.stop(),(a=this.featureFlags)==null||a.reset(),(o=this.persistence)==null||o.set_property(Ee,tt),(l=this.sessionManager)==null||l.resetSessionId(),this.wi=null,this.config.cookieless_mode===xe)this.register_once({distinct_id:_t,$device_id:null},"");else{var u=this.config.get_device_id(Ve());this.register_once({distinct_id:u,$device_id:e?u:c},"")}this.register({$last_posthog_reset:new Date().toISOString()},1),this.reloadFeatureFlags()}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(wn)?(w.critical("Attempting to create alias for existing People user - aborting."),-2):this.zi("posthog.alias")?(k(t)&&(t=this.get_distinct_id()),e!==t?(this.Bi($t,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=y({},this.config);if(X(e)){var i,r,n,a,o,l,c,u,h;B(this.config,kr(e));var v=this.Ti();(i=this.persistence)==null||i.update_config(this.config,t,v),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Rs(y({},this.config,{persistence:"sessionStorage"}),v);var g=this.Ei(this.config.debug);Me(g)&&(this.config.debug=g),Me(this.config.debug)&&(this.config.debug?(_e.DEBUG=!0,V.F()&&V.L("ph_debug",!0),w.info("set_config",{config:e,oldConfig:t,newConfig:y({},this.config)})):(_e.DEBUG=!1,V.F()&&V.U("ph_debug"))),(r=this.exceptionObserver)==null||r.onConfigChange(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),(a=this.autocapture)==null||a.startIfEnabled(),(o=this.heatmaps)==null||o.startIfEnabled(),(l=this.exceptionObserver)==null||l.startIfEnabledOrStop(),(c=this.deadClicksAutocapture)==null||c.startIfEnabledOrStop(),(u=this.surveys)==null||u.loadIfEnabled(),this.Hi(),(h=this.externalIntegrations)==null||h.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){_e.LIB_NAME=e,_e.LIB_VERSION=t}startSessionRecording(e){var t,i,r,n,a,o=e===!0,l={sampling:o||!(e==null||!e.sampling),linked_flag:o||!(e==null||!e.linked_flag),url_trigger:o||!(e==null||!e.url_trigger),event_trigger:o||!(e==null||!e.event_trigger)};Object.values(l).some(Boolean)&&((t=this.sessionManager)==null||t.checkAndGetSessionAndWindowId(),l.sampling&&((i=this.sessionRecording)==null||i.overrideSampling()),l.linked_flag&&((r=this.sessionRecording)==null||r.overrideLinkedFlag()),l.url_trigger&&((n=this.sessionRecording)==null||n.overrideTrigger("url")),l.event_trigger&&((a=this.sessionRecording)==null||a.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){if(this.exceptions){var i=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(y({},r,t))}}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,i;return(t=(i=this.toolbar)==null?void 0:i.loadToolbar(e))!==null&&t!==void 0&&t}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:ot;return t!==ot&&(t=ot+"."+t),t}_isIdentified(){var e,t;return((e=this.persistence)==null?void 0:e.get_property(Ee))===st||((t=this.sessionPersistence)==null?void 0:t.get_property(Ee))===st}ji(){var e,t;return!(this.config.person_profiles==="never"||this.config.person_profiles===di&&!this._isIdentified()&<(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[$t])&&((t=this.persistence)==null||(t=t.props)==null||!t[ls]))}Di(){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.ji()||this.zi("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.zi("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}zi(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.Bi(ls,!0),!0)}Ti(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&this.config.cookieless_mode!==Oe)}Hi(){var e,t,i,r,n=this.Ti();return((e=this.persistence)==null?void 0:e.st)!==n&&((i=this.persistence)==null||i.set_disabled(n)),((t=this.sessionPersistence)==null?void 0:t.st)!==n&&((r=this.sessionPersistence)==null||r.set_disabled(n)),n}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==xe){if(this.config.cookieless_mode===Oe&&this.consent.isExplicitlyOptedOut()){var i,r,n,a,o;this.reset(!0),(i=this.sessionManager)==null||i.destroy(),(r=this.pageViewM
1anager)==null||r.destroy(),this.sessionManager=new _r(this),this.pageViewManager=new lr(this),this.persistence&&(this.sessionPropsManager=new fr(this,this.sessionManager,this.persistence));var l=(n=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&n!==void 0?n:(o=Se.__defaultExtensionClasses)==null?void 0:o.sessionRecording;l&&(this.sessionRecording=this.ci(this.sessionRecording,new l(this)))}var c,u;this.consent.optInOut(!0),this.Hi(),this.Fi(),(t=this.sessionRecording)==null||t.startIfEnabledOrStop(),this.config.cookieless_mode==Oe&&((c=this.surveys)==null||c.loadIfEnabled()),(k(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((u=e?.captureEventName)!==null&&u!==void 0?u:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Ai()}else w.warn(wr)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==xe?(this.config.cookieless_mode===Oe&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Hi(),this.config.cookieless_mode===Oe&&(this.register({distinct_id:_t,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),(t=this.pageViewManager)==null||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(i=this.sessionRecording)==null||i.stopRecording(),this.sessionRecording=void 0,this.Ai())):w.warn(wr)}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===1?"granted":e===0?"denied":"pending"}is_capturing(){return this.config.cookieless_mode===xe||(this.config.cookieless_mode===Oe?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Hi()}_is_bot(){return he?Un(he,this.config.custom_blocked_useragents):void 0}Ai(){b&&(b.visibilityState==="visible"?this.mi||(this.mi=!0,this.capture(at,{title:b.title},{send_instantly:!0}),this.bi&&(b.removeEventListener(us,this.bi),this.bi=null)):this.bi||(this.bi=this.Ai.bind(this),G(b,us,this.bi)))}debug(e){e===!1?(d?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(d?.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}))}bt(){var e,t,i,r,n,a,o=this.Si||{};return"advanced_disable_flags"in o?!!o.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=w,n=(t="advanced_disable_flags")in(e=o)&&!M(e[t]),a=i in e&&!M(e[i]),n?e[t]:!!a&&(r&&r.warn("Config field '"+i+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[i]))}Ni(e){if(M(this.config.before_send))return e;var t=L(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var r of t){if(i=r(i),M(i)){var n="Event '"+e.event+"' was rejected in beforeSend function";return ba(e.event)?w.warn(n+". This can cause unexpected behavior."):w.info(n),null}i.properties&&!lt(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.K)==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)})}Ei(e){var t=Me(e)&&!e,i=V.F()&&V.M("ph_debug")==="true";return!t&&(!!i||e)}}function Sr(s){return s instanceof Element&&(s.id===kn||!(s.closest==null||!s.closest(".toolbar-global-fade-container")))}function Es(s){return!!s&&s.nodeType===1}function ze(s,e){return!!s&&!!s.tagName&&s.tagName.toLowerCase()===e.toLowerCase()}function Gn(s){return!!s&&s.nodeType===3}function Yn(s){return!!s&&s.nodeType===11}function Mi(s){return s?bs(s).split(/\s+/):[]}function Pr(s){var e=d?.location.href;return!!(e&&s&&s.some((t=>e.match(t))))}function ys(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 Mi(e)}function Jn(s){return M(s)?null:bs(s).split(/(\s+)/).filter((e=>Dt(e))).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function Vt(s){var e="";return Ei(s)&&!Kn(s)&&s.childNodes&&s.childNodes.length&&H(s.childNodes,(function(t){var i;Gn(t)&&t.textContent&&(e+=(i=Jn(t.textContent))!==null&&i!==void 0?i:"")})),bs(e)}function Fr(s){return k(s.target)?s.srcElement||null:(e=s.target)!=null&&e.shadowRoot?s.composedPath()[0]||null:s.target||null;var e}Se.__defaultExtensionClasses={},(function(s,e){for(var t=0;e.length>t;t++)s.prototype[e[t]]=to(s.prototype[e[t]])})(Se,["identify"]);var Ni=["a","button","form","input","select","textarea","label"];function $r(s,e){if(k(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 Xn(s){var e=s.parentNode;return!(!e||!Es(e))&&e}var Ho=["next","previous","prev",">","<"],Ir=[".ph-no-rageclick",".ph-no-capture"],wi=s=>!s||ze(s,"html")||!Es(s),Or=(s,e)=>{if(!d||wi(s))return{parentIsUsefulElement:!1,targetElementList:[]};for(var t=!1,i=[s],r=s;r.parentNode&&!ze(r,"body");)if(Yn(r.parentNode))i.push(r.parentNode.host),r=r.parentNode.host;else{var n=Xn(r);if(!n)break;if(e||Ni.indexOf(n.tagName.toLowerCase())>-1)t=!0;else{var a=d.getComputedStyle(n);a&&a.getPropertyValue("cursor")==="pointer"&&(t=!0)}i.push(n),r=n}return{parentIsUsefulElement:t,targetElementList:i}};function Ei(s){for(var e=s;e.parentNode&&!ze(e,"body");e=e.parentNode){var t=ys(e);if(R(t,"ph-sensitive")||R(t,"ph-no-capture"))return!1}if(R(ys(s),"ph-include"))return!0;var i=s.type||"";if(Y(i))switch(i.toLowerCase()){case"hidden":case"password":return!1}var r=s.name||s.id||"";return!Y(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 Kn(s){return!!(ze(s,"input")&&!["button","checkbox","submit","reset"].includes(s.type)||ze(s,"select")||ze(s,"textarea")||s.getAttribute("contenteditable")==="true")}var Zn="(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}
1)|((?:2131|1800|35[0-9]{3})[0-9]{11})",Uo=new RegExp("^(?:"+Zn+")$"),Vo=new RegExp(Zn),Qn="\\d{3}-?\\d{2}-?\\d{4}",zo=new RegExp("^("+Qn+")$"),Wo=new RegExp("("+Qn+")");function Dt(s,e){return e===void 0&&(e=!0),!(M(s)||Y(s)&&(s=bs(s),(e?Uo:Vo).test((s||"").replace(/[- ]/g,""))||(e?zo:Wo).test(s)))}function Cr(s){var e=Vt(s);return Dt(e=(e+" "+ea(s)).trim())?e:""}function ea(s){var e="";return s&&s.childNodes&&s.childNodes.length&&H(s.childNodes,(function(t){var i;if(t&&((i=t.tagName)==null?void 0:i.toLowerCase())==="span")try{var r=Vt(t);e=(e+" "+r).trim(),t.childNodes&&t.childNodes.length&&(e=(e+" "+ea(t)).trim())}catch(n){w.error("[AutoCapture]",n)}})),e}function Tr(s){return s.replace(/"|\\"/g,'\\"')}function Bo(s){var e=s.attr__class;return e?L(e)?e:Mi(e):void 0}class Rr{constructor(e){this.disabled=e===!1;var t=X(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>i-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var Hs="$copy_autocapture",Mr=z("[AutoCapture]");function Us(s,e){return e.length>s?e.slice(0,s)+"...":e}function Go(s){if(s.previousElementSibling)return s.previousElementSibling;var e=s;do e=e.previousSibling;while(e&&!Es(e));return e}function Yo(s,e){for(var t,i,{e:r,maskAllElementAttributes:n,maskAllText:a,elementAttributeIgnoreList:o,elementsC
1hainAsString:l}=e,c=[s],u=s;u.parentNode&&!ze(u,"body");)Yn(u.parentNode)?(c.push(u.parentNode.host),u=u.parentNode.host):(c.push(u.parentNode),u=u.parentNode);var h,v,g=[],f={},p=!1,C=!1;if(H(c,(E=>{var x=Ei(E);E.tagName.toLowerCase()==="a"&&(p=E.getAttribute("href"),p=x&&p&&Dt(p)&&p),R(ys(E),"ph-no-capture")&&(C=!0),g.push((function(_,F,A,N){var T=_.tagName.toLowerCase(),q={tag_name:T};Ni.indexOf(T)>-1&&!A&&(q.$el_text=T.toLowerCase()==="a"||T.toLowerCase()==="button"?Us(1024,Cr(_)):Us(1024,Vt(_)));var D=ys(_);D.length>0&&(q.classes=D.filter((function(W){return W!==""}))),H(_.attributes,(function(W){var se;if((!Kn(_)||["name","id","class","aria-label"].indexOf(W.name)!==-1)&&(N==null||!N.includes(W.name))&&!F&&Dt(W.value)&&(!Y(se=W.name)||se.substring(0,10)!=="_ngcontent"&&se.substring(0,7)!=="_nghost")){var pe=W.value;W.name==="class"&&(pe=Mi(pe).join(" ")),q["attr__"+W.name]=Us(1024,pe)}}));for(var J=1,K=1,ne=_;ne=Go(ne);)J++,ne.tagName===_.tagName&&K++;return q.nth_child=J,q.nth_of_type=K,q})(E,n,a,o));var m=(function(_){if(!Ei(_))return{};var F={};return H(_.attributes,(function(A){if(A.name&&A.name.indexOf("data-ph-capture-attribute")===0){var N=A.name.replace("data-ph-capture-attribute-",""),T=A.value;N&&T&&Dt(T)&&(F[N]=T)}})),F})(E);B(f,m)})),C)return{props:{},explicitNoCapture:C};if(a||(g[0].$el_text=s.tagName.toLowerCase()==="a"||s.tagName.toLowerCase()==="button"?Cr(s):Vt(s)),p){var $,P;g[0].attr__href=p;var I=($=ds(p))==null?void 0:$.host,S=d==null||(P=d.location)==null?void 0:P.host;I&&S&&I!==S&&(h=p)}return{props:B({$event_type:r.type,$ce_version:1},l?{}:{$elements:g},{$elements_chain:(v=g,(function(E){return E.map((x=>{var m,_,F="";if(x.tag_name&&(F+=x.tag_name),x.attr_class)for(var A of(x.attr_class.sort(),x.attr_class))F+="."+A.replace(/"/g,"");var N=y({},x.text?{text:x.text}:{},{"nth-child":(m=x.nth_child)!==null&&m!==void 0?m:0,"nth-of-type":(_=x.nth_of_type)!==null&&_!==void 0?_:0},x.href?{href:x.href}:{},x.attr_id?{attr_id:x.attr_id}:{},x.attributes),T={};return es(N).sort(((q,D)=>{var[J]=q,[K]=D;return J.localeCompare(K)})).forEach((q=>{var[D,J]=q;return T[Tr(D.toString())]=Tr(J.toString())})),(F+=":")+es(T).map((q=>{var[D,J]=q;return D+'="'+J+'"'})).join("")})).join(";")})((function(E){return E.map((x=>{var m,_,F={text:(m=x.$el_text)==null?void 0:m.slice(0,400),tag_name:x.tag_name,href:(_=x.attr__href)==null?void 0:_.slice(0,2048),attr_class:Bo(x),attr_id:x.attr__id,nth_child:x.nth_child,nth_of_type:x.nth_of_type,attributes:{}};return es(x).filter((A=>{var[N]=A;return N.indexOf("attr__")===0})).forEach((A=>{var[N,T]=A;return F.attributes[N]=T})),F}))})(v)))},(t=g[0])!=null&&t.$el_text?{$el_text:(i=g[0])==null?void 0:i.$el_text}:{},h&&r.type==="click"?{$external_click_url:h}:{},f)}}var kt=z("[ExceptionAutocapture]");function Nr(s,e,t){try{if(!(e in s))return()=>{};var i=s[e],r=t(i);return Te(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),s[e]=r,()=>{s[e]=i}}catch{return()=>{}}}var Jo=z("[TracingHeaders]"),qe=z("[Web Vitals]"),Ar=9e5,Lr="disabled",Dr="lazy_loading",St="awaiting_config",Qt="missing_config";z("[SessionRecording]");var xi="[SessionRecording]",je=z(xi),Xo=z("[Heatmaps]");function qr(s){return X(s)&&"clientX"in s&&"clientY"in s&&Fe(s.clientX)&&Fe(s.clientY)}var jr=z("[Product Tours]"),Vs="ph_product_tours",Ko=["$set_once","$set"],He=z("[SiteApps]"),Hr="Error while initializing PostHog app with config id ";function rt(s,e,t){if(M(s))return!1;switch(t){case"exact":return s===e;case"contains":var i=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(i,"i").test(s);case"regex":try{return new RegExp(e).test(s)}catch{return!1}default:return!1}}class Zo{constructor(e){this.qi=new Ri,this.Wi=(t,i)=>this.Vi(t,i)&&this.Yi(t,i)&&this.Gi(t,i)&&this.Ji(t,i),this.Vi=(t,i)=>i==null||!i.event||t?.event===i?.event,this._instance=e,this.Ki=new Set,this.Xi=new Set}init(){var e,t;k((e=this._instance)==null?void 0:e._addCaptureHook)||(t=this._instance)==null||t._addCaptureHook(((i,r)=>{this.on(i,r)}))}register(e){var t,i;if(!k((t=this._instance)==null?void 0:t._addCaptureHook)&&(e.forEach((a=>{var o,l;(o=this.Xi)==null||o.add(a),(l=a.steps)==null||l.forEach((c=>{var u;(u=this.Ki)==null||u.add(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?.selector)}))}
1)),(r=this._instance)==null||r.autocapture.setElementSelectors(n)}}on(e,t){var i;t!=null&&e.length!=0&&(this.Ki.has(e)||this.Ki.has(t?.event))&&this.Xi&&((i=this.Xi)==null?void 0:i.size)>0&&this.Xi.forEach((r=>{this.Qi(t,r)&&this.qi.emit("actionCaptured",r.name)}))}Zi(e){this.onAction("actionCaptured",(t=>e(t)))}Qi(e,t){if(t?.steps==null)return!1;for(var i of t.steps)if(this.Wi(e,i))return!0;return!1}onAction(e,t){return this.qi.on(e,t)}Yi(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"||!rt(r,t.url,t.url_matching||"contains"))return!1}return!0}Gi(e,t){return!!this.te(e,t)&&!!this.ie(e,t)&&!!this.ee(e,t)}te(e,t){var i;if(t==null||!t.href)return!0;var r=this.re(e);if(r.length>0)return r.some((o=>rt(o.href,t.href,t.href_matching||"exact")));var n,a=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!a&&rt((n=a.match(/(?::|")href="(.*?)"/))?n[1]:"",t.href,t.href_matching||"exact")}ie(e,t){var i;if(t==null||!t.text)return!0;var r=this.re(e);if(r.length>0)return r.some((c=>rt(c.text,t.text,t.text_matching||"exact")||rt(c.$el_text,t.text,t.text_matching||"exact")));var n,a,o,l=(e==null||(i=e.properties)==null?void 0:i.$elements_chain)||"";return!!l&&(n=(function(c){for(var u,h=[],v=/(?::|")text="(.*?)"/g;!M(u=v.exec(c));)h.includes(u[1])||h.push(u[1]);return h})(l),a=t.text,o=t.text_matching||"exact",n.some((c=>rt(c,a,o))))}ee(e,t){var i,r;if(t==null||!t.selector)return!0;var n=e==null||(i=e.properties)==null?void 0:i.$element_selectors;if(n!=null&&n.includes(t.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";if(t.selector_regex&&a)try{return new RegExp(t.selector_regex).test(a)}catch{return!1}return!1}re(e){var t;return(e==null||(t=e.properties)==null?void 0:t.$elements)==null?[]:e?.properties.$elements}Ji(e,t){return t==null||!t.properties||t.properties.length===0||zn(t.properties.reduce(((i,r)=>{var n=L(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return i[r.key]={values:n,operator:r.operator||"exact"},i}),{}),e?.properties)}}class Qo{constructor(e){this._instance=e,this.se=new Map,this.ne=new Map,this.oe=new Map}ae(e,t){return!!e&&zn(e.propertyFilters,t?.properties)}le(e,t){var i=new Map;return e.forEach((r=>{var n;(n=r.conditions)==null||(n=n[t])==null||(n=n.values)==null||n.forEach((a=>{if(a!=null&&a.name){var o=i.get(a.name)||[];o.push(r.id),i.set(a.name,o)}}))})),i}ue(e,t,i){var r=(i===yt.Activation?this.se:this.ne).get(e),n=[];return this.he((a=>{n=a.filter((o=>r?.includes(o.id)))})),n.filter((a=>{var o,l=(o=a.conditions)==null||(o=o[i])==null||(o=o.values)==null?void 0:o.find((c=>c.name===e));return this.ae(l,t)}))}register(e){var t;k((t=this._instance)==null?void 0:t._addCaptureHook)||(this.de(e),this.ve(e))}ve(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.ce==null&&(this.ce=new Zo(this._instance),this.ce.init(),this.ce.Zi((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.ce)==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.oe.get(c.name);u&&u.push(i.id),this.oe.set(c.name,u||[i.id])}})))})))}de(e){var t,i=e.filter((n=>{var a,o;return((a=n.conditions)==null?void 0:a.events)&&((o=n.conditions)==null||(o=o.events)==null||(o=o.values)==null?void 0:o.length)>0})),r=e.filter((n=>{var a,o;return((a=n.conditions)==null?void 0:a.cancelEvents)&&((o=n.conditions)==null||(o=o.cancelEvents)==null||(o=o.values)==null?void 0:o.length)>0}));i.length===0&&r.length===0||((t=this._instance)==null||t._addCaptureHook(((n,a)=>{this.onEvent(n,a)})),this.se=this.le(e,yt.Activation),this.ne=this.le(e,yt.Cancellation))}onEvent(e,t){var i,r=this.fe(),n=this.pe(),a=this._e(),o=((i=this._instance)==null||(i=i.persistence)==null?void 0:i.props[n])||[];if(a===e&&t&&o.length>0){var l,c;r.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:o});var u=(t==null||(l=t.properties)==null?void 0:l.$survey_id)||(t==null||(c=t.properties)==null?void 0:c.$product_tour_id);if(u){var h=o.indexOf(u);0>h||(o.splice(h,1),this.ge(o))}}else{if(this.ne.has(e)){var v=this.ue(e,t,yt.Cancellation);v.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:v.map((f=>f.id))}),v.forEach((f=>{var p=o.indexOf(f.id);0>p||o.splice(p,1),this.me(f.id)})),this.ge(o))}if(this.se.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.se.get(e)});var g=this.ue(e,t,yt.Activation);this.ge(o.concat(g.map((f=>f.id))||[]))}}}onAction(e){var t,i=this.pe(),r=((t=this._instance)==null||(t=t.persistence)==null?void 0:t.props[i])||[];this.oe.has(e)&&this.ge(r.concat(this.oe.get(e)||[]))}ge(e){var t,i=this.fe(),r=this.pe(),n=[...new Set(e)].filter((a=>!this.be(a)));i.info("updating activated items",{activatedItems:n}),(t=this._instance)==null||(t=t.persistence)==null||t.register({[r]:n})}getActivatedIds(){var e,t=this.pe();return((e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[t])||[]}
1getEventToItemsMap(){return this.se}ye(){return this.ce}}class el extends Qo{constructor(e){super(e)}pe(){return"$surveys_activated"}_e(){return Tt.SHOWN}he(e){var t;(t=this._instance)==null||t.getSurveys(e)}me(e){var t;(t=this._instance)==null||t.cancelPendingSurvey(e)}fe(){return j}be(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var zs="SDK is not enabled or survey functionality is not yet loaded",Ur="Disabled. Not loading surveys.",tl=d!=null&&d.location?vs(d.location.hash,"__posthog")||vs(location.hash,"state"):null,Vr="_postHogToolbarParams",zr=z("[Toolbar]"),ie=z("[FeatureFlags]"),Ye=z("[FeatureFlags]",{debugEnabled:!0}),Ws=`" failed. Feature flags didn't load in time.`,Bs="$active_feature_flags",Ue="$override_feature_flags",Wr="$feature_flag_payloads",Pt="$override_feature_flag_payloads",Br="$feature_flag_request_id",Gr=s=>{for(var e={},t=0;s.length>t;t++)e[s[t]]=!0;return e},Yr=s=>{var e={};for(var[t,i]of es(s||{}))i&&(e[t]=i);return e},Gs=z("[Error tracking]"),Jr="Refusing to render web experiment since the viewer is a likely bot",sl={icontains:(s,e)=>!!d&&e.href.toLowerCase().indexOf(s.toLowerCase())>-1,not_icontains:(s,e)=>!!d&&e.href.toLowerCase().indexOf(s.toLowerCase())===-1,regex:(s,e)=>!!d&&ms(e.href,s),not_regex:(s,e)=>!!d&&!ms(e.href,s),exact:(s,e)=>e.href===s,is_not:(s,e)=>e.href!==s};class te{get N(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(i){i===void 0&&(i=!1),t.getWebExperiments((r=>{te.we("retrieved web experiments from the server"),t.Ee=new Map,r.forEach((n=>{if(n.feature_flag_key){var a;t.Ee&&(te.we("setting flag key ",n.feature_flag_key," to web experiment ",n),(a=t.Ee)==null||a.set(n.feature_flag_key,n));var o=t._instance.getFeatureFlag(n.feature_flag_key);Y(o)&&n.variants[o]&&t.Se(n.name,o,n.variants[o].transforms)}else if(n.variants)for(var l in n.variants){var c=n.variants[l];te.xe(c)&&t.Se(n.name,l,c.transforms)}}))}),i)},this._instance=e,this._instance.onFeatureFlags((i=>{this.onFeatureFlags(i)}))}initialize(){}onFeatureFlags(e){if(this._is_bot())te.we(Jr);else if(!this.N.disable_web_experiments){if(M(this.Ee))return this.Ee=new Map,this.loadIfEnabled(),void this.previewWebExperiment();te.we("applying feature flags",e),e.forEach((t=>{var i;if(this.Ee&&(i=this.Ee)!=null&&i.has(t)){var r,n=this._instance.getFeatureFlag(t),a=(r=this.Ee)==null?void 0:r.get(t);n&&a!=null&&a.variants[n]&&this.Se(a.name,n,a.variants[n].transforms)}}))}}previewWebExperiment(){var e=te.getWindowLocation();if(e!=null&&e.search){var t=ps(e?.search,"__experiment_id"),i=ps(e?.search,"__experiment_variant");t&&i&&(te.we("previewing web experiments "+t+" && "+i),this.getWebExperiments((r=>{this.Te(parseInt(t),i,r)}),!1,!0))}}loadIfEnabled(){this.N.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.N.disable_web_experiments&&!i)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.N.token),method:"GET",callback:n=>e(n.statusCode===200&&n.json&&n.json.experiments||[])})}Te(e,t,i){var r=i.filter((n=>n.id===e));r&&r.length>0&&(te.we("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.Se(r[0].name,t,r[0].variants[t].transforms))}static xe(e){return!M(e.conditions)&&te.$e(e)&&te.ke(e)}static $e(e){var t;if(M(e.conditions)||M((t=e.conditions)==null?void 0:t.url))return!0;var i,r,n,a=te.getWindowLocation();return!!a&&((i=e.conditions)==null||!i.url||sl[(r=(n=e.conditions)==null?void 0:n.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,a))}
1static getWindowLocation(){return d?.location}static ke(e){var t;if(M(e.conditions)||M((t=e.conditions)==null?void 0:t.utm))return!0;var i=In();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,f=(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,p=(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&&f&&p&&g}return!1}static we(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];w.info("[WebExperiments] "+e,i)}Se(e,t,i){this._is_bot()?te.we(Jr):t!=="control"?i.forEach((r=>{if(r.selector){var n;te.we("applying transform of variant "+t+" for experiment "+e+" ",r);var a=(n=document)==null?void 0:n.querySelectorAll(r.selector);a?.forEach((o=>{var l=o;r.html&&(l.innerHTML=r.html),r.css&&l.setAttribute("style",r.css)}))}})):te.we("Control variants leave the page unmodified.")}_is_bot(){return he&&this._instance?Un(he,this.N.custom_blocked_useragents):void 0}}var fe=z("[Conversations]"),Je="Conversations not available yet.",xs={featureFlags:class{constructor(s){this.Re=!1,this.Pe=!1,this.Oe=!1,this.Ie=!1,this.Ce=!1,this.Fe=!1,this.Ae=!1,this.Me=!1,this._instance=s,this.featureFlagEventHandlers=[]}get N(){return this._instance.config}get qt(){return this._instance.persistence}De(s){return this._instance.get_property(s)}Le(){var s,e;return(s=(e=this.qt)==null?void 0:e.nt(this.N.feature_flag_cache_ttl_ms))!==null&&s!==void 0&&s}Ue(){return!!this.Le()&&(this.Me||this.Oe||(this.Me=!0,ie.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ne(){var s,e=(s=this.N.evaluation_contexts)!==null&&s!==void 0?s:this.N.evaluation_environments;return!this.N.evaluation_environments||this.N.evaluation_contexts||this.Ae||(ie.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Ae=!0),e!=null&&e.length?e.filter((t=>{var i=t&&typeof t=="string"&&t.trim().length>0;return i||ie.error("Invalid evaluation context found:",t,"Expected non-empty string"),i})):[]}je(){return this.Ne().length>0}initialize(){var s,e,{config:t}=this._instance,i=(s=(e=t.bootstrap)==null?void 0:e.featureFlags)!==null&&s!==void 0?s:{};if(Object.keys(i).length){var r,n,a=(r=(n=t.bootstrap)==null?void 0:n.featureFlagPayloads)!==null&&r!==void 0?r:{},o=Object.keys(i).filter((c=>!!i[c])).reduce(((c,u)=>(c[u]=i[u]||!1,c)),{}),l=Object.keys(a).filter((c=>o[c])).reduce(((c,u)=>(a[u]&&(c[u]=a[u]),c)),{});this.receivedFeatureFlags({featureFlags:o,featureFlagPayloads:l})}}updateFlags(s,e,t){var i=t!=null&&t.merge?this.getFlagVariants():{},r=t!=null&&t.merge?this.getFlagPayloads():{},n=y({},i,s),a=y({},r,e),o={};for(var[l,c]of Object.entries(n)){var u=typeof c=="string";o[l]={key:l,enabled:!!u||!!c,variant:u?c:void 0,reason:void 0,metadata:k(a?.[l])?void 0:{id:0,version:void 0,description:void 0,payload:a[l]}}}this.receivedFeatureFlags({flags:o})}get hasLoadedFlags(){return this.Pe}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var s=this.De(ri),e=this.De(Ue),t=this.De(Pt);if(!t&&!e)return s||{};var i=B({},s||{}),r=[...new Set([...Object.keys(t||{}),...Object.keys(e||{})])];for(var n of r){var a,o,l=i[n],c=e?.[n],u=k(c)?(a=l?.enabled)!==null&&a!==void 0&&a:!!c,h=k(c)?l.variant:typeof c=="string"?c:void 0,v=t?.[n],g=y({},l,{enabled:u,variant:u?h??l?.variant:void 0});u!==l?.enabled&&(g.original_enabled=l?.enabled),h!==l?.variant&&(g.original_variant=l?.variant),v&&(g.metadata=y({},l?.metadata,{payload:v,original_payload:l==null||(o=l.metadata)==null?void 0:o.payload})),i[n]=g}return this.Re||(ie.warn(" Overriding feature flag details!",{flagDetails:s,overriddenPayloads:t,finalDetails:i}),this.Re=!0),i}getFlagVariants(){var s=this.De(ut),e=this.De(Ue);if(!e)return s||{};for(var t=B({},s),i=Object.keys(e),r=0;i.length>r;r++)t[i[r]]=e[i[r]];return this.Re||(ie.warn(" Overriding feature flags!",{enabledFlags:s,overriddenFlags:e,finalFlags:t}),this.Re=!0),t}getFlagPayloads(){var s=this.De(Wr),e=this.De(Pt);if(!e)return s||{};for(var t=B({},s||{}),i=Object.keys(e),r=0;i.length>r;r++)t[i[r]]=e[i[r]];return this.Re||(ie.warn(" Overriding feature flag payloads!",{flagPayloads:s,overriddenPayloads:e,finalPayloads:t}),this.Re=!0),t}reloadFeatureFlags(){this.Ie||this.N.advanced_disable_feature_flags||this.ze||(this._instance.gi.emit("featureFlagsReloading",!0),this.ze=setTimeout((()=>{this.Be()}),5))}He(){clearTimeout(this.ze),this.ze=void 0}ensureFlagsLoaded(){this.Pe||this.Oe||this.ze||this.reloadFeatureFlags()}setAnonymousDistinctId(s){this.$anon_distinct_id=s}setReloadingPaused(s){this.Ie=s}Be(s){var e;if(this.He(),!this._instance.bt())if(this.Oe)this.Ce=!0;else{var t=this.N.token,i=this.De(rs),r={token:t,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:y({},((e=this.qt)==null?void 0:e.get_initial_props())||{},this.De(Ct)||{}),group_properties:this.De(Xe),timezone:Nn()};Ae(i)||k(i)||(r.$device_id=i),(s!=null&&s.disableFlags||this.N.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.je()&&(r.evaluation_contexts=this.Ne());var n=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.N.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Oe=!0,this._instance._send_request({method:"POST",url:n,data:r,compression:this.N.disable_compression?void 0:Re.Base64,timeout:this.N.feature_flag_request_timeout_ms,callback:a=>{var o,l,c,u=!0;if(a.statusCode===200&&(this.Ce||(this.$anon_distinct_id=void 0),u=!1),this.Oe=!1,!r.disable_flags||this.Ce){this.Fe=!u;var h=[];
1a.error?a.error instanceof Error?h.push(a.error.name==="AbortError"?"timeout":"connection_error"):h.push("unknown_error"):a.statusCode!==200&&h.push("api_error_"+a.statusCode),(o=a.json)!=null&&o.errorsWhileComputingFlags&&h.push("errors_while_computing_flags");var v,g=!((l=a.json)==null||(l=l.quotaLimited)==null||!l.includes("feature_flags"));g&&h.push("quota_limited"),(c=this.qt)==null||c.register({[oi]:h}),g?ie.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(r.disable_flags||this.receivedFeatureFlags((v=a.json)!==null&&v!==void 0?v:{},u),this.Ce&&(this.Ce=!1,this.Be()))}}})}}getFeatureFlag(s,e){var t;if(e===void 0&&(e={}),!e.fresh||this.Fe)if(this.Pe||this.getFlags()&&this.getFlags().length>0){if(!this.Ue()){var i=this.getFeatureFlagResult(s,e);return(t=i?.variant)!==null&&t!==void 0?t:i?.enabled}}else ie.warn('getFeatureFlag for key "'+s+Ws)}getFeatureFlagDetails(s){return this.getFlagsWithDetails()[s]}getFeatureFlagPayload(s){var e=this.getFeatureFlagResult(s,{send_event:!1});return e?.payload}getFeatureFlagResult(s,e){if(e===void 0&&(e={}),!e.fresh||this.Fe)if(this.Pe||this.getFlags()&&this.getFlags().length>0){if(!this.Ue()){var t=this.getFlagVariants(),i=s in t,r=t[s],n=this.getFlagPayloads()[s],a=String(r),o=this.De(Br)||void 0,l=this.De(as)||void 0,c=this.De(Nt)||{};if(this.N.advanced_feature_flags_dedup_per_session){var u,h=this._instance.get_session_id(),v=this.De(ai);h&&h!==v&&(c={},(u=this.qt)==null||u.register({[Nt]:c,[ai]:h}))}if((e.send_event||!("send_event"in e))&&(!(s in c)||!c[s].includes(a))){var g,f,p,C,$,P,I,S,E,x;L(c[s])?c[s].push(a):c[s]=[a],(g=this.qt)==null||g.register({[Nt]:c});var m=this.getFeatureFlagDetails(s),_=[...(f=this.De(oi))!==null&&f!==void 0?f:[]];k(r)&&_.push("flag_missing");var F={$feature_flag:s,$feature_flag_response:r,$feature_flag_payload:n||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:((p=this.N.bootstrap)==null||(p=p.featureFlags)==null?void 0:p[s])||null,$feature_flag_bootstrapped_payload:((C=this.N.bootstrap)==null||(C=C.featureFlagPayloads)==null?void 0:C[s])||null,$used_bootstrap_value:!this.Fe};k(m==null||($=m.metadata)==null?void 0:$.version)||(F.$feature_flag_version=m.metadata.version);var A,N=(P=m==null||(I=m.reason)==null?void 0:I.description)!==null&&P!==void 0?P:m==null||(S=m.reason)==null?void 0:S.code;N&&(F.$feature_flag_reason=N),m!=null&&(E=m.metadata)!=null&&E.id&&(F.$feature_flag_id=m.metadata.id),k(m?.original_variant)&&k(m?.original_enabled)||(F.$feature_flag_original_response=k(m.original_variant)?m.original_enabled:m.original_variant),m!=null&&(x=m.metadata)!=null&&x.original_payload&&(F.$feature_flag_original_payload=m==null||(A=m.metadata)==null?void 0:A.original_payload),_.length&&(F.$feature_flag_error=_.join(",")),this._instance.capture("$feature_flag_called",F)}if(i){var T=n;if(!k(n))try{T=JSON.parse(n)}catch{}return{key:s,enabled:!!r,variant:typeof r=="string"?r:void 0,payload:T}}}}else ie.warn('getFeatureFlagResult for key "'+s+Ws)}getRemoteConfigPayload(s,e){var t=this.N.token,i={distinct_id:this._instance.get_distinct_id(),token:t};this.je()&&(i.evaluation_contexts=this.Ne()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:i,compression:this.N.disable_compression?void 0:Re.Base64,timeout:this.N.feature_flag_request_timeout_ms,callback(r){var n,a=(n=r.json)==null?void 0:n.featureFlagPayloads;e(a?.[s]||void 0)}})}isFeatureEnabled(s,e){if(e===void 0&&(e={}),!e.fresh||this.Fe){if(this.Pe||this.getFlags()&&this.getFlags().length>0){var t=this.getFeatureFlag(s,e);return k(t)?void 0:!!t}ie.warn('isFeatureEnabled for key "'+s+Ws)}}addFeatureFlagsHandler(s){this.featureFlagEventHandlers.push(s)}removeFeatureFlagsHandler(s){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter((e=>e!==s))}receivedFeatureFlags(s,e){if(this.qt){this.Pe=!0;var t=this.getFlagVariants(),i=this.getFlagPayloads(),r=this.getFlagsWithDetails();(function(n,a,o,l,c){o===void 0&&(o={}),l===void 0&&(l={}),c===void 0&&(c={});var u=(x=>{var m=x.flags;return m?(x.featureFlags=Object.fromEntries(Object.keys(m).map((_=>{var F;return[_,(F=m[_].variant)!==null&&F!==void 0?F:m[_].enabled]}))),x.featureFlagPayloads=Object.fromEntries(Object.keys(m).filter((_=>m[_].enabled)).filter((_=>{var F;return(F=m[_].metadata)==null?void 0:F.payload})).map((_=>{var F;return[_,(F=m[_].metadata)==null?void 0:F.payload]})))):ie.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),x})(n),h=u.flags,v=u.featureFlags,g=u.featureFlagPayloads;if(v){var f=n.requestId,p=n.evaluatedAt;
1if(L(v)){ie.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var C={};if(v)for(var $=0;v.length>$;$++)C[v[$]]=!0;a&&a.register({[Bs]:v,[ut]:C})}else{var P=v,I=g,S=h;if(n.errorsWhileComputingFlags)if(h){var E=new Set(Object.keys(h).filter((x=>{var m;return!((m=h[x])!=null&&m.failed)})));P=y({},o,Object.fromEntries(Object.entries(P).filter((x=>{var[m]=x;return E.has(m)})))),I=y({},l,Object.fromEntries(Object.entries(I||{}).filter((x=>{var[m]=x;return E.has(m)})))),S=y({},c,Object.fromEntries(Object.entries(S||{}).filter((x=>{var[m]=x;return E.has(m)}))))}else P=y({},o,P),I=y({},l,I),S=y({},c,S);a&&a.register(y({[Bs]:Object.keys(Yr(P)),[ut]:P||{},[Wr]:I||{},[ri]:S||{}},f?{[Br]:f}:{},p?{[as]:p}:{}))}}})(s,this.qt,t,i,r),e||(this.Me=!1),this.qe(e)}}override(s,e){e===void 0&&(e=!1),ie.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:s,suppressWarning:e})}overrideFeatureFlags(s){if(!this._instance.__loaded||!this.qt)return ie.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(s===!1)return this.qt.unregister(Ue),this.qt.unregister(Pt),this.qe(),Ye.info("All overrides cleared");if(L(s)){var e=Gr(s);return this.qt.register({[Ue]:e}),this.qe(),Ye.info("Flag overrides set",{flags:s})}if(s&&typeof s=="object"&&("flags"in s||"payloads"in s)){var t,i=s;if(this.Re=!!((t=i.suppressWarning)!==null&&t!==void 0&&t),"flags"in i){if(i.flags===!1)this.qt.unregister(Ue),Ye.info("Flag overrides cleared");else if(i.flags){if(L(i.flags)){var r=Gr(i.flags);this.qt.register({[Ue]:r})}else this.qt.register({[Ue]:i.flags});Ye.info("Flag overrides set",{flags:i.flags})}}return"payloads"in i&&(i.payloads===!1?(this.qt.unregister(Pt),Ye.info("Payload overrides cleared")):i.payloads&&(this.qt.register({[Pt]:i.payloads}),Ye.info("Payload overrides set",{payloads:i.payloads}))),void this.qe()}if(s&&typeof s=="object")return this.qt.register({[Ue]:s}),this.qe(),Ye.info("Flag overrides set",{flags:s});ie.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:s})}onFeatureFlags(s){if(this.addFeatureFlagsHandler(s),this.Pe){var{flags:e,flagVariants:t}=this.We();s(e,t)}return()=>this.removeFeatureFlagsHandler(s)}updateEarlyAccessFeatureEnrollment(s,e,t){var i,r=(this.De(Ot)||[]).find((l=>l.flagKey===s)),n={["$feature_enrollment/"+s]:e},a={$feature_flag:s,$feature_enrollment:e,$set:n};r&&(a.$early_access_feature_name=r.name),t&&(a.$feature_enrollment_stage=t),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=y({},this.getFlagVariants(),{[s]:e});(i=this.qt)==null||i.register({[Bs]:Object.keys(Yr(o)),[ut]:o}),this.qe()}getEarlyAccessFeatures(s,e,t){e===void 0&&(e=!1);var i=this.De(Ot),r=t?"&"+t.map((n=>"stage="+n)).join("&"):"";if(i&&!e)return s(i);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.N.token+r),method:"GET",callback:n=>{var a,o;if(n.json){var l=n.json.earlyAccessFeatures;return(a=this.qt)==null||a.unregister(Ot),(o=this.qt)==null||o.register({[Ot]:l}),s(l)}}})}We(){var s=this.getFlags(),e=this.getFlagVariants();return{flags:s.filter((t=>e[t])),flagVariants:Object.keys(e).filter((t=>e[t])).reduce(((t,i)=>(t[i]=e[i],t)),{})}}qe(s){var{flags:e,flagVariants:t}=this.We();this.featureFlagEventHandlers.forEach((i=>i(e,t,{errorsLoading:s})))}setPersonPropertiesForFlags(s,e){e===void 0&&(e=!0);var t=this.De(Ct)||{};this._instance.register({[Ct]:y({},t,s)}),e&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(Ct)}setGroupPropertiesForFlags(s,e){e===void 0&&(e=!0);var t=this.De(Xe)||{};Object.keys(t).length!==0&&Object.keys(t).forEach((i=>{t[i]=y({},t[i],s[i]),delete s[i]})),this._instance.register({[Xe]:y({},t,s)}),e&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(s){if(s){var e=this.De(Xe)||{};this._instance.register({[Xe]:y({},e,{[s]:{}})})}else this._instance.unregister(Xe)}reset(){this.Pe=!1,this.Oe=!1,this.Ie=!1,this.Ce=!1,this.Fe=!1,this.$anon_distinct_id=void 0,this.He(),this.Re=!1}}},il={sessionRecording:class{get N(){return this._instance.config}get qt(){return this._instance.persistence}get started(){var s;return!((s=this.Ve)==null||!s.isStarted)}get status(){var s,e;return this.Ye===St||this.Ye===Qt?this.Ye:(s=(e=this.Ve)==null?void 0:e.status)!==null&&s!==void 0?s:this.Ye}constructor(s){if(this._forceAllowLocalhostNetworkCapture=!1,this.Ye=Lr,this.Ge=void 0,this._instance=s,!this._instance.sessionManager)throw je.error("started without valid sessionManager"),new Error(xi+" started without valid sessionManager. This is a bug.");if(this.N.cookieless_mode===xe)throw new Error(xi+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Je(){var s,e=!((s=this._instance.get_property(Gt))==null||!s.enabled),t=!this.N.disable_session_recording,i=this.N.disable_session_recording||this._instance.consent.isOptedOut();return d&&e&&t&&!i}startIfEnabledOrStop(s){var e;if(!this.Je||(e=this.Ve)==null||!e.isStarted){var t=!k(Object.assign)&&!k(Array.from);this.Je&&t?(this.Ke(s),je.info("starting")):(this.Ye=Lr,this.stopRecording())}}Ke(s){var e,t,i;this.Je&&(this.Ye!==St&&this.Ye!==Qt&&(this.Ye=Dr),O!=null&&(e=O.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(t=O.__PosthogExtensions__)!=null&&t.initSessionRecording?this.Xe(s):(i=O.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this._instance,this.Qe,(r=>{if(r)return je.error("could not load recorder",r);this.Xe(s)})))}stopRecording(){var s,e;(s=this.Ge)==null||s.call(this),this.Ge=void 0,(e=this.Ve)==null||e.stop()}Ze(){var s,e;(s=this.Ge)==null||s.call(this),this.Ge=void 0,(e=this.Ve)==null||e.discard()}tr(){var s;(s=this.qt)==null||s.unregister(xn)}ir(s,e){if(M(s))return null;var t,i=Fe(s)?s:parseFloat(s);return typeof(t=i)!="number"||!Number.isFinite(t)||0>t||t>1?(je.warn(e+" must be between 0 and 1. Ignoring invalid value:",s),null):i}er(s){if(this.qt){var e,t,i=this.qt,r=()=>{var n,a=s.sessionRecording===!1?void 0:s.sessionRecording,o=this.ir((n=this.N.session_recording)==null?void 0:n.sampleRate,"session_recording.sampleRate"),l=this.ir(a?.sampleRate,"remote config sampleRate"),c=o??l;M(c)&&this.tr();var u=a?.minimumDurationMilliseconds;i.register({[Gt]:y({cache_timestamp:Date.now(),enabled:!!a},a,{networkPayloadCapture:y({capturePerformance:s.capturePerformance},a?.networkPayloadCapture),canvasRecording:{enabled:a?.recordCanvas,fps:a?.canvasFps,quality:a?.canvasQuality},sampleRate:c,minimumDurationMilliseconds:k(u)?null:u,endpoint:a?.endpoint,triggerMatchType:a?.triggerMatchType,masking:a?.masking,urlTriggers:a?.urlTriggers})})};r(),(e=this.Ge)==null||e.call(this),this.Ge=(t=this._instance.sessionManager)==null?void 0:t.onSessionId(r)}}onRemoteConfig(s){return"sessionRecording"in s?s.sessionRecording===!1?(this.er(s),void this.Ze()):(this.er(s),void this.startIfEnabledOrStop()):(this.Ye===St&&(this.Ye=Qt,je.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(s,e){var t;e===void 0&&(e="log"),(t=this.Ve)!=null&&t.log?this.Ve.log(s,e):je.warn("log called before recorder was ready")}get Qe(){var s,e,t=(s=this._instance)==null||(s=s.persistence)==null?void 0:s.get_property(Gt);return(t==null||(e=t.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}rr(){var s,e=this._instance.get_property(Gt);if(!e)return!1;var t=(s=(typeof e=="object"?e:JSON.parse(e)).cache_timestamp)!==null&&s!==void 0?s:Date.now();return 36e5>=Date.now()-t}Xe(s){var e,t;if((e=O.__PosthogExtensions__)==null||!e.initSessionRecording)return je.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({$sdk_debug_recording_script_not_loaded:!0});if(this.Ve||(this.Ve=(t=O.__PosthogExtensions__)==null?void 0:t.initSessionRecording(this._instance),this.Ve._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.rr())return this.Ye===Qt||this.Ye===St?void 0:(this.Ye=St,je.info("persisted remote config is stale, requesting fresh config before starting"),void new An(this._instance).load());this.Ye=Dr,this.Ve.start(s)}onRRwebEmit(s){var e;(e=this.Ve)==null||e.onRRwebEmit==null||e.onRRwebEmit(s)}overrideLinkedFlag(){var s,e;this.Ve||(e=this.qt)==null||e.register({$replay_override_linked_flag:!0}),(s=this.Ve)==null||s.overrideLinkedFlag()}overrideSampling(){var s,e;this.Ve||(e=this.qt)==null||e.register({$replay_override_sampling:!0}),(s=this.Ve)==null||s.overrideSampling()}overrideTrigger(s){var e,t;this.Ve||(t=this.qt)==null||t.register({[s==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}
1),(e=this.Ve)==null||e.overrideTrigger(s)}get sdkDebugProperties(){var s;return((s=this.Ve)==null?void 0:s.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(s,e){var t;return!((t=this.Ve)==null||!t.tryAddCustomEvent(s,e))}}},rl={autocapture:class{constructor(s){this.sr=!1,this.nr=null,this.ar=!1,this.instance=s,this.rageclicks=new Rr(s.config.rageclick),this.lr=null}initialize(){this.startIfEnabled()}get N(){var s,e,t=X(this.instance.config.autocapture)?this.instance.config.autocapture:{};return t.url_allowlist=(s=t.url_allowlist)==null?void 0:s.map((i=>new RegExp(i))),t.url_ignorelist=(e=t.url_ignorelist)==null?void 0:e.map((i=>new RegExp(i))),t}ur(){if(this.isBrowserSupported()){if(d&&b){var s=t=>{t=t||d?.event;try{this.hr(t)}catch(i){Mr.error("Failed to capture event",i)}};if(G(b,"submit",s,{capture:!0}),G(b,"change",s,{capture:!0}),G(b,"click",s,{capture:!0}),this.N.capture_copied_text){var e=t=>{this.hr(t=t||d?.event,Hs)};G(b,"copy",e,{capture:!0}),G(b,"cut",e,{capture:!0})}}}else Mr.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.sr&&(this.ur(),this.sr=!0)}onRemoteConfig(s){s.elementsChainAsString&&(this.ar=s.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Zi]:!!s.autocapture_opt_out}),this.nr=!!s.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(s){this.lr=s}getElementSelectors(s){var e,t=[];return(e=this.lr)==null||e.forEach((i=>{var r=b?.querySelectorAll(i);r?.forEach((n=>{s===n&&t.push(i)}))})),t}get isEnabled(){var s,e,t=(s=this.instance.persistence)==null?void 0:s.props[Zi];if(Ae(this.nr)&&!Me(t)&&!this.instance.bt())return!1;var i=(e=this.nr)!==null&&e!==void 0?e:!!t;return!!this.instance.config.autocapture&&!i}hr(s,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var t,i=Fr(s);Gn(i)&&(i=i.parentNode||null),e==="$autocapture"&&s.type==="click"&&s instanceof MouseEvent&&this.instance.config.rageclick&&(t=this.rageclicks)!=null&&t.isRageClick(s.clientX,s.clientY,s.timeStamp||new Date().getTime())&&(function(h,v){if(!d||wi(h))return!1;var g,f,p;if(Me(v)?(g=!!v&&Ir,f=void 0):(g=(p=v?.css_selector_ignorelist)!==null&&p!==void 0?p:Ir,f=v?.content_ignorelist),g===!1)return!1;var{targetElementList:C}=Or(h,!1);return!(function($,P){if($===!1||k($))return!1;var I;if($===!0)I=Ho;else{if(!L($))return!1;if($.length>10)return w.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;I=$.map((S=>S.toLowerCase()))}return P.some((S=>{var{safeText:E,ariaLabel:x}=S;return I.some((m=>E.includes(m)||x.includes(m)))}))})(f,C.map(($=>{var P;return{safeText:Vt($).toLowerCase(),ariaLabel:((P=$.getAttribute("aria-label"))==null?void 0:P.toLowerCase().trim())||""}})))&&!$r(C,g)})(i,this.instance.config.rageclick)&&this.hr(s,"$rageclick");var r=e===Hs;if(i&&(function(h,v,g,f,p){var C,$,P,I;if(g===void 0&&(g=void 0),!d||wi(h)||(C=g)!=null&&C.url_allowlist&&!Pr(g.url_allowlist)||($=g)!=null&&$.url_ignorelist&&Pr(g.url_ignorelist))return!1;if((P=g)!=null&&P.dom_event_allowlist){var S=g.dom_event_allowlist;if(S&&!S.some((F=>v.type===F)))return!1}var{parentIsUsefulElement:E,targetElementList:x}=Or(h,f);if(!(function(F,A){var N=A?.element_allowlist;if(k(N))return!0;var T,q=function(J){if(N.some((K=>J.tagName.toLowerCase()===K)))return{v:!0}};for(var D of F)if(T=q(D))return T.v;return!1})(x,g)||!$r(x,(I=g)==null?void 0:I.css_selector_allowlist))return!1;var m=d.getComputedStyle(h);if(m&&m.getPropertyValue("cursor")==="pointer"&&v.type==="click")return!0;var _=h.tagName.toLowerCase();switch(_){case"html":return!1;case"form":return(p||["submit"]).indexOf(v.type)>=0;case"input":case"select":case"textarea":return(p||["change","click"]).indexOf(v.type)>=0;default:return E?(p||["click"]).indexOf(v.type)>=0:(p||["click"]).indexOf(v.type)>=0&&(Ni.indexOf(_)>-1||h.getAttribute("contenteditable")==="true")}})(i,s,this.N,r,r?["copy","cut"]:void 0)){var{props:n,explicitNoCapture:a}=Yo(i,{e:s,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.N.element_attribute_ignorelist,elementsC
1hainAsString:this.ar});if(a)return!1;var o=this.getElementSelectors(i);if(o&&o.length>0&&(n.$element_selectors=o),e===Hs){var l,c=Jn(d==null||(l=d.getSelection())==null?void 0:l.toString()),u=s.type||"clipboard";if(!c)return!1;n.$selected_content=c,n.$copy_type=u}return this.instance.capture(e,n),!0}}}isBrowserSupported(){return Te(b?.querySelectorAll)}},historyAutocapture:class{constructor(s){var e;this._instance=s,this.dr=(d==null||(e=d.location)==null?void 0:e.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&(w.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.vr&&this.vr(),this.vr=void 0,w.info("History API monitoring stopped")}monitorHistoryChanges(){var s,e;if(d&&d.history){var t=this;(s=d.history.pushState)!=null&&s.__posthog_wrapped__||Nr(d.history,"pushState",(i=>function(r,n,a){i.call(this,r,n,a),t.cr("pushState")})),(e=d.history.replaceState)!=null&&e.__posthog_wrapped__||Nr(d.history,"replaceState",(i=>function(r,n,a){i.call(this,r,n,a),t.cr("replaceState")})),this.pr()}}cr(s){try{var e,t=d==null||(e=d.location)==null?void 0:e.pathname;if(!t)return;t!==this.dr&&this.isEnabled&&this._instance.capture(at,{navigation_type:s}),this.dr=t}catch(i){w.error("Error capturing "+s+" pageview",i)}}pr(){if(!this.vr){var s=()=>{this.cr("popstate")};G(d,"popstate",s),this.vr=()=>{d&&d.removeEventListener("popstate",s)}}}},heatmaps:class{get N(){return this.instance.config}constructor(s){var e;this._r=!1,this.sr=!1,this.gr=null,this.instance=s,this._r=!((e=this.instance.persistence)==null||!e.props[si]),this.rageclicks=new Rr(s.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var s=5e3;return X(this.N.capture_heatmaps)&&this.N.capture_heatmaps.flush_interval_milliseconds&&(s=this.N.capture_heatmaps.flush_interval_milliseconds),s}get isEnabled(){return M(this.N.capture_heatmaps)?M(this.N.enable_heatmaps)?this._r:this.N.enable_heatmaps:this.N.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.sr)return;Xo.info("starting..."),this.mr(),this.br()}else{var s;clearInterval((s=this.gr)!==null&&s!==void 0?s:void 0),this.yr(),this.getAndClearBuffer()}}onRemoteConfig(s){if("heatmaps"in s){var e=!!s.heatmaps;this.instance.persistence&&this.instance.persistence.register({[si]:e}),this._r=e,this.startIfEnabled()}}getAndClearBuffer(){var s=this.I;return this.I=void 0,s}wr(s){this.Er(s.originalEvent,"deadclick")}br(){this.gr&&clearInterval(this.gr),this.gr=b?.visibilityState==="visible"?setInterval(this.Ft.bind(this),this.flushIntervalMilliseconds):null}mr(){d&&b&&(this.Sr=this.Ft.bind(this),G(d,cs,this.Sr),this.Tr=s=>this.Er(s||d?.event),G(b,"click",this.Tr,{capture:!0}),this.$r=s=>this.kr(s||d?.event),G(b,"mousemove",this.$r,{capture:!0}),this.Rr=new or(this.instance,ho,this.wr.bind(this)),this.Rr.startIfEnabledOrStop(),this.Pr=this.br.bind(this),G(b,us,this.Pr),this.sr=!0)}yr(){var s;d&&b&&(this.Sr&&d.removeEventListener(cs,this.Sr),this.Tr&&b.removeEventListener("click",this.Tr,{capture:!0}),this.$r&&b.removeEventListener("mousemove",this.$r,{capture:!0}),this.Pr&&b.removeEventListener(us,this.Pr),clearTimeout(this.Or),(s=this.Rr)==null||s.stop(),this.sr=!1)}Ir(s,e){var t=this.instance.scrollManager.scrollY(),i=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),n=(function(a,o,l){for(var c=a;c&&Es(c)&&!ze(c,"body");){if(c===l)return!1;if(R(o,d?.getComputedStyle(c).position))return!0;c=Xn(c)}return!1})(Fr(s),["fixed","sticky"],r);return{x:s.clientX+(n?0:i),y:s.clientY+(n?0:t),target_fixed:n,type:e}}Er(s,e){var t;if(e===void 0&&(e="click"),!Sr(s.target)&&qr(s)){var i=this.Ir(s,e);(t=this.rageclicks)!=null&&t.isRageClick(s.clientX,s.clientY,new Date().getTime())&&this.Cr(y({},i,{type:"rageclick"})),this.Cr(i)}}kr(s){!Sr(s.target)&&qr(s)&&(clearTimeout(this.Or),this.Or=setTimeout((()=>{this.Cr(this.Ir(s,"mousemove"))}),500))}Cr(s){if(d){var e=d.location.href,t=this.N.custom_personal_data_properties,i=this.N.mask_personal_data_properties?[...gt,...t||[]]:[],r=Ht(e,i,Ut);this.I=this.I||{},this.I[r]||(this.I[r]=[]),this.I[r].push(s)}}Ft(){this.I&&!lt(this.I)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:or,webVitalsAutocapture:class{constructor(s){var e;this._r=!1,this.sr=!1,this.I={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Fr=()=>{clearTimeout(this.Ar),this.I.metrics.length!==0&&(this._instance.capture("$web_vitals",this.I.metrics.reduce(((t,i)=>y({},t,{["$web_vitals_"+i.name+"_event"]:y({},i),["$web_vitals_"+i.name+"_value"]:i.value})),{})),this.I={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Mr=t=>{var i,r=(i=this._instance.sessionManager)==null?void 0:i.checkAndGetSessionAndWindowId(!0);if(k(r))qe.error("Could not read session ID. Dropping metrics!");else{this.I=this.I||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var n=this.Dr();k(n)||(M(t?.name)||M(t?.value)?qe.error("Invalid metric received",t):!this.Lr||this.Lr>t.value?(this.I.url!==n&&(this.Fr(),this.Ar=setTimeout(this.Fr,this.flushToCaptureTimeoutMs)),k(this.I.url)&&(this.I.url=n),this.I.firstMetricTimestamp=k(this.I.firstMetricTimestamp)?Date.now():this.I.firstMetricTimestamp,t.attribution&&t.attribution.interactionTargetElement&&(t.attribution.interactionTargetElement=void 0),this.I.metrics.push(y({},t,{$current_url:n,$session_id:r.sessionId,$window_id:r.windowId,timestamp:Date.now()})),this.I.metrics.length===this.allowedMetrics.length&&this.Fr()):qe.error("Ignoring metric with value >= "+this.Lr,t))}},this.Ur=()=>{if(!this.sr){var t,i,r,n,a=O.__PosthogExtensions__;k(a)||k(a.postHogWebVitalsCallbacks)||({onLCP:t,onCLS:i,onFCP:r,onINP:n}=a.postHogWebVitalsCallbacks),t&&i&&r&&n?(this.allowedMetrics.indexOf("LCP")>-1&&t(this.Mr.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&i(this.Mr.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.Mr.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&n(this.Mr.bind(this)),this.sr=!0):qe.error("web vitals callbacks not loaded - not starting")}},this._instance=s,this._r=!((e=this._instance.persistence)==null||!e.props[tr]),this.startIfEnabled()}get Nr(){return this._instance.config.capture_performance}get allowedMetrics(){var s,e,t=X(this.Nr)?(s=this.Nr)==null?void 0:s.web_vitals_allowed_metrics:void 0;return M(t)?((e=this._instance.persistence)==null?void 0:e.props[ir])||["CLS","FCP","INP","LCP"]:t}get flushToCaptureTimeoutMs(){return(X(this.Nr)?this.Nr.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var s=X(this.Nr)?this.Nr.web_vitals_attribution:void 0;return s!=null&&s}get Lr(){var s=X(this.Nr)&&Fe(this.Nr.__web_vitals_max_value)?this.Nr.__web_vitals_max_value:Ar;return s>0&&6e4>=s?Ar:s}get isEnabled(){var s=Z?.protocol;if(s!=="http:"&&s!=="https:")return qe.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=X(this.Nr)?this.Nr.web_vitals:Me(this.Nr)?this.Nr:void 0;return Me(e)?e:this._r}startIfEnabled(){this.isEnabled&&!this.sr&&(qe.info("enabled, starting..."),this.Y(this.Ur))}onRemoteConfig(s){if("capturePerformance"in s){var e=X(s.capturePerformance)&&!!s.capturePerformance.web_vitals,t=X(s.capturePerformance)?s.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[tr]:e}),this._instance.persistence.register({[ir]:t})),this._r=e,this.startIfEnabled()}}Y(s){var e,t;(e=O.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks?s():(t=O.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",(i=>{i?qe.error("failed to load script",i):s()}))}Dr(){var s=d?d.location.href:void 0;if(s){var e=this._instance.config.custom_personal_data_properties,t=this._instance.config.mask_personal_data_properties?[...gt,...e||[]]:[];return Ht(s,t,Ut)}qe.error("Could not determine current URL")}}},nl={exceptionObserver:class{constructor(s){var e,t,i;this.Ur=()=>{var r;if(d&&this.isEnabled&&(r=O.__PosthogExtensions__)!=null&&r.errorWrappingFunctions){var n=O.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,a=O.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,o=O.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.jr&&this.N.capture_unhandled_errors&&(this.jr=n(this.captureException.bind(this))),!this.zr&&this.N.capture_unhandled_rejections&&(this.zr=a(this.captureException.bind(this))),!this.Br&&this.N.capture_console_errors&&(this.Br=o(this.captureException.bind(this)))}catch(l){kt.error("failed to start",l),this.Hr()}}},this._instance=s,this.qr=!((e=this._instance.persistence)==null||!e.props[Qi]),this.Wr=new xa({refillRate:(t=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&t!==void 0?t:1,bucketSize:(i=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&i!==void 0?i:10,refillInterval:1e4,h:kt}),this.N=this.Vr(),this.startIfEnabledOrStop()}Vr(){var s=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return X(s)?e=y({},e,s):(k(s)?this.qr:s)&&(e=y({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.N.capture_console_errors||this.N.capture_unhandled_errors||this.N.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(kt.info("enabled"),this.Hr(),this.Y(this.Ur)):this.Hr()}Y(s){var e,t;(e=O.__PosthogExtensions__)!=null&&e.errorWrappingFunctions&&s(),(t=O.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,"exception-autocapture",(i=>{if(i)return kt.error("failed to load script",i);s()}))}Hr(){var s,e,t;(s=this.jr)==null||s.call(this),this.jr=void 0,(e=this.zr)==null||e.call(this),this.zr=void 0,(t=this.Br)==null||t.call(this),this.Br=void 0}
1onRemoteConfig(s){"autocaptureExceptions"in s&&(this.qr=!!s.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Qi]:this.qr}),this.N=this.Vr(),this.startIfEnabledOrStop())}onConfigChange(){this.N=this.Vr()}captureException(s){var e,t,i,r=(e=s==null||(t=s.$exception_list)==null||(t=t[0])==null?void 0:t.type)!==null&&e!==void 0?e:"Exception";this.Wr.consumeRateLimit(r)?kt.info("Skipping exception capture because of client rate limiting.",{exception:r}):(i=this._instance.exceptions)==null||i.sendExceptionEvent(s)}},exceptions:class{constructor(s){var e,t;this.Yr=[],this.Gr=new Na([new Va,new Za,new Wa,new za,new Xa,new Ja,new Ga,new Ka],(function(i){for(var r=arguments.length,n=new Array(r>1?r-1:0),a=1;r>a;a++)n[a-1]=arguments[a];return function(o,l){l===void 0&&(l=0);for(var c=[],u=o.split(` 2`),h=l;u.length>h;h++){var v=u[h];if(1024>=v.length){var g=Xi.test(v)?v.replace(Xi,"$1"):v;if(!g.match(/\S*Error: /)){for(var f of n){var p=f(g,i);if(p){c.push(p);break}}if(c.length>=50)break}}}return(function(C){if(!C.length)return[];var $=Array.from(C);return $.reverse(),$.slice(0,50).map((P=>{return y({},P,{filename:P.filename||(I=$,I[I.length-1]||{}).filename,function:P.function||vt});var I}))})(c)}})("web:javascript",qa,Ua)),this._instance=s,this.Yr=(e=(t=this._instance.persistence)==null?void 0:t.get_property(ii))!==null&&e!==void 0?e:[]}onRemoteConfig(s){var e,t,i;if("errorTracking"in s){var r=(e=(t=s.errorTracking)==null?void 0:t.suppressionRules)!==null&&e!==void 0?e:[],n=(i=s.errorTracking)==null?void 0:i.captureExtensionExceptions;this.Yr=r,this._instance.persistence&&this._instance.persistence.register({[ii]:this.Yr,[er]:n})}}get Jr(){var s,e=!!this._instance.get_property(er),t=this._instance.config.error_tracking.captureExtensionExceptions;return(s=t??e)!==null&&s!==void 0&&s}buildProperties(s,e){return this.Gr.buildFromUnknown(s,{syntheticException:e?.syntheticException,mechanism:{handled:e?.handled}})}sendExceptionEvent(s){var e=s.$exception_list;if(this.Kr(e)){if(this.Xr(e))return void Gs.info("Skipping exception capture because a suppression rule matched");if(!this.Jr&&this.Qr(e))return void Gs.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Zr(e))return void Gs.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",s,{_noTruncate:!0,_batchKey:"exceptionEvent",Li:!0})}Xr(s){if(s.length===0)return!1;var e=s.reduce(((t,i)=>{var{type:r,value:n}=i;return Y(r)&&r.length>0&&t.$exception_types.push(r),Y(n)&&n.length>0&&t.$exception_values.push(n),t}),{$exception_types:[],$exception_values:[]});return this.Yr.some((t=>{var i=t.values.map((r=>{var n,a=Vn[r.operator],o=L(r.value)?r.value:[r.value],l=(n=e[r.key])!==null&&n!==void 0?n:[];return o.length>0&&a(o,l)}));return t.type==="OR"?i.some(Boolean):i.every(Boolean)}))}Qr(s){return s.flatMap((e=>{var t,i;return(t=(i=e.stacktrace)==null?void 0:i.frames)!==null&&t!==void 0?t:[]})).some((e=>e.filename&&e.filename.startsWith("chrome-extension://")))}Zr(s){if(s.length>0){var e,t,i,r,n=(e=(t=s[0].stacktrace)==null?void 0:t.frames)!==null&&e!==void 0?e:[],a=n[n.length-1];return(i=a==null||(r=a.filename)==null?void 0:r.includes("posthog.com/static"))!==null&&i!==void 0&&i}return!1}Kr(s){return!M(s)&&L(s)}}},al=y({productTours:class{get qt(){return this._instance.persistence}constructor(s){this.ts=null,this.es=null,this._instance=s}initialize(){this.loadIfEnabled()}onRemoteConfig(s){"productTours"in s&&(this.qt&&this.qt.register({[sr]:!!s.productTours}),this.loadIfEnabled())}loadIfEnabled(){var s,e;this.ts||(s=this._instance).config.disable_product_tours||(e=s.persistence)==null||!e.get_property(sr)||this.Y((()=>this.rs()))}Y(s){var e,t;(e=O.__PosthogExtensions__)!=null&&e.generateProductTours?s():(t=O.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,"product-tours",(i=>{i?jr.error("Could not load product tours script",i):s()}))}rs(){var s;!this.ts&&(s=O.__PosthogExtensions__)!=null&&s.generateProductTours&&(this.ts=O.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(s,e){if(e===void 0&&(e=!1),!L(this.es)||e){var t=this.qt;if(t){var i=t.props[Vs];if(L(i)&&!e)return this.es=i,void s(i,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:r=>{var n=r.statusCode;if(n!==200||!r.json){var a="Product Tours API could not be loaded, status: "+n;return jr.error(a),void s([],{isLoaded:!1,error:a})}var o=L(r.json.product_tours)?r.json.product_tours:[];this.es=o,t&&t.register({[Vs]:o}),s(o,{isLoaded:!0})}})}else s(this.es,{isLoaded:!0})}getActiveProductTours(s){M(this.ts)?s([],{isLoaded:!1,error:"Product tours not loaded"}):this.ts.getActiveProductTours(s)}showProductTour(s){var e;(e=this.ts)==null||e.showTourById(s)}previewTour(s){this.ts?this.ts.previewTour(s):this.Y((()=>{var e;this.rs(),(e=this.ts)==null||e.previewTour(s)}))}dismissProductTour(){var s;(s=this.ts)==null||s.dismissTour("user_clicked_skip")}nextStep(){var s;(s=this.ts)==null||s.nextStep()}previousStep(){var s;(s=this.ts)==null||s.previousStep()}clearCache(){var s;this.es=null,(s=this.qt)==null||s.unregister(Vs)}resetTour(s){var e;(e=this.ts)==null||e.resetTour(s)}resetAllTours(){var s;(s=this.ts)==null||s.resetAllTours()}cancelPendingTour(s){var e;(e=this.ts)==null||e.cancelPendingTour(s)}}},xs),ol={siteApps:class{constructor(s){this._instance=s,this.ss=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ns(s,e){if(e){var t=this.globalsForEvent(e);this.ss.push(t),this.ss.length>1e3&&(this.ss=this.ss.slice(10))}}get siteAppLoaders(){var s;return(s=O._POSTHOG_REMOTE_CONFIG)==null||(s=s[this._instance.config.token])==null?void 0:s.siteApps}initialize(){if(this.isEnabled){var s=this._instance._addCaptureHook(this.ns.bind(this));this.os=()=>{s(),this.ss=[],this.os=void 0}}}globalsForEvent(s){var e,t,i,r,n,a,o;if(!s)throw new Error("Event payload is required");var l={},c=this._instance.get_property("$groups")||[],u=this._instance.get_property("$stored_group_properties")||{};for(var[h,v]of Object.entries(u))l[h]={id:c[h],type:h,properties:v};var{$set_once:g,$set:f}=s;return{event:y({},Kr(s,Ko),{properties:y({},s.properties,f?{$set:y({},(e=(t=s.properties)==null?void 0:t.$set)!==null&&e!==void 0?e:{},f)}:{},g?{$set_once:y({},(i=(r=s.properties)==null?void 0:r.$set_once)!==null&&i!==void 0?i:{},g)}:{}),elements_chain:(n=(a=s.properties)==null?void 0:a.$elements_chain)!==null&&n!==void 0?n:"",distinct_id:(o=s.properties)==null?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(s){var e=this.apps[s.id],t=()=>{var a;!e.errored&&this.ss.length&&(He.info("Processing "+this.ss.length+" events for site app with id "+s.id),this.ss.forEach((o=>e.processEvent==null?void 0:e.processEvent(o))),e.processedBuffer=!0),Object.values(this.apps).every((o=>o.processedBuffer||o.errored))&&((a=this.os)==null||a.call(this))},i=!1,r=a=>{e.errored=!a,e.loaded=!0,He.info("Site app with id "+s.id+" "+(a?"loaded":"errored")),i&&t()};try{var{processEvent:n}=s.init({posthog:this._instance,callback(a){r(a)}});n&&(e.processEvent=n),i=!0}catch(a){He.error(Hr+s.id,a),r(!1)}if(i&&e.loaded)try{t()}catch(a){He.error("Error while processing buffered events PostHog app with config id "+s.id,a),e.errored=!0}}ls(){var s=this.siteAppLoaders||[];for(var e of s)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var t of s)this.setupSiteApp(t)}us(s){if(Object.keys(this.apps).length!==0){var e=this.globalsForEvent(s);for(var t of Object.values(this.apps))try{t.processEvent==null||t.processEvent(e)}catch(i){He.error("Error while processing event "+s.event+" for site app "+t.id,i)}}}onRemoteConfig(s){var e,t,i,r=this;
2if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.ls(),void this._instance.on("eventCaptured",(l=>this.us(l)))):void He.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((t=this.os)==null||t.call(this),(i=s.siteApps)!=null&&i.length)if(this.isEnabled){var n=function(l){var c;O["__$$ph_site_app_"+l]=r._instance,(c=O.__PosthogExtensions__)==null||c.loadSiteApp==null||c.loadSiteApp(r._instance,o,(u=>{if(u)return He.error(Hr+l,u)}))};for(var{id:a,url:o}of s.siteApps)n(a)}else He.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},ll={tracingHeaders:class{constructor(s){this.hs=void 0,this.ds=void 0,this.Ur=()=>{var e,t;k(this.hs)&&((e=O.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),k(this.ds)&&((t=O.__PosthogExtensions__)==null||(t=t.tracingHeadersPatchFns)==null||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=s}initialize(){this.startIfEnabledOrStop()}Y(s){var e,t;(e=O.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns&&s(),(t=O.__PosthogExtensions__)==null||t.loadExternalDependency==null||t.loadExternalDependency(this._instance,"tracing-headers",(i=>{if(i)return Jo.error("failed to load script",i);s()}))}startIfEnabledOrStop(){var s,e;this._instance.config.__add_tracing_headers?this.Y(this.Ur):((s=this.hs)==null||s.call(this),(e=this.ds)==null||e.call(this),this.hs=void 0,this.ds=void 0)}}},ul=y({surveys:class{get N(){return this._instance.config}constructor(s){this.vs=void 0,this._surveyManager=null,this.cs=!1,this.fs=[],this.ps=null,this._instance=s,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(s){if(!this.N.disable_surveys){var e=s.surveys;if(M(e))return j.warn("Flags not loaded yet. Not loading surveys.");var t=L(e);this.vs=t?e.length>0:e,j.info("flags response received, isSurveysEnabled: "+this.vs),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var s=[],e=0;e<localStorage.length;e++){var t=localStorage.key(e);(t!=null&&t.startsWith(yi)||t!=null&&t.startsWith("inProgressSurvey_"))&&s.push(t)}s.forEach((i=>localStorage.removeItem(i)))}loadIfEnabled(){if(!this._surveyManager)if(this.cs)j.info("Already initializing surveys, skipping...");else if(this.N.disable_surveys)j.info(Ur);else if(this.N.cookieless_mode&&this._instance.consent.isOptedOut())j.info("Not loading surveys in cookieless mode without consent.");else{var s=O?.__PosthogExtensions__;if(s){if(!k(this.vs)||this.N.advanced_enable_surveys){var e=this.vs||this.N.advanced_enable_surveys;this.cs=!0;try{var t=s.generateSurveys;if(t)return void this._s(t,e);var i=s.loadExternalDependency;if(!i)return void this.gs(Ii);i(this._instance,"surveys",(r=>{r||!s.generateSurveys?this.gs("Could not load surveys script",r):this._s(s.generateSurveys,e)}))}catch(r){throw this.gs("Error initializing surveys",r),r}finally{this.cs=!1}}}else j.error("PostHog Extensions not found.")}}_s(s,e){this._surveyManager=s(this._instance,e),this._surveyEventReceiver=new el(this._instance),j.info("Surveys loaded successfully"),this.bs({isLoaded:!0})}gs(s,e){j.error(s,e),this.bs({isLoaded:!1,error:s})}onSurveysLoaded(s){return this.fs.push(s),this._surveyManager&&this.bs({isLoaded:!0}),()=>{this.fs=this.fs.filter((e=>e!==s))}}getSurveys(s,e){if(e===void 0&&(e=!1),this.N.disable_surveys)return j.info(Ur),s([]);var t,i=this._instance.get_property(ni);if(i&&!e)return s(i,{isLoaded:!0});typeof Promise<"u"&&this.ps?this.ps.then((r=>{var{surveys:n,context:a}=r;return s(n,a)})):(typeof Promise<"u"&&(this.ps=new Promise((r=>{t=r}))),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.N.token),method:"GET",timeout:this.N.surveys_request_timeout_ms,callback:r=>{var n;this.ps=null;var a=r.statusCode;if(a!==200||!r.json){var o="Surveys API could not be loaded, status: "+a;j.error(o);var l={isLoaded:!1,error:o};return s([],l),void(t==null||t({surveys:[],context:l}))}var c,u=r.json.surveys||[],h=u.filter((g=>(function(f){return!(!f.start_date||f.end_date)})(g)&&((function(f){var p;return!((p=f.conditions)==null||(p=p.events)==null||(p=p.values)==null||!p.length)})(g)||(function(f){var p;return!((p=f.conditions)==null||(p=p.actions)==null||(p=p.values)==null||!p.length)})(g))));h.length>0&&((c=this._surveyEventReceiver)==null||c.register(h)),(n=this._instance.persistence)==null||n.register({[ni]:u});var v={isLoaded:!0};s(u,v),t?.({surveys:u,context:v})}}))}
2bs(s){for(var e of this.fs)try{if(!s.isLoaded)return e([],s);this.getSurveys(e)}catch(t){j.error("Error in survey callback",t)}}getActiveMatchingSurveys(s,e){if(e===void 0&&(e=!1),!M(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(s,e);j.warn("init was not called")}ys(s){var e=null;return this.getSurveys((t=>{var i;e=(i=t.find((r=>r.id===s)))!==null&&i!==void 0?i:null})),e}ws(s){if(M(this._surveyManager))return{eligible:!1,reason:zs};var e=typeof s=="string"?this.ys(s):s;return e?this._surveyManager.checkSurveyEligibility(e):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(s){if(M(this._surveyManager))return j.warn("init was not called"),{visible:!1,disabledReason:zs};var e=this.ws(s);return{visible:e.eligible,disabledReason:e.reason}}canRenderSurveyAsync(s,e){return M(this._surveyManager)?(j.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:zs})):new Promise((t=>{this.getSurveys((i=>{var r,n=(r=i.find((o=>o.id===s)))!==null&&r!==void 0?r:null;if(n){var a=this.ws(n);t({visible:a.eligible,disabledReason:a.reason})}else t({visible:!1,disabledReason:"Survey not found"})}),e)}))}renderSurvey(s,e,t){var i;if(M(this._surveyManager))j.warn("init was not called");else{var r=typeof s=="string"?this.ys(s):s;if(r!=null&&r.id)if(Mo.includes(r.type)){var n=b?.querySelector(e);if(n)return(i=r.appearance)!=null&&i.surveyPopupDelaySeconds?(j.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout((()=>{var a,o;j.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,t),j.info("Survey "+r.id+" rendered")}),1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,n,t);j.warn("Survey element not found")}else j.warn("Surveys of type "+r.type+" cannot be rendered in the app");else j.warn("Survey not found")}}displaySurvey(s,e){var t;if(M(this._surveyManager))j.warn("init was not called");else{var i=this.ys(s);if(i){var r=i;if((t=i.appearance)!=null&&t.surveyPopupDelaySeconds&&e.ignoreDelay&&(r=y({},i,{appearance:y({},i.appearance,{surveyPopupDelaySeconds:0})})),e.displayType!==pi.Popover&&e.initialResponses&&j.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),e.ignoreConditions===!1){var n=this.canRenderSurvey(i);if(!n.visible)return void j.warn("Survey is not eligible to be displayed: ",n.disabledReason)}e.displayType!==pi.Inline?this._surveyManager.handlePopoverSurvey(r,e):this.renderSurvey(r,e.selector,e.properties)}else j.warn("Survey not found")}}cancelPendingSurvey(s){M(this._surveyManager)?j.warn("init was not called"):this._surveyManager.cancelSurvey(s)}handlePageUnload(){var s;(s=this._surveyManager)==null||s.handlePageUnload()}}},xs),cl={toolbar:class{constructor(s){this.instance=s}Es(s){O.ph_toolbar_state=s}Ss(){var s;return(s=O.ph_toolbar_state)!==null&&s!==void 0?s:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(s,e,t){if(s===void 0&&(s=void 0),e===void 0&&(e=void 0),t===void 0&&(t=void 0),Sn(this.instance.config)||!d||!b)return!1;s=s??d.location,t=t??d.history;try{if(!e){try{d.localStorage.setItem("test","test"),d.localStorage.removeItem("test")}catch{return!1}e=d?.localStorage}var i,r=tl||vs(s.hash,"__posthog")||vs(s.hash,"state"),n=r?nr((()=>JSON.parse(atob(decodeURIComponent(r)))))||nr((()=>JSON.parse(decodeURIComponent(r)))):null;return n&&n.action==="ph_authorize"?((i=n).source="url",i&&Object.keys(i).length>0&&(n.desiredHash?s.hash=n.desiredHash:t?t.replaceState(t.state,"",s.pathname+s.search):s.hash="")):((i=JSON.parse(e.getItem(Vr)||"{}")).source="localstorage",delete i.userIntent),!(!i.token||this.instance.config.token!==i.token||(this.loadToolbar(i),0))}catch{return!1}}xs(s){var e=O.ph_load_toolbar||O.ph_load_editor;!M(e)&&Te(e)?e(s,this.instance):zr.warn("No toolbar load function found")}loadToolbar(s){var e=!(b==null||!b.getElementById(kn));if(!d||e)return!1;var t=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,i=y({token:this.instance.config.token},s,{apiURL:this.instance.requestRouter.endpointFor("ui")},t?{instrument:!1}:{});if(d.localStorage.setItem(Vr,JSON.stringify(y({},i,{source:void 0}))),this.Ss()===2)this.xs(i);else if(this.Ss()===0){var r;this.Es(1),(r=O.__PosthogExtensions__)==null||r.loadExternalDependency==null||r.loadExternalDependency(this.instance,"toolbar",(n=>{if(n)return zr.error("[Toolbar] Failed to load",n),void this.Es(0);this.Es(2),this.xs(i)})),G(d,"turbolinks:load",(()=>{this.Es(0),this.loadToolbar(i)}))}return!0}Ts(s){return this.loadToolbar(s)}maybeLoadEditor(s,e,t){return s===void 0&&(s=void 0),e===void 0&&(e=void 0),t===void 0&&(t=void 0),this.maybeLoadToolbar(s,e,t)}}},hl=y({experiments:te},xs),dl={conversations:class{constructor(s){this.$s=void 0,this._conversationsManager=null,this.ks=!1,this.Rs=null,this._instance=s}initialize(){this.loadIfEnabled()}onRemoteConfig(s){if(!this._instance.config.disable_conversations){var e=s.conversations;M(e)||(Me(e)?this.$s=e:(this.$s=e.enabled,this.Rs=e),this.loadIfEnabled())}}reset(){var s;(s=this._conversationsManager)==null||s.reset(),this._conversationsManager=null,this.$s=void 0,this.Rs=null}loadIfEnabled(){if(!(this._conversationsManager||this.ks||this._instance.config.disable_conversations||Sn(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var s=O?.__PosthogExtensions__;if(s&&!k(this.$s)&&this.$s)if(this.Rs&&this.Rs.token){this.ks=!0;try{var e=s.initConversations;if(e)return this.Ps(e),void(this.ks=!1);var t=s.loadExternalDependency;if(!t)return void this.Os(Ii);t(this._instance,"conversations",(i=>{i||!s.initConversations?this.Os("Could not load conversations script",i):this.Ps(s.initConversations),this.ks=!1}))}catch(i){this.Os("Error initializing conversations",i),this.ks=!1}}else fe.error("Conversations enabled but missing token in remote config.")}}Ps(s){if(this.Rs)try{this._conversationsManager=s(this.Rs,this._instance),fe.info("Conversations loaded successfully")}catch(e){this.Os("Error completing conversations initialization",e)}else fe.error("Cannot complete initialization: remote config is null")}Os(s,e){fe.error(s,e),this._conversationsManager=null,this.ks=!1}show(){this._conversationsManager?this._conversationsManager.show():fe.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.$s===!0&&!Ae(this._conversationsManager)}isVisible(){var s,e;return(s=(e=this._conversationsManager)==null?void 0:e.isVisible())!==null&&s!==void 0&&s}sendMessage(s,e,t){var i=this;return Ce((function*(){return i._conversationsManager?i._conversationsManager.sendMessage(s,e,t):(fe.warn(Je),null)}))()}getMessages(s,e){var t=this;return Ce((function*(){return t._conversationsManager?t._conversationsManager.getMessages(s,e):(fe.warn(Je),null)}))()}markAsRead(s){var e=this;return Ce((function*(){return e._conversationsManager?e._conversationsManager.markAsRead(s):(fe.warn(Je),null)}))()}getTickets(s){var e=this;return Ce((function*(){return e._conversationsManager?e._conversationsManager.getTickets(s):(fe.warn(Je),null)}))()}requestRestoreLink(s){var e=this;return Ce((function*(){return e._conversationsManager?e._conversationsManager.requestRestoreLink(s):(fe.warn(Je),null)}))()}restoreFromToken(s){var e=this;return Ce((function*(){return e._conversationsManager?e._conversationsManager.restoreFromToken(s):(fe.warn(Je),null)}))()}restoreFromUrlToken(){var s=this;return Ce((function*(){return s._conversationsManager?s._conversationsManager.restoreFromUrlToken():(fe.warn(Je),null)}))()}getCurrentTicketId(){var s,e;return(s=(e=this._conversationsManager)==null?void 0:e.getCurrentTicketId())!==null&&s!==void 0?s:null}getWidgetSessionId(){var s,e;return(s=(e=this._conversationsManager)==null?void 0:e.getWidgetSessionId())!==null&&s!==void 0?s:null}}},pl={logs:class{constructor(s){var e;this.Is=!1,this.Cs=!1,this._instance=s,this._instance&&(e=this._instance.config.logs)!=null&&e.captureConsoleLogs&&(this.Is=!0)}initialize(){this.loadIfEnabled()}onRemoteConfig(s){var e,t=(e=s.logs)==null?void 0:e.captureConsoleLogs;!M(t)&&t&&(this.Is=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Is&&!this.Cs){var s=z("[logs]"),e=O?.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",(i=>{var r;i||(r=e.logs)==null||!r.initializeLogs?s.error("Could not load logs script",i):(e.logs.initializeLogs(this._instance),this.Cs=!0)})):s.error(Ii)}else s.error("PostHog Extensions not found.")}}}},vl=y({},xs,il,rl,nl,al,ol,ul,ll,cl,hl,dl,pl);Se.__defaultExtensionClasses=y({},vl);var Xr,gl=(Xr=Lt[ot]=new Se,(function(){function s(){s.done||(s.done=!0,Bn=!1,H(Lt,(function(e){e._dom_loaded()})))}b!=null&&b.addEventListener?b.readyState==="complete"?s():G(b,"DOMContentLoaded",s,{capture:!1}):d&&w.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")})(),Xr);const fl=aa.PUBLIC_POSTHOG_KEY||"phc_wChHnifJyQW2PWGRQTTbtdoT9FobMD3rQ2TNfZJAvfcR",_l="/relay",ml=async({data:s})=>(gl.init(fl,{api_host:`${window.location.origin}${_l}`,ui_host:"https://us.posthog.com",defaults:"2026-01-30",cookieless_mode:"always",capture_pageview:"history_change",capture_pageleave:!0,autocapture:!1,disable_session_recording:!0}),s),Pl=Object.freeze(Object.defineProperty({__proto__:null,load:ml},Symbol.toStringTag,{value:"Module"}));var yl=ha('<meta name="description"/> <meta property="og:type" content="website"/> <meta property="og:url"/> <meta property="og:title"/> <meta property="og:description"/> <meta property="og:image"/> <meta property="og:image:width"/> <meta property="og:image:height"/>
2 <meta property="og:site_name" content="Xybrid"/> <meta property="og:logo"/> <meta name="twitter:card" content="summary_large_image"/> <meta name="twitter:url"/> <meta name="twitter:title"/> <meta name="twitter:description"/> <meta name="twitter:image"/> <link rel="canonical"/> <link rel="alternate" type="application/rss+xml" title="Xybrid Blog" href="/blog/rss.xml"/>',1);function Fl(s,e){oa(e,!0);const t={title:"Xybrid - Hybrid On-Device AI",description:"Run ML models on-device or in the cloud with intelligent routing. Zero infrastructure. Privacy-first, cost-optimized. Any model. Any platform.",image:"https://www.xybrid.ai/og-image.jpg",logo:"https://www.xybrid.ai/logo.png"};let i=et(()=>Be.data.seo?.title??t.title),r=et(()=>Be.data.seo?.description??t.description),n=et(()=>Be.data.seo?.image??t.image),a=et(()=>Be.data.seo?.imageWidth??"1200"),o=et(()=>Be.data.seo?.imageHeight??"630"),l=et(()=>Be.data.seo?.url??Be.url.href);var c=la();fa("12qhfyh",h=>{var v=yl(),g=ji(v),f=ge(g,4),p=ge(f,2),C=ge(p,2),$=ge(C,2),P=ge($,2),I=ge(P,2),S=ge(I,4),E=ge(S,4),x=ge(E,2),m=ge(x,2),_=ge(m,2),F=ge(_,2);da(2),pa(()=>{ce(g,"content",ue(r)),ce(f,"content",ue(l)),ce(p,"content",ue(i)),ce(C,"content",ue(r)),ce($,"content",ue(n)),ce(P,"content",ue(a)),ce(I,"content",ue(o)),ce(S,"content",t.logo),ce(E,"content",ue(l)),ce(x,"content",ue(i)),ce(m,"content",ue(r)),ce(_,"content",ue(n)),ce(F,"href",ue(l))}),va(()=>{ga.title=ue(i)??""}),Hi(h,v)});var u=ji(c);ua(u,()=>e.children),Hi(s,c),ca()}export{Fl as component,Pl as universal};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.