1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,365269,e=>{"use strict";e.i(167225);var t=e.i(843476),i="u">typeof window?window:void 0,s="u">typeof globalThis?globalThis:i;"u"<typeof self&&(s.self=s),"u"<typeof File&&(s.File=function(){});var r=Array.prototype,n=r.forEach,a=r.indexOf,o=null==s?void 0:s.navigator,l=null==s?void 0:s.document,c=null==s?void 0:s.location,u=null==s?void 0:s.fetch,h=null!=s&&s.XMLHttpRequest&&"withCredentials"in new s.XMLHttpRequest?s.XMLHttpRequest:void 0,d=null==s?void 0:s.AbortController,p=null==o?void 0:o.userAgent,g=null!=i?i:{},f={DEBUG:!1,LIB_VERSION:"1.342.0"};function v(e,t,i,s,r,n,a){try{var o=e[n](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(s,r)}function _(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function a(e){v(n,s,r,a,o,"next",e)}function o(e){v(n,s,r,a,o,"throw",e)}a(void 0)})}}function m(){return(m=Object.assign.bind()).apply(null,arguments)}function y(e,t){if(null==e)return{};var i={};for(var s in e)if(({}).hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}var b=["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"],w=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return b.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})},E=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"];function x(e,t){return -1!==e.indexOf(t)}var k=function(e){return e.trim()},S=function(e){return e.replace(/^\$/,"")},P=Array.isArray,F=Object.prototype,C=F.hasOwnProperty,O=F.toString,R=P||function(e){return"[object Array]"===O.call(e)},I=e=>"function"==typeof e,T=e=>e===Object(e)&&!R(e),$=e=>{if(T(e)){for(var t in e)if(C.call(e,t))return!1;return!0}return!1},M=e=>void 0===e,A=e=>"[object String]"==O.call(e),D=e=>A(e)&&0===e.trim().length,L=e=>null===e,N=e=>M(e)||L(e),j=e=>"[object Number]"==O.call(e)&&e==e,q=e=>j(e)&&e>0,H=e=>"[object Boolean]"===O.call(e),U=e=>x(E,e);function G(e){return null===e||"object"!=typeof e}function B(e,t){return Object.prototype.toString.call(e)==="[object "+t+"]"}function V(e){return!M(Event)&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var z=[!0,"true",1,"1","yes"],W=[!1,"false",0,"0","no"];function K(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),j(e)?e>i?(s.warn(" cannot be greater than max: "+i+". Using max value instead."),i):e<t?(s.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(s.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+r),K(r||i,t,i,s))}class Y{constructor(e){this.t={},this.i=e.i,this.o=K(e.bucketSize,0,100,e.h),this.m=K(e.refillRate,0,this.o,e.h),this.$=K(e.refillInterval,0,864e5,e.h)}S(e,t){var i=Math.floor((t-e.lastAccess)/this.$);if(i>0){var s=i*this.m;e.tokens=Math.min(e.tokens+s,this.o),e.lastAccess=e.lastAccess+i*this.$}}consumeRateLimit(e){var t,i=Date.now(),s=String(e),r=this.t[s];return r?this.S(r,i):(r={tokens:this.o,lastAccess:i},this.t[s]=r),0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.i)||t.call(this,e)),0===r.tokens)}stop(){this.t={}}}var Q,J,X,Z="Mobile",ee="Android",et="Tablet",ei=ee+" "+et,es="iPad",er="Apple",en=er+" Watch",ea="Safari",eo="BlackBerry",el="Samsung",ec=el+"Browser",eu=el+" Internet",eh="Chrome",ed=eh+" OS",ep=eh+" iOS",eg="Internet Explorer",ef=eg+" "+Z,ev="Opera",e_=ev+" Mini",em="Edge",ey="Microsoft "+em,eb="Firefox",ew=eb+" iOS",eE="Nintendo",ex="PlayStation",ek="Xbox",eS=ee+" "+Z,eP=Z+" "+ea,eF="Windows",eC=eF+" Phone",eO="Nokia",eR="Ouya",eI="Generic",eT=eI+" "+Z.toLowerCase(),e$=eI+" "+et.toLowerCase(),eM="Konqueror",eA="(\\d+(\\.\\d+)?)",eD=RegExp("Version/"+eA),eL=RegExp(ek,"i"),eN=RegExp(ex+" \\w+","i"),ej=RegExp(eE+" \\w+","i"),eq=RegExp(eo+"|PlayBook|BB10","i"),eH={"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"},eU=function(e,t){var i;return t=t||"",x(e," OPR/")&&x(e,"Mini")?e_:x(e," OPR/")?ev:eq.test(e)?eo:x(e,"IE"+Z)||x(e,"WPDesktop")?ef:x(e,ec)?eu:x(e,em)||x(e,"Edg/")?ey:x(e,"FBIOS")?"Facebook "+Z:x(e,"UCWEB")||x(e,"UCBrowser")?"UC Browser":x(e,"CriOS")?ep:x(e,"CrMo")||x(e,eh)?eh:x(e,ee)&&x(e,ea)?eS:x(e,"FxiOS")?ew:x(e.toLowerCase(),eM.toLowerCase())?eM:(i=t)&&x(i,er)||x(e,ea)&&!x(e,eh)&&!x(e,ee)?x(e,Z)?eP:ea:x(e,eb)?eb:x(e,"MSIE")||x(e,"Trident/")?eg:x(e,"Gecko")?eb:""},eG={[ef]:[RegExp("rv:"+eA)],[ey]:[RegExp(em+"?\\/"+eA)],[eh]:[RegExp("("+eh+"|CrMo)\\/"+eA)],[ep]:[RegExp("CriOS\\/"+eA)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+eA)],[ea]:[eD],[eP]:[eD],[ev]:[RegExp("(Opera|OPR)\\/"+eA)],[eb]:[RegExp(eb+"\\/"+eA)],[ew]:[RegExp("FxiOS\\/"+eA)],[eM]:[RegExp("Konqueror[:/]?"+eA,"i")],[eo]:[RegExp(eo+" "+eA),eD],[eS]:[RegExp("android\\s"+eA,"i")],[eu]:[RegExp(ec+"\\/"+eA)],[eg]:[RegExp("(rv:|MSIE )"+eA)],Mozilla:[RegExp("rv:"+eA)]},eB=function(e,t){var i=eG[eU(e,t)];if(M(i))return null;for(var s=0;s<i.length;s++){var r=i[s],n=e.match(r);if(n)return parseFloat(n[n.length-2])}return null},eV=[[RegExp(ek+"; "+ek+" (.*?)[);]","i"),e=>[ek,e&&e[1]||""]],[RegExp(eE,"i"),[eE,""]],[RegExp(ex,"i"),[ex,""]],[eq,[eo,""]],[RegExp(eF,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eC,""];if(new RegExp(Z).test(t)&&!/IEMobile\b/.test(t))return[eF+" "+Z,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=eH[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[eF,s]}return[eF,""]}
1],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=M(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+ee+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ee+")","i"),e=>e&&e[2]?[ee,[e[2],e[3],e[4]||"0"].join(".")]:[ee,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];if(e&&e[1]){var i=[e[1],e[2],e[3]||"0"];t[1]=i.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[ed,""]],[/Linux|debian/i,["Linux",""]]],ez=function(e){return ej.test(e)?eE:eN.test(e)?ex:eL.test(e)?ek:RegExp(eR,"i").test(e)?eR:RegExp("("+eC+"|WPDesktop)","i").test(e)?eC:/iPad/.test(e)?es:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?en:eq.test(e)?eo:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eO,"i").test(e)?eO:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(e)||/(kf[a-z]+)( bui|\)).+silk\//i.test(e)?"Kindle Fire":/(Android|ZTE)/i.test(e)?new RegExp(Z).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?ee:ei:RegExp("(pda|"+Z+")","i").test(e)?eT:RegExp(et,"i").test(e)&&!RegExp(et+" pc","i").test(e)?e$:""},eW=e=>e instanceof Error;class eK{constructor(e,t,i){void 0===i&&(i=[]),this.coercers=e,this.stackParser=t,this.modifiers=i}buildFromUnknown(e,t){void 0===t&&(t={});var i=t&&t.mechanism||{handled:!0,type:"generic"},s=this.buildCoercingContext(i,t,0).apply(e),r=this.buildParsingContext(),n=this.parseStacktrace(s,r);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return _(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&R(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:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,s;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(s=this.applyChunkIds(this.stackParser(e.stack,+!!e.synthetic),t.chunkIdMap)),m({},e,{cause:i,stack:s})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}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 _(function*(){var i=e;for(var s of t.modifiers)i=yield s(i);return i})()}convertToExceptionList(e,t){var i,s,r,n={type:e.type,value:e.value,mechanism:{type:null!=(i=t.type)?i:"generic",handled:null==(s=t.handled)||s,synthetic:null!=(r=e.synthetic)&&r}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var a=[n];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,m({},t,{handled:!0}))),a}buildParsingContext(){return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return X&&i.length===J||(J=i.length,X=i.reduce((i,s)=>{Q||(Q={});var r=Q[s];if(r)i[r[0]]=r[1];else for(var n=e(s),a=n.length-1;a>=0;a--){var o=n[a],l=null==o?void 0:o.filename,c=t[s];if(l&&c){i[l]=c,Q[s]=[l,c];break}}return i},{})),X}}(this.stackParser)}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var s=(i,s)=>{if(s<=4){var r=this.buildCoercingContext(e,t,s);return this.applyCoercers(i,r)}};return m({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,i),next:e=>s(e,i+1)})}}function eY(e,t,i,s,r){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!0};return M(s)||(n.lineno=s),M(r)||(n.colno=r),n}var eQ=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),s=-1!==e.indexOf("safari-web-extension");return i||s?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},eJ=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,eX=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,eZ=/\((\S*)(?::(\d+))(?::(\d+))\)/,e0=(e,t)=>{var i=eJ.exec(e);if(i){var[,s,r,n]=i;return eY(t,s,"?",+r,+n)}var a=eX.exec(e);if(a){if(a[2]&&0===a[2].indexOf("eval")){var o=eZ.exec(a[2]);o&&(a[2]=o[1],a[3]=o[2],a[4]=o[3])}var[l,c]=eQ(a[1]||"?",a[2]);return eY(t,c,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},e1=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,e2=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,e3=(e,t)=>
vendor: 5,023 bytes, line 1
1{var i=e1.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var s=e2.exec(i[3]);s&&(i[1]=i[1]||"eval",i[3]=s[1],i[4]=s[2],i[5]="")}var r=i[3],n=i[1]||"?";return[n,r]=eQ(n,r),eY(t,r,n,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},e5=/\(error: (.*)\)/;class e6{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=A(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 B(e,"DOMException")}isDOMError(e){return B(e,"DOMError")}}class e8{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var i=e.message;return i.error&&"string"==typeof i.error.message?String(i.error.message):String(i)}getStack(e){return e.stacktrace||e.stack||void 0}}class e4{match(e){return B(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var i;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}var e7=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class e9{match(e){return"string"==typeof e}coerce(e,t){var i,[s,r]=this.getInfos(e);return{type:null!=s?s:"Error",value:null!=r?r:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,s=e.match(e7);return s&&(t=s[1],i=s[2]),[t,i]}}var te=["fatal","error","warning","log","info","debug"];function tt(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var s=i.length;s>0;s--){var r=i.slice(0,s).join(", ");if(!(r.length>t))return s===i.length||r.length<=t?r:r.slice(0,t)+"..."}return""}class ti{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return V(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+tt(e)}isSeverityLevel(e){return A(e)&&!D(e)&&te.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)){var i=e[t];if(eW(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class ts{match(e){return V(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+tt(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tr{match(e){return G(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tn{match(e){return B(e,"PromiseRejectionEvent")}coerce(e,t){var i,s=this.getUnhandledRejectionReason(e);return G(s)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(s),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(s)}getUnhandledRejectionReason(e){if(G(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}}var ta=function(e,t){var{debugEnabled:s}=void 0===t?{}:t,r={k:function(t){if(i&&(f.DEBUG||g.POSTHOG_DEBUG||s)&&!M(i.console)&&i.console){for(var r=("__rrweb_original__"in i.console[t])?i.console[t].__rrweb_original__:i.console[t],n=arguments.length,a=Array(n>1?n-1:0),o=1;o<n;o++)a[o-1]=arguments[o];r(e,...a)}},info:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];r.k("log",...t)},warn:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];r.k("warn",...t)},error:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];r.k("error",...t)},critical:function(){for(var t=arguments.length,i=Array(t),s=0;s<t;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning:e=>{r.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>ta(e+" "+t,i)};return r},to=ta("[PostHog.js]"),tl=to.createLogger,tc=tl("[ExternalScriptsLoader]"),tu=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return tc.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=null==l?void 0:l.querySelectorAll("script");
1if(s){for(var r,n=0;n<s.length;n++)if(r=function(){if(s[n].src===t){var e=s[n];return e.__posthog_loading_callback_fired?{v:i()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,i(void 0,t)}),e.onerror=e=>i(e),{v:void 0})}}())return r.v}var a=()=>{if(!l)return i("document not found");var s=l.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)},s.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)l.head.appendChild(s);else{var r,n=l.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):l.body.appendChild(s)}};null!=l&&l.body?a():null==l||l.addEventListener("DOMContentLoaded",a)};g.__PosthogExtensions__=g.__PosthogExtensions__||{},g.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{var s="/static/"+t+".js?v="+e.version;"remote-config"===t&&(s="/array/"+e.config.token+"/config.js"),"toolbar"===t&&(s=s+"&t="+3e5*Math.floor(Date.now()/3e5));var r=e.requestRouter.endpointFor("assets",s);tu(e,r,i)},g.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);tu(e,s,i)};var th={};function td(e,t,i){if(R(e)){if(n&&e.forEach===n)e.forEach(t,i);else if("length"in e&&e.length===+e.length){for(var s=0,r=e.length;s<r;s++)if(s in e&&t.call(i,e[s],s)===th)return}}}function tp(e,t,i){if(!N(e)){if(R(e))return td(e,t,i);if(e instanceof FormData){for(var s of e.entries())if(t.call(i,s[1],s[0])===th)return}else for(var r in e)if(C.call(e,r)&&t.call(i,e[r],r)===th)return}}var tg=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return td(i,function(t){for(var i in t)void 0!==t[i]&&(e[i]=t[i])}),e},tf=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return td(i,function(t){td(t,function(t){e.push(t)})}),e};function tv(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var t_=function(e){try{return e()}catch(e){return}},tm=function(e){return function(){try{for(var t=arguments.length,i=Array(t),s=0;s<t;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){to.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),to.critical(e)}}},ty=function(e){var t={};return tp(e,function(e,i){(A(e)&&e.length>0||j(e))&&(t[i]=e)}),t},tb=["herokuapp.com","vercel.app","netlify.app"];function tw(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}function tE(e,t,i,s){var{capture:r=!1,passive:n=!0}=null!=s?s:{};null==e||e.addEventListener(t,i,{capture:r,passive:n})}var tx="$people_distinct_id",tk="__alias",tS="__timers",tP="$autocapture_disabled_server_side",tF="$heatmaps_enabled_server_side",tC="$exception_capture_enabled_server_side",tO="$error_tracking_suppression_rules",tR="$error_tracking_capture_extension_exceptions",tI="$web_vitals_enabled_server_side",tT="$dead_clicks_enabled_server_side",t$="$product_tours_enabled_server_side",tM="$web_vitals_allowed_metrics",tA="$session_recording_remote_config",tD="$sesid",tL="$session_is_sampled",tN="$enabled_feature_flags",tj="$early_access_features",tq="$feature_flag_details",tH="$stored_person_properties",tU="$stored_group_properties",tG="$surveys",tB="$flag_call_reported",tV="$user_state",tz="$client_session_props",tW="$capture_rate_limit",tK="$initial_campaign_params",tY="$initial_referrer_info",tQ="$initial_person_info",tJ="$epp",tX="__POSTHOG_TOOLBAR__",tZ="$posthog_cookieless",t0=[tx,tk,"__cmpns",tS,"$session_recording_enabled_server_side",tF,tD,tN,tO,tV,tj,tq,tU,tH,tG,tB,tz,tW,tK,tY,tJ,tQ,"$conversations_widget_session_id","$conversations_ticket_id","$conversations_widget_state","$conversations_user_traits"];function t1(e){return e instanceof Element&&(e.id===tX||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function t2(e){return!!e&&1===e.nodeType}function t3(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}
1function t5(e){return!!e&&3===e.nodeType}function t6(e){return!!e&&11===e.nodeType}function t8(e){return e?k(e).split(/\s+/):[]}function t4(e){var t=null==i?void 0:i.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function t7(e){var t="";switch(typeof e.className){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return t8(t)}function t9(e){return N(e)?null:k(e).split(/(\s+)/).filter(e=>iy(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ie(e){var t="";return iu(e)&&!ih(e)&&e.childNodes&&e.childNodes.length&&tp(e.childNodes,function(e){var i;t5(e)&&e.textContent&&(t+=null!=(i=t9(e.textContent))?i:"")}),k(t)}function it(e){var t;return M(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var ii=["a","button","form","input","select","textarea","label"];function is(e,t){if(M(t))return!0;var i,s=function(e){if(t.some(t=>e.matches(t)))return{v:!0}};for(var r of e)if(i=s(r))return i.v;return!1}function ir(e){var t=e.parentNode;return!(!t||!t2(t))&&t}var ia=["next","previous","prev",">","<"],io=[".ph-no-rageclick",".ph-no-capture"],il=e=>!e||t3(e,"html")||!t2(e),ic=(e,t)=>{if(!i||il(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var s=!1,r=[e],n=e;n.parentNode&&!t3(n,"body");)if(t6(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var a=ir(n);if(!a)break;if(t||ii.indexOf(a.tagName.toLowerCase())>-1)s=!0;else{var o=i.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(s=!0)}r.push(a),n=a}return{parentIsUsefulElement:s,targetElementList:r}};function iu(e){for(var t=e;t.parentNode&&!t3(t,"body");t=t.parentNode){var i=t7(t);if(x(i,"ph-sensitive")||x(i,"ph-no-capture"))return!1}if(x(t7(e),"ph-include"))return!0;var s=e.type||"";if(A(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var r=e.name||e.id||"";return!(A(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 ih(e){return!!(t3(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||t3(e,"select")||t3(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var id="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",ip=RegExp("^(?:"+id+")$"),ig=new RegExp(id),iv="\\d{3}-?\\d{2}-?\\d{4}",i_=RegExp("^("+iv+")$"),im=RegExp("("+iv+")");function iy(e,t){return void 0===t&&(t=!0),!(N(e)||A(e)&&(e=k(e),(t?ip:ig).test((e||"").replace(/[- ]/g,""))||(t?i_:im).test(e)))&&!0}function ib(e){var t=ie(e);return iy(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&tp(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=ie(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){to.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function iw(e){return e.replace(/"|\\"/g,'\\"')}class iE{constructor(e){this.disabled=!1===e;var t=T(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 s=this.clicks[this.clicks.length-1];if(s&&Math.abs(e-s.x)+Math.abs(t-s.y)<this.thresholdPx&&i-s.timestamp<this.timeoutMs){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 ix=e=>{var t=null==l?void 0:l.createElement("a");return M(t)?null:(t.href=e,t)},ik=function(e,t){void 0===t&&(t="&");var i,s,r=[];return tp(e,function(e,t){M(e)||M(t)||"undefined"===t||(i=encodeURIComponent(e instanceof File?e.name:e.toString()),s=encodeURIComponent(t),r[r.length]=s+"="+i)}),r.join(t)},iS=function(e,t){for(var i,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<s.length;r++){var n=s[r].split("=");if(n[0]===t){i=n;break}}if(!R(i)||i.length<2)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(e){to.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},iP=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[0]||"",n=s[1],a=r.split("?"),o=a[1],l=a[0],c=(o||"").split("&"),u=[],h=0;h<c.length;h++){var d=c[h].split("=");R(d)&&(t.includes(d[0])?u.push(d[0]+"="+i):u.push(c[h]))}var p=l;return null!=o&&(p+="?"+u.join("&")),null!=n&&(p+="#"+n),p},iF=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},iC="$copy_autocapture",iO=tl("[AutoCapture]");function iR(e,t){return t.length>e?t.slice(0,e)+"...":t}class iI{constructor(e){this.P=!1,this.T=null,this.I=!1,this.instance=e,this.rageclicks=new iE(e.config.rageclick),this.C=null}get R(){var e,t,i=T(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(e=>new RegExp(e)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),i}
1F(){if(this.isBrowserSupported()){if(i&&l){var e=e=>{e=e||(null==i?void 0:i.event);try{this.O(e)}catch(e){iO.error("Failed to capture event",e)}};if(tE(l,"submit",e,{capture:!0}),tE(l,"change",e,{capture:!0}),tE(l,"click",e,{capture:!0}),this.R.capture_copied_text){var t=e=>{e=e||(null==i?void 0:i.event),this.O(e,iC)};tE(l,"copy",t,{capture:!0}),tE(l,"cut",t,{capture:!0})}}}else iO.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.P&&(this.F(),this.P=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.I=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[tP]:!!e.autocapture_opt_out}),this.T=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.C=e}getElementSelectors(e){var t,i=[];return null==(t=this.C)||t.forEach(t=>{var s=null==l?void 0:l.querySelectorAll(t);null==s||s.forEach(s=>{e===s&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[tP];if(L(this.T)&&!H(i)&&!this.instance.M())return!1;var s=null!=(t=this.T)?t:!!i;return!!this.instance.config.autocapture&&!s}O(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var s,r=it(e);t5(r)&&(r=r.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(s=this.rageclicks)&&s.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&function(e,t){if(!i||il(e)||(H(t)?(s=!!t&&io,r=void 0):(s=null!=(n=null==t?void 0:t.css_selector_ignorelist)?n:io,r=null==t?void 0:t.content_ignorelist),!1===s))return!1;var s,r,n,{targetElementList:a}=ic(e,!1);return!function(e,t){var i;if(!1===e||M(e))return!1;if(!0===e)i=ia;else{if(!R(e))return!1;if(e.length>10)return to.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=e.map(e=>e.toLowerCase())}return t.some(e=>{var{safeText:t,ariaLabel:s}=e;return i.some(e=>t.includes(e)||s.includes(e))})}(r,a.map(e=>{var t;return{safeText:ie(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!is(a,s)}(r,this.instance.config.rageclick)&&this.O(e,"$rageclick");var n=t===iC;if(r&&function(e,t,s,r,n){if(void 0===s&&(s=void 0),!i||il(e)||null!=(a=s)&&a.url_allowlist&&!t4(s.url_allowlist)||null!=(o=s)&&o.url_ignorelist&&t4(s.url_ignorelist))return!1;if(null!=(l=s)&&l.dom_event_allowlist){var a,o,l,c,u=s.dom_event_allowlist;if(u&&!u.some(e=>t.type===e))return!1}var{parentIsUsefulElement:h,targetElementList:d}=ic(e,r);if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(M(i))return!0;var s,r=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(s=r(n))return s.v;return!1}(d,s)||!is(d,null==(c=s)?void 0:c.css_selector_allowlist))return!1;var p=i.getComputedStyle(e);if(p&&"pointer"===p.getPropertyValue("cursor")&&"click"===t.type)return!0;var g=e.tagName.toLowerCase();switch(g){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return h?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(ii.indexOf(g)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.R,n,n?["copy","cut"]:void 0)){var{props:a,explicitNoCapture:o}=function(e,t){for(var s,r,{e:n,maskAllElementAttributes:a,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:c}=t,u=[e],h=e;h.parentNode&&!t3(h,"body");)t6(h.parentNode)?(u.push(h.parentNode.host),h=h.parentNode.host):(u.push(h.parentNode),h=h.parentNode);var d,p=[],g={},f=!1,v=!1;if(tp(u,e=>{var t=iu(e);"a"===e.tagName.toLowerCase()&&(f=e.getAttribute("href"),f=t&&f&&iy(f)&&f),x(t7(e),"ph-no-capture")&&(v=!0),p.push(function(e,t,i,s){var r=e.tagName.toLowerCase(),n={tag_name:r};ii.indexOf(r)>-1&&!i&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?n.$el_text=iR(1024,ib(e)):n.$el_text=iR(1024,ie(e)));var a=t7(e);a.length>0&&(n.classes=a.filter(function(e){return""!==e})),tp(e.attributes,function(i){var r;if((!ih(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&
1!t&&iy(i.value)&&(!A(r=i.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))){var a=i.value;"class"===i.name&&(a=t8(a).join(" ")),n["attr__"+i.name]=iR(1024,a)}});for(var o=1,l=1,c=e;c=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!t2(t))return t}(c);)o++,c.tagName===e.tagName&&l++;return n.nth_child=o,n.nth_of_type=l,n}(e,a,o,l)),tg(g,function(e){if(!iu(e))return{};var t={};return tp(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),s=e.value;i&&s&&iy(s)&&(t[i]=s)}}),t}(e))}),v)return{props:{},explicitNoCapture:v};if(o||("a"===e.tagName.toLowerCase()||"button"===e.tagName.toLowerCase()?p[0].$el_text=ib(e):p[0].$el_text=ie(e)),f){p[0].attr__href=f;var _,y,b=null==(_=ix(f))?void 0:_.host,w=null==i||null==(y=i.location)?void 0:y.host;b&&w&&b!==w&&(d=f)}return{props:tg({$event_type:n.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:p.map(e=>{var t,i,s,r={text:null==(i=e.$el_text)?void 0:i.slice(0,400),tag_name:e.tag_name,href:null==(s=e.attr__href)?void 0:s.slice(0,2048),attr_class:(t=e.attr__class)?R(t)?t:t8(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return tv(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return r.attributes[t]=i}),r}).map(e=>{var t,i,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var r of(e.attr_class.sort(),e.attr_class))s+="."+r.replace(/"/g,"");var n=m({},e.text?{text:e.text}:{},{"nth-child":null!=(t=e.nth_child)?t:0,"nth-of-type":null!=(i=e.nth_of_type)?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return tv(n).sort((e,t)=>{var[i]=e,[s]=t;return i.localeCompare(s)}).forEach(e=>{var[t,i]=e;return a[iw(t.toString())]=iw(i.toString())}),s+=":",s+=tv(a).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},null!=(s=p[0])&&s.$el_text?{$el_text:null==(r=p[0])?void 0:r.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},g)}}(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.R.element_attribute_ignorelist,elementsChainAsString:this.I});if(o)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(a.$element_selectors=l),t===iC){var c,u=t9(null==i||null==(c=i.getSelection())?void 0:c.toString()),h=e.type||"clipboard";if(!u)return!1;a.$selected_content=u,a.$copy_type=h}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return I(null==l?void 0:l.querySelectorAll)}}Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return j(e)&&isFinite(e)&&Math.floor(e)===e});var iT="0123456789abcdef";class i${constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||e<0||t<0||i<0||s<0||e>0xffffffffffff||t>4095||i>0x3fffffff||s>0xffffffff)throw RangeError("invalid field value");var r=new Uint8Array(16);return r[0]=e/0x10000000000,r[1]=e/0x100000000,r[2]=e/0x1000000,r[3]=e/65536,r[4]=e/256,r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|i>>>24,r[9]=i>>>16,r[10]=i>>>8,r[11]=i,r[12]=s>>>24,r[13]=s>>>16,r[14]=s>>>8,r[15]=s,new i$(r)}toString(){for(var e="",t=0;t<this.bytes.length;t++)e=e+iT.charAt(this.bytes[t]>>>4)+iT.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new i$(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;t<16;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}class iM{constructor(){this.A=0,this.j=0,this.D=new iL}generate(){var e=this.generateOrAbort();if(M(e)){this.A=0;var t=this.generateOrAbort();if(M(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.A)this.A=e,this.L();else{if(!(e+1e4>this.A))return;this.j++,this.j>
10x3ffffffffff&&(this.A++,this.L())}return i$.fromFieldsV7(this.A,Math.trunc(this.j/0x40000000),0x3fffffff&this.j,this.D.nextUint32())}L(){this.j=1024*this.D.nextUint32()+(1023&this.D.nextUint32())}}var iA,iD=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};i&&!M(i.crypto)&&crypto.getRandomValues&&(iD=e=>crypto.getRandomValues(e));class iL{constructor(){this.N=new Uint32Array(8),this.U=1/0}nextUint32(){return this.U>=this.N.length&&(iD(this.N),this.U=0),this.N[this.U++]}}var iN=()=>ij().toString(),ij=()=>(iA||(iA=new iM)).generate(),iq="",iH=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,iU={H:()=>!!l,B:function(e){to.error("cookieStore error: "+e)},q:function(e){if(l){try{for(var t=e+"=",i=l.cookie.split(";").filter(e=>e.length),s=0;s<i.length;s++){for(var r=i[s];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}},W:function(e){var t;try{t=JSON.parse(iU.q(e))||{}}catch(e){}return t},G:function(e,t,i,s,r){if(l)try{var n="",a="",o=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=l),iq)return iq;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+iN();!iq&&s--;){var n=i.slice(s).join("."),a=r+"=1;domain=."+n+";path=/";t.cookie=a+";max-age=3",t.cookie.includes(r)&&(t.cookie=a+";max-age=0",iq=n)}return iq}(e);if(!i){var s,r=(s=e.match(iH))?s[0]:"";r!==i&&to.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(l.location.hostname,s);if(i){var c=new Date;c.setTime(c.getTime()+24*i*36e5),n="; expires="+c.toUTCString()}r&&(a="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+o+a;return u.length>3686.4&&to.warn("cookieStore warning: large cookie, len="+u.length),l.cookie=u,u}catch(e){return}},V:function(e,t){if(null!=l&&l.cookie)try{iU.G(e,"",-1,t)}catch(e){return}}},iG=null,iB={H:function(){if(!L(iG))return iG;var e=!0;if(M(i))e=!1;else try{var t="__mplssupport__";iB.G(t,"xyz"),'"xyz"'!==iB.q(t)&&(e=!1),iB.V(t)}catch(t){e=!1}return e||to.error("localStorage unsupported; falling back to cookie store"),iG=e,e},B:function(e){to.error("localStorage error: "+e)},q:function(e){try{return null==i?void 0:i.localStorage.getItem(e)}catch(e){iB.B(e)}return null},W:function(e){try{return JSON.parse(iB.q(e))||{}}catch(e){}return null},G:function(e,t){try{null==i||i.localStorage.setItem(e,JSON.stringify(t))}catch(e){iB.B(e)}},V:function(e){try{null==i||i.localStorage.removeItem(e)}catch(e){iB.B(e)}}},iV=["$device_id","distinct_id",tD,tL,tJ,tQ],iz={},iW={H:function(){return!0},B:function(e){to.error("memoryStorage error: "+e)},q:function(e){return iz[e]||null},W:function(e){return iz[e]||null},G:function(e,t){iz[e]=t},V:function(e){delete iz[e]}},iK=null,iY={H:function(){if(!L(iK))return iK;if(iK=!0,M(i))iK=!1;else try{var e="__support__";iY.G(e,"xyz"),'"xyz"'!==iY.q(e)&&(iK=!1),iY.V(e)}catch(e){iK=!1}return iK},B:function(e){to.error("sessionStorage error: ",e)},q:function(e){try{return null==i?void 0:i.sessionStorage.getItem(e)}catch(e){iY.B(e)}return null},W:function(e){try{return JSON.parse(iY.q(e))||null}catch(e){}return null},G:function(e,t){try{null==i||i.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){iY.B(e)}},V:function(e){try{null==i||i.sessionStorage.removeItem(e)}catch(e){iY.B(e)}}},iQ=((n_={})[n_.PENDING=-1]="PENDING",n_[n_.DENIED=0]="DENIED",n_[n_.GRANTED=1]="GRANTED",n_);class iJ{constructor(e){this._instance=e}get R(){return this._instance.config}get consent(){return this.J()?iQ.DENIED:this.K}isOptedOut(){return"always"===this.R.cookieless_mode||this.consent===iQ.DENIED||this.consent===iQ.PENDING&&(this.R.opt_out_capturing_by_default||"on_reject"===this.R.cookieless_mode)}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===iQ.DENIED}optInOut(e){this.Y.G(this.X,+!!e,this.R.cookie_expiration,this.R.cross_subdomain_cookie,this.R.secure_cookie)}reset(){this.Y.V(this.X,this.R.cross_subdomain_cookie)}get X(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;
1return i||(t?t+e:"__ph_opt_in_out_"+e)}get K(){var e=this.Y.q(this.X);return x(z,e)?iQ.GRANTED:x(W,e)?iQ.DENIED:iQ.PENDING}get Y(){if(!this.Z){var e=this.R.opt_out_capturing_persistence_type;this.Z="localStorage"===e?iB:iU;var t="localStorage"===e?iU:iB;t.q(this.X)&&(this.Z.q(this.X)||this.optInOut(x(z,t.q(this.X))),t.V(this.X,this.R.cross_subdomain_cookie))}return this.Z}J(){return!!this.R.respect_dnt&&!!tw([null==o?void 0:o.doNotTrack,null==o?void 0:o.msDoNotTrack,g.doNotTrack],e=>x(z,e))}}var iX=tl("[Dead Clicks]"),iZ=()=>!0,i0=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(tT)),s=e.instance.config.capture_dead_clicks;return H(s)?s:!!T(s)||i};class i1{get lazyLoadedDeadClicksAutocapture(){return this.tt}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabled()}onRemoteConfig(e){this.instance.persistence&&this.instance.persistence.register({[tT]:null==e?void 0:e.captureDeadClicks}),this.startIfEnabled()}startIfEnabled(){this.isEnabled(this)&&this.it(()=>{this.et()})}it(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.initDeadClicksAutocapture&&e(),null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?iX.error("failed to load script",t):e()})}et(){var e;if(l){if(!this.tt&&null!=(e=g.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=T(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.tt=g.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.tt.start(l),iX.info("starting...")}}else iX.error("`document` not found. Cannot start.")}stop(){this.tt&&(this.tt.stop(),this.tt=void 0,iX.info("stopping..."))}}var i2=tl("[ExceptionAutocapture]");class i3{constructor(e){var t,s,r;this.rt=()=>{var e;if(i&&this.isEnabled&&null!=(e=g.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=g.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,s=g.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=g.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.st&&this.R.capture_unhandled_errors&&(this.st=t(this.captureException.bind(this))),!this.nt&&this.R.capture_unhandled_rejections&&(this.nt=s(this.captureException.bind(this))),!this.ot&&this.R.capture_console_errors&&(this.ot=r(this.captureException.bind(this)))}catch(e){i2.error("failed to start",e),this.ut()}}},this._instance=e,this.ht=!(null==(t=this._instance.persistence)||!t.props[tC]),this.dt=new Y({refillRate:null!=(s=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)?s:1,bucketSize:null!=(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)?r:10,refillInterval:1e4,h:i2}),this.R=this.vt(),this.startIfEnabledOrStop()}vt(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return T(e)?t=m({},t,e):(M(e)?this.ht:e)&&(t=m({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.R.capture_console_errors||this.R.capture_unhandled_errors||this.R.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(i2.info("enabled"),this.ut(),this.it(this.rt)):this.ut()}it(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.errorWrappingFunctions&&e(),null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return i2.error("failed to load script",t);e()})}ut(){var e,t,i;null==(e=this.st)||e.call(this),this.st=void 0,null==(t=this.nt)||t.call(this),this.nt=void 0,null==(i=this.ot)||i.call(this),this.ot=void 0}onRemoteConfig(e){var t=e.autocaptureExceptions;this.ht=!!t,this._instance.persistence&&this._instance.persistence.register({[tC]:this.ht}),this.R=this.vt(),this.startIfEnabledOrStop()}onConfigChange(){this.R=this.vt()}captureException(e){var t,i,s=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";this.dt.consumeRateLimit(s)?i2.info("Skipping exception capture because of client rate limiting.",{exception:s}):this._instance.exceptions.sendExceptionEvent(e)}}function i5(e,t,i){try{if(!(t in e))return()=>{};var s=e[t],r=i(s);return I(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=r,()=>{e[t]=s}}catch(e){return()=>{}}}class i6{constructor(e){var t;this._instance=e,this.ct=(null==i||null==(t=i.location)?void 0:t.pathname)||""}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(to.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.ft&&this.ft(),this.ft=void 0,to.info("History API monitoring stopped")}monitorHistoryChanges(){var e,t;if(i&&i.history){var s=this;null!=(e=i.history.pushState)&&e.__posthog_wrapped__||i5(i.history,"pushState",e=>function(t,i,r){e.call(this,t,i,r),s._t("pushState")}),null!=(t=i.history.replaceState)&&t.__posthog_wrapped__||i5(i.history,"replaceState",e=>function(t,i,r){e.call(this,t,i,r),s._t("replaceState")}),this.bt()}}_t(e){try{var t,s=null==i||null==(t=i.location)?void 0:t.pathname;if(!s)return;s!==this.ct&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:e}),this.ct=s}catch(t){to.error("Error capturing "+e+" pageview",t)}}
1bt(){if(!this.ft){var e=()=>{this._t("popstate")};tE(i,"popstate",e),this.ft=()=>{i&&i.removeEventListener("popstate",e)}}}}var i8=tl("[SegmentIntegration]"),i4="posthog-js";function i7(e,t){var{organization:i,projectId:s,prefix:r,severityAllowList:n=["error"],sendExceptionsToPostHog:a=!0}=void 0===t?{}:t;return t=>{if(!("*"===n||n.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var o,l,c,u,h,d=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p=(null==(o=t.exception)?void 0:o.values)||[],g=p.map(e=>m({},e,{stacktrace:e.stacktrace?m({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>m({},e,{platform:"web:javascript"}))}):void 0})),f={$exception_message:(null==(l=p[0])?void 0:l.value)||t.message,$exception_type:null==(c=p[0])?void 0:c.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(u=p[0])?void 0:u.value)||t.message,$sentry_exception_type:null==(h=p[0])?void 0:h.type,$sentry_tags:t.tags};return i&&s&&(f.$sentry_url=(r||"https://sentry.io/organizations/")+i+"/issues/?project="+s+"&query="+t.event_id),a&&e.exceptions.sendExceptionEvent(f),t}}class i9{constructor(e,t,i,s,r,n){this.name=i4,this.setupOnce=function(a){a(i7(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}var se=null!=i&&i.location?iF(i.location.hash,"__posthog")||iF(location.hash,"state"):null,st="_postHogToolbarParams",si=tl("[Toolbar]"),ss=((nm=ss||{})[nm.UNINITIALIZED=0]="UNINITIALIZED",nm[nm.LOADING=1]="LOADING",nm[nm.LOADED=2]="LOADED",nm);class sr{constructor(e){this.instance=e}yt(e){g.ph_toolbar_state=e}wt(){var e;return null!=(e=g.ph_toolbar_state)?e:ss.UNINITIALIZED}maybeLoadToolbar(e,t,s){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===s&&(s=void 0),!i||!l)return!1;e=null!=e?e:i.location,s=null!=s?s:i.history;try{if(!t){try{i.localStorage.setItem("test","test"),i.localStorage.removeItem("test")}catch(e){return!1}t=null==i?void 0:i.localStorage}var r,n=se||iF(e.hash,"__posthog")||iF(e.hash,"state"),a=n?t_(()=>JSON.parse(atob(decodeURIComponent(n))))||t_(()=>JSON.parse(decodeURIComponent(n))):null;return a&&"ph_authorize"===a.action?((r=a).source="url",r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:s?s.replaceState(s.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(st)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch(e){return!1}}xt(e){var t=g.ph_load_toolbar||g.ph_load_editor;!N(t)&&I(t)?t(e,this.instance):si.warn("No toolbar load function found")}loadToolbar(e){var t,s=!(null==l||!l.getElementById(tX));if(!i||s)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=m({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});return(i.localStorage.setItem(st,JSON.stringify(m({},n,{source:void 0}))),this.wt()===ss.LOADED)?this.xt(n):this.wt()===ss.UNINITIALIZED&&(this.yt(ss.LOADING),null==(t=g.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{e?(si.error("[Toolbar] Failed to load",e),this.yt(ss.UNINITIALIZED)):(this.yt(ss.LOADED),this.xt(n))}),tE(i,"turbolinks:load",()=>{this.yt(ss.UNINITIALIZED),this.loadToolbar(n)})),!0}Et(e){return this.loadToolbar(e)}maybeLoadEditor(e,t,i){return void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),this.maybeLoadToolbar(e,t,i)}}var sn=tl("[TracingHeaders]");class sa{constructor(e){this.$t=void 0,this.St=void 0,this.rt=()=>{var e,t;M(this.$t)&&(null==(e=g.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),M(this.St)&&(null==(t=g.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)||t._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=e}it(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.tracingHeadersPatchFns&&e(),null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return sn.error("failed to load script",t);e()})}startIfEnabledOrStop(){var e,t;this._instance.config.__add_tracing_headers?this.it(this.rt):(null==(e=this.$t)||e.call(this),null==(t=this.St)||t.call(this),this.$t=void 0,this.St=void 0)}}var so="https?://(.*)",sl=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],sc=tf(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],sl),su="<masked>",sh=["li_fat_id"];function sd(e,t,i){if(!l)return{};var s,r=t?tf([],sl,i||[]):[],n=sp(iP(l.URL,r,su),e);return tg((s={},tp(sh,function(e){var t=iU.q(e);s[e]=t||null}),s),n)}function sp(e,t){var i=sc.concat(t||[]),s={};return tp(i,function(t){var i=iS(e,t);s[t]=i||null}),s}function sg(e){var t=e?0===e.search(so+"google.([^/?]*)")?"google":0===e.search(so+"bing.com")?"bing":0===e.search(so+"yahoo.com")?"yahoo":0===e.search(so+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!L(t)){i.$search_engine=t;var s=l?iS(l.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function sf(){return navigator.language||navigator.userLanguage}function sv(){return(null==l?void 0:l.referrer)||"$direct"}function s_(e,t){var i=e?tf([],sl,t||[]):[],s=null==c?void 0:c.href.substring(0,1e3);return{r:sv().substring(0,1e3),u:s?iP(s,i,su):void 0}}function sm(e){var t,{r:i,u:s}=e,r={$referrer:i,$referring_domain:null==i?void 0:"$direct"==i?"$direct":null==(t=ix(i))?void 0:t.host};
1if(s){r.$current_url=s;var n=ix(s);r.$host=null==n?void 0:n.host,r.$pathname=null==n?void 0:n.pathname,tg(r,sp(s))}return i&&tg(r,sg(i)),r}function sy(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var sb=tl("[Web Vitals]");class sw{constructor(e){var t;this.kt=!1,this.P=!1,this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Pt=()=>{clearTimeout(this.Tt),0!==this.N.metrics.length&&(this._instance.capture("$web_vitals",this.N.metrics.reduce((e,t)=>m({},e,{["$web_vitals_"+t.name+"_event"]:m({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.N={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.It=e=>{var t,i=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0);if(M(i))sb.error("Could not read session ID. Dropping metrics!");else{this.N=this.N||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=this.Ct();M(s)||(N(null==e?void 0:e.name)||N(null==e?void 0:e.value)?sb.error("Invalid metric received",e):this.Rt&&e.value>=this.Rt?sb.error("Ignoring metric with value >= "+this.Rt,e):(this.N.url!==s&&(this.Pt(),this.Tt=setTimeout(this.Pt,this.flushToCaptureTimeoutMs)),M(this.N.url)&&(this.N.url=s),this.N.firstMetricTimestamp=M(this.N.firstMetricTimestamp)?Date.now():this.N.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0),this.N.metrics.push(m({},e,{$current_url:s,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),this.N.metrics.length===this.allowedMetrics.length&&this.Pt()))}},this.rt=()=>{if(!this.P){var e,t,i,s,r=g.__PosthogExtensions__;M(r)||M(r.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:s}=r.postHogWebVitalsCallbacks),e&&t&&i&&s?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.It.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.It.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.It.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.It.bind(this)),this.P=!0):sb.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.kt=!(null==(t=this._instance.persistence)||!t.props[tI]),this.startIfEnabled()}get allowedMetrics(){var e,t,i=T(this._instance.config.capture_performance)?null==(e=this._instance.config.capture_performance)?void 0:e.web_vitals_allowed_metrics:void 0;return N(i)?(null==(t=this._instance.persistence)?void 0:t.props[tM])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(T(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=T(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return null!=e&&e}get Rt(){var e=T(this._instance.config.capture_performance)&&j(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:9e5;return 0<e&&e<=6e4?9e5:e}get isEnabled(){var e=null==c?void 0:c.protocol;if("http:"!==e&&"https:"!==e)return sb.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=T(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:H(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return H(t)?t:this.kt}startIfEnabled(){this.isEnabled&&!this.P&&(sb.info("enabled, starting..."),this.it(this.rt))}onRemoteConfig(e){var t=T(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=T(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[tI]:t}),this._instance.persistence.register({[tM]:i})),this.kt=t,this.startIfEnabled()}it(e){var t,i;if(null!=(t=g.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks)e();else{var s=this.useAttribution?"web-vitals-with-attribution":"web-vitals";null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,s,t=>{t?sb.error("failed to load script",t):e()})}}Ct(){var e=i?i.location.href:void 0;if(e){var t=this._instance.config.mask_personal_data_properties,s=this._instance.config.custom_personal_data_properties;return iP(e,t?tf([],sl,s||[]):[],su)}sb.error("Could not determine current URL")}}var sE=tl("[Heatmaps]");function sx(e){return T(e)&&"clientX"in e&&"clientY"in e&&j(e.clientX)&&j(e.clientY)}class sk{constructor(e){var t;this.kt=!1,this.P=!1,this.Ft=null,this.instance=e,this.kt=!(null==(t=this.instance.persistence)||!t.props[tF]),this.rageclicks=new iE(e.config.rageclick)}get flushIntervalMilliseconds(){var e=5e3;return T(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return N(this.instance.config.capture_heatmaps)?N(this.instance.config.enable_heatmaps)?this.kt:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.P||(sE.info("starting..."),this.Ot(),this.Mt());else{var e;clearInterval(null!=(e=this.Ft)?e:void 0),this.At(),this.getAndClearBuffer()}}onRemoteConfig(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[tF]:t}),this.kt=t,this.startIfEnabled()}getAndClearBuffer(){var e=this.N;return this.N=void 0,e}jt(e){this.Dt(e.originalEvent,"deadclick")}Mt(){this.Ft&&clearInterval(this.Ft),this.Ft="visible"===(null==l?void 0:l.visibilityState)?setInterval(this.Lt.bind(this),this.flushIntervalMilliseconds):null}Ot(){i&&l&&(this.Nt=this.Lt.bind(this),tE(i,"beforeunload",this.Nt),this.Ut=e=>this.Dt(e||(null==i?void 0:i.event)),tE(l,"click",this.Ut,{capture:!0}),this.zt=e=>this.Ht(e||(null==i?void 0:i.event)),tE(l,"mousemove",this.zt,{capture:!0}),this.Bt=new i1(this.instance,iZ,this.jt.bind(this)),this.Bt.startIfEnabled(),this.qt=this.Mt.bind(this),tE(l,"visibilitychange",this.qt),this.P=!0)}At(){var e;i&&l&&(this.Nt&&i.removeEventListener("beforeunload",this.Nt),this.Ut&&l.removeEventListener("click",this.Ut,{capture:!0}),this.zt&&l.removeEventListener("mousemove",this.zt,{capture:!0}),this.qt&&l.removeEventListener("visibilitychange",this.qt),clearTimeout(this.Wt),null==(e=this.Bt)||e.stop(),this.P=!1)}Gt(e,t){var s=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),a=function(e,t,s){for(var r=e;r&&t2(r)&&!t3(r,"body")&&r!==s;){if(x(t,null==i?void 0:i.getComputedStyle(r).position))return!0;r=ir(r)}return!1}(it(e),["fixed","sticky"],n);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:s),target_fixed:a,type:t}}Dt(e,t){var i;if(void 0===t&&(t="click"),!t1(e.target)&&sx(e)){var s=this.Gt(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this.Vt(m({}
1,s,{type:"rageclick"})),this.Vt(s)}}Ht(e){!t1(e.target)&&sx(e)&&(clearTimeout(this.Wt),this.Wt=setTimeout(()=>{this.Vt(this.Gt(e,"mousemove"))},500))}Vt(e){if(i){var t=i.location.href,s=this.instance.config.mask_personal_data_properties,r=this.instance.config.custom_personal_data_properties,n=iP(t,s?tf([],sl,r||[]):[],su);this.N=this.N||{},this.N[n]||(this.N[n]=[]),this.N[n].push(e)}}Lt(){this.N&&!$(this.N)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}class sS{constructor(e){this.Jt=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength)&&(to.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Kt=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Yt()}Yt(){var e;this.Xt=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Jt)}destroy(){var e;null==(e=this.Xt)||e.call(this),this.Xt=void 0}doPageView(e,t){var s,r=this.Qt(e,t);return this.Kt={pathname:null!=(s=null==i?void 0:i.location.pathname)?s:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.Qt(e,null==(t=this.Kt)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Kt)?void 0:e.pageViewId}}Qt(e,t){var i=this.Kt;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:a,maxScrollY:o,maxContentHeight:l,lastContentY:c,maxContentY:u}=r;if(!(M(n)||M(a)||M(o)||M(l)||M(c)||M(u))){n=Math.ceil(n),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u);var h=n<=1?1:K(a/n,0,1,to),d=n<=1?1:K(o/n,0,1,to),p=l<=1?1:K(c/l,0,1,to),g=l<=1?1:K(u/l,0,1,to);s=tg(s,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:o,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:c,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:u,$prev_pageview_max_content_percentage:g})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}}var sP=((ny={}).GZipJS="gzip-js",ny.Base64="base64",ny),sF=Uint8Array,sC=Uint16Array,sO=Uint32Array,sR=new sF([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]),sI=new sF([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]),sT=new sF([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s$=function(e,t){for(var i=new sC(31),s=0;s<31;++s)i[s]=t+=1<<e[s-1];var r=new sO(i[30]);for(s=1;s<30;++s)for(var n=i[s];n<i[s+1];++n)r[n]=n-i[s]<<5|s;return[i,r]},sM=s$(sR,2),sA=sM[0],sD=sM[1];sA[28]=258,sD[258]=28;for(var sL=s$(sI,0)[1],sN=new sC(32768),sj=0;sj<32768;++sj){var sq=(43690&sj)>>>1|(21845&sj)<<1;sq=(61680&(sq=(52428&sq)>>>2|(13107&sq)<<2))>>>4|(3855&sq)<<4,sN[sj]=((65280&sq)>>>8|(255&sq)<<8)>>>1}var sH=function(e,t,i){for(var s=e.length,r=0,n=new sC(t);r<s;++r)++n[e[r]-1];var a,o=new sC(t);for(r=0;r<t;++r)o[r]=o[r-1]+n[r-1]<<1;if(i){a=new sC(1<<t);var l=15-t;for(r=0;r<s;++r)if(e[r])for(var c=r<<4|e[r],u=t-e[r],h=o[e[r]-1]++<<u,d=h|(1<<u)-1;h<=d;++h)a[sN[h]>>>l]=c}else for(a=new sC(s),r=0;r<s;++r)a[r]=sN[o[e[r]-1]++]>>>15-e[r];return a},sU=new sF(288);for(sj=0;sj<144;++sj)sU[sj]=8;for(sj=144;sj<256;++sj)sU[sj]=9;for(sj=256;sj<280;++sj)sU[sj]=7;for(sj=280;sj<288;++sj)sU[sj]=8;var sG=new sF(32);for(sj=0;sj<32;++sj)sG[sj]=5;var sB=sH(sU,9,0),sV=sH(sG,5,0),sz=function(e){return(e/8|0)+(7&e&&1)},sW=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof sC?sC:e instanceof sO?sO:sF)(i-t);return s.set(e.subarray(t,i)),s},sK=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8},sY=function(e,t,i){i<<=7&t;var s=t/8|0;e[s]|=i,e[s+1]|=i>>>8,e[s+2]|=i>>>16},sQ=function(e,t){for(var i=[],s=0;s<e.length;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new sF(0),0];if(1==r){var a=new sF(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var o=i[0],l=i[1],c=0,u=1,h=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};u!=r-1;)o=i[i[c].f<i[h].f?c++:h++],l=i[c!=u&&i[c].f<i[h].f?c++:h++],i[u++]={s:-1,f:o.f+l.f,l:o,r:l};var d=n[0].s;for(s=1;s<r;++s)n[s].s>d&&(d=n[s].s);
vendor: 1,513 bytes, line 1
1var p=new sC(d+1),g=sJ(i[u-1],p,0);if(g>t){s=0;var f=0,v=g-t,_=1<<v;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});s<r;++s){var m=n[s].s;if(!(p[m]>t))break;f+=_-(1<<g-p[m]),p[m]=t}for(f>>>=v;f>0;){var y=n[s].s;p[y]<t?f-=1<<t-p[y]++-1:++s}for(;s>=0&&f;--s){var b=n[s].s;p[b]==t&&(--p[b],++f)}g=t}return[new sF(p),g]},sJ=function(e,t,i){return -1==e.s?Math.max(sJ(e.l,t,i+1),sJ(e.r,t,i+1)):t[e.s]=i},sX=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new sC(++t),s=0,r=e[0],n=1,a=function(e){i[s++]=e},o=1;o<=t;++o)if(e[o]==r&&o!=t)++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=e[o]}return[i.subarray(0,s),t]},sZ=function(e,t){for(var i=0,s=0;s<t.length;++s)i+=e[s]*t[s];return i},s0=function(e,t,i){var s=i.length,r=sz(t+2);e[r]=255&s,e[r+1]=s>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var n=0;n<s;++n)e[r+n+4]=i[n];return 8*(r+4+s)},s1=function(e,t,i,s,r,n,a,o,l,c,u){sK(t,u++,i),++r[256];for(var h=sQ(r,15),d=h[0],p=h[1],g=sQ(n,15),f=g[0],v=g[1],_=sX(d),m=_[0],y=_[1],b=sX(f),w=b[0],E=b[1],x=new sC(19),k=0;k<m.length;++k)x[31&m[k]]++;for(k=0;k<w.length;++k)x[31&w[k]]++;for(var S=sQ(x,7),P=S[0],F=S[1],C=19;C>4&&!P[sT[C-1]];--C);var O,R,I,T,$=c+5<<3,M=sZ(r,sU)+sZ(n,sG)+a,A=sZ(r,d)+sZ(n,f)+a+14+3*C+sZ(x,P)+(2*x[16]+3*x[17]+7*x[18]);if($<=M&&$<=A)return s0(t,u,e.subarray(l,l+c));if(sK(t,u,1+(A<M)),u+=2,A<M){O=sH(d,p,0),R=d,I=sH(f,v,0),T=f;var D=sH(P,F,0);
1for(sK(t,u,y-257),sK(t,u+5,E-1),sK(t,u+10,C-4),u+=14,k=0;k<C;++k)sK(t,u+3*k,P[sT[k]]);u+=3*C;for(var L=[m,w],N=0;N<2;++N){var j=L[N];for(k=0;k<j.length;++k){var q=31&j[k];sK(t,u,D[q]),u+=P[q],q>15&&(sK(t,u,j[k]>>>5&127),u+=j[k]>>>12)}}}else O=sB,R=sU,I=sV,T=sG;for(k=0;k<o;++k)if(s[k]>255){sY(t,u,O[(q=s[k]>>>18&31)+257]),u+=R[q+257],q>7&&(sK(t,u,s[k]>>>23&31),u+=sR[q]);var H=31&s[k];sY(t,u,I[H]),u+=T[H],H>3&&(sY(t,u,s[k]>>>5&8191),u+=sI[H])}else sY(t,u,O[s[k]]),u+=R[s[k]];return sY(t,u,O[256]),u+R[256]},s2=new sO([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),s3=function(){for(var e=new sO(256),t=0;t<256;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),s5=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},s6=function(e){var t,i,s,r,n="";for(t=i=0,s=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,r=0;r<s;r++){var a=e.charCodeAt(r),o=null;a<128?i++:o=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),L(o)||(i>t&&(n+=e.substring(t,i)),n+=o,t=i=r+1)}return i>t&&(n+=e.substring(t,e.length)),n},s8=!!h||!!u,s4="text/plain",s7=function(e,t,i){void 0===i&&(i=!0);var s,[r,n]=e.split("?"),a=m({},t),o=null!=(s=null==n?void 0:n.split("&").map(e=>{var t,[s,r]=e.split("="),n=i&&null!=(t=a[s])?t:r;return delete a[s],s+"="+n}))?s:[],l=ik(a);return l&&o.push(l),r+"?"+o.join("&")},s9=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),re=e=>{var{data:t,compression:i}=e;if(t){if(i===sP.GZipJS){var s,r,n,a,o,l,c,u,h=new Blob([(s=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new sF(e.length+(e.length>>>1)),s=0,r=function(e){i[s++]=e},n=0;n<t;++n){if(s+5>i.length){var a=new sF(s+8+(t-n<<1));a.set(i),i=a}var o=e.charCodeAt(n);o<128?r(o):(o<2048?r(192|o>>>6):(o>55295&&o<57344?(r(240|(o=65536+(1047552&o)|1023&e.charCodeAt(++n))>>>18),r(128|o>>>12&63)):r(224|o>>>12),r(128|o>>>6&63)),r(128|63&o))}return sW(i,0,s)}(s9(t)),r={mtime:0},n=0xffffffff,a={p:function(e){for(var t=n,i=0;i<e.length;++i)t=s3[255&t^e[i]]^t>>>8;n=t},d:function(){return 0xffffffff^n}},o=s.length,a.p(s),u=(l=10+(r.filename&&r.filename.length+1||0),c=function(e,t,i,s,r){var n=e.length,a=new sF(s+n+5*(1+Math.floor(n/7e3))+8),o=a.subarray(s,a.length-8),l=0;if(!t||n<8)for(var c=0;c<=n;c+=65535){var u=c+65535;u<n?l=s0(o,l,e.subarray(c,u)):(o[c]=r,l=s0(o,l,e.subarray(c,n)))}else{for(var h=s2[t-1],d=h>>>13,p=8191&h,g=(1<<i)-1,f=new sC(32768),v=new sC(g+1),_=Math.ceil(i/3),m=2*_,y=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<m)&g},b=new sO(25e3),w=new sC(288),E=new sC(32),x=0,k=0,S=(c=0,0),P=0,F=0;c<n;++c){var C=y(c),O=32767&c,R=v[C];if(f[O]=R,v[C]=O,P<=c){var I=n-c;if((x>7e3||S>24576)&&I>423){l=s1(e,o,0,b,w,E,k,S,F,c-F,l),S=x=k=0,F=c;for(var T=0;T<286;++T)w[T]=0;for(T=0;T<30;++T)E[T]=0}var $=2,M=0,A=p,D=O-R&32767;if(I>2&&C==y(c-D))for(var L=Math.min(d,I)-1,N=Math.min(32767,c),j=Math.min(258,I);D<=N&&--A&&O!=R;){if(e[c+$]==e[c+$-D]){for(var q=0;q<j&&e[c+q]==e[c+q-D];++q);if(q>$){if($=q,M=D,q>L)break;var H=Math.min(D,q-2),U=0;for(T=0;T<H;++T){var G=c-D+T+32768&32767,B=G-f[G]+32768&32767;B>U&&(U=B,R=G)}}}D+=(O=R)-(R=f[O])+32768&32767}if(M){b[S++]=0x10000000|sD[$]<<18|sL[M];var V=31&sD[$],z=31&sL[M];k+=sR[V]+sI[z],++w[257+V],++E[z],P=c+$,++x}else b[S++]=e[c],++w[e[c]]}}l=s1(e,o,r,b,w,E,k,S,F,c-F,l)}return sW(a,0,s+sz(l)+8)}(s,null==r.level?6:r.level,null==r.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):12+r.mem,l,!0)).length,function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:2*(9==t.level),e[9]=3,0!=t.mtime&&s5(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;s<=i.length;++s)e[s+10]=i.charCodeAt(s)}}
1(c,r),s5(c,u-8,a.d()),s5(c,u-4,o),c)],{type:s4});return{contentType:s4,body:h,estimatedSize:h.size}}if(i===sP.Base64){let e;var d="data="+encodeURIComponent("string"==typeof(e=function(e){var t,i,s,r,n,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",o=0,l=0,c="",u=[];if(!e)return e;e=s6(e);do t=(n=e.charCodeAt(o++)<<16|e.charCodeAt(o++)<<8|e.charCodeAt(o++))>>18&63,i=n>>12&63,s=n>>6&63,r=63&n,u[l++]=a.charAt(t)+a.charAt(i)+a.charAt(s)+a.charAt(r);while(o<e.length)switch(c=u.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c}(s9(t)))?e:s9(e));return{contentType:"application/x-www-form-urlencoded",body:d,estimatedSize:new Blob([d]).size}}var p=s9(t);return{contentType:"application/json",body:p,estimatedSize:new Blob([p]).size}}},rt=[];u&&rt.push({transport:"fetch",method:e=>{var t,i,{contentType:s,body:r,estimatedSize:n}=null!=(t=re(e))?t:{},a=new Headers;tp(e.headers,function(e,t){a.append(t,e)}),s&&a.append("Content-Type",s);var o=e.url,l=null;if(d){var c=new d;l={signal:c.signal,timeout:setTimeout(()=>c.abort(),e.timeout)}}u(o,m({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&52428.8>(n||0),body:r,signal:null==(i=l)?void 0:i.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var s={statusCode:t.status,text:i};if(200===t.status)try{s.json=JSON.parse(i)}catch(e){to.error(e)}null==e.callback||e.callback(s)})).catch(t=>{to.error(t),null==e.callback||e.callback({statusCode:0,text:t})}).finally(()=>l?clearTimeout(l.timeout):null)}}),h&&rt.push({transport:"XHR",method:e=>{var t,i=new h;i.open(e.method||"GET",e.url,!0);var{contentType:s,body:r}=null!=(t=re(e))?t:{};tp(e.headers,function(e,t){i.setRequestHeader(t,e)}),s&&i.setRequestHeader("Content-Type",s),e.timeout&&(i.timeout=e.timeout),e.disableXHRCredentials||(i.withCredentials=!0),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(r)}}),null!=o&&o.sendBeacon&&rt.push({transport:"sendBeacon",method:e=>{var t=s7(e.url,{beacon:"1"});try{var i,{contentType:s,body:r}=null!=(i=re(e))?i:{},n="string"==typeof r?new Blob([r],{type:s}):r;o.sendBeacon(t,n)}catch(e){}}});var ri=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function rs(e,t,i){return s9({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var rr={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>ri(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!ri(t,e))),icontains:(e,t)=>t.map(rn).some(t=>e.map(rn).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(rn).every(t=>e.map(rn).every(e=>!t.includes(e))),gt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i>parseFloat(e))}),lt:(e,t)=>t.some(t=>{var i=parseFloat(t);return!isNaN(i)&&e.some(e=>i<parseFloat(e))})},rn=e=>e.toLowerCase();function ra(e,t){return!e||Object.entries(e).every(e=>{var[i,s]=e,r=null==t?void 0:t[i];if(M(r)||L(r))return!1;var n=[String(r)],a=rr[s.operator];return!!a&&a(s.values,n)})}var ro=tl("[Error tracking]");class rl{constructor(e){var t,i;this.Zt=[],this.ti=new eK([new e6,new tn,new e4,new e8,new ts,new ti,new e9,new tr],function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return function(t,s){void 0===s&&(s=0);for(var r=[],n=t.split("\n"),a=s;a<n.length;a++){var o=n[a];if(!(o.length>1024)){var l=e5.test(o)?o.replace(e5,"$1"):o;if(!l.match(/\S*Error: /)){for(var c of i){var u=c(l,e);if(u){r.push(u);break}}if(r.length>=50)break}}}if(!r.length)return[];var h=Array.from(r);return h.reverse(),h.slice(0,50).map(e=>m({},e,{filename:e.filename||(h[h.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",e0,e3)),this._instance=e,this.Zt=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(tO))?t:[]}onRemoteConfig(e){var t,i,s,r=null!=(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)?t:[],n=null==(s=e.errorTracking)?void 0:s.captureExtensionExceptions;this.Zt=r,this._instance.persistence&&this._instance.persistence.register({[tO]:this.Zt,[tR]:n})}get ii(){var e,t=!!this._instance.get_property(tR),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this.ti.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}sendExceptionEvent(e){var t=e.$exception_list;if(this.ei(t)){if(this.ri(t))return void ro.info("Skipping exception capture because a suppression rule matched");if(!this.ii&&this.si(t))return void ro.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ni(t))return void ro.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent"})}ri(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>
1{var{type:i,value:s}=t;return A(i)&&i.length>0&&e.$exception_types.push(i),A(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.Zt.some(e=>{var i=e.values.map(e=>{var i,s=rr[e.operator],r=R(e.value)?e.value:[e.value],n=null!=(i=t[e.key])?i:[];return r.length>0&&s(r,n)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}si(e){return e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}ni(e){if(e.length>0){var t,i,s,r,n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[],a=n[n.length-1];return null!=(s=null==a||null==(r=a.filename)?void 0:r.includes("posthog.com/static"))&&s}return!1}ei(e){return!N(e)&&R(e)}}var rc=tl("[FeatureFlags]"),ru=tl("[FeatureFlags]",{debugEnabled:!0}),rh="$active_feature_flags",rd="$override_feature_flags",rp="$feature_flag_payloads",rg="$override_feature_flag_payloads",rf="$feature_flag_request_id",rv="$feature_flag_evaluated_at",r_=e=>{var t={};for(var[i,s]of tv(e||{}))s&&(t[i]=s);return t},rm=((nb={}).FeatureFlags="feature_flags",nb.Recordings="recordings",nb);class ry{constructor(e){this.oi=!1,this.ai=!1,this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this.ci=!1,this._instance=e,this.featureFlagEventHandlers=[]}fi(){var e,t=null!=(e=this._instance.config.evaluation_contexts)?e:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.ci||(rc.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ci=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||rc.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}pi(){return this.fi().length>0}flags(){if(this._instance.config.__preview_remote_config)this.di=!0;else{var e=!this.gi&&(this._instance.config.advanced_disable_feature_flags||this._instance.config.advanced_disable_feature_flags_on_first_load);this.mi({disableFlags:e})}}get hasLoadedFlags(){return this.ai}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(tq),t=this._instance.get_property(rd),i=this._instance.get_property(rg);if(!i&&!t)return e||{};var s=tg({},e||{});for(var r of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,a,o=s[r],l=null==t?void 0:t[r],c=M(l)?null!=(n=null==o?void 0:o.enabled)&&n:!!l,u=M(l)?o.variant:"string"==typeof l?l:void 0,h=null==i?void 0:i[r],d=m({},o,{enabled:c,variant:c?null!=u?u:null==o?void 0:o.variant:void 0});c!==(null==o?void 0:o.enabled)&&(d.original_enabled=null==o?void 0:o.enabled),u!==(null==o?void 0:o.variant)&&(d.original_variant=null==o?void 0:o.variant),h&&(d.metadata=m({},null==o?void 0:o.metadata,{payload:h,original_payload:null==o||null==(a=o.metadata)?void 0:a.payload})),s[r]=d}return this.oi||(rc.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.oi=!0),s}getFlagVariants(){var e=this._instance.get_property(tN),t=this._instance.get_property(rd);if(!t)return e||{};for(var i=tg({},e),s=Object.keys(t),r=0;r<s.length;r++)i[s[r]]=t[s[r]];return this.oi||(rc.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.oi=!0),i}getFlagPayloads(){var e=this._instance.get_property(rp),t=this._instance.get_property(rg);if(!t)return e||{};for(var i=tg({},e||{}),s=Object.keys(t),r=0;r<s.length;r++)i[s[r]]=t[s[r]];return this.oi||(rc.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.oi=!0),i}reloadFeatureFlags(){this.ui||this._instance.config.advanced_disable_feature_flags||this.gi||(this._instance.bi.emit("featureFlagsReloading",!0),this.gi=setTimeout(()=>{this.mi()},5))}yi(){clearTimeout(this.gi),this.gi=void 0}ensureFlagsLoaded(){this.ai||this.li||this.gi||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.ui=e}mi(e){var t;if(this.yi(),!this._instance.M())if(this.li)this.hi=!0;else{var i=this._instance.config.token,s=this._instance.get_property("$device_id"),r={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:m({},(null==(t=this._instance.persistence)?void 0:t.get_initial_props())||{},this._instance.get_property(tH)||{}),group_properties:this._instance.get_property(tU)};L(s)||M(s)||(r.$device_id=s),(null!=e&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.pi()&&(r.evaluation_contexts=this.fi());var n=this._instance.config.__preview_remote_config,a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",o=this._instance.requestRouter.endpointFor("flags",(n?"/flags/?v=2":"/flags/?v=2&config=true")+a);n&&(r.timezone=sy()),this.li=!0,this._instance._send_request({method:"POST",url:o,data:r,compression:this._instance.config.disable_compression?void 0:sP.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:e=>{var t,i,s,n=!0;200===e.statusCode&&(this.hi||(this.$anon_distinct_id=void 0),n=!1),this.li=!1,this.di||(this.di=!0,this._instance.wi(null!=(s=e.json)?s:{})),(!r.disable_flags||this.hi)&&((this.vi=!n,e.json&&null!=(i=e.json.quotaLimited)&&i.includes(rm.FeatureFlags))?rc.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(null!=(t=e.json)?t:{}
1,n),this.hi&&(this.hi=!1,this.mi())))}})}}getFeatureFlag(e,t){var i;if(void 0===t&&(t={}),this.ai||this.getFlags()&&this.getFlags().length>0){var s=this.getFeatureFlagResult(e,t);return null!=(i=null==s?void 0:s.variant)?i:null==s?void 0:s.enabled}rc.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),this.ai||this.getFlags()&&this.getFlags().length>0){var i=this.getFlagVariants(),s=e in i,r=i[e],n=this.getFlagPayloads()[e],a=String(r),o=this._instance.get_property(rf)||void 0,l=this._instance.get_property(rv)||void 0,c=this._instance.get_property(tB)||{};if((t.send_event||!("send_event"in t))&&(!(e in c)||!c[e].includes(a))){R(c[e])?c[e].push(a):c[e]=[a],null==(d=this._instance.persistence)||d.register({[tB]:c});var u=this.getFeatureFlagDetails(e),h={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:n||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(p=this._instance.config.bootstrap)||null==(p=p.featureFlags)?void 0:p[e])||null,$feature_flag_bootstrapped_payload:(null==(g=this._instance.config.bootstrap)||null==(g=g.featureFlagPayloads)?void 0:g[e])||null,$used_bootstrap_value:!this.vi};M(null==u||null==(f=u.metadata)?void 0:f.version)||(h.$feature_flag_version=u.metadata.version);var d,p,g,f,v,_,m,y,b,w,E=null!=(v=null==u||null==(_=u.reason)?void 0:_.description)?v:null==u||null==(m=u.reason)?void 0:m.code;E&&(h.$feature_flag_reason=E),null!=u&&null!=(y=u.metadata)&&y.id&&(h.$feature_flag_id=u.metadata.id),M(null==u?void 0:u.original_variant)&&M(null==u?void 0:u.original_enabled)||(h.$feature_flag_original_response=M(u.original_variant)?u.original_enabled:u.original_variant),null!=u&&null!=(b=u.metadata)&&b.original_payload&&(h.$feature_flag_original_payload=null==u||null==(w=u.metadata)?void 0:w.original_payload),this._instance.capture("$feature_flag_called",h)}if(s){var x=n;if(!M(n))try{x=JSON.parse(n)}catch(e){}return{key:e,enabled:!!r,variant:"string"==typeof r?r:void 0,payload:x}}}else rc.warn('getFeatureFlagResult for key "'+e+"\" failed. Feature flags didn't load in time.")}getRemoteConfigPayload(e,t){var i=this._instance.config.token,s={distinct_id:this._instance.get_distinct_id(),token:i};this.pi()&&(s.evaluation_contexts=this.fi()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2&config=true"),data:s,compression:this._instance.config.disable_compression?void 0:sP.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var s,r=null==(s=i.json)?void 0:s.featureFlagPayloads;t((null==r?void 0:r[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),this.ai||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return M(i)?void 0:!!i}rc.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t){if(this._instance.persistence){this.ai=!0;var i=this.getFlagVariants(),s=this.getFlagPayloads(),r=this.getFlagsWithDetails();!function(e,t,i,s,r){void 0===i&&(i={}),void 0===s&&(s={}),void 0===r&&(r={});var n,a=((n=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(n).map(e=>{var t;return[e,null!=(t=n[e].variant)?t:n[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(n).filter(e=>n[e].enabled).filter(e=>{var t;return null==(t=n[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=n[e].metadata)?void 0:t.payload]}))):rc.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),o=a.flags,l=a.featureFlags,c=a.featureFlagPayloads;if(l){var u=e.requestId,h=e.evaluatedAt;if(R(l)){rc.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(l)for(var p=0;p<l.length;p++)d[l[p]]=!0;t&&t.register({[rh]:l,[tN]:d})}else{var g=l,f=c,v=o;if(e.errorsWhileComputingFlags)if(o){var _=new Set(Object.keys(o).filter(e=>{var t;return!(null!=(t=o[e])&&t.failed)}));g=m({},i,Object.fromEntries(Object.entries(g).filter(e=>{var[t]=e;return _.has(t)}))),f=m({},s,Object.fromEntries(Object.entries(f||{}).filter(e=>{var[t]=e;return _.has(t)}))),v=m({},r,Object.fromEntries(Object.entries(v||{}).filter(e=>{var[t]=e;return _.has(t)})))}else g=m({},i,g),f=m({},s,f),v=m({},r,v);t&&t.register(m({[rh]:Object.keys(r_(g)),[tN]:g||{},[rp]:f||{},[tq]:v||{}},u?{[rf]:u}:{},h?{[rv]:h}:{}))}}}(e,this._instance.persistence,i,s,r),this.xi(t)}}override(e,t){void 0===t&&(t=!1),rc.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return rc.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this._instance.persistence.unregister(rd),this._instance.persistence.unregister(rg),this.xi(),ru.info("All overrides cleared");if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var t;if(this.oi=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this._instance.persistence.unregister(rd),ru.info("Flag overrides cleared");else if(e.flags){if(R(e.flags)){for(var i={},s=0;s<e.flags.length;s++)i[e.flags[s]]=!0;this._instance.persistence.register({[rd]:i})}else this._instance.persistence.register({[rd]:e.flags});ru.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this._instance.persistence.unregister(rg),ru.info("Payload overrides cleared")):e.payloads&&(this._instance.persistence.register({[rg]:e.payloads}),ru.info("Payload overrides set",{payloads:e.payloads}))),void this.xi()}this.xi()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.ai){var{flags:t,flagVariants:i}=this.Ei();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r=(this._instance.get_property(tj)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:n};r&&(a.$early_access_feature_name=r.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=m({},this.getFlagVariants(),{[e]:t});null==(s=this._instance.persistence)||s.register({[rh]:Object.keys(r_(o)),[tN]:o}),this.xi()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this._instance.get_property(tj),r=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(s&&!t)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+r),method:"GET",callback:t=>{var i,s;if(t.json){var r=t.json.earlyAccessFeatures;return null==(i=this._instance.persistence)||i.unregister(tj),null==(s=this._instance.persistence)||s.register({[tj]:r}),e(r)}}})}Ei(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(e=>t[e]),flagVariants:Object.keys(t).filter(e=>t[e]).reduce((e,i)=>(e[i]=t[i],e),{})}}xi(e){var{flags:t,flagVariants:i}=this.Ei();
1this.featureFlagEventHandlers.forEach(s=>s(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(tH)||{};this._instance.register({[tH]:m({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(tH)}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this._instance.get_property(tU)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=m({},i[t],e[t]),delete e[t]}),this._instance.register({[tU]:m({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this._instance.get_property(tU)||{};this._instance.register({[tU]:m({},t,{[e]:{}})})}else this._instance.unregister(tU)}reset(){this.ai=!1,this.li=!1,this.ui=!1,this.hi=!1,this.di=!1,this.vi=!1,this.$anon_distinct_id=void 0,this.yi(),this.oi=!1}}var rb=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class rw{constructor(e,t){this.R=e,this.props={},this.$i=!1,this.Si=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.Y=this.ki(e),this.load(),e.debug&&to.info("Persistence loaded",e.persistence,m({},this.props)),this.update_config(e,e,t),this.save()}isDisabled(){return!!this.Pi}ki(e){-1===rb.indexOf(e.persistence.toLowerCase())&&(to.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,s,r=(void 0===(t=e.cookie_persisted_properties||[])&&(t=[]),s=[...iV,...t],m({},iB,{W:function(e){try{var t={};try{t=iU.W(e)||{}}catch(e){}var i=tg(t,JSON.parse(iB.q(e)||"{}"));return iB.G(e,i),i}catch(e){}return null},G:function(e,t,i,r,n,a){try{iB.G(e,t,void 0,void 0,a);var o={};s.forEach(e=>{t[e]&&(o[e]=t[e])}),Object.keys(o).length&&iU.G(e,o,i,r,n,a)}catch(e){iB.B(e)}},V:function(e,t){try{null==i||i.localStorage.removeItem(e),iU.V(e,t)}catch(e){iB.B(e)}}})),n=e.persistence.toLowerCase();return"localstorage"===n&&iB.H()?iB:"localstorage+cookie"===n&&r.H()?r:"sessionstorage"===n&&iY.H()?iY:"memory"===n?iW:"cookie"===n?iU:r.H()?r:iU}properties(){var e={};return tp(this.props,function(t,i){if(i===tN&&T(t))for(var s,r=Object.keys(t),n=0;n<r.length;n++)e["$feature/"+r[n]]=t[r[n]];else s=!1,(L(t0)?s:a&&t0.indexOf===a?-1!=t0.indexOf(i):(tp(t0,function(e){if(s||(s=e===i))return th}),s))||(e[i]=t)}),e}load(){if(!this.Pi){var e=this.Y.W(this.Si);e&&(this.props=tg({},e))}}save(){this.Pi||this.Y.G(this.Si,this.props,this.Ti,this.Ii,this.Ci,this.R.debug)}remove(){this.Y.V(this.Si,!1),this.Y.V(this.Si,!0)}clear(){this.remove(),this.props={}}register_once(e,t,i){if(T(e)){M(t)&&(t="None"),this.Ti=M(i)?this.Ri:i;var s=!1;if(tp(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.props[i]=e,s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(T(e)){this.Ti=M(t)?this.Ri:t;var i=!1;if(tp(e,(t,s)=>{e.hasOwnProperty(s)&&this.props[s]!==t&&(this.props[s]=t,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.$i){var e=sd(this.R.custom_campaign_params,this.R.mask_personal_data_properties,this.R.custom_personal_data_properties);$(ty(e))||this.register(e),this.$i=!0}}update_search_keyword(){var e;this.register((e=null==l?void 0:l.referrer)?sg(e):{})}update_referrer_info(){var e;this.register_once({$referrer:sv(),$referring_domain:null!=l&&l.referrer&&(null==(e=ix(l.referrer))?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[tK]||this.props[tY]||this.register_once({[tQ]:s_(this.R.mask_personal_data_properties,this.R.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};tp([tY,tK],t=>{var i=this.props[t];i&&tp(i,function(t,i){e["$initial_"+S(i)]=t})});var t,i,s=this.props[tQ];return s&&tg(e,(t=sm(s),i={},tp(t,function(e,t){i["$initial_"+S(t)]=e}),i)),e}safe_merge(e){return tp(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){if(this.Ri=this.Ti=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||!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),s=[...t].sort();return i.every((e,t)=>e===s[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[])){var s=this.ki(e),r=this.props;this.clear(),this.Y=s,this.props=r,this.save()}}set_disabled(e){this.Pi=e,this.Pi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Ii&&(this.Ii=e,this.remove(),this.save())}set_secure(e){e!==this.Ci&&(this.Ci=e,this.remove(),this.save())}set_event_timer(e,t){var i=this.props[tS]||{};i[e]=t,this.props[tS]=i,this.save()}remove_event_timer(e){var t=(this.props[tS]||{})[e];return M(t)||(delete this.props[tS][e],this.save()),t}get_property(e){return this.props[e]}set_property(e,t){this.props[e]=t,this.save()}}var rE=tl("[Product Tours]"),rx="ph_product_tours";class rk{constructor(e){this.Fi=null,this.Oi=null,this._instance=e}onRemoteConfig(e){this._instance.persistence&&this._instance.persistence.register({[t$]:!(null==e||!e.productTours)}),this.loadIfEnabled()}loadIfEnabled(){var e,t;this.Fi||(e=this._instance).config.disable_product_tours||null==(t=e.persistence)||!t.get_property(t$)||this.it(()=>this.Mi())}it(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?rE.error("Could not load product tours script",t):e()})}
1Mi(){var e;!this.Fi&&null!=(e=g.__PosthogExtensions__)&&e.generateProductTours&&(this.Fi=g.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!R(this.Oi)||t){var i=this._instance.persistence;if(i){var s=i.props[rx];if(R(s)&&!t)return this.Oi=s,void e(s,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:t=>{var s=t.statusCode;if(200!==s||!t.json){var r="Product Tours API could not be loaded, status: "+s;return rE.error(r),void e([],{isLoaded:!1,error:r})}var n=R(t.json.product_tours)?t.json.product_tours:[];this.Oi=n,i&&i.register({[rx]:n}),e(n,{isLoaded:!0})}})}else e(this.Oi,{isLoaded:!0})}getActiveProductTours(e){N(this.Fi)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Fi.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.Fi)||t.showTourById(e)}previewTour(e){this.Fi?this.Fi.previewTour(e):this.it(()=>{var t;this.Mi(),null==(t=this.Fi)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.Fi)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.Fi)||e.nextStep()}previousStep(){var e;null==(e=this.Fi)||e.previousStep()}clearCache(){var e;this.Oi=null,null==(e=this._instance.persistence)||e.unregister(rx)}resetTour(e){var t;null==(t=this.Fi)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.Fi)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.Fi)||t.cancelPendingTour(e)}}var rS=((nw={}).Activation="events",nw.Cancellation="cancelEvents",nw),rP=((nE={}).Button="button",nE.Tab="tab",nE.Selector="selector",(nx={}).TopLeft="top_left",nx.TopRight="top_right",nx.TopCenter="top_center",nx.MiddleLeft="middle_left",nx.MiddleRight="middle_right",nx.MiddleCenter="middle_center",nx.Left="left",nx.Center="center",nx.Right="right",nx.NextToTrigger="next_to_trigger",(nk={}).Top="top",nk.Left="left",nk.Right="right",nk.Bottom="bottom",(nS={}).Popover="popover",nS.API="api",nS.Widget="widget",nS.ExternalSurvey="external_survey",nS),rF=((nP={}).Open="open",nP.MultipleChoice="multiple_choice",nP.SingleChoice="single_choice",nP.Rating="rating",nP.Link="link",(nF={}).NextQuestion="next_question",nF.End="end",nF.ResponseBased="response_based",nF.SpecificQuestion="specific_question",(nC={}).Once="once",nC.Recurring="recurring",nC.Always="always",(nO={}).SHOWN="survey shown",nO.DISMISSED="survey dismissed",nO.SENT="survey sent",nO.ABANDONED="survey abandoned",nO),rC=((nR={}).SURVEY_ID="$survey_id",nR.SURVEY_NAME="$survey_name",nR.SURVEY_RESPONSE="$survey_response",nR.SURVEY_ITERATION="$survey_iteration",nR.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",nR.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",nR.SURVEY_SUBMISSION_ID="$survey_submission_id",nR.SURVEY_QUESTIONS="$survey_questions",nR.SURVEY_COMPLETED="$survey_completed",nR.PRODUCT_TOUR_ID="$product_tour_id",nR.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",nR),rO=((nI={}).Popover="popover",nI.Inline="inline",nI),rR=tl("[Surveys]"),rI="seenSurvey_",rT=e=>{var t;return t=""+rI+e.id,e.current_iteration&&e.current_iteration>0&&(t=""+rI+e.id+"_"+e.current_iteration),t},r$=[rP.Popover,rP.Widget,rP.API],rM={ignoreConditions:!1,ignoreDelay:!1,displayType:rO.Popover};class rA{constructor(){this.Ai={},this.Ai={}}on(e,t){return this.Ai[e]||(this.Ai[e]=[]),this.Ai[e].push(t),()=>{this.Ai[e]=this.Ai[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Ai[e]||[])i(t);for(var s of this.Ai["*"]||[])s(e,t)}}function rD(e,t,i){if(N(e))return!1;switch(i){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class rL{constructor(e){this.ji=new rA,this.Di=(e,t)=>this.Li(e,t)&&this.Ni(e,t)&&this.Ui(e,t)&&this.zi(e,t),this.Li=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.Hi=new Set,this.Bi=new Set}init(){var e,t;M(null==(e=this._instance)?void 0:e._addCaptureHook)||null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!M(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e
vendor: 4,517 bytes, line 1
1=>{var t,i;null==(t=this.Bi)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.Hi)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var s,r=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&r.add(null==e?void 0:e.selector)})}),null==(s=this._instance)||s.autocapture.setElementSelectors(r)}}on(e,t){var i;null!=t&&0!=e.length&&(this.Hi.has(e)||this.Hi.has(null==t?void 0:t.event))&&this.Bi&&(null==(i=this.Bi)?void 0:i.size)>0&&this.Bi.forEach(e=>{this.qi(t,e)&&this.ji.emit("actionCaptured",e.name)})}Wi(e){this.onAction("actionCaptured",t=>e(t))}qi(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.Di(e,i))return!0;return!1}onAction(e,t){return this.ji.on(e,t)}Ni(e,t){if(null!=t&&t.url){var i,s=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!s||"string"!=typeof s||!rD(s,t.url,t.url_matching||"contains"))return!1}return!0}Ui(e,t){return!!this.Gi(e,t)&&!!this.Vi(e,t)&&!!this.Ji(e,t)}Gi(e,t){if(null==t||!t.href)return!0;var i=this.Ki(e);if(i.length>0)return i.some(e=>rD(e.href,t.href,t.href_matching||"exact"));var s,r,n=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!n&&rD((r=n.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}Vi(e,t){if(null==t||!t.text)return!0;var i=this.Ki(e);if(i.length>0)return i.some(e=>rD(e.text,t.text,t.text_matching||"exact")||rD(e.$el_text,t.text,t.text_matching||"exact"));var s,r,n,a,o=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";return!!o&&(r=function(e){for(var t,i=[],s=/(?::|")text="(.*?)"/g;!N(t=s.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(o),n=t.text,a=t.text_matching||"exact",r.some(e=>rD(e,n,a)))}Ji(e,t){if(null==t||!t.selector)return!0;var i,s,r=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null!=r&&r.includes(t.selector))return!0;var n=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}Ki(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}zi(e,t){return null==t||!t.properties||0===t.properties.length||ra(t.properties.reduce((e,t)=>{var i=R(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:i,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}}class rN{constructor(e){this._instance=e,this.Yi=new Map,this.Xi=new Map,this.Qi=new Map}Zi(e,t){return!!e&&ra(e.propertyFilters,null==t?void 0:t.properties)}te(e,t){var i=new Map;return e.forEach(e=>{var s;null==(s=e.conditions)||null==(s=s[t])||null==(s=s.values)||s.forEach(t=>{if(null!=t&&t.name){var s=i.get(t.name)||[];s.push(e.id),i.set(t.name,s)}})}),i}ie(e,t,i){var s=(i===rS.Activation?this.Yi:this.Xi).get(e),r=[];return this.ee(e=>{r=e.filter(e=>null==s?void 0:s.includes(e.id))}),r.filter(s=>{var r,n=null==(r=s.conditions)||null==(r=r[i])||null==(r=r.values)?void 0:r.find(t=>t.name===e);return this.Zi(n,t)})}register(e){var t;M(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.re(e),this.se(e))}se(e){var t=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0});0!==t.length&&(null==this.ne&&(this.ne=new rL(this._instance),this.ne.init(),this.ne.Wi(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,s,r,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)?void 0:s.length)>0&&(null==(r=this.ne)||r.register(e.conditions.actions.values),null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach(t=>{if(t&&t.name){var i=this.Qi.get(t.name);i&&i.push(e.id),this.Qi.set(t.name,i||[e.id])}}))}))}re(e){var t,i=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),s=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(i=e.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0});(0!==i.length||0!==s.length)&&(null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),this.Yi=this.te(e,rS.Activation),this.Xi=this.te(e,rS.Cancellation))}onEvent(e,t){var i,s=this.oe(),r=this.ae(),n=this.le(),a=(null==(i=this._instance)||null==(i=i.persistence)?void 0:i.props[r])||[];
1if(n===e&&t&&a.length>0){s.info("event matched, removing item from activated items",{event:e,eventPayload:t,existingActivatedItems:a});var o,l,c=(null==t||null==(o=t.properties)?void 0:o.$survey_id)||(null==t||null==(l=t.properties)?void 0:l.$product_tour_id);if(c){var u=a.indexOf(c);u>=0&&(a.splice(u,1),this.ue(a))}}else{if(this.Xi.has(e)){var h=this.ie(e,t,rS.Cancellation);h.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:h.map(e=>e.id)}),h.forEach(e=>{var t=a.indexOf(e.id);t>=0&&a.splice(t,1),this.he(e.id)}),this.ue(a))}if(this.Yi.has(e)){s.info("event name matched",{event:e,eventPayload:t,items:this.Yi.get(e)});var d=this.ie(e,t,rS.Activation);this.ue(a.concat(d.map(e=>e.id)||[]))}}}onAction(e){var t,i=this.ae(),s=(null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[i])||[];this.Qi.has(e)&&this.ue(s.concat(this.Qi.get(e)||[]))}ue(e){var t,i=this.oe(),s=this.ae(),r=[...new Set(e)].filter(e=>!this.de(e));i.info("updating activated items",{activatedItems:r}),null==(t=this._instance)||null==(t=t.persistence)||t.register({[s]:r})}getActivatedIds(){var e,t=this.ae();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getEventToItemsMap(){return this.Yi}ve(){return this.ne}}class rj extends rN{constructor(e){super(e)}ae(){return"$surveys_activated"}le(){return rF.SHOWN}ee(e){var t;null==(t=this._instance)||t.getSurveys(e)}he(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}oe(){return rR}de(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class rq{constructor(e){this.ce=void 0,this._surveyManager=null,this.fe=!1,this.pe=[],this.ge=null,this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var t=e.surveys;if(N(t))return rR.warn("Flags not loaded yet. Not loading surveys.");var i=R(t);this.ce=i?t.length>0:t,rR.info("flags response received, isSurveysEnabled: "+this.ce),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],t=0;t<localStorage.length;t++){var i=localStorage.key(t);(null!=i&&i.startsWith(rI)||null!=i&&i.startsWith("inProgressSurvey_"))&&e.push(i)}e.forEach(e=>localStorage.removeItem(e))}loadIfEnabled(){if(!this._surveyManager)if(this.fe)rR.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)rR.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())rR.info("Not loading surveys in cookieless mode without consent.");else{var e=null==g?void 0:g.__PosthogExtensions__;if(e){if(!M(this.ce)||this._instance.config.advanced_enable_surveys){var t=this.ce||this._instance.config.advanced_enable_surveys;this.fe=!0;try{var i=e.generateSurveys;if(i)return void this._e(i,t);var s=e.loadExternalDependency;if(!s)return void this.me("PostHog loadExternalDependency extension not found.");s(this._instance,"surveys",i=>{i||!e.generateSurveys?this.me("Could not load surveys script",i):this._e(e.generateSurveys,t)})}catch(e){throw this.me("Error initializing surveys",e),e}finally{this.fe=!1}}}else rR.error("PostHog Extensions not found.")}}_e(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new rj(this._instance),rR.info("Surveys loaded successfully"),this.be({isLoaded:!0})}me(e,t){rR.error(e,t),this.be({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.pe.push(e),this._surveyManager&&this.be({isLoaded:!0}),()=>{this.pe=this.pe.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this._instance.config.disable_surveys)return rR.info("Disabled. Not loading surveys."),e([]);var i,s=this._instance.get_property(tG);if(s&&!t)return e(s,{isLoaded:!0});"u">typeof Promise&&this.ge?this.ge.then(t=>{var{surveys:i,context:s}=t;return e(i,s)}):("u">typeof Promise&&(this.ge=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:t=>{this.ge=null;var s=t.statusCode;if(200!==s||!t.json){var r="Surveys API could not be loaded, status: "+s;rR.error(r);var n={isLoaded:!1,error:r};return e([],n),void(null==i||i({surveys:[],context:n}))}
1var a,o,l=t.json.surveys||[],c=l.filter(e=>{var t,i;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)||!i.length))});c.length>0&&(null==(o=this._surveyEventReceiver)||o.register(c)),null==(a=this._instance.persistence)||a.register({[tG]:l});var u={isLoaded:!0};e(l,u),null==i||i({surveys:l,context:u})}}))}be(e){for(var t of this.pe)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){rR.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!N(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);rR.warn("init was not called")}ye(e){var t=null;return this.getSurveys(i=>{var s;t=null!=(s=i.find(t=>t.id===e))?s:null}),t}we(e){if(N(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var t="string"==typeof e?this.ye(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(N(this._surveyManager))return rR.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var t=this.we(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return N(this._surveyManager)?(rR.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(i=>{this.getSurveys(t=>{var s,r=null!=(s=t.find(t=>t.id===e))?s:null;if(r){var n=this.we(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(N(this._surveyManager))rR.warn("init was not called");else{var r="string"==typeof e?this.ye(e):e;if(null!=r&&r.id)if(r$.includes(r.type)){var n=null==l?void 0:l.querySelector(t);if(n)return null!=(s=r.appearance)&&s.surveyPopupDelaySeconds?(rR.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;rR.info("Rendering survey "+r.id+" with delay of "+(null==(e=r.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(r,n,i),rR.info("Survey "+r.id+" rendered")},1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,n,i);rR.warn("Survey element not found")}else rR.warn("Surveys of type "+r.type+" cannot be rendered in the app");else rR.warn("Survey not found")}}displaySurvey(e,t){var i;if(N(this._surveyManager))rR.warn("init was not called");else{var s=this.ye(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=m({},s,{appearance:m({},s.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==rO.Popover&&t.initialResponses&&rR.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.canRenderSurvey(s);if(!n.visible)return void rR.warn("Survey is not eligible to be displayed: ",n.disabledReason)}t.displayType!==rO.Inline?this._surveyManager.handlePopoverSurvey(r,t):this.renderSurvey(r,t.selector,t.properties)}else rR.warn("Survey not found")}}cancelPendingSurvey(e){N(this._surveyManager)?rR.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}var rH=tl("[Conversations]");class rU{constructor(e){this.xe=void 0,this._conversationsManager=null,this.Ee=!1,this.$e=null,this._instance=e}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;N(t)||(H(t)?this.xe=t:(this.xe=t.enabled,this.$e=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.xe=void 0,this.$e=null}loadIfEnabled(){if(!this._conversationsManager&&!this.Ee&&!(this._instance.config.disable_conversations||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==g?void 0:g.__PosthogExtensions__;if(e&&!M(this.xe)&&this.xe)if(this.$e&&this.$e.token){this.Ee=!0;try{var t=e.initConversations;if(t)return this.Se(t),void(this.Ee=!1);var i=e.loadExternalDependency;if(!i)return void this.ke("PostHog loadExternalDependency extension not found.");i(this._instance,"conversations",t=>{t||!e.initConversations?this.ke("Could not load conversations script",t):this.Se(e.initConversations),this.Ee=!1})}catch(e){this.ke("Error initializing conversations",e),this.Ee=!1}}else rH.error("Conversations enabled but missing token in remote config.")}}Se(e){if(this.$e)try{this._conversationsManager=e(this.$e,this._instance),rH.info("Conversations loaded successfully")}catch(e){this.ke("Error completing conversations initialization",e)}else rH.error("Cannot complete initialization: remote config is null")}ke(e,t){rH.error(e,t),this._conversationsManager=null,this.Ee=!1}show(){this._conversationsManager?this._conversationsManager.show():rH.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.xe&&!L(this._conversationsManager)}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,i){var s=this;return _(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(rH.warn("Conversations not available yet."),null)})()}getMessages(e,t){var i=this;return _(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(rH.warn("Conversations not available yet."),null)})()}markAsRead(e){var t=this;return _(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(rH.warn("Conversations not available yet."),null)})()}getTickets(e){var t=this;return _(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(rH.warn("Conversations not available yet."),null)})()}getCurrentTicketId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())?e:null}getWidgetSessionId(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())?e:null}}class rG{constructor(e){var t;this.Pe=!1,this.Te=!1,this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.Pe=!0)}onRemoteConfig(e){var t,i=null==(t=e.logs)?void 0:t.captureConsoleLogs;!N(i)&&i&&(this.Pe=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Pe&&!this.Te){var e=tl("[logs]"),t=null==g?void 0:g.__PosthogExtensions__;if(t){var i=t.loadExternalDependency;i?i(this._instance,"logs",i=>{var s;i||null==(s=t.logs)||!s.initializeLogs?e.error("Could not load logs script",i):(t.logs.initializeLogs(this._instance),this.Te=!0)}):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}}var rB=tl("[RateLimiter]");class rV{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;
1if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{rB.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void rB.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,s,{captureEventsBurstLimit:r,captureEventsPerSecond:n}=this,a=(new Date).getTime(),o=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(tW))?t:{tokens:r,last:a};o.tokens+=(a-o.last)/1e3*n,o.last=a,o.tokens>r&&(o.tokens=r);var l=o.tokens<1;return l||e||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+n+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(tW,o),{isRateLimited:l,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var rz=tl("[RemoteConfig]");class rW{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=g._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Ie(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):(rz.error("PostHog Extensions not found. Cannot load remote config."),e())}Ce(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 rz.info("Using preloaded remote config",this.remoteConfig),void this.wi(this.remoteConfig);if(this._instance.M())return void rz.warn("Remote config is disabled. Falling back to local config.");this.Ie(e=>{e?this.wi(e):(rz.info("No config found after loading remote JS config. Falling back to JSON."),this.Ce(e=>{this.wi(e)}))})}catch(e){rz.error("Error loading remote config",e)}}wi(e){e?this._instance.config.__preview_remote_config?(this._instance.wi(e),!1!==e.hasFeatureFlags&&this._instance.featureFlags.ensureFlagsLoaded()):rz.info("__preview_remote_config is disabled. Logging config instead",e):rz.error("Failed to fetch remote config from PostHog.")}}class rK{constructor(e,t){this.Re=!0,this.Fe=[],this.Oe=K((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,to.createLogger("flush interval"),3e3),this.Me=e}enqueue(e){this.Fe.push(e),this.Ae||this.je()}unload(){this.De();var e=Object.values(this.Fe.length>0?this.Le():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Me(m({},e,{transport:"sendBeacon"}))})}enable(){this.Re=!1,this.je()}je(){var e=this;this.Re||(this.Ae=setTimeout(()=>{if(this.De(),this.Fe.length>0){var t=this.Le();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&R(s.data)&&tp(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.Me(s)}()}},this.Oe))}De(){clearTimeout(this.Ae),this.Ae=void 0}Le(){var e={};return tp(this.Fe,t=>{var i,s=(t?t.batchKey:null)||t.url;M(e[s])&&(e[s]=m({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.Fe=[],e}}var rY=["retriesPerformedSoFar"];class rQ{constructor(e){this.Ne=!1,this.Ue=3e3,this.Fe=[],this._instance=e,this.Fe=[],this.ze=!0,!M(i)&&"onLine"in i.navigator&&(this.ze=i.navigator.onLine,this.He=()=>{this.ze=!0,this.Lt()},this.Be=()=>{this.ze=!1},tE(i,"online",this.He),tE(i,"offline",this.Be))}get length(){return this.Fe.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=y(e,rY);q(t)&&(i.url=s7(i.url,{retry_count:t})),this._instance._send_request(m({},i,{callback:e=>{200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=t?t:0)<10?this.qe(m({retriesPerformedSoFar:t},i)):null==i.callback||i.callback(e)}}))}qe(e){var t,i,s,r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var n=(s=(Math.random()-.5)*((i=Math.min(18e5,t=3e3*Math.pow(2,r)))-t/2),Math.ceil(i+s)),a=Date.now()+n;this.Fe.push({retryAt:a,requestOptions:e});var o="Enqueued failed request for retry in "+n;
1navigator.onLine||(o+=" (Browser is offline)"),to.warn(o),this.Ne||(this.Ne=!0,this.We())}We(){(this.Ge&&clearTimeout(this.Ge),0===this.Fe.length)?(this.Ne=!1,this.Ge=void 0):this.Ge=setTimeout(()=>{this.ze&&this.Fe.length>0&&this.Lt(),this.We()},this.Ue)}Lt(){var e=Date.now(),t=[],i=this.Fe.filter(i=>i.retryAt<e||(t.push(i),!1));if(this.Fe=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.Ge&&(clearTimeout(this.Ge),this.Ge=void 0),this.Ne=!1,M(i)||(this.He&&(i.removeEventListener("online",this.He),this.He=void 0),this.Be&&(i.removeEventListener("offline",this.Be),this.Be=void 0)),this.Fe))try{this._instance._send_request(m({},e,{transport:"sendBeacon"}))}catch(e){to.error(e)}this.Fe=[]}}class rJ{constructor(e){this.Ve=()=>{this.Je||(this.Je={});var e,t,i,s,r=this.scrollElement(),n=this.scrollY(),a=r?Math.max(0,r.scrollHeight-r.clientHeight):0,o=n+((null==r?void 0:r.clientHeight)||0),l=(null==r?void 0:r.scrollHeight)||0;this.Je.lastScrollY=Math.ceil(n),this.Je.maxScrollY=Math.max(n,null!=(e=this.Je.maxScrollY)?e:0),this.Je.maxScrollHeight=Math.max(a,null!=(t=this.Je.maxScrollHeight)?t:0),this.Je.lastContentY=o,this.Je.maxContentY=Math.max(o,null!=(i=this.Je.maxContentY)?i:0),this.Je.maxContentHeight=Math.max(l,null!=(s=this.Je.maxContentHeight)?s:0)},this._instance=e}getContext(){return this.Je}resetContext(){var e=this.Je;return setTimeout(this.Ve,0),e}startMeasuringScrollPosition(){tE(i,"scroll",this.Ve,{capture:!0}),tE(i,"scrollend",this.Ve,{capture:!0}),tE(i,"resize",this.Ve)}scrollElement(){if(!this._instance.config.scroll_root_selector)return null==i?void 0:i.document.documentElement;for(var e of R(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector]){var t=null==i?void 0:i.document.querySelector(e);if(t)return t}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return i&&(i.scrollY||i.pageYOffset||i.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return i&&(i.scrollX||i.pageXOffset||i.document.documentElement.scrollLeft)||0}}var rX=e=>s_(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);class rZ{constructor(e,t,i,s){this.Ke=e=>{var t=this.Ye();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Xe(this._instance)};this.Qe.register({[tz]:i})}},this._instance=e,this.Ze=t,this.Qe=i,this.Xe=s||rX,this.Ze.onSessionId(this.Ke)}Ye(){return this.Qe.props[tz]}getSetOnceProps(){var e,t=null==(e=this.Ye())?void 0:e.props;return t?"r"in t?sm(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 tp(ty(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+S(i)]=t}),e}}var r0=tl("[SessionId]");class r1{on(e,t){return this.tr.on(e,t)}constructor(e,t,i){if(this.ir=[],this.er=void 0,this.tr=new rA,this.rr=(e,t)=>!(!q(e)||!q(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if("always"===e.config.cookieless_mode)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.R=e.config,this.Qe=e.persistence,this.sr=void 0,this.nr=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ar=t||iN,this.lr=i||iN;var s,r=this.R.persistence_name||this.R.token,n=this.R.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*K(n,60,36e3,r0.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ur(),this.hr="ph_"+r+"_window_id",this.dr="ph_"+r+"_primary_window_exists",this.vr()){var a=iY.W(this.hr),o=iY.W(this.dr);a&&!o?this.sr=a:iY.V(this.hr),iY.G(this.dr,!0)}if(null!=(s=this.R.bootstrap)&&s.sessionID)try{var l=(e=>{var t=e.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})(this.R.bootstrap.sessionID);this.cr(this.R.bootstrap.sessionID,(new Date).getTime(),l)}catch(e){r0.error("Invalid sessionID in bootstrap",e)}this.pr()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return M(this.ir)&&(this.ir=[]),this.ir.push(e),this.nr&&e(this.nr,this.sr),()=>{this.ir=this.ir.filter(t=>t!==e)}}vr(){return"memory"!==this.R.persistence&&!this.Qe.Pi&&iY.H()}gr(e){e!==this.sr&&(this.sr=e,this.vr()&&iY.G(this.hr,e))}_r(){return this.sr?this.sr:this.vr()?iY.W(this.hr):null}cr(e,t,i){e===this.nr&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.nr=e,this.Qe.register({[tD]:[t,e,i]}))}mr(){var e=this.Qe.props[tD];return R(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.cr(null,null,null)}destroy(){clearTimeout(this.br),this.br=void 0,this.er&&i&&(i.removeEventListener("beforeunload",this.er,{capture:!1}),this.er=void 0),this.ir=[]}pr(){this.er=()=>{this.vr()&&iY.V(this.dr)},tE(i,"beforeunload",this.er,{capture:!1})}
vendor: 5,885 bytes, line 1
1checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),"always"===this.R.cookieless_mode)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[s,r,n]=this.mr(),a=this._r(),o=q(n)&&Math.abs(i-n)>864e5,l=!1,c=!r,u=!c&&!e&&this.rr(i,s);c||u||o?(r=this.ar(),a=this.lr(),r0.info("new session ID generated",{sessionId:r,windowId:a,changeReason:{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:o}}),n=i,l=!0):a||(a=this.lr(),l=!0);var h=q(s)&&e&&!o?s:i,d=q(n)?n:(new Date).getTime();return this.gr(a),this.cr(r,h,d),e||this.ur(),l&&this.ir.forEach(e=>e(r,a,l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:o}:void 0)),{sessionId:r,windowId:a,sessionStartTimestamp:d,changeReason:l?{noSessionId:c,activityTimeout:u,sessionPastMaximumLength:o}:void 0,lastActivityTimestamp:s}}ur(){clearTimeout(this.br),this.br=setTimeout(()=>{var[e]=this.mr();if(this.rr((new Date).getTime(),e)){var t=this.nr;this.resetSessionId(),this.tr.emit("forcedIdleReset",{idleSessionId:t})}},1.1*this.sessionTimeoutMs)}}var r2=["$set_once","$set"],r3=tl("[SiteApps]");class r5{constructor(e){this._instance=e,this.yr=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}wr(e,t){if(t){var i=this.globalsForEvent(t);this.yr.push(i),this.yr.length>1e3&&(this.yr=this.yr.slice(10))}}get siteAppLoaders(){var e;return null==(e=g._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}init(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.wr.bind(this));this.Er=()=>{e(),this.yr=[],this.Er=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,s,r,n,a,o,l={},c=this._instance.get_property("$groups")||[];for(var[u,h]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[u]={id:c[u],type:u,properties:h};var{$set_once:d,$set:p}=e;return{event:m({},y(e,r2),{properties:m({},e.properties,p?{$set:m({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},d?{$set_once:m({},null!=(s=null==(r=e.properties)?void 0:r.$set_once)?s:{},d)}:{}),elements_chain:null!=(n=null==(a=e.properties)?void 0:a.$elements_chain)?n:"",distinct_id:null==(o=e.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.yr.length&&(r3.info("Processing "+this.yr.length+" events for site app with id "+e.id),this.yr.forEach(e=>null==t.processEvent?void 0:t.processEvent(e)),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.Er)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,r3.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var{processEvent:n}=e.init({posthog:this._instance,callback:e=>{r(e)}});n&&(t.processEvent=n),s=!0}catch(t){r3.error("Error while initializing PostHog app with config id "+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){r3.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}$r(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}Sr(e){if(0!==Object.keys(this.apps).length){var t=this.globalsForEvent(e);for(var i of Object.values(this.apps))try{null==i.processEvent||i.processEvent(t)}catch(t){r3.error("Error while processing event "+e.event+" for site app "+i.id,t)}}}onRemoteConfig(e){var t,i,s,r=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.$r(),void this._instance.on("eventCaptured",e=>this.Sr(e))):void r3.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Er)||i.call(this),null!=(s=e.siteApps)&&s.length)if(this.isEnabled){var n=function(e){var t;g["__$$ph_site_app_"+e]=r._instance,null==(t=g.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(r._instance,o,t=>{if(t)return r3.error("Error while initializing PostHog app with config id "+e,t)})};for(var{id:a,url:o}of e.siteApps)n(a)}else r3.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}var r6=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&w(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>w(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},r8=((nT={}).US="us",nT.EU="eu",nT.CUSTOM="custom",nT),r4="i.posthog.com";class r7{constructor(e){this.kr={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"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=null==(e=this.instance.config.ui_host)?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace("."+r4,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.kr[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.kr[this.apiHost]=r8.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.kr[this.apiHost]=r8.EU:this.kr[this.apiHost]=r8.CUSTOM),this.kr[this.apiHost]}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if(this.region===r8.CUSTOM)return this.apiHost+t;var i=r4+t;switch(e){case"assets":return"https://"+this.region+"-assets."+i;case"api":return"https://"+this.region+"."+i}}}var r9={icontains:(e,t)=>!!i&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!i&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!i&&ri(t.href,e),not_regex:(e,t)=>!!i&&!ri(t.href,e),exact:(e,t)=>
1t.href===e,is_not:(e,t)=>t.href!==e};class ne{constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{ne.Pr("retrieved web experiments from the server"),t.Tr=new Map,e.forEach(e=>{if(e.feature_flag_key){t.Tr&&(ne.Pr("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.Tr)||i.set(e.feature_flag_key,e));var i,s=t._instance.getFeatureFlag(e.feature_flag_key);A(s)&&e.variants[s]&&t.Ir(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];ne.Cr(n)&&t.Ir(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}onFeatureFlags(e){if(this._is_bot())ne.Pr("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(N(this.Tr))return this.Tr=new Map,this.loadIfEnabled(),void this.previewWebExperiment();ne.Pr("applying feature flags",e),e.forEach(e=>{var t;if(this.Tr&&null!=(t=this.Tr)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.Tr)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.Ir(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=ne.getWindowLocation();if(null!=e&&e.search){var t=iS(null==e?void 0:e.search,"__experiment_id"),i=iS(null==e?void 0:e.search,"__experiment_variant");t&&i&&(ne.Pr("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.Rr(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this._instance.config.disable_web_experiments&&!i)return e([]);var s=this._instance.get_property("$web_experiments");if(s&&!t)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:t=>200===t.statusCode&&t.json?e(t.json.experiments||[]):e([])})}Rr(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(ne.Pr("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.Ir(s[0].name,t,s[0].variants[t].transforms))}static Cr(e){return!N(e.conditions)&&ne.Fr(e)&&ne.Or(e)}static Fr(e){if(N(e.conditions)||N(null==(t=e.conditions)?void 0:t.url))return!0;var t,i,s,r,n=ne.getWindowLocation();return!!n&&(null==(i=e.conditions)||!i.url||r9[null!=(s=null==(r=e.conditions)?void 0:r.urlMatchType)?s:"icontains"](e.conditions.url,n))}
vendor: 5,991 bytes, line 1
1static getWindowLocation(){return null==i?void 0:i.location}static Or(e){if(N(e.conditions)||N(null==(i=e.conditions)?void 0:i.utm))return!0;var t=sd();if(t.utm_source){var i,s,r,n,a,o,l,c,u,h=null==(s=e.conditions)||null==(s=s.utm)||!s.utm_campaign||(null==(r=e.conditions)||null==(r=r.utm)?void 0:r.utm_campaign)==t.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(a=e.conditions)||null==(a=a.utm)?void 0:a.utm_source)==t.utm_source,p=null==(o=e.conditions)||null==(o=o.utm)||!o.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,g=null==(c=e.conditions)||null==(c=c.utm)||!c.utm_term||(null==(u=e.conditions)||null==(u=u.utm)?void 0:u.utm_term)==t.utm_term;return h&&p&&g&&d}return!1}static Pr(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];to.info("[WebExperiments] "+e,i)}Ir(e,t,i){this._is_bot()?ne.Pr("Refusing to render web experiment since the viewer is a likely bot"):"control"!==t?i.forEach(i=>{if(i.selector){ne.Pr("applying transform of variant "+t+" for experiment "+e+" ",i);var s,r=null==(s=document)?void 0:s.querySelectorAll(i.selector);null==r||r.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):ne.Pr("Control variants leave the page unmodified.")}_is_bot(){return o&&this._instance?r6(o,this._instance.config.custom_blocked_useragents):void 0}}var nt=tl("[PostHog ExternalIntegrations]"),ni={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class ns{constructor(e){this._instance=e}it(e,t){var i;null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return nt.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,s,n;!r||null!=(i=g.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.it(ni[e],()=>{var i;null==(i=g.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!r&&null!=(s=g.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[e]&&(null==(n=g.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[s,r]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))i(s)}}var nr="[SessionRecording]",nn=tl(nr);class na{get started(){var e;return!(null==(e=this.Mr)||!e.isStarted)}get status(){return this.Mr?this.Mr.status:this.Ar&&!this.jr?"disabled":"lazy_loading"}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Ar=!1,this.Dr=void 0,this._instance=e,!this._instance.sessionManager)throw nn.error("started without valid sessionManager"),Error(nr+" started without valid sessionManager. This is a bug.");if("always"===this._instance.config.cookieless_mode)throw Error(nr+' cannot be used with cookieless_mode="always"')}get jr(){var e,t=!(null==(e=this._instance.get_property(tA))||!e.enabled),s=!this._instance.config.disable_session_recording,r=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return i&&t&&s&&!r}startIfEnabledOrStop(e){var t;if(!this.jr||null==(t=this.Mr)||!t.isStarted){var i=!M(Object.assign)&&!M(Array.from);this.jr&&i?(this.Lr(e),nn.info("starting")):this.stopRecording()}}Lr(e){var t,i,s;this.jr&&(null!=g&&null!=(t=g.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=g.__PosthogExtensions__)&&i.initSessionRecording?this.Nr(e):null==(s=g.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.Ur,t=>{if(t)return nn.error("could not load recorder",t);this.Nr(e)}))}stopRecording(){var e,t;null==(e=this.Dr)||e.call(this),this.Dr=void 0,null==(t=this.Mr)||t.stop()}zr(){var e;null==(e=this._instance.persistence)||e.unregister(tL)}Hr(e){if(this._instance.persistence){var t,i,s=this._instance.persistence,r=()=>{var t=!1===e.sessionRecording?void 0:e.sessionRecording,i=null==t?void 0:t.sampleRate,r=N(i)?null:parseFloat(i);N(r)&&this.zr();var n=null==t?void 0:t.minimumDurationMilliseconds;s.register({[tA]:m({enabled:!!t},t,{networkPayloadCapture:m({capturePerformance:e.capturePerformance},null==t?void 0:t.networkPayloadCapture),canvasRecording:{enabled:null==t?void 0:t.recordCanvas,fps:null==t?void 0:t.canvasFps,quality:null==t?void 0:t.canvasQuality},sampleRate:r,minimumDurationMilliseconds:M(n)?null:n,endpoint:null==t?void 0:t.endpoint,triggerMatchType:null==t?void 0:t.triggerMatchType,masking:null==t?void 0:t.masking,urlTriggers:null==t?void 0:t.urlTriggers})})};r(),null==(t=this.Dr)||t.call(this),this.Dr=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(r)}}onRemoteConfig(e){"sessionRecording"in e?!1!==e.sessionRecording?(this.Hr(e),this.Ar=!0,this.startIfEnabledOrStop()):this.Ar=!0:nn.info("skipping remote config with no sessionRecording",e)}log(e,t){var i;void 0===t&&(t="log"),null!=(i=this.Mr)&&i.log?this.Mr.log(e,t):nn.warn("log called before recorder was ready")}get Ur(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(tA);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}Nr(e){var t,i;if(null==(t=g.__PosthogExtensions__)||!t.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.Mr||(this.Mr=null==(i=g.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.Mr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Mr.start(e)}onRRwebEmit(e){var t;null==(t=this.Mr)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Mr||null==(t=this._instance.persistence)||t.register({$replay_override_linked_flag:!0}),null==(e=this.Mr)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Mr||null==(t=this._instance.persistence)||t.register({$replay_override_sampling:!0}),null==(e=this.Mr)||e.overrideSampling()}overrideTrigger(e){var t,i;this.Mr||null==(i=this._instance.persistence)||i.register({["url"===e?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}
1),null==(t=this.Mr)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.Mr)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.Mr)||!i.tryAddCustomEvent(e,t))}}var no={},nl=()=>{},nc="posthog",nu=!s8&&-1===(null==p?void 0:p.indexOf("MSIE"))&&-1===(null==p?void 0:p.indexOf("Mozilla")),nh=e=>{var t;return m({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!A(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of tb)if(i===s)return!1;return!0}(null==l?void 0:l.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:nl,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,debug:c&&A(null==c?void 0:c.search)&&-1!==c.search.indexOf("__posthog_debug=true")||!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:!0,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==i||null==(t=i.location)?void 0:t.protocol),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_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:e=>{var t="Bad HTTP status: "+e.statusCode+" "+e.text;to.error(t)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:nl,__preview_eager_load_replay:!1},{rageclick:!(e&&e>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(e&&e>="2025-05-24")||"history_change",session_recording:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0})},nd=e=>{var t={};M(e.process_person)||(t.person_profiles=e.process_person),M(e.xhr_headers)||(t.request_headers=e.xhr_headers),M(e.cookie_name)||(t.persistence_name=e.cookie_name),M(e.disable_cookie)||(t.disable_persistence=e.disable_cookie),M(e.store_google)||(t.save_campaign_params=e.store_google),M(e.verbose)||(t.debug=e.verbose);var i=tg({},t,e);return R(e.property_blacklist)&&(M(e.property_denylist)?i.property_denylist=e.property_blacklist:R(e.property_denylist)?i.property_denylist=[...e.property_blacklist,...e.property_denylist]:to.error("Invalid value for property_denylist config: "+e.property_denylist)),i};class np{constructor(){this.__forceAllowLocalhost=!1}get Br(){return this.__forceAllowLocalhost}set Br(e){to.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class ng{get decideEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}get flagsEndpointWasHit(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&e}constructor(){this.webPerformance=new np,this.qr=!1,this.version=f.LIB_VERSION,this.bi=new rA,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=nh(),this.SentryIntegration=i9,this.sentryIntegration=e=>{var t;return t=i7(this,e),{name:i4,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Wr=!1,this.Gr=null,this.Vr=null,this.Jr=null,this.featureFlags=new ry(this),this.toolbar=ne
vendor: 4,539 bytes, line 1
1w sr(this),this.scrollManager=new rJ(this),this.pageViewManager=new sS(this),this.surveys=new rq(this),this.conversations=new rU(this),this.logs=new rG(this),this.experiments=new ne(this),this.exceptions=new rl(this),this.rateLimiter=new rV(this),this.requestRouter=new r7(this),this.consent=new iJ(this),this.externalIntegrations=new ns(this),this.people={set:(e,t,i)=>{var s=A(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=A(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>to.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==nc){var s,r=null!=(s=no[i])?s:new ng;return r._init(e,t,i),no[i]=r,no[nc][i]=r,r}return this._init(e,t,i)}_init(e,t,s){if(void 0===t&&(t={}),M(e)||D(e))return to.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.Kr(t.debug),this.Yr=t,this.Xr=[],t.person_profiles&&(this.Vr=t.person_profiles),this.set_config(tg({},nh(t.defaults),nd(t),{name:s,token:e})),this.config.on_xhr_error&&to.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:sP.GZipJS;var r=this.Qr();this.persistence=new rw(this.config,r),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rw(m({},this.config,{persistence:"sessionStorage"}),r);var n=m({},this.persistence.props),a=m({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Zr=new rK(e=>this.ts(e),this.config.request_queue_config),this.es=new rQ(this),this.__request_queue=[];var o="always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut();if(o||(this.sessionManager=new r1(this),this.sessionPropsManager=new rZ(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(to.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.rs(o)},0)):(to.info("Initializing extensions synchronously"),this.rs(o)),f.DEBUG=f.DEBUG||this.config.debug,f.DEBUG&&to.info("Starting in debug mode",{this:this,config:t,thisC:m({},this.config),p:n,s:a}),void 0!==(null==(l=t.bootstrap)?void 0:l.distinctID)){var l,c,u,h=this.config.get_device_id(iN()),d=null!=(c=t.bootstrap)&&c.isIdentifiedID?h:t.bootstrap.distinctID;this.persistence.set_property(tV,null!=(u=t.bootstrap)&&u.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:t.bootstrap.distinctID,$device_id:d})}if(this.ss()){var p,g,v=Object.keys((null==(p=t.bootstrap)?void 0:p.featureFlags)||{}).filter(e=>{var i;return!(null==(i=t.bootstrap)||null==(i=i.featureFlags)||!i[e])}).reduce((e,i)=>{var s;return e[i]=(null==(s=t.bootstrap)||null==(s=s.featureFlags)?void 0:s[i])||!1,e},{}),_=Object.keys((null==(g=t.bootstrap)?void 0:g.featureFlagPayloads)||{}).filter(e=>v[e]).reduce((e,i)=>{var s,r;return null!=(s=t.bootstrap)&&null!=(s=s.featureFlagPayloads)&&s[i]&&(e[i]=null==(r=t.bootstrap)||null==(r=r.featureFlagPayloads)?void 0:r[i]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:_})}if(o)this.register_once({distinct_id:tZ,$device_id:null},"");else if(!this.get_distinct_id()){var y=this.config.get_device_id(iN());this.register_once({distinct_id:y,$device_id:y},""),this.persistence.set_property(tV,"anonymous")}return tE(i,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var s=i=>{var s=()=>i.anonymousId()||iN();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(tV,"identified")),t()},r=i.user();"then"in r&&I(r.then)?r.then(s):s(r)}(e,()=>{var s;i.register((Promise&&Promise.resolve||i8.warn("This browser does not have Promise support, and can not use the segment integration"),s=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(i8.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(i8.info("UserId set, identifying with PostHog"),e.identify(t.event.userId)
1);var s=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},s,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>s(e,e.event.event),page:e=>s(e,"$pageview"),identify:e=>s(e,"$identify"),screen:e=>s(e,"$screen")})).then(()=>{t()})})}(this,()=>this.ns()):this.ns(),I(this.config._onCapture)&&this.config._onCapture!==nl&&(to.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&to.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}rs(e){var t=performance.now();this.historyAutocapture=new i6(this),this.historyAutocapture.startIfEnabled();var i=[];i.push(()=>{new sa(this).startIfEnabledOrStop()}),i.push(()=>{var e;this.siteApps=new r5(this),null==(e=this.siteApps)||e.init()}),e||i.push(()=>{this.sessionRecording=new na(this),this.sessionRecording.startIfEnabledOrStop()}),this.config.disable_scroll_properties||i.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),i.push(()=>{this.autocapture=new iI(this),this.autocapture.startIfEnabled()}),i.push(()=>{this.surveys.loadIfEnabled()}),i.push(()=>{this.logs.loadIfEnabled()}),i.push(()=>{this.conversations.loadIfEnabled()}),i.push(()=>{this.productTours=new rk(this),this.productTours.loadIfEnabled()}),i.push(()=>{this.heatmaps=new sk(this),this.heatmaps.startIfEnabled()}),i.push(()=>{this.webVitalsAutocapture=new sw(this)}),i.push(()=>{this.exceptionObserver=new i3(this),this.exceptionObserver.startIfEnabledOrStop()}),i.push(()=>{this.deadClicksAutocapture=new i1(this,i0),this.deadClicksAutocapture.startIfEnabled()}),i.push(()=>{if(this.os){var e=this.os;this.os=void 0,this.wi(e)}}),this.ls(i,t)}ls(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.ls(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){to.error("Error initializing extension:",e)}}var s=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:s}),this.config.__preview_deferred_init_extensions&&to.info("PostHog extensions initialized ("+s+"ms)")}wi(e){var t,i,s,r,n,a,o,c,u;l&&l.body?(this.config.__preview_deferred_init_extensions&&(this.os=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=x(e.supportedCompression,sP.GZipJS)?sP.GZipJS:x(e.supportedCompression,sP.Base64)?sP.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Vr?this.Vr:"identified_only"}),null==(i=this.siteApps)||i.onRemoteConfig(e),null==(s=this.sessionRecording)||s.onRemoteConfig(e),null==(r=this.autocapture)||r.onRemoteConfig(e),null==(n=this.heatmaps)||n.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.logs.onRemoteConfig(e),this.conversations.onRemoteConfig(e),null==(a=this.productTours)||a.onRemoteConfig(e),null==(o=this.webVitalsAutocapture)||o.onRemoteConfig(e),null==(c=this.exceptionObserver)||c.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),null==(u=this.deadClicksAutocapture)||u.onRemoteConfig(e)):(to.info("document not ready yet, trying again in 500 milliseconds..."),setTimeout(()=>{this.wi(e)},500))}ns(){try{this.config.loaded(this)}catch(e){to.critical("`loaded` function failed",e)}if(this.us(),this.config.internal_or_test_user_hostname&&null!=c&&c.hostname){var e=c.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||"always"===this.config.cookieless_mode)&&this.hs()},1),new rW(this).load(),this.featureFlags.flags()}us(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Zr)||e.enable())}_dom_loaded(){this.is_capturing()&&td(this.__request_queue,e=>this.ts(e)),this.__request_queue=[],this.us()}_handle_unload(){var e,t;this.surveys.handlePageUnload(),this.config.request_batching?(this.ds()&&this.capture("$pageleave"),null==(e=this.Zr)||e.unload(),null==(t=this.es)||t.unload()):this.ds()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(nu?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=s7(e.url,{ip:+!!this.config.ip}),e.headers=m({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?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(e=>{var t,i,s,r=m({},e);r.timeout=r.timeout||6e4,r.url=s7(r.url,{_:(new Date).getTime().toString(),ver:f.LIB_VERSION,compression:r.compression});var n=null!=(t=r.transport)?t:"fetch",a=rt.filter(e=>!r.disableTransport||!e.transport||!r.disableTransport.includes(e.transport)),o=null!=(i=null==(s=tw(a,e=>e.transport===n))?void 0:s.method)?i:a[0].method;if(!o)throw Error("No available transport method");o(r)})(m({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),t.statusCode>=400&&(null==(i=(s=this.config).on_request_error)||i.call(s,t)),null==e.callback||e.callback(t)}}))))}ts(e){this.es?this.es.retriableRequest(e):this._send_request(e)}_execute_array(e){var t,i=[],s=[],r=[];td(e,e=>{e&&(R(t=e[0])?r.push(e):I(e)?e.call(this):R(e)&&"alias"===t?i.push(e):R(e)&&-1!==t.indexOf("capture")&&I(this[t])?r.push(e):s.push(e))});var n=function(e,t){td(e,function(e){if(R(e[0])){var i=t;tp(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};n(i,this),n(s,this),n(r,this)}ss(){var e,t;return(null==(e=this.config.bootstrap)?void 0:e.featureFlags)&&Object.keys(null==(t=this.config.bootstrap)?void 0:t.featureFlags).length>0||!1}push(e){this._execute_array([e])}capture(e,t,i){var s;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Zr){if(this.is_capturing())if(!M(e)&&A(e)){var r=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(r&&!this.config.__preview_capture_bot_pageviews)){var n=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==n||!n.isRateLimited){null!=t&&t.$current_url&&!A(null==t?void 0:t.$current_url)&&(to.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var a=new Date,o=(null==i?void 0:i.timestamp)||a,l=iN(),c={uuid:l,event:e,properties:this.calculateEventProperties(e,t||{},o,l)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&r&&(c.event="$bot_pageview",c.properties.$browser_type="bot"),n&&(c.properties.$lib_rate_limit_remaining_tokens=n.remainingTokens),(null==i?void 0:i.$set)&&(c.$set=null==i?void 0:i.$set);var u,h="$groupidentify"!==e,d=this.vs(null==i?void 0:i.$set_once,h);if(d&&(c.$set_once=d),(p=c,g=null!=i&&i._noTruncate?null:this.config.properties_string_max_length,f=e=>A(e)&&!L(g)?e.slice(0,g):e,v=new Set,c=function e(t,i){var s;return t!==Object(t)?f?f(t,i):t:v.has(t)?void 0:(v.add(t),R(t)?(s=[],td(t,t=>{s.push(e(t))})):(s={},tp(t,(t,i)=>{v.has(t)||(s[i]=e(t,i))})),s)}(p)).timestamp=o,M(null==i?void 0:i.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=a),e===rF.DISMISSED||e===rF.SENT){var p,g,f,v,_,y,b,w=null==t?void 0:t[rC.SURVEY_ID],E=null==t?void 0:t[rC.SURVEY_ITERATION];u={id:w,current_iteration:E},localStorage.getItem(rT(u))||localStorage.setItem(rT(u),"true"),c.$set=m({},c.$set,{[(_={id:w,current_iteration:E},b="$survey_"+(y=e===rF.SENT?"responded":"dismissed")+"/"+_.id,_.current_iteration&&_.current_iteration>0&&(b="$survey_"+y+"/"+_.id+"/"+_.current_iteration),b)]:!0})}else e===rF.SHOWN&&(c.$set=m({},c.$set,{[rC.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));var x=m({},c.properties.$set,c.$set);if($(x)||this.setPersonPropertiesForFlags(x),!N(this.config.before_send)){var k=this.cs(c);if(!k)return;c=k}this.bi.emit("eventCaptured",c);var S={method:"POST",url:null!=(s=null==i?void 0:i._url)?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.ts(S):this.Zr.enqueue(S),c}to.critical("This capture call is ignored due to client rate limiting.")}}else to.error("No event name provided to posthog.capture")}else to.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,s,r,n){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return t;var a,o=n?void 0:this.persistence.remove_event_timer(e),u=m({},t);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,("always"==this.config.cookieless_mode||"on_reject"==this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut())&&(u.$cookieless_mode=!0),"$snapshot"===e){var h=m({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=h.distinct_id,(!A(u.distinct_id)&&!j(u.distinct_id)||D(u.distinct_id))&&to.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var d,g=function(e,t){if(!p)return{};var s,r,n=e?tf([],sl,t||[]):[],[a,o]=function(e){for(var t=0;t<eV.length;t++){var[i,s]=eV[t],r=i.exec(e),n=r&&(I(s)?s(r,e):s);if(n)return n}return["",""]}(p);return tg(ty({$os:a,$os_version:o,$browser:eU(p,navigator.vendor),$device:ez(p),$device_type:(r=ez(p))===es||r===ei||"Kobo"===r||"Kindle Fire"===r||r===e$?et:r===eE||r===ek||r===ex||r===eR?"Console":r===en?"Wearable":r?Z:"Desktop",$timezone:sy(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:iP(null==c?void 0:c.href,n,su),$host:null==c?void 0:c.host,$pathname:null==c?void 0:c.pathname,$raw_user_agent:p.length>1e3?p.substring(0,997)+"...":p,$browser_version:eB(p,navigator.vendor),$browser_language:sf(),$browser_language_prefix:"string"==typeof(s=sf())?s.split("-")[0]:void 0,$screen_height:null==i?void 0:i.screen.height,$screen_width:null==i?void 0:i.screen.width,$viewport_height:null==i?void 0:i.innerHeight,$viewport_width:null==i?void 0:i.innerWidth,$lib:"web",$lib_version:f.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:v,windowId:_}=this.sessionManager.checkAndGetSessionAndWindowId(n,s.getTime());u.$session_id=v,u.$window_id=_}this.sessionPropsManager&&tg(u,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&tg(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=null==(a=this.es)?void 0:a.length}catch(e){u.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===r8.CUSTOM&&(u.$lib_custom_api_host=this.config.api_host),d="$pageview"!==e||n?"$pageleave"!==e||n?this.pageViewM
1anager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,r),u=tg(u,d),"$pageview"===e&&l&&(u.title=l.title),!M(o)){var y=s.getTime()-o;u.$duration=parseFloat((y/1e3).toFixed(3))}p&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser"),(u=tg({},g,this.persistence.properties(),this.sessionPersistence.properties(),u)).$is_identified=this._isIdentified(),R(this.config.property_denylist)?tp(this.config.property_denylist,function(e){delete u[e]}):to.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(to.error("sanitize_properties is deprecated. Use before_send instead"),u=b(u,e));var w=this.fs();return u.$process_person_profile=w,w&&!n&&this.ps("_calculate_event_properties"),u}vs(e,t){if(void 0===t&&(t=!0),!this.persistence||!this.fs()||this.qr)return e;var i,s=tg({},this.persistence.get_initial_props(),(null==(i=this.sessionPropsManager)?void 0:i.getSetOnceProps())||{},e||{}),r=this.config.sanitize_properties;return r&&(to.error("sanitize_properties is deprecated. Use before_send instead"),s=r(s,"$set_once")),t&&(this.qr=!0),$(s)?void 0:s}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var s;null==(s=this.persistence)||s.register_once(e,t,i)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}gs(e,t){this.register({[e]:t})}getFeatureFlag(e,t){return this.featureFlags.getFeatureFlag(e,t)}getFeatureFlagPayload(e){return this.featureFlags.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){return this.featureFlags.getFeatureFlagResult(e,t)}isFeatureEnabled(e,t){return this.featureFlags.isFeatureEnabled(e,t)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(e,t,i){var s=null!=i&&i.merge?this.featureFlags.getFlagVariants():{},r=null!=i&&i.merge?this.featureFlags.getFlagPayloads():{},n=m({},s,e),a=m({},r,t),o={};for(var[l,c]of Object.entries(n)){var u="string"==typeof c;o[l]={key:l,enabled:!!u||!!c,variant:u?c:void 0,reason:void 0,metadata:M(null==a?void 0:a[l])?void 0:{id:0,version:void 0,description:void 0,payload:a[l]}}}this.featureFlags.receivedFeatureFlags({flags:o})}updateEarlyAccessFeatureEnrollment(e,t,i){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){return void 0===t&&(t=!1),this.featureFlags.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.bi.on(e,t)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var t,i;return null!=(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys.getSurveys(e,t)}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys.getActiveMatchingSurveys(e,t)}renderSurvey(e,t){this.surveys.renderSurvey(e,t)}displaySurvey(e,t){void 0===t&&(t=rM),this.surveys.displaySurvey(e,t)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,t){return void 0===t&&(t=!1),this.surveys.canRenderSurveyAsync(e,t)}identify(e,t,i){if(!this.__loaded||!this.persistence)return to.uninitializedWarning("posthog.identify");if(j(e)&&(e=e.toString(),to.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()))to.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==tZ){if(this.ps("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:s}
1,""),e!==s&&e!==this.get_property(tk)&&(this.unregister(tk),this.register({distinct_id:e}));var r="anonymous"===(this.persistence.get_property(tV)||"anonymous");e!==s&&r?(this.persistence.set_property(tV,"identified"),this.setPersonPropertiesForFlags(m({},i||{},t||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.Jr=rs(e,t,i),this.featureFlags.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(tB))}}else to.critical('The string "'+tZ+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else to.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,t){if((e||t)&&this.ps("posthog.setPersonProperties")){var i=rs(this.get_distinct_id(),e,t);this.Jr!==i?(this.setPersonPropertiesForFlags(m({},t||{},e||{})),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Jr=i):to.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,t,i){if(e&&t){var s=this.getGroups();s[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:m({},s,{[e]:t})}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags({[e]:i})),s[e]===t||i||this.reloadFeatureFlags()}else to.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.featureFlags.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0),this.ps("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){if(to.info("reset"),!this.__loaded)return to.uninitializedWarning("posthog.reset");var t,i,s,r,n=this.get_property("$device_id");if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),this.surveys.reset(),this.featureFlags.reset(),null==(s=this.persistence)||s.set_property(tV,"anonymous"),null==(r=this.sessionManager)||r.resetSessionId(),this.Jr=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:tZ,$device_id:null},"");else{var a=this.config.get_device_id(iN());this.register_once({distinct_id:a,$device_id:e?a:n},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var r,n=null!=(r=e.timestampLookBack)?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(tx)?(to.critical("Attempting to create alias for existing People user - aborting."),-2):this.ps("posthog.alias")?(M(t)&&(t=this.get_distinct_id()),e!==t?(this.gs(tk,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(to.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=m({},this.config);if(T(e)){tg(this.config,nd(e));var i,s,r,n,a,o,l,c=this.Qr();null==(i=this.persistence)||i.update_config(this.config,t,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rw(m({},this.config,{persistence:"sessionStorage"}),c);var u=this.Kr(this.config.debug);H(u)&&(this.config.debug=u),H(this.config.debug)&&(this.config.debug?(f.DEBUG=!0,iB.H()&&iB.G("ph_debug","true"),to.info("set_config",{config:e,oldConfig:t,newConfig:m({},this.config)})):(f.DEBUG=!1,iB.H()&&iB.V("ph_debug"))),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(r=this.sessionRecording)||r.startIfEnabledOrStop(),null==(n=this.autocapture)||n.startIfEnabled(),null==(a=this.heatmaps)||a.startIfEnabled(),null==(o=this.exceptionObserver)||o.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this._s(),null==(l=this.externalIntegrations)||l.startIfEnabledOrStop()}}startSessionRecording(e){var t,i,s,r,n,a=!0===e,o={sampling:a||!(null==e||!e.sampling),linked_flag:a||!(null==e||!e.linked_flag),url_trigger:a||!(null==e||!e.url_trigger),event_trigger:a||!(null==e||!e.event_trigger)};Object.values(o).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(s=this.sessionRecording)||s.overrideLinkedFlag()),o.url_trigger&&(null==(r=this.sessionRecording)||r.overrideTrigger("url")),o.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){var i=Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(m({},s,t))}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var t;return null==(t=this.persistence)?void 0:t.props[e]}getSessionProperty(e){var t;return null==(t=this.sessionPersistence)?void 0:t.props[e]}toString(){var e,t=null!=(e=this.config.name)?e:nc;return t!==nc&&(t=nc+"."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property(tV))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property(tV))}fs(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&
vendor: 5,041 bytes, line 1
1!this._isIdentified()&&$(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[tk])&&(null==(t=this.persistence)||null==(t=t.props)||!t[tJ]))}ds(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.fs()||this.ps("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.ps("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}ps(e){return"never"===this.config.person_profiles?(to.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.gs(tJ,!0),!0)}Qr(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut(),t=this.config.opt_out_persistence_by_default||"on_reject"===this.config.cookieless_mode;return this.config.disable_persistence||e&&!!t}_s(){var e,t,i,s,r=this.Qr();return(null==(e=this.persistence)?void 0:e.Pi)!==r&&(null==(i=this.persistence)||i.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t.Pi)!==r&&(null==(s=this.sessionPersistence)||s.set_disabled(r)),r}opt_in_capturing(e){var t,i,s,r;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isExplicitlyOptedOut()&&(this.reset(!0),null==(i=this.sessionManager)||i.destroy(),null==(s=this.pageViewManager)||s.destroy(),this.sessionManager=new r1(this),this.pageViewManager=new sS(this),this.persistence&&(this.sessionPropsManager=new rZ(this,this.sessionManager,this.persistence)),this.sessionRecording=new na(this),this.sessionRecording.startIfEnabledOrStop()),this.consent.optInOut(!0),this._s(),this.us(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&this.surveys.loadIfEnabled(),(M(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(r=null==e?void 0:e.captureEventName)?r:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.hs()):to.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,t,i;"always"!==this.config.cookieless_mode?("on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this._s(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:tZ,$device_id:null}),null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewManager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,null==(i=this.sessionRecording)||i.stopRecording(),this.sessionRecording=void 0,this.hs())):to.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===iQ.GRANTED?"granted":e===iQ.DENIED?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this._s()}_is_bot(){return o?r6(o,this.config.custom_blocked_useragents):void 0}hs(){l&&("visible"===l.visibilityState?this.Wr||(this.Wr=!0,this.capture("$pageview",{title:l.title},{send_instantly:!0}),this.Gr&&(l.removeEventListener("visibilitychange",this.Gr),this.Gr=null)):this.Gr||(this.Gr=this.hs.bind(this),tE(l,"visibilitychange",this.Gr)))}debug(e){!1===e?(null==i||i.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==i||i.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}))}M(){var e,t,i,s,r=this.Yr||{};return"advanced_disable_flags"in r?!!r.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(to.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):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in r&&!N(r[e]),s=t in r&&!N(r[t]),i?r[e]:!!s&&(to&&to.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}cs(e){if(N(this.config.before_send))return e;var t=R(this.config.before_send)?this.config.before_send:[this.config.before_send],i=e;for(var s of t){if(N(i=s(i))){var r="Event '"+e.event+"' was rejected in beforeSend function";return U(e.event)?to.warn(r+". This can cause unexpected behavior."):to.info(r),null}i.properties&&!$(i.properties)||to.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return i}getPageViewId(){var e;
1return null==(e=this.pageViewManager.Kt)?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)})}Kr(e){var t=H(e)&&!e,i=iB.H()&&"true"===iB.q("ph_debug");return!t&&(!!i||e)}}for(var nf=["identify"],nv=0;nv<nf.length;nv++)ng.prototype[nf[nv]]=tm(ng.prototype[nf[nv]]);var n_,nm,ny,nb,nw,nE,nx,nk,nS,nP,nF,nC,nO,nR,nI,nT,n$,nM=(n$=no[nc]=new ng,function(){function e(){e.done||(e.done=!0,nu=!1,tp(no,function(e){e._dom_loaded()}))}null!=l&&l.addEventListener?"complete"===l.readyState?e():tE(l,"DOMContentLoaded",e,{capture:!1}):i&&to.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),n$),nA=e.i(271645),nD=(0,nA.createContext)({client:nM,bootstrap:void 0});function nL(e){var t,i,s=e.children,r=e.client,n=e.apiKey,a=e.options,o=(0,nA.useRef)(null),l=(0,nA.useMemo)(function(){return r?(n&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),a&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),r):(n||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),nM)},[r,n,JSON.stringify(a)]);return(0,nA.useEffect)(function(){if(!r){var e=o.current;e?(n!==e.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),a&&!function e(t,i,s){if(void 0===s&&(s=new WeakMap),t===i)return!0;if("object"!=typeof t||null===t||"object"!=typeof i||null===i)return!1;if(s.has(t)&&s.get(t)===i)return!0;s.set(t,i);var r=Object.keys(t),n=Object.keys(i);if(r.length!==n.length)return!1;for(var a=0;a<r.length;a++){var o=r[a];if(!n.includes(o)||!e(t[o],i[o],s))return!1}return!0}(a,e.options)&&nM.set_config(a)):(nM.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),nM.init(n,a)),o.current={apiKey:n,options:null!=a?a:{}}}},[r,n,JSON.stringify(a)]),nA.default.createElement(nD.Provider,{value:{client:l,bootstrap:null!=(t=null==a?void 0:a.bootstrap)?t:null==(i=null==r?void 0:r.config)?void 0:i.bootstrap}},s)}var nN=function(e){return"function"==typeof e},nj=function(e,t){return(nj=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};"function"==typeof SuppressedError&&SuppressedError;var nq={componentStack:null,exceptionEvent:null,error:null};!function(e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=i}function i(t){var i=e.call(this,t)||this;return i.state=nq,i}nj(i,e),i.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t),i.prototype.componentDidCatch=function(e,t){var i,s=this.props.additionalProperties;nN(s)?i=s(e):"object"==typeof s&&(i=s);var r=this.context.client.captureException(e,i),n=t.componentStack;this.setState({error:e,componentStack:null!=n?n:null,exceptionEvent:r})},i.prototype.render=function(){var e=this.props,t=e.children,i=e.fallback,s=this.state;if(null==s.componentStack)return nN(t)?t():t;var r=nN(i)?nA.default.createElement(i,{error:s.error,componentStack:s.componentStack,exceptionEvent:s.exceptionEvent}):i;return nA.default.isValidElement(r)?r:(console.warn("[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."),nA.default.createElement(nA.default.Fragment,null))},i.contextType=nD}(nA.default.Component),nM.init("phc_UsqG0w7YwUQHmSskOCzPGEvqrjFnipjDLwCU22pPALo",{api_host:"https://us.i.posthog.com",person_profiles:"always"}),e.s(["CSPostHogProvider",0,function({children:e}){return(0,t.jsx)(nL,{client:nM,children:e})}],365269)},363829,e=>{"use strict";let t,i,s,r,n,a;var o=e.i(843476);e.i(167225);var l={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},c=new class{#e=l;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},u="u"<typeof window||"Deno"in globalThis;function h(){}function d(e,t){return"function"==typeof e?e(t):e}function p(e,t){let{type:i="all",exact:s,fetchStatus:r,predicate:n,queryKey:a,stale:o}=e;if(a){if(s){if(t.queryHash!==f(a,t.options))return!1}else if(!_(t.queryKey,a))return!1}if("all"!==i){let e=t.isActive();if("active"===i&&!e||"inactive"===i&&e)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(!r||r===t.state.fetchStatus)&&(!n||!!n(t))}function g(e,t){let{exact:i,status:s,predicate:r,mutationKey:n}=e;if(n){if(!t.options.mutationKey)return!1;if(i){if(v(t.options.mutationKey)!==v(n))return!1}else if(!_(t.options.mutationKey,n))return!1}return(!s||t.state.status===s)&&(!r||!!r(t))}function f(e,t){return(t?.queryKeyHashFn||v)(e)}function v(e){return JSON.stringify(e,(e,t)=>b(t)?Object.keys(t).sort().reduce((e,i)=>(e[i]=t[i],e),{}):t)}function _(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(i=>_(e[i],t[i]))}var m=Object.prototype.hasOwnProperty;function y(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function b(e){if(!w(e))return!1;let t=e.constructor;if(void 0===t)return!0;let i=t.prototype;return!!w(i)&&!!i.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function w(e){return"[object Object]"===Object.prototype.toString.call(e)}function E(e,t,i=0){let s=[...e,t];return i&&s.length>i?s.slice(1):s}function x(e,t,i=0){let s=[t,...e];return i&&s.length>i?s.slice(0,-1):s}var k=Symbol();function S(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==k?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}var P=(t=[],i=0,s=e=>{e()},r=e=>{e()},n=function(e){setTimeout(e,0)},{batch:e=>{let a;i++;try{a=e()}finally{let e;--i||(e=t,t=[],e.length&&n(()=>{r(()=>
1{e.forEach(e=>{s(e)})})}))}return a},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a=e=>{i?t.push(e):n(()=>{s(e)})},setNotifyFunction:e=>{s=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{n=e}}),F=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},C=new class extends F{#i;#s;#r;constructor(){super(),this.#r=e=>{if(!u&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#s||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#s?.(),this.#s=void 0)}setEventListener(e){this.#r=e,this.#s?.(),this.#s=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#i!==e&&(this.#i=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#i?this.#i:globalThis.document?.visibilityState!=="hidden"}},O=new class extends F{#n=!0;#s;#r;constructor(){super(),this.#r=e=>{if(!u&&window.addEventListener){let t=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",i)}}}}onSubscribe(){this.#s||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#s?.(),this.#s=void 0)}setEventListener(e){this.#r=e,this.#s?.(),this.#s=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#n}};function R(e){return Math.min(1e3*2**e,3e4)}function I(e){return(e??"online")!=="online"||O.isOnline()}var T=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function $(e){let t,i=!1,s=0,r=function(){let e,t,i=new Promise((i,s)=>{e=i,t=s});function s(e){Object.assign(i,e),delete i.resolve,delete i.reject}return i.status="pending",i.catch(()=>{}),i.resolve=t=>{s({status:"fulfilled",value:t}),e(t)},i.reject=e=>{s({status:"rejected",reason:e}),t(e)},i}(),n=()=>C.isFocused()&&("always"===e.networkMode||O.isOnline())&&e.canRun(),a=()=>I(e.networkMode)&&e.canRun(),o=e=>{"pending"===r.status&&(t?.(),r.resolve(e))},l=e=>{"pending"===r.status&&(t?.(),r.reject(e))},h=()=>new Promise(i=>{t=e=>{("pending"!==r.status||n())&&i(e)},e.onPause?.()}).then(()=>{t=void 0,"pending"===r.status&&e.onContinue?.()}),d=()=>{let t;if("pending"!==r.status)return;let a=0===s?e.initialPromise:void 0;try{t=a??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(o).catch(t=>{if("pending"!==r.status)return;let a=e.retry??3*!u,o=e.retryDelay??R,p="function"==typeof o?o(s,t):o,g=!0===a||"number"==typeof a&&s<a||"function"==typeof a&&a(s,t);i||!g?l(t):(s++,e.onFail?.(s,t),new Promise(e=>{c.setTimeout(e,p)}).then(()=>n()?void 0:h()).then(()=>{i?l(t):d()}))})};return{promise:r,status:()=>r.status,cancel:t=>{if("pending"===r.status){let i=new T(t);l(i),e.onCancel?.(i)}},continue:()=>(t?.(),r),cancelRetry:()=>{i=!0},continueRetry:()=>{i=!1},canStart:a,start:()=>(a()?d():h().then(d),r)}}var M=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){var e;this.clearGcTimeout(),"number"==typeof(e=this.gcTime)&&e>=0&&e!==1/0&&(this.#a=c.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(u?1/0:3e5))}clearGcTimeout(){this.#a&&(c.clearTimeout(this.#a),this.#a=void 0)}},A=class extends M{#o;#l;#c;#u;#h;#d;#p;constructor(e){super(),this.#p=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#u=e.client,this.#c=this.#u.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#o=L(this.options),this.state=e.state??this.#o,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=L(this.options);void 0!==e.data&&(this.setState(D(e.data,e.dataUpdatedAt)),this.#o=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#c.remove(this)}setData(e,t){var i,s;let r=(i=this.state.data,"function"==typeof(s=this.options).structuralSharing?s.structuralSharing(i,e):!1!==s.structuralSharing?function e(t,i,s=0){if(t===i)return t;if(s>500)return i;let r=y(t)&&y(i);if(!r&&!(b(t)&&b(i)))return i;let n=(r?t:Object.keys(t)).length,a=r?i:Object.keys(i),o=a.length,l=r?Array(o):{},c=0;for(let u=0;u<o;u++){let o=r?u:a[u],h=t[o],d=i[o];if(h===d){l[o]=h,(r?u<n:m.call(t,o))&&c++;continue}if(null===h||null===d||"object"!=typeof h||"object"!=typeof d){l[o]=d;continue}let p=e(h,d,s+1);l[o]=p,p===h&&c++}return n===o&&c===n?t:l}(i,e):e);return this.#g({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#g({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#h?.promise;return this.#h?.cancel(e),t?t.then(h).catch(h):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#o)}isActive(){return this.observers.some(e=>{var t;return!1!==(t=e.options.enabled,"function"==typeof t?t(this):t)})}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===k||this.state.dataUpdateCount+this.state.errorUpdate
vendor: 8,784 bytes, line 1
1Count===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===d(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!Math.max(this.state.dataUpdatedAt+(e||0)-Date.now(),0))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#c.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#h&&(this.#p?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#c.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#g({type:"invalidate"})}async fetch(e,t){let i;if("idle"!==this.state.fetchStatus&&this.#h?.status()!=="rejected"){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let s=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,s.signal)})},n=()=>{let e,i=S(this.options,t),s=(r(e={client:this.#u,queryKey:this.queryKey,meta:this.meta}),e);return(this.#p=!1,this.options.persister)?this.options.persister(i,s,this):i(s)},a=(r(i={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#u,state:this.state,fetchFn:n}),i);this.options.behavior?.onFetch(a,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#g({type:"fetch",meta:a.fetchOptions?.meta}),this.#h=$({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof T&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),s.abort()},onFail:(e,t)=>{this.#g({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#g({type:"pause"})},onContinue:()=>{this.#g({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#h.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#c.config.onSuccess?.(e,this),this.#c.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof T){if(e.silent)return this.#h.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#g({type:"error",error:e}),this.#c.config.onError?.(e,this),this.#c.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#g(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":var i;return{...t,...(i=t.data,{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:I(this.options.networkMode)?"fetching":"paused",...void 0===i&&{error:null,status:"pending"}}),fetchMeta:e.meta??null};case"success":let s={...t,...D(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?s:void 0,s;case"error":let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),P.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#c.notify({query:this,type:"updated",action:e})})}};function D(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function L(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,i=void 0!==t,s=i?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:i?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var N=class extends F{constructor(e={}){super(),this.config=e,this.#f=new Map}#f;build(e,t,i){let s=t.queryKey,r=t.queryHash??f(s,t),n=this.get(r);return n||(n=new A({client:e,queryKey:s,queryHash:r,options:e.defaultQueryOptions(t),state:i,defaultOptions:e.getQueryDefaults(s)}),this.add(n)),n}add(e){this.#f.has(e.queryHash)||(this.#f.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#f.get(e.queryHash);t&&(e.destroy(),t===e&&this.#f.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){P.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#f.get(e)}getAll(){return[...this.#f.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>p(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>p(e,t)):t}notify(e){P.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){P.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){P.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},j=class extends M{#u;#v;#_;#h;constructor(e){super(),this.#u=e.client,this.mutationId=e.mutationId,this.#_=e.mutationCache,this.#v=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#v.includes(e)||(this.#v.push(e),this.clearGcTimeout(),this.#_.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#v=this.#v.filter(t=>t!==e),this.scheduleGc(),this.#_.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#v.length||("pending"===this.state.status?this.scheduleGc():this.#_.remove(this))}continue(){return this.#h?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#g({type:"continue"})},i={client:this.#u,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#h=$({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#g({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#g({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#_.canRun(this)});let s="pending"===this.state.status,r=!this.#h.canStart();try{if(s)t();else{this.#g({type:"pending",variables:e,isPaused:r}),this.#_.config.onMutate&&await this.#_.config.onMutate(e,this,i);let t=await this.options.onMutate?.(e,i);t!==this.state.context&&this.#g({type:"pending",context:t,variables:e,isPaused:r})}let n=await this.#h.start();return await this.#_.config.onSuccess?.(n,e,this.state.context,this,i),await this.options.onSuccess?.(n,e,this.state.context,i),await this.#_.config.onSettled?.(n,null,this.state.variables,this.state.context,this,i),await this.options.onSettled?.(n,null,e,this.state.context,i),this.#g({type:"success",data:n}),n}catch(t){try{await this.#_.config.onError?.(t,e,this.state.context,this,i)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,i)}catch(e){Promise.reject(e)}try{await this.#_.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,i)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,i)}catch(e){Promise.reject(e)}throw this.#g({type:"error",error:t}),t}finally{this.#_.runNext(this)}}#g(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPau
1sed:!1,status:"error"}}})(this.state),P.batch(()=>{this.#v.forEach(t=>{t.onMutationUpdate(e)}),this.#_.notify({mutation:this,type:"updated",action:e})})}},q=class extends F{constructor(e={}){super(),this.config=e,this.#m=new Set,this.#y=new Map,this.#b=0}#m;#y;#b;build(e,t,i){let s=new j({client:e,mutationCache:this,mutationId:++this.#b,options:e.defaultMutationOptions(t),state:i});return this.add(s),s}add(e){this.#m.add(e);let t=H(e);if("string"==typeof t){let i=this.#y.get(t);i?i.push(e):this.#y.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#m.delete(e)){let t=H(e);if("string"==typeof t){let i=this.#y.get(t);if(i)if(i.length>1){let t=i.indexOf(e);-1!==t&&i.splice(t,1)}else i[0]===e&&this.#y.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=H(e);if("string"!=typeof t)return!0;{let i=this.#y.get(t),s=i?.find(e=>"pending"===e.state.status);return!s||s===e}}runNext(e){let t=H(e);if("string"!=typeof t)return Promise.resolve();{let i=this.#y.get(t)?.find(t=>t!==e&&t.state.isPaused);return i?.continue()??Promise.resolve()}}clear(){P.batch(()=>{this.#m.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#m.clear(),this.#y.clear()})}getAll(){return Array.from(this.#m)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>g(t,e))}findAll(e={}){return this.getAll().filter(t=>g(e,t))}notify(e){P.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>
vendor: 4,173 bytes, line 1
1e.state.isPaused);return P.batch(()=>Promise.all(e.map(e=>e.continue().catch(h))))}};function H(e){return e.options.scope?.id}function U(e){return{onFetch:(t,i)=>{let s=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,n=t.state.data?.pages||[],a=t.state.data?.pageParams||[],o={pages:[],pageParams:[]},l=0,c=async()=>{let i=!1,c=S(t.options,t.fetchOptions),u=async(e,s,r)=>{if(i)return Promise.reject();if(null==s&&e.pages.length)return Promise.resolve(e);let n=(()=>{var e,n;let a,o,l={client:t.client,queryKey:t.queryKey,pageParam:s,direction:r?"backward":"forward",meta:t.options.meta};return e=()=>t.signal,n=()=>i=!0,o=!1,Object.defineProperty(l,"signal",{enumerable:!0,get:()=>(a??=e(),o||(o=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),l})(),a=await c(n),{maxPages:o}=t.options,l=r?x:E;return{pages:l(e.pages,a,o),pageParams:l(e.pageParams,s,o)}};if(r&&n.length){let e="backward"===r,t={pages:n,pageParams:a},i=(e?function(e,{pages:t,pageParams:i}){return t.length>0?e.getPreviousPageParam?.(t[0],t,i[0],i):void 0}:G)(s,t);o=await u(t,i,e)}else{let t=e??n.length;do{let e=0===l?a[0]??s.initialPageParam:G(s,o);if(l>0&&null==e)break;o=await u(o,e),l++}while(l<t)}return o};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},i):t.fetchFn=c}}}function G(e,{pages:t,pageParams:i}){let s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,i[s],i):void 0}var B=class{#w;#_;#d;#E;#x;#k;#S;#P;constructor(e={}){this.#w=e.queryCache||new N,this.#_=e.mutationCache||new q,this.#d=e.defaultOptions||{},this.#E=new Map,this.#x=new Map,this.#k=0}mount(){this.#k++,1===this.#k&&(this.#S=C.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#w.onFocus())}),this.#P=O.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#w.onOnline())}))}unmount(){this.#k--,0===this.#k&&(this.#S?.(),this.#S=void 0,this.#P?.(),this.#P=void 0)}isFetching(e){return this.#w.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#_.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#w.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),i=this.#w.build(this,t),s=i.state.data;return void 0===s?this.fetchQuery(e):(e.revalidateIfStale&&i.isStaleByTime(d(t.staleTime,i))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#w.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,i){let s=this.defaultQueryOptions({queryKey:e}),r=this.#w.get(s.queryHash),n=r?.state.data,a="function"==typeof t?t(n):t;if(void 0!==a)return this.#w.build(this,s).setData(a,{...i,manual:!0})}setQueriesData(e,t,i){return P.batch(()=>this.#w.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,i)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#w.get(t.queryHash)?.state}removeQueries(e){let t=this.#w;P.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let i=this.#w;return P.batch(()=>(i.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){let i={revert:!0,...t};return Promise.all(P.batch(()=>this.#w.findAll(e).map(e=>e.cancel(i)))).then(h).catch(h)}invalidateQueries(e,t={}){return P.batch(()=>(this.#w.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,t={}){let i={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(P.batch(()=>this.#w.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,i);return i.throwOnError||(t=t.catch(h)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(h)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let i=this.#w.build(this,t);return i.isStaleByTime(d(t.staleTime,i))?i.fetch(t):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(h).catch(h)}fetchInfiniteQuery(e){return e.behavior=U(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(
1h).catch(h)}ensureInfiniteQueryData(e){return e.behavior=U(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return O.isOnline()?this.#_.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#w}getMutationCache(){return this.#_}getDefaultOptions(){return this.#d}setDefaultOptions(e){this.#d=e}setQueryDefaults(e,t){this.#E.set(v(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#E.values()],i={};return t.forEach(t=>{_(e,t.queryKey)&&Object.assign(i,t.defaultOptions)}),i}setMutationDefaults(e,t){this.#x.set(v(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#x.values()],i={};return t.forEach(t=>{_(e,t.mutationKey)&&Object.assign(i,t.defaultOptions)}),i}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#d.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=f(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===k&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#d.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#w.clear(),this.#_.clear()}},V=e.i(271645),z=V.createContext(void 0),W=({client:e,children:t})=>(V.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,o.jsx)(z.Provider,{value:e,children:t})),K=function(){return null};e.s(["default",0,function({children:e}){let[t]=(0,V.useState)(new B);return(0,o.jsxs)(W,{client:t,children:[e,(0,o.jsx)(K,{initialIsOpen:!1})]})}],363829)}]);
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.