1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="7afc162f-5876-ac2f-68dc-a6c247d9755f")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,669430,e=>{"use strict";try{var t,i,s,r="u">typeof window?window:e.g;r._sentryModuleMetadata=r._sentryModuleMetadata||{},r._sentryModuleMetadata[(new r.Error).stack]=Object.assign({},r._sentryModuleMetadata[(new r.Error).stack],{"_sentryBundlerPluginAppKey:massive-ui-v3":!0})}catch(e){}var n,a=["retriesPerformedSoFar"],o=["$set_once","$set"];function l(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}function u(){return(u=Object.assign.bind()).apply(null,arguments)}function h(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 c(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function a(e){h(n,s,r,a,o,"next",e)}function o(e){h(n,s,r,a,o,"throw",e)}a(void 0)})}}var d="u">typeof window?window:void 0,p="u">typeof globalThis?globalThis:d,v=null==p?void 0:p.navigator,f=null==p?void 0:p.document,g=null==p?void 0:p.location,_=null==p?void 0:p.fetch,m=null!=p&&p.XMLHttpRequest&&"withCredentials"in new p.XMLHttpRequest?p.XMLHttpRequest:void 0,y=null==p?void 0:p.AbortController,b=null==p?void 0:p.CompressionStream,w=null==v?void 0:v.userAgent;function x(){return!(!d||!1===d.navigator.onLine)}var k="u">typeof globalThis?globalThis:d;k&&"u"<typeof self&&(k.self=k),k&&"u"<typeof File&&(k.File=function(){});var E=null!=d?d:{},S="0.8.2",R={DEBUG:!1,LIB_VERSION:S,LIB_NAME:"browser-common",JS_SDK_VERSION:S},P=["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","pinterestbot","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"],$=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return P.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function F(e,t){return -1!==e.indexOf(t)}var I=function(e){return e.trim()},C=function(e){return e.replace(/^\$/,"")};function O(e){var t,i=[];return null!=(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(t))return"[Circular]";i.push(t)}return t}}))?t:"null"}var A=((tr={}).AnonymousId="anonymous_id",tr.DistinctId="distinct_id",tr.Props="props",tr.EnablePersonProcessing="enable_person_processing",tr.PersonMode="person_mode",tr.FeatureFlagDetails="feature_flag_details",tr.FeatureFlags="feature_flags",tr.FeatureFlagPayloads="feature_flag_payloads",tr.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",tr.BootstrapFeatureFlags="bootstrap_feature_flags",tr.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",tr.OverrideFeatureFlags="override_feature_flags",tr.Queue="queue",tr.AiQueue="ai_queue",tr.AiCaptureQueue="ai_capture_queue",tr.LogsQueue="logs_queue",tr.OptedOut="opted_out",tr.SessionId="session_id",tr.SessionStartTimestamp="session_start_timestamp",tr.SessionLastTimestamp="session_timestamp",tr.PersonProperties="person_properties",tr.GroupProperties="group_properties",tr.InstalledAppBuild="installed_app_build",tr.InstalledAppVersion="installed_app_version",tr.SessionReplay="session_replay",tr.PushRegistered="push_registered",tr.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",tr.SurveyLastSeenDate="survey_last_seen_date",tr.SurveysSeen="surveys_seen",tr.Surveys="surveys",tr.RemoteConfig="remote_config",tr.FlagsEndpointWasHit="flags_endpoint_was_hit",tr.DeviceId="device_id",tr),T=((tn={}).GZipJS="gzip-js",tn.Base64="base64",tn),M=["$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"],L=["token"],D=Object.prototype,N=D.hasOwnProperty,j=D.toString,q=Array.isArray||function(e){return"[object Array]"===j.call(e)},B=e=>"function"==typeof e,H=e=>e===Object(e)&&!q(e),z=e=>{if(H(e)){for(var t in e)if(N.call(e,t))return!1;return!0}return!1},V=e=>void 0===e,U=e=>"[object String]"==j.call(e),G=e=>U(e)&&0===e.trim().length,W=e=>null===e,K=e=>V(e)||W(e),J=e=>"[object Number]"==j.call(e)&&e==e,X=e=>J(e)&&e>0,Y=e=>"[object Boolean]"===j.call(e),Z=e=>F(M,e),Q=e=>F(L,e);function ee(e){return null===e||"object"!=typeof e}function et(e,t){return({}).toString.call(e)==="[object "+t+"]"}function ei(e){switch(({}
2).toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return er(e,Error)}}function es(e){return"u">typeof Event&&er(e,Event)}function er(e,t){try{return e instanceof t}catch(e){return!1}}var en=[!0,"true",1,"1","yes"],ea=[!1,"false",0,"0","no"];function eo(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):t>e?(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),eo(null!=r?r:i,t,i,s))}var el=class{constructor(e){this.C={},this.I=e.I,this.R=eo(e.bucketSize,0,100,e.A),this.O=eo(e.refillRate,0,this.R,e.A),this.N=eo(e.refillInterval,0,864e5,e.A)}F(e,t){var i=Math.floor((t-e.lastAccess)/this.N);i>0&&(e.tokens=Math.min(e.tokens+i*this.O,this.R),e.lastAccess=e.lastAccess+i*this.N)}consumeRateLimit(e){var t,i=Date.now(),s=String(e),r=this.C[s];return r?this.F(r,i):this.C[s]=r={tokens:this.R,lastAccess:i},0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.I)||t.call(this,e)),0===r.tokens)}stop(){this.C={}}},eu="Mobile",eh="Android",ec="Tablet",ed="Android Tablet",ep="iPad",ev="Apple Watch",ef="Safari",eg="BlackBerry",e_="Samsung Internet",em="Chrome",ey="Chrome iOS",eb="Internet Explorer",ew="Internet Explorer Mobile",ex="Opera",ek="Microsoft Edge",eE="Firefox",eS="Firefox iOS",eR="Nintendo",eP="PlayStation",e$="Xbox",eF="Android Mobile",eI="Mobile Safari",eC="Windows",eO="Windows Phone",eA="Nokia",eT="Ouya",eM="Generic "+eu.toLowerCase(),eL="Generic "+ec.toLowerCase(),eD="Konqueror",eN="Oculus Browser",ej="Vivaldi",eq="Yandex",eB="Whale",eH="DuckDuckGo",ez="Pale Moon",eV="Waterfox",eU="Brave",eG="Claude",eW="Codex",eK="ChatGPT",eJ="Google Search App",eX=RegExp("Version/(\\d+(\\.\\d+)?)"),eY=RegExp("(Claude|Codex|ChatGPT)\\/(\\d+(\\.\\d+)?)"),eZ=RegExp(e$,"i"),eQ=RegExp("PlayStation \\w+","i"),e0=RegExp("Nintendo \\w+","i"),e1=RegExp("BlackBerry|PlayBook|BB10","i"),e2={"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"},e3=function(e,t,i,s){var r;return t=t||"",(null!=i&&i.brave?eU:null)||(null!=s&&s.detectGoogleSearchApp&&F(e,"GSA/")?eJ:F(e," OPR/")&&F(e,"Mini")?"Opera Mini":F(e," OPR/")?ex:e1.test(e)?eg:F(e,"IEMobile")||F(e,"WPDesktop")?ew:F(e,"OculusBrowser")?eN:F(e,"SamsungBrowser")?e_:F(e,"Edge")||F(e,"Edg/")?ek:F(e,"Vivaldi/")?ej:F(e,"YaBrowser/")?eq:F(e,"Whale/")?eB:F(e,"DuckDuckGo/")||F(e,"Ddg/")?eH:F(e,"Claude/")?eG:F(e,"Codex/")?eW:F(e,"ChatGPT/")?eK:F(e,"FBIOS")?"Facebook Mobile":F(e,"UCWEB")||F(e,"UCBrowser")?"UC Browser":F(e,"CriOS")?ey:F(e,"CrMo")||F(e,em)?em:F(e,eh)&&F(e,ef)?eF:F(e,"FxiOS")?eS:F(e.toLowerCase(),eD.toLowerCase())?eD:F(e,"Brave/")?eU:(r=t)&&F(r,"Apple")||F(e,ef)&&!F(e,em)&&!F(e,eh)?F(e,eu)?eI:ef:F(e,"PaleMoon/")?ez:F(e,"Waterfox/")?eV:F(e,eE)?eE:F(e,"MSIE")||F(e,"Trident/")?eb:F(e,"Gecko")?eE:"")},e5={[ew]:[RegExp("rv:(\\d+(\\.\\d+)?)")],[ek]:[RegExp("Edge?\\/(\\d+(\\.\\d+)?)")],[em]:[RegExp("(Chrome|CrMo)\\/(\\d+(\\.\\d+)?)")],[ey]:[RegExp("CriOS\\/(\\d+(\\.\\d+)?)")],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/(\\d+(\\.\\d+)?)")],[ef]:[eX],[eI]:[eX],[ex]:[RegExp("(Opera|OPR)\\/(\\d+(\\.\\d+)?)")],[eE]:[RegExp("Firefox\\/(\\d+(\\.\\d+)?)")],[eS]:[RegExp("FxiOS\\/(\\d+(\\.\\d+)?)")],[eD]:[RegExp("Konqueror[:/]?(\\d+(\\.\\d+)?)","i")],[eg]:[RegExp("BlackBerry (\\d+(\\.\\d+)?)"),eX],[eF]:[RegExp("android\\s(\\d+(\\.\\d+)?)","i")],[e_]:[RegExp("SamsungBrowser\\/(\\d+(\\.\\d+)?)")],[eN]:[RegExp("OculusBrowser\\/(\\d+(\\.\\d+)?)")],[ej]:[RegExp("Vivaldi\\/(\\d+(\\.\\d+)?)")],[eq]:[RegExp("YaBrowser\\/(\\d+(\\.\\d+)?)")],[eB]:[RegExp("Whale\\/(\\d+(\\.\\d+)?)")],[eU]:[RegExp("Brave\\/(\\d+(\\.\\d+)?)")],[eG]:[eY],[eW]:[eY],[eK]:[eY],[eH]:[RegExp("(DuckDuckGo|Ddg)\\/(\\d+(\\.\\d+)?)")],[ez]:[RegExp("PaleMoon\\/(\\d+(\\.\\d+)?)")],[eV]:[RegExp("Waterfox\\/(\\d+(\\.\\d+)?)")],[eJ]:[RegExp("GSA\\/(\\d+(\\.\\d+)?)")],[eb]:[RegExp("(rv:|MSIE )(\\d+(\\.\\d+)?)")],Mozilla:[RegExp("rv:(\\d+(\\.\\d+)?)")]},e6=function(e,t,i,s){var r=e5[e3(e,t,i,s)];if(V(r))return null;for(var n=0;r.length>n;n++){var a=e.match(r[n]);if(a)return parseFloat(a[a.length-2])}return null},e8=[[RegExp("Xbox; Xbox (.*?)[);]","i"),e=>[e$,e&&e[1]||""]],[RegExp(eR,"i"),[eR,""]],[RegExp(eP,"i"),[eP,""]],[e1,[eg,""]],[RegExp(eC,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eO,""];if(new RegExp(eu).test(t)&&!/IEMobile\b/.test(t))return["Windows Mobile",""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=e2[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[eC,s]}return[eC,""]}],[/((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=V(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("(Android (\\d+)\\.(\\d+)\\.?(\\d+)?|Android)","i"),e=>e&&e[2]?[eh,[e[2],e[3],e[4]||"0"].join(".")]:[eh,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,["Chrome OS",""]],[/Linux|debian/i,["Linux",""]]],e4=function(e){for(var t=0;e8.length>t;t++){var i=e8[t],s=i[1],r=i[0].exec(e),n=r&&(B(s)?s(r,e):s);if(n)return n}return["",""]},e9=function(e){return e0.test(e)?eR:eQ.test(e)?eP:eZ.test(e)?e$:RegExp(eT,"i").test(e)?eT:RegExp("(Windows Phone|WPDesktop)","i").test(e)?eO:/iPad/.test(e)?ep:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ev:e1.test(e)?eg:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eA,"i").test(e)?eA:/(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(eu).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)?eh:ed:RegExp("(pda|Mobile)","i").test(e)?eM:RegExp(ec,"i").test(e)&&!RegExp("Tablet pc","i").test(e)?eL:""},e7=/\bFBAV\/(\d+(?:\.\d+)*)/i,te=[[/\bInstagram(?:[ /](\d+(?:\.\d+)*))?\b/i,"Instagram"],[/\bBarcelona[ /](\d+(?:\.\d+)*)?/i,"Threads"],[/\b(?:MessengerForiOS|(?:FBAN|FB_IAB)\/Orca-Android)\b/i,"Messenger",e7],[/\bFBAN\/EMA\b/i,"Facebook Lite",e7],[/\b(?:FBIOS|(?:FBAN|FB_IAB)\/(?:FB4A|FBIOS))\b/i,"Facebook",e7],[/\bLinkedInApp(?:\]?\/(\d+(?:\.\d+)*))?\b/i,"LinkedIn"],[/\bTwitter(?:Android| for (?:iPhone|iPad|Android))(?
2:\/(\d+(?:\.\d+)*))?\b/i,"Twitter"],[/\b(?:musical_ly|trill)(?:[_/](\d+\.\d+(?:\.\d+)*))?(?=\b|_)/i,"TikTok",/\bapp_version\/(\d+(?:\.\d+)*)/i],[/\b(?:MicroMessenger|WeChat)\/(\d+(?:\.\d+)*)?/i,"WeChat"],[/\bLine\/(\d+(?:\.\d+)*)?/i,"Line"],[/\bGSA\/(\d+(?:\.\d+)*)?/i,"Google"],[/\[Pinterest\/(?:iOS|Android)\b|\bPinterest(?: for (?:Android(?: Tablet)?|iOS))?\/(\d+(?:\.\d+)*)/i,"Pinterest"],[/\b(?:WA4A|WAiOS)\/(\d+(?:\.\d+)*)?/i,"WhatsApp"],[/\bSnapchat[ /](\d+(?:\.\d+)*)?/i,"Snapchat"],[/\bBing(?:Web|Sapphire)\/(\d+(?:\.\d+)*)?/i,"Bing"],[/\bNAVER\(inapp; search;/i,"Naver",/\bNAVER\(inapp; search;[^;)]*; (\d+(?:\.\d+)*)/i],[/\bKAKAOTALK[ /](\d+\.\d+(?:\.\d+)*)?/i,"KakaoTalk"]],tt="[Truncated]",ti="[Unserializable]";function ts(e){for(var t="",i=0;e.length>i;i++){var s=e.charCodeAt(i);if(55296>s||s>56319)t+=56320>s||s>57343?e[i]:"�";else{var r=e.charCodeAt(i+1);56320>r||r>57343?t+="�":(t+=e[i]+e[i+1],i++)}}return t}var tr,tn,ta,to,tl,tu=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function th(e,t){return"string"==typeof e&&tu.test(e)?e:t()}function tc(e,t){var i=Error(t);try{Object.defineProperty(i,"name",{value:e,writable:!0,enumerable:!0,configurable:!0})}catch(e){}return i}function td(e){return e?e.split("#")[0]:e}function tp(e,t){var i=setTimeout(e,t);return null!=i&&i.unref&&(null==i||i.unref()),i}function tv(e,t,i){return tf.apply(this,arguments)}function tf(){return(tf=c(function*(e,t,i){var s;try{return yield Promise.race([e,new Promise((e,r)=>{s=tp(()=>{try{null==i||i(),e()}catch(e){r(e)}},t)})])}finally{clearTimeout(s)}})).apply(this,arguments)}var tg=class{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(t),n=this.parseStacktrace(s,r);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return c(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&q(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.skipFirstLines:0),t.chunkIdMap)),u({},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 c(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,u({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return tl&&i.length===to?tl:(to=i.length,tl=i.reduce((i,s)=>{ta||(ta={});var r=ta[s];if(r)i[r[0]]=r[1];else for(var n=e(s),a=n.length-1;a>=0;a--){var o,l=null==(o=n[a])?void 0:o.filename,u=t[s];if(l&&u){i[l]=u,ta[s]=[l,u];break}}return i},{}))}}(this.stackParser),skipFirstLines:null!=(t=e.skipFirstLines)?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var s=(i,s)=>{if(4>=s){var r=this.buildCoercingContext(e,t,s);return this.applyCoercers(i,r)}};return u({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,i),next:e=>s(e,i+1)})}};function t_(e,t,i,s,r){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!!t&&!t.startsWith("webkit-masked-url://")&&"<anonymous>"!==t};return V(s)||(n.lineno=s),V(r)||(n.colno=r),n}var tm=(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]},ty=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tb=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tw=/\((\S*)(?::(\d+))(?::(\d+))\)/,tx=(e,t)=>{var i=ty.exec(e);if(i)return t_(t,i[1],"?",+i[2],+i[3]);var s=tb.exec(e);if(s){if(s[2]&&0===s[2].indexOf("eval")){var r=tw.exec(s[2]);r&&(s[2]=r[1],s[3]=r[2],s[4]=r[3])}var n=tm(s[1]||"?",s[2]);return t_(t,n[1],n[0],s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},tk=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tE=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tS=(e,t)=>{var i=tk.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var s=tE.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]||"?",a=tm(n,r);return t_(t,r=a[1],n=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tR=/\(error: (.*)\)/,tP=class{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=U(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 et(e,"DOMException")}isDOMError(e){return et(e,"DOMError")}},t$=class{match(e){return ei(e)}coerce(e,t){var i,s=this.getStack(e);return{type:this.getType(e),value:this.getMessage(e,t),stack:null!=s?s:null==(i=t.syntheticException)?void 0:i.stack,cause:e.cause?t.next(e.cause):void 0,synthetic:void 0===s}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var i=e.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(e){return e.stacktrace||e.stack||void 0}},tF=class{match(e){return!!et(e,"ErrorEvent")&&(null!=e.error||this.an(e))}coerce(e,t){if(null!=e.error)return t.apply(e.error);var i,s=t.apply(e.message);return u({},s,{stack:null!=(i=this.sn(e))?i:s.stack,synthetic:!0})}an(e){return U(e.message)&&e.message.length>0}sn(e){var t,i,s=null!=(t=e.lineno)?t:0,r=null!=(i=e.colno)?i:0;if(U(e.filename)&&0!==e.filename.length&&0!==s)return"Error\n at "+e.filename+":"+s+":"+r}},tI=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,tC=class{match(e){return"string"==typeof e}coerce(e,t){var i,s=this.getInfos(e),r=s[0],n=s[1];return{type:null!=r?r:"Error",value:null!=n?n:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,s=e.match(tI);return s&&(t=s[1],i=s[2]),[t,i]}},tO=["fatal","error","warning","log","info","debug"];function tA(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(", ");
2if(t>=r.length)return s===i.length?r:r.length>t?r.slice(0,t)+"...":r}return""}var tT=class{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,s,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{type:this.getType(e),value:this.getValue(e),stack:null!=(i=this.getStack(e))?i:null==(s=t.syntheticException)?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){if(es(e))return e.constructor.name;var t="name"in e?e.name:void 0;return U(t)&&!G(t)?t:"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: "+tA(e)}isSeverityLevel(e){return U(e)&&!G(e)&&tO.indexOf(e)>=0}getStack(e){try{return U(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:U(e.stack)&&e.stack.length>0?e.stack:void 0}catch(e){return}}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var i=e[t];if(ei(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}},tM=class{match(e){return es(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+tA(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}},tL=class{match(e){return ee(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}}},tD=class{match(e){return et(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!es(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var i,s=this.getUnhandledRejectionReason(e);return ee(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){try{if("reason"in e)return e.reason;if("detail"in e&&null!=e.detail&&"object"==typeof e.detail&&"reason"in e.detail)return e.detail.reason}catch(e){}return e}},tN="$message",tj="$timestamp",tq=new Set([tN,tj]),tB={enabled:!0,max_bytes:32768};function tH(e){var t;return e?{enabled:null!=(t=e.enabled)?t:tB.enabled,max_bytes:function(e,t){if(!J(e)||1/0===e||-1/0===e)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,tB.max_bytes)}:u({},tB)}var tz=class{constructor(e){this.Gn=[],this.Zn=0,this.Rn=tH(e)}setConfig(e){this.Rn=tH(e),this.Jn()}add(e){var t=function(e){var t;try{t=O(e)}catch(e){return}try{var i=JSON.parse(t);if(!H(i))return;var s=i[tN],r=i[tj];if(!U(s)||0===s.trim().length||!U(r)&&!J(r))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var i=function(e){if("u">typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),i=0,s=0;t.length>s;s++)"%"===t[s]?(i+=1,s+=2):i+=1;return i}(t.json);i>this.Rn.max_bytes||(this.Gn.push({step:t.step,bytes:i}),this.Zn+=i,this.Jn())}}getAttachable(){return this.Gn.map(e=>e.step)}clear(){this.Gn=[],this.Zn=0}size(){return this.Gn.length}Jn(){for(;this.Zn>this.Rn.max_bytes&&this.Gn.length>0;){var e=this.Gn.shift();e&&(this.Zn-=e.bytes)}}},tV=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function tU(e){return"string"==typeof e||e}function tG(e){return"string"==typeof e?e:void 0}var tW,tK,tJ=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$referring_domain","utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid","gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],tX="NativeGzipValidationError",tY=e=>e.length>=2&&31===e[0]&&139===e[1],tZ=(e,t)=>e===T.GZipJS||t===T.GZipJS||"gzip"===t,tQ=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),t0=e=>
2{throw tc(tX,"Native gzip produced invalid output: "+e)},t1=(tW=c(function*(e,t){18>e.size&&t0("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));tY(i)&&8===i[2]||t0("invalid-header");var s=new DataView((yield e.slice(e.size-8).arrayBuffer()));s.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(tK)return tK;tK=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?0xedb88320^t>>>1:t>>>1;tK[e]=t>>>0}return tK})(),i=0xffffffff,s=0;e.length>s;s++)i=t[255&(i^e[s])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&t0("invalid-crc");var r=t.length>>>0;s.getUint32(4,!0)!==r&&t0("invalid-size")}),function(e,t){return tW.apply(this,arguments)});function t2(){return(t2=c(function*(e,t,i){void 0===t&&(t=!0);try{var s,r=(new TextEncoder).encode(e),n=new globalThis.CompressionStream("gzip"),a=n.writable.getWriter(),o=a.write(r).then(()=>a.close()).catch((s=c(function*(e){try{yield a.abort(e)}catch(e){}throw e}),function(e){return s.apply(this,arguments)})),l=new Response(n.readable).blob(),u=(yield Promise.all([l,o]))[0];return yield t1(u,r),u}catch(e){if(null!=i&&i.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})).apply(this,arguments)}var t3={}.propertyIsEnumerable;function t5(e,t){try{return t6(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(e){return[]}}function t6(e,t,i,s){var r=[];for(var n in e)if(t3.call(e,n)){if(!n){null==t||t.debug("Dropping an attribute with an empty key");continue}if(r.length>=1e3||0>=i.remainingNodes){null==t||t.debug("Attributes truncated: the value exceeds the OTLP encoder budget");break}try{var a=e[n];if(W(a)||V(a))continue;r.push({key:ts(n),value:function e(t,i,s,r){if(0>=s.remainingNodes)return{stringValue:tt};if(s.remainingNodes--,Y(t))return{boolValue:t};if("bigint"==typeof t){var n,a;return n=t.toString(),t>=(a=BigInt("9223372036854775808"))||-a>t?(null==i||i.debug("Attribute "+n+" is outside the int64 range; encoding it as a string"),{stringValue:n}):{intValue:n}}if("number"==typeof t){if(!Number.isFinite(t))return{stringValue:String(t)};if(Number.isInteger(t)){if(Number.isSafeInteger(t))return{intValue:String(t)};if(typeof BigInt>"u")return{stringValue:String(t)};var o=BigInt(t).toString();return t>=0x8000000000000000||-0x8000000000000000>t?(null==i||i.debug("Attribute "+o+" is outside the int64 range; encoding it as a string"),{stringValue:o}):{intValue:o}}return{doubleValue:t}}if("string"==typeof t)return{stringValue:ts(t)};if("function"==typeof t)return{stringValue:"[Function]"};if("symbol"==typeof t)return{stringValue:String(t)};if("object"==typeof t&&null!==t){if(s.ancestors.has(t))return{stringValue:"[Circular]"};if(r>=20)return{stringValue:tt};if(t instanceof Date){var l=Number.isFinite(t.getTime())?t.toISOString():String(t);return{stringValue:"string"==typeof l?ts(l):String(l)}}s.ancestors.add(t);try{try{var u=t.toJSON;if("function"==typeof u)return e(u.call(t),i,s,r+1)}catch(e){}return q(t)?{arrayValue:{values:function(t,i,s,r){for(var n=[],a=Math.min(t.length,1e3),o=0;a>o&&s.remainingNodes>0;o++)try{var l=o in t?t[o]:void 0;if(K(l))continue;n.push(e(l,i,s,r))}catch(e){n.push({stringValue:ti})}return t.length>o&&n.push({stringValue:tt}),n}(t,i,s,r+1)}}:{kvlistValue:{values:t6(t,i,s,r+1)}}}finally{s.ancestors.delete(t)}}return{stringValue:ts(String(t))}}(a,t,i,s)})}catch(e){r.push({key:ts(n),value:{stringValue:ti}})}}return r}function t8(e,t,i){return u({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":i})}var t4={darwin:"macOS",win32:"Windows",linux:"Linux",android:"Android",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",aix:"AIX","Mac OS X":"macOS"},t9={trace:{text:"TRACE",number:1},debug:{text:"DEBUG",number:5},info:{text:"INFO",number:9},warn:{text:"WARN",number:13},error:{text:"ERROR",number:17},fatal:{text:"FATAL",number:21}},t7=t9.info;function ie(e,t,i,s){return{resourceLogs:[{resource:{attributes:t5(t)},scopeLogs:[{scope:{name:i,version:s},logRecords:e}]}]}}var it=class{constructor(e,t,i,s,r,n,a){var o;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.Rn=t,this.A=i,this.Qn=s,this.Kn=r,this.Xn=n,this.Yn=a,this.ts=null,this.es=0,this.rs=0,this.ns=0,this.ss=0,this.ls=0,this.us=!1,this.hs=t.maxBufferSize,this.ds=Math.max(null!=(o=t.maxQueueSize)?o:t.maxBufferSize,t.maxBufferSize),this.vs=t.flushIntervalMs,this.cs=t.maxBatchRecordsPerPost,this.fs=t.rateCapWindowMs,this.ps=t.maxLogsPerInterval}clearQueue(){this.rs++,this._instance.setPersistedProperty(A.LogsQueue,[])}reset(){this.gs(),this.ss=0,this.ls=0,this.us=!1,this.ns=0,this.cs=this.Rn.maxBatchRecordsPerPost}onReconnect(){this.ns=0,this.ys()}captureLog(e,t){var i;if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var s=this.bs(e);if(null!==s)if(s.body){if(this._s()){var r={record:function(e,t,i,s){var r,n=t9[e.level||"info"]||t7,a=n.text,o=n.number,l=(void 0===(r=J(s)?s:void 0)&&(r=Date.now()),String(r)+"000000"),h={};t.distinctId&&(h.posthogDistinctId=t.distinctId),t.sessionId&&(h.sessionId=t.sessionId),t.windowId&&(h["window.id"]=t.windowId),K(t.sessionStartTimestamp)||(h.sessionStartTimestamp=String(t.sessionStartTimestamp)),K(t.lastActivityTimestamp)||(h.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(h["url.full"]=t.currentUrl),t.screenName&&(h["screen.name"]=t.screenName),t.appState&&(h["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(h.feature_flags=t.activeFeatureFlags);var c=u({},h),d=e.attributes;if(d){var p=[];try{p=Object.keys(d)}catch(e){p=[]}for(var v of p){var f=void 0;try{f=d[v]}catch(e){f=ti}Object.defineProperty(c,v,{value:f,enumerable:!0,writable:!0,configurable:!0})}}var g={timeUnixNano:l,observedTimeUnixNano:l,severityNumber:o,severityText:a,body:{stringValue:function(e){try{return ts(String(e))}catch(e){return ti}}(e.body)},attributes:t5(c,i)};return e.trace_id&&(g.traceId=e.trace_id),e.span_id&&(g.spanId=e.span_id),V(e.trace_flags)||(g.flags=e.trace_flags),g}(s,null!=(i=null==t?void 0:t.context)?i:this.Qn(),this.A,null==t?void 0:t.occurredAtMs)};this.Kn(()=>this.ws(r))}}else this.A.info("Log was rejected in beforeSend function")}}bs(e){var t=this.Rn.beforeSend;if(!t)return e;var i=q(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.A.info("Log was rejected in beforeSend function"),null;s=n}catch(e){return this.A.error("Error in beforeSend function for log:",e),null}return s}_s(){if(void 0===this.ps)return!0;var e=Date.now(),t=e-this.ss;return this.fs>t&&t>=0||(this.ss=e,this.ls=0,this.us=!1),this.ps>this.ls?(this.ls++,!0):(this.us||(this.A.warn("captureLog dropping logs: exceeded "+this.ps+" logs per "+this.fs+"ms"),this.us=!0),!1)}flush(){var e=this;return c(function*(){if(!e._instance.isDisabled)return e.ts||(e.ts=e.ks().finally(()=>{e.ts=null})),e.ts})()}ks(){var e=this;return c(function*(){e.gs();var t=null!=(r=e._instance.getPersistedProperty(A.LogsQueue))?r:[];if(0!==t.length)for(var i=t.length,s=0;t.length>0&&i>s;){var r,n,a,o=e.rs;e.es=0;var l=Math.min(t.length,e.cs),u=t.slice(0,l),h=ie(u.map(e=>e.record),e.Ss(),null!=(n=e.Yn)?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),c=yield e._instance.xs(h);if(e.rs!==o)return;if("too-large"===c.kind&&u.length>1)e.cs=Math.max(1,Math.floor(u.length/2)),e.A.warn("Received 413 when sending logs batch of size "+u.length+", reducing batch size to "+e.cs);else if("retry-later"===c.kind||("too-large"===c.kind?e.A.warn("Dropping a single log record after 413 with batch size 1 â the record
2is larger than the server cap and cannot be split further."):"ok"===c.kind&&e.Rn.maxBatchRecordsPerPost>e.cs&&(e.cs=Math.min(e.Rn.maxBatchRecordsPerPost,e.cs+1)),yield e.Cs(u.length),t=null!=(a=e._instance.getPersistedProperty(A.LogsQueue))?a:[],s+=u.length,"fatal"===c.kind))throw c.error}})()}Cs(e){var t=this;return c(function*(){var i,s=Math.max(0,e-t.es),r=null!=(i=t._instance.getPersistedProperty(A.LogsQueue))?i:[];t._instance.setPersistedProperty(A.LogsQueue,r.slice(s)),yield t.Xn()})()}Ss(){var e;return e=this.Rn,t8(e,this._instance.getLibraryId(),this._instance.getLibraryVersion())}ws(e){var t;if(!this._instance.optedOut){var i=null!=(t=this._instance.getPersistedProperty(A.LogsQueue))?t:[];this.ds>i.length||(i.shift(),this.es++,this.A.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(A.LogsQueue,i),this.hs>i.length?this.Ts():this.ys()}}Ts(e){void 0===e&&(e=this.vs),this.Ms||(this.Ms=tp(()=>{this.Ms=void 0,this.ys()},e))}Is(){var e=Math.min(Math.max(0,this.ns-1),6);return this.vs*Math.pow(2,e)}Es(){var e=this._instance.getPersistedProperty(A.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return c(function*(){t.gs();var i=t.flush().catch(()=>{});void 0!==e?yield tv(i,e):yield i})()}flushWithTimeout(e){var t=this;return c(function*(){var i=t.flush();yield tv(i,e,()=>{i.catch(()=>{})})})()}ys(){this.flush().then(()=>{this.ns=0},e=>{this.ns++,this.A.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.Es()&&this.Ts(this.Is())})}gs(){this.Ms&&(clearTimeout(this.Ms),this.Ms=void 0)}},ii=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function is(e){return String(e)+"000000"}function ir(e,t,i,s){var r="";return s&&(r=Object.keys(s).sort().map(e=>JSON.stringify(e)+":"+JSON.stringify(s[e])).join(",")),e+"\0"+t+"\0"+(null!=i?i:"")+"\0"+r}var ia=class{constructor(e,t,i){this._instance=e,this.Rn=t,this.A=i,this.Rs=new Map,this.ts=null,this.As=!1,this.Ps=new Map,this.Fs=new Set,this.Os=0}count(e,t,i){void 0===t&&(t=1),this.$s({name:e,type:"count",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(e,t,i){this.$s({name:e,type:"gauge",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(e,t,i){this.$s({name:e,type:"histogram",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var e,t=this,i=this.ts,s=(e=c(function*(){i&&(yield i.catch(()=>{})),yield t.Ds()}),function(){return e.apply(this,arguments)})().finally(()=>{this.ts===s&&(this.ts=null)});return this.ts=s,s}drainWindow(){if(0===this.Rs.size)return null;var e=this.Rs;return this.Rs=new Map,this.As=!1,this.Ps=new Map,this.Fs=new Set,this.Ls(e)}reset(){this.Os++,this.gs(),this.Rs=new Map,this.ts=null,this.As=!1,this.Ps=new Map,this.Fs=new Set}$s(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.bs(e);if(null!==t)if(t.name&&"string"==typeof t.name)if("number"==typeof t.value&&Number.isFinite(t.value))if("count"===t.type&&0>t.value)this.A.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{try{i=t.attributes?u({},t.attributes):void 0,s=ir(t.type,t.name,t.unit,i)}catch(e){return void this.A.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var i,s,r=this.Rs.get(s);if(!r){if(!this.Ns())return;r={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.Rs.set(s,r)}var n=this.Ps.get(t.name);void 0===n?this.Ps.set(t.name,t.type):n===t.type||this.Fs.has(t.name)||(this.Fs.add(t.name),this.A.warn("Metric name '"+t.name+"' is already used as a "+n+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this.qs(r,t.value),this.Ts()}else this.A.warn("Dropping metric '"+t.name+"': value must be a finite number");else this.A.warn("Dropping metric with empty name")}}Ns(){return this.Rn.maxSeriesPerFlush>this.Rs.size||(this.As||(this.As=!0,this.A.warn("Metric series cap reached ("+this.Rn.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}qs(e,t){var i;switch(e.type){case"count":e.total=(null!=(i=e.total)?i:0)+t;break;case"gauge":e.last=t;break;case"histogram":e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:Array(ii.length+1).fill(0)});var s=e.hist;s.count+=1,s.sum+=t,s.min=Math.min(s.min,t),s.max=Math.max(s.max,t),s.bucketCounts[function(e,t){for(var i=0;t.length>i;i++)if(t[i]>=e)return i;return t.length}(t,ii)]+=1}}bs(e){var t=this.Rn.beforeSend;if(!t)return e;var i=q(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.A.info("Metric was rejected in beforeSend function"),null;s=n}catch(e){return this.A.error("Error in beforeSend function for metric:",e),null}return s}Ts(){this.Ms||(this.Ms=tp(()=>{this.Ms=void 0,this.flush().catch(e=>{this.A.error("Metrics flush failed:",e)})},this.Rn.flushIntervalMs))}gs(){this.Ms&&(clearTimeout(this.Ms),this.Ms=void 0)}Ds(){var e=this;return c(function*(){if(0!==e.Rs.size){var t=e.Rs;e.Rs=new Map,e.As=!1,e.Ps=new Map,e.Fs=new Set;var i=e.Os,s=yield e._instance.js(e.Ls(t));if(i===e.Os)switch(s.kind){case"ok":return;case"retry-later":return e.Bs(t),void e.Ts();case"too-large":return void e.A.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.A.error("Failed to send metrics batch:",s.error)}}})()}Ls(e){var t,i,s,r;return t=this.Hs(e),i=t8(this.Rn,this._instance.getLibraryId(),this._instance.getLibraryVersion()),s=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:t5(i)},scopeMetrics:[{scope:{name:s,version:r},metrics:t}]}]}}Hs(e){var t=is(Date.now()),i=new Map;for(var s of e.values()){var r,n=ir(s.type,s.name,s.unit,void 0),a=i.get(n);a||(a=u({name:s.name},s.unit&&{unit:s.unit}),"count"===s.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===s.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(n,a));var o=t5(null!=(r=s.attributes)?r:{},this.A),l=is(s.windowStartMs);if("count"===s.type){var h,c={attributes:o,startTimeUnixNano:l,timeUnixNano:t,asDouble:null!=(h=s.total)?h:0};a.sum.dataPoints.push(c)}else if("gauge"===s.type){var d,p={attributes:o,timeUnixNano:t,asDouble:null!=(d=s.last)?d:0};a.gauge.dataPoints.push(p)}else s.hist&&a.histogram.dataPoints.push({attributes:o,startTimeUnixNano:l,timeUnixNano:t,count:s.hist.count,sum:s.hist.sum,min:s.hist.min,max:s.hist.max,bucketCounts:s.hist.bucketCounts,explicitBounds:ii})}return Array.from(i.values())}Bs(e){var t,i;for(var s of e){var r=s[0],n=s[1],a=this.Rs.get(r);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,n.windowStartMs),a.type){case"count":a.total=(null!=(t=a.total)?t:0)+(null!=(i=n.total)?i:0);break;case"gauge":break;case"histogram":if(n.hist)if(a.hist){a.hist.count+=n.hist.count,a.hist.sum+=n.hist.sum,a.hist.min=Math.min(a.hist.min,n.hist.min),a.hist.max=Math.max(a.hist.max,n.hist.max);for(var o=0;a.hist.bucketCounts.length>o;o++)a.hist.bucketCounts[o]+=n.hist.bucketCounts[o]}else a.hist=n.hist}else this.Ns()&&this.Rs.set(r,n)}}},io=function(e,t){var i=(void 0===t?{}:t).debugEnabled,s={q(t){for(var s=arguments.length,r=Array(s>1?s-1:0),n=1;s>n;n++)r[n-1]=arguments[n];
vendor: 4,632 bytes, line 2
2d&&(R.DEBUG||d.POSTHOG_DEBUG||i)&&!V(d.console)&&d.console&&("__rrweb_original__"in d.console[t]?d.console[t].__rrweb_original__:d.console[t])(e,...r)},debug(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.q("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.q("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.q("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.q("error",...t)},critical(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];console.error(e,...i)},uninitializedWarning(e){s.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>io(e+" "+t,i)};return s},il=io("[PostHog.js]"),iu=il.createLogger,ih=iu("[ExternalScriptsLoader]"),ic=e=>{var t=null==f?void 0:f.querySelectorAll("script");if(t){for(var i=0;t.length>i;i++)if(t[i].src===e||t[i].getAttribute("src")===e)return t[i]}},id=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return ih.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=ic(t);if(s){if(s.__posthog_loading_callback_fired)return i();var r=s.__posthog_loading_error;return r?i(r):(s.addEventListener("load",e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)}),void s.addEventListener("error",e=>{s.__posthog_loading_error=e,i(e)}))}var n=()=>{if(!f)return i("document not found");if(ic(t))return id(e,t,i);var s=f.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=>{s.__posthog_loading_error=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)f.head.appendChild(s);else{var r,n=f.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):f.body.appendChild(s)}};null!=f&&f.body?n():null==f||f.addEventListener("DOMContentLoaded",n)},ip={},iv=(e,t)=>{var i="/static/"+t+".js?v="+e.version;return"toolbar"===t&&(i=i+"&t="+3e5*Math.floor(Date.now()/3e5)),e.requestRouter.endpointFor("assets",i)};E.__PosthogExtensions__=E.__PosthogExtensions__||{},E.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var s=e.config.strict_script_versioning;if(s){var r=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js"),n=ip[r];if("fallback"===s&&n){if(ic(n))return void id(e,n,i);delete ip[r]}id(e,r,"fallback"===s?(s,n)=>{if(s)if("string"==typeof s)i(s);else{var a,o=iv(e,t);ip[r]=o;var l=ic(r);null==l||null==(a=l.parentNode)||a.removeChild(l),id(e,o,i)}else i(void 0,n)}:i)}else id(e,iv(e,t),i)}else id(e,e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js"),i)},E.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{id(e,e.requestRouter.endpointFor("api",t),i)},R.DEBUG=!1,R.LIB_VERSION="1.428.5",R.LIB_NAME="web";var ig="distinct_id",i_="$device_id",im="$device_model",iy="__alias",ib="$fbc",iw="$fbc_persistence",ix="__timers",ik="$autocapture_disabled_server_side",iE="$heatmaps_enabled_server_side",iS="$exception_capture_enabled_server_side",iR="$error_tracking_suppression_rules",iP="$error_tracking_capture_extension_exceptions",i$="$web_vitals_enabled_server_side",iF="$dead_clicks_enabled_server_side",iI="$product_tours_enabled_server_side",iC="$logs_capture_enabled_server_side",iO="$web_vitals_allowed_metrics",iA="$session_recording_remote_config",iT="$replay_sample_rate",iM="$replay_override_sampling",iL="$replay_override_linked_flag",iD="$replay_override_url_trigger",iN="$replay_override_event_trigger",ij="$sesid",iq="$session_is_sampled",iB="$enabled_feature_flags",iH="$active_feature_flags",iz="$early_access_features",iV="$feature_flag_details",iU="$feature_flag_payloads",iG="$feature_flag_request_id",iW="$minimal_flag_called_events",iK="$override_feature_flags",iJ="$override_feature_flag_payloads",iX="$stored_person_properties",iY="$stored_group_properties",iZ="$groups",iQ="$surveys",i0="$surveys_loaded_at",i1="$surveys_activated",i2="$surveys_activated_session",i3="$surveys_activated_timestamps",i5="ph_product_tours",i6="$flag_call_reported",i8="$flag_call_reported_session_id",i4="$feature_flag_errors",i9="$feature_flag_evaluated_at",i7="$user_state",se="$client_session_props",st="$capture_rate_limit",si="$initial_campaign_params",ss="$initial_referrer_info",sr="$initial_person_info",sn="$epp",sa="$posthog_cookieless",so="$co
2okieless_mode",sl="$sdk_debug_extensions_init_method",su="$sdk_debug_extensions_init_time_ms",sh="$sdk_debug_recording_script_not_loaded",sc="PostHog loadExternalDependency extension not found.",sd="anonymous",sp="identified",sv="identified_only",sf="visibilitychange",sg="beforeunload",s_="$pageview",sm="$pageleave",sy="$identify",sb="$groupidentify";function sw(e,t){q(e)&&e.forEach(t)}function sx(e,t){if(!K(e))if(q(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(var i in e)N.call(e,i)&&t(e[i],i)}var sk=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];for(var r of i)for(var n in r)void 0!==r[n]&&(e[n]=r[n]);return e};function sE(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var sS=function(e){try{return e()}catch(e){return}},sR=function(e){return function(){try{for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,i)}catch(e){il.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),il.critical(e)}}},sP=function(e){var t={};return sx(e,function(e,i){(U(e)&&e.length>0||J(e))&&(t[i]=e)}),t};function s$(e){var t=u({},e);for(var i of["name","message","stack","cause","errors"])try{i in e&&(t[i]=e[i])}catch(e){}return t}var sF=["herokuapp.com","vercel.app","netlify.app"];function sI(e,t,i,s){var r=null!=s?s:{},n=r.capture,a=r.passive;null==e||e.addEventListener(t,i,{capture:void 0!==n&&n,passive:void 0===a||a})}function sC(e){return"ph_toolbar_internal"===e.name}var sO=e=>{if(f){try{for(var t=e+"=",i=f.cookie.split(";").filter(e=>e.length),s=0;i.length>s;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}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return J(e)&&isFinite(e)&&Math.floor(e)===e});var sA=class e{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(t,i,s,r){if(!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||!Number.isInteger(r)||0>t||0>i||0>s||0>r||t>0xffffffffffff||i>4095||s>0x3fffffff||r>0xffffffff)throw RangeError("invalid field value");var n=new Uint8Array(16);return n[0]=t/0x10000000000,n[1]=t/0x100000000,n[2]=t/0x1000000,n[3]=t/65536,n[4]=t/256,n[5]=t,n[6]=112|i>>>8,n[7]=i,n[8]=128|s>>>24,n[9]=s>
vendor: 5,694 bytes, line 2
2>>16,n[10]=s>>>8,n[11]=s,n[12]=r>>>24,n[13]=r>>>16,n[14]=r>>>8,n[15]=r,new e(n)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new e(this.bytes.slice(0))}equals(e){return 0===this.compareTo(e)}compareTo(e){for(var t=0;16>t;t++){var i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}},sT=class{generate(){var e=this.generateOrAbort();if(!V(e))return e;this.Ct=0;var t=this.generateOrAbort();if(V(t))throw Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e,t=J(e=Date.now())&&isFinite(e)?Math.min(Math.max(Math.floor(e),0),0xffffffffffff):0;if(t>this.Ct)this.Ct=t,this.Mt();else{if(this.Ct>=t+1e4)return;this.Tt++,this.Tt>0x3ffffffffff&&(this.Ct++,this.Mt())}return sA.fromFieldsV7(this.Ct,Math.trunc(this.Tt/0x40000000),0x3fffffff&this.Tt,this.It.nextUint32())}Mt(){this.Tt=1024*this.It.nextUint32()+(1023&this.It.nextUint32())}constructor(){this.Ct=0,this.Tt=0,this.It=new sD}},sM=e=>{if("u">typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};d&&!V(d.crypto)&&crypto.getRandomValues&&(sM=e=>crypto.getRandomValues(e));var sL,sD=class{nextUint32(){return this.Rt.length>this.At||(sM(this.Rt),this.At=0),this.Rt[this.At++]}constructor(){this.Rt=new Uint32Array(8),this.At=1/0}},sN=()=>sj().toString(),sj=()=>(sL||(sL=new sT)).generate(),sq="",sB=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,sH=null,sz={Et(){if(!W(sH))return sH;if(sH=!1,f)try{var e="__ph_cookie_support_"+sN();sz.Ot(e,"xyz"),sH='"xyz"'===sO(e),sz.Dt(e)}catch(e){sH=!1}return sH},Pt(e){il.error("cookieStore error: "+e)},Lt:sO,Nt(e){var t;try{t=JSON.parse(sz.Lt(e))||{}}catch(e){}return t},Ot(e,t,i,s,r){if(!f)return!1;try{var n="",a="",o=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=f),sq)return sq;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+sN();!sq&&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",sq=n)}return sq}(e);if(!i){var s,r=(s=e.match(sB))?s[0]:"";r!==i&&il.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(f.location.hostname,s);if(i){var l=new Date;l.setTime(l.getTime()+864e5*i),n="; expires="+l.toUTCString()}r&&(a="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+o+a;return u.length>3686.4&&il.warn("cookieStore warning: large cookie, len="+u.length),f.cookie=u,!0}catch(e){return!1}},Dt(e,t){if(null!=f&&f.cookie)try{sz.Ot(e,"",-1,t)}catch(e){return}}},sV=null,sU={Et(){if(!W(sV))return sV;var e=!0;if(V(d))e=!1;else try{var t="__mplssupport__";sU.Ot(t,"xyz"),'"xyz"'!==sU.Lt(t)&&(e=!1),sU.Dt(t)}catch(t){e=!1}return e||il.error("localStorage unsupported; falling back to cookie store"),sV=e,e},Pt(e){il.error("localStorage error: "+e)},Lt(e){try{return null==d?void 0:d.localStorage.getItem(e)}catch(e){sU.Pt(e)}return null},Nt(e){try{return JSON.parse(sU.Lt(e))||{}}catch(e){}return null},Ot(e,t){try{return null==d||d.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sU.Pt(e)}return!1},Dt(e){try{null==d||d.localStorage.removeItem(e)}catch(e){sU.Pt(e)}}},sG=[iX,iH,iB,iV,iU,iG,i9,i4,i6],sW=[i_,ig,ij,iq,sn,sr,iw,i7],sK=["__proto__","constructor","prototype"],sJ=e=>{if(!H(e))return{};var t={};return Object.keys(e).forEach(i=>{-1===sK.indexOf(i)&&(t[i]=e[i])}),t},sX=function(e,t){void 0===t&&(t=[]);var i={};return[...sW,...t].forEach(t=>{var s=e[t];V(s)||W(s)||""===s||(i[t]=s)}),i},sY=e=>{for(var t=5381,i=0x811c9dc5,s=0;e.length>s;s++){var r=e.charCodeAt(s);t=33*t^r,i=Math.imul(i^r,0x1000193)}return e.length.toString(36)+"."+(t>>>0).toString(36)+"."+(i>>>0).toString(36)},sZ=(e,t)=>({p:t,f:sY(JSON.stringify(e))}),sQ=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{var i=sz.Nt(e+"_cpm"),s=(null==i?void 0:i.f)===sY(t)&&q(i.p);return{properties:s?i.p:[],isValid:s}}catch(e){return{properties:[],isValid:!1}}},s0=(e,t)=>t+"|"+(sz.Lt(e+"_cpm")||""),s1={},s2={Et:()=>!0,Pt(e){il.error("memoryStorage error: "+e)},Lt:e=>e in s1?s1[e]:null,Nt:e=>e in s1?s1[e]:null,Ot:(e,t)=>(s1[e]=t,!0),Dt(e){delete s1[e]}},s3=null,s5={Et(){if(!W(s3))return s3;if(s3=!0,V(d))s3=!1;else try{var e="__support__";s5.Ot(e,"xyz"),'"xyz"'!==s5.Lt(e)&&(s3=!1),s5.Dt(e)}catch(e){s3=!1}return s3},Pt(e){il.error("sessionStorage error: ",e)},Lt(e){try{return null==d?void 0:d.sessionStorage.getItem(e)}catch(e){s5.Pt(e)}return null},Nt(e){try{return JSON.parse(s5.Lt(e))||null}catch(e){}return null},Ot(e,t){try{return null==d||d.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){s5.Pt(e)}return!1},Dt(e){try{null==d||d.sessionStorage.removeItem(e)}catch(e){s5.Pt(e)}}},s6=class{constructor(e){this._instance=e}get Rn(){return this._instance.config}get consent(){return this.vo()?0:this.co}isOptedOut(){return"always"===this.Rn.cookieless_mode||this.isRejected()||-1===this.consent&&"on_reject"===this.Rn.cookieless_mode}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Rn.opt_out_capturing_by_default}optInOut(e){this.fo.Ot(this.po,+!!e,this.Rn.cookie_expiration,this.Rn.cross_subdomain_cookie,this.Rn.secure_cookie)}reset(){this.fo.Dt(this.po,this.Rn.cross_subdomain_cookie)}get po(){var e=this._instance.config,t=e.token,i=e.opt_out_capturing_cookie_prefix;
2return e.consent_persistence_name||(i?i+t:"__ph_opt_in_out_"+t)}get co(){var e=this.fo.Lt(this.po);return F(en,e)?1:F(ea,e)?0:-1}get fo(){var e=this.Rn.opt_out_capturing_persistence_type,t="localStorage"===e?sU:sz,i=t.Et()?t:s2;if(!this.mo||this.mo!==i){this.mo=i;var s="localStorage"===e?sz:sU;s.Lt(this.po)&&(this.mo.Lt(this.po)||this.optInOut(F(en,s.Lt(this.po))),s.Dt(this.po,this.Rn.cross_subdomain_cookie))}return this.mo}vo(){return!!this.Rn.respect_dnt&&[null==v?void 0:v.doNotTrack,null==v?void 0:v.msDoNotTrack,E.doNotTrack,null==v?void 0:v.globalPrivacyControl].some(e=>F(en,e))}};function s8(e,t){var i,s=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!B(s))return t;try{var r=s(t);return U(r)&&r?r:t}catch(e){return il.error("Error in get_current_url, falling back to window.location.href",e),t}}function s4(e){return e instanceof Element&&("__POSTHOG_TOOLBAR__"===e.id||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function s9(e){return!!e&&1===e.nodeType}function s7(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function re(e){return!!e&&3===e.nodeType}function rt(e){return!!e&&11===e.nodeType&&s9(e.host)}function ri(e){return e?I(e).split(/\s+/):[]}function rs(e,t){var i,s,r=V(s=null==d||null==(i=d.location)?void 0:i.href)?void 0:s8(t,s);return!!(r&&e&&e.some(e=>r.match(e)))}function rr(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 ri(t)}function rn(e){return K(e)?null:I(e).split(/(\s+)/).filter(e=>rF(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ra(e){var t="";return rw(e)&&!rx(e)&&e.childNodes&&e.childNodes.length&&sx(e.childNodes,function(e){var i;re(e)&&e.textContent&&(t+=null!=(i=rn(e.textContent))?i:"")}),I(t)}function ro(e){var t;return V(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var rl=["a","button","form","input","select","textarea","label"];function ru(e,t){var i=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!i&&i.call(e,t)}catch(e){return!1}}function rh(e,t){if(V(t))return!0;var i,s=function(e){if(t.some(t=>ru(e,t)))return{v:!0}};for(var r of e)if(i=s(r))return i.v;return!1}function rc(e){var t=e.parentNode;return!(!t||!s9(t))&&t}var rd=[".ph-no-autocapture","[data-ph-no-autocapture]"],rp=["next","previous","prev",">","<"],rv=[...rp,"+","-","â","â"],rf=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,rg=[".ph-no-rageclick",".ph-no-capture"],r_=["","text","search","email","password","url","tel","number"];function rm(e,t){if(!d||ry(e)||(Y(t)?(s=!!t&&rg,r=void 0,n=!1):(s=null!=(a=null==t?void 0:t.css_selector_ignorelist)?a:rg,r=null==t?void 0:t.content_ignorelist,n=null!=(o=null==t?void 0:t.ignore_text_selection)&&o),!1===s)||n&&!(!(i=e)||!s9(i))&&(s7(i,"textarea")||(s7(i,"input")?F(r_,(i.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(i))))return!1;var i,s,r,n,a,o,l=rb(e,!1).targetElementList;return!function(e,t){var i;if(!1===e||V(e))return!1;if(!0===e)i=rp;else{if(!q(e))return!1;if(e.length>10)return il.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 t=e.safeText,s=e.ariaLabel;return i.some(e=>rf(t,e)||rf(s,e))})}(r,l.map(e=>{var t;return{safeText:ra(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!rh(l,s)}var ry=e=>!e||s7(e,"html")||!s9(e),rb=(e,t)=>{if(!d||ry(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,s=[e],r=e;r.parentNode&&!s7(r,"body");)if(rt(r.parentNode))s.push(r.parentNode.host),r=r.parentNode.host;else{var n=rc(r);if(!n)break;if(t||rl.indexOf(n.tagName.toLowerCase())>-1)i=!0;else try{var a=d.getComputedStyle(n);a&&"pointer"===a.getPropertyValue("cursor")&&(i=!0)}catch(e){}s.push(n),r=n}return{parentIsUsefulElement:i,targetElementList:s}};function rw(e){for(var t=new Set,i=0,s=e;s.parentNode&&!s7(s,"body");s=s.parentNode){if(i++>=1e3||t.has(s))return!1;t.add(s);var r=rr(s);if(F(r,"ph-sensitive")||F(r,"ph-no-capture"))return!1}if(F(rr(e),"ph-include"))return!0;var n=e.type||"";if(U(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}
2var a=e.name||e.id||"";return!U(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function rx(e){return!!(s7(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||s7(e,"select")||s7(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var rk=RegExp("^(?:(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}))$"),rE=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,rS=[16,15,14,13],rR=RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),rP=RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),r$=/[0-9A-Za-z_]/;function rF(e,t){return void 0===t&&(t=!0),!(K(e)||U(e)&&(e=I(e),(t?rk.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(rE.lastIndex=0;t=rE.exec(e);){var i=t[2];if(i)for(var s=i.replace(/[- ]/g,""),r=0;s.length>r;r++)for(var n of rS){var a=r+n;if(s.length>=a){var o=s.slice(r,a);if(rk.test(o)&&function(e){for(var t=0,i=!1,s=e.length-1;s>=0;s--){var r=e.charCodeAt(s)-48;i&&(r*=2)>9&&(r-=9),t+=r,i=!i}return t%10==0}(o))return!0}}}return!1}(e))||(t?rR.test(e):function(e){var t;for(rP.lastIndex=0;t=rP.exec(e);){var i=t[1],s=t[3];if(!(i&&s&&r$.test(i)&&r$.test(s)))return!0}return!1}(e))))&&!0}function rI(e){var t=ra(e);return rF(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&sx(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=ra(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){il.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function rC(e){return e.replace(/"|\\"/g,'\\"')}var rO=iu("[Dead Clicks]"),rA=()=>!0,rT=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(iF)),s=e.instance.config.capture_dead_clicks;return Y(s)?s:!!H(s)||i},rM=class{get lazyLoadedDeadClicksAutocapture(){return this.yo}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[iF]:t.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.bo(()=>{this._o()}):this.stop()}bo(e){var t,i;null!=(t=E.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(i=E.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?rO.error("failed to load script",t):e()})}_o(){var e;if(f){if(!this.yo&&null!=(e=E.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=H(this.instance.config.capture_dead_clicks)?u({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.yo=E.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.yo.start(f),rO.info("starting...")}}else rO.error("`document` not found. Cannot start.")}stop(){this.yo&&(this.yo.stop(),this.yo=void 0,rO.info("stopping..."))}},rL=iu("[SegmentIntegration]");function rD(e,t,i){void 0===i&&(i=!0);var s=e.config.segment;if(!s)return t();!function(e,t,i){var s=e.config.segment;if(!s)return t();var r=s=>{var r=()=>s.anonymousId()||sN();e.config.get_device_id=r,i&&s.id()&&(e.register({distinct_id:s.id(),$device_id:r()}),e.persistence.set_property(i7,sp)),t(i?void 0:s.anonymousId()||void 0)},n=s.user();"then"in n&&B(n.then)?n.then(r):r(n)}(e,i=>{var r,n;s.register((r=i,"u">typeof Promise&&Promise.resolve||rL.warn("This browser does not have Promise support, and can not use the segment integration"),n=(t,i)=>{if(!i)return t;var s=!!r&&t.event.anonymousId===r&&!t.event.userId;s||t.event.userId||t.event.anonymousId===e.get_distinct_id()||(rL.info("No userId set, resetting PostHog"),e.reset()),s||(r=void 0),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(rL.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var n=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},n,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>n(e,e.event.event),page:e=>n(e,s_),identify:e=>n(e,sy),screen:e=>n(e,"$screen")})).then(()=>{t()},e=>{rL.error("Failed to register the Segment integration",e),t()})},i)}var rN="posthog-js";function rj(e,t){var i=void 0===t?{}:t,s=i.organization,r=i.projectId,n=i.prefix,a=i.severityAllowList,o=void 0===a?["error"]:a,l=i.sendExceptionsToPostHog,h=void 0===l||l;return t=>{if("*"!==o&&!o.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var i,a,l,c,d,p,v=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/pers
2on/"+e.get_distinct_id());t.tags["PostHog Person URL"]=v,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var f=(null==(i=t.exception)?void 0:i.values)||[],g=f.map(e=>u({},e,{stacktrace:e.stacktrace?u({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>u({},e,{platform:"web:javascript"}))}):void 0})),_={$exception_message:(null==(a=f[0])?void 0:a.value)||t.message,$exception_type:null==(l=f[0])?void 0:l.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=f[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(d=f[0])?void 0:d.type,$sentry_tags:t.tags};return s&&r&&(_.$sentry_url=(n||"https://sentry.io/organizations/")+s+"/issues/?project="+r+"&query="+t.event_id),h&&(null==(p=e.exceptions)||p.sendExceptionEvent(_)),t}}var rq=class{constructor(e,t,i,s,r,n){this.name=rN,this.setupOnce=function(a){a(rj(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}},rB=class{constructor(e){this.wo=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(il.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.ko=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.So()}So(){var e;this.xo=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.wo)}destroy(){var e;null==(e=this.xo)||e.call(this),this.xo=void 0}doPageView(e,t){var i,s=this.Co(e,t);return this.ko={pathname:null!=(i=null==d?void 0:d.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.Co(e,null==(t=this.ko)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.ko)?void 0:e.pageViewId}}Co(e,t){var i=this.ko;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 n=r.maxScrollHeight,a=r.lastScrollY,o=r.maxScrollY,l=r.maxContentHeight,u=r.lastContentY,h=r.maxContentY;if(!(V(n)||V(a)||V(o)||V(l)||V(u)||V(h))){n=Math.ceil(n),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var c=n>1?eo(a/n,0,1,il):1,d=n>1?eo(o/n,0,1,il):1,p=l>1?eo(u/l,0,1,il):1,v=l>1?eo(h/l,0,1,il):1;s=sk(s,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:o,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:v})}}return i.pathname&&(s.$prev_pageview_pathname=i.pathname),i.timestamp&&(s.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),s}},rH=["flags","surveys"],rz={$people_distinct_id:{exposure:"hidden"},[iy]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[ix]:{exposure:"hidden"},[iw]:{exposure:"hidden"},[ik]:{exposure:"event"},[iE]:{exposure:"hidden"},[iC]:{exposure:"hidden"},[iS]:{exposure:"event"},[iR]:{exposure:"hidden"},[iP]:{exposure:"event"},[i$]:{exposure:"event"},[iF]:{exposure:"event"},[iI]:{exposure:"hidden"},[iO]:{exposure:"event"},[iA]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[ij]:{exposure:"hidden"},[iq]:{exposure:"event"},[iT]:{exposure:"event",shouldSkipFromEventProperties:e=>W(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[iB]:{exposure:"hidden",storageGroup:"flags"},[iH]:{exposure:"hidden",storageGroup:"flags"},[iz]:{exposure:"hidden"},[iV]:{exposure:"hidden",storageGroup:"flags"},[iU]:{exposure:"hidden",storageGroup:"flags"},[iG]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iW]:{exposure:"hidden",storageGroup:"flags"},[iK]:{exposure:"hidden"},[iJ]:{exposure:"hidden"},[iX]:{exposure:"hidden"},[iY]:{exposure:"hidden"}
2,[iQ]:{exposure:"hidden",storageGroup:"surveys"},[i0]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[i1]:{exposure:"event"},[i2]:{exposure:"hidden"},[i3]:{exposure:"hidden"},[i5]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[i6]:{exposure:"hidden"},[i8]:{exposure:"hidden"},[iZ]:{exposure:"event"},[i4]:{exposure:"hidden"},[i9]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[i7]:{exposure:"hidden"},[se]:{exposure:"hidden"},[st]:{exposure:"hidden"},[si]:{exposure:"hidden"},[ss]:{exposure:"hidden"},[sr]:{exposure:"hidden"},[sn]:{exposure:"hidden"},[iM]:{exposure:"event"},[iL]:{exposure:"event"},[iD]:{exposure:"event"},[iN]:{exposure:"event"},[sl]:{exposure:"event"},[su]:{exposure:"event"},[sh]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"}
2,$sdk_debug_replay_pending_trigger_conditions:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},rV=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],rU=e=>{var t=rz[e];if(t)return t;for(var i of rV){var s=i[1];if(0===e.indexOf(i[0]))return s}},rG=(e,t)=>{try{var i;return JSON.stringify(e,(e,t)=>ei(t)?(null!=i||(i=new WeakMap),i.has(t)||i.set(t,s$(t)),i.get(t)):"bigint"==typeof t?t.toString():t,t)}catch(t){return O(e)}},rW=e=>{var t=null==f?void 0:f.createElement("a");return V(t)?null:(t.href=e,t)},rK=function(e,t){for(var i,s=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;s.length>r;r++){var n=s[r].split("=");if(n[0]===t){i=n;break}}if(!q(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(e){il.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},rJ=function(e,t,i){if(!e||!t||!t.length)return e;for(var s=e.split("#"),r=s[1],n=(s[0]||"").split("?"),a=n[1],o=n[0],l=(a||"").split("&"),u=[],h=0;l.length>h;h++){var c=l[h].split("=");q(c)&&(t.includes(c[0])?u.push(c[0]+"="+i):u.push(l[h]))}var d=o;return null!=a&&(d+="?"+u.join("&")),null!=r&&(d+="#"+r),d},rX=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},rY=(e,t)=>e>=t&&x(),rZ=(e,t,i,s)=>{if(0===e){if(x()){var r=t+1;return r===i&&s(),r}return t}return 0},rQ=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],r0=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...rQ],r1="<masked>",r2=["li_fat_id"];function r3(e,t,i){if(!f)return{};var s,r=t?[...rQ,...i||[]]:[],n=r5(rJ(f.URL,r,r1),e);return sk((s={},sx(r2,function(e){var t=sO(e);s[e]=t||null}),s),n)}function r5(e,t){var i=r0.concat(t||[]),s={};return sx(i,function(t){var i=rK(e,t);s[t]=i||null}),s}function r6(e){var t=e?0===e.search("https?://(.*)google.([^/?]*)")?"google":0===e.search("https?://(.*)bing.com")?"bing":0===e.search("https?://(.*)yahoo.com")?"yahoo":0===e.search("https?://(.*)duckduckgo.com")?"duckduckgo":null:null,i={};if(!W(t)){i.$search_engine=t;var s=f?rK(f.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function r8(){return navigator.language||navigator.userLanguage}var r4="$direct";function r9(){return(null==f?void 0:f.referrer)||r4}function r7(e,t,i){void 0===i&&(i=!1);var s,r=e?[...rQ,...t||[]]:[],n=null==(s=i?td(null==g?void 0:g.href):null==g?void 0:g.href)?void 0:s.substring(0,1e3);return{r:r9().substring(0,1e3),u:n?rJ(n,r,r1):void 0}}function ne(e,t){void 0===t&&(t=!1);var i,s=e.r,r=e.u,n=t?td(r):r,a={$referrer:s,$referring_domain:null==s?void 0:s==r4?r4:null==(i=rW(s))?void 0:i.host};
vendor: 7,333 bytes, line 2
2if(n){a.$current_url=n;var o=rW(n);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname,sk(a,r5(n))}return s&&sk(a,r6(s)),a}function nt(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var ni={flags:i9,surveys:i0},ns=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],nr=e=>{var t="",i=0;for(var s of e){var r=encodeURIComponent(JSON.stringify(s).slice(1,-1)).length;if(i+r>1e3)break;t+=s,i+=r}return t},nn="main",na=[iB,iH,iV,iU,iG,i9,iW,iX],no=e=>-1!==na.indexOf(e),nl=(e,t)=>{try{return JSON.stringify(e)===JSON.stringify(t)}catch(i){return e===t}},nu=e=>{if(!e)return{};var t=JSON.parse(e);return H(t)?t:{}},nh=(e,t)=>{sx(e,(i,s)=>{var r=rU(s);r&&"event"!==r.exposure||({}).hasOwnProperty.call(t,s)||delete e[s]})},nc=class{constructor(e,t,i){if(void 0===i&&(i=!0),this.To={},this.Mo=!1,this.Io=!1,this.Eo=!1,this.Ro=!1,this.Ao=!1,this.Po=new Map,this.Fo=!1,this.Oo=!1,this.$o=!1,this.Do=!1,this.Lo=new Set,this.Rn=e,this.No=i,this.props={},this.qo=void 0,this.jo=(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.fo=this.Bo(e),this.Eo=this.Ho(e),this.load(),this.zo(),e.debug&&il.info("Persistence loaded",e.persistence,u({},this.props)),this.update_config(e,e,t),this.save(),d){var s=()=>this.flush();sI(d,"beforeunload",s,{capture:!1}),sI(d,"pagehide",s,{capture:!1}),this.Uo=e=>{if(this.Mo&&(!e.storageArea||e.storageArea===(null==d?void 0:d.localStorage))&&e.key)if(e.key!==this.jo){if(this.Eo){var t=rH.find(t=>e.key===this.Wo(t));t&&this.Vo(e.key,t)}}else this.Vo(e.key,nn)},sI(d,"storage",this.Uo)}}markCrossTabFeatureFlagChanges(e){Object.entries(e).forEach(e=>{var t=e[0],i=e[1],s=this.Po.get(t);if(no(t)&&!0!==s)if(!0!==i){var r=new Set(s||[]);i.forEach(e=>r.add(e)),r.size&&this.Go(t,r)}else this.Go(t,!0)})}onCrossTabFeatureFlagChange(e){return this.Lo.add(e),()=>this.Lo.delete(e)}destroy(){this.Uo&&d&&(d.removeEventListener("storage",this.Uo),this.Uo=void 0),this.Lo.clear()}Vo(e,t,i){if(void 0===i&&(i=!0),this.gi)return!1;try{if(r=sU.Lt(e),W(r)){var s,r,n=this.Zo(t);return n.storageValue=null,t!==nn&&(n.persisted=!1),!1}s=nu(r)}catch(e){return!1}var a=t===nn?s:sU.Nt(this.jo);if(a&&this.Jo(a))return!1;var o=this.Qo(s,t,i);return t===nn&&this.Eo&&!nl(this.Ko().main,s)||this.Xo(s,t,!0,r),o}Jo(e){var t=this.props[ig],i=e[ig];return!V(t)&&!V(i)&&t!==i}Xo(e,t,i,s){var r=this.Zo(t);r.storageValue=s,t!==nn&&(r.persisted=i);try{r.fingerprint=this.Yo(e,t)}catch(e){r.fingerprint=void 0}}Qo(e,t,i){var s=!1;return na.forEach(i=>{var r,n=null==(r=rU(i))?void 0:r.storageGroup;if(!(t===nn&&this.Eo&&n||t!==nn&&n!==t)){var a=i in e,o=this.ta(i,a?e[i]:void 0),l=this.Po.has(i)?i in this.props:a;l===i in this.props&&nl(o,this.props[i])||(l?this.ea(i,o,!1):this.ia(i,!1),s=!0)}}),s&&i&&this.Lo.forEach(e=>e()),s}ra(){if(!this.Mo)return!1;try{this.$o=!1;var e,t=sU.Lt(this.jo),i=this.Zo(nn),s=!1,r=!1;if(t!==i.storageValue)if(W(t))i.storageValue=null;else{if(e=nu(t),this.$o=!this.Oo&&this.Jo(e),this.$o)return!1;r=this.Qo(e,nn,!1),!this.Eo||nl(this.Ko().main,e)?this.Xo(e,nn,!0,t):i.storageValue=t,s=!0}return this.Eo&&rH.forEach(t=>{var i=sU.Lt(this.Wo(t)),n=this.Zo(t),a=e||{},o=s&&na.some(e=>{var i;return(null==(i=rU(e))?void 0:i.storageGroup)===t&&e in a});if(i!==n.storageValue||o){if(W(i))return n.storageValue=null,n.persisted=!1,void(o&&(r=this.Qo(a,t,!1)||r));var l=nu(i);r=this.Qo(l,t,!1)||r,this.Xo(l,t,!0,i)}}),r}catch(e){return!1}}Go(e,t){this.Po.set(e,t);var i=rU(e);null!=i&&i.volatile||(this.Zo((this.Eo?null==i?void 0:i.storageGroup:void 0)||nn).fingerprint=void 0,this.na(e))}sa(){na.forEach(e=>this.Po.set(e,!0))}zo(){if(this.Mo)try{var e=sU.Lt(this.jo),t=nu(e);this.Zo(nn).storageValue=e,na.forEach(e=>{var i,s=this.Eo?null==(i=rU(e))?void 0:i.storageGroup:void 0,r=s?sU.Lt(this.Wo(s)):null;if(s){var n=this.Zo(s);n.storageValue=r,n.persisted=!W(r)}var a=s&&!W(r)?nu(r):t;e in this.props?this.oa(e,a[e],this.props[e]):e in a&&this.Go(e,!0)})}catch(e){}}ta(e,t){var i=this.Po.get(e);if(!i)return t;if(!0===i)return this.props[e];if("$active_feature_flags"===e){var s=new Set(q(t)?t:[]),r=new Set(q(this.props[e])?this.props[e]:[]);return i.forEach(e=>r.has(e)?s.add(e):s.delete(e)),Array.from(s)}var n=H(t)?u({},t):{},a=H(this.props[e])?this.props[e]:{};return i.forEach(e=>{e in a?n[e]=a[e]:delete n[e]}),n}oa(e,t,i){if(no(e)){var s=this.Po.get(e);if(!0!==s){var r=t;if(this.Mo)try{var n,a=this.Eo?null==(n=rU(e))?void 0:n.storageGroup:void 0,o=a?this.Wo(a):this.jo;r=nu(sU.Lt(o))[e]}catch(e){}var l=new Set(s||[]);if("$active_feature_flags"===e){if(!V(t)&&!q(t)||!V(r)&&!q(r)||!q(i))return void this.Go(e,!0);var u=new Set(t||[]),h=new Set(r||[]),c=new Set(i);new Set([...u,...c]).forEach(e=>{u.has(e)!==c.has(e)&&l.add(e)}),l.forEach(e=>{h.has(e)===c.has(e)&&l.delete(e)})}else{if(!H(i))return void(nl(r,i)?this.Po.delete(e):this.Go(e,!0));if(!V(t)&&!H(t)||V(t)&&z(i)&&V(r))return void this.Go(e,!0);var d=H(t)?t:{},p=H(r)?r:{};new Set([...Object.keys(d),...Object.keys(i)]).forEach(e=>{e in d==e in i&&nl(d[e],i[e])||l.add(e)}),l.forEach(e=>{e in p==e in i&&nl(p[e],i[e])&&l.delete(e)})}l.size?this.Go(e,l):this.Po.delete(e)}}}aa(){var e,t=null==(e=this.Rn)?void 0:e.persistence_save_debounce_ms;return J(t)&&t>0?t:0}la(e){if(this.Rn.cookieWinsOnConflict&&"localstorage+cookie"===this.Rn.persistence.toLowerCase())if(e)try{var t=sX(e,this.Rn.cookie_persisted_properties||[]),i=sZ(t,this.Rn.cookie_persisted_properties||[]),s=JSON.stringify(t)+"|"+JSON.stringify(i),r=sz.Lt(this.jo)||void 0;r&&s0(this.jo,r)===s&&(this.ua=s,this.ha=r)}catch(e){}else try{var n=sz.Lt(this.jo)||void 0;this.ua=n?s0(this.jo,n):void 0,this.ha=n}catch(e){}}syncCookieProperties(){return this.da(this.Rn)}da(e,t){if(void 0===t&&(t=!1),this.gi&&!t||this.Ao||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{i=sz.Lt(this.jo)||void 0}catch(e){}if(!i||i===this.ha)return!1;var i,s,r=s0(this.jo,i);try{s=sJ(JSON.parse(i))}catch(e){return!1}if((sz.Lt(this.jo)||void 0)!==i)return!1;this.ua=r,this.ha=i;var n=sQ(this.jo,i),a=[...sW,...n.properties],o={};if(Object.keys(s).forEach(e=>{var t=s[e];(V(t)||W(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t)&&(o[e]=!0,delete s[e])}),z(s))return!1;var l="distinct_id"in s||"anonymous"===s.$user_state||"identified"===s.$user_state,u=this.props,h=u[ig],c=u[i7],d=sk({},u);[...sW,...e.cookie_persisted_properties||[]].forEach(e=>{if(-1!==a.indexOf(e)&&!(e in s)&&!o[e]&&(l||"distinct_id"!==e&&"$user_state"!==e)){var t=d[e];(n.isValid||-1===sW.indexOf(e)||!1!==t&&0!==t)&&delete d[e]}}),this.props=sk(d,s),na.forEach(e=>{var t=e in this.props;e in u===t&&nl(u[e],this.props[e])||(t?this.oa(e,u[e],this.props[e]):this.Go(e,!0))}),!l||"$user_state"in s||"$user_state"in this.props||this.ea(i7,sd);var p=this.props[ig],v=this.props[i7];return l&&(p!==h||v!==c)&&(this.Oo=!0,this.Ro=!0,s5.Ot(this.jo+"_cookie_identity_change_pending",!0),this.ia(iX),this.ia(iH),this.ia(iB),this.ia(iV),this.ia(iU),this.ia(iG),this.ia(i9),this.ia(i4),this.ia(i6),"anonymous"!==v||"identified"!==c&&"anonymous"!==s.$user_state&&(V(h)||p===h)||(nh(this.props,s),this.ia(iY)),"identified"===v?this.props.$user_id=p:delete this.props.$user_id,this.ia(iy)),!0}
2consumeCookieIdentityChange(){var e=this.jo+"_cookie_identity_change_pending",t=this.Ro||!!s5.Lt(e);return this.Ro=!1,t&&s5.Dt(e),t}va(e){return void 0===e&&(e=!1),!(this.Ao||this.gi&&!e||!this.Rn.cookieWinsOnConflict||"localstorage+cookie"!==this.Rn.persistence.toLowerCase()||(this.Ao=!0,0))}ca(){this.Ao&&(V(this.fa)||(clearTimeout(this.fa),this.fa=void 0),delete this.To[nn],this.pa(!0))}ga(e){if(void 0===e&&(e=!0),this.Ao)try{e?this.ca():V(this.fa)||(clearTimeout(this.fa),this.fa=void 0)}finally{this.Ao=!1}}isDisabled(){return!!this.gi}Bo(e){-1===ns.indexOf(e.persistence.toLowerCase())&&(il.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i,s,r,n=(t=e.cookie_persisted_properties||[],i=e.cookieWinsOnConflict,void 0===t&&(t=[]),void 0===i&&(i=!1),s=[...sW,...t],u({},sU,{Nt(e){try{var t,r={};try{r=(t=sz.Lt(e)||void 0)?sJ(JSON.parse(t)):{}}catch(e){}var n,a=JSON.parse(sU.Lt(e)||"{}");if(i){var o=sQ(e,t),l=[...sW,...o.properties],u={};Object.keys(r).forEach(e=>{var t=r[e];W(t)||""===t||"$user_state"===e&&"anonymous"!==t&&"identified"!==t||(u[e]=t)});var h="distinct_id"in u||"anonymous"===u.$user_state||"identified"===u.$user_state;if(Object.keys(u).length>0){var c,d=a[ig],p=null!=(c=a.$user_state)?c:"anonymous";s.forEach(e=>{if(-1!==l.indexOf(e)&&!(e in r)&&(h||"distinct_id"!==e&&"$user_state"!==e)){var t=a[e];(o.isValid||-1===sW.indexOf(e)||!1!==t&&0!==t)&&delete a[e]}}),!h||"$user_state"in r||"$user_state"in a||(a[i7]=sd),h&&(("distinct_id"in u?u[ig]:a[ig])!==d||("$user_state"in u?u[i7]:a[i7])!==p)&&(sG.forEach(e=>delete a[e]),"identified"===u.$user_state&&"distinct_id"in u?a.$user_id=u[ig]:delete a.$user_id,"identified"!==u.$user_state&&(delete a[iZ],delete a[iY]),delete a.__alias)}n=sk(a,u)}else n=sk(r,a);return sU.Ot(e,n),n}catch(e){}return null},Ot(e,s,r,n,a,o){var l=sU.Ot(e,s,void 0,void 0,o);try{var u=sX(s,t);if(Object.keys(u).length){if(i){var h=e+"_cpm",c=sZ(u,t);if(sz.Ot(h,c,r,n,a,o),sz.Lt(h)!==JSON.stringify(c)){sz.Dt(h,n);var d=sX(s);return sz.Ot(e,d,r,n,a,o),l}}sz.Ot(e,u,r,n,a,o)}}catch(e){sU.Pt(e)}return l},Dt(e,t){try{null==d||d.localStorage.removeItem(e),sz.Dt(e,t),sz.Dt(e+"_cpm",t)}catch(e){sU.Pt(e)}}})),a=!1,o=!1,l=e.persistence.toLowerCase();return"localstorage"===l&&sU.Et()?(r=sU,o=!0):"localstorage+cookie"===l&&n.Et()?(r=n,o=!0,a=!0):"sessionstorage"===l&&s5.Et()?r=s5:"memory"===l?r=s2:"cookie"===l&&sz.Et()?(r=sz,a=!0):n.Et()?(r=n,o=!0,a=!0):sz.Et()?(r=sz,a=!0):r=s2,this.Mo=o,this.Io=a,r}Wo(e){return this.jo+"__"+e}Ho(e){return this.Mo&&!!e.split_storage}properties(){var e={};return sx(this.props,(t,i)=>{var s=rU(i);if(!s||"event"===s.exposure){if(null!=s&&null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t))return;e[i]=t}}),e}load(e){if(void 0===e&&(e=!1),!this.gi||e){var t=this.Rn.cookieWinsOnConflict&&"localstorage+cookie"===this.Rn.persistence.toLowerCase(),i=t?sU.Nt(this.jo):null,s={};if(t)try{sx(s=sJ(sz.Nt(this.jo)),(e,t)=>{(V(e)||W(e)||""===e)&&delete s[t]})}catch(e){}var r=this.fo.Nt(this.jo);if(r&&(this.props=sk({},r)),this.Eo&&this.ma(),t&&r){var n,a,o=null==i?void 0:i[ig],l=null!=(n=null==i?void 0:i.$user_state)?n:"anonymous",u=r[ig],h=null!=(a=r.$user_state)?a:"anonymous";if(u!==o||h!==l){this.Ro=!0,s5.Ot(this.jo+"_cookie_identity_change_pending",!0);var c=sk({},this.props);sG.forEach(e=>delete c[e]),"anonymous"!==h||"identified"!==l&&"anonymous"!==s.$user_state&&(V(o)||u===o)||(nh(c,s),delete c[iY]),this.props=c;var d=new Set;sG.forEach(e=>{var t,i=null==(t=rU(e))?void 0:t.storageGroup;i&&d.add(i)}),d.forEach(e=>{var t={};sx(this.props,(i,s)=>{var r;(null==(r=rU(s))?void 0:r.storageGroup)===e&&(t[s]=i)}),z(t)?(sU.Dt(this.Wo(e)),this.To[e]={}):sU.Ot(this.Wo(e),t)&&(this.To[e]={persisted:!0,fingerprint:this.Yo(t,e)})})}}s5.Lt(this.jo+"_cookie_identity_change_pending")&&(this.Ro=!0)}}ma(){for(var e of rH){var t=sU.Nt(this.Wo(e));if(t&&!z(t)){var i=this.Zo(e);i.persisted=!0,this.ya(e)||(i.fingerprint=this.Yo(t,e)),this.ba(e,t)||sk(this.props,t)}}}ya(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=rU(t))?void 0:i.storageGroup)===e})}ba(e,t){var i=ni[e];if(!i)return!1;var s=t[i],r=this.props[i];return J(s)&&J(r)&&r>s}refreshKey(e){var t;if(!(this.gi||"$fbc_persistence"===e&&this.Do)){var i=this.Eo?null==(t=rU(e))?void 0:t.storageGroup:void 0,s=i?sU.Nt(this.Wo(i)):this.fo.Nt(this.jo);if(s&&e in s)this.ea(e,s[e],!1);else{if(i){var r=this.fo.Nt(this.jo);if(r&&e in r)return void this.ea(e,r[e],!1)}this.ia(e,!1)}}}save(){if(!this.gi){var e=this.aa();e>0?V(this.fa)&&(this.fa=setTimeout(()=>{this.fa=void 0,this.pa()},e)):this.pa()}}flush(){V(this.fa)||(clearTimeout(this.fa),this.fa=void 0,this.pa())}pa(e){if(void 0===e&&(e=!1),!(this.gi||this.Ao&&!e)){e||(this.syncCookieProperties(),this.Do||this.Rn.cookieWinsOnConflict&&"localstorage+cookie"===this.Rn.persistence.toLowerCase()||this.refreshKey(iw));var t=!e&&!this.Fo;t||(this.$o=!1);var i=!!t&&this.ra();if(this.$o)this.Rn.debug&&il.warn("skipping persistence write because storage belongs to a different distinct ID");
vendor: 17,305 bytes, line 2
2else{if(this.Eo)return this._a(),void(i&&this.Lo.forEach(e=>e()));var s=this.wa(this.fo,this.jo,this.props,nn);"written"===s&&this.la(this.props),"failed"!==s&&(this.Po.clear(),this.Oo=!1,this.Do=!1),i&&this.Lo.forEach(e=>e())}}}_a(){var e=this,t=this.Ko(),i=t.main,s=t.groups,r=this.wa(this.fo,this.jo,i,nn);"written"===r&&this.la(i),"failed"!==r&&(this.Oo=!1,this.Do=!1,na.forEach(e=>{var t;null!=(t=rU(e))&&t.storageGroup||this.Po.delete(e)}));var n=function(t){var i,r=s[t];if(z(r)&&(null==(i=e.To[t])||!i.persisted))return na.forEach(i=>{var s;(null==(s=rU(i))?void 0:s.storageGroup)===t&&e.Po.delete(i)}),1;var n=e.wa(sU,e.Wo(t),r,t);"failed"!==n&&na.forEach(i=>{var s=rU(i);(null==s?void 0:s.storageGroup)!==t||"written"!==n&&s.volatile||e.Po.delete(i)})};for(var a of rH)if(n(a))continue}Ko(){var e={},t={flags:{},surveys:{}};return sx(this.props,(i,s)=>{var r,n=null==(r=rU(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i}),{main:e,groups:t}}Yo(e,t){if(t===nn)return JSON.stringify(e)+"|"+this.ka+"|"+this.Sa+"|"+this.xa;var i={};return sx(e,(e,t)=>{var s;i[t]=null!=(s=rU(t))&&s.volatile?"__volatile__":e}),JSON.stringify(i)}wa(e,t,i,s){var r,n=this.Zo(s);if(s!==nn&&!n.dirty&&!V(n.fingerprint))return"skipped";try{if((r=this.Yo(i,s))===n.fingerprint)return n.dirty=!1,"skipped"}catch(e){r=void 0}return e.Ot(t,i,this.ka,this.Sa,this.xa,this.Rn.debug)?(n.dirty=!1,s!==nn&&(n.persisted=!0),V(r)||(n.fingerprint=r),this.Mo&&(n.storageValue=sU.Lt(t)),"written"):(this.Rn.debug&&il.warn('failed to persist storage entry "'+t+'"; will retry on next save'),"failed")}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,i=void 0!==t&&t;if(this.sa(),V(this.fa)||(clearTimeout(this.fa),this.fa=void 0),this.fo.Dt(this.jo,!1),this.fo.Dt(this.jo,!0),!i&&this.No)for(var s of rH)sU.Dt(this.Wo(s));i?delete this.To[nn]:this.To={},this.ua=void 0,this.ha=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(H(e)){this.syncCookieProperties(),V(t)&&(t="None"),this.ka=V(i)?this.Ca:i;var s=!1;if(sx(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.ea(i,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(H(e)){this.syncCookieProperties(),this.ka=V(t)?this.Ca:t;var i=!1;if(sx(e,(t,s)=>{e.hasOwnProperty(s)&&(this.props[s]!==t||H(t)||q(t))&&(this.ea(s,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){this.syncCookieProperties();var t=!1;for(var i of"string"==typeof e?[e]:e)i in this.props&&(this.ia(i),t=!0);t&&this.save()}update_campaign_params(){var e=null==f?void 0:f.URL;if(e!==this.qo){var t=r3(this.Rn.custom_campaign_params,this.Rn.mask_personal_data_properties,this.Rn.custom_personal_data_properties),i=!z(sP(t));return i&&this.register(t),this.qo=e,i?t:void 0}}update_search_keyword(){var e;this.register((e=null==f?void 0:f.referrer)?r6(e):{})}update_referrer_info(){var e;this.register_once({$referrer:r9(),$referring_domain:null!=f&&f.referrer&&(null==(e=rW(f.referrer))?void 0:e.host)||r4},void 0)}set_initial_person_info(){if(!this.props.$initial_campaign_params&&!this.props.$initial_referrer_info){var e=r7(this.Rn.mask_personal_data_properties,this.Rn.custom_personal_data_properties,this.Rn.disable_capture_url_hashes);this.register_once({[sr]:this.Io?{r:nr(e.r),u:e.u?nr(e.u):void 0}:e},void 0)}}get_initial_props(){var e,t,i,s={};sx([ss,si],e=>{var t=this.props[e];t&&sx(t,function(e,t){s["$initial_"+C(t)]=e})});var r=this.props[sr];return r&&sk(s,(void 0===(e=this.Rn.disable_capture_url_hashes)&&(e=!1),t=ne(r,e),i={},sx(t,function(e,t){i["$initial_"+C(t)]=e}),i)),s}safe_merge(e){return sx(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){var s=e.persistence!==t.persistence,r=!((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||[]),n=s||r,a=e.cookieWinsOnConflict!==t.cookieWinsOnConflict,o=e.disable_persistence||!!i,l=!!this.gi&&!o;o||this.da(t,l),this.Rn=e,!o&&(s||r||a)&&(this.ua=void 0,this.ha=void 0,this.da(u({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),l));var h=n||a?this.Bo(e):this.fo;this.Ta();var c=this.Ho(e),d=n||c!==this.Eo,p=!o&&(d||e.cross_subdomain_cookie!==this.Sa||e.secure_cookie!==this.xa)&&this.va(l);this.Fo=d;try{if(this.Ca=this.ka=e.cookie_expiration,this.set_disabled(o),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),d){var v=this.props;this.clear(),this.fo=h,this.Eo=c,this.props=v,this.save()}else a&&(this.fo=h,o||(delete this.To[nn],this.pa()))}finally{this.Fo=!1,p&&this.ga()}}Ta(){var e=this.props[sr];if(this.Io&&H(e)&&"string"==typeof e.r){var t=nr(e.r),i="string"==typeof e.u?nr(e.u):e.u;t===e.r&&i===e.u||this.ea(sr,u({},e,{r:t,u:i}))}}set_disabled(e){this.gi=e,this.gi?this.remove():this.save()}set_cross_subdomain(e){e!==this.Sa&&(this.Sa=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.xa&&(this.xa=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props.__timers||{};i[e]=t,this.ea(ix,i),this.save()}remove_event_timer(e){var t=this.props.__timers||{},i=t[e];return V(i)||(delete t[e],this.ea(ix,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.ea(e,t),this.save()}ea(e,t,i){void 0===i&&(i=!0);var s,r=this.props[e];this.props[e]=t,i&&("distinct_id"!==e&&"$user_state"!==e||r===t||(this.Oo=!0),"$fbc_persistence"!==e||nl(r,t)||(this.Do=!0),this.oa(e,r,t),null!=(s=rU(e))&&s.volatile||this.na(e))}ia(e,t){void 0===t&&(t=!0),delete this.props[e],t&&(no(e)&&this.Go(e,!0),"$fbc_persistence"===e&&(this.Do=!0),this.na(e))}na(e){var t,i=null==(t=rU(e))?void 0:t.storageGroup;i&&(this.Zo(i).dirty=!0)}Zo(e){return this.To[e]||(this.To[e]={})}},nd="gzip-js",np="base64",nv="events",nf="cancelEvents",ng="survey shown",n_="survey dismissed",nm="survey sent",ny="popover";function nb(e){var t=!0;return{dispose(){if(t){t=!1;var i=e();i&&B(i.then)&&i.then(void 0,()=>{})}}}}var nw=iu("[RateLimiter]"),nx=class{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=e=>{var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(e=>{nw.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void nw.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,r=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,a=(new Date).getTime(),o=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property("$capture_rate_limit"))?t:{tokens:r,last:a};o.tokens+=(a-o.last)/1e3*n,o.last=a,o.tokens>r&&(o.tokens=r);var l=1>o.tokens;if(l||e||(o.tokens=Math.max(0,o.tokens-1)),l&&!e){var u=(J(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.Ma(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(st,o),{isRateLimited:l,remainingTokens:o.tokens}}Ia(e){var t=this.instance.config.property_denylist;return!q(t)||!t.includes(e)}Ea(){var e;if(this.Ia("$current_url")&&this.Ia("$pathname")&&null!=g&&g.pathname)return""+(null!=(e=g.origin)?e:"")+g.pathname}Ma(e){var t,i,s=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,n=this.Ea(),a=this.Ia("$session_id")?null==(t=(i=this.instance).get_session_id)?void 0:t.call(i):void 0,o=[e+" event(s) dropped since the last warning",n?"triggered on "+n:void 0,a?"session "+a:void 0].filter(Boolean).join(", ");return!!this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited: "+o+". Config is set to "+r+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0})}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}},nk=iu("[RemoteConfig]"),nE=class{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=E._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Ra(e){var t,i;null!=(t=E.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=E.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Aa(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:e})}load(){try{if(this.remoteConfig)return nk.info("Using preloaded remote config",this.remoteConfig),void this.Pa(this.remoteConfig);if(this._instance.Fa())return void nk.warn("Remote config is disabled. Falling back to local config.");this.Ra(e=>{e?this.Pa(e):(nk.info("No config found after loading remote JS config. Falling back to JSON."),this.Aa(e=>{this.Pa(e.json,e)}))})}catch(e){nk.error("Error loading remote config",e),this.Pa()}}Pa(e,t){!e&&t&&(0===t.statusCode?t.error||nk.warn("Failed to fetch remote config from PostHog."):nk.error("Failed to fetch remote config from PostHog."));try{this._instance.Pa(e?{ok:!0,config:e}:{ok:!1})}catch(e){nk.error("Error applying remote config",e)}if(!1!==(null==e?void 0:e.hasFeatureFlags)&&!this._instance.config.advanced_disable_feature_flags_on_first_load)try{var i;null==(i=this._instance.featureFlags)||i.ensureFlagsLoaded()}catch(e){nk.error("Error loading feature flags",e)}}},nS=Uint8Array,nR=Uint16Array,nP=Uint32Array,n$=new nS([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]),nF=new nS([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]),nI=new nS([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nC=function(e,t){for(var i=new nR(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new nP(i[30]);for(s=1;30>s;++s)for(var n=i[s];i[s+1]>n;++n)r[n]=n-i[s]<<5|s;return[i,r]},nO=nC(n$,2),nA=nO[1];nO[0][28]=258,nA[258]=28;for(var nT=nC(nF,0)[1],nM=new nR(32768),nL=0;32768>nL;++nL){var nD=(43690&nL)>>>1|(21845&nL)<<1;nM[nL]=((65280&(nD=(61680&(nD=(52428&nD)>>>2|(13107&nD)<<2))>>>4|(3855&nD)<<4))>>>8|(255&nD)<<8)>>>1}var nN=function(e,t,i){for(var s=e.length,r=0,n=new nR(t);s>r;++r)++n[e[r]-1];var a,o=new nR(t);for(r=0;t>r;++r)o[r]=o[r-1]+n[r-1]<<1;if(i){a=new nR(1<<t);var l=15-t;for(r=0;s>r;++r)if(e[r])for(var u=r<<4|e[r],h=t-e[r],c=o[e[r]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)a[nM[c]>>>l]=u}else for(a=new nR(s),r=0;s>r;++r)a[r]=nM[o[e[r]-1]++]>>>15-e[r];return a},nj=new nS(288);for(nL=0;144>nL;++nL)nj[nL]=8;for(nL=144;256>nL;++nL)nj[nL]=9;for(nL=256;280>nL;++nL)nj[nL]=7;for(nL=280;288>nL;++nL)nj[nL]=8;var nq=new nS(32);for(nL=0;32>nL;++nL)nq[nL]=5;var nB=nN(nj,9,0),nH=nN(nq,5,0),nz=function(e){return(e/8|0)+(7&e&&1)},nV=function(e,t,i){(null==t||0>t)&&(t=0),(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof nR?nR:e instanceof nP?nP:nS)(i-t);return s.set(e.subarray(t,i)),s},nU=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},nG=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},nW=function(e,t){for(var i=[],s=0;e.length>s;++s)e[s]&&i.push({s:s,f:e[s]});var r=i.length,n=i.slice();if(!r)return[new nS(0),0];if(1==r){var a=new nS(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],u=0,h=1,c=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=r-1;)o=i[i[c].f>i[u].f?u++:c++],l=i[u!=h&&i[c].f>i[u].f?u++:c++],i[h++]={s:-1,f:o.f+l.f,l:o,r:l};var d=n[0].s;for(s=1;r>s;++s)n[s].s>d&&(d=n[s].s);var p=new nR(d+1),v=nK(i[h-1],p,0);if(v>t){s=0;var f=0,g=v-t,_=1<<g;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});r>s;++s){var m=n[s].s;if(t>=p[m])break;f+=_-(1<<v-p[m]),p[m]=t}for(f>>>=g;f>0;){var y=n[s].s;t>p[y]?f-=1<<t-p[y]++-1:++s}for(;s>=0&&f;--s){var b=n[s].s;p[b]==t&&(--p[b],++f)}v=t}return[new nS(p),v]},nK=function(e,t,i){return -1==e.s?Math.max(nK(e.l,t,i+1),nK(e.r,t,i+1)):t[e.s]=i},nJ=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new nR(++t),s=0,r=e[0],n=1,a=function(e){i[s++]=e},o=1;t>=o;++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]},nX=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},nY=function(e,t,i){var s=i.length,r=nz(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;s>n;++n)e[r+n+4]=i[n];return 8*(r+4+s)},nZ=function(e,t,i,s,r,n,a,o,l,u,h){nU(t,h++,i),++r[256];for(var c=nW(r,15),d=c[0],p=c[1],v=nW(n,15),f=v[0],g=v[1],_=nJ(d),m=_[0],y=_[1],b=nJ(f),w=b[0],x=b[1],k=new nR(19),E=0;m.length>E;++E)k[31&m[E]]++;for(E=0;w.length>E;++E)k[31&w[E]]++;for(var S=nW(k,7),R=S[0],P=S[1],$=19;$>4&&!R[nI[$-1]];--$);var F,I,C,O,A=u+5<<3,T=nX(r,nj)+nX(n,nq)+a,M=nX(r,d)+nX(n,f)+a+14+3*$+nX(k,R)+(2*k[16]+3*k[17]+7*k[18]);if(T>=A&&M>=A)return nY(t,h,e.subarray(l,l+u));if(nU(t,h,1+(T>M)),h+=2,T>M){F=nN(d,p,0),I=d,C=nN(f,g,0),O=f;var L=nN(R,P,0);for(nU(t,h,y-257),nU(t,h+5,x-1),nU(t,h+10,$-4),h+=14,E=0;$>E;++E)nU(t,h+3*E,R[nI[E]]);h+=3*$;for(var D=[m,w],N=0;2>N;++N){var j=D[N];for(E=0;j.length>E;++E)nU(t,h,L[q=31&j[E]]),h+=R[q],q>15&&(nU(t,h,j[E]>>>5&127),h+=j[E]>>>12)}}else F=nB,I=nj,C=nH,O=nq;for(E=0;o>E;++E)if(s[E]>255){nG(t,h,F[257+(q=s[E]>>>18&31)]),h+=I[q+257],q>7&&(nU(t,h,s[E]>>>23&31),h+=n$[q]);var q,B=31&s[E];nG(t,h,C[B]),h+=O[B],B>3&&(nG(t,h,s[E]>>>5&8191),h+=nF[B])}else nG(t,h,F[s[E]]),h+=I[s[E]];return nG(t,h,F[256]),h+I[256]},nQ=new nP([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),n0=new nS(0),n1=function(){for(var e=new nP(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),n2=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},n3=!!m||!!_,n5="text/plain",n6=!1,n8=(e,t)=>{var i=e.split("#"),s=i[1],r=i[0].split("?"),n=r[0],a=r[1];if(!a)return e;var o=a.split("&").filter(e=>e.split("=")[0]!==t).join("&");return n+(o?"?"+o:"")+(s?"#"+s:"")},n4=function(e,t,i){void 0===i&&(i=!0);var s,r,n,a,o,l=e.split("?"),h=l[0],c=l[1],d=u({},t),p=null!=(o=null==c?void 0:c.split("&").map(e=>{var t,s=e.split("="),r=s[0],n=i&&null!=(t=d[r])?t:s[1];return delete d[r],r+"="+n}))?o:[],v=(void 0===s&&(s="&"),a=[],sx(d,function(e,t){V(e)||V(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),a[a.length]=n+"="+r)}),a.join(s));return v&&p.push(v),p.length>0?h+"?"+p.join("&"):h},n9=e=>{if(e.Oa)return e.Oa;var t=e.data,i=e.compression;if(t){if(i===nd){var s,r,n,a,o,l,u,h,c,d=(s=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new nS(e.length+(e.length>>>1)),s=0,r=function(e){i[s++]=e},n=0;t>n;++n){if(s+5>i.length){var a=new nS(s+8+(t-n<<1));a.set(i),i=a}var o=e.charCodeAt(n);128>o?r(o):(2048>o?r(192|o>>>6):(o>55295&&57344>o?(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 nV(i,0,s)}(rG(t)),r={mtime:0},n=0xffffffff,a={p(e){for(var t=n,i=0;e.length>i;++i)t=n1[255&t^e[i]]^t>>>8;n=t},d:()=>0xffffffff^n},o=s.length,a.p(s),c=(l=10+(r.filename&&r.filename.length+1||0),h=function(e,t,i,s,r){var n=e.length,a=new nS(s+n+5*(1+Math.floor(n/7e3))+8),o=a.subarray(s,a.length-8),l=0;if(!t||8>n)for(var u=0;n>=u;u+=65535){var h=u+65535;n>h?l=nY(o,l,e.subarray(u,h)):(o[u]=r,l=nY(o,l,e.subarray(u,n)))}else{for(var c=nQ[t-1],d=c>>>13,p=8191&c,v=(1<<i)-1,f=new nR(32768),g=new nR(v+1),_=Math.ceil(i/3),m=2*_,y=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<m)&v},b=new nP(25e3),w=new nR(288),x=new nR(32),k=0,E=0,S=(u=0,0),R=0,P=0;n>u;++u){var $=y(u),F=32767&u,I=g[$];if(f[F]=I,g[$]=F,u>=R){var C=n-u;if((k>7e3||S>24576)&&C>423){l=nZ(e,o,0,b,w,x,E,S,P,u-P,l),S=k=E=0,P=u;for(var O=0;286>O;++O)w[O]=0;for(O=0;30>O;++O)x[O]=0}var A=2,T=0,M=p,L=F-I&32767;if(C>2&&$==y(u-L))for(var D=Math.min(d,C)-1,N=Math.min(32767,u),j=Math.min(258,C);N>=L&&--M&&F!=I;){if(e[u+A]==e[u+A-L]){for(var q=0;j>q&&e[u+q]==e[u+q-L];++q);if(q>A){if(A=q,T=L,q>D)break;var B=Math.min(L,q-2),H=0;for(O=0;B>O;++O){var z=u-L+O+32768&32767,V=z-f[z]+32768&32767;V>H&&(H=V,I=z)}}}L+=(F=I)-(I=f[F])+32768&32767}if(T){b[S++]=0x10000000|nA[A]<<18|nT[T];var U=31&nA[A],G=31&nT[T];E+=n$[U]+nF[G],++w[257+U],++x[G],R=u+A,++k}else b[S++]=e[u],++w[e[u]]}}l=nZ(e,o,r,b,w,x,E,S,P,u-P,l),r||(l=nY(o,l,n0))}return nV(a,0,s+nz(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,!u)).length,function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:2*(9==t.level),e[9]=3,0!=t.mtime&&n2(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var s=0;i.length>=s;++s)e[s+10]=i.charCodeAt(s)}}(h,r),n2(h,c-8,a.d()),n2(h,c-4,o),h);return{contentType:n5,body:d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength),estimatedSize:d.byteLength}}if(i===np){let e;var p,v="data="+encodeURIComponent("string"==typeof(e=(p=rG(t))?btoa(encodeURIComponent(p).replace(/%([0-9A-F]{2})/g,(e,t)=>
2String.fromCharCode(parseInt(t,16)))):p)?e:rG(e));return{contentType:"application/x-www-form-urlencoded",body:v,estimatedSize:new Blob([v]).size}}var f=rG(t);return{contentType:"application/json",body:f,estimatedSize:new Blob([f]).size}}},n7=e=>{var t,i,s=()=>"sendBeacon"===e.transport?{url:n4(e.url,{compression:np}),encodedBody:n9(u({},e,{compression:np,Oa:void 0}))}:{url:n8(e.url,"compression"),encodedBody:n9(u({},e,{compression:void 0,Oa:void 0}))};try{t=n9(e)}catch(t){if(tZ(e.compression,rK(e.url,"compression")))return il.error("Failed to gzip request body, sending uncompressed payload",t),s();throw t}return!(t&&tZ(e.compression,rK(e.url,"compression")))||((i=t.body)instanceof ArrayBuffer?tY(new Uint8Array(i)):ArrayBuffer.isView(i)&&tY(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?{url:e.url,encodedBody:t}:(n6=!0,s())},ae=e=>{try{return n7(e)}catch(t){return il.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},at=(t=c(function*(e){var t=yield function(e,t,i){return t2.apply(this,arguments)}(rG(e.data),R.DEBUG,{rethrow:!0});if(!t)return e;var i=yield t.arrayBuffer();return u({},e,{Oa:{contentType:n5,body:i,estimatedSize:i.byteLength}})}),function(e){return t.apply(this,arguments)}),ai=/Failed to fetch|NetworkError|Load failed/i,as=e=>"TypeError"===(null==e?void 0:e.name)&&ai.test((null==e?void 0:e.message)||""),ar=e=>{var t=ae(e);if(t){var i,s=t.url,r=t.encodedBody,n=null!=r?r:{},a=n.contentType,o=n.body,l=n.estimatedSize,h=new Headers;sx(e.headers,function(e,t){h.append(t,e)}),a&&h.append("Content-Type",a);var c=null,d=!1;if(y){var p=new y;c={signal:p.signal,timeout:setTimeout(()=>{var t;d=!0,p.abort(tc("AbortError","PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":"")))},e.timeout)}}var v=t=>{d&&"AbortError"===(null==t?void 0:t.name)||as(t)?il.warn(t):il.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{_(s,u({method:(null==e?void 0:e.method)||"GET",headers:h,keepalive:"POST"===e.method&&!e.$a&&52428.8>(l||0),body:o,signal:null==(i=c)?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){il.error(e)}null==e.callback||e.callback(s)})).catch(v).finally(()=>c?clearTimeout(c.timeout):null)}catch(e){c&&clearTimeout(c.timeout),v(e)}}},an=e=>{try{var t,i=n7(e),s=i.url,r=i.encodedBody,n=null!=r?r:{},a=n.body,o=n.estimatedSize;if(!a)return;var l=a instanceof Blob?a:new Blob([a],{type:n.contentType});if(v.sendBeacon(s,l))return;var h=q(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(q(h)&&h.length>1&&(null!=o?o:0)>16384){var c=Math.ceil(h.length/2),d=t=>q(e.data)?t:u({},e.data,{batch:t});return an(u({},e,{data:d(h.slice(0,c))})),void an(u({},e,{data:d(h.slice(c))}))}il.warn("Beacon of ~"+(null!=o?o:0)+" bytes was rejected by the browser, falling back to fetch"),ar(u({},e,{$a:!0}))}catch(e){il.warn("Beacon send failed",e)}},aa=(e,t,i,s)=>{var r="query"===s?"POST"===t?"sent_at":"_":void 0;return n4(i===nd?n8(e,"compression"):e,u({},r?{[r]:Date.now().toString()}:{},i===nd?{}:{compression:i}))},ao=[];_&&ao.push({transport:"fetch",method:ar}),m&&ao.push({transport:"XHR",method(e){var t=ae(e);if(t){var i=new m,s=t.encodedBody;i.open(e.method||"GET",t.url,!0);var r=null!=s?s:{},n=r.contentType,a=r.body;sx(e.headers,function(e,t){i.setRequestHeader(t,e)}),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),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(a)}}}),null!=v&&v.sendBeacon&&ao.push({transport:"sendBeacon",method:an});var al=class{constructor(e,t){this.Da=!0,this.La=[],this.Na=eo((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,il.createLogger("flush interval"),3e3),this.qa=e}enqueue(e){this.La.push(e),this.ja||this.Ba()}unload(){this.Ha();var e=Object.values(this.La.length>0?this.za():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Ua(u({},e,{transport:"sendBeacon"}))})}enable(){this.Da=!1,this.Ba()}Ba(){var e=this;this.Da||(this.ja=setTimeout(()=>{if(this.Ha(),this.La.length>0){var t=this.za();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&q(s.data)&&sx(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.Ua(s)}()}},this.Na))}Ua(e){try{this.qa(e)}catch(e){il.error(e)}}Ha(){clearTimeout(this.ja),this.ja=void 0}za(){var e={};return sx(this.La,t=>{var i,s=(t?t.batchKey:null)||t.url;V(e[s])&&(e[s]=u({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.La=[],e}},au=class{constructor(e){this._instance=e,this.Wa=!1,this.Va=3e3,this.La=[],this.La=[],this.Ga=!0,!V(d)&&"onLine"in d.navigator&&(this.Ga=d.navigator.onLine,this.Za=()=>{this.Ga=!0,this.Ja()},this.Qa=()=>{this.Ga=!1}
2,sI(d,"online",this.Za),sI(d,"offline",this.Qa))}get length(){return this.La.length}retriableRequest(e){var t=e.retriesPerformedSoFar,i=l(e,a);X(t)&&(i.url=n4(i.url,{retry_count:t})),this._instance._send_request(u({},i,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this.ws(u({retriesPerformedSoFar:t},i));0===e.statusCode&&il.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=t?t:0)+" retries.")}null==i.callback||i.callback(e)}}))}ws(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.La.push({retryAt:a,requestOptions:e});var o="Enqueued failed request for retry in "+n;navigator.onLine||(o+=" (Browser is offline)"),il.warn(o),this.Wa||(this.Wa=!0,this.Ka())}Ka(){(this.Xa&&clearTimeout(this.Xa),0===this.La.length)?(this.Wa=!1,this.Xa=void 0):this.Xa=setTimeout(()=>{this.Ga&&this.La.length>0&&this.Ja(),this.Ka()},this.Va)}Ja(){var e=Date.now(),t=[],i=this.La.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.La=t,i.length>0)for(var s of i)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.Xa&&(clearTimeout(this.Xa),this.Xa=void 0),this.Wa=!1,V(d)||(this.Za&&(d.removeEventListener("online",this.Za),this.Za=void 0),this.Qa&&(d.removeEventListener("offline",this.Qa),this.Qa=void 0)),this.La)){var t=e.requestOptions;try{this._instance._send_request(u({},t,{transport:"sendBeacon"}))}catch(e){il.error(e)}}this.La=[]}},ah=class{constructor(e){this._instance=e,this.Ya=()=>{this.tl||(this.tl={});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.tl.lastScrollY=Math.ceil(n),this.tl.maxScrollY=Math.max(n,null!=(e=this.tl.maxScrollY)?e:0),this.tl.maxScrollHeight=Math.max(a,null!=(t=this.tl.maxScrollHeight)?t:0),this.tl.lastContentY=o,this.tl.maxContentY=Math.max(o,null!=(i=this.tl.maxContentY)?i:0),this.tl.maxContentHeight=Math.max(l,null!=(s=this.tl.maxContentHeight)?s:0)}}get el(){return this._instance.config.scroll_root_selector}getContext(){return this.tl}resetContext(){var e=this.tl;return setTimeout(this.Ya,0),e}startMeasuringScrollPosition(){sI(d,"scroll",this.Ya,{capture:!0}),sI(d,"scrollend",this.Ya,{capture:!0}),sI(d,"resize",this.Ya)}scrollElement(){var e;if(!this.el)return null==d||null==(e=d.document)?void 0:e.documentElement;for(var t of q(this.el)?this.el:[this.el]){var i,s=null==d||null==(i=d.document)?void 0:i.querySelector(t);if(s)return s}}il(e){var t,i;if(this.el){var s=this.scrollElement();return s&&s["y"===e?"scrollTop":"scrollLeft"]||0}return d?"y"===e?d.scrollY||d.pageYOffset||(null==(t=d.document)||null==(t=t.documentElement)?void 0:t.scrollTop)||0:d.scrollX||d.pageXOffset||(null==(i=d.document)||null==(i=i.documentElement)?void 0:i.scrollLeft)||0:0}scrollY(){return this.il("y")}scrollX(){return this.il("x")}},ac=e=>r7(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes),ad=class{constructor(e,t,i,s){this.Be=e=>{var t=this.rl();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.nl(this._instance)};this.sl.register({[se]:i})}},this._instance=e,this.ol=t,this.sl=i,this.nl=s||ac,this.ol.onSessionId(this.Be)}rl(){return this.sl.props[se]}getSetOnceProps(){var e,t=null==(e=this.rl())?void 0:e.props;return t?"r"in t?ne(t,this._instance.config.disable_capture_url_hashes):{$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 sx(sP(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+C(i)]=t}),e}},ap=class{on(e,t){return this.al[e]||(this.al[e]=[]),this.al[e].push(t),()=>{this.al[e]=this.al[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.al[e]||[])i(t);for(var s of this.al["*"]||[])s(e,t)}constructor(){this.al={}}},av=iu("[SessionId]"),af=class{on(e,t){return this.ll.on(e,t)}constructor(e,t,i){if(this.ul=null,this.hl=null,this.dl=[],this.vl=void 0,this.cl=!1,this.ll=new ap,this.fl=(e,t)=>
2!(!X(e)||!X(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.Rn=e.config,this.sl=e.persistence,this.He=void 0,this.Xt=void 0,this._sessionStartTimestamp=null,this.pl=void 0,this._sessionActivityTimestamp=null,this.gl=t||sN,this.ml=i||sN;var s,r=this.Rn.persistence_name||this.Rn.token;if(this._sessionTimeoutMs=1e3*eo(this.Rn.session_idle_timeout_seconds||1800,60,36e3,av.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.yl(),this.bl="ph_"+r+"_window_id",this._l="ph_"+r+"_primary_window_exists",this.wl()){var n=s5.Nt(this.bl),a=s5.Nt(this._l);n&&!a?this.He=n:s5.Dt(this.bl),s5.Ot(this._l,!0)}null!=(s=this.Rn.bootstrap)&&s.sessionID&&this.setBootstrapSessionId(this.Rn.bootstrap.sessionID),this.kl()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return V(this.dl)&&(this.dl=[]),this.dl.push(e),this.Xt&&e(this.Xt,this.He),()=>{this.dl=this.dl.filter(t=>t!==e)}}wl(){return"memory"!==this.Rn.persistence&&!this.sl.gi&&s5.Et()}Sl(e){e!==this.He&&(this.He=e,this.wl()&&s5.Ot(this.bl,e))}xl(){return this.He?this.He:this.wl()?s5.Nt(this.bl):null}Cl(e){var t=this.ul;return!W(t)&&!W(e)&&5e3>Math.abs(e-t)}Tl(e,t,i){var s=t!==this._sessionActivityTimestamp,r=e===this.Xt&&i===this._sessionStartTimestamp;this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Xt=e,r&&!s||r&&this.Cl(t)||(this.ul=t,this.sl.register({[ij]:[t,e,i]}))}Ml(){var e,t=null==(e=this.Rn)?void 0:e.persistence_save_debounce_ms;return X(t)&&t>0}Il(){this.Ml()?this.sl.refreshKey(ij):(this.sl.flush(),this.sl.load())}El(){var e;if(!W(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.ul){this.Il();var t=this.Rl();t[1]===this.Xt&&t[2]===this._sessionStartTimestamp&&(this.ul=this._sessionActivityTimestamp,this.sl.register({[ij]:[this._sessionActivityTimestamp,null!=(e=this.Xt)?e:null,this._sessionStartTimestamp]}),this.sl.flush())}}Al(){var e=this.Rl()[0];return Math.max(X(e)?e:0,X(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}Pl(e){return this.Il(),this.fl(e,this.Al())}Rl(){var e=this.sl.props[ij];return q(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.ul=null,this.pl=void 0,clearTimeout(this.Fl),this.Fl=void 0,this.Tl(null,null,null)}setBootstrapSessionId(e,t){void 0===t&&(t=!1);var i=function(e,t){void 0===t&&(t=(new Date).getTime());try{var i=(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)})(e);return i>t+6e4?void av.error("Bootstrap sessionID cannot be in the future"):i}catch(e){return void av.error("Invalid sessionID in bootstrap",e)}}(e);return!V(i)&&(t?this.pl={sessionId:e,sessionStartTimestamp:i}:this.Tl(e,(new Date).getTime(),i),!0)}destroy(){this.cl=!0,this.El(),clearTimeout(this.Fl),this.Fl=void 0,this.vl&&d&&(d.removeEventListener(sg,this.vl,{capture:!1}),this.vl=void 0),this.dl=[]}kl(){this.vl=()=>{this.El(),this.wl()&&s5.Dt(this._l)},sI(d,sg,this.vl,{capture:!1})}checkAndGetSessionAndWindowId(e,t,i){if(void 0===e&&(e=!1),void 0===t&&(t=null),void 0===i&&(i=!1),"always"===this.Rn.cookieless_mode)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s,r,n=t||(new Date).getTime(),a=this.Xt;i?this.hl=n:(W(this.hl)||this.hl>n||n-this.hl>=1e3)&&(null==(s=(r=this.sl).syncCookieProperties)||s.call(r),this.hl=n);var o=this.Rl(),l=o[1],u=o[2],h=!V(a)&&l!==a,c=this.Al(),d=this.xl(),p=this.pl,v=!!p&&(p.sessionStartTimestamp>n+6e4||n-p.sessionStartTimestamp>864e5),f=p?v:X(u)&&Math.abs(n-u)>864e5,g=!1,_=h,m=!l||!!p,y=l,b=!m&&!e&&this.fl(n,c);if(b){(b=this.Pl(n))||av.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.Rl();l=w[1],u=w[2]}if(m||b||f){_=!1;var x=p&&!v;l=x?p.sessionId:this.gl(),d=this.ml(),av.info("new session ID assigned",{sessionId:l,windowId:d,bootstrapped:!!x,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:f}}),u=x?p.sessionStartTimestamp:n,this.pl=void 0,g=!0}else d||(d=this.ml(),g=!0),(_=_||l!==y)&&(av.info("adopted cross-tab session id",{sessionId:l,windowId:d}),g=!0);var k=X(c)&&e&&!f?c:n,E=X(u)?u:(new Date).getTime();this.Sl(d),this.Tl(l,k,E),e||this.yl();var S={noSessionId:m,activityTimeout:b,sessionPastMaximumLength:f,crossTabAdoption:_};
2return g&&this.dl.forEach(e=>e(l,d,S)),{sessionId:l,windowId:d,sessionStartTimestamp:E,changeReason:g?S:void 0,lastActivityTimestamp:c}}yl(){this.cl||(clearTimeout(this.Fl),this.Fl=setTimeout(()=>{if(!this.cl)if(this.Pl((new Date).getTime())){var e=this.Xt;this.resetSessionId(),this.ll.emit("forcedIdleReset",{idleSessionId:e})}else this.yl()},1.1*this.sessionTimeoutMs))}},ag=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&$(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>$(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function a_(){return(a_=c(function*(){var e=null==v?void 0:v.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t,i=null==(t=yield e.getHighEntropyValues(["model"]))?void 0:t.model;return U(i)&&i.length>0?i:void 0}catch(e){return void il.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function am(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}var ay=(e,t)=>{if(!(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}},ab=e=>e.toLowerCase(),aw={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=>ay(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!ay(t,e))),icontains:(e,t)=>t.map(ab).some(t=>e.map(ab).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(ab).every(t=>e.map(ab).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))})};function ax(e,t){return!e||Object.entries(e).every(e=>{var i=e[1],s=null==t?void 0:t[e[0]];if(null==s)return!1;var r=aw[i.operator];return!!r&&r(i.values,[String(s)])})}function ak(e,t,i){return rG({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}for(var aE="custom",aS="i.posthog.com",aR=/^\/static\//,aP=["/s/","/e/","/i/"],a$=class{constructor(e){this.Ol={},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("."+aS,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Ol[this.apiHost]||(this.Ol[this.apiHost]=/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"us":/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?"eu":aE),this.Ol[this.apiHost]}$l(e){if(aR.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}Dl(e){var t=rW(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}Ll(e,t,i){if("ui"===e)return i;var s=i,r=this.instance.config.rewriteRequestPath;if(r&&(s=r(new URL((null==(a=rW(i))?void 0:a.href)||i)).toString()),r&&"api"===e&&aP.some(e=>0===t.indexOf(e))){var n=this.Dl(s);if(n){var a,o,l=this.apiHost,u=this.Nl;(null==(o=u)?void 0:o.apiHost)===l&&u.rewriteRequestPath===r||(this.Nl=u={apiHost:l,rewriteRequestPath:r,urls:new Set}),u.urls.add(n)}}return s}isIngestionEndpoint(e){var t=this.Nl,i=this.Dl(e);return(null==t?void 0:t.apiHost)===this.apiHost&&t.rewriteRequestPath===this.instance.config.rewriteRequestPath&&!!i&&t.urls.has(i)}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.Ll(e,t,this.uiHost+t);if("flags"===e)return this.Ll(e,t,this.flagsApiHost+t);if("assets"===e){var i=this.$l(t);if(i)return this.Ll(e,t,""+i+t)}if(this.region===aE)return this.Ll(e,t,this.apiHost+t);var s=aS+t;switch(e){case"assets":return this.Ll(e,t,"https://"+this.region+"-assets."+s);case"api":return this.Ll(e,t,"https://"+this.region+"."+s)}}},aF=iu("[Surveys]"),aI=e=>{try{var t="seenSurvey_"+(e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){aF.error("Failed to persist survey seen state",e)}}
2,aC=["popover","widget","api"],aO={ignoreConditions:!1,ignoreDelay:!1,displayType:ny},aA=iu("[PostHog ExternalIntegrations]"),aT={intercom:"intercom-integration",crispChat:"crisp-chat-integration"},aM=class{constructor(e){this._instance=e}bo(e,t){var i;null==(i=E.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return aA.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this;for(var i of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))!function(){var e,s,r,n=i[0],a=i[1];!a||null!=(e=E.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[n]||t.bo(aT[n],()=>{var e;null==(e=E.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[n])||e.start(t._instance)}),!a&&null!=(s=E.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[n]&&(null==(r=E.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[n])||r.stop())}()}},aL=class{constructor(e,t){this.A=e,this.Js=t,this.ql=new Map,this.ro=!1}add(e){var t=this;return c(function*(){if(t.ro)throw Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.ql.has(e.name))throw Error('Browser extension "'+e.name+'" is already registered');t.ql.set(e.name,e);try{var i=e.setup(t.Js);i&&(yield i)}catch(i){var s=t.ql.get(e.name)===e;s&&t.ql.delete(e.name),t.A.error('Failed to set up browser extension "'+e.name+'"',i),s&&t.jl(e)}})()}getExtension(e){return this.ql.get(e)}dispose(){if(!this.ro){this.ro=!0;var e=Array.from(this.ql.values()).reverse();for(var t of(this.ql.clear(),e))this.jl(t)}}jl(e){try{var t=null==e.dispose?void 0:e.dispose();t&&B(t.then)&&t.then(void 0,t=>{this.A.error('Failed to dispose browser extension "'+e.name+'"',t)})}catch(t){this.A.error('Failed to dispose browser extension "'+e.name+'"',t)}}},aD=class{constructor(e){this._instance=e}initialize(){}get(e){var t=this._instance.persistence;if("string"==typeof e)return null==t?void 0:t.get_property(e);var i={};for(var s of e){var r=null==t?void 0:t.get_property(s);V(r)||(i[s]=r)}return i}set(e,t){var i;null==(i=this._instance.persistence)||i.register("string"==typeof e?{[e]:t}:e)}remove(e){var t;null==(t=this._instance.persistence)||t.unregister(e)}},aN="extensionsRemoteConfig",aj=class{constructor(e){this.instance=e,this.ro=!1,this.A=il,this.Bl=e.Hl,this.kv=new aD(e),this.onEvent=e=>nb(this.instance.on("eventCaptured",t=>{try{e({event:t.event,properties:t.properties})}catch(e){this.A.error("Browser extension event listener failed",e)}})),this.onRemoteConfig=e=>{if(this.ro)return nb(()=>{});var t=t=>{try{e(t)}catch(e){this.A.error("Browser extension remote config listener failed",e)}},i=this.instance.zl.on(aN,t);return this.Bl&&t(this.Bl),nb(i)},this.Ul=new aL(il.createLogger("[BrowserExtensions]"),this)}get logger(){return this.A}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!=(e=this.instance.get_property("$device_id"))?e:this.distinctId}get deviceId(){var e=this.instance.get_property(i_);return"string"==typeof e?e:void 0}get library(){return{name:R.LIB_NAME,version:R.LIB_VERSION}}get initialPersonProperties(){var e,t;return null!=(e=null==(t=this.instance.persistence)?void 0:t.get_initial_props())?e:{}}get groups(){return this.instance.getGroups()}get session(){try{var e,t,i,s,r=null==(e=this.instance.sessionManager)?void 0:e.checkAndGetSessionAndWindowId(!0);return{sessionId:null!=(t=null==r?void 0:r.sessionId)?t:"",windowId:null!=(i=null==r?void 0:r.windowId)?i:"",sessionStartTimestamp:null!=(s=null==r?void 0:r.sessionStartTimestamp)?s:0}}catch(e){return{sessionId:"",windowId:"",sessionStartTimestamp:0}}}get canCapture(){return this.instance.is_capturing()}get projectToken(){return this.instance.config.token}add(e){return this.Ul.add(e)}getExtension(e){return this.Ul.getExtension(e)}capture(e,t,i){var s=this;return c(function*(){i?s.instance.capture(e,t,{timestamp:i.timestamp,uuid:i.uuid,$set:i.set,$set_once:i.setOnce}):s.instance.capture(e,t)})()}registerDynamicEventProperties(e){return nb(this.instance.Wl(e))}handleRemoteConfig(e){this.ro||(this.Bl=e,this.instance.zl.emit(aN,e))}sendRequest(e,t){var i=this;return c(function*(){void 0===t&&(t={});var s,r=i.instance.requestRouter.endpointFor(null!=(s=t.target)?s:"api",e),n={method:t.method,url:t.query?n4(r,t.query):r,data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,compressionFallback:"flags"===t.target&&"best-available"===t.compression?T.Base64:void 0,timestampMode:t.sentAt};return"sendBeacon"===t.transport?(i.instance._send_request(n),{statusCode:202}):new Promise(e=>{n.callback=e,i.instance._send_request(n)})})()}dispose(){this.ro||(this.ro=!0,this.Ul.dispose())}},aq={},aB=0,aH=()=>{}
2,az='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',aV="Surveys module not available",aU="sanitize_properties is deprecated. Use before_send instead",aG="Invalid value for property_denylist config: ",aW=/^[A-Za-z0-9_-]{1,400}$/,aK=/^fb\.[0-9]+\.[0-9]+\.[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)?$/,aJ=["token","distinct_id",so],aX="posthog",aY=!n3&&-1===(null==w?void 0:w.indexOf("MSIE"))&&-1===(null==w?void 0:w.indexOf("Mozilla")),aZ=e=>{var t,i;return u({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!U(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of sF)if(i===s)return!1;return!0}(null==f?void 0:f.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:aH,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,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:g&&U(null==g?void 0:g.search)&&-1!==g.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:!1,disableDeviceModel:!1,reuseAnonymousId:!1,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==d||null==(t=d.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_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){il.error("Bad HTTP status: "+e.statusCode+" "+e.text)},get_device_id:e=>e,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:sv,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:aH},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:rv,ignore_text_selection:!0}
2:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:(i={},e&&"unset"!==e&&("2025-11-30">e||(i.strictMinimumDuration=!0),"2026-05-30">e||(i.canvasCapture={resolutionScale:.6}),"2026-06-25">e||(i.streamNetworkBody=!0),"2026-08-30">e||(i.captureJsonLd=!0)),i),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,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e),cookieWinsOnConflict:!(!e||"unset"===e||"2026-08-29">e)})},aQ=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"],["__preview_cookie_wins_on_conflict","cookieWinsOnConflict"]],a0=e=>{var t={};for(var i of aQ){var s=i[0],r=i[1];
2V(e[s])||(t[r]=e[s])}var n=sk({},t,e),a=e.__preview_external_dependency_versioned_paths;return V(a)||(V(e.strict_script_versioning)&&(n.strict_script_versioning=!!a),U(a)&&V(e.asset_host)&&(n.asset_host=a)),q(e.property_blacklist)&&(V(e.property_denylist)?n.property_denylist=e.property_blacklist:q(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:il.error(aG+e.property_denylist)),n},a1=class{constructor(){this.__forceAllowLocalhost=!1}get Vl(){return this.__forceAllowLocalhost}set Vl(e){il.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}},a2=((n=class e{Gl(e){if(e){var t=this.ql.indexOf(e);-1!==t&&this.ql.splice(t,1)}}Zl(e,t){return this.Gl(e),this.ql.push(t),null==t.initialize||t.initialize(),t}Jl(){return"always"===this.config.cookieless_mode||"on_reject"===this.config.cookieless_mode&&this.consent.isRejected()}Ql(){if(!(this.Kl||this.config.reuseAnonymousId||this.config.segment||this.Jl())){var e,t,i,s="memory"===this.config.persistence||"sessionStorage"===this.config.persistence;(s||this.config.disable_persistence)&&(this.Xl||(s?(e="persistence is set to '"+this.config.persistence+"'",t="memory"===this.config.persistence?"on every page load":"for every new browser tab or window",i="Either set persistence to 'localStorage+cookie', keep this persistence and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."):(e="persistence is disabled (disable_persistence is true)",t="on every page load",i="Either set disable_persistence to false, keep persistence disabled and pass a stable ID through bootstrap.distinctID, or enable reuseAnonymousId."),this.Kl=!0,console.warn("[PostHog.js]",e+" but no bootstrap.distinctID was provided. PostHog will mint a new distinct ID "+t+", so calling identify() merges a new ID onto the person each time. A person can then pass the distinct-ID limit and its events stop appearing on person pages and the session tab. "+i)))}}Yl(){if(!this.Jl()&&"$posthog_cookieless"===this.get_distinct_id()){var e=this.persistence;if(e){this.tu()||e.load(!0);var t=this.get_distinct_id();if(!t||"$posthog_cookieless"===t){var i=this.config.get_device_id(sN());this.register({distinct_id:i,$device_id:i}),e.set_property(i7,sd)}this.eu()}}}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 a1,this.iu=!1,this.version=R.LIB_VERSION,this.ru=new Set,this.nu="",this.zl=new ap,this.ql=[],this.su=[],this.Xl=!1,this.Kl=!1,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=aZ(),this.SentryIntegration=rq,this.sentryIntegration=e=>{var t;return t=rj(this,e),{name:rN,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.ou=!1,this.au=null,this.lu=null,this.uu=null,this.scrollManager=new ah(this),this.pageViewManager=new rB(this),this.rateLimiter=new nx(this),this.requestRouter=new a$(this),this.consent=new s6(this),this.externalIntegrations=new aM(this);var t,i=null!=(t=e.__defaultExtensionClasses)?t:{};this.featureFlags=i.featureFlags&&new i.featureFlags(this),this.toolbar=i.toolbar&&new i.toolbar(this),this.surveys=i.surveys&&new i.surveys(this),this.conversations=i.conversations&&new i.conversations(this),this.logs=i.logs&&new i.logs(this),this.metrics=i.metrics&&new i.metrics(this),this.experiments=i.experiments&&new i.experiments(this),this.exceptions=i.exceptions&&new i.exceptions(this),this.people={set:(e,t,i)=>{var s=U(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=U(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>il.info('send "'+(null==e?void 0:e.event)+'"',e))}init(t,i,s){if(s&&s!==aX){var r,n=null!=(r=aq[s])?r:new e;return n._init(t,i,s),aq[s]=n,aq[aX][s]=n,n}return this._init(t,i,s)}_init(e,t,i){void 0===t&&(t={});var s,r,n,a,o=U(e)?e.trim():"";if(!o)return il.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 o!==(null==(a=this.config)?void 0:a.token)?console.warn("[PostHog.js]","You have already initialized PostHog with a different project token! Re-initializing is a no-op, so events will keep going to the project this instance was initialized with. To capture into a second project, load PostHog once, then initialize a named instance after the SDK has loaded, e.g. posthog.init('"+o+"', { ... }, 'project2')"):console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config=aZ(t.defaults),t.debug=this.hu(t.debug),this.du=t,this.vu=[],t.person_profiles?this.lu=t.person_profiles:t.process_person&&(this.lu=t.process_person);var l=aZ(t.defaults),h=a0(t),c=sk({},l,h,{name:i,token:o});H(l.rageclick)&&H(h.rageclick)&&(c.rageclick=sk({},l.rageclick,h.rageclick)),H(l.session_recording)&&H(h.session_recording)&&(c.session_recording=sk({},l.session_recording,h.session_recording)),this.set_config(c),this.config.on_xhr_error&&il.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:nd;var p=this.tu();if(this.persistence=new nc(this.config,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new nc(u({},this.config,{persistence:"sessionStorage"}),p,!1),this.nu="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!p&&s5.Et()){var v=s5.Nt(this.nu);
2q(v)&&v.forEach(e=>{U(e)&&this.ru.add(e)})}else s5.Dt(this.nu);var f=u({},this.persistence.props),g=u({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.cu=new al(e=>this.fu(e),this.config.request_queue_config),this.pu=new au(this),this.__request_queue=[];var _=this.Jl();_||(this.sessionManager=new af(this),this.sessionPropsManager=new ad(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((e,t,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.gu()})),this.mu(),this.config.__preview_deferred_init_extensions?(il.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.yu(_)},0)):(il.info("Initializing extensions synchronously"),this.yu(_)),R.DEBUG=R.DEBUG||this.config.debug,R.DEBUG&&il.info("Starting in debug mode",{this:this,config:t,thisC:u({},this.config),p:f,s:g}),!this.config.identity_distinct_id||null!=(s=t.bootstrap)&&s.distinctID||(t.bootstrap=u({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}));var m=null==(r=t.bootstrap)?void 0:r.distinctID;if(this.Xl=!!m&&!G(m),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var y=t.bootstrap.distinctID,b=this.get_distinct_id(),w=this.persistence.get_property(i7);if(t.bootstrap.isIdentifiedID&&null!=b&&b!==y&&"anonymous"===w)this.identify(y);else if(t.bootstrap.isIdentifiedID&&null!=b&&b!==y&&"identified"===w)il.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var x=this.config.get_device_id(sN()),k=t.bootstrap.isIdentifiedID?x:y;this.persistence.set_property(i7,t.bootstrap.isIdentifiedID?sp:sd),this.register({distinct_id:y,$device_id:k})}}if(_)this.register_once({distinct_id:sa,$device_id:null},"");else if(!this.get_distinct_id()){var E=this.config.get_device_id(sN());this.register_once({distinct_id:E,$device_id:E},""),this.persistence.set_property(i7,sd)}return sI(d,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?rD(this,()=>this.bu()):this.bu(),B(this.config._onCapture)&&this.config._onCapture!==aH&&(il.w
2arn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&il.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.config.disableDeviceModel||(function(){return a_.apply(this,arguments)})().then(e=>{e&&this.register({[im]:e})}).catch(aH),this}_u(e){return U(e.name)&&B(e.setup)}wu(e,t){this._u(e)?t.push(()=>{this.ku().add(e).catch(()=>null==e.dispose?void 0:e.dispose()).catch(t=>{il.error('Failed to dispose browser extension "'+e.name+'"',t)})}):this.ql.push(e)}mu(){var t,i,s,r,n,a,o=null!=(t=null==(i=this.config.__extensionClasses)?void 0:i.featureFlags)?t:null==(s=e.__defaultExtensionClasses)?void 0:s.featureFlags;o&&(this.featureFlags&&this.featureFlags instanceof o||(null==(a=this.Su)||a.call(this),this.Su=void 0,this.featureFlags=new o(this)),B(this.featureFlags.onReloading)&&B(this.featureFlags.setup)?this.Su||(this.Su=this.featureFlags.onReloading(()=>{this.zl.emit("featureFlagsReloading",!0)}),this.ku().add(this.featureFlags)):null==(r=(n=this.featureFlags).initialize)||r.call(n))}yu(t){var i,s,r,n,a,o,l,h=performance.now(),c=u({},e.__defaultExtensionClasses,this.config.__extensionClasses),d=[];c.exceptions&&this.ql.push(this.exceptions=null!=(i=this.exceptions)?i:new c.exceptions(this)),c.historyAutocapture&&this.ql.push(this.historyAutocapture=new c.historyAutocapture(this)),c.tracingHeaders&&this.ql.push(this.tracingHeaders=new c.tracingHeaders(this)),c.siteApps&&this.ql.push(this.siteApps=new c.siteApps(this)),c.sessionRecording&&!t&&this.ql.push(this.sessionRecording=new c.sessionRecording(this)),this.config.disable_scroll_properties||d.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),c.autocapture&&this.wu(this.autocapture=new c.autocapture(this),d),c.surveys&&this.wu(this.surveys=null!=(s=this.surveys)?s:new c.surveys(this),d),c.logs&&this.wu(this.logs=null!=(r=this.logs)?r:new c.logs(this),d),c.metrics&&this.ql.push(this.metrics=null!=(n=this.metrics)?n:new c.metrics(this)),c.conversations&&this.ql.push(this.conversations=null!=(a=this.conversations)?a:new c.conversations(this)),c.productTours&&this.ql.push(this.productTours=new c.productTours(this)),c.heatmaps&&this.ql.push(this.heatmaps=new c.heatmaps(this)),c.webVitalsAutocapture&&this.ql.push(this.webVitalsAutocapture=new c.webVitalsAutocapture(this)),c.exceptionObserver&&this.ql.push(this.exceptionObserver=new c.exceptionObserver(this)),c.deadClicksAutocapture&&this.ql.push(this.deadClicksAutocapture=new c.deadClicksAutocapture(this,rT)),c.toolbar&&this.ql.push(this.toolbar=null!=(o=this.toolbar)?o:new c.toolbar(this)),c.experiments&&this.ql.push(this.experiments=null!=(l=this.experiments)?l:new c.experiments(this)),this.ql.forEach(e=>{e.initialize&&d.push(()=>{null==e.initialize||e.initialize()})}),d.push(()=>{if(this.xu){var e=this.xu;this.xu=void 0,this.ql.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}}),this.Cu(d,h)}Cu(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Cu(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){il.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[sl]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[su]:s}),this.config.__preview_deferred_init_extensions&&il.info("PostHog extensions initialized ("+s+"ms)")}Pa(e){var t;if(!f||!f.body)return il.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Pa(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.xu=e),this.Hl=e,this.compression=void 0,e.ok){var i,s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=F(s.supportedCompression,nd)?nd:F(s.supportedCompression,np)?np:void 0),null!=(i=s.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.lu?this.lu:sv}),null==(t=this.Tu)||t.handleRemoteConfig(e),this.ql.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}bu(){try{this.config.loaded(this)}catch(e){il.critical("`loaded` function failed",e)}if(this.Mu(),this.config.internal_or_test_user_hostname&&null!=g&&g.hostname){var e=g.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()||this.Jl())&&this.Iu()},1),this.Eu=new nE(this),this.Eu.load()}Mu(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.cu)||e.enable())}_dom_loaded(){this.is_capturing()&&sw(this.__request_queue,e=>this.fu(e)),this.__request_queue=[],this.Mu()}_handle_unload(){var e,t,i,s,r;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this.Ru()&&this.capture(sm),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(s=this.cu)||s.unload(),null==(r=this.pu)||r.unload()):this.Ru()&&this.capture(sm,null,{transport:"sendBeacon"})}_send_request(e){var t;this.__loaded?aY?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=u({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?null!=(t=this.compression)?t:e.compressionFallback:e.compression,(V(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,
2(e=>{var t,i,s,r,n,a=u({},e);a.timeout=a.timeout||6e4;var o,l,h,c,d,p=null!=(s=a.transport)?s:"fetch";"sendBeacon"===p&&V(a.compression)&&a.data&&(a.compression=np),"POST"===a.method&&a.data&&("capture-body"===a.timestampMode?a.data={api_key:null!=(l=null==(d=(c=(q(o=a.data)?o:[o]).map(e=>u({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})))[0])||null==(h=d.properties)?void 0:h.token)?l:null==d?void 0:d.token,batch:c,sent_at:(new Date).toISOString()}:"body"===a.timestampMode&&(t=a.data,void 0===i&&(i=(new Date).toISOString()),a.data=q(t)?t.map(e=>u({},e,{sent_at:i})):u({},t,{sent_at:i}))),a.url=aa(a.url,a.method,a.compression,a.timestampMode);var v=ao.filter(e=>!a.disableTransport||!e.transport||!a.disableTransport.includes(e.transport)),f=null!=(r=null==(n=function(e,t){for(var i=0;e.length>i;i++)if(t(e[i]))return e[i]}(v,e=>e.transport===p))?void 0:n.method)?r:v[0].method;if(!f)throw Error("No available transport method");var g=e=>{try{f(e)}catch(e){as(e)?il.warn(e):il.error(e),null==a.callback||a.callback({statusCode:0,error:e})}};"sendBeacon"!==p&&a.data&&a.compression===nd&&b&&"u">typeof Promise&&!n6?at(a).then(e=>{g(e)}).catch(t=>{tQ(t)?(n6=!0,g(u({},a,{compression:void 0,url:aa(e.url,e.method,void 0,e.timestampMode)}))):((e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return tQ(e)||t===tX})(t)&&(n6=!0),g(a))}):f(a)})(u({},e,{callback:t=>{var i,s;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(i=(s=this.config).on_request_error)||i.call(s,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}fu(e){this.pu?this.pu.retriableRequest(e):this._send_request(e)}_execute_array(e){aB++;try{var t,i=[],s=[],r=[];sw(e,e=>{if(e)if(q(t=e[0]))r.push(e);else if(B(e))try{e.call(this)}catch(t){il.error("Error executing queued PostHog call",e,t)}else q(e)&&"alias"===t?i.push(e):q(e)&&-1!==t.indexOf("capture")&&B(this[t])?r.push(e):s.push(e)});var n=function(e,t){sw(e,function(e){try{if(q(e[0])){var i=t;sx(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){il.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(s,this),n(r,this)}finally{aB--}}push(t){if(aB>0&&q(t)&&U(t[0])){var i=e.prototype[t[0]];B(i)&&i.apply(this,t.slice(1))}else this._execute_array([t])}Au(){var e,t=null==(e=this.persistence)?void 0:e.get_property(iw);return U(t)&&aK.test(t)?{value:t,delivered:!1}:H(t)&&U(t.value)&&aK.test(t.value)?{value:t.value,delivered:!0===t.delivered}:void 0}Pu(e,t,i,s){if(this.persistence){this.persistence.refreshKey(iw);var r=this.Au();if(!s){if(i)return U(t)&&aK.test(t)?(t!==(null==r?void 0:r.value)&&this.persistence.register({[iw]:{value:t,delivered:!1}}),{value:t,pending:t!==(null==r?void 0:r.value)||!r.delivered}):void this.persistence.unregister(iw);if(U(e)&&aW.test(e)){if((null==r?void 0:r.value.split(".")[3])===e)return{value:r.value,pending:!r.delivered};var n="fb.1."+Date.now()+"."+e;return this.persistence.register({[iw]:{value:n,delivered:!1}}),{value:n,pending:!0}}return r?{value:r.value,pending:!r.delivered}:void 0}this.persistence.unregister(iw)}}Fu(e){if(this.persistence){this.persistence.refreshKey(iw);var t=this.Au();(null==t?void 0:t.value)!==e||t.delivered||this.persistence.register({[iw]:{value:e,delivered:!0}})}}capture(e,t,i){var s,r,n,a,o,l,h,c,d,p;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.cu){if(this.is_capturing())if(!V(e)&&U(e)){this.Yl();var v=!this.config.opt_out_useragent_filter&&this._is_bot();if(!v||this.config.__preview_capture_bot_pageviews){var f=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==f||!f.isRateLimited){null!=t&&t.$current_url&&!U(null==t?void 0:t.$current_url)&&(il.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),null==t||delete t.$current_url),"$exception"!==e||null!=i&&i.Ou||il.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&(g=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 g,_=new Date,m=(null==i?void 0:i.timestamp)||_,y=th(null==i?void 0:i.uuid,sN),b={uuid:y,event:e,properties:this.calculateEventProperties(e,t||{},m,y)};"$pageview"===e&&this.config.__preview_capture_bot_pageviews&&v&&(b.event="$bot_pageview",b.properties.$browser_type="bot"),f&&(b.properties.$lib_rate_limit_remaining_tokens=f.remainingTokens);var w="$feature_flag_called"===e&&!1===b.properties.$feature_flag_has_experiment&&!0===this.get_property("$minimal_flag_called_events");null!=i&&i.$set&&!w&&(b.$set=null==i?void 0:i.$set);
2var x=H(null==t?void 0:t.$set)?t.$set:void 0,k=!(null==i||!i.$set)&&"$fbc"in i.$set,E=k||!!x&&"$fbc"in x,S=k?null==i||null==(s=i.$set)?void 0:s[ib]:null==x?void 0:x[ib],R=q(null==t?void 0:t.$unset)?t.$unset:[],P=(null==i?void 0:i.$unset)||[],$=-1!==R.indexOf("$fbc")||-1!==P.indexOf("$fbc"),F=this.Pu(null==(r=g)?void 0:r.fbclid,S,E,$);F&&!0===b.properties.$process_person_profile&&F.pending&&!E&&!w&&(b.$set=u({[ib]:F.value},b.$set));var I=null==i?void 0:i.$unset;I&&(b.$unset=I);var C=w?void 0:this.$u(null==i?void 0:i.$set_once,e!==sb,e===sy);if(C&&(b.$set_once=C),null!=i&&i._noTruncate||(h=this.config.properties_string_max_length,c=b,d=e=>U(e)?e.slice(0,h):e,p=new Set,b=function e(t,i){if(t!==Object(t))return d?d(t):t;if(!p.has(t)){var s;if(p.add(t),q(t))s=[],sw(t,t=>{s.push(e(t))});else{var r={};sx(ei(t)?s$(t):t,(t,i)=>{p.has(t)||(r[i]=e(t,i))}),s=r}return s}}(c)),b.timestamp=m,V(null==i?void 0:i.timestamp)||(b.properties.$event_time_override_provided=!0,b.properties.$event_time_override_system_time=_),w&&(b.properties=(O=b.properties,void 0===(A=aJ)&&(A=[]),T={},M=e=>{void 0!==O[e]&&(T[e]=O[e])},tJ.forEach(M),A.forEach(M),T)),e===n_||e===nm){var O,A,T,M,L,D,N,j=null==t?void 0:t.$survey_id,B=null==t?void 0:t.$survey_iteration;aI({id:j,current_iteration:B}),b.$set=u({},b.$set,{[(L={id:j,current_iteration:B},N="$survey_"+(D=e===nm?"responded":"dismissed")+"/"+L.id,L.current_iteration&&L.current_iteration>0&&(N="$survey_"+D+"/"+L.id+"/"+L.current_iteration),N)]:!0})}else e===ng&&(b.$set=u({},b.$set,{$survey_last_seen_date:(new Date).toISOString()}));if("product tour shown"===e){var G=null==t?void 0:t.$product_tour_type;G&&(b.$set=u({},b.$set,{["$product_tour_last_seen_date/"+G]:(new Date).toISOString()}))}var W=u({},b.properties.$set,b.$set);if(z(W)||this.setPersonPropertiesForFlags(W),!K(this.config.before_send)){var J=this.bs(b);if(!J)return;(b=J).uuid=th(b.uuid,sN)}var X=null!=(n=null==(a=b.$set)?void 0:a.$fbc)?n:H(null==(o=b.properties)?void 0:o.$set)?b.properties.$set.$fbc:void 0,Y=null!=F&&F.pending&&X===F.value?F.value:void 0;this.zl.emit("eventCaptured",b);var Z=null!=(l=null==i?void 0:i._url)?l:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),Q=u({method:"POST",url:Z,data:b,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(Z)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey},null!=i&&i.transport?{transport:i.transport}:{},Y?{fireCallbackOnDrop:!0,callback:e=>{e.statusCode>=200&&300>e.statusCode&&this.Fu(Y)}}:{});return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly||Y?this.fu(Q):this.cu.enqueue(Q),b}il.critical("This capture call is ignored due to client rate limiting.")}}else il.error("No event name provided to posthog.capture")}else il.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}getExtension(e){var t;return null==(t=this.Tu)?void 0:t.getExtension(e)}ku(){var e;return null!=(e=this.Tu)?e:this.Tu=new aj(this)}Wl(e){this.su.push(e);var t=!0;return()=>{if(t){t=!1;var i=this.su.indexOf(e);-1!==i&&this.su.splice(i,1)}}}Du(e){var t,i,s;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this.uu=null,"anonymous"===this.persistence.get_property("$user_state")&&(null==(s=this.sessionPersistence)||s.clear(),this.ru.clear(),this.Lu()),null==(i=this.featureFlags)||i.reset(),e&&this.reloadFeatureFlags(),!0)}calculateEventProperties(e,t,i,s,r){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;this.persistence.syncCookieProperties(),this.Du();var n,a=r?void 0:this.persistence.remove_event_timer(e),o=u({},t);if(o.token=this.config.token,o.$config_defaults=this.config.defaults,this.Jl()&&(o[so]=!0),"$snapshot"===e){var l=u({},this.persistence.properties(),this.sessionPersistence.properties());return o.distinct_id=l.distinct_id,(!U(o.distinct_id)&&!J(o.distinct_id)||G(o.distinct_id))&&il.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var h,c=function(e,t,i,s){if(void 0===s&&(s=!1),!w)return{};var r,n,a,o,l,u=e?[...rQ,...t||[]]:[],h=e4(w),c=h[0],p=h[1],v=function(e){for(var t=0;te.length>t;t++){var i,s=te[t],r=s[1],n=s[2],a=e.match(s[0]);if(a)return[r,(null==(i=n&&e.match(n)||a)?void 0:i[1])||""]}
2return["",""]}(w),f=v[0],_=v[1],m=null!=(l="u">typeof navigator?navigator:void 0)&&l.brave?{brave:!0}:{},y={};V(i)||(y.detectGoogleSearchApp=i);var b={},x=null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,k=null==(n=navigator)?void 0:n.maxTouchPoints,E=null==d||null==(a=d.screen)?void 0:a.width,S=null==d||null==(o=d.screen)?void 0:o.height,P=null==d?void 0:d.devicePixelRatio;V(x)||(b.userAgentDataPlatform=x),V(k)||(b.maxTouchPoints=k),V(E)||(b.screenWidth=E),V(S)||(b.screenHeight=S),V(P)||(b.devicePixelRatio=P);var $,F,I,C,O,A,T=sk(sP({$os:c,$os_version:p,$browser:e3(w,navigator.vendor,m,y),$webview_app:f,$webview_app_version:_,$device:e9(w),$device_type:(A=e9(w))===ep||A===ed||"Kobo"===A||"Kindle Fire"===A||A===eL?ec:A===eR||A===e$||A===eP||A===eT?"Console":A===ev?"Wearable":A?eu:"Android"===(null==b?void 0:b.userAgentDataPlatform)&&(null!=(F=null==b?void 0:b.maxTouchPoints)?F:0)>0?600>Math.min(null!=(I=null==b?void 0:b.screenWidth)?I:0,null!=(C=null==b?void 0:b.screenHeight)?C:0)/(null!=(O=null==b?void 0:b.devicePixelRatio)?O:1)?eu:ec:"Desktop",$timezone:nt(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:rJ(s?td(null==g?void 0:g.href):null==g?void 0:g.href,u,r1),$host:null==g?void 0:g.host,$pathname:null==g?void 0:g.pathname,$raw_user_agent:w.length>1e3?w.substring(0,997)+"...":w,$browser_version:e6(w,navigator.vendor,m,y),$browser_language:r8(),$browser_language_prefix:"string"==typeof($=r8())?$.split("-")[0]:void 0,$screen_height:null==d?void 0:d.screen.height,$screen_width:null==d?void 0:d.screen.width,$viewport_height:null==d?void 0:d.innerHeight,$viewport_width:null==d?void 0:d.innerWidth,$lib:R.LIB_NAME,$lib_version:R.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return R.SDK_DIST_CHANNEL&&(T.$sdk_dist_channel=R.SDK_DIST_CHANNEL),T}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var p=this.sessionManager.checkAndGetSessionAndWindowId(r,i.getTime(),!0),v=p.windowId;o.$session_id=p.sessionId,o.$window_id=v}this.sessionPropsManager&&sk(o,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&sk(o,this.sessionRecording.sdkDebugProperties),o.$sdk_debug_retry_queue_size=null==(n=this.pu)?void 0:n.length}catch(e){o.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===aE&&(o.$lib_custom_api_host=this.config.api_host),h="$pageview"!==e||r?"$pageleave"!==e||r?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),o=sk(o,h),"$pageview"===e&&f&&(o.title=f.title),!V(a)){var _=i.getTime()-a;o.$duration=parseFloat((_/1e3).toFixed(3))}w&&this.config.opt_out_useragent_filter&&(o.$browser_type=this._is_bot()?"bot":"browser");var m=this.persistence.properties(),y=this.sessionPersistence.properties(),b=o.$groups,x=m.$groups;H(b)&&!z(b)&&(o.$groups=u({},H(x)?x:{},b)),sx(["$referrer","$referring_domain"],e=>{e in m&&delete y[e]});var k={};if(this.su.length>0)for(var E of this.su.slice())try{sk(k,E())}catch(e){il.error("Failed to produce browser extension event properties",e)}(o=sk({},c,m,y,u({},k,o))).$is_identified=this._isIdentified(),q(this.config.property_denylist)?sx(this.config.property_denylist,function(e){delete o[e]}):il.error(aG+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var S=this.config.sanitize_properties;S&&(il.error(aU),o=S(o,e));var P=this.Nu();return o.$process_person_profile=P,P&&!r&&this.qu("_calculate_event_properties"),o}$u(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.Nu()||this.iu&&!i)return e;var s,r=sk({},this.persistence.get_initial_props(),(null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(il.error(aU),r=n(r,"$set_once")),t&&(this.iu=!0),z(r)?void 0:r}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,i;null==(t=this.persistence)||t.syncCookieProperties(),this.Du(),null==(i=this.sessionPersistence)||i.register(e),Object.keys(e).forEach(e
vendor: 5,710 bytes, line 2
2=>this.ru.add(e)),this.Lu()}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e),this.ru.delete(e),this.Lu()}ju(e,t){this.register({[e]:t})}gu(){this.ru.forEach(e=>{var t;null==(t=this.sessionPersistence)||t.unregister(e)}),this.ru.clear(),this.Lu()}Lu(){var e;if(this.nu)if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e.gi||!s5.Et())s5.Dt(this.nu);else{var t=[];this.ru.forEach(e=>t.push(e)),t.length>0?s5.Ot(this.nu,t):s5.Dt(this.nu)}}getFeatureFlag(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!=(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())?e:[]}isFeatureEnabled(e,t){var i,s;return null!=(i=null==(s=this.featureFlags)?void 0:s.isFeatureEnabled(e,t))?i:null==t?void 0:t.defaultValue}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,i){var s;null==(s=this.featureFlags)||s.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var s;null==(s=this.featureFlags)||s.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){var s;return void 0===t&&(t=!1),null==(s=this.featureFlags)?void 0:s.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.zl.on(e,t)}onFeatureFlags(e){return this.featureFlags?this.featureFlags.onFeatureFlags(e):(e([],{},{errorsLoading:!0}),()=>{})}onSurveysLoaded(e){return this.surveys?this.surveys.onSurveysLoaded(e):(e([],{isLoaded:!1,error:aV}),()=>{})}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?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:aV})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:aV})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=aO),null==(i=this.surveys)||i.displaySurvey(e,t)}cancelPendingSurvey(e){var t;null==(t=this.surveys)||t.cancelPendingSurvey(e)}canRenderSurvey(e){var t,i;return null!=(t=null==(i=this.surveys)?void 0:i.canRenderSurvey(e))?t:{visible:!1,disabledReason:aV}}canRenderSurveyAsync(e,t){var i,s;return void 0===t&&(t=!1),null!=(i=null==(s=this.surveys)?void 0:s.canRenderSurveyAsync(e,t))?i:Promise.resolve({visible:!1,disabledReason:aV})}Bu(e){return!e||G(e)?(il.critical("Unique user id has not been set in posthog.identify"),!1):"$posthog_cookieless"===e?(il.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.'),!1):!["distinct_id","distinctid"].includes(e.toLowerCase())&&!["undefined","null"].includes(e.toLowerCase())||(il.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.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return il.uninitializedWarning("posthog.identify");if(J(e)&&(e=e.toString(),il.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Bu(e)&&this.qu("posthog.identify")){this.Yl();var s=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,n=this.Du(!1),a=this.persistence.va(),o=!1;try{var l=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),e!==l&&e!==this.get_property("__alias")&&(this.unregister(iy),this.register({distinct_id:e}));var u=(this.persistence.get_property("$user_state")||"anonymous")===sd,h=e!==l,c=!h&&u;if(h&&u){var d,p=this.config.reuseAnonymousId?{distinct_id:e}:{distinct_id:e,$anon_distinct_id:l};this.persistence.set_property(i7,sp),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.ca(),this.capture(sy,p,{$set:t||{},$set_once:i||{}}),this.uu=ak(e,t,i),null==(d=this.featureFlags)||d.setAnonymousDistinctId(this.config.reuseAnonymousId?void 0:l)}else if(c){this.persistence.set_property(i7,sp);var v=t||{},f=i||{};this.setPersonPropertiesForFlags({$set:v,$set_once:f},!1),this.config.cookieWinsOnConflict&&this.persistence.ca(),this.capture("$set",{$set:v,$set_once:f}),this.uu=ak(e,t,i)}else(t||i)&&this.setPersonProperties(t,i);h||r||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(i6)):c&&(t||i)&&this.reloadFeatureFlags(),o=!0}finally{a&&this.persistence.ga(o)}}}setPersonProperties(e,t){if((e||t)&&this.qu("posthog.setPersonProperties")){var i=ak(this.get_distinct_id(),e,t);this.uu!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.uu=i):il.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(q(e)?e:[e]).filter(e=>U(e)&&e.length>0);0!==i.length&&this.qu("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.uu=null)}group(e,t,i){var s;if(e&&t){null==(s=this.persistence)||s.syncCookieProperties(),this.Du();var r=this.getGroups(),n=r[e]!==t;if(n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:u({},r,{[e]:t})}),(n||i)&&this.Nu()){var a={$group_type:e,$group_key:t};
2i&&(a.$group_set=i),this.capture(sb,a)}i&&this.setGroupPropertiesForFlags({[e]:i}),n&&!i&&this.reloadFeatureFlags()}else il.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),this.qu("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t=Y(e)?e:null==e?void 0:e.resetDeviceID,i=Y(e)||null==e?void 0:e.bootstrap;this.Hu(t,!1,i)}Hu(e,t,i){if(void 0===t&&(t=!1),il.info("reset"),!this.__loaded)return il.uninitializedWarning("posthog.reset");var s,r,n,a,o,l,h,c,d,p,v,f,g,_,m,y,b,w,x=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(s=this.du)?void 0:s.bootstrap)||{},null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.Fa());var k=this.get_property(i_),E=this.get_property(im),S=this.get_property(iA);null==(n=this.sessionRecording)||n.flushBeforeIdentityReset();var R=this.is_capturing();this.consent.reset(),t||!R||this.is_capturing()||console.warn("[PostHog.js]","reset() cleared the stored consent, and capturing is now off because of `opt_out_capturing_by_default`. Call opt_in_capturing() again, and prefer calling reset() before opting in rather than after.");var P=null==(a=this.persistence)||null==a.va?void 0:a.va(),$=!1;try{if(null==(o=this.persistence)||o.clear(),null==(l=this.sessionPersistence)||l.clear(),this.ru.clear(),this.Lu(),V(S)||null==(h=this.persistence)||h.register({[iA]:S}),null==(c=this.surveys)||c.reset(),null==(d=this.featureFlags)||d.reset(),null==(p=this.conversations)||p.reset(),null==(v=this.logs)||v.reset(),null==(f=this.metrics)||f.reset(),null==(g=this.persistence)||g.set_property(i7,sd),null==(_=this.sessionManager)||_.resetSessionId(),this.uu=null,"always"===this.config.cookieless_mode)this.register_once({distinct_id:sa,$device_id:null},"");else{var F=this.config.get_device_id(sN());this.register_once({distinct_id:F,$device_id:e?F:k},""),e||V(E)||this.register({[im]:E})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i&&(void 0===i.distinctID||this.Jl()||(null==(b=this.persistence)||b.set_property(i7,i.isIdentifiedID?sp:sd),this.register({distinct_id:i.distinctID})),null==(m=this.featureFlags)||m.initialize(),!(V(x)||null!=(y=this.sessionManager)&&y.setBootstrapSessionId(x,!0)))){var I=u({},i);delete I.sessionID,this.config.bootstrap=I}delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,$=!0}finally{P&&(null==(w=this.persistence)||null==w.ga||w.ga($))}this.reloadFeatureFlags()}shutdown(e){var t=this;return c(function*(){var e,i,s,r,n,a,o,l;if(t.__loaded){t.ku().dispose(),null==(e=t.sessionRecording)||e.dispose(),null==(i=t.logs)||i.flushLogs("sendBeacon"),null==(s=t.metrics)||s.flush("sendBeacon"),null==(r=t.cu)||r.unload(),null==(n=t.pu)||n.unload();try{null==(l=t.featureFlags)||l.destroy()}catch(e){il.error("Error while destroying feature flags",e)}null==(a=t.persistence)||a.destroy(),null==(o=t.sessionPersistence)||o.destroy()}else il.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var i;delete this.config.identity_claims,this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i.zu()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,delete this.config.identity_claims,null==(e=this.conversations)||e.Uu()}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 t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionStartTimestamp,s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);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("$people_distinct_id")?(il.critical("Attempting to create alias for existing People user - aborting."),-2):this.qu("posthog.alias")?(V(t)&&(t=this.get_distinct_id()),e!==t?(this.ju(iy,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(il.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=u({},this.config);if(H(e)){sk(this.config,a0(e));var i,s,r,n,a,o,l,h,c,d,p,v,f,g=this.tu();null==(i=this.persistence)||i.update_config(this.config,t,g),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new nc(u({},this.config,{persistence:"sessionStorage"}),g,!1);var _=this.hu(this.config.debug);Y(_)&&(this.config.debug=_),Y(this.config.debug)&&(this.config.debug?(R.DEBUG=!0,sU.Et()&&sU.Ot("ph_debug",!0),il.info("set_config",{config:e,oldConfig:t,newConfig:u({},this.config)})):(R.DEBUG=!1,sU.Et()&&sU.Dt("ph_debug"))),null==(s=this.featureFlags)||null==s.updateConfig||s.updateConfig(this.config,this.Fa()),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(n=this.exceptions)||n.onConfigChange(),null==(a=this.sessionRecording)||a.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(l=this.autocapture)||l.startIfEnabled(),null==(h=this.heatmaps)||h.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(c=this.historyAutocapture)||
vendor: 5,376 bytes, line 2
2c.startIfEnabledOrStop()),null==(d=this.exceptionObserver)||d.startIfEnabledOrStop(),null==(p=this.deadClicksAutocapture)||p.startIfEnabledOrStop(),null==(v=this.surveys)||v.loadIfEnabled(),this.eu(),null==(f=this.externalIntegrations)||f.startIfEnabledOrStop(),!t.segment&&this.config.segment&&this.persistence&&rD(this,aH,!1)}}_overrideSDKInfo(e,t){R.LIB_NAME=e,R.LIB_VERSION=t}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){try{if(!this.exceptions)return;var i=this.exceptions.buildProperties(e,{handled:!0,syntheticException:Error("PostHog syntheticException")});return this.exceptions.sendExceptionEvent(u({},i,t))}catch(e){return}}addExceptionStep(e,t){var i;null==(i=this.exceptions)||i.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var t,i;return null!=(t=null==(i=this.logs)?void 0:i.logger)?t:e.Wu}startExceptionAutocapture(e){this.set_config({capture_exceptions:null==e||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){var t,i;return null!=(t=null==(i=this.toolbar)?void 0:i.loadToolbar(e))&&t}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:aX;return t!==aX&&(t="posthog."+t),t}_isIdentified(){var e,t;return"identified"===(null==(e=this.persistence)?void 0:e.get_property("$user_state"))||"identified"===(null==(t=this.sessionPersistence)?void 0:t.get_property("$user_state"))}Nu(){var e,t;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&z(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e.__alias)&&(null==(t=this.persistence)||null==(t=t.props)||!t.$epp))}Ru(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.Nu()||this.qu("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.qu("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}qu(e){return"never"===this.config.person_profiles?(il.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ql(),this.ju(sn,!0),!0)}tu(){if("always"===this.config.cookieless_mode)return!0;var e=this.consent.isOptedOut();return this.config.disable_persistence||e&&!(!this.config.opt_out_persistence_by_default&&"on_reject"!==this.config.cookieless_mode)}eu(){var e,t,i,s,r,n=this.tu();return this.is_capturing()||null==(e=this.logs)||e.Vu(),(null==(t=this.persistence)?void 0:t.gi)!==n&&(null==(i=this.persistence)||i.set_disabled(n)),(null==(s=this.sessionPersistence)?void 0:s.gi)!==n&&(null==(r=this.sessionPersistence)||r.set_disabled(n)),n&&(this.ru.clear(),this.Lu()),n}opt_in_capturing(t){var i,s,r;if("always"!==this.config.cookieless_mode){if(this.Jl()){null==(n=this.sessionRecording)||n.dispose({discardBufferedEvents:!0}),this.Hu(!0,!0),null==(a=this.sessionManager)||a.destroy(),null==(o=this.pageViewManager)||o.destroy(),this.sessionManager=new af(this),this.pageViewManager=new rB(this),this.persistence&&(this.sessionPropsManager=new ad(this,this.sessionManager,this.persistence));var n,a,o,l,u,h,c,d=null!=(l=null==(u=this.config.__extensionClasses)?void 0:u.sessionRecording)?l:null==(h=e.__defaultExtensionClasses)?void 0:h.sessionRecording;d&&(this.sessionRecording=this.Zl(this.sessionRecording,new d(this)),this.Hl&&(null==(c=this.sessionRecording)||null==c.onRemoteConfig||c.onRemoteConfig(this.Hl)))}this.consent.optInOut(!0),this.eu(),this.Mu(),null==(i=this.sessionRecording)||i.startIfEnabledOrStop(),"on_reject"==this.config.cookieless_mode&&(null==(s=this.surveys)||s.loadIfEnabled()),(V(null==t?void 0:t.captureEventName)||null!=t&&t.captureEventName)&&this.capture(null!=(r=null==t?void 0:t.captureEventName)?r:"$opt_in",null==t?void 0:t.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Iu()}else il.warn(az)}opt_out_capturing(){if("always"!==this.config.cookieless_mode){var e,t,i="on_reject"===this.config.cookieless_mode?this.sessionRecording:void 0;null==i||i.dispose({discardBufferedEvents:!0}),"on_reject"===this.config.cookieless_mode&&this.consent.isOptedIn()&&this.Hu(!0,!0),this.consent.optInOut(!1),this.eu(),"on_reject"===this.config.cookieless_mode&&(this.register({distinct_id:sa,$device_id:null}),this.Gl(i),this.sessionRecording=void 0,null==(e=this.sessionManager)||e.destroy(),null==(t=this.pageViewM
2anager)||t.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.Iu(),this.Mu())}else il.warn(az)}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 1===e?"granted":0===e?"denied":"pending"}is_capturing(){return"always"===this.config.cookieless_mode||("on_reject"===this.config.cookieless_mode?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.eu()}_is_bot(){return v?ag(v,this.config.custom_blocked_useragents):void 0}Iu(){f&&("visible"===f.visibilityState?this.ou||(this.ou=!0,this.capture(s_,{title:f.title},{send_instantly:!0}),this.au&&(f.removeEventListener(sf,this.au),this.au=null)):this.au||(this.au=this.Iu.bind(this),sI(f,sf,this.au)))}debug(e){!1===e?(null==d||d.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==d||d.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Fa(){var e,t,i,s,r=this.du||{};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?(il.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&&!K(r[e]),s=t in r&&!K(r[t]),i?r[e]:!!s&&(il&&il.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}bs(e){if(K(this.config.before_send))return e;var t,i=Object.keys(null!=(t=e.properties)?t:{}).filter(Q),s=q(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of s)try{if(r=n(r),K(r)){var a="Event '"+e.event+"' was rejected in beforeSend function";return Z(e.event)?il.warn(a+". This can cause unexpected behavior."):il.info(a),null}r.properties&&!z(r.properties)||il.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(t){return il.error("Error in beforeSend function for event '"+e.event+"':",t),null}for(var o of i)if(r.properties&&K(r.properties[o]))return il.warn("Event '"+e.event+"' had its '"+o+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return r}getPageViewId(){var e;return null==(e=this.pageViewManager.ko)?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)})}hu(e){var t=Y(e)&&!e,i=sU.Et()&&"true"===sU.Lt("ph_debug");return!t&&(!!i||e)}}).__defaultExtensionClasses={},n.Wu={trace:i=()=>{},debug:i,info:i,warn:i,error:i,fatal:i},n),a3=["identify"],a5=0;a3.length>a5;a5++)a2.prototype[a3[a5]]=sR(a2.prototype[a3[a5]]);var a6=class{constructor(e){this.disabled=!1===e;var t=H(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&&this.timeoutMs>i-s.timestamp){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}},a8="$copy_autocapture",a4=iu("[AutoCapture]");function a9(e,t){return t.length>e?t.slice(0,e)+"...":t}var a7=class{zs(){this.Us=void 0,clearTimeout(this.Ws),this.Ws=void 0}Vs(e){var t;if(!rw(e))return!0;for(var i,s=null!=(t=this.Gs().css_selector_ignorelist)?t:rd,r=new Set,n=e;n;)if(i=function(){if(r.size>=1e3||r.has(n))return{v:!0};r.add(n);var e=n,t=rr(e);if(F(t,"ph-no-capture")||F(t,"ph-sensitive")||rx(e)||s.some(t=>ru(e,t)))return{v:!0};var i=n.parentNode;n=rt(i)?i.host:i&&s9(i)?i:null}())return i.v;return!1}Zs(e){if(this.isEnabled&&"pointercancel"!==e.type)if("pointerdown"!==e.type){var t=this.Us;t&&(e.pointerId!==t.id||Math.abs(e.clientX-t.x)>5||Math.abs(e.clientY-t.y)>5?this.zs():"pointerup"===e.type&&(t.released=!0,this.Ws=setTimeout(()=>this.zs(),0)))}else{this.zs();var i,s=ro(e);e.isPrimary&&0===e.button&&!e.ctrlKey&&s&&s9(s)&&(this.Us={target:s,excluded:this.Vs(s),id:e.pointerId,x:e.clientX,y:e.clientY,released:!1,distinctId:null==(i=this.Js)?void 0:i.distinctId})}else this.zs()}Qs(e){var t,i=this.Us;this.zs();var s=ro(e);if(null!=i&&i.released&&i.target.isConnected&&i.distinctId===(null==(t=this.Js)?void 0:t.distinctId)&&e.pointerId===i.id&&(e.detail>0||"touch"===e.pointerType||"pen"===e.pointerType)&&0===e.button&&5>=Math.abs(e.clientX-i.x)&&5>=Math.abs(e.clientY-i.y)&&s&&(s7(s,"html")||s7(s,"body"))){if(i.excluded)return null;var r,n=null!=(r=this.Gs().css_selector_ignorelist)?r:rd;return[s,null==f?void 0:f.documentElement,null==f?void 0:f.body].some(e=>{if(!e)return!1;var t=rr(e);return F(t,"ph-no-capture")||F(t,"ph-sensitive")||!rw(e)||rx(e)||n.some(t=>ru(e,t))})?null:i.target}}constructor(e){this.Ks=e,this.name="autocapture",this.Xs=!1,this.Ys=null,this.eo=!1,this.io=!1,this.Rn={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.ro=!1,this.Ks.refresh(this.Rn),this.rageclicks=new a6(this.Rn.rageclick),this.no=null}setup(e){this.so(),this.Js=e;var t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.ro?t.dispose():(this.oo=t,this.startIfEnabled())}dispose(){var e;this.ro||(this.ro=!0,this.Js=void 0,null==(e=this.oo)||e.dispose(),this.oo=void 0,this.ao())}Gs(){return this.Ks.refresh(this.Rn),this.Rn}so(){var e,t;return this.Gs(),this.Rn.url_allowlist=null==(e=this.Rn.url_allowlist)?void 0:e.map(e=>new RegExp(e)),this.Rn.url_ignorelist=null==(t=this.Rn.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),this.Rn}
2lo(){if(this.isBrowserSupported()){if(d&&f){var e=this.uo=e=>{e=e||(null==d?void 0:d.event);try{if("blur"===e.type)return void this.zs();if(0===e.type.indexOf("pointer"))return void this.Zs(e);var t="click"===e.type?this.Qs(e):void 0;if(W(t))return;this.ho(e,"$autocapture",t)}catch(e){a4.error("Failed to capture event",e)}};if(sI(d,"blur",e),sI(f,"submit",e,{capture:!0}),sI(f,"change",e,{capture:!0}),sI(f,"click",e,{capture:!0}),sx(["pointerdown","pointermove","pointerup","pointercancel"],t=>{sI(f,t,e,{capture:!0})}),this.Gs().capture_copied_text){var t=this.do=e=>{e=e||(null==d?void 0:d.event);try{this.ho(e,a8)}catch(e){a4.error("Failed to capture clipboard event",e)}};sI(f,"copy",t,{capture:!0}),sI(f,"cut",t,{capture:!0}),sI(f,"paste",t,{capture:!0})}}}else a4.info("Disabling Automatic Event Collection because this browser is not supported")}ao(){this.zs(),this.uo&&(null==d||d.removeEventListener("blur",this.uo),sx(["pointerdown","pointermove","pointerup","pointercancel"],e=>{null==f||f.removeEventListener(e,this.uo,!0)}),null==f||f.removeEventListener("submit",this.uo,!0),null==f||f.removeEventListener("change",this.uo,!0),null==f||f.removeEventListener("click",this.uo,!0),this.uo=void 0),this.do&&(null==f||f.removeEventListener("copy",this.do,!0),null==f||f.removeEventListener("cut",this.do,!0),null==f||f.removeEventListener("paste",this.do,!0),this.do=void 0),this.Xs=!1}startIfEnabled(){this.isEnabled||this.zs(),!this.ro&&this.Js&&this.isEnabled&&!this.Xs&&(this.lo(),this.Xs=!0)}onRemoteConfig(e){if(!this.ro)if(this.eo=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this.io=t.elementsChainAsString);var i,s=t.autocapture_opt_out;Y(s)&&(null==(i=this.Js)||i.kv.set(ik,s),this.Ys=s),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this.no=e}getElementSelectors(e,t){var i,s=[];return null==(i=this.no)||i.forEach(i=>{var r;null==f||null==(r=f.querySelectorAll(i))||r.forEach(r=>{e!==r&&t!==r||F(s,i)||s.push(i)})}),s}get isEnabled(){if(this.ro)return!1;var e,t,i=null==(e=this.Js)?void 0:e.kv.get(ik),s=this.Ys,r=this.Gs();if(!r.remoteRequestsDisabled&&!this.eo)return!1;var n=r.remoteRequestsDisabled&&!this.eo;if(W(s)&&!Y(i)&&!n)return!1;var a=null!=(t=this.Ys)?t:!!i;return!!r.enabled&&!a}ho(e,t,i){if(void 0===t&&(t="$autocapture"),this.isEnabled){var s=i||ro(e);re(s)&&(s=s.parentNode||null);var r,n=this.so();"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&n.rageclick&&null!=(r=this.rageclicks)&&r.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&rm(s,n.rageclick)&&this.ho(e,"$rageclick",i);var a=t===a8,o=a?u({},n,{dom_event_allowlist:void 0}):n;if(s&&function(e,t,i,s,r,n){if(!d||ry(e)||null!=i&&i.url_allowlist&&!rs(i.url_allowlist,n)||null!=i&&i.url_ignorelist&&rs(i.url_ignorelist,n))return!1;if(null!=i&&i.dom_event_allowlist){var a,o=i.dom_event_allowlist;if(o&&!o.some(e=>t.type===e))return!1}var l=rb(e,s),u=l.parentIsUsefulElement,h=l.targetElementList;if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(V(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}(h,i)||!rh(h,null==i?void 0:i.css_selector_allowlist)||rh(h,null!=(a=null==i?void 0:i.css_selector_ignorelist)?a:rd))return!1;try{var c=d.getComputedStyle(e);if(c&&"pointer"===c.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var p=e.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return u?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(rl.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,o,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:n.getCurrentUrl}})){var l,h=function(e,t){var i,s,r=t.e,n=t.maskAllElementAttributes,a=t.maskAllText,o=t.elementAttributeIgnoreList,l=t.elementsChainAsString,h=t.disableCaptureUrlHashes;if(!s9(e))return{props:{}};for(var c=[e],p=new Set([e]),v=e;v.parentNode&&!s7(v,"body")&&1e3>c.length;)if(rt(v.parentNode)){var f=v.parentNode.host;if(p.has(f))break;p.add(f),c.push(f),v=f}else{if(!s9(v.parentNode)||p.has(v.parentNode))break;p.add(v.parentNode),c.push(v.parentNode),v=v.parentNode}var g="click"===r.type&&"http://www.w3.org/2000/svg"===e.namespaceURI?c.findIndex(e=>s7(e,"button")||s7(e,"a")):-1;g>0&&(a=a||c.slice(0,g+1).some(e=>!rw(e)||rx(e)));var _,m=[],y={},b=!1,w=!1;if(sx(c,e=>{var t=rw(e);if(s7(e,"a")){var i=e.getAttribute("href");b=!!(t&&i&&rF(i))&&(h?td(i):i)}F(rr(e),"ph-no-capture")&&(w=!0),m.push(function(e,t,i,s,r){void 0===r&&(r=!1);var n=e.tagName.toLowerCase(),a={tag_name:n};rl.indexOf(n)>-1&&!i&&(a.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?a9(1024,rI(e)):a9(1024,ra(e)));var o=rr(e);o.length>0&&(a.classes=o.filter(function(e){return""!==e})),sx(e.attributes,function(i){var n;if((!rx(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&
2!t&&rF(i.value)&&(!U(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=i.value;"class"===i.name&&(o=ri(o).join(" ")),a["attr__"+i.name]=a9(1024,"href"===i.name&&r?td(o):o)}});for(var l=1,u=1,h=e;h=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!s9(t))return t}(h);)l++,h.tagName===e.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(e,n,a,o,h)),sx(function(e){if(!rw(e))return{};var t={};return sx(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&&rF(s)&&(t[i]=s)}}),t}(e),(e,t)=>{({}).hasOwnProperty.call(y,t)||(y[t]=e)})}),w)return{props:{},explicitNoCapture:w};if(g>0&&(e=c[g],m.splice(0,g)),a||(m[0].$el_text=s7(e,"a")||s7(e,"button")?rI(e):ra(e)),b){m[0].attr__href=b;var x,k,E=null==(x=rW(b))?void 0:x.host,S=null==d||null==(k=d.location)?void 0:k.host;E&&S&&E!==S&&(_=b)}return{props:sk({$event_type:r.type,$ce_version:1},l?{}:{$elements:m},{$elements_chain:q(m)?m.map(e=>{var t,i,s={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:function(e){var t=e.attr__class;if(t)return q(t)?t:ri(t)}(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return sE(e).filter(e=>0===e[0].indexOf("attr__")).forEach(e=>s.attributes[e[0]]=e[1]),s}).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=u({},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 sE(n).sort((e,t)=>{var i,s;return(s=t[0])>(i=e[0])?-1:+(i>s)}).forEach(e=>{var t=e[1];return a[rC(e[0].toString())]=rC(t.toString())}),(s+=":")+sE(a).map(e=>e[0]+'="'+e[1]+'"').join("")}).join(";"):""},null!=(i=m[0])&&i.$el_text?{$el_text:null==(s=m[0])?void 0:s.$el_text}:{},_&&"click"===r.type?{$external_click_url:_}:{},y),target:e}}(s,{e:e,maskAllElementAttributes:n.maskAllElementAttributes,maskAllText:n.maskAllText,elementAttributeIgnoreList:n.element_attribute_ignorelist,elementsChainAsString:this.io,disableCaptureUrlHashes:n.disableCaptureUrlHashes}),c=h.props;if(h.explicitNoCapture)return!1;var p=this.getElementSelectors(s,h.target);if(p&&p.length>0&&(c.$element_selectors=p),t===a8){var v=e.type||"clipboard";if("paste"!==v){var f,g,_=null==d||null==(f=d.getSelection())?void 0:f.toString(),m=rn(_);if(!m)return!1;c.$selected_content=m,c.$clipboard_text_length=null!=(g=null==_?void 0:_.length)?g:0}c.$copy_type=v}return null==(l=this.Js)||l.capture(t,c).catch(e=>a4.error("Failed to capture event",e)),!0}}else this.zs()}isBrowserSupported(){return B(null==f?void 0:f.querySelectorAll)}},oe=class{constructor(e){this._instance=e}refresh(e){var t=this._instance.config,i=H(t.autocapture)?t.autocapture:void 0;e.enabled=!!t.autocapture,e.rageclick=t.rageclick,e.maskAllElementAttributes=t.mask_all_element_attributes,e.maskAllText=t.mask_all_text,e.disableCaptureUrlHashes=t.disable_capture_url_hashes,e.getCurrentUrl=t.get_current_url,e.remoteRequestsDisabled=this._instance.Fa(),e.url_allowlist=null==i?void 0:i.url_allowlist,e.url_ignorelist=null==i?void 0:i.url_ignorelist,e.dom_event_allowlist=null==i?void 0:i.dom_event_allowlist,e.element_allowlist=null==i?void 0:i.element_allowlist,e.css_selector_allowlist=null==i?void 0:i.css_selector_allowlist,e.css_selector_ignorelist=null==i?void 0:i.css_selector_ignorelist,e.element_attribute_ignorelist=null==i?void 0:i.element_attribute_ignorelist,e.capture_copied_text=null==i?void 0:i.capture_copied_text}},ot=iu("[ExceptionAutocapture]"),oi=()=>{},os=e=>{var t;if(B(e))return null!=(t=e.__posthog_layer__)?t:e.__rrweb_layer__};function or(e,t,i){try{if(!(t in e))return oi;var s={next:e[t]},r=i(function(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];return s.next.apply(this,t)});return B(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:s}})),e[t]=r,()=>{if(e[t]!==r)for(var i=e[t],n=os(i);n;){if(n.next===r)return void(n.next=s.next);n=os(i=n.next)}else e[t]=s.next}}catch(e){return oi}}var on=iu("[TracingHeaders]"),oa=iu("[Web Vitals]"),oo=["CLS","FCP","INP","LCP"],ol=["INP","LCP"],ou=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],oh="disabled",oc="lazy_loading",od=iu("[SessionRecording]"),op=iu("[Heatmaps]");function ov(e){return H(e)&&"clientX"in e&&"clientY"in e&&J(e.clientX)&&J(e.clientY)}var of=iu("[Product Tours]"),og=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(iI))},o_=iu("[SiteApps]"),om="Error while initializing PostHog app with config id ",oy=(e,t)=>null!=e&&e.then?e.then(t):t(e),ob="SDK is not enabled or survey functionality is not yet loaded",ow="Disabled. Not loading surveys.",ox=class{constructor(e,t){this.Ks=e,this.Gu=t,this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Zu=!1,this.Ju=[],this.Qu=null,this.Ku=null,this.ro=!1,this.Xu=new Set,this.onRemoteConfig=e=>{if(!this.ro&&!this.Rn.disableSurveys){if(!e.ok)return aF.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(K(t))return aF.warn("Flags not loaded yet. Not loading surveys.");this.Yu=Y(t)?t:t.length>0,aF.info("flags response received, isSurveysEnabled: "+this.Yu),this.loadIfEnabled()}}}setup(e){if(!this.ro)return this.th=e,oy(e.kv.initialize(),()=>{if(this.th===e&&!this.ro){this.th=void 0,this.Js=e;var t=e.onRemoteConfig(this.onRemoteConfig);this.ro?t.dispose():(this.oo=t,this.loadIfEnabled())}})}dispose(){var e,t,i;this.ro||(this.ro=!0,this.th=void 0,this.Js=void 0,null==(e=this.oo)||e.dispose(),this.oo=void 0,null==(t=this._surveyEventReceiver)||t.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.Ju=[],this.Qu=null,this.Xu.forEach(e
2=>clearTimeout(e)),this.Xu.clear())}get Rn(){return this.Ks.get()}initialize(){this.loadIfEnabled()}reset(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],i=0;i<localStorage.length;i++){var s=localStorage.key(i);(null!=s&&s.startsWith("seenSurvey_")||null!=s&&s.startsWith("inProgressSurvey_"))&&t.push(s)}t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this.ro&&this.Js){var e=this.Rn;if(!this._surveyManager)if(this.Zu)aF.info("Already initializing surveys, skipping...");else if(e.disableSurveys)aF.info(ow);else if(e.cookielessMode&&this.Ks.isOptedOut())aF.info("Not loading surveys in cookieless mode without consent.");else{var t=this.Ks.getExtensions();if(t){if(!V(this.Yu)||e.advancedEnableSurveys){var i=this.Yu||e.advancedEnableSurveys;this.Zu=!0;try{var s=t.generateSurveys;if(s)return this.eh(s,i),void(this.Zu=!1);var r=t.loadExternalDependency;if(!r)return this.ih(sc),void(this.Zu=!1);r(e=>{try{if(this.ro)return;var t=this.Ks.getExtensions();e||null==t||!t.generateSurveys?this.ih("Could not load surveys script",e):this.eh(t.generateSurveys,i)}finally{this.Zu=!1}})}catch(e){throw this.Zu=!1,this.ih("Error initializing surveys",e),e}}}else aF.error("PostHog Extensions not found.")}}}eh(e,t){this.ro||(this._surveyManager=e(t),this._surveyEventReceiver=this.Ks.createEventReceiver(),aF.info("Surveys loaded successfully"),this.rh({isLoaded:!0}))}ih(e,t){aF.error(e,t),this.rh({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Ju.push(e),this._surveyManager&&this.rh({isLoaded:!0}),()=>{this.Ju=this.Ju.filter(t=>t!==e)}}getSurveys(e,t){void 0===t&&(t=!1);var i,s=null!=(i=this.Js)?i:this.Gu;if(s&&!this.ro){if(this.Rn.disableSurveys)return aF.info(ow),e([]);var r=s.kv.get(iQ);if(r&&!t)return e(r,{isLoaded:!0}),void(this.nh()&&this.getSurveys(()=>{},!0));if(this.Qu)this.Qu.then(t=>{this.ro||e(t.surveys,t.context)}).catch(e=>aF.error("Error in survey callback",e));else{var n=this.sh("/api/surveys/",{method:"GET",query:{token:s.projectToken},sentAt:"query",timeoutMs:this.Rn.requestTimeoutMs}).then(e=>{try{return this.oh(s,e)}catch(e){return aF.error("Error processing surveys response",e),this.oh(s,{statusCode:0,error:e})}},e=>this.oh(s,{statusCode:0,error:e}));this.Qu=n;var a=()=>{this.Qu===n&&(this.Qu=null)};n.then(t=>{a(),this.ro||e(t.surveys,t.context)},a).catch(e=>aF.error("Error in survey callback",e))}}}sh(e,t){var i=this.Js;return i?i.sendRequest(e,t):new Promise(e=>e({statusCode:0,error:Error(ob)}))}oh(e,t){if(this.ro)return{surveys:[],context:{isLoaded:!1,error:ob}};var i,s=t.statusCode;if(200!==s||!t.json){var r="Surveys API could not be loaded, status: "+s;return 0!==s?aF.error(r):t.error||aF.warn(r),this.Ku=Date.now(),{surveys:[],context:{isLoaded:!1,error:r}}}this.Ku=null;var n=t.json.surveys||[],a=n.filter(e=>{var t;return!(!e.start_date||e.end_date)&&(am(e)||!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length))});return a.length>0&&(null==(i=this._surveyEventReceiver)||i.register(a)),e.kv.set({[iQ]:n,[i0]:Date.now()}),{surveys:n,context:{isLoaded:!0}}}nh(){return this.ah()&&!this.Qu&&!this.uh()}ah(){var e,t,i=null==(e=null!=(t=this.Js)?t:this.Gu)?void 0:e.kv.get(i0);return J(i)&&Date.now()-i>3e5}uh(){return J(this.Ku)&&3e5>Date.now()-this.Ku}markSurveyAsSeen(e,t){var i;aI({id:e,current_iteration:null!=(i=null==t?void 0:t.iteration)?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}rh(e){for(var t of this.Ju)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){aF.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!K(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);aF.warn("init was not called")}hh(e){var t=null;return this.getSurveys(i=>{var s;t=null!=(s=i.find(t=>t.id===e))?s:null}),t}dh(e){if(K(this._surveyManager))return{eligible:!1,reason:ob};var t="string"==typeof e?this.hh(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}fh(e){if(K(this._surveyManager))return{eligible:!1,reason:ob};var t="string"==typeof e?this.hh(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(K(this._surveyManager))return aF.warn("init was not called"),{visible:!1,disabledReason:ob};var t=this.fh(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return K(this._surveyManager)?(aF.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:ob})):new Promise(i=>
2{this.getSurveys(t=>{var s,r=null!=(s=t.find(t=>t.id===e))?s:null;if(r){var n=this.fh(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(K(this._surveyManager))aF.warn("init was not called");else{var r="string"==typeof e?this.hh(e):e;if(null!=r&&r.id)if(aC.includes(r.type)){var n=null==f?void 0:f.querySelector(t);if(n)if(null!=(s=r.appearance)&&s.surveyPopupDelaySeconds){aF.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout(()=>{var e,t;this.Xu.delete(a),this.ro||(aF.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),aF.info("Survey "+r.id+" rendered"))},1e3*r.appearance.surveyPopupDelaySeconds);this.Xu.add(a)}else this._surveyManager.renderSurvey(r,n,i);else aF.warn("Survey element not found")}else aF.warn("Surveys of type "+r.type+" cannot be rendered in the app");else aF.warn("Survey not found")}}displaySurvey(e,t){var i;if(K(this._surveyManager))aF.warn("init was not called");else{var s=this.hh(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=u({},s,{appearance:u({},s.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==ny&&t.initialResponses&&aF.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.dh(s);if(!n.eligible)return void aF.warn("Survey is not eligible to be displayed: ",n.reason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(r,t):this.renderSurvey(r,t.selector,t.properties)}else aF.warn("Survey not found")}}cancelPendingSurvey(e){K(this._surveyManager)?aF.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()}};function ok(e,t,i){if(K(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}}var oE=class{constructor(e){this._instance=e,this.ph=new Set,this.gh=new Set,this.mh=new ap,this.yh=(e,t)=>this.bh(e,t)&&this._h(e,t)&&this.wh(e,t)&&this.kh(e,t),this.bh=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event)}init(){var e,t;V(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.Sh=null==(t=this._instance)?void 0:t._addCaptureHook((e,t)=>{this.on(e,t)}))}dispose(){var e;null==(e=this.Sh)||e.call(this),this.Sh=void 0,this.mh=new ap}register(e){var t,i;if(!V(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t;this.ph.add(e),null==(t=e.steps)||t.forEach(e=>{this.gh.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var s=new Set;this.ph.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&s.add(e.selector)})}),this._instance.autocapture.setElementSelectors(s)}}replace(e){this.ph.clear(),this.gh.clear(),this.register(e)}on(e,t){null!=t&&0!=e.length&&(this.gh.has(e)||this.gh.has(t.event))&&this.ph.forEach(e=>{this.xh(t,e)&&this.mh.emit("actionCaptured",e.name)})}Ch(e){this.onAction("actionCaptured",t=>e(t))}xh(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.yh(e,i))return!0;return!1}onAction(e,t){return this.mh.on(e,t)}_h(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||!ok(s,t.url,t.url_matching||"contains"))return!1}return!0}wh(e,t){return!!this.Th(e,t)&&!!this.Mh(e,t)&&!!this.Ih(e,t)}Th(e,t){if(null==t||!t.href)return!0;var i=this.Eh(e);if(i.length>0)return i.some(e=>ok(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&&ok((r=n.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}Mh(e,t){if(null==t||!t.text)return!0;var i=this.Eh(e);if(i.length>0)return i.some(e=>ok(e.text,t.text,t.text_matching||"exact")||ok(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;!K(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=>ok(e,n,a)))}Ih(e,t){if(null==t||!t.selector||null!=e&&null!=(i=e.properties)&&null!=(i=i.$element_selectors)&&i.includes(t.selector))return!0;var i,s,r=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";if(t.selector_regex&&r)try{return new RegExp(t.selector_regex).test(r)}catch(e){}return!1}Eh(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}kh(e,t){return null==t||!t.properties||0===t.properties.length||ax(t.properties.reduce((e,t)=>
vendor: 4,854 bytes, line 2
2{var i=q(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)}},oS=class{constructor(e){var t;this.Rh=[],this._instance=e,this.Ah=new Map,this.Ph=new Map,this.Fh=new Map,this.Oh=null==(t=this._instance)||null==t.onSessionId?void 0:t.onSessionId(e=>this.$h(e))}Dh(e){return!1}Lh(){return null}Nh(e){}qh(){}jh(e,t){return!!e&&ax(e.propertyFilters,null==t?void 0:t.properties)}Bh(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}Hh(e,t,i){var s=(i===nv?this.Ah:this.Ph).get(e),r=[];return this.zh(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.jh(n,t)})}register(e){this.Uh(e,!1)}replace(e){this.Uh(e,!0)}Uh(e,t){var i;V(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.Wh(e,t),this.Vh(e,t))}Vh(e,t){var i,s=e.filter(e=>{var t;return null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)?void 0:t.length});if(t&&this.Fh.clear(),0!==s.length){this.Gh||(this.Gh=new oE(this._instance),this.Gh.init(),this.Gh.Ch(e=>this.onAction(e)));var r=[];s.forEach(e=>{var t;null==(t=e.conditions)||null==(t=t.actions)||t.values.forEach(t=>{if(r.push(t),t.name){var i,s=null!=(i=this.Fh.get(t.name))?i:[];s.includes(e.id)||s.push(e.id),this.Fh.set(t.name,s)}})}),t?this.Gh.replace(r):this.Gh.register(r)}else t&&(null==(i=this.Gh)||i.replace([]))}Zh(e,t){t.forEach((t,i)=>{var s,r=null!=(s=e.get(i))?s:[];t.forEach(e=>{r.includes(e)||r.push(e)}),e.set(i,r)})}Wh(e,t){var i,s=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}),r=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}),n=this.Bh(e,nv),a=this.Bh(e,nf);t?(this.Ah=n,this.Ph=a):(this.Zh(this.Ah,n),this.Zh(this.Ph,a)),(0!==s.length||0!==r.length)&&(null!=this.Sh||(this.Sh=null==(i=this._instance)?void 0:i._addCaptureHook((e,t)=>{this.onEvent(e,t)})))}onEvent(e,t){var i,s,r=this.Jh(),n=(null==t||null==(i=t.properties)?void 0:i.$survey_id)||(null==t||null==(s=t.properties)?void 0:s.$product_tour_id);if(n&&this.getActivatedIds().includes(n)){var a=this.Qh(e,n);if("consume"===a)return r.info("event consumed activated item, removing it",{event:e,itemId:n}),void this.Kh([n]);if("persist"===a)return r.info("shown item promoted to persisted activation",{event:e,itemId:n}),this.Xh(n),void this.Yh([n])}if(this.Ph.has(e)){var o=this.Hh(e,t,nf);o.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:o.map(e=>e.id)}),this.Kh(o.map(e=>e.id)),o.forEach(e=>this.td(e.id)))}if(this.Ah.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.Ah.get(e)});var l=this.Hh(e,t,nv);this.ed(l.map(e=>e.id))}}onAction(e){this.Fh.has(e)&&this.ed(this.Fh.get(e)||[])}ed(e){var t;if(0!==e.length){var i=!(null==(t=this._instance)||null==t.get_session_id||!t.get_session_id()),s=[];for(var r of e)i&&this.Dh(r)?this.Xh(r)&&this.rd(r):s.push(r);s.length>0&&(this.Rh=[...new Set([...this.Rh,...s])]),this.Jh().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Xh(e){this.Rh=this.Rh.filter(t=>t!==e);var t=this.nd();return!t.includes(e)&&(this.sd([...t,e]),this.od(),!0)}Kh(e){var t=new Set(e);this.Rh=this.Rh.filter(e=>!t.has(e));var i=this.ad(),s=i.filter(e=>!t.has(e));s.length!==i.length&&(this.sd(s),0===s.length&&this.ld()),this.Yh(e)}ud(){var e,t=this.Lh();if(!t)return{};var i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return i&&"object"==typeof i?i:{}}rd(e){if(this.Lh()){var t=this.ud();this.Nh(u({},t,{[e]:Date.now()}))}}Yh(e){if(this.Lh()){var t=this.ud(),i={},s=!1;for(var r of Object.entries(t)){var n=r[0],a=r[1];e.includes(n)?s=!0:i[n]=a}s&&(z(i)?this.qh():this.Nh(i))}}hd(){this.Lh()&&this.qh()}getActivationTimestamp(e){if(this.nd().includes(e)){var t=this.ud()[e];return J(t)?t:void 0}}ad(){var e,t=this.dd();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}nd(){var e,t,i=this.ad();if(0===i.length)return[];var s=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.vd()],r=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return r&&s===r?i:[]}od(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this.fd(t)}ld(){this.pd()}$h(e){var t,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.vd()];if(i&&i!==e){var s=this.ad(),r=this.ud();s.length>0&&(this.sd([]),s.filter(e=>
2J(r[e])).forEach(e=>this.td(e))),this.ld(),this.hd()}}getActivatedIds(){return[...new Set([...this.nd(),...this.Rh])].filter(e=>!this.gd(e))}dispose(){var e,t,i;null==(e=this.Oh)||e.call(this),this.Oh=void 0,null==(t=this.Sh)||t.call(this),this.Sh=void 0,null==(i=this.Gh)||i.dispose(),this.Gh=void 0}reset(){this.Rh=[],this.ad().length>0&&this.sd([]),this.ld(),this.hd()}getEventToItemsMap(){return this.Ah}md(){return this.Gh}},oR=class extends oS{constructor(e){super(e)}dd(){return i1}vd(){return i2}Lh(){return i3}Nh(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[i3]:e})}qh(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(i3)}Dh(e){this.zh(t=>{i=t.find(t=>t.id===e)});var t,i,s=null==(t=i)||null==(t=t.appearance)?void 0:t.surveyPopupDelaySeconds;return J(s)&&s>0}yd(){return ng}zh(e){var t;null==(t=this._instance)||t.getSurveys(e)}td(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}Jh(){return aF}sd(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[i1]:e})}fd(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[i2]:e})}pd(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(i2)}gd(){return!1}Qh(e,t){var i,s,r;return this.zh(e=>{i=e.find(e=>e.id===t)}),!i||am(s=i)&&!(null==(r=s.conditions)||null==(r=r.events)||!r.repeatedActivation)||"always"===s.schedule?e===ng?"consume":"ignore":e===ng?"persist":e===n_||e===nm?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}},oP=class{constructor(e){this._instance=e}initialize(){}get(e){if("string"==typeof e)return this._instance.get_property(e);var t={};for(var i of e){var s=this._instance.get_property(i);V(s)||(t[i]=s)}return t}set(e,t){this._instance.register("string"==typeof e?{[e]:t}:e)}remove(e){"string"!=typeof e?e.forEach(e=>this._instance.unregister(e)):this._instance.unregister(e)}},o$=class{constructor(e){this._instance=e}get(){var e=this._instance.config;return{disableSurveys:e.disable_surveys,cookielessMode:!!e.cookieless_mode,advancedEnableSurveys:e.advanced_enable_surveys,requestTimeoutMs:e.surveys_request_timeout_ms}}isOptedOut(){return this._instance.consent.isOptedOut()}getExtensions(){var e=null==E?void 0:E.__PosthogExtensions__;if(e){var t=e.generateSurveys,i=e.loadExternalDependency;return{generateSurveys:t?e=>t(this._instance,e):void 0,loadExternalDependency:i?e=>i(this._instance,"surveys",e):void 0}}}createEventReceiver(){return new oR(this._instance)}},oF=null!=d&&d.location?rX(d.location.hash,"__posthog")||rX(location.hash,"state"):null,oI="_postHogToolbarParams",oC=iu("[Toolbar]"),oO=iu("[FeatureFlags]"),oA=class{constructor(e,t){void 0===t&&(t=!1),this.bd=!1,this.update(e,t)}update(e,t){var i,s,r,n,a;this._d={bootstrap:{featureFlags:null==(i=e.bootstrap)?void 0:i.featureFlags,featureFlagPayloads:null==(s=e.bootstrap)?void 0:s.featureFlagPayloads},remoteRequestsDisabled:t,featureFlagsDisabled:!!e.advanced_disable_feature_flags,onlyEvaluateSurveyFeatureFlags:!!e.advanced_only_evaluate_survey_feature_flags,deduplicateCallsPerSession:!!e.advanced_feature_flags_dedup_per_session,cacheTtlMs:e.feature_flag_cache_ttl_ms,refreshIntervalMs:null!=(r=e.remote_config_refresh_interval_ms)?r:3e5,requestTimeoutMs:e.feature_flag_request_timeout_ms,compression:e.disable_compression?void 0:"best-available",evaluationContexts:null!=(n=null!=(a=e.evaluation_contexts)?a:e.evaluation_environments)?n:[],flagKeys:q(e.flag_keys)?e.flag_keys:void 0},!e.evaluation_environments||e.evaluation_contexts||this.bd||(oO.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.bd=!0),V(e.flag_keys)||q(e.flag_keys)||oO.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this._d}},oT=iu("[FeatureFlags]"),oM=iu("[FeatureFlags]",{debugEnabled:!0}),oL="\" failed. Feature flags didn't load in time.",oD="connection_error",oN=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},oj=e=>{var t={};for(var i of sE(e||{})){var s=i[1];s&&(t[i[0]]=s)}return t},oq=e=>ei(e)&&("RangeError"===e.name&&0===e.message.indexOf("Maximum call stack size exceeded")||"InternalError"===e.name&&"too much recursion"===e.message),oB=iu("[Error tracking]"),oH="webkit-masked-url:",oz=[{value:"isolatedAPI.contexts.topHostname",exact:!1},{value:"No response from target",exact:!0}],oV=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:",oH],oU=["__firefox__","__gCrWeb"],oG="Refusing to render web experiment since the viewer is a likely bot",oW={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>ay(t,e),not_regex:(e,t)=>!ay(t,e),exact:(e,t)=>
2t===e,is_not:(e,t)=>t!==e},oK=iu("[Conversations]"),oJ="Conversations not available yet.";function oX(e,t){var i,s,r,n,a,o,l,h=null!=(i=null==e?void 0:e.flushIntervalMs)?i:3e3,c=null!=(s=null==e?void 0:e.maxBufferSize)?s:100,d=null!=t&&t.consoleCapture?void 0:null!=(r=null==e?void 0:e.maxLogsPerInterval)?r:1e3,p=V(d)?Math.max(c,2048):Math.max(c,d),f=u({},function(){var e,t,i,s="",r="";try{var n=null==v?void 0:v.userAgent;if(n){var a=e4(n);s=a[0],r=a[1]}}catch(e){}return e=s,t=r,i=function(e){if(e)return({}).hasOwnProperty.call(t4,e)?t4[e]:e}(e),u({},i?{"os.name":i}:{},t?{"os.version":t}:{})}(),null==e?void 0:e.resourceAttributes);return{serviceName:null!=(n=null!=(a=null==f?void 0:f["service.name"])?a:null==e?void 0:e.serviceName)?n:null==t?void 0:t.serviceNameDefault,serviceVersion:null!=(o=null==f?void 0:f["service.version"])?o:null==e?void 0:e.serviceVersion,environment:null!=(l=null==f?void 0:f["deployment.environment"])?l:null==e?void 0:e.environment,resourceAttributes:f,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:h,maxBufferSize:c,maxQueueSize:p,maxBatchRecordsPerPost:100,rateCapWindowMs:h,maxLogsPerInterval:d,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}var oY=["debug","log","warn","error","info"],oZ="console",oQ="__posthogHandledLogsRequestError",o0=(e,t)=>{var i=e instanceof Error?e:Error(t);return i[oQ]=!0,i},o1=e=>!!e&&"object"==typeof e&&!0===e[oQ],o2={featureFlags:class{constructor(e){this.name="featureFlags",this.wd=!1,this.featureFlagEventHandlers=[],this.A=oT,this.kd={},this.Sd={},this.xd=[],this.Cd=!1,this.Td=!1,this.Md=0,this.Id=!1,this.Ed=!1,this.Rd=!1,this.Ad=!1,this.Pd=0,this.nr=()=>{var e=this.Fd();this.Pd=0,e&&this.reloadFeatureFlags()},this.Od=()=>{var e,t=this.$d;V(t)||this.Rn.remoteRequestsDisabled||!f||"hidden"===f.visibilityState||Date.now()-(null!=(e=this.Dd)?e:0)<t||(this.reloadFeatureFlags(),this.Ld())},this.ar=()=>{"visible"===(null==f?void 0:f.visibilityState)&&this.Od()},"get"in e?this.Ks=e:(this._instance=e,this.Nd=new oA(e.config,e.Fa()),this.Ks=this.Nd)}updateConfig(e,t){var i;null==(i=this.Nd)||i.update(e,t),this.Js&&this.qd()}setup(e){return this.th=e,this.A=e.logger.createLogger("[FeatureFlags]"),oy(e.kv.initialize(),()=>{this.th===e&&(this.th=void 0,this.Js=e,this.jd(e))})}jd(e){var t;if(this.Js===e)return d&&sI(d,"online",this.nr),this.qd(),this.Bd=e.registerDynamicEventProperties(()=>this.Hd()?this.kd:this.Sd),this.zd=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.onCrossTabFeatureFlagChange(()=>{this.Ud(),this.Wd(),this.Vd()}),this.Wd(),this.initialize()}qd(){var e=this.Rn.refreshIntervalMs,t=!this.Rn.remoteRequestsDisabled&&f&&!V(e)&&e>0?e:void 0;t!==this.$d&&(this.Gd(),V(t)||(this.$d=t,this.Ld(),null!=f&&f.addEventListener&&sI(f,sf,this.ar)))}Ld(){V(this.$d)||(V(this.Zd)||clearInterval(this.Zd),this.Dd=Date.now(),this.Zd=setInterval(this.Od,this.$d))}Gd(){V(this.Zd)||(clearInterval(this.Zd),this.Zd=void 0,null==f||null==f.removeEventListener||f.removeEventListener(sf,this.ar)),this.$d=void 0,this.Dd=void 0}destroy(){this.Jd()}dispose(){this.Jd()}Jd(){var e,t;this.Gd(),this.Md++,this.Ed=!1,this.th=void 0,this.Js&&(this.Qd(),null==(e=this.Bd)||e.dispose(),this.Bd=void 0,null==(t=this.zd)||t.call(this),this.zd=void 0,this.xd=[],null==d||d.removeEventListener("online",this.nr),this.Js=void 0)}get Rn(){return this.Ks.get()}Kd(e){var t;return this.Xd&&e in this.Xd?this.Xd[e]:null==(t=this.Js)?void 0:t.kv.get(e)}Ud(){return!!this.Xd&&(this.Xd=void 0,!0)}Yd(){var e;return!V(null==(e=this.Js)?void 0:e.kv.get("$enabled_feature_flags"))&&this.Ud()}Ot(e){this.tv(()=>{var t;return null==(t=this.Js)?void 0:t.kv.set(e)})}ev(e,t,i){var s;if(null!=(s=this._instance)&&s.persistence&&e.$enabled_feature_flags){var r=this.Kd("$enabled_feature_flags")||{},n=e.$enabled_feature_flags||{},a=t.flags||t.featureFlags,o=t.flags?Object.entries(t.flags).filter(e=>{var t=e[1];return!(null!=t&&t.failed)}).map(e=>e[0]):[],l=!!t.errorsWhileComputingFlags&&!!t.flags,u=l?o:i&&!q(a)?Object.keys(a||{}):Array.from(new Set([...Object.keys(r),...Object.keys(n)])),h=this.Kd("$feature_flag_payloads")||{},c=e.$feature_flag_payloads||{},d=l||i?u:Array.from(new Set([...Object.keys(h),...Object.keys(c)])),p=!l&&!i,v=!!p||u,f={[iH]:v,[iB]:v,[iU]:!!p||d};for(var g of(e.$feature_flag_details&&(f[iV]=v),[iG,i9,iW]))V(e[g])||(f[g]=!0);this._instance.persistence.markCrossTabFeatureFlagChanges(f)}}Dt(e){this.tv(()=>{var t;return null==(t=this.Js)?void 0:t.kv.remove(e)})}tv(e){try{e()}catch(e){this.A.error("Failed to update feature flag persistence",e)}}Wd(){var e={};for(var t of[iH,iU,iG,iK]){var i=this.Kd(t);V(i)||(e[t]=i)}this.kd=e;var s=u({},e),r=this.Kd(iB);if(r)for(var n of Object.entries(r))s["$feature/"+n[0]]=n[1];this.Sd=s}Hd(){var e=this.Rn.cacheTtlMs;
2if(!e||0>=e)return!1;var t=this.Kd(i9);return"number"!=typeof t||Date.now()-t>e}iv(){return!!this.Hd()&&(this.Ad||this.Td||(this.Ad=!0,this.A.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}rv(){var e=this.Rn.evaluationContexts;return null!=e&&e.length?e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.A.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}nv(){var e=this.Rn.flagKeys;if(!V(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.A.error("Invalid flag key found:",e,"Expected non-empty string"),t})}initialize(){var e,t,i=this.Rn,s=null!=(e=null==(t=i.bootstrap)?void 0:t.featureFlags)?e:{};if(Object.keys(s).length){var r,n,a=null!=(r=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)?r:{},o=Object.keys(s).filter(e=>!V(s[e])).reduce((e,t)=>(e[t]=s[t],e),{}),l=Object.keys(a).filter(e=>o[e]).reduce((e,t)=>(e[t]=a[t],e),{});return this.sv({featureFlags:o,featureFlagPayloads:l},void 0,{persist:!1})}}updateFlags(e,t,i){var s,r,n=null!=i&&i.merge&&null!=(s=this.Kd("$enabled_feature_flags"))?s:{},a=null!=i&&i.merge&&null!=(r=this.Kd("$feature_flag_payloads"))?r:{},o=u({},n,e),l=u({},a,t),h={};for(var c of Object.entries(o)){var d=c[0],p=c[1];h[d]={key:d,enabled:tU(p),variant:tG(p),reason:void 0,metadata:V(null==l?void 0:l[d])?void 0:{id:0,version:void 0,description:void 0,payload:l[d]}}}this.sv({flags:h})}get hasLoadedFlags(){return this.Cd}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.Kd(iV),t=this.Kd(iK),i=this.Kd(iJ);if(!i&&!t)return e||{};var s=sk({},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],h=V(l)?null!=(n=null==o?void 0:o.enabled)&&n:!!l,c=V(l)?null==o?void 0:o.variant:"string"==typeof l?l:void 0,d=null==i?void 0:i[r],p=u({},o,{enabled:h,variant:h?null!=c?c:null==o?void 0:o.variant:void 0});h!==(null==o?void 0:o.enabled)&&(p.original_enabled=null==o?void 0:o.enabled),c!==(null==o?void 0:o.variant)&&(p.original_variant=null==o?void 0:o.variant),d&&(p.metadata=u({},null==o?void 0:o.metadata,{payload:d,original_payload:null==o||null==(a=o.metadata)?void 0:a.payload})),s[r]=p}return this.wd||(this.A.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.wd=!0),s}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{var s=e[i];return{key:i,enabled:tU(s),variant:tG(s),payload:tV(t[i])}})}getFlagVariants(){var e=this.Kd(iB),t=this.Kd(iK);if(!t)return e||{};for(var i=sk({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.wd||(this.A.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.wd=!0),i}getFlagPayloads(){var e=this.Kd(iU),t=this.Kd(iJ);if(!t)return e||{};for(var i=sk({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.wd||(this.A.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.wd=!0),i}reloadFeatureFlags(){this.Id||this.Rn.featureFlagsDisabled||this.Fd()||(this.Td&&(this.Ed=!0),this.ov||(this.xd.slice().forEach(e=>{try{e()}catch(e){this.A.error("Error while running feature flags reloading callback",e)}}),this.ov=setTimeout(()=>{this.av()},5)))}Qd(){clearTimeout(this.ov),this.ov=void 0}onReloading(e){return this.xd.push(e),()=>{this.xd=this.xd.filter(t=>t!==e)}}ensureFlagsLoaded(){this.Cd||this.Td||this.ov||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Id=e}resetFlagCallReported(){this.Dt(i6)}av(e){this.Qd();var t=this.Js;if(t&&!this.Rn.remoteRequestsDisabled&&!this.Fd())if(this.Td)this.Ed=!0;else{var i={token:t.projectToken,distinct_id:t.distinctId,groups:t.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:u({},t.initialPersonProperties,this.Kd("$stored_person_properties")||{},{$lib:t.library.name,$lib_version:t.library.version}),group_properties:this.Kd(iY),timezone:nt()};V(t.deviceId)||(i.$device_id=t.deviceId),(null!=e&&e.disableFlags||this.Rn.featureFlagsDisabled)&&(i.disable_flags=!0);var s=this.rv();s.length&&(i.evaluation_contexts=s);var r=this.nv();V(r)||(i.flag_keys=r);var n=this.Rn.onlyEvaluateSurveyFeatureFlags,a=this.Md;this.Td=!0;var o=()=>{this.Ed&&(this.Ed=!1,this.av())},l=e=>{this.Td=!1,a===this.Md&&(this.Ot({[i4]:[oD]}),this.A.error("Feature flag request failed",e),this.Yd()&&this.Vd(!0)),o()};try{t.sendRequest("/flags/?v=2"+(n?"&only_evaluate_survey_feature_flags=true":""),{target:"flags",method:"POST",body:i,compression:this.Rn.compression,sentAt:"body",timeoutMs:this.Rn.requestTimeoutMs}).then(e=>{var t,s,r=null!=(t=e.json)?t:{},l=200!==e.statusCode;
2if(this.Td=!1,a===this.Md){if(this.lv(e.statusCode),l||this.Ed||(this.$anon_distinct_id=void 0),!i.disable_flags||this.Ed){this.Rd=!l;var u=[];e.error?u.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?oD:"unknown_error"):200!==e.statusCode&&u.push("api_error_"+e.statusCode),r.errorsWhileComputingFlags&&u.push("errors_while_computing_flags");var h=!(null==(s=r.quotaLimited)||!s.includes("feature_flags"));h&&u.push("quota_limited"),this.Ot({[i4]:u}),h?this.A.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):i.disable_flags||this.sv(r,l,{partialResponse:n}),o()}}else o()}).catch(l)}catch(e){l(e)}}}Fd(){return rY(this.Pd,3)}lv(e){this.Pd=rZ(e,this.Pd,3,()=>this.A.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t){var i;if(void 0===t&&(t={}),!t.fresh||this.Rd)if(this.Cd||this.getFlags()&&this.getFlags().length>0){if(!this.iv()){var s=this.getFeatureFlagResult(e,t);return null!=(i=null==s?void 0:s.variant)?i:null==s?void 0:s.enabled}}else this.A.warn('getFeatureFlag for key "'+e+oL)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t;return null==(t=this.getFeatureFlagResult(e,{send_event:!1}))?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.Rd)if(this.Cd||this.getFlags()&&this.getFlags().length>0){if(!this.iv()){var i,s=this.getFlagVariants(),r=e in s,n=s[e],a=this.getFlagPayloads()[e],o=String(n),l=this.Kd("$feature_flag_request_id")||void 0,h=this.Kd("$feature_flag_evaluated_at")||void 0,c=this.Kd("$flag_call_reported")||{};if(this.Rn.deduplicateCallsPerSession){var d,p=null==(d=this.Js)?void 0:d.session.sessionId,v=this.Kd(i8);p&&p!==v&&(c={},i=p)}if(!t.send_event&&"send_event"in t)i&&this.Ot({[i6]:c,[i8]:i});else if(e in c&&c[e].includes(o))i&&this.Ot({[i6]:c,[i8]:i});else{q(c[e])?c[e].push(o):c[e]=[o],this.Ot(u({[i6]:c},i?{[i8]:i}:{}));var f,g,_,m,y,b,w,x,k,E,S,R,P,$=this.getFeatureFlagDetails(e),F=[...null!=(f=this.Kd("$feature_flag_errors"))?f:[]];V(n)&&F.push("flag_missing");var I={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:l,$feature_flag_evaluated_at:h,$feature_flag_bootstrapped_response:null!=(g=null==(_=this.Rn.bootstrap)||null==(_=_.featureFlags)?void 0:_[e])?g:null,$feature_flag_bootstrapped_payload:null!=(m=null==(y=this.Rn.bootstrap)||null==(y=y.featureFlagPayloads)?void 0:y[e])?m:null,$used_bootstrap_value:!this.Rd};V(null==$||null==(b=$.metadata)?void 0:b.has_experiment)||(I.$feature_flag_has_experiment=$.metadata.has_experiment),V(null==$||null==(w=$.metadata)?void 0:w.version)||(I.$feature_flag_version=$.metadata.version);var C=null!=(x=null==$||null==(k=$.reason)?void 0:k.description)?x:null==$||null==(E=$.reason)?void 0:E.code;C&&(I.$feature_flag_reason=C),null!=$&&null!=(S=$.metadata)&&S.id&&(I.$feature_flag_id=$.metadata.id),V(null==$?void 0:$.original_variant)&&V(null==$?void 0:$.original_enabled)||(I.$feature_flag_original_response=V($.original_variant)?$.original_enabled:$.original_variant),null!=$&&null!=(R=$.metadata)&&R.original_payload&&(I.$feature_flag_original_payload=null==$||null==(P=$.metadata)?void 0:P.original_payload),F.length&&(I.$feature_flag_error=F.join(",")),this.uv(I)}if(r)return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:tV(a)}}}else this.A.warn('getFeatureFlagResult for key "'+e+oL)}uv(e){try{var t;null==(t=this.Js)||t.capture("$feature_flag_called",e).catch(e=>{this.A.error("Failed to capture feature flag call",e)})}catch(e){this.A.error("Failed to capture feature flag call",e)}}getRemoteConfigPayload(e,t){this.hv(e,t)}hv(e,t){var i=this;return c(function*(){var s=i.Js;if(s){var r,n={distinct_id:s.distinctId,token:s.projectToken,person_properties:{$lib:s.library.name,$lib_version:s.library.version}},a=i.rv();a.length&&(n.evaluation_contexts=a);var o,l=i.nv();V(l)||(n.flag_keys=l);try{o=(null==(r=(yield s.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:n,compression:i.Rn.compression,sentAt:"body",timeoutMs:i.Rn.requestTimeoutMs})).json)||null==(r=r.featureFlagPayloads)?void 0:r[e])||void 0}catch(e){return void i.A.error("Remote config feature flag request failed",e)}try{t(o)}catch(e){i.A.error("Remote config feature flag callback failed",e)}}})()}isFeatureEnabled(e,t){if(void 0===t&&(t={}),t.fresh&&!this.Rd)return t.defaultValue;if(!(this.Cd||this.getFlags()&&this.getFlags().length>0))return this.A.warn('isFeatureEnabled for key "'+e+oL),t.defaultValue;var i=this.getFeatureFlag(e,t);return V(i)?t.defaultValue:!!i}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){this.sv(e,t,i)}sv(e,t,i){if(this.Js){this.Cd=!0;var s=function(e,t,i,s,r,n){void 0===t&&(t={}),void 0===i&&(i={}),void 0===s&&(s={}),void 0===n&&(n=oT);var a,o,l=(a=n,(o=e.flags)?u({},e,{featureFlags:Object.fromEntries(Object.keys(o).map(e=>{var t;return[e,null!=(t=o[e].variant)?t:o[e].enabled]})),featureFlagPayloads:Object.fromEntries(Object.keys(o).filter(e=>o[e].enabled).filter(e=>{var t;return!V(null==(t=o[e].metadata)?void 0:t.payload)}).map(e=>{var t;return[e,null==(t=o[e].metadata)?void 0:t.payload]}))}):(e.featureFlags&&a.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e)),h=l.flags,c=l.featureFlags,d=l.featureFlagPayloads;if(c){var p=e.requestId,v=e.evaluatedAt;if(q(c)){n.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var f={};if(c)for(var g=0;c.length>g;g++)f[c[g]]=!0;return{[iH]:c,[iB]:f,[iW]:!1}}var _=c,m=d,y=h;if(null!=r&&r.partialResponse){var b=Object.keys(_),w=m||{};_=u({},t,_),m=u({}
vendor: 4,484 bytes, line 2
2,i,w),b.forEach(e=>{var t;e in w||null==(t=m)||delete t[e]}),y=u({},s,y)}else if(e.errorsWhileComputingFlags)if(h){var x=new Set(Object.keys(h).filter(e=>{var t;return!(null!=(t=h[e])&&t.failed)}));_=u({},t,Object.fromEntries(Object.entries(_).filter(e=>x.has(e[0]))));var k=Object.fromEntries(Object.entries(m||{}).filter(e=>x.has(e[0])));m=u({},i,k),x.forEach(e=>{var t;e in k||null==(t=m)||delete t[e]}),y=u({},s,Object.fromEntries(Object.entries(y||{}).filter(e=>x.has(e[0]))))}else _=u({},t,_),m=u({},i,m),y=u({},s,y);return u({[iH]:Object.keys(oj(_)),[iB]:_||{},[iU]:m||{},[iV]:y||{},[iW]:!0===e.minimalFlagCalledEvents},p?{[iG]:p}:{},v?{[i9]:v}:{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.A);if(s)if(!1===(null==i?void 0:i.persist)){var r=!V(this.Js.kv.get(iB));this.Xd=s,r||this.Ot(s)}else this.Ud(),this.ev(s,e,!(null==i||!i.partialResponse)),this.Ot(s);else t&&this.Yd();t||(this.Ad=!1),this.Vd(t)}}override(e,t){void 0===t&&(t=!1),this.A.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.dv(e)}dv(e){if(this.Js){if(!1===e)return this.Dt([iK,iJ]),this.Vd(),void oM.info("All overrides cleared");if(q(e))return this.Ot({[iK]:oN(e)}),this.Vd(),void oM.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){this.wd=!!(null!=(t=e.suppressWarning)&&t);var t,i={},s=e.flags,r=e.payloads;return s&&(i[iK]=q(s)?oN(s):s),r&&(i[iJ]=r),Object.keys(i).length&&this.Ot(i),!1===s&&!1===r?this.Dt([iK,iJ]):!1===s?this.Dt(iK):!1===r&&this.Dt(iJ),this.Vd(),!1===s?oM.info("Flag overrides cleared"):s&&oM.info("Flag overrides set",{flags:s}),void(!1===r?oM.info("Payload overrides cleared"):r&&oM.info("Payload overrides set",{payloads:r}))}if(e&&"object"==typeof e)return this.Ot({[iK]:e}),this.Vd(),void oM.info("Flag overrides set",{flags:e});this.A.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.A.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Cd){var t=this.vv(),i=t.flags,s=t.flagVariants;try{e(i,s)}catch(e){this.A.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r,n=(this.Kd("$early_access_features")||[]).find(t=>t.flagKey===e),a={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:a};n&&(o.$early_access_feature_name=n.name),i&&(o.$feature_enrollment_stage=i);var l=u({},this.getFlagVariants(),{[e]:t});null==(r=this._instance)||null==(r=r.persistence)||r.markCrossTabFeatureFlagChanges({[iH]:[e],[iB]:[e],[iX]:Object.keys(a)}),this.Ot({[iH]:Object.keys(oj(l)),[iB]:l,[iX]:u({},this.Kd("$stored_person_properties")||{},a)}),this.Vd();try{null==(s=this.Js)||s.capture("$feature_enrollment_update",o).catch(e=>{this.A.error("Failed to capture early access feature enrollment",e)})}catch(e){this.A.error("Failed to capture early access feature enrollment",e)}}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this.Kd(iz);!s||t?this.fv(e,i):e(s)}fv(e,t){var i=this;return c(function*(){var s=i.Js;if(s){var r,n=t?"&"+t.map(e=>"stage="+e).join("&"):"";try{var a=yield s.sendRequest("/api/early_access_features/?token="+s.projectToken+n,{target:"api",method:"GET",sentAt:"query"});if(!a.json)return;r=a.json.earlyAccessFeatures,i.Ot({[iz]:r})}catch(e){return void i.A.error("Early access feature request failed",e)}try{e(r)}catch(e){i.A.error("Early access feature callback failed",e)}}})()}vv(){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),{})}}Vd(e){this.Wd();var t=this.vv(),i=t.flags,s=t.flagVariants;this.featureFlagEventHandlers.forEach(t=>{try{t(i,s,{errorsLoading:e})}catch(e){this.A.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.pv(e,t)}pv(e,t){void 0===t&&(t=!0);var i=this.Kd("$stored_person_properties")||{},s=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),r=null==e?void 0:e.$set_once,n={};if(r)for(var a in r)({}).hasOwnProperty.call(r,a)&&(a in i||(n[a]=r[a]));this.Ot({[iX]:u({},i,n,s)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=u({},this.Kd("$stored_person_properties")||{});
2e.forEach(e=>{delete i[e]}),this.Ot({[iX]:i}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this.Dt(iX),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.Kd("$stored_group_properties")||{},s=u({},i);for(var r of Object.keys(e))s[r]=u({},i[r],e[r]);this.Ot({[iY]:s}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.Kd("$stored_group_properties")||{};this.Ot({[iY]:u({},t,{[e]:{}})})}else this.Dt(iY)}reset(){this.Md++,this.Ed=!1,this.kd={},this.Sd={},this.Xd=void 0,this.Cd=!1,this.Id=!1,this.Rd=!1,this.$anon_distinct_id=void 0,this.Qd(),this.wd=!1,this.Pd=0}}},o3=u({productTours:class{get sl(){return this._instance.persistence}constructor(e){this.Rc=null,this.Ac=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t,i,s=e.config;if("productTours"in s){if(this.sl&&this.sl.register({[iI]:!!s.productTours}),!og(this._instance))return!this.Rc&&K(null==(t=this.sl)?void 0:t.props.ph_product_tours)||of.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.Rc)||i.stop(),this.Rc=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.Rc&&og(this._instance)&&this.bo(()=>this.Pc())}bo(e){var t,i;null!=(t=E.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=E.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?of.error("Could not load product tours script",t):e()})}Pc(){var e;!this.Rc&&null!=(e=E.__PosthogExtensions__)&&e.generateProductTours&&(this.Rc=E.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!q(this.Ac)||t){var i=this.sl;if(i){var s=i.props[i5];if(q(s)&&!t)return this.Ac=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",timestampMode:"query",callback:t=>{if(og(this._instance)){var s=t.statusCode;if(200!==s||!t.json){var r="Product Tours API could not be loaded, status: "+s;return 0===s?t.error||of.warn(r):of.error(r),void e([],{isLoaded:!1,error:r})}var n=q(t.json.product_tours)?t.json.product_tours:[];this.Ac=n,i&&i.register({[i5]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Ac,{isLoaded:!0})}getActiveProductTours(e){K(this.Rc)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Rc.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.Rc)||t.showTourById(e)}previewTour(e){this.Rc?this.Rc.previewTour(e):this.bo(()=>{var t;this.Pc(),null==(t=this.Rc)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.Rc)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.Rc)||e.nextStep()}previousStep(){var e;null==(e=this.Rc)||e.previousStep()}clearCache(){var e;this.Ac=null,null==(e=this.sl)||e.unregister(i5)}resetTour(e){var t;null==(t=this.Rc)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.Rc)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.Rc)||t.cancelPendingTour(e)}}},o2),o5=u({surveys:class extends ox{constructor(e){super(new o$(e),{get projectToken(){return e.config.token},kv:new oP(e)}),this._instance=e}sh(e,t){var i=t.query?n4(e,t.query):e;return new Promise(e=>{var s;this._instance._send_request({method:t.method,url:this._instance.requestRouter.endpointFor(null!=(s=t.target)?s:"api",i),data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,timestampMode:t.sentAt,callback:e})})}}},o2),o6=u({experiments:class e{get Rn(){return this._instance.config}constructor(t){var i=this;this._instance=t,this.getWebExperimentsAndEvaluateDisplayLogic=function(t){void 0===t&&(t=!1),i.getWebExperiments(t=>{e.Yc("retrieved web experiments from the server"),i.tf=new Map,t.forEach(t=>{if(t.feature_flag_key){i.tf&&(e.Yc("setting flag key ",t.feature_flag_key," to web experiment ",t),null==(s=i.tf)||s.set(t.feature_flag_key,t));var s,r=i._instance.getFeatureFlag(t.feature_flag_key);U(r)&&t.variants[r]&&i.ef(t.name,r,t.variants[r].transforms)}else if(t.variants)for(var n in t.variants){var a=t.variants[n];
vendor: 8,002 bytes, line 2
2e.if(a,i._instance)&&i.ef(t.name,n,a.transforms)}})},t)},this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(t){if(this._is_bot())e.Yc(oG);else if(!this.Rn.disable_web_experiments){if(K(this.tf))return this.tf=new Map,this.loadIfEnabled(),void this.previewWebExperiment();e.Yc("applying feature flags",t),t.forEach(e=>{var t;if(this.tf&&null!=(t=this.tf)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.tf)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.ef(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var t=e.getWindowLocation();if(null!=t&&t.search){var i=rK(null==t?void 0:t.search,"__experiment_id"),s=rK(null==t?void 0:t.search,"__experiment_variant");i&&s&&(e.Yc("previewing web experiments "+i+" && "+s),this.getWebExperiments(e=>{this.rf(parseInt(i),s,e)},!1,!0))}}loadIfEnabled(){this.Rn.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.Rn.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.Rn.token),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}rf(t,i,s){var r=s.filter(e=>e.id===t);r&&r.length>0&&(e.Yc("Previewing web experiment ["+r[0].name+"] with variant ["+i+"]"),this.ef(r[0].name,i,r[0].variants[i].transforms))}static if(t,i){return!K(t.conditions)&&e.nf(t,i)&&e.sf(t)}static nf(t,i){if(K(t.conditions)||K(null==(r=t.conditions)?void 0:r.url))return!0;var s=e.getWindowLocation();if(s){var r,n,a,o,l=s8(i,s.href);return null==(n=t.conditions)||!n.url||oW[null!=(a=null==(o=t.conditions)?void 0:o.urlMatchType)?a:"icontains"](t.conditions.url,l)}return!1}static getWindowLocation(){return null==d?void 0:d.location}static sf(e){if(K(e.conditions)||K(null==(i=e.conditions)?void 0:i.utm))return!0;var t=r3();if(t.utm_source){var i,s,r,n,a,o,l,u,h,c=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,v=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=e.conditions)||null==(h=h.utm)?void 0:h.utm_term)==t.utm_term;return c&&p&&v&&d}return!1}static Yc(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];il.info("[WebExperiments] "+e,i)}ef(t,i,s){this._is_bot()?e.Yc(oG):"control"!==i?s.forEach(s=>{var r;s.selector&&(e.Yc("applying transform of variant "+i+" for experiment "+t+" ",s),null==(r=document)||null==(r=r.querySelectorAll(s.selector))||r.forEach(e=>{s.html&&(e.innerHTML=s.html),s.css&&e.setAttribute("style",s.css)}))}):e.Yc("Control variants leave the page unmodified.")}_is_bot(){return v&&this._instance?ag(v,this.Rn.custom_blocked_useragents):void 0}}},o2),o8=u({},o2,{sessionRecording:class{get Rn(){return this._instance.config}get sl(){return this._instance.persistence}get started(){var e;return!(null==(e=this.gv)||!e.isStarted)}get status(){var e,t;return"awaiting_config"===this.mv||"missing_config"===this.mv?this.mv:null!=(e=null==(t=this.gv)?void 0:t.status)?e:this.mv}constructor(e){if(this._instance=e,this._forceAllowLocalhostNetworkCapture=!1,this.mv=oh,this.yv=void 0,this.bv=!1,this.Ke=(()=>{if(null==f||!f.visibilityState||"visible"===f.visibilityState)return!0;var e,t=null==d||null==(e=d.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=t&&t.length)||t.some(e=>"visible"===e.name)})(),this.ar=()=>{var e;"visible"===(null==f?void 0:f.visibilityState)&&(this.Ke=!0,null==(e=this.gv)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},!this._instance.sessionManager)throw od.error("started without valid sessionManager"),Error("[SessionRecording] started without valid sessionManager. This is a bug.");if("always"===this.Rn.cookieless_mode)throw Error('[SessionRecording] cannot be used with cookieless_mode="always"');null!=f&&f.addEventListener&&sI(f,"visibilitychange",this.ar)}initialize(){this.startIfEnabledOrStop()}dispose(e){var t=(void 0===e?{}:e).discardBufferedEvents;this.bv=!0,null==f||null==f.removeEventListener||f.removeEventListener("visibilitychange",this.ar),void 0!==t&&t?this._v(!0):this.stopRecording()}get wv(){var e,t=!(null==(e=this._instance.get_property(iA))||!e.enabled),i=!this.Rn.disable_session_recording,s=this.Rn.disable_session_recording||this._instance.consent.isOptedOut();return d&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!(this.bv||this.wv&&null!=(t=this.gv)&&t.isStarted)){var i=!V(Object.assign)&&!V(Array.from);this.wv&&i?(this.Sv(e),od.info("starting")):(this.mv=oh,this.stopRecording())}}Sv(e){var t,i;if(this.wv)if("awaiting_config"!==this.mv&&"missing_config"!==this.mv&&(this.mv=oc),null!=E&&null!=(t=E.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=E.__PosthogExtensions__)&&i.initSessionRecording)this.xv(e);else{var s,r=this._instance.sessionManager;null==(s=E.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.Cv,t=>{if(!this.bv&&this.wv&&this._instance.sessionManager===r)return t?(this._instance.register_for_session({[sh]:!0}),od.error("could not load recorder",t)):void this.xv(e);this.mv=oh})}}stopRecording(){var e,t;null==(e=this.yv)||e.call(this),this.yv=void 0,null==(t=this.gv)||t.stop()}_v(e){var t,i;void 0===e&&(e=!1),null==(t=this.yv)||t.call(this),this.yv=void 0,null==(i=this.gv)||i.discard({discardProducerEvents:e})}Tv(){var e,t;null==(e=this.sl)||e.unregister(iq),null==(t=this.sl)||t.unregister(iT)}Mv(e,t){if(K(e))return null;var i=J(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(od.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}Iv(e){if(this.sl){var t,i,s=this.sl,r=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Mv(null==(t=this.Rn.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.Mv(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=r?r:n;K(a)&&this.Tv();var o=null==i?void 0:i.minimumDurationMilliseconds;s.register({[iA]:u({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:u({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:V(o)?null:o,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};r(),null==(t=this.yv)||t.call(this),this.yv=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(r)}}onRemoteConfig(e){var t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this.Iv(t),void this._v()):(this.Iv(t),void this.startIfEnabledOrStop()):("awaiting_config"===this.mv&&(this.mv="missing_config",od.warn("config refresh failed, recording will not start until page reload")),void this.startIfEnabledOrStop())}log(e,t){var i;void 0===t&&(t="log"),null!=(i=this.gv)&&i.log?this.gv.log(e,t):od.warn("log called before recorder was ready")}get Cv(){var e;return(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.get_property("$session_recording_remote_config"))||null==(e=e.scriptConfig)?void 0:e.script)||"lazy-recorder"}Ev(){var e,t=this._instance.get_property(iA);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return od.warn("persisted remote config for session recording is invali
2d and will be ignored",e),!1}return!K(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}xv(e){var t,i,s,r;if(!this.bv&&this.wv&&this._instance.sessionManager){if(null==(t=E.__PosthogExtensions__)||!t.initSessionRecording)return od.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[sh]:!0});if(this.gv||(this.gv=null==(r=E.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance,this.Ke),this.gv._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ev()){if("missing_config"===this.mv||"awaiting_config"===this.mv)return;return this.mv="awaiting_config",od.info("persisted remote config is stale, requesting fresh config before starting"),void new nE(this._instance).load()}this.mv=oc,null==(i=(s=this.gv).setDocumentWasEverVisible)||i.call(s,this.Ke),this.gv.start(e)}else this.mv=oh}onRRwebEmit(e){var t;null==(t=this.gv)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.gv||null==(e=this.sl)||e.register({[iL]:!0}),null==(t=this.gv)||t.overrideLinkedFlag()}overrideSampling(){var e,t;this.gv||null==(e=this.sl)||e.register({[iM]:!0}),null==(t=this.gv)||t.overrideSampling()}overrideTrigger(e){var t,i;this.gv||null==(t=this.sl)||t.register({["url"===e?iD:iN]:!0}),null==(i=this.gv)||i.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.gv)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.gv)||!i.tryAddCustomEvent(e,t))}flushBeforeIdentityReset(){var e;null==(e=this.gv)||null==e.flushBeforeIdentityReset||e.flushBeforeIdentityReset()}}},{autocapture:class extends a7{constructor(e){super(new oe(e)),this.instance=e}},historyAutocapture:class{constructor(e){this._instance=e,this.Rv=this.Av()}initialize(){this.startIfEnabled()}get isEnabled(){var e=this.Pv();return!!(e.path||e.search||this.Fv(e))}startIfEnabled(){this.isEnabled&&(il.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.Rv=this.Av(),this.startIfEnabled()}stop(){this.Ov&&this.Ov(),this.Ov=void 0,this.$v&&this.$v(),this.$v=void 0,il.info("History API monitoring stopped")}monitorHistoryChanges(){d&&d.history&&(this.Dv("pushState"),this.Dv("replaceState"),this.Lv(),this.Fv()&&this.Nv())}Dv(e){var t;if(d&&(null==(t=d.history[e])||!t.__posthog_wrapped__)){var i=this;or(d.history,e,t=>function(s,r,n){t.call(this,s,r,n),i.qv(e)})}}Av(){var e=null==d?void 0:d.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}Pv(){var e=this._instance.config.capture_pageview;return"history_change"===e?{path:!0}:H(e)?e:{}}Fv(e){return void 0===e&&(e=this.Pv()),!!e.hash&&!this._instance.config.disable_capture_url_hashes}jv(e){var t=this.Pv(),i=this.Rv;return!(!i||!(t.path&&e.pathname!==i.pathname||t.search&&e.search!==i.search||this.Fv(t)&&e.hash!==i.hash))}qv(e){try{var t=this.Av();if(!t)return;this.jv(t)&&this._instance.capture(s_,{navigation_type:e}),this.Rv=t}catch(t){il.error("Error capturing "+e+" pageview",t)}}Lv(){if(!this.Ov){var e=()=>{this.qv("popstate")};sI(d,"popstate",e),this.Ov=()=>{d&&d.removeEventListener("popstate",e)}}}Nv(){if(!this.$v){var e=()=>{this.qv("hashchange")};sI(d,"hashchange",e),this.$v=()=>{d&&d.removeEventListener("hashchange",e)}}}},heatmaps:class{get Rn(){return this.instance.config}constructor(e){var t;this.Bv=!1,this.Xs=!1,this.Hv=null,this.instance=e,this.Bv=!(null==(t=this.instance.persistence)||!t.props[iE]),this.rageclicks=new a6(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return H(this.Rn.capture_heatmaps)&&this.Rn.capture_heatmaps.flush_interval_milliseconds&&(e=this.Rn.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return K(this.Rn.capture_heatmaps)?K(this.Rn.enable_heatmaps)?this.Bv:this.Rn.enable_heatmaps:!1!==this.Rn.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.Xs||(op.info("starting..."),this.zv(),this.ar());else{var e;clearInterval(null!=(e=this.Hv)?e:void 0),this.Uv(),this.getAndClearBuffer()}}onRemoteConfig(e){if(e.ok){var t=e.config;if("heatmaps"in t){var i=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[iE]:i}),this.Bv=i,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.Rt;return this.Rt=void 0,e}Wv(e){ov(e.originalEvent)&&this.vn(e.originalEvent,"deadclick")}ar(){this.Hv&&clearInterval(this.Hv),this.Hv="visible"===(null==f?void 0:f.visibilityState)?setInterval(this.Ja.bind(this),this.flushIntervalMilliseconds):null}zv(){d&&f&&(this.Vv=this.Ja.bind(this),sI(d,sg,this.Vv),this.Gv=e=>this.vn(e||(null==d?void 0:d.event)),sI(f,"click",this.Gv,{capture:!0}),this.Zv=e=>this.Jv(e||(null==d?void 0:d.event)),sI(f,"mousemove",this.Zv,{capture:!0}),this.Qv=new rM(this.instance,rA,this.Wv.bind(this)),this.Qv.startIfEnabledOrStop(),this.Kv=this.ar.bind(this),sI(f,sf,this.Kv),this.Xs=!0)}Uv(){var e;d&&f&&(this.Vv&&d.removeEventListener(sg,this.Vv),this.Gv&&f.removeEventListener("click",this.Gv,{capture:!0}),this.Zv&&f.removeEventListener("mousemove",this.Zv,{capture:!0}),this.Kv&&f.removeEventListener(sf,this.Kv),clearTimeout(this.Xv),null==(e=this.Qv)||e.stop(),this.Xs=!1)}Yv(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),n=function(e,t,i){for(var s=e;s&&s9(s)&&!s7(s,"body")&&s!==i;){var r,n,a,o=void 0;try{o=null==(r=null!=(n=null==(a=s.ownerDocument)?void 0:a.defaultView)?n:d)?void 0:r.getComputedStyle(s).position}catch(e){break}if(F(t,o))return!0;s=rc(s)}return!1}(ro(e),["fixed","sticky"],r);return{x:e.clientX+(n?0:s),y:e.clientY+(n?0:i),target_fixed:n,type:t}}vn(e,t){var i;if(void 0===t&&(t="click"),!s4(e.target)&&ov(e)){var s=this.Yv(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&rm(ro(e),this.instance.config.rageclick)&&this.$s(u({}
vendor: 5,127 bytes, line 2
2,s,{type:"rageclick"})),this.$s(s)}}Jv(e){!s4(e.target)&&ov(e)&&(clearTimeout(this.Xv),this.Xv=setTimeout(()=>{this.$s(this.Yv(e,"mousemove"))},500))}$s(e){if(d){var t=this.Rn.disable_capture_url_hashes?td(d.location.href):d.location.href,i=this.Rn.custom_personal_data_properties,s=rJ(t,this.Rn.mask_personal_data_properties?[...rQ,...i||[]]:[],r1);this.Rt=this.Rt||{},this.Rt[s]||(this.Rt[s]=[]),this.Rt[s].push(e)}}Ja(){this.Rt&&!z(this.Rt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:rM,webVitalsAutocapture:class{constructor(e){var t;this._instance=e,this.Bv=!1,this.Xs=!1,this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.tc=()=>{clearTimeout(this.ec),this.ec=void 0,0!==this.Rt.metrics.length&&(this._instance.capture("$web_vitals",u({$current_url:this.Rt.url},this.Rt.metrics.reduce((e,t)=>u({},e,{["$web_vitals_"+t.name+"_event"]:u({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{}))),this.Rt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.rc=e=>{var t;if(this.Rt=this.Rt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},K(null==e?void 0:e.name)||K(null==e?void 0:e.value))oa.error("Invalid metric received",e);else{var i="string"==typeof e.navigationURL?e.navigationURL:void 0,s=this.nc(i);if(!V(s)){var r=J(e.navigationId)||"string"==typeof e.navigationId?"navigation:"+e.navigationId:"url:"+s;if(!this.sc||this.sc>e.value){this.Rt.navigationKey!==r&&(this.tc(),this.ec=setTimeout(this.tc,this.flushToCaptureTimeoutMs)),V(this.Rt.navigationKey)&&(this.Rt.navigationKey=r,this.Rt.url=s),this.Rt.firstMetricTimestamp=V(this.Rt.firstMetricTimestamp)?Date.now():this.Rt.firstMetricTimestamp;var n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),a=u({},e,i?{navigationURL:s}:{},{$current_url:s,timestamp:Date.now()});if(delete a.entries,H(e.attribution)&&this.attributionMetrics.indexOf(e.name)>-1){var o={};for(var l of ou){var h="url"===l&&"string"==typeof e.attribution[l]?this.nc(e.attribution[l]):e.attribution[l];V(h)||(o[l]=h)}a.attribution=o}else delete a.attribution;V(n)||(a.$session_id=n.sessionId,a.$window_id=n.windowId),this.Rt.metrics.push(a),this.Rt.metrics.length===this.allowedMetrics.length&&this.tc()}else oa.error("Ignoring metric with value >= "+this.sc,e)}}},this.oc=()=>{if(!this.Xs){var e,t,i,s,r=!1,n=E.__PosthogExtensions__,a=null==n?void 0:n.postHogWebVitalsCallbacksByFlavor,o=(null==a?void 0:a[this.ac])||("web-vitals"===this.ac&&V(a)?null==n?void 0:n.postHogWebVitalsCallbacks:void 0);if(!V(o)){var l=o.withoutAttribution,h=this.attributionMetrics;r=!V(l),e=h.indexOf("LCP")>-1?o.onLCP:(null==l?void 0:l.onLCP)||o.onLCP,t=h.indexOf("CLS")>-1?o.onCLS:(null==l?void 0:l.onCLS)||o.onCLS,i=h.indexOf("FCP")>-1?o.onFCP:(null==l?void 0:l.onFCP)||o.onFCP,s=h.indexOf("INP")>-1?o.onINP:(null==l?void 0:l.onINP)||o.onINP}if(e&&t&&i&&s){var c={reportSoftNavs:this.useSoftNavs},d=r&&this.attributionMetrics.indexOf("INP")>-1?u({},c,{includeProcessedEventEntries:!1}):c;this.allowedMetrics.indexOf("LCP")>-1&&e(this.rc.bind(this),c),this.allowedMetrics.indexOf("CLS")>-1&&t(this.rc.bind(this),c),this.allowedMetrics.indexOf("FCP")>-1&&i(this.rc.bind(this),c),this.allowedMetrics.indexOf("INP")>-1&&s(this.rc.bind(this),d),this.Xs=!0}else oa.error("web vitals callbacks not loaded - not starting")}},this.Bv=!(null==(t=this._instance.persistence)||!t.props[i$]),this.startIfEnabled()}get lc(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=H(this.lc)?null==(e=this.lc)?void 0:e.web_vitals_allowed_metrics:void 0;return K(i)?(null==(t=this._instance.persistence)?void 0:t.props.$web_vitals_allowed_metrics)||oo:i}get flushToCaptureTimeoutMs(){return(H(this.lc)?this.lc.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var e=H(this.lc)?this.lc.web_vitals_attribution:void 0;return Y(e)?e?oo:[]:q(e)?e:ol}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var e;return null!=(e=H(this.lc)?this.lc.__preview_web_vitals_soft_navs:void 0)&&e}get sc(){var e=H(this.lc)&&J(this.lc.__web_vitals_max_value)?this.lc.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==g?void 0:g.protocol;if("http:"!==e&&"https:"!==e)return oa.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=H(this.lc)?this.lc.web_vitals:Y(this.lc)?this.lc:void 0;return Y(t)?t:this.Bv}startIfEnabled(){this.isEnabled&&!this.Xs&&(oa.info("enabled, starting..."),this.bo(this.oc))}onRemoteConfig(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var i=H(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=H(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[i$]:i}),this._instance.persistence.register({[iO]:s})),this.Bv=i,this.startIfEnabled()}}}get ac(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}
2bo(e){var t=E.__PosthogExtensions__,i=this.ac,s=null==t?void 0:t.postHogWebVitalsCallbacksByFlavor;null!=s&&s[i]||"web-vitals"===i&&V(s)&&null!=t&&t.postHogWebVitalsCallbacks?e():null==t||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,i,t=>{t?oa.error("failed to load script",t):e()})}nc(e){var t=e||(null==d?void 0:d.location.href);if(t){var i=this._instance.config.disable_capture_url_hashes?td(t):t,s=this._instance.config.custom_personal_data_properties;return rJ(i,this._instance.config.mask_personal_data_properties?[...rQ,...s||[]]:[],r1)}oa.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t;this.oc=()=>{var e;if(d&&this.isEnabled&&null!=(e=E.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=E.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=E.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=E.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.uc&&this.Rn.capture_unhandled_errors&&(this.uc=t(this.captureException.bind(this))),!this.hc&&this.Rn.capture_unhandled_rejections&&(this.hc=i(this.captureException.bind(this))),!this.dc&&this.Rn.capture_console_errors&&(this.dc=s(this.captureException.bind(this)))}catch(e){ot.error("failed to start",e),this.vc()}}},this._instance=e,this.cc=!(null==(t=this._instance.persistence)||!t.props[iS]),this.wt=new el(u({},function(e){var t,i,s,r;return void 0===e&&(e={}),{refillRate:null!=(t=null!=(i=e.exceptionRateLimiterRefillRate)?i:e.__exceptionRateLimiterRefillRate)?t:1,bucketSize:null!=(s=null!=(r=e.exceptionRateLimiterBucketSize)?r:e.__exceptionRateLimiterBucketSize)?s:10}}(this._instance.config.error_tracking),{refillInterval:1e4,A:ot})),this.Rn=this.fc(),this.startIfEnabledOrStop()}fc(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return H(e)?t=u({},t,e):(V(e)?this.cc:e)&&(t=u({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Rn.capture_console_errors||this.Rn.capture_unhandled_errors||this.Rn.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ot.info("enabled"),this.vc(),this.bo(this.oc)):this.vc()}bo(e){var t,i;null!=(t=E.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(i=E.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return ot.error("failed to load script",t);e()})}vc(){var e,t,i;null==(e=this.uc)||e.call(this),this.uc=void 0,null==(t=this.hc)||t.call(this),this.hc=void 0,null==(i=this.dc)||i.call(this),this.dc=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;"autocaptureExceptions"in t&&(this.cc=!!t.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[iS]:this.cc}),this.Rn=this.fc(),this.startIfEnabledOrStop())}}onConfigChange(){this.Rn=this.fc()}captureException(e){try{var t,i,s,r=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";if(this.wt.consumeRateLimit(r))return void ot.info("Skipping exception capture because of client rate limiting.",{exception:r});null==(s=this._instance.exceptions)||s.sendExceptionEvent(e)}catch(e){}}},exceptions:class{constructor(e){var t,i;this.gc=[],this.mc=new tg([new tP,new tD,new tF,new t$,new tM,new tT,new tC,new tL],function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];return function(t,s){void 0===s&&(s=0);for(var r=[],n=t.split("\n"),a=s;n.length>a;a++){var o=n[a];if(1024>=o.length){var l=tR.test(o)?o.replace(tR,"$1"):o;if(!l.match(/\S*Error: /)){for(var h of i){var c=h(l,e);if(c){r.push(c);break}}if(r.length>=50)break}}}if(!r.length)return[];var d=Array.from(r);return d.reverse(),d.slice(0,50).map(e=>u({},e,{filename:e.filename||(d[d.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",tx,tS)),this._instance=e,this.gc=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property("$error_tracking_suppression_rules"))?t:[],this.yc=tH(this.bc()),this._c=new tz(this.yc)}onConfigChange(){this.yc=tH(this.bc()),this._c.setConfig(this.yc)}onRemoteConfig(e){var t,i,s;if(e.ok){var r=e.config;if("errorTracking"in r){var n=null!=(t=null==(i=r.errorTracking)?void 0:i.suppressionRules)?t:[],a=null==(s=r.errorTracking)?void 0:s.captureExtensionExceptions;this.gc=n,this._instance.persistence&&this._instance.persistence.register({[iR]:this.gc,[iP]:a})}}}get wc(){var e,t,i=!!this._instance.get_property(iP);return null!=(e=null!=(t=this._instance.config.error_tracking.captureExtensionExceptions)?t:i)&&e}buildProperties(e,t){return this.mc.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.yc.enabled)try{if(!U(e)||0===e.trim().length)return void oB.warn("Ignoring exception step because message must be a non-empty string");var i=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((i,s)=>(tq.has(s)?t.push(s):i[s]=e[s],i),{}),droppedKeys:t}}(this.kc(t)),s=i.sanitizedProperties,r=i.droppedKeys;r.length>0&&oB.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this._c.add(u({[tN]:e,[tj]:(new Date).toISOString()}
2,s))}catch(e){oB.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){var t;try{var i=e.$exception_list;if(this.Sc(i)){if(this.xc(i))return this.Cc("Exception dropped: matched a suppression rule"),void oB.info("Skipping exception capture because a suppression rule matched");if(!this.wc&&this.Tc(i))return this.Cc("Exception dropped: thrown by a browser extension"),void oB.info("Skipping exception capture because it was thrown by an extension");if(!this.wc&&this.Mc(i))return this.Cc("Exception dropped: thrown by an injected browser script"),void oB.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Ic(i))return this.Cc("Exception dropped: thrown by the PostHog SDK"),void oB.info("Skipping exception capture because it was thrown by the PostHog SDK")}var s=this.yc.enabled&&K(e.$exception_steps)?this.Ec(e):e,r="string"==typeof(t=globalThis._posthogReleaseId)&&t.length>0?t:void 0;r&&(s.$release_id=r);try{var n=this._instance.capture("$exception",s,{_noTruncate:!0,_batchKey:"exceptionEvent",Ou:!0});return n&&this._c.clear(),n}catch(e){return oq(e)||oB.error("Failed to capture exception event. Dropping this exception.",e),void this._c.clear()}}catch(e){return void(oq(e)||oB.error("Failed to process exception event. Ignoring this exception.",e))}}Ec(e){try{var t=this._c.getAttachable();return 0===t.length?e:u({},e,{$exception_steps:t})}catch(t){return oB.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Cc(e){this.yc.enabled&&this._c.add({[tN]:e,[tj]:(new Date).toISOString()})}kc(e){return H(e)?u({},e):{}}bc(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}xc(e){if(0===e.length)return!1;try{var t=e.reduce((e,t)=>{var i=t.type,s=t.value;return U(i)&&i.length>0&&e.$exception_types.push(i),U(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.gc.some(e=>{var i=e.values.map(e=>{var i=aw[e.operator],s=t[e.key];if(!i||!s)return!1;var r=q(e.value)?e.value:[e.value];return r.length>0&&i(r,s)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}catch(e){return oB.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}Tc(e){var t=e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}),i=t.filter(e=>{var t=e.filename;return!!t&&oV.some(e=>
2t.startsWith(e))});return 0!==i.length&&(!i.every(e=>{var t=e.filename;return!!t&&t.startsWith(oH)})||e.some(e=>{var t=e.value;return"NoResponse"===e.type||U(t)&&oz.some(e=>{var i=e.value;return e.exact?t===i:t.includes(i)})})&&!t.some(e=>{var t=e.filename;return e.in_app&&!(null!=t&&t.startsWith(oH))}))}Mc(e){return e.some(e=>{var t=e.value;return U(t)&&oU.some(e=>t.includes(e))})}Ic(e){if(e.length>0){var t,i,s,r,n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[];return null!=(s=null==(r=n[n.length-1])||null==(r=r.filename)?void 0:r.includes("posthog.com/static"))&&s}return!1}Sc(e){return!K(e)&&q(e)}}},o3,{siteApps:class{constructor(e){this._instance=e,this.Fc=0,this.Oc=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}$c(e,t){if(t){var i=this.globalsForEvent(t);this.Oc.push(i),this.Oc.length>1e3&&(this.Oc=this.Oc.slice(10))}}get siteAppLoaders(){var e;return null==(e=E._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.$c.bind(this));this.Dc=()=>{e(),this.Oc=[],this.Dc=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,s,r,n,a,h,c={},d=this._instance.get_property("$groups")||[];for(var p of Object.entries(this._instance.get_property("$stored_group_properties")||{})){var v=p[0];c[v]={id:d[v],type:v,properties:p[1]}}var f=e.$set_once,g=e.$set;return{event:u({},l(e,o),{properties:u({},e.properties,g?{$set:u({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},g)}:{},f?{$set_once:u({},null!=(s=null==(r=e.properties)?void 0:r.$set_once)?s:{},f)}:{}),elements_chain:null!=(n=null==(a=e.properties)?void 0:a.$elements_chain)?n:"",distinct_id:null==(h=e.properties)?void 0:h.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}Lc(e){var t,i=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(o_.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(o_.error("prepare_external_dependency_script returned null"),null):e}Nc(){if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var e,t,i,s,r,n,a,o,l=null==f?void 0:f.defaultView,u=null==l||null==(e=l.Node)?void 0:e.prototype;if(!l||!u)return()=>{};if(this.Fc++,this.qc)return this.jc();var h=[],c=this,d=new WeakSet,p=(e,t,i)=>{if(null!=e&&e[t]){var s=e[t];e[t]=i(s),h.push(()=>{e[t]=s})}},v=e=>{if(d.has(e))return e;var t=c.Lc(e);return t&&d.add(t),t},g=e=>e.map(e=>"string"==typeof e?e:v(e)).filter(e=>!W(e));return p(u,"appendChild",e=>function(t){var i=v(t);return i?e.call(this,i):t}),p(u,"insertBefore",e=>function(t,i){var s=v(t);return s?e.call(this,s,i):t}),p(u,"replaceChild",e=>function(t,i){var s=v(t);return s?e.call(this,s,i):i}),[null==(t=l.Element)?void 0:t.prototype,null==(i=l.Document)?void 0:i.prototype,null==(s=l.DocumentFragment)?void 0:s.prototype].forEach(e=>{p(e,"append",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,g(i))}),p(e,"prepend",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,g(i))})}),[null==(r=l.Element)?void 0:r.prototype,null==(n=l.CharacterData)?void 0:n.prototype,null==(a=l.DocumentType)?void 0:a.prototype].forEach(e=>{p(e,"before",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,g(i))}),p(e,"after",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];return e.apply(this,g(i))}),p(e,"replaceWith",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];var r=g(i);return i.length&&!r.length?void 0:e.apply(this,r)})}),p(null==(o=l.Element)?void 0:o.prototype,"insertAdjacentElement",e=>function(t,i){var s=v(i);return s?e.call(this,t,s):null}),this.qc=()=>
vendor: 15,314 bytes, line 2
2{h.forEach(e=>e()),this.qc=void 0},this.jc()}jc(){var e=!1;return()=>{var t;e||(e=!0,this.Fc--,0===this.Fc&&(null==(t=this.qc)||t.call(this)))}}Bc(e,t){void 0===t&&(t=!0);var i=this.Nc();try{var s=e(i);return t&&i(),s}catch(e){throw i(),e}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.Oc.length&&(o_.info("Processing "+this.Oc.length+" events for site app with id "+e.id),this.Oc.forEach(e=>this.Bc(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.Dc)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,o_.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var n=this.Bc(t=>e.init({posthog:this._instance,callback(e){t(),r(e)}}),!1).processEvent;n&&(t.processEvent=n),s=!0}catch(t){o_.error(om+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){o_.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}Hc(){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)}zc(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),s=function(s){try{t.Bc(()=>null==s.processEvent?void 0:s.processEvent(i))}catch(t){o_.error("Error while processing event "+e.event+" for site app "+s.id,t)}};for(var r of Object.values(this.apps))s(r)}}onRemoteConfig(e){var t,i,s,r=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Hc(),void this._instance.on("eventCaptured",e=>this.zc(e))):void o_.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Dc)||i.call(this),e.ok){var n=e.config;if(null!=(s=n.siteApps)&&s.length)if(this.isEnabled)for(var a of n.siteApps)!function(){var e,t=a.id,i=a.url;E["__$$ph_site_app_"+t]=r._instance,null==(e=E.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(r._instance,i,e=>{if(e)return o_.error(om+t,e)})}();else o_.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},o5,{tracingHeaders:class{constructor(e){this._instance=e,this.Uc=void 0,this.Wc=void 0,this.Vc=void 0,this.oc=()=>{var e,t,i=this.Gc();i?(V(this.Uc)&&(this.Uc=null==(e=E.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),V(this.Wc)&&(this.Wc=null==(t=E.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.vc()}}initialize(){this.startIfEnabledOrStop()}bo(e){var t,i;null!=(t=E.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=E.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return on.error("failed to load script",t);e()})}Zc(){var e,t;return null!=(e=null!=(t=this._instance.config.tracing_headers)?t:this._instance.config.addTracingHeaders)?e:this._instance.config.__add_tracing_headers}Gc(){var e=this.Zc();return q(e)?(q(this.Vc)?this.Vc.splice(0,this.Vc.length,...e):this.Vc=[...e],e.length>0?this.Vc:void 0):(q(this.Vc)&&this.Vc.splice(0),this.Vc=e||void 0,this.Vc)}vc(){var e,t;null==(e=this.Uc)||e.call(this),null==(t=this.Wc)||t.call(this),this.Uc=void 0,this.Wc=void 0}startIfEnabledOrStop(){this.Gc()?this.bo(this.oc):this.vc()}}},{toolbar:class{constructor(e){this.instance=e}Jc(e){E.ph_toolbar_state=e}Qc(){var e;return null!=(e=E.ph_toolbar_state)?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,i){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),sC(this.instance.config)||!d||!f)return!1;e=null!=e?e:d.location,i=null!=i?i:d.history;try{if(!t){try{d.localStorage.setItem("test","test"),d.localStorage.removeItem("test")}catch(e){return!1}t=null==d?void 0:d.localStorage}var s,r=oF||rX(e.hash,"__posthog")||rX(e.hash,"state"),n=r?sS(()=>JSON.parse(atob(decodeURIComponent(r))))||sS(()=>JSON.parse(decodeURIComponent(r))):null;return n&&"ph_authorize"===n.action?((s=n).source="url",s&&Object.keys(s).length>0&&(n.desiredHash?e.hash=n.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(oI)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(e){return!1}}Kc(e){var t=E.ph_load_toolbar||E.ph_load_editor;!K(t)&&B(t)?t(e,this.instance):oC.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==f||!f.getElementById("__POSTHOG_TOOLBAR__"));if(!d||i)return!1;var s="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=u({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});return(d.localStorage.setItem(oI,JSON.stringify(u({},r,{source:void 0}))),2===this.Qc())?this.Kc(r):0===this.Qc()&&(this.Jc(1),null==(t=E.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{e?(oC.error("[Toolbar] Failed to load",e),this.Jc(0)):(this.Jc(2),this.Kc(r))}),sI(d,"turbolinks:load",()=>{this.Jc(0),this.loadToolbar(r)})),!0}Xc(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)}}},o6,{conversations:class{constructor(e){this._instance=e,this.af=void 0,this._conversationsManager=null,this.lf=!1,this.re=null,this.uf=!1}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&(this.hf=e.ok,e.ok)){var t=e.config.conversations;K(t)||(Y(t)?this.af=t:(this.af=t.enabled,this.re=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.af=void 0,this.re=null,this.hf=void 0,this.uf=!1}loadIfEnabled(){if(!(this._conversationsManager||this.lf||this._instance.config.disable_conversations||sC(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==E?void 0:E.__PosthogExtensions__;if(e&&!V(this.af)&&this.af)if(this.re&&this.re.token){this.lf=!0;try{var t=e.initConversations;if(t)return this.df(t),void(this.lf=!1);var i=e.loadExternalDependency;if(!i)return void this.vf(sc);i(this._instance,"conversations",t=>{t||!e.initConversations?this.vf("Could not load conversations script",t):this.df(e.initConversations),this.lf=!1})}catch(e){this.vf("Error initializing conversations",e),this.lf=!1}}else oK.error("Conversations enabled but missing token in remote config.")}}df(e){if(this.re)try{this._conversationsManager=e(this.re,this._instance),this.uf=!1,oK.info("Conversations loaded successfully")}catch(e){this.vf("Error completing conversations initialization",e)}else oK.error("Cannot complete initialization: remote config is null")}vf(e,t){oK.error(e,t),this._conversationsManager=null,this.lf=!1,this.uf=!0}show(){this._conversationsManager?this._conversationsManager.show():oK.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.af&&!W(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":sC(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.hf?"remote_config_failed":V(this.af)?this.hf?"disabled_in_project":"remote_config_pending":this.af?K(this.re)||!this.re.token?"missing_token":null!=E&&E.__PosthogExtensions__?this.lf?"initializing":this.uf?"load_failed":"not_loaded":"extensions_unavailable":"disabled_in_project"}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,i){var s=this;return c(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(oK.warn(oJ),null)})()}getMessages(e,t){var i=this;return c(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(oK.warn(oJ),null)})()}markAsRead(e){var t=this;return c(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(oK.warn(oJ),null)})()}getTickets(e){var t=this;return c(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(oK.warn(oJ),null)})()}requestRestoreLink(e){var t=this;return c(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(oK.warn(oJ),null)})()}restoreFromToken(e){var t=this;return c(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(oK.warn(oJ),null)})()}restoreFromUrlToken(){var e=this;return c(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(oK.warn(oJ),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}zu(){var e;null==(e=this._conversationsManager)||e.setIdentity()}Uu(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t,i=this;this._instance=e,this.name="logs",this.cf=!1,this.ff=!1,this.pf=!1,this.A=iu("[logs]"),this.gf=u({},this.A,{error(){for(var e=arguments.length,t=Array(e),s=0;e>s;s++)t[s]=arguments[s];t.some(o1)||i.A.error(...t)}}),this.La=[],this.mf=[],this.Pd=0,this.ro=!1,this.yf=[],this.bf=[],this._f=!1,this.wf=!1,this.kf=()=>{var e,t;this.ro||(this.Pd=0,null==(e=this.Sf)||e.onReconnect(),null==(t=this.xf)||t.onReconnect())},this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.cf=!0),d&&sI(d,"online",this.kf)}Cf(e,t,i,s){var r,n=oX(null==(r=this._instance)||null==(r=r.config)?void 0:r.logs,i);return[new it(this.Tf(e,t),n,this.gf,()=>this.Mf(),e=>e(),void 0,s),n]}If(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.Sf||this.Ef!==t){null==(i=this.Sf)||i.reset(),this.Ef=t;var i,s=this.Cf(()=>this.La,e=>{this.La=e});this.Sf=s[0],this.Rf=s[1]}return this.Sf}Af(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.xf||this.Pf!==t){null==(i=this.xf)||i.reset(),this.Pf=t;var i,s=this.Cf(()=>this.mf,e=>{this.mf=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},oZ);this.xf=s[0],this.Ff=s[1]}return this.xf}setup(e){var t;if(!this.ro){this.Js=e,null!=(t=this._instance)&&null!=(t=t.config)&&null!=(t=t.logs)&&t.captureConsoleLogs&&(this.cf=!0),(this.cf||this.Of()&&this.$f())&&this.Df();var i=!1,s=e.onRemoteConfig(e=>{var t;i=e.ok&&!0===(null==(t=e.config.logs)?void 0:t.captureConsoleLogs),this.onRemoteConfig(e)});this.ro?s.dispose():(this.oo=s,i||this.loadIfEnabled())}}dispose(){var e,t,i,s;this.ro||(this.ro=!0,this.Lf(),null==(e=this.oo)||e.dispose(),this.oo=void 0,this.Js=void 0,this.pf=!1,null==d||d.removeEventListener("online",this.kf),null==(t=this.Nf)||t.call(this),this.Nf=void 0,null==(i=this.Sf)||i.reset(),null==(s=this.xf)||s.reset())}onRemoteConfig(e){var t,i;if(!this.ro){var s=e.ok?null==(t=e.config.logs)?void 0:t.captureConsoleLogs:void 0;K(s)?this.qf():(null==(i=this._instance)||null==(i=i.persistence)||i.register({[iC]:!!s}),s?(this.cf=!0,this.ff||this.Df(),this.loadIfEnabled()):this.qf())}}reset(){var e,t,i,s;this.Lf(),null==(e=this.Sf)||e.clearQueue(),this.La=[],null==(t=this.Sf)||t.reset(),null==(i=this.xf)||i.clearQueue(),this.mf=[],null==(s=this.xf)||s.reset(),this.Pd=0}captureLog(e){this.ro||this.If().captureLog(e)}captureConsoleLog(e){this.ro||this.Af().captureLog(e)}captureBufferedConsoleLog(e,t,i){this.ro||this.Af().captureLog(e,{context:t,occurredAtMs:i})}$f(){var e;return!(null==(e=this._instance)||null==(e=e.persistence)||null==(e=e.props)||!e[iC])}Of(){var e,t;return null==(e=this._instance)||null==e.Fa||!e.Fa()||!(null==(t=E._POSTHOG_REMOTE_CONFIG)||null==(t=t[this._instance.config.token])||!t.config)}Vu(){var e;this.Lf(),null==(e=this.xf)||e.clearQueue(),this.mf=[]}qf(){this.cf||this.Lf()}Df(){var e,t=this;if(!this._f&&null!=E&&E.console){var i=oX(null==(e=this._instance)||null==(e=e.config)?void 0:e.logs).maxBufferSize,s=function(e){var s;try{s=(e=>{for(;null!=(t=e)&&t.__rrweb_original__;){var t;e=e.__rrweb_original__}return e})(E.console[e])}catch(e){return 0}if(!s)return 0;t.bf.push(or(E.console,e,r=>{var n=function(){for(var s=arguments.length,n=Array(s),a=0;s>a;a++)n[a]=arguments[a];try{t.jf(e,n,i)}catch(e){}return r.apply(E.console,n)};return n.__rrweb_original__=s,n}))};for(var r of oY)s(r);this._f=!0,this.Bf=setTimeout(()=>{this.Lf()},3e4)}}jf(e,t,i){var s;if(this._f&&!this.wf&&0!==t.length)if(null!=(s=this._instance)&&s.is_capturing()){if(i>this.yf.length){this.wf=!0;try{this.yf.push({level:e,args:t,occurredAtMs:Date.now(),context:this.Mf()})}finally{this.wf=!1}}}else this.Lf()}Lf(){if(this.yf=[],this._f){for(var e of(this._f=!1,this.Bf&&(clearTimeout(this.Bf),this.Bf=void 0),this.bf))e();this.bf=[]}}Hf(){var e=this.yf;return this.Lf(),e}get logger(){return this.zf||(this.zf={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.zf}flushLogs(e){e?this.Uf(e):(this.Sf&&this.Sf.flush().catch(e=>this.Wf(e)),this.xf&&this.xf.flush().catch(e=>this.Wf(e)))}Wf(e){o1(e)||this.A.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(!this.ro&&this.cf&&!this.ff&&!this.pf){var e=null==E?void 0:E.__PosthogExtensions__;if(!e)return this.A.error("PostHog Extensions not found."),void this.Lf();var t=e.loadExternalDependency;if(!t)return this.A.error(sc),void this.Lf();this.pf=!0;try{t(this._instance,"logs",t=>{if(this.pf=!1,!this.ro&&this.cf){var i=e.logs;if(t||null==i||!i.initializeLogs)this.A.error("Could not load logs script",t),this.Lf();else{var s,r,n=this.Hf();this.Nf=i.initializeLogs(null!=(s=this.Js)?s:this._instance),this.ff=!0,n.length>0&&(null==i.replayConsoleBuffer||i.replayConsoleBuffer(null!=(r=this.Js)?r:this._instance,n))}}})}catch(e){throw this.pf=!1,e}}}Tf(e,t){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:t=>t===A.LogsQueue?e():void 0,setPersistedProperty(e,i){e===A.LogsQueue&&t(null!=i?i:[])},xs:e=>this.xs(e),getLibraryId:()=>R.LIB_NAME,getLibraryVersion:()=>R.LIB_VERSION}}xs(e){return new Promise(t=>{if(rY(this.Pd,3))t({kind:"fatal",error:o0(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,s=e=>{i||(i=!0,clearTimeout(r),t(e))},r=setTimeout(()=>{this.A.warn("Logs request timed out before receiving a response"),s({kind:"retry-later",error:o0(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.Vf(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t,i=e.statusCode;(this.Gf(i),i>=200&&300>i)?s({kind:"ok"}
2):413===i?s({kind:"too-large"}):0!==i&&408!==i&&429!==i&&500>i?s({kind:"fatal",error:Error("logs request failed with status "+i)}):0===i?(e.error||this.A.warn("Logs request failed before receiving an HTTP response"),s({kind:"retry-later",error:o0(e.error,"logs request failed before receiving an HTTP response")})):s({kind:"retry-later",error:null!=(t=e.error)?t:Error("logs request failed with status "+i)})}})}})}Gf(e){(0!==e||this._instance.__loaded)&&(this.Pd=rZ(e,this.Pd,3,()=>this.A.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}Uf(e){this.La.length>0&&this.Zf(e,this.La,this.Rf,R.LIB_NAME,e=>{this.La=e}),this.mf.length>0&&this.Zf(e,this.mf,this.Ff,oZ,e=>{this.mf=e})}Zf(e,t,i,s,r){if(0!==t.length){var n=t.map(e=>e.record);r([]);var a=ie(n,t8(i,R.LIB_NAME,R.LIB_VERSION),s,R.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Vf(),data:a,compression:"best-available",batchKey:"logs",transport:e})}}Vf(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Mf(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var i=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),s=i.windowId,r=i.sessionStartTimestamp,n=i.lastActivityTimestamp;t.sessionId=i.sessionId,t.windowId=s,K(r)||(t.sessionStartTimestamp=r),K(n)||(t.lastActivityTimestamp=n)}if(null!=E&&null!=(e=E.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?td(E.location.href):E.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(t.activeFeatureFlags=a)}return t}}},{metrics:class{constructor(e){this._instance=e,this.A=iu("[metrics]")}initialize(){}If(){var e,t,i,s,r,n,a,o,l=null==(a=this._instance)||null==(a=a.config)?void 0:a.metrics;return this.Sf&&this.Ef===l||(null==(o=this.Sf)||o.reset(),this.Ef=l,this.Sf=new ia(this.Tf(),{serviceName:null!=(e=null==(n=null==l?void 0:l.resourceAttributes)?void 0:n["service.name"])?e:null==l?void 0:l.serviceName,serviceVersion:null!=(t=null==n?void 0:n["service.version"])?t:null==l?void 0:l.serviceVersion,environment:null!=(i=null==n?void 0:n["deployment.environment"])?i:null==l?void 0:l.environment,resourceAttributes:n,beforeSend:null==l?void 0:l.beforeSend,flushIntervalMs:null!=(s=null==l?void 0:l.flushIntervalMs)?s:1e4,maxSeriesPerFlush:null!=(r=null==l?void 0:l.maxSeriesPerFlush)?r:1e3},this.A)),this.Sf}count(e,t,i){void 0===t&&(t=1),this.If().count(e,t,i)}gauge(e,t,i){this.If().gauge(e,t,i)}histogram(e,t,i){this.If().histogram(e,t,i)}flush(e){if(!this.Sf)return Promise.resolve();if(e){var t=this.Sf.drainWindow();return t&&this.js(t,e),Promise.resolve()}return this.Sf.flush().catch(e=>this.A.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.Sf)||e.reset()}Tf(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},js:e=>t.js(e),getLibraryId:()=>R.LIB_NAME,getLibraryVersion:()=>R.LIB_VERSION}}js(e,t){return new Promise(i=>{var s=!1,r=e=>{s||(s=!0,clearTimeout(n),i(e))},n=setTimeout(()=>r({kind:"retry-later",error:Error("metrics request timed out")}),9e4);this._instance._send_request(u({method:"POST",url:this.Jf(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t,i=e.statusCode;r(i>=200&&300>i?{kind:"ok"}:413===i?{kind:"too-large"}:0!==i&&408!==i&&429!==i&&500>i?{kind:"fatal",error:Error("metrics request failed with status "+i)}:{kind:"retry-later",error:null!=(t=e.error)?t:Error("metrics request failed with status "+i)})}}))})}Jf(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});a2.__defaultExtensionClasses=u({},o8);var o4=(R.SDK_DIST_CHANNEL="npm",s=aq[aX]=new a2,function(){function e(){e.done||(e.done=!0,aY=!1,sx(aq,function(e){e._dom_loaded()}))}null!=f&&f.addEventListener?"complete"===f.readyState?e():sI(f,"DOMContentLoaded",e,{capture:!1}):d&&il.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),s);e.s(["default",0,o4])}]); 3 4//# debugId=7afc162f-5876-ac2f-68dc-a6c247d9755f
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.