PageSourceSearch

https://app.tamy.ai/_next/static/chunks/0yrgp3-shg4-_.js

js tamy.ai collected 2026-10-05 13:53:15 UTC 277,833 bytes, 4 lines download raw bytes

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]="a40d7461-7227-2f8e-933f-6847dac8c549")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,876229,e=>{"use strict";var t=e.i(577635),i=(e,t,i,s,r,n,a,o)=>{let l=document.documentElement,u=["light","dark"];function h(t){var i;(Array.isArray(e)?e:[e]).forEach(e=>{let i="class"===e,s=i&&n?r.map(e=>n[e]||e):r;i?(l.classList.remove(...s),l.classList.add(n&&n[t]?n[t]:t)):l.setAttribute(e,t)}),i=t,o&&u.includes(i)&&(l.style.colorScheme=i)}if(s)h(s);else try{let e=localStorage.getItem(t)||i,s=a&&"system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e;h(s)}catch(e){}},s=["light","dark"],r="(prefers-color-scheme: dark)",n="u"<typeof window,a=t.createContext(void 0),o={setTheme:e=>{},themes:[]},l=["light","dark"],u=({forcedTheme:e,disableTransitionOnChange:i=!1,enableSystem:n=!0,enableColorScheme:o=!0,storageKey:u="theme",themes:v=l,defaultTheme:g=n?"system":"light",attribute:f="data-theme",value:_,children:m,nonce:y,scriptProps:b})=>{let[w,x]=t.useState(()=>c(u,g)),[k,E]=t.useState(()=>"system"===w?p():w),S=_?Object.values(_):v,P=t.useCallback(e=>{let t=e;if(!t)return;"system"===e&&n&&(t=p());let r=_?_[t]:t,a=i?d(y):null,l=document.documentElement,u=e=>{"class"===e?(l.classList.remove(...S),r&&l.classList.add(r)):e.startsWith("data-")&&(r?l.setAttribute(e,r):l.removeAttribute(e))};if(Array.isArray(f)?f.forEach(u):u(f),o){let e=s.includes(g)?g:null,i=s.includes(t)?t:e;l.style.colorScheme=i}null==a||a()},[y]),I=t.useCallback(e=>{let t="function"==typeof e?e(w):e;x(t);try{localStorage.setItem(u,t)}catch(e){}},[w]),F=t.useCallback(t=>{E(p(t)),"system"===w&&n&&!e&&P("system")},[w,e]);t.useEffect(()=>{let e=window.matchMedia(r);return e.addListener(F),F(e),()=>e.removeListener(F)},[F]),t.useEffect(()=>{let e=e=>{e.key===u&&(e.newValue?x(e.newValue):I(g))};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[I]),t.useEffect(()=>{P(null!=e?e:w)},[e,w]);let C=t.useMemo(()=>({theme:w,setTheme:I,forcedTheme:e,resolvedTheme:"system"===w?k:w,themes:n?[...v,"system"]:v,systemTheme:n?k:void 0}),[w,I,e,k,n,v]);return t.createElement(a.Provider,{value:C},t.createElement(h,{forcedTheme:e,storageKey:u,attribute:f,enableSystem:n,enableColorScheme:o,defaultTheme:g,value:_,themes:v,nonce:y,scriptProps:b}),m)},h=t.memo(({forcedTheme:e,storageKey:s,attribute:r,enableSystem:n,enableColorScheme:a,defaultTheme:o,value:l,themes:u,nonce:h,scriptProps:c})=>{let d=JSON.stringify([r,s,o,e,u,l,n,a]).slice(1,-1);return t.createElement("script",{...c,suppressHydrationWarning:!0,nonce:"u"<typeof window?h:"",dangerouslySetInnerHTML:{__html:`(${i.toString()})(${d})`}})}),c=(e,t)=>{let i;if(!n){try{i=localStorage.getItem(e)||void 0}catch(e){}return i||t}},d=e=>{let t=document.createElement("style");return e&&t.setAttribute("nonce",e),t.appendChild(document.createTextNode("*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(t),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(t)},1)}},p=e=>(e||(e=window.matchMedia(r)),e.matches?"dark":"light");e.s(["ThemeProvider",0,e=>t.useContext(a)?t.createElement(t.Fragment,null,e.children):t.createElement(u,{...e}),"useTheme",0,()=>{var e;return null!=(e=t.useContext(a))?e:o}])},925174,197507,e=>{"use strict";var t,i,s,r,n="u">typeof window?window:void 0,a="u">typeof globalThis?globalThis:n,o=null==a?void 0:a.navigator,l=null==a?void 0:a.document,u=null==a?void 0:a.location,h=null==a?void 0:a.fetch,c=null!=a&&a.XMLHttpRequest&&"withCredentials"in new a.XMLHttpRequest?a.XMLHttpRequest:void 0,d=null==a?void 0:a.AbortController,p=null==a?void 0:a.CompressionStream,v=null==o?void 0:o.userAgent;function g(){return!(!n||!1===n.navigator.onLine)}var f="u">typeof globalThis?globalThis:n;f&&"u"<typeof self&&(f.self=f),f&&"u"<typeof File&&(f.File=function(){});var _=null!=n?n:{},m={DEBUG:!1,LIB_VERSION:"0.6.0",LIB_NAME:"browser-common"};function y(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 b(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function a(e){y(n,s,r,a,o,"next",e)}function o(e){y(n,s,r,a,o,"throw",e)}a(void 0)})}}function w(){return(w=Object.assign.bind()).apply(null,arguments)}function x(e,t){if(null==e)return{};var i={};for(var s in e)if(({}).hasOwnProperty.call(e,s)){if(-1!==t.indexOf(s))continue;i[s]=e[s]}return i}var k=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function E(e){return"string"==typeof e||e}function S(e){return"string"==typeof e?e:void 0}var P,I,F,C,T=["$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"],$=((P={}).AnonymousId="anonymous_id",P.DistinctId="distinct_id",P.Props="props",P.EnablePersonProcessing="enable_person_processing",P.PersonMode="person_mode",P.FeatureFlagDetails="feature_flag_details",P.FeatureFlags="feature_flags",P.FeatureFlagPayloads="feature_flag_payloads",P.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",P.BootstrapFeatureFlags="bootstrap_feature_flags",P.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",P.OverrideFeatureFlags="override_feature_flags",P.Queue="queue",P.AiQueue="ai_queue",P.AiCaptureQueue="ai_capture_queue",P.LogsQueue="logs_queue",P.OptedOut="opted_out",P.SessionId="session_id",P.SessionStartTimestamp="session_start_timestamp",P.SessionLastTimestamp="session_timestamp",P.PersonProperties="person_properties",P.GroupProperties="group_properties",P.InstalledAppBuild="installed_app_build",P.InstalledAppVersion="installed_app_version",P.SessionReplay="session_replay",P.PushRegistered="push_registered",P.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",P.SurveyLastSeenDate="survey_last_seen_date",P.SurveysSeen="surveys_seen",P.Surveys="surveys",P.RemoteConfig="remote_config",P.FlagsEndpointWasHit="flags_endpoint_was_hit",P.DeviceId="device_id",P),R=((I={}).GZipJS="gzip-js",I.Base64="base64",I),O=["$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"],M=["token"],L="NativeGzipValidationError",A=e=>e.length>=2&&31===e[0]&&139===e[1],D=(e,t)=>
2e===R.GZipJS||t===R.GZipJS||"gzip"===t,j=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),W=e=>{var t=Error("Native gzip produced invalid output: "+e);throw t.name=L,t},N=(F=b(function*(e,t){18>e.size&&W("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));A(i)&&8===i[2]||W("invalid-header");var s=new DataView((yield e.slice(e.size-8).arrayBuffer()));s.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(C)return C;C=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?0xedb88320^t>>>1:t>>>1;C[e]=t>>>0}return C})(),i=0xffffffff,s=0;e.length>s;s++)i=t[255&(i^e[s])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&W("invalid-crc");var r=t.length>>>0;s.getUint32(4,!0)!==r&&W("invalid-size")}),function(e,t){return F.apply(this,arguments)});function H(){return(H=b(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=b(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 N(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 q="[Truncated]",U="[Unserializable]";function B(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 z=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],V=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return z.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function G(e,t){return -1!==e.indexOf(t)}var K=function(e){return e.trim()},J=function(e){return e.replace(/^\$/,"")};function Y(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 Z=Object.prototype,X=Z.hasOwnProperty,Q=Z.toString,ee=Array.isArray||function(e){return"[object Array]"===Q.call(e)},et=e=>"function"==typeof e,ei=e=>e===Object(e)&&!ee(e),es=e=>{if(ei(e)){for(var t in e)if(X.call(e,t))return!1;return!0}return!1},er=e=>void 0===e,en=e=>"[object String]"==Q.call(e),ea=e=>en(e)&&0===e.trim().length,eo=e=>null===e,el=e=>er(e)||eo(e),eu=e=>"[object Number]"==Q.call(e)&&e==e,eh=e=>eu(e)&&e>0,ec=e=>"[object Boolean]"===Q.call(e),ed=e=>G(O,e),ep=e=>G(M,e);function ev(e){return null===e||"object"!=typeof e}function eg(e,t){return({}).toString.call(e)==="[object "+t+"]"}function ef(e){switch(({}).toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object DOMError]":case"[object WebAssembly.Exception]":return!0;default:return em(e,Error)}}function e_(e){return"u">typeof Event&&em(e,Event)}function em(e,t){try{return e instanceof t}catch(e){return!1}}var ey=[!0,"true",1,"1","yes"],eb=[!1,"false",0,"0","no"];function ew(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),eu(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),ew(r||i,t,i,s))}class ex{constructor(e){this.k={},this.S=e.S,this.C=ew(e.bucketSize,0,100,e.I),this.R=ew(e.refillRate,0,this.C,e.I),this.A=ew(e.refillInterval,0,864e5,e.I)}O(e,t){var i=Math.floor((t-e.lastAccess)/this.A);i>0&&(e.tokens=Math.min(e.tokens+i*this.R,this.C),e.lastAccess=e.lastAccess+i*this.A)}consumeRateLimit(e){var t,i=Date.now(),s=String(e),r=this.k[s];return r?this.O(r,i):this.k[s]=r={tokens:this.C,lastAccess:i},0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.S)||t.call(this,e)),0===r.tokens)}stop(){this.k={}}}var ek="Mobile",eE="Android",eS="Tablet",eP=eE+" "+eS,eI="iPad",eF="Apple",eC=eF+" Watch",eT="Safari",e$="BlackBerry",eR="Samsung",eO=eR+"Browser",eM=eR+" Internet",eL="Chrome",eA=eL+" OS",eD=eL+" iOS",ej="Internet Explorer",eW=ej+" "+ek,eN="Opera",eH=eN+" Mini",eq="Edge",eU="Microsoft "+eq,eB="Firefox",ez=eB+" iOS",eV="Nintendo",eG="PlayStation",eK="Xbox",eJ=eE+" "+ek,eY=ek+" "+eT,eZ="Windows",eX=eZ+" Phone",eQ="Nokia",e0="Ouya",e1="Generic",e2=e1+" "+ek.toLowerCase(),e3=e1+" "+eS.toLowerCase(),e5="Konqueror",e6="Oculus Browser",e4="Vivaldi",e8="Yandex",e7="Whale",e9="DuckDuckGo",te="Pale Moon",tt="Waterfox",ti="Brave",ts="Google Search App",tr="(\\d+(\\.\\d+)?)",tn=RegExp("Version/"+tr),ta=RegExp(eK,"i"),to=RegExp(eG+" \\w+","i"),tl=RegExp(eV+" \\w+","i"),tu=RegExp(e$+"|PlayBook|BB10","i"),th={"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"},tc=function(e,t,i,s){var r;return t=t||"",(null!=i&&i.brave?ti:null)||(null!=s&&s.detectGoogleSearchApp&&G(e,"GSA/")?ts:G(e," OPR/")&&G(e,"Mini")?eH:G(e," OPR/")?eN:tu.test(e)?e$:G(e,"IE"+ek)||G(e,"WPDesktop")?eW:G(e,"OculusBrowser")?e6:G(e,eO)?eM:G(e,eq)||G(e,"Edg/")?eU:G(e,e4+"/")?e4:G(e,"YaBrowser/")?e8:G(e,e7+"/")?e7:G(e,e9+"/")||G(e,"Ddg/")?e9:G(e,"FBIOS")?"Facebook "+ek:G(e,"UCWEB")||G(e,"UCBrowser")?"UC Browser":G(e,"CriOS")?eD:G(e,"CrMo")||G(e,eL)?eL:G(e,eE)&&G(e,eT)?eJ:G(e,"FxiOS")?ez:G(e.toLowerCase(),e5.toLowerCase())?e5:G(e,ti+"/")?ti:(r=t)&&G(r,eF)||G(e,eT)&&!G(e,eL)&&!G(e,eE)?G(e,ek)?eY:eT:G(e,"PaleMoon/")?te:G(e,tt+"/")?tt:G(e,eB)?eB:G(e,"MSIE")||G(e,"Trident/")?ej:G(e,"Gecko")?eB:"")},td={[eW]:[RegExp("rv:"+tr)],[eU]:[RegExp(eq+"?\\/"+tr)],[eL]:[RegExp("("+eL+"|CrMo)\\/"+tr)],[eD]:[RegExp("CriOS\\/"+tr)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+tr)],[eT]:[tn],[eY]:[tn],[eN]:[RegExp("(Opera|OPR)\\/"+tr)],[eB]:[RegExp(eB+"\\/"+tr)],[ez]:[RegExp("FxiOS\\/"+tr)],[e5]:[RegExp("Konqueror[:/]?"+tr,"i")],[e$]:[RegExp(e$+" "+tr),tn],[eJ]:[RegExp("android\\s"+tr,"i")],[eM]:[RegExp(eO+"\\/"+tr)],[e6]:[RegExp("OculusBrowser\\/"+tr)],[e4]:[RegExp(e4+"\\/"+tr)],[e8]:[RegExp("YaBrowser\\/"+tr)],[e7]:[RegExp(e7+"\\/"+tr)],[ti]:[RegExp(ti+"\\/"+tr)],[e9]:[RegExp("(DuckDuckGo|Ddg)\\/"+tr)],[te]:[RegExp("PaleMoon\\/"+tr)],[tt]:[RegExp(tt+"\\/"+tr)],[ts]:[RegExp("GSA\\/"+tr)],[ej]:[RegExp("(rv:|MSIE )"+tr)],Mozilla:[RegExp("rv:"+tr)]},tp=function(e,t,i,s){var r=td[tc(e,t,i,s)];if(er(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},tv=[[RegExp(eK+"; "+eK+" (.*?)[);]","i"),e=>[eK,e&&e[1]||""]],[RegExp(eV,"i"),[eV,""]],[RegExp(eG,"i"),[eG,""]],[tu,[e$,""]],[RegExp(eZ,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eX,""];if(new RegExp(ek).test(t)&&!/IEMobile\b/.test(t))return[eZ+" "+ek,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=th[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[eZ,s]}return[eZ,""]}],[/((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=er(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+eE+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+eE+")","i"),e=>e&&e[2]?[eE,[e[2],e[3],e[4]||"0"].join(".")]:[eE,""]],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,e=>{var t=["Mac OS X",""];return e&&e[1]&&(t[1]=[e[1],e[2],e[3]||"0"].join(".")),t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[eA,""]],[/Linux|debian/i,["Linux",""]]],tg=function(e){return tl.test(e)?eV:to.test(e)?eG:ta.test(e)?eK:RegExp(e0,"i").test(e)?e0:RegExp("("+eX+"|WPDesktop)","i").test(e)?eX:/iPad/.test(e)?eI:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?eC:tu.test(e)?e$:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eQ,"i").test(e)?eQ:/(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(ek).test(e)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(e)||/pixel[\daxl ]{1,6}/i.test(e)&&!/pixel c/i.test(e)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(e)||/lmy47v/i.test(e)&&!/QTAQZ3/i.test(e)?eE:eP:
2RegExp("(pda|"+ek+")","i").test(e)?e2:RegExp(eS,"i").test(e)&&!RegExp(eS+" pc","i").test(e)?e3:""},tf=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function t_(e,t){return"string"==typeof e&&tf.test(e)?e:t()}function tm(e){return e?e.split("#")[0]:e}function ty(e,t){var i=setTimeout(e,t);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}function tb(e,t,i){return tw.apply(this,arguments)}function tw(){return(tw=b(function*(e,t,i){var s;try{return yield Promise.race([e,new Promise((e,r)=>{s=ty(()=>{try{null==i||i(),e()}catch(e){r(e)}},t)})])}finally{clearTimeout(s)}})).apply(this,arguments)}var tx={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}},tk=tx.info,tE={}.propertyIsEnumerable;function tS(e,t){try{return tP(e,t,{ancestors:new WeakSet,remainingNodes:1e4},0)}catch(e){return[]}}function tP(e,t,i,s){var r=[];for(var n in e)if(tE.call(e,n)){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(eo(a)||er(a))continue;r.push({key:B(n),value:function e(t,i,s,r){if(0>=s.remainingNodes)return{stringValue:q};if(s.remainingNodes--,ec(t))return{boolValue:t};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("u"<typeof BigInt)return{stringValue:String(t)};var n=BigInt(t).toString();return t>=0x8000000000000000||-0x8000000000000000>t?(null==i||i.debug("Attribute "+n+" is outside the int64 range; encoding it as a string"),{stringValue:n}):{intValue:n}}return{doubleValue:t}}if("string"==typeof t)return{stringValue:B(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:q};if(t instanceof Date){var a=Number.isFinite(t.getTime())?t.toISOString():String(t);return{stringValue:"string"==typeof a?B(a):String(a)}}s.ancestors.add(t);try{try{var o=t.toJSON;if("function"==typeof o)return e(o.call(t),i,s,r+1)}catch(e){}return ee(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(el(l))continue;n.push(e(l,i,s,r))}catch(e){n.push({stringValue:U})}return t.length>o&&n.push({stringValue:q}),n}(t,i,s,r+1)}}:{kvlistValue:{values:tP(t,i,s,r+1)}}}finally{s.ancestors.delete(t)}}return{stringValue:B(String(t))}}(a,t,i,s)})}catch(e){r.push({key:B(n),value:{stringValue:U}})}}return r}function tI(e,t,i){return w({},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})}function tF(e,t,i,s){return{resourceLogs:[{resource:{attributes:tS(t)},scopeLogs:[{scope:{name:i,version:s},logRecords:e}]}]}}let tC=class{constructor(e,t,i,s,r,n,a){var o;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.Wi=t,this.I=i,this.hn=s,this.dn=r,this.vn=n,this.cn=a,this.fn=null,this.pn=0,this.gn=0,this.mn=0,this.yn=0,this.bn=!1,this._n=t.maxBufferSize,this.wn=Math.max(null!=(o=t.maxQueueSize)?o:t.maxBufferSize,t.maxBufferSize),this.kn=t.flushIntervalMs,this.Sn=t.maxBatchRecordsPerPost,this.xn=t.rateCapWindowMs,this.Cn=t.maxLogsPerInterval}reset(){this.Tn(),this.fn=null,this.mn=0,this.yn=0,this.bn=!1,this.pn=0,this.gn=0,this.Sn=this.Wi.maxBatchRecordsPerPost}onReconnect(){this.gn=0,this.Mn()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.En(e);if(null!==t)if(t.body){if(this.In()){var i={record:function(e,t,i){var s=tx[e.level||"info"]||tk,r=s.text,n=s.number,a=String(Date.now())+"000000",o={};t.distinctId&&(o.posthogDistinctId=t.distinctId),t.sessionId&&(o.sessionId=t.sessionId),t.windowId&&(o["window.id"]=t.windowId),el(t.sessionStartTimestamp)||(o.sessionStartTimestamp=String(t.sessionStartTimestamp)),el(t.lastActivityTimestamp)||(o.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(o["url.full"]=t.currentUrl),t.screenName&&(o["screen.name"]=t.screenName),t.appState&&(o["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(o.feature_flags=t.activeFeatureFlags);var l=w({},o),u=e.attributes;if(u){var h=[];try{h=Object.keys(u)}catch(e){h=[]}for(var c of h){var d=void 0;try{d=u[c]}catch(e){d=U}Object.defineProperty(l,c,{value:d,enumerable:!0,writable:!0,configurable:!0})}}var p={timeUnixNano:a,observedTimeUnixNano:a,severityNumber:n,severityText:r,body:{stringValue:function(e){try{return B(String(e))}catch(e){return U}}(e.body)},attributes:tS(l,i)};return e.trace_id&&(p.traceId=e.trace_id),e.span_id&&(p.spanId=e.span_id),er(e.trace_flags)||(p.flags=e.trace_flags),p}(t,this.hn(),this.I)};this.dn(()=>this.Rn(i))}}else this.I.info("Log was rejected in beforeSend function")}}En(e){var t=this.Wi.beforeSend;if(!t)return e;var i=ee(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.I.info("Log was rejected in beforeSend function"),null;s=n}catch(e){return this.I.error("Error in beforeSend function for log:",e),null}return s}In(){if(void 0===this.Cn)return!0;var e=Date.now(),t=e-this.mn;return this.xn>t&&t>=0||(this.mn=e,this.yn=0,this.bn=!1),this.Cn>this.yn?(this.yn++,!0):(this.bn||(this.I.warn("captureLog dropping logs: exceeded "+this.Cn+" logs per "+this.xn+"ms"),this.bn=!0),!1)}flush(){var e=this;return b(function*(){if(!e._instance.isDisabled)return e.fn||(e.fn=e.Pn().finally(()=>{e.fn=null})),e.fn})()}Pn(){var e=this;return b(function*(){e.Tn();var t=null!=(r=e._instance.getPersistedProperty($.LogsQueue))?r:[];if(0!==t.length)for(var i=t.length,s=0;t.length>0&&i>s;){e.pn=0;var r,n,a,o=Math.min(t.length,e.Sn),l=t.slice(0,o),u=tF(l.map(e=>e.record),e.An(),null!=(n=e.cn)?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),h=yield e._instance.Fn(u);if("too-large"===h.kind&&l.length>1)e.Sn=Math.max(1,Math.floor(l.length/2)),e.I.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.Sn);else if("retry-later"===h.kind||("too-large"===h.kind?e.I.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"===h.kind&&e.Wi.maxBatchRecordsPerPost>e.Sn&&(e.Sn=Math.min(e.Wi.maxBatchRecordsPerPost,e.Sn+1)),yield e.On(l.length),t=null!=(a=e._instance.getPersistedProperty($.LogsQueue))?a:[],s+=l.length,"fatal"===h.kind))throw h.error}})()}On(e){var t=this;return b(function*(){var i,s=Math.max(0,e-t.pn),r=null!=(i=t._instance.getPersistedProperty($.LogsQueue))?i:[];t._instance.setPersistedProperty($.LogsQueue,r.slice(s)),yield t.vn()})()}An(){return tI(this.Wi,this._instance.getLibraryId(),this._instance.getLibraryVersion())}Rn(e){var t;if(!this._instance.optedOut){var i=null!=(t=this._instance.getPersistedProperty($.LogsQueue))?t:[];this.wn>i.length||(i.shift(),this.pn++,this.I.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty($.LogsQueue,i),this._n>i.length?this.Ln():this.Mn()}}Ln(e){void 0===e&&(e=this.kn),this.Dn||(this.Dn=ty(()=>{this.Dn=void 0,this.Mn()},e))}$n(){var e=Math.min(Math.max(0,this.gn-1),6);return this.kn*Math.pow(2,e)}Nn(){var e=this._instance.getPersistedProperty($.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return b(function*(){t.Tn();var i=t.flush().catch(()=>{});void 0!==e?yield tb(i,e):yield i})()}flushWithTimeout(e){var t=this;return b(function*(){var i=t.flush();yield tb(i,e,()=>{i.catch(()=>{})})})()}Mn(){this.flush().then(()=>{this.gn=0},e=>{this.gn++,this.I.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.Nn()&&this.Ln(this.$n())})}Tn(){this.Dn&&(clearTimeout(this.Dn),this.Dn=void 0)}};var tT=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function t$(e){return String(e)+"000000"}function tR(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}let tO=class{constructor(e,t,i){this._instance=e,this.Wi=t,this.I=i,this.qn=new Map,this.fn=null,this.jn=!1,this.Bn=new Map,this.Hn=new Set,this.Un=0}count(e,t,i){void 0===t&&(t=1),this.zn({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.zn({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.zn({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.fn,s=(e=b(function*(){i&&(yield i.catch(()=>{})),yield t.Wn()}),function(){return e.apply(this,arguments)})().finally(()=>{this.fn===s&&(this.fn=null)});return this.fn=s,s}drainWindow(){if(0===this.qn.size)return null;var e=this.qn;return this.qn=new Map,this.jn=!1,this.Bn=new Map,this.Hn=new Set,this.Vn(e)}reset(){this.Un++,this.Tn(),this.qn=new Map,this.fn=null,this.jn=!1,this.Bn=new Map,this.Hn=new Set}zn(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.En(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.I.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{try{i=t.attributes?w({},t.attributes):void 0,s=tR(t.type,t.name,t.unit,i)}catch(e){return void this.I.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var i,s,r=this.qn.get(s);if(!r){if(!this.Gn())return;r={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.qn.set(s,r)}var n=this.Bn.get(t.name);void 0===n?this.Bn.set(t.name,t.type):n===t.type||this.Hn.has(t.name)||(this.Hn.add(t.name),this.I.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.Zn(r,t.value),this.Ln()}else this.I.warn("Dropping metric '"+t.name+"': value must be a finite number");else this.I.warn("Dropping metric with empty name")}}Gn(){return this.Wi.maxSeriesPerFlush>this.qn.size||(this.jn||(this.jn=!0,this.I.warn("Metric series cap reached ("+this.Wi.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Zn(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(tT.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,tT)]+=1}}En(e){var t=this.Wi.beforeSend;if(!t)return e;var i=ee(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.I.info("Metric was rejected in beforeSend function"),null;s=n}catch(e){return this.I.error("Error in beforeSend function for metric:",e),null}return s}Ln(){this.Dn||(this.Dn=ty(()=>{this.Dn=void 0,this.flush().catch(e=>{this.I.error("Metrics flush failed:",e)})},this.Wi.flushIntervalMs))}Tn(){this.Dn&&(clearTimeout(this.Dn),this.Dn=void 0)}Wn(){var e=this;return b(function*(){if(0!==e.qn.size){var t=e.qn;e.qn=new Map,e.jn=!1,e.Bn=new Map,e.Hn=new Set;var i=e.Un,s=yield e._instance.Qn(e.Vn(t));if(i===e.Un)switch(s.kind){case"ok":return;case"retry-later":return e.Jn(t),void e.Ln();case"too-large":return void e.I.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.I.error("Failed to send metrics batch:",s.error)}}})()}Vn(e){var t,i,s,r,n,a,o;return t=this.Kn(e),n=this.Wi,a=this._instance.getLibraryId(),o=this._instance.getLibraryVersion(),i=w({},n.resourceAttributes,{"service.name":n.serviceName||"unknown_service"},n.environment&&{"deployment.environment":n.environment},n.serviceVersion&&{"service.version":n.serviceVersion},{"telemetry.sdk.name":a,"telemetry.sdk.version":o}),s=this._instance.getLibraryId(),r=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:tS(i)},scopeMetrics:[{scope:{name:s,version:r},metrics:t}]}]}}Kn(e){var t=t$(Date.now()),i=new Map;for(var s of e.values()){var r,n=tR(s.type,s.name,s.unit,void 0),a=i.get(n);a||(a=w({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=tS(null!=(r=s.attributes)?r:{},this.I),l=t$(s.windowStartMs);if("count"===s.type){var u,h={attributes:o,startTimeUnixNano:l,timeUnixNano:t,asDouble:null!=(u=s.total)?u:0};a.sum.dataPoints.push(h)}else if("gauge"===s.type){var c,d={attributes:o,timeUnixNano:t,asDouble:null!=(c=s.last)?c:0};a.gauge.dataPoints.push(d)}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:tT})}return Array.from(i.values())}Jn(e){var t,i;for(var s of e){var r=s[0],n=s[1],a=this.qn.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.Gn()&&this.qn.set(r,n)}}};class tM{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 b(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&ee(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.ski
2pFirstLines:0),t.chunkIdMap)),w({},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 b(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,w({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return sF&&i.length===sI||(sI=i.length,sF=i.reduce((i,s)=>{sP||(sP={});var r=sP[s];if(r)i[r[0]]=r[1];else for(var n=e(s),a=n.length-1;a>=0;a--){var o=n[a],l=null==o?void 0:o.filename,u=t[s];if(l&&u){i[l]=u,sP[s]=[l,u];break}}return i},{})),sF}}(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 w({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,i),next:e=>s(e,i+1)})}}function tL(e,t,i,s,r){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!(null!=t&&t.startsWith("webkit-masked-url://"))&&"<anonymous>"!==t};return er(s)||(n.lineno=s),er(r)||(n.colno=r),n}var tA=(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]},tD=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tj=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tW=/\((\S*)(?::(\d+))(?::(\d+))\)/,tN=(e,t)=>{var i=tD.exec(e);if(i)return tL(t,i[1],"?",+i[2],+i[3]);var s=tj.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=tA(s[1]||"?",s[2]);return tL(t,n[1],n[0],s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},tH=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tq=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tU=(e,t)=>{var i=tH.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var s=tq.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=tA(n,r);return tL(t,r=a[1],n=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tB=/\(error: (.*)\)/;class tz{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=en(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 eg(e,"DOMException")}isDOMError(e){return eg(e,"DOMError")}}class tV{match(e){return ef(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}}class tG{match(e){return!!eg(e,"ErrorEvent")&&(null!=e.error||this.wi(e))}coerce(e,t){if(null!=e.error)return t.apply(e.error);var i,s=t.apply(e.message);return w({},s,{stack:null!=(i=this.ki(e))?i:s.stack,synthetic:!0})}wi(e){return en(e.message)&&e.message.length>0}ki(e){var t,i,s=null!=(t=e.lineno)?t:0,r=null!=(i=e.colno)?i:0;if(en(e.filename)&&0!==e.filename.length&&0!==s)return"Error\n    at "+e.filename+":"+s+":"+r}}var tK=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tJ{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(tK);return s&&(t=s[1],i=s[2]),[t,i]}}var tY=["fatal","error","warning","log","info","debug"];function tZ(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""}class tX{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(e_(e))return e.constructor.name;var t="name"in e?e.name:void 0;return en(t)&&!ea(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: "+tZ(e)}isSeverityLevel(e){return en(e)&&!ea(e)&&tY.indexOf(e)>=0}getStack(e){try{return en(e.stacktrace)&&e.stacktrace.length>0?e.stacktrace:en(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(ef(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tQ{match(e){return e_(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+tZ(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class t0{match(e){return ev(e)}coerce(e,t){var i;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class t1{match(e){return eg(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!e_(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 ev(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}}var t2="$message",t3="$timestamp",t5=new Set([t2,t3]),t6={enabled:!0,max_bytes:32768};function t4(e){var t;return e?{enabled:null!=(t=e.enabled)?t:t6.enabled,max_bytes:function(e,t){if(!eu(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,t6.max_bytes)}:w({},t6)}class t8{constructor(e){this.Yn=[],this.Xn=0,this.Wi=t4(e)}setConfig(e){this.Wi=t4(e),this.ts()}add(e){var t=function(e){var t;try{t=Y(e)}catch(e){return}try{var i=JSON.parse(t);if(!ei(i))return;var s=i[t2],r=i[t3];if(!en(s)||0===s.trim().length||!en(r)&&!eu(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.Wi.max_bytes||(this.Yn.push({step:t.step,bytes:i}),this.Xn+=i,this.ts())}}getAttachable(){return this.Yn.map(e=>e.step)}clear(){this.Yn=[],this.Xn=0}size(){return this.Yn.length}ts(){for(;this.Xn>this.Wi.max_bytes&&this.Yn.length>0;){var e=this.Yn.shift();e&&(this.Xn-=e.bytes)}}}var t7=function(e,t){var i=(void 0===t?{}:t).debugEnabled,s={P(t){if(n&&(m.DEBUG||n.POSTHOG_DEBUG||i)&&!er(n.console)&&n.console){for(var s=("__rrweb_original__"in n.console[t])?n.console[t].__rrweb_original__:n.console[t],r=arguments.length,a=Array(r>1?r-1:0),o=1;r>o;o++)a[o-1]=arguments[o];s(e,...a)}},debug(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.P("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.P("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.P("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.P("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)=>t7(e+" "+t,i)};return s},t9=t7("[PostHog.js]"),ie=t9.createLogger,it=ie("[ExternalScriptsLoader]"),ii=e=>{var t=null==l?void 0:l.querySelectorAll("script");
2if(t){for(var i=0;t.length>i;i++)if(t[i].src===e||t[i].getAttribute("src")===e)return t[i]}},is=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return it.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=ii(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(!l)return i("document not found");if(ii(t))return is(e,t,i);var s=l.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)},s.onerror=e=>{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)l.head.appendChild(s);else{var r,n=l.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):l.body.appendChild(s)}};null!=l&&l.body?n():null==l||l.addEventListener("DOMContentLoaded",n)},ir={},ia=(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)};_.__PosthogExtensions__=_.__PosthogExtensions__||{},_.__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=ir[r];if("fallback"===s&&n){if(ii(n))return void is(e,n,i);delete ir[r]}is(e,r,"fallback"===s?(s,n)=>{if(s)if("string"==typeof s)i(s);else{var a,o=ia(e,t);ir[r]=o;var l=ii(r);null==l||null==(a=l.parentNode)||a.removeChild(l),is(e,o,i)}else i(void 0,n)}:i)}else is(e,ia(e,t),i)}else{var a=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");is(e,a,i)}},_.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);is(e,s,i)},m.DEBUG=!1,m.LIB_VERSION="1.421.0",m.LIB_NAME="web";var io="$people_distinct_id",il="distinct_id",iu="$device_id",ih="$device_model",ic="__alias",id="__timers",ip="$autocapture_disabled_server_side",iv="$heatmaps_enabled_server_side",ig="$exception_capture_enabled_server_side",i_="$error_tracking_suppression_rules",im="$error_tracking_capture_extension_exceptions",iy="$web_vitals_enabled_server_side",ib="$dead_clicks_enabled_server_side",iw="$product_tours_enabled_server_side",ix="$web_vitals_allowed_metrics",ik="$session_recording_remote_config",iE="$replay_sample_rate",iS="$replay_override_sampling",iP="$replay_override_linked_flag",iI="$replay_override_url_trigger",iF="$replay_override_event_trigger",iC="$sesid",iT="$session_is_sampled",i$="$enabled_feature_flags",iR="$active_feature_flags",iO="$early_access_features",iM="$feature_flag_details",iL="$feature_flag_payloads",iA="$feature_flag_request_id",iD="$minimal_flag_called_events",ij="$override_feature_flags",iW="$override_feature_flag_payloads",iN="$stored_person_properties",iH="$stored_group_properties",iq="$groups",iU="$surveys",iB="$surveys_loaded_at",iz="$surveys_activated",iV="$surveys_activated_session",iG="$surveys_activated_timestamps",iK="ph_product_tours",iJ="$flag_call_reported",iY="$flag_call_reported_session_id",iZ="$feature_flag_errors",iX="$feature_flag_evaluated_at",iQ="$user_state",i0="$client_session_props",i1="$capture_rate_limit",i2="$initial_campaign_params",i3="$initial_referrer_info",i5="$initial_person_info",i6="$epp",i4="$posthog_cookieless",i8="$cookieless_mode",i7="$sdk_debug_extensions_init_method",i9="$sdk_debug_extensions_init_time_ms",se="$sdk_debug_recording_script_not_loaded",st="PostHog loadExternalDependency extension not found.",si="on_reject",ss="always",sr="anonymous",sn="identified",sa="identified_only",so="visibilitychange",sl="beforeunload",su="$pageview",sh="$pageleave",sc="$identify",sd="$groupidentify";function sp(e,t){ee(e)&&e.forEach(t)}function sv(e,t){if(!el(e))if(ee(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(var i in e)X.call(e,i)&&t(e[i],i)}var sg=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 sf(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var s_=function(e){try{return e()}catch(e){return}},sm=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){t9.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),t9.critical(e)}}},sy=function(e){var t={};return sv(e,function(e,i){(en(e)&&e.length>0||eu(e))&&(t[i]=e)}),t},sb=["herokuapp.com","vercel.app","netlify.app"];function sw(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 sx(e){return"ph_toolbar_internal"===e.name}var sk=e=>{if(l){try{for(var t=e+"=",i=l.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 eu(e)&&isFinite(e)&&Math.floor(e)===e});class sE{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,s){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(s)||0>e||0>t||0>i||0>s||e>0xffffffffffff||t>4095||i>0x3fffffff||s>0xffffffff)throw RangeError("invalid field value");
2var r=new Uint8Array(16);return r[0]=e/0x10000000000,r[1]=e/0x100000000,r[2]=e/0x1000000,r[3]=e/65536,r[4]=e/256,r[5]=e,r[6]=112|t>>>8,r[7]=t,r[8]=128|i>>>24,r[9]=i>>>16,r[10]=i>>>8,r[11]=i,r[12]=s>>>24,r[13]=s>>>16,r[14]=s>>>8,r[15]=s,new sE(r)}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 sE(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}}class sS{generate(){var e=this.generateOrAbort();if(!er(e))return e;this.Dr=0;var t=this.generateOrAbort();if(er(t))throw Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this.Dr)this.Dr=e,this.Fr();else{if(this.Dr>=e+1e4)return;this.Nr++,this.Nr>0x3ffffffffff&&(this.Dr++,this.Fr())}return sE.fromFieldsV7(this.Dr,Math.trunc(this.Nr/0x40000000),0x3fffffff&this.Nr,this.qr.nextUint32())}Fr(){this.Nr=1024*this.qr.nextUint32()+(1023&this.qr.nextUint32())}constructor(){this.Dr=0,this.Nr=0,this.qr=new s$}}var sP,sI,sF,sC,sT=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};n&&!er(n.crypto)&&crypto.getRandomValues&&(sT=e=>crypto.getRandomValues(e));class s${nextUint32(){return this.yt.length>this.jr||(sT(this.yt),this.jr=0),this.yt[this.jr++]}constructor(){this.yt=new Uint32Array(8),this.jr=1/0}}var sR=()=>sO().toString(),sO=()=>(sC||(sC=new sS)).generate(),sM="",sL=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,sA={Br:()=>!!l,Wr(e){t9.error("cookieStore error: "+e)},Ur:sk,zr(e){var t;try{t=JSON.parse(sA.Ur(e))||{}}catch(e){}return t},Hr(e,t,i,s,r){if(!l)return!1;try{var n="",a="",o=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=l),sM)return sM;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+sR();!sM&&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",sM=n)}return sM}(e);if(!i){var s,r=(s=e.match(sL))?s[0]:"";r!==i&&t9.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(l.location.hostname,s);if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),n="; expires="+u.toUTCString()}r&&(a="; secure");var h=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+o+a;return h.length>3686.4&&t9.warn("cookieStore warning: large cookie, len="+h.length),l.cookie=h,!0}catch(e){return!1}},$r(e,t){if(null!=l&&l.cookie)try{sA.Hr(e,"",-1,t)}catch(e){return}}},sD=null,sj={Br(){if(!eo(sD))return sD;var e=!0;if(er(n))e=!1;else try{var t="__mplssupport__";sj.Hr(t,"xyz"),'"xyz"'!==sj.Ur(t)&&(e=!1),sj.$r(t)}catch(t){e=!1}return e||t9.error("localStorage unsupported; falling back to cookie store"),sD=e,e},Wr(e){t9.error("localStorage error: "+e)},Ur(e){try{return null==n?void 0:n.localStorage.getItem(e)}catch(e){sj.Wr(e)}return null},zr(e){try{return JSON.parse(sj.Ur(e))||{}}catch(e){}return null},Hr(e,t){try{return null==n||n.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sj.Wr(e)}return!1},$r(e){try{null==n||n.localStorage.removeItem(e)}catch(e){sj.Wr(e)}}},sW=[iN,iR,i$,iM,iL,iA,iX,iZ,iJ],sN=[iu,il,iC,iT,i6,i5,iQ],sH=["__proto__","constructor","prototype"],sq=e=>{if(!ei(e))return{};var t={};return Object.keys(e).forEach(i=>{-1===sH.indexOf(i)&&(t[i]=e[i])}),t},sU=function(e,t){void 0===t&&(t=[]);var i={};return[...sN,...t].forEach(t=>{var s=e[t];er(s)||eo(s)||""===s||(i[t]=s)}),i},sB=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:sB(JSON.stringify(e))}),sV=(e,t)=>{if(!t)return{properties:[],isValid:!1};try{var i=sA.zr(e+"_cpm"),s=(null==i?void 0:i.f)===sB(t)&&ee(i.p);return{properties:s?i.p:[],isValid:s}}catch(e){return{properties:[],isValid:!1}}},sG=(e,t)=>
2t+"|"+(sA.Ur(e+"_cpm")||""),sK={},sJ={Br:()=>!0,Wr(e){t9.error("memoryStorage error: "+e)},Ur:e=>sK[e]||null,zr:e=>sK[e]||null,Hr:(e,t)=>(sK[e]=t,!0),$r(e){delete sK[e]}},sY=null,sZ={Br(){if(!eo(sY))return sY;if(sY=!0,er(n))sY=!1;else try{var e="__support__";sZ.Hr(e,"xyz"),'"xyz"'!==sZ.Ur(e)&&(sY=!1),sZ.$r(e)}catch(e){sY=!1}return sY},Wr(e){t9.error("sessionStorage error: ",e)},Ur(e){try{return null==n?void 0:n.sessionStorage.getItem(e)}catch(e){sZ.Wr(e)}return null},zr(e){try{return JSON.parse(sZ.Ur(e))||null}catch(e){}return null},Hr(e,t){try{return null==n||n.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sZ.Wr(e)}return!1},$r(e){try{null==n||n.sessionStorage.removeItem(e)}catch(e){sZ.Wr(e)}}};class sX{constructor(e){this._instance=e}get Wi(){return this._instance.config}get consent(){return this._s()?0:this.ws}isOptedOut(){return this.Wi.cookieless_mode===ss||this.isRejected()||-1===this.consent&&this.Wi.cookieless_mode===si}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Wi.opt_out_capturing_by_default}optInOut(e){this.ks.Hr(this.Ss,+!!e,this.Wi.cookie_expiration,this.Wi.cross_subdomain_cookie,this.Wi.secure_cookie)}reset(){this.ks.$r(this.Ss,this.Wi.cross_subdomain_cookie)}get Ss(){var e=this._instance.config,t=e.token,i=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(i?i+t:"__ph_opt_in_out_"+t)}get ws(){var e=this.ks.Ur(this.Ss);return G(ey,e)?1:G(eb,e)?0:-1}get ks(){var e=this.Wi.opt_out_capturing_persistence_type,t="localStorage"===e?sj:sA;if(!this.xs||this.xs!==t){this.xs=t;var i="localStorage"===e?sA:sj;i.Ur(this.Ss)&&(this.xs.Ur(this.Ss)||this.optInOut(G(ey,i.Ur(this.Ss))),i.$r(this.Ss,this.Wi.cross_subdomain_cookie))}return this.xs}_s(){return!!this.Wi.respect_dnt&&[null==o?void 0:o.doNotTrack,null==o?void 0:o.msDoNotTrack,_.doNotTrack].some(e=>G(ey,e))}}function sQ(e,t){var i,s=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!et(s))return t;try{var r=s(t);return en(r)&&r?r:t}catch(e){return t9.error("Error in get_current_url, falling back to window.location.href",e),t}}var s0="__POSTHOG_TOOLBAR__";function s1(e){return e instanceof Element&&(e.id===s0||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function s2(e){return!!e&&1===e.nodeType}function s3(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function s5(e){return!!e&&3===e.nodeType}function s6(e){return!!e&&11===e.nodeType&&s2(e.host)}function s4(e){return e?K(e).split(/\s+/):[]}function s8(e,t){var i,s,r=er(s=null==n||null==(i=n.location)?void 0:i.href)?void 0:sQ(t,s);return!!(r&&e&&e.some(e=>r.match(e)))}function s7(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 s4(t)}function s9(e){return el(e)?null:K(e).split(/(\s+)/).filter(e=>rx(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function re(e){var t="";return rv(e)&&!rg(e)&&e.childNodes&&e.childNodes.length&&sv(e.childNodes,function(e){var i;s5(e)&&e.textContent&&(t+=null!=(i=s9(e.textContent))?i:"")}),K(t)}function rt(e){var t;return er(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var ri=["a","button","form","input","select","textarea","label"];function rs(e,t){if(er(t))return!0;var i,s=function(e){if(t.some(t=>(function(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}})(e,t)))return{v:!0}};for(var r of e)if(i=s(r))return i.v;return!1}function rr(e){var t=e.parentNode;return!(!t||!s2(t))&&t}var rn=[".ph-no-autocapture","[data-ph-no-autocapture]"],ra=["next","previous","prev",">","<"],ro=[...ra,"+","-","−","–"],rl=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,ru=[".ph-no-rageclick",".ph-no-capture"],rh=["","text","search","email","password","url","tel","number"];function rc(e,t){if(!n||rd(e)||(ec(t)?(s=!!t&&ru,r=void 0,a=!1):(s=null!=(o=null==t?void 0:t.css_selector_ignorelist)?o:ru,r=null==t?void 0:t.content_ignorelist,a=null!=(l=null==t?void 0:t.ignore_text_selection)&&l),!1===s)||a&&!(!(i=e)||!s2(i))&&(s3(i,"textarea")||(s3(i,"input")?G(rh,(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,a,o,l,u=rp(e,!1).targetElementList;return!function(e,t){var i;if(!1===e||er(e))return!1;if(!0===e)i=ra;else{if(!ee(e))return!1;if(e.length>10)return t9.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=>rl(t,e)||rl(s,e))})}(r,u.map(e=>{var t;return{safeText:re(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!rs(u,s)}var rd=e=>!e||s3(e,"html")||!s2(e),rp=(e,t)=>{if(!n||rd(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,s=[e],r=e;r.parentNode&&!s3(r,"body");)if(s6(r.parentNode))s.push(r.parentNode.host),r=r.parentNode.host;else{var a=rr(r);if(!a)break;if(t||ri.indexOf(a.tagName.toLowerCase())>-1)i=!0;else try{var o=n.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}catch(e){}s.push(a),r=a}return{parentIsUsefulElement:i,targetElementList:s}};function rv(e){for(var t=new Set,i=0,s=e;s.parentNode&&!s3(s,"body");s=s.parentNode){if(i++>=1e3||t.has(s))return!1;t.add(s);var r=s7(s);if(G(r,"ph-sensitive")||G(r,"ph-no-capture"))return!1}if(G(s7(e),"ph-include"))return!0;var n=e.type||"";if(en(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}
2var a=e.name||e.id||"";return!en(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 rg(e){return!!(s3(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||s3(e,"select")||s3(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var rf=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}))$"),r_=/(^|[^0-9A-Za-z_])([0-9][0-9 -]*[0-9])(?=$|[^0-9A-Za-z_])/g,rm=[16,15,14,13],ry=RegExp("^(\\d{3}-?\\d{2}-?\\d{4})$"),rb=RegExp("(^|[^0-9])((?!000|666)[0-9]{3}-?(?!00)[0-9]{2}-?(?!0000)[0-9]{4})(?=$|([^0-9]))","g"),rw=/[0-9A-Za-z_]/;function rx(e,t){return void 0===t&&(t=!0),!(el(e)||en(e)&&(e=K(e),(t?rf.test((e||"").replace(/[- ]/g,"")):function(e){var t;for(r_.lastIndex=0;t=r_.exec(e);){var i=t[2];if(i)for(var s=i.replace(/[- ]/g,""),r=0;s.length>r;r++)for(var n of rm){var a=r+n;if(s.length>=a){var o=s.slice(r,a);if(rf.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?ry.test(e):function(e){var t;for(rb.lastIndex=0;t=rb.exec(e);){var i=t[1],s=t[3];if(!(i&&s&&rw.test(i)&&rw.test(s)))return!0}return!1}(e))))&&!0}function rk(e){var t=re(e);return rx(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&sv(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=re(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){t9.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function rE(e){return e.replace(/"|\\"/g,'\\"')}var rS=ie("[Dead Clicks]"),rP=()=>!0,rI=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(ib)),s=e.instance.config.capture_dead_clicks;return ec(s)?s:!!ei(s)||i};class rF{get lazyLoadedDeadClicksAutocapture(){return this.Cs}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({[ib]:t.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.Ts(()=>{this.Ms()}):this.stop()}Ts(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?rS.error("failed to load script",t):e()})}Ms(){var e;if(l){if(!this.Cs&&null!=(e=_.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=ei(this.instance.config.capture_dead_clicks)?w({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.Cs=_.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Cs.start(l),rS.info("starting...")}}else rS.error("`document` not found. Cannot start.")}stop(){this.Cs&&(this.Cs.stop(),this.Cs=void 0,rS.info("stopping..."))}}var rC=ie("[SegmentIntegration]"),rT="posthog-js";function r$(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,u=void 0===l||l;return t=>{if("*"!==o&&!o.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var i=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=i,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var a,l,h,c,d,p,v=(null==(a=t.exception)?void 0:a.values)||[],g=v.map(e=>w({},e,{stacktrace:e.stacktrace?w({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>w({},e,{platform:"web:javascript"}))}):void 0})),f={$exception_message:(null==(l=v[0])?void 0:l.value)||t.message,$exception_type:null==(h=v[0])?void 0:h.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(c=v[0])?void 0:c.value)||t.message,$sentry_exception_type:null==(d=v[0])?void 0:d.type,$sentry_tags:t.tags};return s&&r&&(f.$sentry_url=(n||"https://sentry.io/organizations/")+s+"/issues/?project="+r+"&query="+t.event_id),u&&(null==(p=e.exceptions)||p.sendExceptionEvent(f)),t}}class rR{constructor(e,t,i,s,r,n){this.name=rT,this.setupOnce=function(a){a(r$(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}class rO{constructor(e){this.Es=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(t9.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Is=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Rs()}Rs(){var e;this.Ps=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Es)}destroy(){var e;null==(e=this.Ps)||e.call(this),this.Ps=void 0}doPageView(e,t){var i,s=this.As(e,t);return this.Is={pathname:null!=(i=null==n?void 0:n.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.As(e,null==(t=this.Is)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Is)?void 0:e.pageViewId}}As(e,t){var i=this.Is;
2if(!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(!(er(n)||er(a)||er(o)||er(l)||er(u)||er(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?ew(a/n,0,1,t9):1,d=n>1?ew(o/n,0,1,t9):1,p=l>1?ew(u/l,0,1,t9):1,v=l>1?ew(h/l,0,1,t9):1;s=sg(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}}var rM=["flags","surveys"],rL={[io]:{exposure:"hidden"},[ic]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[id]:{exposure:"hidden"},[ip]:{exposure:"event"},[iv]:{exposure:"hidden"},[ig]:{exposure:"event"},[i_]:{exposure:"hidden"},[im]:{exposure:"event"},[iy]:{exposure:"event"},[ib]:{exposure:"event"},[iw]:{exposure:"hidden"},[ix]:{exposure:"event"},[ik]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[iC]:{exposure:"hidden"},[iT]:{exposure:"event"},[iE]:{exposure:"event",shouldSkipFromEventProperties:e=>eo(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"},[i$]:{exposure:"hidden",storageGroup:"flags"},[iR]:{exposure:"hidden",storageGroup:"flags"},[iO]:{exposure:"hidden"},[iM]:{exposure:"hidden",storageGroup:"flags"},[iL]:{exposure:"hidden",storageGroup:"flags"},[iA]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iD]:{exposure:"hidden",storageGroup:"flags"},[ij]:{exposure:"hidden"},[iW]:{exposure:"hidden"},[iN]:{exposure:"hidden"},[iH]:{exposure:"hidden"},[iU]:{exposure:"hidden",storageGroup:"surveys"},[iB]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[iz]:{exposure:"event"},[iV]:{exposure:"hidden"},[iG]:{exposure:"hidden"},[iK]:{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"},[iJ]:{exposure:"hidden"},[iY]:{exposure:"hidden"},[iq]:{exposure:"event"},[iZ]:{exposure:"hidden"},[iX]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iQ]:{exposure:"hidden"},[i0]:{exposure:"hidden"},[i1]:{exposure:"hidden"},[i2]:{exposure:"hidden"},[i3]:{exposure:"hidden"},[i5]:{exposure:"hidden"},[i6]:{exposure:"hidden"},[iS]:{exposure:"event"},[iP]:{exposure:"event"},[iI]:{exposure:"event"},[iF]:{exposure:"event"},[i7]:{exposure:"event"},[i9]:{exposure:"event"},[se]:{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"}},rA=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],rD=e=>{var t=rL[e];if(t)return t;for(var i of rA){var s=i[1];if(0===e.indexOf(i[0]))return s}},rj=(e,t)=>{try{return JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t)}catch(t){return Y(e)}},rW=e=>{var t=null==l?void 0:l.createElement("a");return er(t)?null:(t.href=e,t)},rN=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(!ee(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(e){t9.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},rH=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("=");ee(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},rq=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},rU=(e,t)=>e>=t&&g(),rB=(e,t,i,s)=>{if(0===e){if(g()){var r=t+1;return r===i&&s(),r}return t}return 0},rz="https?://(.*)",rV=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],rG=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...rV],rK="<masked>",rJ=["li_fat_id"];function rY(e,t,i){if(!l)return{};var s,r=t?[...rV,...i||[]]:[],n=rZ(rH(l.URL,r,rK),e);return sg((s={},sv(rJ,function(e){var t=sk(e);s[e]=t||null}),s),n)}function rZ(e,t){var i=rG.concat(t||[]),s={};return sv(i,function(t){var i=rN(e,t);s[t]=i||null}),s}function rX(e){var t=e?0===e.search(rz+"google.([^/?]*)")?"google":0===e.search(rz+"bing.com")?"bing":0===e.search(rz+"yahoo.com")?"yahoo":0===e.search(rz+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!eo(t)){i.$search_engine=t;var s=l?rN(l.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function rQ(){return navigator.language||navigator.userLanguage}var r0="$direct";function r1(){return(null==l?void 0:l.referrer)||r0}function r2(e,t,i){void 0===i&&(i=!1);var s=e?[...rV,...t||[]]:[],r=i?tm(null==u?void 0:u.href):null==u?void 0:u.href,n=null==r?void 0:r.substring(0,1e3);return{r:r1().substring(0,1e3),u:n?rH(n,s,rK):void 0}}function r3(e,t){void 0===t&&(t=!1);var i,s=e.r,r=e.u,n=t?tm(r):r,a={$referrer:s,$referring_domain:null==s?void 0:s==r0?r0:null==(i=rW(s))?void 0:i.host};
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,sg(a,rZ(n))}return s&&sg(a,rX(s)),a}function r5(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var r6={flags:iX,surveys:iB},r4=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],r8="main",r7=(e,t)=>{sv(e,(i,s)=>{var r=rD(s);r&&"event"!==r.exposure||({}).hasOwnProperty.call(t,s)||delete e[s]})};class r9{constructor(e,t,i){if(void 0===i&&(i=!0),this.Fs={},this.Os=!1,this.Ls=!1,this.Ds=!1,this.$s=!1,this.Wi=e,this.Ns=i,this.props={},this.qs=void 0,this.js=(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.ks=this.Bs(e),this.Ls=this.Hs(e),this.load(),e.debug&&t9.info("Persistence loaded",e.persistence,w({},this.props)),this.update_config(e,e,t),this.save(),n){var s=()=>this.flush();sw(n,"beforeunload",s,{capture:!1}),sw(n,"pagehide",s,{capture:!1})}}Us(){var e,t=null==(e=this.Wi)?void 0:e.persistence_save_debounce_ms;return eu(t)&&t>0?t:0}zs(e){if(this.Wi.cookieWinsOnConflict&&"localstorage+cookie"===this.Wi.persistence.toLowerCase())if(e)try{var t=sU(e,this.Wi.cookie_persisted_properties||[]),i=sz(t,this.Wi.cookie_persisted_properties||[]),s=JSON.stringify(t)+"|"+JSON.stringify(i),r=sA.Ur(this.js)||void 0;r&&sG(this.js,r)===s&&(this.Ws=s,this.Vs=r)}catch(e){}else try{var n=sA.Ur(this.js)||void 0;this.Ws=n?sG(this.js,n):void 0,this.Vs=n}catch(e){}}syncCookieProperties(){return this.Gs(this.Wi)}Gs(e,t){if(void 0===t&&(t=!1),this.Zs&&!t||this.$s||!e.cookieWinsOnConflict||"localstorage+cookie"!==e.persistence.toLowerCase())return!1;try{i=sA.Ur(this.js)||void 0}catch(e){}if(!i||i===this.Vs)return!1;var i,s,r=sG(this.js,i);try{s=sq(JSON.parse(i))}catch(e){return!1}if((sA.Ur(this.js)||void 0)!==i)return!1;this.Ws=r,this.Vs=i;var n=sV(this.js,i),a=[...sN,...n.properties],o={};if(Object.keys(s).forEach(e=>{var t=s[e];(er(t)||eo(t)||""===t||e===iQ&&t!==sr&&t!==sn)&&(o[e]=!0,delete s[e])}),es(s))return!1;var l=il in s||s[iQ]===sr||s[iQ]===sn,u=this.props[il],h=this.props[iQ],c=sg({},this.props);[...sN,...e.cookie_persisted_properties||[]].forEach(e=>{if(-1!==a.indexOf(e)&&!(e in s)&&!o[e]&&(l||e!==il&&e!==iQ)){var t=c[e];(n.isValid||-1===sN.indexOf(e)||!1!==t&&0!==t)&&delete c[e]}}),this.props=sg(c,s),!l||iQ in s||iQ in this.props||this.Qs(iQ,sr);var d=this.props[il],p=this.props[iQ];return l&&(d!==u||p!==h)&&(this.Ds=!0,sZ.Hr(this.js+"_cookie_identity_change_pending",!0),this.Js(iN),this.Js(iR),this.Js(i$),this.Js(iM),this.Js(iL),this.Js(iA),this.Js(iX),this.Js(iZ),this.Js(iJ),p!==sr||h!==sn&&s[iQ]!==sr&&(er(u)||d===u)||(r7(this.props,s),this.Js(iH)),p===sn?this.props.$user_id=d:delete this.props.$user_id,this.Js(ic)),!0}
2consumeCookieIdentityChange(){var e=this.js+"_cookie_identity_change_pending",t=this.Ds||!!sZ.Ur(e);return this.Ds=!1,t&&sZ.$r(e),t}Ks(e){return void 0===e&&(e=!1),!(this.$s||this.Zs&&!e||!this.Wi.cookieWinsOnConflict||"localstorage+cookie"!==this.Wi.persistence.toLowerCase()||(this.$s=!0,0))}Ys(){this.$s&&(er(this.Xs)||(clearTimeout(this.Xs),this.Xs=void 0),delete this.Fs[r8],this.ta(!0))}ea(e){if(void 0===e&&(e=!0),this.$s)try{e?this.Ys():er(this.Xs)||(clearTimeout(this.Xs),this.Xs=void 0)}finally{this.$s=!1}}isDisabled(){return!!this.Zs}Bs(e){-1===r4.indexOf(e.persistence.toLowerCase())&&(t9.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i,s,r,a=(t=e.cookie_persisted_properties||[],i=e.cookieWinsOnConflict,void 0===t&&(t=[]),void 0===i&&(i=!1),s=[...sN,...t],w({},sj,{zr(e){try{var t,r={};try{r=(t=sA.Ur(e)||void 0)?sq(JSON.parse(t)):{}}catch(e){}var n,a=JSON.parse(sj.Ur(e)||"{}");if(i){var o=sV(e,t),l=[...sN,...o.properties],u={};Object.keys(r).forEach(e=>{var t=r[e];eo(t)||""===t||e===iQ&&t!==sr&&t!==sn||(u[e]=t)});var h=il in u||u[iQ]===sr||u[iQ]===sn;if(Object.keys(u).length>0){var c,d=a[il],p=null!=(c=a[iQ])?c:sr;s.forEach(e=>{if(-1!==l.indexOf(e)&&!(e in r)&&(h||e!==il&&e!==iQ)){var t=a[e];(o.isValid||-1===sN.indexOf(e)||!1!==t&&0!==t)&&delete a[e]}}),!h||iQ in r||iQ in a||(a[iQ]=sr),h&&((il in u?u[il]:a[il])!==d||(iQ in u?u[iQ]:a[iQ])!==p)&&(sW.forEach(e=>delete a[e]),u[iQ]===sn&&il in u?a.$user_id=u[il]:delete a.$user_id,u[iQ]!==sn&&(delete a[iq],delete a[iH]),delete a.__alias)}n=sg(a,u)}else n=sg(r,a);return sj.Hr(e,n),n}catch(e){}return null},Hr(e,s,r,n,a,o){var l=sj.Hr(e,s,void 0,void 0,o);try{var u=sU(s,t);if(Object.keys(u).length){if(i){var h=e+"_cpm",c=sz(u,t);if(sA.Hr(h,c,r,n,a,o),sA.Ur(h)!==JSON.stringify(c)){sA.$r(h,n);var d=sU(s);return sA.Hr(e,d,r,n,a,o),l}}sA.Hr(e,u,r,n,a,o)}}catch(e){sj.Wr(e)}return l},$r(e,t){try{null==n||n.localStorage.removeItem(e),sA.$r(e,t),sA.$r(e+"_cpm",t)}catch(e){sj.Wr(e)}}})),o=!1,l=e.persistence.toLowerCase();return"localstorage"===l&&sj.Br()?(r=sj,o=!0):"localstorage+cookie"===l&&a.Br()?(r=a,o=!0):"sessionstorage"===l&&sZ.Br()?r=sZ:"memory"===l?r=sJ:"cookie"===l?r=sA:a.Br()?(r=a,o=!0):r=sA,this.Os=o,r}ia(e){return this.js+"__"+e}Hs(e){return this.Os&&!!e.split_storage}properties(){var e={};return sv(this.props,(t,i)=>{var s=rD(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.Zs||e){var t=this.Wi.cookieWinsOnConflict&&"localstorage+cookie"===this.Wi.persistence.toLowerCase(),i=t?sj.zr(this.js):null,s={};if(t)try{sv(s=sq(sA.zr(this.js)),(e,t)=>{(er(e)||eo(e)||""===e)&&delete s[t]})}catch(e){}var r=this.ks.zr(this.js);if(r&&(this.props=sg({},r)),this.Ls&&this.ra(),t&&r){var n,a,o=null==i?void 0:i[il],l=null!=(n=null==i?void 0:i[iQ])?n:sr,u=r[il],h=null!=(a=r[iQ])?a:sr;if(u!==o||h!==l){this.Ds=!0,sZ.Hr(this.js+"_cookie_identity_change_pending",!0);var c=sg({},this.props);sW.forEach(e=>delete c[e]),h!==sr||l!==sn&&s[iQ]!==sr&&(er(o)||u===o)||(r7(c,s),delete c[iH]),this.props=c;var d=new Set;sW.forEach(e=>{var t,i=null==(t=rD(e))?void 0:t.storageGroup;i&&d.add(i)}),d.forEach(e=>{var t={};sv(this.props,(i,s)=>{var r;(null==(r=rD(s))?void 0:r.storageGroup)===e&&(t[s]=i)}),es(t)?(sj.$r(this.ia(e)),this.Fs[e]={}):sj.Hr(this.ia(e),t)&&(this.Fs[e]={persisted:!0,fingerprint:this.na(t,e)})})}}sZ.Ur(this.js+"_cookie_identity_change_pending")&&(this.Ds=!0)}}ra(){for(var e of rM){var t=sj.zr(this.ia(e));if(t&&!es(t)){var i=this.sa(e);i.persisted=!0,this.aa(e)||(i.fingerprint=this.na(t,e)),this.oa(e,t)||sg(this.props,t)}}}aa(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=rD(t))?void 0:i.storageGroup)===e})}oa(e,t){var i=r6[e];if(!i)return!1;var s=t[i],r=this.props[i];return eu(s)&&eu(r)&&r>s}refreshKey(e){var t;if(!this.Zs){var i=this.Ls?null==(t=rD(e))?void 0:t.storageGroup:void 0,s=i?sj.zr(this.ia(i)):this.ks.zr(this.js);if(s&&e in s)this.Qs(e,s[e]);else{if(i){var r=this.ks.zr(this.js);if(r&&e in r)return void this.Qs(e,r[e])}this.Js(e)}}}save(){if(!this.Zs){var e=this.Us();e>0?er(this.Xs)&&(this.Xs=setTimeout(()=>{this.Xs=void 0,this.ta()},e)):this.ta()}}flush(){er(this.Xs)||(clearTimeout(this.Xs),this.Xs=void 0,this.ta())}ta(e){void 0===e&&(e=!1),this.Zs||this.$s&&!e||(e||this.syncCookieProperties(),this.Ls?this.la():this.ua(this.ks,this.js,this.props,r8)&&this.zs(this.props))}la(){var e=this.ha(),t=e.main,i=e.groups;for(var s of(this.ua(this.ks,this.js,t,r8)&&this.zs(t),rM)){var r,n=i[s];(!es(n)||null!=(r=this.Fs[s])&&r.persisted)&&this.ua(sj,this.ia(s),n,s)}}ha(){var e={},t={flags:{},surveys:{}};return sv(this.props,(i,s)=>{var r,n=null==(r=rD(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i}),{main:e,groups:t}}na(e,t){if(t===r8)return JSON.stringify(e)+"|"+this.da+"|"+this.va+"|"+this.ca;var i={};return sv(e,(e,t)=>{var s;i[t]=null!=(s=rD(t))&&s.volatile?"__volatile__":e}),JSON.stringify(i)}ua(e,t,i,s){var r,n=this.sa(s);if(s!==r8&&!n.dirty&&!er(n.fingerprint))return!1;try{if((r=this.na(i,s))===n.fingerprint)return n.dirty=!1,!1}catch(e){r=void 0}return e.Hr(t,i,this.da,this.va,this.ca,this.Wi.debug)?(n.dirty=!1,s!==r8&&(n.persisted=!0),er(r)||(n.fingerprint=r),!0):(this.Wi.debug&&t9.warn('failed to persist storage entry "'+t+'"; will retry on next save'),!1)}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,i=void 0!==t&&t;
2if(er(this.Xs)||(clearTimeout(this.Xs),this.Xs=void 0),this.ks.$r(this.js,!1),this.ks.$r(this.js,!0),!i&&this.Ns)for(var s of rM)sj.$r(this.ia(s));i?delete this.Fs[r8]:this.Fs={},this.Ws=void 0,this.Vs=void 0}clear(){this.remove(),this.props={}}register_once(e,t,i){if(ei(e)){this.syncCookieProperties(),er(t)&&(t="None"),this.da=er(i)?this.fa:i;var s=!1;if(sv(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.Qs(i,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(ei(e)){this.syncCookieProperties(),this.da=er(t)?this.fa:t;var i=!1;if(sv(e,(t,s)=>{e.hasOwnProperty(s)&&(this.props[s]!==t||ei(t)||ee(t))&&(this.Qs(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.Js(i),t=!0);t&&this.save()}update_campaign_params(){var e=null==l?void 0:l.URL;if(e!==this.qs){var t=rY(this.Wi.custom_campaign_params,this.Wi.mask_personal_data_properties,this.Wi.custom_personal_data_properties);es(sy(t))||this.register(t),this.qs=e}}update_search_keyword(){var e;this.register((e=null==l?void 0:l.referrer)?rX(e):{})}update_referrer_info(){var e;this.register_once({$referrer:r1(),$referring_domain:null!=l&&l.referrer&&(null==(e=rW(l.referrer))?void 0:e.host)||r0},void 0)}set_initial_person_info(){this.props[i2]||this.props[i3]||this.register_once({[i5]:r2(this.Wi.mask_personal_data_properties,this.Wi.custom_personal_data_properties,this.Wi.disable_capture_url_hashes)},void 0)}get_initial_props(){var e,t,i,s={};sv([i3,i2],e=>{var t=this.props[e];t&&sv(t,function(e,t){s["$initial_"+J(t)]=e})});var r=this.props[i5];return r&&sg(s,(void 0===(e=this.Wi.disable_capture_url_hashes)&&(e=!1),t=r3(r,e),i={},sv(t,function(e,t){i["$initial_"+J(t)]=e}),i)),s}safe_merge(e){return sv(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.Zs&&!o;o||this.Gs(t,l),this.Wi=e,!o&&(s||r||a)&&(this.Ws=void 0,this.Vs=void 0,this.Gs(w({},e,{cookie_persisted_properties:t.cookie_persisted_properties}),l));var u=n||a?this.Bs(e):this.ks,h=this.Hs(e),c=n||h!==this.Ls,d=!o&&(c||e.cross_subdomain_cookie!==this.va||e.secure_cookie!==this.ca)&&this.Ks(l);try{if(this.fa=this.da=e.cookie_expiration,this.set_disabled(o),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),c){var p=this.props;this.clear(),this.ks=u,this.Ls=h,this.props=p,this.save()}else a&&(this.ks=u,o||(delete this.Fs[r8],this.ta()))}finally{d&&this.ea()}}set_disabled(e){this.Zs=e,this.Zs?this.remove():this.save()}set_cross_subdomain(e){e!==this.va&&(this.va=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.ca&&(this.ca=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[id]||{};i[e]=t,this.Qs(id,i),this.save()}remove_event_timer(e){var t=this.props[id]||{},i=t[e];return er(i)||(delete t[e],this.Qs(id,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.Qs(e,t),this.save()}Qs(e,t){var i;this.props[e]=t,null!=(i=rD(e))&&i.volatile||this.pa(e)}Js(e){delete this.props[e],this.pa(e)}pa(e){var t,i=null==(t=rD(e))?void 0:t.storageGroup;i&&(this.sa(i).dirty=!0)}sa(e){return this.Fs[e]||(this.Fs[e]={})}}function ne(e){var t=!0;return{dispose(){if(t){t=!1;var i=e();i&&et(i.then)&&i.then(void 0,()=>{})}}}}var nt="gzip-js",ni="base64",ns="events",nr="cancelEvents",nn="survey shown",na="survey dismissed",no="survey sent",nl="popover",nu=ie("[RateLimiter]");class nh{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=>{nu.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void nu.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(i1))?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=(eu(o.dropped)?o.dropped:0)+1;o.dropped=u,!this.lastEventRateLimited&&this.ga(u)&&(o.dropped=0)}return this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(i1,o),{isRateLimited:l,remainingTokens:o.tokens}}ma(e){var t=this.instance.config.property_denylist;return!ee(t)||!t.includes(e)}ya(){var e;if(this.ma("$current_url")&&this.ma("$pathname")&&null!=u&&u.pathname)return""+(null!=(e=u.origin)?e:"")+u.pathname}ga(e){var t,i,s=this.captureEventsBurstLimit,r=this.captureEventsPerSecond,n=this.ya(),a=this.ma("$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(
vendor: 5,814 bytes, line 2
2Boolean).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}}var nc=ie("[RemoteConfig]");class nd{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=_._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}ba(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}_a(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 nc.info("Using preloaded remote config",this.remoteConfig),void this.wa(this.remoteConfig);if(this._instance.ka())return void nc.warn("Remote config is disabled. Falling back to local config.");this.ba(e=>{e?this.wa(e):(nc.info("No config found after loading remote JS config. Falling back to JSON."),this._a(e=>{this.wa(e.json,e)}))})}catch(e){nc.error("Error loading remote config",e),this.wa()}}wa(e,t){!e&&t&&(0===t.statusCode?t.error||nc.warn("Failed to fetch remote config from PostHog."):nc.error("Failed to fetch remote config from PostHog."));try{this._instance.wa(e?{ok:!0,config:e}:{ok:!1})}catch(e){nc.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){nc.error("Error loading feature flags",e)}}}var np=Uint8Array,nv=Uint16Array,ng=Uint32Array,nf=new np([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]),n_=new np([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]),nm=new np([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ny=function(e,t){for(var i=new nv(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new ng(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]},nb=ny(nf,2),nw=nb[1];nb[0][28]=258,nw[258]=28;for(var nx=ny(n_,0)[1],nk=new nv(32768),nE=0;32768>nE;++nE){var nS=(43690&nE)>>>1|(21845&nE)<<1;nk[nE]=((65280&(nS=(61680&(nS=(52428&nS)>>>2|(13107&nS)<<2))>>>4|(3855&nS)<<4))>>>8|(255&nS)<<8)>>>1}var nP=function(e,t,i){for(var s=e.length,r=0,n=new nv(t);s>r;++r)++n[e[r]-1];var a,o=new nv(t);for(r=0;t>r;++r)o[r]=o[r-1]+n[r-1]<<1;if(i){a=new nv(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[nk[c]>>>l]=u}else for(a=new nv(s),r=0;s>r;++r)a[r]=nk[o[e[r]-1]++]>>>15-e[r];return a},nI=new np(288);for(nE=0;144>nE;++nE)nI[nE]=8;for(nE=144;256>nE;++nE)nI[nE]=9;for(nE=256;280>nE;++nE)nI[nE]=7;for(nE=280;288>nE;++nE)nI[nE]=8;var nF=new np(32);for(nE=0;32>nE;++nE)nF[nE]=5;var nC=nP(nI,9,0),nT=nP(nF,5,0),n$=function(e){return(e/8|0)+(7&e&&1)},nR=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof nv?nv:e instanceof ng?ng:np)(i-t);return s.set(e.subarray(t,i)),s},nO=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},nM=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},nL=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 np(0),0];if(1==r){var a=new np(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 nv(d+1),v=nA(i[h-1],p,0);if(v>t){s=0;var g=0,f=v-t,_=1<<f;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;g+=_-(1<<v-p[m]),p[m]=t}for(g>>>=f;g>0;){var y=n[s].s;t>p[y]?g-=1<<t-p[y]++-1:++s}for(;s>=0&&g;--s){var b=n[s].s;p[b]==t&&(--p[b],++g)}v=t}return[new np(p),v]},nA=function(e,t,i){return -1==e.s?Math.max(nA(e.l,t,i+1),nA(e.r,t,i+1)):t[e.s]=i},nD=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new nv(++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]},nj=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},nW=function(e,t,i){var s=i.length,r=n$(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)},nN=function(e,t,i,s,r,n,a,o,l,u,h){nO(t,h++,i),++r[256];for(var c=nL(r,15),d=c[0],p=c[1],v=nL(n,15),g=v[0],f=v[1],_=nD(d),m=_[0],y=_[1],b=nD(g),w=b[0],x=b[1],k=new nv(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=nL(k,7),P=S[0],I=S[1],F=19;F>4&&!P[nm[F-1]];--F);var C,T,$,R,O=u+5<<3,M=nj(r,nI)+nj(n,nF)+a,L=nj(r,d)+nj(n,g)+a+14+3*F+nj(k,P)+(2*k[16]+3*k[17]+7*k[18]);if(M>=O&&L>=O)return nW(t,h,e.subarray(l,l+u));if(nO(t,h,1+(M>L)),h+=2,M>L){C=nP(d,p,0),T=d,$=nP(g,f,0),R=g;var A=nP(P,I,0);for(nO(t,h,y-257),nO(t,h+5,x-1),nO(t,h+10,F-4),h+=14,E=0;F>E;++E)nO(t,h+3*E,P[nm[E]]);h+=3*F;for(var D=[m,w],j=0;2>j;++j){var W=D[j];for(E=0;W.length>E;++E)nO(t,h,A[N=31&W[E]]),h+=P[N],N>15&&(nO(t,h,W[E]>>>5&127),h+=W[E]>>>12)}}else C=nC,T=nI,$=nT,R=nF;for(E=0;o>E;++E)if(s[E]>255){nM(t,h,C[257+(N=s[E]>>>18&31)]),h+=T[N+257],N>7&&(nO(t,h,s[E]>>>23&31),h+=nf[N]);var N,H=31&s[E];nM(t,h,$[H]),h+=R[H],H>
23&&(nM(t,h,s[E]>>>5&8191),h+=n_[H])}else nM(t,h,C[s[E]]),h+=T[s[E]];return nM(t,h,C[256]),h+T[256]},nH=new ng([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nq=function(){for(var e=new ng(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),nU=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},nB=!!c||!!h,nz="text/plain",nV=!1,nG=(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:"")},nK=function(e,t,i){void 0===i&&(i=!0);var s,r,n,a,o,l=e.split("?"),u=l[0],h=l[1],c=w({},t),d=null!=(o=null==h?void 0:h.split("&").map(e=>{var t,s=e.split("="),r=s[0],n=i&&null!=(t=c[r])?t:s[1];return delete c[r],r+"="+n}))?o:[],p=(void 0===s&&(s="&"),a=[],sv(c,function(e,t){er(e)||er(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),a[a.length]=n+"="+r)}),a.join(s));return p&&d.push(p),d.length>0?u+"?"+d.join("&"):u},nJ=e=>{if(e.Sa)return e.Sa;var t=e.data,i=e.compression;if(t){if(i===nt){var s,r,n,a,o,l,u,h,c=(s=function(e){var t=e.length;if("u">typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new np(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 np(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 nR(i,0,s)}(rj(t)),r={mtime:0},n=0xffffffff,a={p(e){for(var t=n,i=0;e.length>i;++i)t=nq[255&t^e[i]]^t>>>8;n=t},d:()=>0xffffffff^n},o=s.length,a.p(s),h=(l=10+(r.filename&&r.filename.length+1||0),u=function(e,t,i,s){var r=e.length,n=new np(s+r+5*(1+Math.floor(r/7e3))+8),a=n.subarray(s,n.length-8),o=0;if(!t||8>r)for(var l=0;r>=l;l+=65535){var u=l+65535;r>u?o=nW(a,o,e.subarray(l,u)):(a[l]=!0,o=nW(a,o,e.subarray(l,r)))}else{for(var h=nH[t-1],c=h>>>13,d=8191&h,p=(1<<i)-1,v=new nv(32768),g=new nv(p+1),f=Math.ceil(i/3),_=2*f,m=function(t){return(e[t]^e[t+1]<<f^e[t+2]<<_)&p},y=new ng(25e3),b=new nv(288),w=new nv(32),x=0,k=0,E=(l=0,0),S=0,P=0;r>l;++l){var I=m(l),F=32767&l,C=g[I];if(v[F]=C,g[I]=F,l>=S){var T=r-l;if((x>7e3||E>24576)&&T>423){o=nN(e,a,0,y,b,w,k,E,P,l-P,o),E=x=k=0,P=l;for(var $=0;286>$;++$)b[$]=0;for($=0;30>$;++$)w[$]=0}var R=2,O=0,M=d,L=F-C&32767;if(T>2&&I==m(l-L))for(var A=Math.min(c,T)-1,D=Math.min(32767,l),j=Math.min(258,T);D>=L&&--M&&F!=C;){if(e[l+R]==e[l+R-L]){for(var W=0;j>W&&e[l+W]==e[l+W-L];++W);if(W>R){if(R=W,O=L,W>A)break;var N=Math.min(L,W-2),H=0;for($=0;N>$;++$){var q=l-L+$+32768&32767,U=q-v[q]+32768&32767;U>H&&(H=U,C=q)}}}L+=(F=C)-(C=v[F])+32768&32767}if(O){y[E++]=0x10000000|nw[R]<<18|nx[O];var B=31&nw[R],z=31&nx[O];k+=nf[B]+n_[z],++b[257+B],++w[z],S=l+R,++x}else y[E++]=e[l],++b[e[l]]}}o=nN(e,a,!0,y,b,w,k,E,P,l-P,o)}return nR(n,0,s+n$(o)+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)).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&&nU(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)}}(u,r),nU(u,h-8,a.d()),nU(u,h-4,o),u);return{contentType:nz,body:c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength),estimatedSize:c.byteLength}}if(i===ni){let e;var d,p="data="+encodeURIComponent("string"==typeof(e=(d=rj(t))?btoa(encodeURIComponent(d).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):d)?e:rj(e));return{contentType:"application/x-www-form-urlencoded",body:p,estimatedSize:new Blob([p]).size}}var v=rj(t);return{contentType:"application/json",body:v,estimatedSize:new Blob([v]).size}}},nY=e=>{var t,i,s=()=>"sendBeacon"===e.transport?{url:nK(e.url,{compression:ni}),encodedBody:nJ(w({},e,{compression:ni,Sa:void 0}))}:{url:nG(e.url,"compression"),encodedBody:nJ(w({},e,{compression:void 0,Sa:void 0}))};try{t=nJ(e)}catch(t){if(D(e.compression,rN(e.url,"compression")))return t9.error("Failed to gzip request body, sending uncompressed payload",t),s();throw t}return!(t&&D(e.compression,rN(e.url,"compression")))||((i=t.body)instanceof ArrayBuffer?A(new Uint8Array(i)):ArrayBuffer.isView(i)&&A(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?{url:e.url,encodedBody:t}:(nV=!0,s())},nZ=e=>{try{return nY(e)}catch(t){return t9.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},nX=(t=b(function*(e){var t=rj(e.data),i=yield function(e,t,i){return H.apply(this,arguments)}(t,m.DEBUG,{rethrow:!0});if(!i)return e;var s=yield i.arrayBuffer();return w({},e,{Sa:{contentType:nz,body:s,estimatedSize:s.byteLength}})}),function(e){return t.apply(this,arguments)}),nQ=/Failed to fetch|NetworkError|Load failed/i,n0=e=>"TypeError"===(null==e?void 0:e.name)&&nQ.test((null==e?void 0:e.message)||""),n1=e=>{var t=nZ(e);if(t){var i,s=t.url,r=t.encodedBody,n=null!=r?r:{},a=n.contentType,o=n.body,l=n.estimatedSize,u=new Headers;sv(e.headers,function(e,t){u.append(t,e)}),a&&u.append("Content-Type",a);var c=null,p=!1;if(d){var v=new d;c={signal:v.signal,timeout:setTimeout(()=>{var t,i;p=!0,v.abort(((i=Error("PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":""))).name="AbortError",i))},e.timeout)}}var g=t=>{p&&"AbortError"===(null==t?void 0:t.name)||n0(t)?t9.warn(t):t9.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{h(s,w({method:(null==e?void 0:e.method)||"GET",headers:u,keepalive:"POST"===e.method&&!e.xa&&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){t9.error(e)}null==e.callback||e.callback(s)})).catch(g).finally(()=>c?clearTimeout(c.timeout):null)}catch(e){c&&clearTimeout(c.timeout),g(e)}}},n2=e=>{try{var t,i=nY(e),s=i.url,r=i.encodedBody,n=null!=r?r:{},a=n.body,l=n.estimatedSize;if(!a)return;var u=a instanceof Blob?a:new Blob([a],{type:n.contentType});if(o.sendBeacon(s,u))return;var h=ee(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(ee(h)&&h.length>1&&(null!=l?l:0)>16384){var c=Math.ceil(h.length/2),d=t=>ee(e.data)?t:w({},e.data,{batch:t});return n2(w({},e,{data:d(h.slice(0,c))})),void n2(w({},e,{data:d(h.slice(c))}))}t9.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),n1(w({},e,{xa:!0}))}catch(e){t9.warn("Beacon send failed",e)}},n3=(e,t,i,s)=>{var r="query"===s?"POST"===t?"sent_at":"_":void 0;return nK(i===nt?nG(e,"compression"):e,w({},r?{[r]:Date.now().toString()}:{},i===nt?{}:{compression:i}))},n5=[];h&&n5.push({transport:"fetch",method:n1}),c&&n5.push({transport:"XHR",method(e){var t=nZ(e);if(t){var i=new c,s=t.encodedBody;i.open(e.method||"GET",t.url,!0);var r=null!=s?s:{},n=r.contentType,a=r.body;sv(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};
2if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(a)}}}),null!=o&&o.sendBeacon&&n5.push({transport:"sendBeacon",method:n2});class n6{constructor(e,t){this.Ca=!0,this.Ta=[],this.Ma=ew((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,t9.createLogger("flush interval"),3e3),this.Ea=e}enqueue(e){this.Ta.push(e),this.Ia||this.Ra()}unload(){this.Pa();var e=Object.values(this.Ta.length>0?this.Aa():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Fa(w({},e,{transport:"sendBeacon"}))})}enable(){this.Ca=!1,this.Ra()}Ra(){var e=this;this.Ca||(this.Ia=setTimeout(()=>{if(this.Pa(),this.Ta.length>0){var t=this.Aa();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&ee(s.data)&&sv(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.Fa(s)}()}},this.Ma))}Fa(e){try{this.Ea(e)}catch(e){t9.error(e)}}Pa(){clearTimeout(this.Ia),this.Ia=void 0}Aa(){var e={};return sv(this.Ta,t=>{var i,s=(t?t.batchKey:null)||t.url;er(e[s])&&(e[s]=w({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.Ta=[],e}}var n4=["retriesPerformedSoFar"];class n8{constructor(e){this.Oa=!1,this.La=3e3,this.Ta=[],this._instance=e,this.Ta=[],this.Da=!0,!er(n)&&"onLine"in n.navigator&&(this.Da=n.navigator.onLine,this.$a=()=>{this.Da=!0,this.Na()},this.qa=()=>{this.Da=!1},sw(n,"online",this.$a),sw(n,"offline",this.qa))}get length(){return this.Ta.length}retriableRequest(e){var t=e.retriesPerformedSoFar,i=x(e,n4);eh(t)&&(i.url=nK(i.url,{retry_count:t})),this._instance._send_request(w({},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.Rn(w({retriesPerformedSoFar:t},i));0===e.statusCode&&t9.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)}}))}Rn(e){var t,i,s=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=s+1;var r=Math.ceil((i=Math.min(18e5,t=3e3*Math.pow(2,s)))+(Math.random()-.5)*(i-t/2)),n=Date.now()+r;this.Ta.push({retryAt:n,requestOptions:e});var a="Enqueued failed request for retry in "+r;navigator.onLine||(a+=" (Browser is offline)"),t9.warn(a),this.Oa||(this.Oa=!0,this.ja())}ja(){(this.Ba&&clearTimeout(this.Ba),0===this.Ta.length)?(this.Oa=!1,this.Ba=void 0):this.Ba=setTimeout(()=>{this.Da&&this.Ta.length>0&&this.Na(),this.ja()},this.La)}Na(){var e=Date.now(),t=[],i=this.Ta.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.Ta=t,i.length>0)for(var s of i)this.retriableRequest(s.requestOptions)}unload(){for(var e of(this.Ba&&(clearTimeout(this.Ba),this.Ba=void 0),this.Oa=!1,er(n)||(this.$a&&(n.removeEventListener("online",this.$a),this.$a=void 0),this.qa&&(n.removeEventListener("offline",this.qa),this.qa=void 0)),this.Ta)){var t=e.requestOptions;try{this._instance._send_request(w({},t,{transport:"sendBeacon"}))}catch(e){t9.error(e)}}this.Ta=[]}}class n7{constructor(e){this.Ha=()=>{this.Ua||(this.Ua={});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.Ua.lastScrollY=Math.ceil(n),this.Ua.maxScrollY=Math.max(n,null!=(e=this.Ua.maxScrollY)?e:0),this.Ua.maxScrollHeight=Math.max(a,null!=(t=this.Ua.maxScrollHeight)?t:0),this.Ua.lastContentY=o,this.Ua.maxContentY=Math.max(o,null!=(i=this.Ua.maxContentY)?i:0),this.Ua.maxContentHeight=Math.max(l,null!=(s=this.Ua.maxContentHeight)?s:0)},this._instance=e}get za(){return this._instance.config.scroll_root_selector}getContext(){return this.Ua}resetContext(){var e=this.Ua;return setTimeout(this.Ha,0),e}startMeasuringScrollPosition(){sw(n,"scroll",this.Ha,{capture:!0}),sw(n,"scrollend",this.Ha,{capture:!0}),sw(n,"resize",this.Ha)}scrollElement(){if(!this.za)return null==n?void 0:n.document.documentElement;for(var e of ee(this.za)?this.za:[this.za]){var t=null==n?void 0:n.document.querySelector(e);if(t)return t}}Wa(e){if(this.za){var t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return n?"y"===e?n.scrollY||n.pageYOffset||n.document.documentElement.scrollTop||0:n.scrollX||n.pageXOffset||n.document.documentElement.scrollLeft||0:0}scrollY(){return this.Wa("y")}scrollX(){return this.Wa("x")}}var n9=e=>r2(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
2);class ae{constructor(e,t,i,s){this.st=e=>{var t=this.Va();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Ga(this._instance)};this.Za.register({[i0]:i})}},this._instance=e,this.Qa=t,this.Za=i,this.Ga=s||n9,this.Qa.onSessionId(this.st)}Va(){return this.Za.props[i0]}getSetOnceProps(){var e,t=null==(e=this.Va())?void 0:e.props;return t?"r"in t?r3(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 sv(sy(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+J(i)]=t}),e}}class at{on(e,t){return this.Ja[e]||(this.Ja[e]=[]),this.Ja[e].push(t),()=>{this.Ja[e]=this.Ja[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Ja[e]||[])i(t);for(var s of this.Ja["*"]||[])s(e,t)}constructor(){this.Ja={}}}var ai=ie("[SessionId]");class as{on(e,t){return this.Ka.on(e,t)}constructor(e,t,i){if(this.Ya=null,this.Xa=null,this.eo=[],this.io=void 0,this.ro=!1,this.Ka=new at,this.no=(e,t)=>!(!eh(e)||!eh(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===ss)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Wi=e.config,this.Za=e.persistence,this.ut=void 0,this._e=void 0,this._sessionStartTimestamp=null,this.so=void 0,this._sessionActivityTimestamp=null,this.ao=t||sR,this.oo=i||sR;var s,r=this.Wi.persistence_name||this.Wi.token;if(this._sessionTimeoutMs=1e3*ew(this.Wi.session_idle_timeout_seconds||1800,60,36e3,ai.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.lo(),this.uo="ph_"+r+"_window_id",this.ho="ph_"+r+"_primary_window_exists",this.do()){var n=sZ.zr(this.uo),a=sZ.zr(this.ho);n&&!a?this.ut=n:sZ.$r(this.uo),sZ.Hr(this.ho,!0)}null!=(s=this.Wi.bootstrap)&&s.sessionID&&this.setBootstrapSessionId(this.Wi.bootstrap.sessionID),this.vo()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return er(this.eo)&&(this.eo=[]),this.eo.push(e),this._e&&e(this._e,this.ut),()=>{this.eo=this.eo.filter(t=>t!==e)}}do(){return"memory"!==this.Wi.persistence&&!this.Za.Zs&&sZ.Br()}co(e){e!==this.ut&&(this.ut=e,this.do()&&sZ.Hr(this.uo,e))}fo(){return this.ut?this.ut:this.do()?sZ.zr(this.uo):null}po(e){var t=this.Ya;return!eo(t)&&!eo(e)&&5e3>Math.abs(e-t)}mo(e,t,i){var s=t!==this._sessionActivityTimestamp,r=e===this._e&&i===this._sessionStartTimestamp;this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._e=e,r&&!s||r&&this.po(t)||(this.Ya=t,this.Za.register({[iC]:[t,e,i]}))}yo(){var e,t=null==(e=this.Wi)?void 0:e.persistence_save_debounce_ms;return eh(t)&&t>0}bo(){this.yo()?this.Za.refreshKey(iC):(this.Za.flush(),this.Za.load())}_o(){var e;if(!eo(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Ya){this.bo();var t=this.wo();t[1]===this._e&&t[2]===this._sessionStartTimestamp&&(this.Ya=this._sessionActivityTimestamp,this.Za.register({[iC]:[this._sessionActivityTimestamp,null!=(e=this._e)?e:null,this._sessionStartTimestamp]}),this.Za.flush())}}ko(){var e=this.wo()[0];return Math.max(eh(e)?e:0,eh(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}So(e){return this.bo(),this.no(e,this.ko())}wo(){var e=this.Za.props[iC];return ee(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ya=null,this.so=void 0,clearTimeout(this.xo),this.xo=void 0,this.mo(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 ai.error("Bootstrap sessionID cannot be in the future"):i}catch(e){return void ai.error("Invalid sessionID in bootstrap",e)}}(e);return!er(i)&&(t?this.so={sessionId:e,sessionStartTimestamp:i}:this.mo(e,(new Date).getTime(),i),!0)}destroy(){this.ro=!0,this._o(),clearTimeout(this.xo),this.xo=void 0,this.io&&n&&(n.removeEventListener(sl,this.io,{
2capture:!1}),this.io=void 0),this.eo=[]}vo(){this.io=()=>{this._o(),this.do()&&sZ.$r(this.ho)},sw(n,sl,this.io,{capture:!1})}checkAndGetSessionAndWindowId(e,t,i){if(void 0===e&&(e=!1),void 0===t&&(t=null),void 0===i&&(i=!1),this.Wi.cookieless_mode===ss)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s,r,n=t||(new Date).getTime(),a=this._e;i?this.Xa=n:(eo(this.Xa)||this.Xa>n||n-this.Xa>=1e3)&&(null==(s=(r=this.Za).syncCookieProperties)||s.call(r),this.Xa=n);var o=this.wo(),l=o[1],u=o[2],h=!er(a)&&l!==a,c=this.ko(),d=this.fo(),p=this.so,v=!!p&&(p.sessionStartTimestamp>n+6e4||n-p.sessionStartTimestamp>864e5),g=p?v:eh(u)&&Math.abs(n-u)>864e5,f=!1,_=h,m=!l||!!p,y=l,b=!m&&!e&&this.no(n,c);if(b){(b=this.So(n))||ai.info("cross-tab refresh kept the session alive",{sessionId:l});var w=this.wo();l=w[1],u=w[2]}if(m||b||g){_=!1;var x=p&&!v;l=x?p.sessionId:this.ao(),d=this.oo(),ai.info("new session ID assigned",{sessionId:l,windowId:d,bootstrapped:!!x,changeReason:{noSessionId:m,activityTimeout:b,sessionPastMaximumLength:g}}),u=x?p.sessionStartTimestamp:n,this.so=void 0,f=!0}else d||(d=this.oo(),f=!0),(_=_||l!==y)&&(ai.info("adopted cross-tab session id",{sessionId:l,windowId:d}),f=!0);var k=eh(c)&&e&&!g?c:n,E=eh(u)?u:(new Date).getTime();this.co(d),this.mo(l,k,E),e||this.lo();var S={noSessionId:m,activityTimeout:b,sessionPastMaximumLength:g,crossTabAdoption:_};return f&&this.eo.forEach(e=>e(l,d,S)),{sessionId:l,windowId:d,sessionStartTimestamp:E,changeReason:f?S:void 0,lastActivityTimestamp:c}}lo(){this.ro||(clearTimeout(this.xo),this.xo=setTimeout(()=>{if(!this.ro)if(this.So((new Date).getTime())){var e=this._e;this.resetSessionId(),this.Ka.emit("forcedIdleReset",{idleSessionId:e})}else this.lo()},1.1*this.sessionTimeoutMs))}}var ar=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&V(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>V(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function an(){return(an=b(function*(){var e=null==o?void 0:o.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return en(i)&&i.length>0?i:void 0}catch(e){return void t9.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}function aa(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}var ao=(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}},al=e=>e.toLowerCase(),au={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=>ao(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!ao(t,e))),icontains:(e,t)=>t.map(al).some(t=>e.map(al).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(al).every(t=>e.map(al).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 ah(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=au[i.operator];return!!r&&r(i.values,[String(s)])})}function ac(e,t,i){return rj({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var ad="custom",ap="i.posthog.com",av=/^\/static\//,ag=["/s/","/e/","/i/"];class af{constructor(e){this.Co={},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("."+ap,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Co[this.apiHost]||(this.Co[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":ad),this.Co[this.apiHost]}To(e){if(av.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}Mo(e){var t=rW(e);return t?t.protocol+"//"+t.host+t.pathname:void 0}Eo(e,t,i){if("ui"===e)return i;var s=i,r=this.instance.config.rewriteRequestPath;
2if(r&&(s=r(new URL((null==(a=rW(i))?void 0:a.href)||i)).toString()),r&&"api"===e&&ag.some(e=>0===t.indexOf(e))){var n=this.Mo(s);if(n){var a,o,l=this.apiHost,u=this.Io;(null==(o=u)?void 0:o.apiHost)===l&&u.rewriteRequestPath===r||(u={apiHost:l,rewriteRequestPath:r,urls:new Set},this.Io=u),u.urls.add(n)}}return s}isIngestionEndpoint(e){var t=this.Io,i=this.Mo(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.Eo(e,t,this.uiHost+t);if("flags"===e)return this.Eo(e,t,this.flagsApiHost+t);if("assets"===e){var i=this.To(t);if(i)return this.Eo(e,t,""+i+t)}if(this.region===ad)return this.Eo(e,t,this.apiHost+t);var s=ap+t;switch(e){case"assets":return this.Eo(e,t,"https://"+this.region+"-assets."+s);case"api":return this.Eo(e,t,"https://"+this.region+"."+s)}}}var a_=ie("[Surveys]"),am="seenSurvey_",ay=e=>{try{var t=""+am+(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){a_.error("Failed to persist survey seen state",e)}},ab=["popover","widget","api"],aw={ignoreConditions:!1,ignoreDelay:!1,displayType:nl},ax=ie("[PostHog ExternalIntegrations]"),ak={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class aE{constructor(e){this._instance=e}Ts(e,t){var i;null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return ax.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=_.__PosthogExtensions__)&&null!=(e=e.integrations)&&e[n]||t.Ts(ak[n],()=>{var e;null==(e=_.__PosthogExtensions__)||null==(e=e.integrations)||null==(e=e[n])||e.start(t._instance)}),!a&&null!=(s=_.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[n]&&(null==(r=_.__PosthogExtensions__)||null==(r=r.integrations)||null==(r=r[n])||r.stop())}()}}class aS{constructor(e,t){this.I=e,this.ds=t,this.Ro=new Map,this.os=!1}add(e){var t=this;return b(function*(){if(t.os)throw Error("Cannot add an extension to a disposed ExtensionRuntime");if(t.Ro.has(e.name))throw Error('Browser extension "'+e.name+'" is already registered');t.Ro.set(e.name,e);try{var i=e.setup(t.ds);i&&(yield i)}catch(i){var s=t.Ro.get(e.name)===e;s&&t.Ro.delete(e.name),t.I.error('Failed to set up browser extension "'+e.name+'"',i),s&&t.Po(e)}})()}getExtension(e){return this.Ro.get(e)}dispose(){if(!this.os){this.os=!0;var e=Array.from(this.Ro.values()).reverse();for(var t of(this.Ro.clear(),e))this.Po(t)}}Po(e){try{var t=null==e.dispose?void 0:e.dispose();t&&et(t.then)&&t.then(void 0,t=>{this.I.error('Failed to dispose browser extension "'+e.name+'"',t)})}catch(t){this.I.error('Failed to dispose browser extension "'+e.name+'"',t)}}}class aP{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);er(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)}}var aI="extensionsRemoteConfig";class aF{constructor(e){this.os=!1,this.instance=e,this.I=t9,this.Ao=e.Fo,this.kv=new aP(e),this.onEvent=e=>ne(this.instance.on("eventCaptured",t=>{try{e({event:t.event,properties:t.properties})}catch(e){this.I.error("Browser extension event listener failed",e)}})),this.onRemoteConfig=e=>{if(this.os)return ne(()=>{});var t=t=>{try{e(t)}catch(e){this.I.error("Browser extension remote config listener failed",e)}},i=this.instance.Oo.on(aI,t);return this.Ao&&t(this.Ao),ne(i)},this.Lo=new aS(t9.createLogger("[BrowserExtensions]"),this)}get logger(){return this.I}get distinctId(){return this.instance.get_distinct_id()}get anonymousId(){var e;return null!=(e=this.instance.get_property(iu))?e:this.distinctId}get deviceId(){var e=this.instance.get_property(iu);return"string"==typeof e?e:void 0}get library(){return{name:m.LIB_NAME,version:m.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.Lo.add(e)}getExtension(e){return this.Lo.getExtension(e)}capture(e,t,i){var s=this;return b(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 ne(this.instance.Do(e))}handleRemoteConfig(e){this.os||(this.Ao=e,this.instance.Oo.emit(aI,e))}sendRequest(e,t){var i=this;return b(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?nK(r,t.query):r,data:t.body,headers:t.headers,timeout:t.timeoutMs,fireCallbackOnDrop:!0,transport:t.transport,compression:t.compression,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.os||(this.os=!0,this.Lo.dispose())}}var aC={},aT=0,a$=()=>{}
2,aR='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',aO="Surveys module not available",aM="sanitize_properties is deprecated. Use before_send instead",aL="Invalid value for property_denylist config: ",aA=["token","distinct_id",i8],aD="posthog",aj=!nB&&-1===(null==v?void 0:v.indexOf("MSIE"))&&-1===(null==v?void 0:v.indexOf("Mozilla")),aW=e=>{var t,i;return w({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(!en(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of sb)if(i===s)return!1;return!0}(null==l?void 0:l.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:a$,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:u&&en(null==u?void 0:u.search)&&-1!==u.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,disable_external_dependency_loading:!1,strict_script_versioning:"fallback",enable_recording_console_log:void 0,secure_cookie:"https:"===(null==n||null==(t=n.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){t9.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:sa,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:a$},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:ro,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)})},aN=[["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"]],aH=e=>{var t={};for(var i of aN){var s=i[0],r=i[1];er(e[s])||(t[r]=e[s])}var n=sg({},t,e),a=e.__preview_external_dependency_versioned_paths;return er(a)||(er(e.strict_script_versioning)&&(n.strict_script_versioning=!!a),en(a)&&er(e.asset_host)&&(n.asset_host=a)),ee(e.property_blacklist)&&(er(e.property_denylist)?n.property_denylist=e.property_blacklist:ee(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:t9.error(aL+e.property_denylist)),n};class aq{constructor(){this.__forceAllowLocalhost=!1}get $o(){return this.__forceAllowLocalhost}set $o(e){t9.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class aU{No(e,t){if(e){var i=this.Ro.indexOf(e);-1!==i&&this.Ro.splice(i,1)}return this.Ro.push(t),null==t.initialize||t.initialize(),t}qo(){return this.config.cookieless_mode===ss||this.config.cookieless_mode===si&&this.consent.isRejected()}jo(){if(!this.qo()&&this.get_distinct_id()===i4){var e=this.persistence;if(e){this.Bo()||e.load(!0);var t=this.get_distinct_id();if(!t||t===i4){var i=this.config.get_device_id(sR());this.register({distinct_id:i,$device_id:i}),e.set_property(iQ,sr)}this.Ho()}}}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 aq,this.Uo=!1,this.version=m.LIB_VERSION,this.zo=new Set,this.Wo="",this.Oo=new at,this.Ro=[],this.Vo=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=aW(),this.SentryIntegration=rR,this.sentryIntegration=e=>{var t;return t=r$(this,e),{name:rT,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Go=!1,this.Zo=null,this.Qo=null,this.Jo=null,this.scrollManager=new n7(this),this.pageViewManager=new rO(this),this.rateLimiter=new nh(this),this.requestRouter=new af(this),this.consent=new sX(this),this.externalIntegrations=new aE(this);var e,t=null!=(e=aU.__defaultExtensionClasses)?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,i)=>{var s=en(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=en(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>t9.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==aD){var s,r=null!=(s=aC[i])?s:new aU;return r._init(e,t,i),aC[i]=r,aC[aD][i]=r,r}return this._init(e,t,i)}_init(e,t,i){void 0===t&&(t={});var s,r,a,o=en(e)?e.trim():"";if(!o)return t9.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=aW(t.defaults),t.debug=this.Ko(t.debug),this.Yo=t,this.Xo=[],t.person_profiles?this.Qo=t.person_profiles:t.process_person&&(this.Qo=t.process_person);var l=aW(t.defaults),u=aH(t),h=sg({},l,u,{name:i,token:o});ei(l.rageclick)&&ei(u.rageclick)&&(h.rageclick=sg({},l.rageclick,u.rageclick)),ei(l.session_recording)&&ei(u.session_recording)&&(h.session_recording=sg({},l.session_recording,u.session_recording)),this.set_config(h),this.config.on_xhr_error&&t9.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:nt;var c=this.Bo();if(this.persistence=new r9(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r9(w({},this.config,{persistence:"sessionStorage"}),c,!1),this.Wo="ph_"+(this.config.persistence_name||this.config.token)+"_session_registered_properties","memory"!==this.config.persistence&&!c&&sZ.Br()){var d=sZ.zr(this.Wo);
2ee(d)&&d.forEach(e=>{en(e)&&this.zo.add(e)})}else sZ.$r(this.Wo);var p=w({},this.persistence.props),v=w({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.tl=new n6(e=>this.el(e),this.config.request_queue_config),this.il=new n8(this),this.__request_queue=[];var g=this.qo();if(g||(this.sessionManager=new as(this),this.sessionPropsManager=new ae(this,this.sessionManager,this.persistence),this.sessionManager.onSessionId((e,t,i)=>{(null!=i&&i.activityTimeout||null!=i&&i.sessionPastMaximumLength||null!=i&&i.crossTabAdoption)&&this.rl()})),this.nl(),this.config.__preview_deferred_init_extensions?(t9.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.sl(g)},0)):(t9.info("Initializing extensions synchronously"),this.sl(g)),m.DEBUG=m.DEBUG||this.config.debug,m.DEBUG&&t9.info("Starting in debug mode",{this:this,config:t,thisC:w({},this.config),p:p,s:v}),!this.config.identity_distinct_id||null!=(s=t.bootstrap)&&s.distinctID||(t.bootstrap=w({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(r=t.bootstrap)?void 0:r.distinctID)){var f=t.bootstrap.distinctID,_=this.get_distinct_id(),y=this.persistence.get_property(iQ);if(t.bootstrap.isIdentifiedID&&null!=_&&_!==f&&y===sr)this.identify(f);else if(t.bootstrap.isIdentifiedID&&null!=_&&_!==f&&y===sn)t9.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 b=this.config.get_device_id(sR()),x=t.bootstrap.isIdentifiedID?b:f;this.persistence.set_property(iQ,t.bootstrap.isIdentifiedID?sn:sr),this.register({distinct_id:f,$device_id:x})}}if(g)this.register_once({distinct_id:i4,$device_id:null},"");else if(!this.get_distinct_id()){var k=this.config.get_device_id(sR());this.register_once({distinct_id:k,$device_id:k},""),this.persistence.set_property(iQ,sr)}return sw(n,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var s=i=>{var s=()=>i.anonymousId()||sR();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(iQ,sn)),t()},r=i.user();"then"in r&&et(r.then)?r.then(s):s(r)}(e,()=>{var s;i.register(("u">typeof Promise&&Promise.resolve||rC.warn("This browser does not have Promise support, and can not use the segment integration"),s=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(rC.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(rC.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var s=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},s,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>s(e,e.event.event),page:e=>s(e,su),identify:e=>s(e,sc),screen:e=>s(e,"$screen")})).then(()=>{t()})})}(this,()=>this.al()):this.al(),et(this.config._onCapture)&&this.config._onCapture!==a$&&(t9.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&t9.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 an.apply(this,arguments)})().then(e=>{e&&this.register({[ih]:e})}).catch(a$),this}ol(e){return en(e.name)&&et(e.setup)}ll(e,t){this.ol(e)?t.push(()=>{this.ul().add(e).catch(()=>null==e.dispose?void 0:e.dispose()).catch(t=>{t9.error('Failed to dispose browser extension "'+e.name+'"',t)})}):this.Ro.push(e)}nl(){var e,t,i,s,r,n,a=null!=(e=null==(t=this.config.__extensionClasses)?void 0:t.featureFlags)?e:null==(i=aU.__defaultExtensionClasses)?void 0:i.featureFlags;a&&(this.featureFlags&&this.featureFlags instanceof a||(null==(s=this.hl)||s.call(this),this.hl=void 0,this.featureFlags=new a(this)),et(this.featureFlags.onReloading)&&et(this.featureFlags.setup)?this.hl||(this.hl=this.featureFlags.onReloading(()=>
2{this.Oo.emit("featureFlagsReloading",!0)}),this.ul().add(this.featureFlags)):null==(r=(n=this.featureFlags).initialize)||r.call(n))}sl(e){var t,i,s,r,n,a,o,l=performance.now(),u=w({},aU.__defaultExtensionClasses,this.config.__extensionClasses),h=[];u.exceptions&&this.Ro.push(this.exceptions=null!=(t=this.exceptions)?t:new u.exceptions(this)),u.historyAutocapture&&this.Ro.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.Ro.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.Ro.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!e&&this.Ro.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||h.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.ll(this.autocapture=new u.autocapture(this),h),u.surveys&&this.ll(this.surveys=null!=(i=this.surveys)?i:new u.surveys(this),h),u.logs&&this.ll(this.logs=null!=(s=this.logs)?s:new u.logs(this),h),u.metrics&&this.Ro.push(this.metrics=null!=(r=this.metrics)?r:new u.metrics(this)),u.conversations&&this.Ro.push(this.conversations=null!=(n=this.conversations)?n:new u.conversations(this)),u.productTours&&this.Ro.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.Ro.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.Ro.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.Ro.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.Ro.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,rI)),u.toolbar&&this.Ro.push(this.toolbar=null!=(a=this.toolbar)?a:new u.toolbar(this)),u.experiments&&this.Ro.push(this.experiments=null!=(o=this.experiments)?o:new u.experiments(this)),this.Ro.forEach(e=>{e.initialize&&h.push(()=>{null==e.initialize||e.initialize()})}),h.push(()=>{if(this.dl){var e=this.dl;this.dl=void 0,this.Ro.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}}),this.vl(h,l)}vl(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.vl(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){t9.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[i7]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[i9]:s}),this.config.__preview_deferred_init_extensions&&t9.info("PostHog extensions initialized ("+s+"ms)")}wa(e){var t;if(!l||!l.body)return t9.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.wa(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.dl=e),this.Fo=e,this.compression=void 0,e.ok){var i,s=e.config;s.supportedCompression&&!this.config.disable_compression&&(this.compression=G(s.supportedCompression,nt)?nt:G(s.supportedCompression,ni)?ni:void 0),null!=(i=s.analytics)&&i.endpoint&&(this.analyticsDefaultEndpoint=s.analytics.endpoint)}this.set_config({person_profiles:this.Qo?this.Qo:sa}),null==(t=this.cl)||t.handleRemoteConfig(e),this.Ro.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}al(){try{this.config.loaded(this)}catch(e){t9.critical("`loaded` function failed",e)}if(this.fl(),this.config.internal_or_test_user_hostname&&null!=u&&u.hostname){var e=u.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.qo())&&this.pl()},1),this.gl=new nd(this),this.gl.load()}fl(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.tl)||e.enable())}_dom_loaded(){this.is_capturing()&&sp(this.__request_queue,e=>this.el(e)),this.__request_queue=[],this.fl()}_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.ml()&&this.capture(sh),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(s=this.tl)||s.unload(),null==(r=this.il)||r.unload()):this.ml()&&this.capture(sh,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?aj?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=w({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(er(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=w({},e);a.timeout=a.timeout||6e4;var o,l,u,h,c,d=null!=(s=a.transport)?s:"fetch";"sendBeacon"===d&&er(a.compression)&&a.data&&(a.compression=ni),"POST"===a.method&&a.data&&("capture-body"===a.timestampMode?a.data={api_key:null!=(l=null==(c=(h=(ee(o=a.data)?o:[o]).map(e=>w({},e,e.timestamp instanceof Date&&!isNaN(e.timestamp.getTime())?{timestamp:e.timestamp.toISOString()}:{})))[0])||null==(u=c.properties)?void 0:u.token)?l:null==c?void 0:c.token,batch:h,sent_at:(new Date).toISOString()}:"body"===a.timestampMode&&(t=a.data,void 0===i&&(i=(new Date).toISOString()),a.data=ee(t)?t.map(e=>w({},e,{sent_at:i})):w({},t,{sent_at:i}))),a.url=n3(a.url,a.method,a.compression,a.timestampMode);var v=n5.filter(e=>!a.disableTransport||!e.transport||!a.disableTransport.includes(e.transport)),g=null!=(r=null==(n=function(e){for(var t=0;e.length>t;t++)if(e[t].transport===d)return e[t]}(v))?void 0:n.method)?r:v[0].method;if(!g)throw Error("No available transport method");var f=e=>{try{g(e)}catch(e){n0(e)?t9.warn(e):t9.error(e),null==a.callback||a.callback({statusCode:0,error:e})}};"sendBeacon"!==d&&a.data&&a.compression===nt&&p&&"u">typeof Promise&&!nV?nX(a).then(e=>{f(e)}).catch(t=>{j(t)?(nV=!0,f(w({},a,{compression:void 0,url:n3(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 j(e)||t===L})(t)&&(nV=!0),f(a))}):g(a)})(w({},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}))}el(e){this.il?this.il.retriableRequest(e):this._send_request(e)}_execute_array(e){aT++;try{var t,i=[],s=[],r=[];sp(e,e=>{if(e)if(ee(t=e[0]))r.push(e);else if(et(e))try{e.call(this)}catch(t){t9.error("Error executing queued PostHog call",e,t)}else ee(e)&&"alias"===t?i.push(e):ee(e)&&-1!==t.indexOf("capture")&&et(this[t])?r.push(e):s.push(e)});var n=function(e,t){sp(e,function(e){try{if(ee(e[0])){var i=t;sv(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){t9.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(s,this),n(r,this)}finally{aT--}}push(e){if(aT>0&&ee(e)&&en(e[0])){var t=aU.prototype[e[0]];et(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var s,r,n,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.tl){if(this.is_capturing())if(!er(e)&&en(e)){this.jo();var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var u=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==u||!u.isRateLimited){null!=t&&t.$current_url&&!en(null==t?void 0:t.$current_url)&&(t9.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.yl||t9.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h,c,d,p,v=new Date,g=(null==i?void 0:i.timestamp)||v,f=t_(null==i?void 0:i.uuid,sR),_={uuid:f,event:e,properties:this.calculateEventProperties(e,t||{},g,f)};e===su&&this.config.__preview_capture_bot_pageviews&&l&&(_.event="$bot_pageview",_.properties.$browser_type="bot"),u&&(_.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens);var m="$feature_flag_called"===e&&!1===_.properties.$feature_flag_has_experiment&&!0===this.get_property(iD);(null==i?void 0:i.$set)&&!m&&(_.$set=null==i?void 0:i.$set);var y=null==i?void 0:i.$unset;y&&(_.$unset=y);var b,x,k,E=m?void 0:this.bl(null==i?void 0:i.$set_once,e!==sd,e===sc);if(E&&(_.$set_once=E),null!=i&&i._noTruncate||(r=this.config.properties_string_max_length,n=_,a=e=>en(e)?e.slice(0,r):e,o=new Set,_=function e(t,i){if(t!==Object(t))return a?a(t):t;if(!o.has(t)){var s;if(o.add(t),ee(t))s=[],sp(t,t=>{s.push(e(t))});else{var r={};sv(t,(t,i)=>{o.has(t)||(r[i]=e(t,i))}),s=r}return s}}(n)),_.timestamp=g,er(null==i?void 0:i.timestamp)||(_.properties.$event_time_override_provided=!0,_.properties.$event_time_override_system_time=v),m&&(_.properties=(h=_.properties,void 0===(c=aA)&&(c=[]),d={},p=e=>{void 0!==h[e]&&(d[e]=h[e])}
2,T.forEach(p),c.forEach(p),d)),e===na||e===no){var S=null==t?void 0:t.$survey_id,P=null==t?void 0:t.$survey_iteration;ay({id:S,current_iteration:P}),_.$set=w({},_.$set,{[(b={id:S,current_iteration:P},k="$survey_"+(x=e===no?"responded":"dismissed")+"/"+b.id,b.current_iteration&&b.current_iteration>0&&(k="$survey_"+x+"/"+b.id+"/"+b.current_iteration),k)]:!0})}else e===nn&&(_.$set=w({},_.$set,{$survey_last_seen_date:(new Date).toISOString()}));if("product tour shown"===e){var I=null==t?void 0:t.$product_tour_type;I&&(_.$set=w({},_.$set,{["$product_tour_last_seen_date/"+I]:(new Date).toISOString()}))}var F=w({},_.properties.$set,_.$set);if(es(F)||this.setPersonPropertiesForFlags(F),!el(this.config.before_send)){var C=this.En(_);if(!C)return;(_=C).uuid=t_(_.uuid,sR)}this.Oo.emit("eventCaptured",_);var $=null!=(s=null==i?void 0:i._url)?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),R={method:"POST",url:$,data:_,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test($)?"body":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.el(R):this.tl.enqueue(R),_}t9.critical("This capture call is ignored due to client rate limiting.")}}else t9.error("No event name provided to posthog.capture")}else t9.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}getExtension(e){var t;return null==(t=this.cl)?void 0:t.getExtension(e)}ul(){var e;return null!=(e=this.cl)?e:this.cl=new aF(this)}Do(e){this.Vo.push(e);var t=!0;return()=>{if(t){t=!1;var i=this.Vo.indexOf(e);-1!==i&&this.Vo.splice(i,1)}}}_l(e){var t,i,s;return void 0===e&&(e=!0),!(null==(t=this.persistence)||!t.consumeCookieIdentityChange())&&(this.Jo=null,this.persistence.get_property(iQ)===sr&&(null==(s=this.sessionPersistence)||s.clear(),this.zo.clear(),this.wl()),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._l();var a,o=r?void 0:this.persistence.remove_event_timer(e),h=w({},t);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.qo()&&(h[i8]=!0),"$snapshot"===e){var c=w({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=c.distinct_id,(!en(h.distinct_id)&&!eu(h.distinct_id)||ea(h.distinct_id))&&t9.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var d,p=function(e,t,i,s){if(void 0===s&&(s=!1),!v)return{};var r,a,o,l,h,c=e?[...rV,...t||[]]:[],d=function(e){for(var t=0;tv.length>t;t++){var i=tv[t],s=i[1],r=i[0].exec(e),n=r&&(et(s)?s(r,e):s);if(n)return n}return["",""]}(v),p=d[0],g=d[1],f=null!=(h="u">typeof navigator?navigator:void 0)&&h.brave?{brave:!0}:{},_={};er(i)||(_.detectGoogleSearchApp=i);var y={},b=null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,w=null==(a=navigator)?void 0:a.maxTouchPoints,x=null==n||null==(o=n.screen)?void 0:o.width,k=null==n||null==(l=n.screen)?void 0:l.height,E=null==n?void 0:n.devicePixelRatio;er(b)||(y.userAgentDataPlatform=b),er(w)||(y.maxTouchPoints=w),er(x)||(y.screenWidth=x),er(k)||(y.screenHeight=k),er(E)||(y.devicePixelRatio=E);var S,P,I,F,C,T,$=sg(sy({$os:p,$os_version:g,$browser:tc(v,navigator.vendor,f,_),$device:tg(v),$device_type:(T=tg(v))===eI||T===eP||"Kobo"===T||"Kindle Fire"===T||T===e3?eS:T===eV||T===eK||T===eG||T===e0?"Console":T===eC?"Wearable":T?ek:"Android"===(null==y?void 0:y.userAgentDataPlatform)&&(null!=(P=null==y?void 0:y.maxTouchPoints)?P:0)>0?600>Math.min(null!=(I=null==y?void 0:y.screenWidth)?I:0,null!=(F=null==y?void 0:y.screenHeight)?F:0)/(null!=(C=null==y?void 0:y.devicePixelRatio)?C:1)?ek:eS:"Desktop",$timezone:r5(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:rH(s?tm(null==u?void 0:u.href):null==u?void 0:u.href,c,rK),$host:null==u?void 0:u.host,$pathname:null==u?void 0:u.pathname,$raw_user_agent:v.length>1e3?v.substring(0,997)+"...":v,$browser_version:tp(v,navigator.vendor,f,_),$browser_language:rQ(),$browser_language_prefix:"string"==typeof(S=rQ())?S.split("-")[0]:void 0,$screen_height:null==n?void 0:n.screen.height,$screen_width:null==n?void 0:n.screen.width,$viewport_height:null==n?void 0:n.innerHeight,$viewport_width:null==n?void 0:n.innerWidth,$lib:m.LIB_NAME,$lib_version:m.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});
2return m.SDK_DIST_CHANNEL&&($.$sdk_dist_channel=m.SDK_DIST_CHANNEL),$}(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 g=this.sessionManager.checkAndGetSessionAndWindowId(r,i.getTime(),!0),f=g.windowId;h.$session_id=g.sessionId,h.$window_id=f}this.sessionPropsManager&&sg(h,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&sg(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(a=this.il)?void 0:a.length}catch(e){h.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===ad&&(h.$lib_custom_api_host=this.config.api_host),d=e!==su||r?e!==sh||r?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),h=sg(h,d),e===su&&l&&(h.title=l.title),!er(o)){var _=i.getTime()-o;h.$duration=parseFloat((_/1e3).toFixed(3))}v&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser");var y=this.persistence.properties(),b=this.sessionPersistence.properties();sv(["$referrer","$referring_domain"],e=>{e in y&&delete b[e]});var x={};if(this.Vo.length>0)for(var k of this.Vo.slice())try{sg(x,k())}catch(e){t9.error("Failed to produce browser extension event properties",e)}(h=sg({},p,y,b,w({},x,h))).$is_identified=this._isIdentified(),ee(this.config.property_denylist)?sv(this.config.property_denylist,function(e){delete h[e]}):t9.error(aL+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var E=this.config.sanitize_properties;E&&(t9.error(aM),h=E(h,e));var S=this.kl();return h.$process_person_profile=S,S&&!r&&this.Sl("_calculate_event_properties"),h}bl(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.kl()||this.Uo&&!i)return e;var s,r=sg({},this.persistence.get_initial_props(),(null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(t9.error(aM),r=n(r,"$set_once")),t&&(this.Uo=!0),es(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._l(),null==(i=this.sessionPersistence)||i.register(e),Object.keys(e).forEach(e=>this.zo.add(e)),this.wl()}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.zo.delete(e),this.wl()}xl(e,t){this.register({[e]:t})}rl(){this.zo.forEach(e=>{var t;null==(t=this.sessionPersistence)||t.unregister(e)}),this.zo.clear(),this.wl()}wl(){var e;if(this.Wo)if("memory"===this.config.persistence||null!=(e=this.sessionPersistence)&&e.Zs||!sZ.Br())sZ.$r(this.Wo);else{var t=[];this.zo.forEach(e=>t.push(e)),t.length>0?sZ.Hr(this.Wo,t):sZ.$r(this.Wo)}}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.Oo.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:aO}),()=>{})}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:aO})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:aO})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=aw),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:aO}}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:aO})}Cl(e){return!e||ea(e)?(t9.critical("Unique user id has not been set in posthog.identify"),!1):e===i4?(t9.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())||(t9.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
2ot a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return t9.uninitializedWarning("posthog.identify");if(eu(e)&&(e=e.toString(),t9.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Cl(e)&&this.Sl("posthog.identify")){this.jo();var s=this.get_distinct_id(),r=this.persistence.syncCookieProperties()&&this.get_distinct_id()!==s,n=this._l(!1),a=this.persistence.Ks(),o=!1;try{var l=this.get_distinct_id();this.register({$user_id:e}),this.get_property(iu)||this.register_once({$had_persisted_distinct_id:!0,$device_id:l},""),e!==l&&e!==this.get_property(ic)&&(this.unregister(ic),this.register({distinct_id:e}));var u,h=(this.persistence.get_property(iQ)||sr)===sr,c=e!==l,d=!c&&h;if(c&&h)this.persistence.set_property(iQ,sn),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.config.cookieWinsOnConflict&&this.persistence.Ys(),this.capture(sc,{distinct_id:e,$anon_distinct_id:l},{$set:t||{},$set_once:i||{}}),this.Jo=ac(e,t,i),null==(u=this.featureFlags)||u.setAnonymousDistinctId(l);else if(d){this.persistence.set_property(iQ,sn);var p=t||{},v=i||{};this.setPersonPropertiesForFlags({$set:p,$set_once:v},!1),this.config.cookieWinsOnConflict&&this.persistence.Ys(),this.capture("$set",{$set:p,$set_once:v}),this.Jo=ac(e,t,i)}else(t||i)&&this.setPersonProperties(t,i);c||r||n?(this.reloadFeatureFlags(),this.featureFlags?this.featureFlags.resetFlagCallReported():this.unregister(iJ)):d&&(t||i)&&this.reloadFeatureFlags(),o=!0}finally{a&&this.persistence.ea(o)}}}setPersonProperties(e,t){if((e||t)&&this.Sl("posthog.setPersonProperties")){var i=ac(this.get_distinct_id(),e,t);this.Jo!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Jo=i):t9.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(ee(e)?e:[e]).filter(e=>en(e)&&e.length>0);0!==i.length&&this.Sl("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Jo=null)}group(e,t,i){var s;if(e&&t){null==(s=this.persistence)||s.syncCookieProperties(),this._l();var r=this.getGroups(),n=r[e]!==t;if(n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:w({},r,{[e]:t})}),n||i){var a={$group_type:e,$group_key:t};i&&(a.$group_set=i),this.capture(sd,a)}i&&this.setGroupPropertiesForFlags({[e]:i}),n&&!i&&this.reloadFeatureFlags()}else t9.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.Sl("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=ec(e)?e:null==e?void 0:e.resetDeviceID,i=ec(e)||null==e?void 0:e.bootstrap;this.Tl(t,!1,i)}Tl(e,t,i){if(void 0===t&&(t=!1),t9.info("reset"),!this.__loaded)return t9.uninitializedWarning("posthog.reset");var s,r,n,a,o,l,u,h,c,d,p,v,g,f,_,m,y,b=null==i?void 0:i.sessionID;this.config.bootstrap=i||(null==(s=this.Yo)?void 0:s.bootstrap)||{},null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.ka());var x=this.get_property(iu),k=this.get_property(ih),E=this.get_property(ik),S=this.is_capturing();this.consent.reset(),t||!S||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==(n=this.persistence)||null==n.Ks?void 0:n.Ks(),I=!1;try{if(null==(a=this.persistence)||a.clear(),null==(o=this.sessionPersistence)||o.clear(),this.zo.clear(),this.wl(),er(E)||null==(g=this.persistence)||g.register({[ik]:E}),null==(l=this.surveys)||l.reset(),null==(u=this.featureFlags)||u.reset(),null==(h=this.conversations)||h.reset(),null==(c=this.logs)||c.reset(),null==(d=this.metrics)||d.reset(),null==(p=this.persistence)||p.set_property(iQ,sr),null==(v=this.sessionManager)||v.resetSessionId(),this.Jo=null,this.config.cookieless_mode===ss)this.register_once({distinct_id:i4,$device_id:null},"");else{var F=this.config.get_device_id(sR());this.register_once({distinct_id:F,$device_id:e?F:x},""),e||er(k)||this.register({[ih]:k})}if(this.register({$last_posthog_reset:(new Date).toISOString()},1),i&&(void 0===i.distinctID||this.qo()||(null==(m=this.persistence)||m.set_property(iQ,i.isIdentifiedID?sn:sr),this.register({distinct_id:i.distinctID})),null==(f=this.featureFlags)||f.initialize(),!(er(b)||null!=(_=this.sessionManager)&&_.setBootstrapSessionId(b,!0)))){var C=w({},i);delete C.sessionID,this.config.bootstrap=C}delete this.config.identity_distinct_id,delete this.config.identity_hash,I=!0}
2finally{P&&(null==(y=this.persistence)||null==y.ea||y.ea(I))}this.reloadFeatureFlags()}shutdown(e){var t=this;return b(function*(){var e,i,s,r,n,a;if(t.__loaded){t.ul().dispose(),null==(e=t.sessionRecording)||e.dispose(),null==(i=t.logs)||i.flushLogs("sendBeacon"),null==(s=t.metrics)||s.flush("sendBeacon"),null==(r=t.tl)||r.unload(),null==(n=t.il)||n.unload();try{null==(a=t.featureFlags)||a.destroy()}catch(e){t9.error("Error while destroying feature flags",e)}}else t9.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var i;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i.Ml()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.El()}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(io)?(t9.critical("Attempting to create alias for existing People user - aborting."),-2):this.Sl("posthog.alias")?(er(t)&&(t=this.get_distinct_id()),e!==t?(this.xl(ic,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(t9.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=w({},this.config);if(ei(e)){sg(this.config,aH(e));var i=this.Bo();null==(s=this.persistence)||s.update_config(this.config,t,i),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new r9(w({},this.config,{persistence:"sessionStorage"}),i,!1);var s,r,n,a,o,l,u,h,c,d,p,v,g,f=this.Ko(this.config.debug);ec(f)&&(this.config.debug=f),ec(this.config.debug)&&(this.config.debug?(m.DEBUG=!0,sj.Br()&&sj.Hr("ph_debug",!0),t9.info("set_config",{config:e,oldConfig:t,newConfig:w({},this.config)})):(m.DEBUG=!1,sj.Br()&&sj.$r("ph_debug"))),null==(r=this.featureFlags)||null==r.updateConfig||r.updateConfig(this.config,this.ka()),null==(n=this.exceptionObserver)||n.onConfigChange(),null==(a=this.exceptions)||a.onConfigChange(),null==(o=this.sessionRecording)||o.startIfEnabledOrStop(),null==(l=this.tracingHeaders)||l.startIfEnabledOrStop(),null==(u=this.autocapture)||u.startIfEnabled(),null==(h=this.heatmaps)||h.startIfEnabled(),("capture_pageview"in e||"disable_capture_url_hashes"in e)&&(null==(g=this.historyAutocapture)||g.startIfEnabledOrStop()),null==(c=this.exceptionObserver)||c.startIfEnabledOrStop(),null==(d=this.deadClicksAutocapture)||d.startIfEnabledOrStop(),null==(p=this.surveys)||p.loadIfEnabled(),this.Ho(),null==(v=this.externalIntegrations)||v.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){m.LIB_NAME=e,m.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){if(this.exceptions){var i=Error("PostHog syntheticException"),s=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(w({},s,t))}}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 e,t;return null!=(e=null==(t=this.logs)?void 0:t.logger)?e:aU.Il}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:aD;return t!==aD&&(t=aD+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(iQ))===sn||(null==(t=this.sessionPersistence)?void 0:t.get_property(iQ))===sn}kl(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===sa&&!this._isIdentified()&&es(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[ic])&&(null==(t=this.persistence)||null==(t=t.props)||!t[i6]))}ml(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&!!this.config.capture_pageview}createPersonProfile(){this.kl()||this.Sl("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Sl("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Sl(e){return"never"===this.config.person_profiles?(t9.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.xl(i6,!0),!0)}Bo(){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&&this.config.cookieless_mode!==si)}Ho(){var e,t,i,s,r=this.Bo();return(null==(e=this.persistence)?void 0:e.Zs)!==r&&(null==(i=this.persistence)||i.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t.Zs)!==r&&(null==(s=this.sessionPersistence)||s.set_disabled(r)),r&&(this.zo.clear(),this.wl()),r}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==ss){if(this.qo()){this.Tl(!0,!0),null==(r=this.sessionManager)||r.destroy(),null==(n=this.pageViewM
2anager)||n.destroy(),this.sessionManager=new as(this),this.pageViewManager=new rO(this),this.persistence&&(this.sessionPropsManager=new ae(this,this.sessionManager,this.persistence));var i,s,r,n,a,o,l,u,h=null!=(a=null==(o=this.config.__extensionClasses)?void 0:o.sessionRecording)?a:null==(l=aU.__defaultExtensionClasses)?void 0:l.sessionRecording;h&&(this.sessionRecording=this.No(this.sessionRecording,new h(this)),this.Fo&&(null==(u=this.sessionRecording)||null==u.onRemoteConfig||u.onRemoteConfig(this.Fo)))}this.consent.optInOut(!0),this.Ho(),this.fl(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==si&&(null==(i=this.surveys)||i.loadIfEnabled()),(er(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!=(s=null==e?void 0:e.captureEventName)?s:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.pl()}else t9.warn(aR)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==ss?(this.config.cookieless_mode===si&&this.consent.isOptedIn()&&this.Tl(!0,!0),this.consent.optInOut(!1),this.Ho(),this.config.cookieless_mode===si&&(this.register({distinct_id:i4,$device_id:null}),null==(e=this.sessionRecording)||e.stopRecording(),this.sessionRecording=void 0,null==(t=this.sessionManager)||t.destroy(),null==(i=this.pageViewManager)||i.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,this.config.capture_pageview&&this.pl(),this.fl())):t9.warn(aR)}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 this.config.cookieless_mode===ss||(this.config.cookieless_mode===si?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Ho()}_is_bot(){return o?ar(o,this.config.custom_blocked_useragents):void 0}pl(){l&&("visible"===l.visibilityState?this.Go||(this.Go=!0,this.capture(su,{title:l.title},{send_instantly:!0}),this.Zo&&(l.removeEventListener(so,this.Zo),this.Zo=null)):this.Zo||(this.Zo=this.pl.bind(this),sw(l,so,this.Zo)))}debug(e){!1===e?(null==n||n.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==n||n.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}))}ka(){var e,t,i,s,r=this.Yo||{};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?(t9.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&&!el(r[e]),s=t in r&&!el(r[t]),i?r[e]:!!s&&(t9&&t9.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}En(e){if(el(this.config.before_send))return e;var t,i=Object.keys(null!=(t=e.properties)?t:{}).filter(ep),s=ee(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of s)try{if(r=n(r),el(r)){var a="Event '"+e.event+"' was rejected in beforeSend function";return ed(e.event)?t9.warn(a+". This can cause unexpected behavior."):t9.info(a),null}r.properties&&!es(r.properties)||t9.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}catch(t){return t9.error("Error in beforeSend function for event '"+e.event+"':",t),null}for(var o of i)if(r.properties&&el(r.properties[o]))return t9.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.Is)?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)})}Ko(e){var t=ec(e)&&!e,i=sj.Br()&&"true"===sj.Ur("ph_debug");return!t&&(!!i||e)}}aU.__defaultExtensionClasses={},aU.Il={trace:i=()=>{},debug:i,info:i,warn:i,error:i,fatal:i},function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=sm(e.prototype[t[i]])}(aU,["identify"]);class aB{constructor(e){this.disabled=!1===e;var t=ei(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}}var az="$copy_autocapture",aV=ie("[AutoCapture]");function aG(e,t){return t.length>e?t.slice(0,e)+"...":t}class aK{constructor(e){this.name="autocapture",this.es=!1,this.rs=null,this.ns=!1,this.ss=!1,this.Wi={enabled:!1,rageclick:!1,maskAllElementAttributes:!1,maskAllText:!1,disableCaptureUrlHashes:!1,remoteRequestsDisabled:!1},this.os=!1,this.ls=e,this.ls.refresh(this.Wi),this.rageclicks=new aB(this.Wi.rageclick),this.us=null}setup(e){this.hs(),this.ds=e;var t=e.onRemoteConfig(this.onRemoteConfig.bind(this));this.os?t.dispose():(this.vs=t,this.startIfEnabled())}dispose(){var e;this.os||(this.os=!0,this.ds=void 0,null==(e=this.vs)||e.dispose(),this.vs=void 0,this.cs())}fs(){return this.ls.refresh(this.Wi),this.Wi}hs(){var e,t;return this.fs(),this.Wi.url_allowlist=null==(e=this.Wi.url_allowlist)?void 0:e.map(e=>new RegExp(e)),this.Wi.url_ignorelist=null==(t=this.Wi.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),this.Wi}
2ps(){if(this.isBrowserSupported()){if(n&&l){var e=this.gs=e=>{e=e||(null==n?void 0:n.event);try{this.ys(e)}catch(e){aV.error("Failed to capture event",e)}};if(sw(l,"submit",e,{capture:!0}),sw(l,"change",e,{capture:!0}),sw(l,"click",e,{capture:!0}),this.fs().capture_copied_text){var t=this.bs=e=>{e=e||(null==n?void 0:n.event);try{this.ys(e,az)}catch(e){aV.error("Failed to capture clipboard event",e)}};sw(l,"copy",t,{capture:!0}),sw(l,"cut",t,{capture:!0}),sw(l,"paste",t,{capture:!0})}}}else aV.info("Disabling Automatic Event Collection because this browser is not supported")}cs(){this.gs&&(null==l||l.removeEventListener("submit",this.gs,!0),null==l||l.removeEventListener("change",this.gs,!0),null==l||l.removeEventListener("click",this.gs,!0),this.gs=void 0),this.bs&&(null==l||l.removeEventListener("copy",this.bs,!0),null==l||l.removeEventListener("cut",this.bs,!0),null==l||l.removeEventListener("paste",this.bs,!0),this.bs=void 0),this.es=!1}startIfEnabled(){!this.os&&this.ds&&this.isEnabled&&!this.es&&(this.ps(),this.es=!0)}onRemoteConfig(e){if(!this.os)if(this.ns=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this.ss=t.elementsChainAsString);var i,s=t.autocapture_opt_out;ec(s)&&(null==(i=this.ds)||i.kv.set(ip,s),this.rs=s),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this.us=e}getElementSelectors(e){var t,i=[];return null==(t=this.us)||t.forEach(t=>{var s=null==l?void 0:l.querySelectorAll(t);null==s||s.forEach(s=>{e===s&&i.push(t)})}),i}get isEnabled(){if(this.os)return!1;var e,t,i=null==(e=this.ds)?void 0:e.kv.get(ip),s=this.rs,r=this.fs(),n=r.remoteRequestsDisabled&&!this.ns;if(eo(s)&&!ec(i)&&!n)return!1;var a=null!=(t=this.rs)?t:!!i;return!!r.enabled&&!a}ys(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i=rt(e);s5(i)&&(i=i.parentNode||null);var s,r=this.hs();"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&r.rageclick&&null!=(s=this.rageclicks)&&s.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&rc(i,r.rageclick)&&this.ys(e,"$rageclick");var a=t===az,o=a?w({},r,{dom_event_allowlist:void 0}):r;if(i&&function(e,t,i,s,r,a){if(!n||rd(e)||null!=i&&i.url_allowlist&&!s8(i.url_allowlist,a)||null!=i&&i.url_ignorelist&&s8(i.url_ignorelist,a))return!1;if(null!=i&&i.dom_event_allowlist){var o,l=i.dom_event_allowlist;if(l&&!l.some(e=>t.type===e))return!1}var u=rp(e,s),h=u.parentIsUsefulElement,c=u.targetElementList;if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(er(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}(c,i)||!rs(c,null==i?void 0:i.css_selector_allowlist)||rs(c,null!=(o=null==i?void 0:i.css_selector_ignorelist)?o:rn))return!1;try{var d=n.getComputedStyle(e);if(d&&"pointer"===d.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 h?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(ri.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}(i,e,o,a,a?["copy","cut","paste"]:void 0,{config:{get_current_url:r.getCurrentUrl}})){var l,u=function(e,t){var i,s,r=t.e,a=t.maskAllElementAttributes,o=t.maskAllText,l=t.elementAttributeIgnoreList,u=t.elementsChainAsString,h=t.disableCaptureUrlHashes;if(!s2(e))return{props:{}};for(var c=[e],d=new Set([e]),p=e;p.parentNode&&!s3(p,"body")&&1e3>c.length;)if(s6(p.parentNode)){var v=p.parentNode.host;if(d.has(v))break;d.add(v),c.push(v),p=v}else{if(!s2(p.parentNode)||d.has(p.parentNode))break;d.add(p.parentNode),c.push(p.parentNode),p=p.parentNode}var g,f=[],_={},m=!1,y=!1;if(sv(c,e=>{var t=rv(e);if(s3(e,"a")){var i=e.getAttribute("href");m=!!(t&&i&&rx(i))&&(h?tm(i):i)}G(s7(e),"ph-no-capture")&&(y=!0),f.push(function(e,t,i,s,r){void 0===r&&(r=!1);var n=e.tagName.toLowerCase(),a={tag_name:n};ri.indexOf(n)>-1&&!i&&(a.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?aG(1024,rk(e)):aG(1024,re(e)));var o=s7(e);o.length>0&&(a.classes=o.filter(function(e){return""!==e})),sv(e.attributes,function(i){var n;if((!rg(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&
2!t&&rx(i.value)&&(!en(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=i.value;"class"===i.name&&(o=s4(o).join(" ")),a["attr__"+i.name]=aG(1024,"href"===i.name&&r?tm(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&&!s2(t))return t}(h);)l++,h.tagName===e.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(e,a,o,l,h)),sg(_,function(e){if(!rv(e))return{};var t={};return sv(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&&rx(s)&&(t[i]=s)}}),t}(e))}),y)return{props:{},explicitNoCapture:y};if(o||(f[0].$el_text=s3(e,"a")||s3(e,"button")?rk(e):re(e)),m){f[0].attr__href=m;var b,x,k=null==(b=rW(m))?void 0:b.host,E=null==n||null==(x=n.location)?void 0:x.host;k&&E&&k!==E&&(g=m)}return{props:sg({$event_type:r.type,$ce_version:1},u?{}:{$elements:f},{$elements_chain:f.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 ee(t)?t:s4(t)}(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return sf(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=w({},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 sf(n).sort((e,t)=>e[0].localeCompare(t[0])).forEach(e=>{var t=e[1];return a[rE(e[0].toString())]=rE(t.toString())}),(s+=":")+sf(a).map(e=>e[0]+'="'+e[1]+'"').join("")}).join(";")},null!=(i=f[0])&&i.$el_text?{$el_text:null==(s=f[0])?void 0:s.$el_text}:{},g&&"click"===r.type?{$external_click_url:g}:{},_)}}(i,{e:e,maskAllElementAttributes:r.maskAllElementAttributes,maskAllText:r.maskAllText,elementAttributeIgnoreList:r.element_attribute_ignorelist,elementsChainAsString:this.ss,disableCaptureUrlHashes:r.disableCaptureUrlHashes}),h=u.props;if(u.explicitNoCapture)return!1;var c=this.getElementSelectors(i);if(c&&c.length>0&&(h.$element_selectors=c),t===az){var d=e.type||"clipboard";if("paste"!==d){var p,v,g=null==n||null==(p=n.getSelection())?void 0:p.toString(),f=s9(g);if(!f)return!1;h.$selected_content=f,h.$clipboard_text_length=null!=(v=null==g?void 0:g.length)?v:0}h.$copy_type=d}return null==(l=this.ds)||l.capture(t,h).catch(e=>aV.error("Failed to capture event",e)),!0}}}isBrowserSupported(){return et(null==l?void 0:l.querySelectorAll)}}class aJ{constructor(e){this._instance=e}refresh(e){var t=this._instance.config,i=ei(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.ka(),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}}var aY=ie("[ExceptionAutocapture]"),aZ=()=>{},aX=ie("[TracingHeaders]"),aQ=ie("[Web Vitals]"),a0=["CLS","FCP","INP","LCP"],a1=["INP","LCP"],a2=["interactionTarget","interactionType","inputDelay","processingDuration","presentationDelay","loadState","target","url","timeToFirstByte","resourceLoadDelay","resourceLoadDuration","elementRenderDelay","largestShiftTarget","largestShiftTime","largestShiftValue","firstByteToFCP"],a3="disabled",a5="lazy_loading",a6="awaiting_config",a4="missing_config";ie("[SessionRecording]"),ie("[SessionRecording]");var a8="[SessionRecording]",a7=ie(a8),a9=ie("[Heatmaps]");function oe(e){return ei(e)&&"clientX"in e&&"clientY"in e&&eu(e.clientX)&&eu(e.clientY)}var ot=ie("[Product Tours]"),oi=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(iw))},os=["$set_once","$set"],or=ie("[SiteApps]"),on="Error while initializing PostHog app with config id ",oa=(e,t)=>null!=e&&e.then?e.then(t):t(e),oo="SDK is not enabled or survey functionality is not yet loaded",ol="Disabled. Not loading surveys.";class ou{constructor(e,t){this.name="surveys",this._surveyEventReceiver=null,this._surveyManager=null,this.Rl=!1,this.Pl=[],this.Al=null,this.Fl=null,this.os=!1,this.Ol=new Set,this.onRemoteConfig=e=>{if(!this.os&&!this.Wi.disableSurveys){if(!e.ok)return a_.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(el(t))return a_.warn("Flags not loaded yet. Not loading surveys.");this.Ll=ec(t)?t:t.length>0,a_.info("flags response received, isSurveysEnabled: "+this.Ll),this.loadIfEnabled()}},this.ls=e,this.Dl=t}setup(e){if(!this.os)return this.$l=e,oa(e.kv.initialize(),()=>{if(this.$l===e&&!this.os){this.$l=void 0,this.ds=e;var t=e.onRemoteConfig(this.onRemoteConfig);this.os?t.dispose():(this.vs=t,this.loadIfEnabled())}})}dispose(){var e,t,i;this.os||(this.os=!0,this.$l=void 0,this.ds=void 0,null==(e=this.vs)||e.dispose(),this.vs=void 0,null==(t=this._surveyEventReceiver)||t.dispose(),this._surveyEventReceiver=null,null==(i=this._surveyManager)||null==i.dispose||i.dispose(),this._surveyManager=null,this.Pl=[],this.Al=null,this.Ol.forEach(e
2=>clearTimeout(e)),this.Ol.clear())}get Wi(){return this.ls.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(am)||null!=s&&s.startsWith("inProgressSurvey_"))&&t.push(s)}t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this.os&&this.ds){var e=this.Wi;if(!this._surveyManager)if(this.Rl)a_.info("Already initializing surveys, skipping...");else if(e.disableSurveys)a_.info(ol);else if(e.cookielessMode&&this.ls.isOptedOut())a_.info("Not loading surveys in cookieless mode without consent.");else{var t=this.ls.getExtensions();if(t){if(!er(this.Ll)||e.advancedEnableSurveys){var i=this.Ll||e.advancedEnableSurveys;this.Rl=!0;try{var s=t.generateSurveys;if(s)return this.Nl(s,i),void(this.Rl=!1);var r=t.loadExternalDependency;if(!r)return this.ql(st),void(this.Rl=!1);r(e=>{try{if(this.os)return;var t=this.ls.getExtensions();e||null==t||!t.generateSurveys?this.ql("Could not load surveys script",e):this.Nl(t.generateSurveys,i)}finally{this.Rl=!1}})}catch(e){throw this.Rl=!1,this.ql("Error initializing surveys",e),e}}}else a_.error("PostHog Extensions not found.")}}}Nl(e,t){this.os||(this._surveyManager=e(t),this._surveyEventReceiver=this.ls.createEventReceiver(),a_.info("Surveys loaded successfully"),this.jl({isLoaded:!0}))}ql(e,t){a_.error(e,t),this.jl({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.Pl.push(e),this._surveyManager&&this.jl({isLoaded:!0}),()=>{this.Pl=this.Pl.filter(t=>t!==e)}}getSurveys(e,t){void 0===t&&(t=!1);var i,s=null!=(i=this.ds)?i:this.Dl;if(s&&!this.os){if(this.Wi.disableSurveys)return a_.info(ol),e([]);var r=s.kv.get(iU);if(r&&!t)return e(r,{isLoaded:!0}),void(this.Bl()&&this.getSurveys(()=>{},!0));if(this.Al)this.Al.then(t=>{this.os||e(t.surveys,t.context)}).catch(e=>a_.error("Error in survey callback",e));else{var n=this.Hl("/api/surveys/",{method:"GET",query:{token:s.projectToken},sentAt:"query",timeoutMs:this.Wi.requestTimeoutMs}).then(e=>{try{return this.Ul(s,e)}catch(e){return a_.error("Error processing surveys response",e),this.Ul(s,{statusCode:0,error:e})}},e=>this.Ul(s,{statusCode:0,error:e}));this.Al=n;var a=()=>{this.Al===n&&(this.Al=null)};n.then(t=>{a(),this.os||e(t.surveys,t.context)},a).catch(e=>a_.error("Error in survey callback",e))}}}Hl(e,t){var i=this.ds;return i?i.sendRequest(e,t):new Promise(e=>e({statusCode:0,error:Error(oo)}))}Ul(e,t){if(this.os)return{surveys:[],context:{isLoaded:!1,error:oo}};var i=t.statusCode;if(200!==i||!t.json){var s="Surveys API could not be loaded, status: "+i;return 0!==i?a_.error(s):t.error||a_.warn(s),this.Fl=Date.now(),{surveys:[],context:{isLoaded:!1,error:s}}}this.Fl=null;var r,n=t.json.surveys||[],a=n.filter(e=>{var t;return!(!e.start_date||e.end_date)&&(aa(e)||!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length))});return a.length>0&&(null==(r=this._surveyEventReceiver)||r.register(a)),e.kv.set({[iU]:n,[iB]:Date.now()}),{surveys:n,context:{isLoaded:!0}}}Bl(){return this.zl()&&!this.Al&&!this.Wl()}zl(){var e,t,i=null==(e=null!=(t=this.ds)?t:this.Dl)?void 0:e.kv.get(iB);return eu(i)&&Date.now()-i>3e5}Wl(){return eu(this.Fl)&&3e5>Date.now()-this.Fl}markSurveyAsSeen(e,t){var i;ay({id:e,current_iteration:null!=(i=null==t?void 0:t.iteration)?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}jl(e){for(var t of this.Pl)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){a_.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!el(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);a_.warn("init was not called")}Vl(e){var t=null;return this.getSurveys(i=>{var s;t=null!=(s=i.find(t=>t.id===e))?s:null}),t}Gl(e){if(el(this._surveyManager))return{eligible:!1,reason:oo};var t="string"==typeof e?this.Vl(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}Zl(e){if(el(this._surveyManager))return{eligible:!1,reason:oo};var t="string"==typeof e?this.Vl(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(el(this._surveyManager))return a_.warn("init was not called"),{visible:!1,disabledReason:oo};var t=this.Zl(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return el(this._surveyManager)?(a_.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:oo})):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.Zl(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(el(this._surveyManager))a_.warn("init was not called");else{var r="string"==typeof e?this.Vl(e):e;if(null!=r&&r.id)if(ab.includes(r.type)){var n=null==l?void 0:l.querySelector(t);if(n)if(null!=(s=r.appearance)&&s.surveyPopupDelaySeconds){a_.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds");var a=setTimeout(()=>{var e,t;this.Ol.delete(a),this.os||(a_.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),a_.info("Survey "+r.id+" rendered"))},1e3*r.appearance.surveyPopupDelaySeconds);this.Ol.add(a)}else this._surveyManager.renderSurvey(r,n,i);else a_.warn("Survey element not found")}else a_.warn("Surveys of type "+r.type+" cannot be rendered in the app");else a_.warn("Survey not found")}}displaySurvey(e,t){var i;if(el(this._surveyManager))a_.warn("init was not called");else{var s=this.Vl(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=w({},s,{appearance:w({},s.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==nl&&t.initialResponses&&a_.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.Gl(s);if(!n.eligible)return void a_.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 a_.warn("Survey not found")}}cancelPendingSurvey(e){el(this._surveyManager)?a_.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()}}function oh(e,t,i){if(el(e))return!1;switch(i){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class oc{constructor(e){this.Ql=new Set,this.Jl=new Set,this.Kl=new at,this.Yl=(e,t)=>this.Xl(e,t)&&this.tu(e,t)&&this.eu(e,t)&&this.iu(e,t),this.Xl=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e}init(){var e,t;er(null==(e=this._instance)?void 0:e._addCaptureHook)||(this.ru=null==(t=this._instance)?void 0:t._addCaptureHook((e,t)=>{this.on(e,t)}))}dispose(){var e;null==(e=this.ru)||e.call(this),this.ru=void 0,this.Kl=new at}register(e){var t,i;if(!er(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t;this.Ql.add(e),null==(t=e.steps)||t.forEach(e=>{this.Jl.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var s=new Set;this.Ql.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.Ql.clear(),this.Jl.clear(),this.register(e)}on(e,t){null!=t&&0!=e.length&&(this.Jl.has(e)||this.Jl.has(t.event))&&this.Ql.forEach(e=>{this.nu(t,e)&&this.Kl.emit("actionCaptured",e.name)})}su(e){this.onAction("actionCaptured",t=>e(t))}nu(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.Yl(e,i))return!0;return!1}onAction(e,t){return this.Kl.on(e,t)}tu(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||!oh(s,t.url,t.url_matching||"contains"))return!1}return!0}eu(e,t){return!!this.au(e,t)&&!!this.ou(e,t)&&!!this.lu(e,t)}au(e,t){if(null==t||!t.href)return!0;var i=this.uu(e);if(i.length>0)return i.some(e=>oh(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&&oh((r=n.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}ou(e,t){if(null==t||!t.text)return!0;var i=this.uu(e);if(i.length>0)return i.some(e=>oh(e.text,t.text,t.text_matching||"exact")||oh(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;!el(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=>oh(e,n,a)))}lu(e,t){if(null==t||!t.selector)return!0;var i,s,r=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null!=r&&r.includes(t.selector))return!0;var n=(null==e||null==(s=e.properties)?void 0:s.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}uu(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}iu(e,t){return null==t||!t.properties||0===t.properties.length||ah(t.properties.reduce((e,t)=>
vendor: 4,857 bytes, line 2
2{var i=ee(t.value)?t.value.map(String):null!=t.value?[String(t.value)]:[];return e[t.key]={values:i,operator:t.operator||"exact"},e},{}),null==e?void 0:e.properties)}}class od{constructor(e){var t;this.hu=[],this._instance=e,this.du=new Map,this.vu=new Map,this.cu=new Map,this.fu=null==(t=this._instance)||null==t.onSessionId?void 0:t.onSessionId(e=>this.pu(e))}gu(e){return!1}mu(){return null}yu(e){}bu(){}_u(e,t){return!!e&&ah(e.propertyFilters,null==t?void 0:t.properties)}wu(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}ku(e,t,i){var s=(i===ns?this.du:this.vu).get(e),r=[];return this.Su(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._u(n,t)})}register(e){this.xu(e,!1)}replace(e){this.xu(e,!0)}xu(e,t){var i;er(null==(i=this._instance)?void 0:i._addCaptureHook)||(this.Cu(e,t),this.Tu(e,t))}Tu(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.cu.clear(),0!==s.length){this.Mu||(this.Mu=new oc(this._instance),this.Mu.init(),this.Mu.su(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.cu.get(t.name))?i:[];s.includes(e.id)||s.push(e.id),this.cu.set(t.name,s)}})}),t?this.Mu.replace(r):this.Mu.register(r)}else t&&(null==(i=this.Mu)||i.replace([]))}Eu(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)})}Cu(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.wu(e,ns),a=this.wu(e,nr);t?(this.du=n,this.vu=a):(this.Eu(this.du,n),this.Eu(this.vu,a)),(0!==s.length||0!==r.length)&&(null!=this.ru||(this.ru=null==(i=this._instance)?void 0:i._addCaptureHook((e,t)=>{this.onEvent(e,t)})))}onEvent(e,t){var i,s,r=this.Iu(),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.Ru(e,n);if("consume"===a)return r.info("event consumed activated item, removing it",{event:e,itemId:n}),void this.Pu([n]);if("persist"===a)return r.info("shown item promoted to persisted activation",{event:e,itemId:n}),this.Au(n),void this.Fu([n])}if(this.vu.has(e)){var o=this.ku(e,t,nr);o.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:o.map(e=>e.id)}),this.Pu(o.map(e=>e.id)),o.forEach(e=>this.Ou(e.id)))}if(this.du.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.du.get(e)});var l=this.ku(e,t,ns);this.Lu(l.map(e=>e.id))}}onAction(e){this.cu.has(e)&&this.Lu(this.cu.get(e)||[])}Lu(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.gu(r)?this.Au(r)&&this.Du(r):s.push(r);s.length>0&&(this.hu=[...new Set([...this.hu,...s])]),this.Iu().info("updating activated items",{activatedItems:this.getActivatedIds()})}}Au(e){this.hu=this.hu.filter(t=>t!==e);var t=this.$u();return!t.includes(e)&&(this.Nu([...t,e]),this.qu(),!0)}Pu(e){var t=new Set(e);this.hu=this.hu.filter(e=>!t.has(e));var i=this.ju(),s=i.filter(e=>!t.has(e));s.length!==i.length&&(this.Nu(s),0===s.length&&this.Bu()),this.Fu(e)}Hu(){var e,t=this.mu();if(!t)return{};var i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t];return i&&"object"==typeof i?i:{}}Du(e){if(this.mu()){var t=this.Hu();this.yu(w({},t,{[e]:Date.now()}))}}Fu(e){if(this.mu()){var t=this.Hu(),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&&(es(i)?this.bu():this.yu(i))}}Uu(){this.mu()&&this.bu()}getActivationTimestamp(e){if(this.$u().includes(e)){var t=this.Hu()[e];return eu(t)?t:void 0}}ju(){var e,t=this.zu();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}$u(){var e,t,i=this.ju();if(0===i.length)return[];var s=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this.Wu()],r=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return r&&s===r?i:[]}qu(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this.Vu(t)}Bu(){this.Gu()}pu(e){var t,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this.Wu()];if(i&&i!==e){var s=this.ju(),r=this.Hu();s.length>0&&(this.Nu([]),s.filter(e=>
2eu(r[e])).forEach(e=>this.Ou(e))),this.Bu(),this.Uu()}}getActivatedIds(){return[...new Set([...this.$u(),...this.hu])].filter(e=>!this.Zu(e))}dispose(){var e,t,i;null==(e=this.fu)||e.call(this),this.fu=void 0,null==(t=this.ru)||t.call(this),this.ru=void 0,null==(i=this.Mu)||i.dispose(),this.Mu=void 0}reset(){this.hu=[],this.ju().length>0&&this.Nu([]),this.Bu(),this.Uu()}getEventToItemsMap(){return this.du}Qu(){return this.Mu}}class op extends od{constructor(e){super(e)}zu(){return iz}Wu(){return iV}mu(){return iG}yu(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iG]:e})}bu(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(iG)}gu(e){this.Su(t=>{i=t.find(t=>t.id===e)});var t,i,s=null==(t=i)||null==(t=t.appearance)?void 0:t.surveyPopupDelaySeconds;return eu(s)&&s>0}Ju(){return nn}Su(e){var t;null==(t=this._instance)||t.getSurveys(e)}Ou(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}Iu(){return a_}Nu(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iz]:e})}Vu(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iV]:e})}Gu(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(iV)}Zu(){return!1}Ru(e,t){var i,s,r;return this.Su(e=>{r=e.find(e=>e.id===t)}),!r||aa(i=r)&&!(null==(s=i.conditions)||null==(s=s.events)||!s.repeatedActivation)||"always"===i.schedule?e===nn?"consume":"ignore":e===nn?"persist":e===na||e===no?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class ov{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);er(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)}}class og{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==_?void 0:_.__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 op(this._instance)}}var of=null!=n&&n.location?rq(n.location.hash,"__posthog")||rq(location.hash,"state"):null,o_="_postHogToolbarParams",om=ie("[Toolbar]"),oy=ie("[FeatureFlags]");class ob{constructor(e,t){void 0===t&&(t=!1),this.Ku=!1,this.update(e,t)}update(e,t){var i,s,r,n,a;this.Yu={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?"none":"base64",evaluationContexts:null!=(n=null!=(a=e.evaluation_contexts)?a:e.evaluation_environments)?n:[],flagKeys:ee(e.flag_keys)?e.flag_keys:void 0},!e.evaluation_environments||e.evaluation_contexts||this.Ku||(oy.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Ku=!0),er(e.flag_keys)||ee(e.flag_keys)||oy.error("Invalid flag_keys found:",e.flag_keys,"Expected array of non-empty strings")}get(){return this.Yu}}var ow=ie("[FeatureFlags]"),ox=ie("[FeatureFlags]",{debugEnabled:!0}),ok="\" failed. Feature flags didn't load in time.",oE="connection_error",oS=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},oP=e=>{var t={};for(var i of sf(e||{})){var s=i[1];s&&(t[i[0]]=s)}return t},oI=ie("[Error tracking]"),oF=["chrome-extension://","moz-extension://","safari-extension:","safari-web-extension:"],oC=["__firefox__","__gCrWeb"],oT="Refusing to render web experiment since the viewer is a likely bot",o$={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>ao(t,e),not_regex:(e,t)=>!ao(t,e),exact:(e,t)=>
2t===e,is_not:(e,t)=>t!==e};class oR{get Wi(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{oR.Xu("retrieved web experiments from the server"),t.th=new Map,e.forEach(e=>{if(e.feature_flag_key){t.th&&(oR.Xu("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.th)||i.set(e.feature_flag_key,e));var i,s=t._instance.getFeatureFlag(e.feature_flag_key);en(s)&&e.variants[s]&&t.eh(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];oR.ih(n,t._instance)&&t.eh(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())oR.Xu(oT);else if(!this.Wi.disable_web_experiments){if(el(this.th))return this.th=new Map,this.loadIfEnabled(),void this.previewWebExperiment();oR.Xu("applying feature flags",e),e.forEach(e=>{var t;if(this.th&&null!=(t=this.th)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.th)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.eh(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=oR.getWindowLocation();if(null!=e&&e.search){var t=rN(null==e?void 0:e.search,"__experiment_id"),i=rN(null==e?void 0:e.search,"__experiment_variant");t&&i&&(oR.Xu("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.rh(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.Wi.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.Wi.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.Wi.token),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}rh(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(oR.Xu("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.eh(s[0].name,t,s[0].variants[t].transforms))}static ih(e,t){return!el(e.conditions)&&oR.nh(e,t)&&oR.sh(e)}static nh(e,t){if(el(e.conditions)||el(null==(s=e.conditions)?void 0:s.url))return!0;var i=oR.getWindowLocation();if(i){var s,r,n,a,o=sQ(t,i.href);return null==(r=e.conditions)||!r.url||o$[null!=(n=null==(a=e.conditions)?void 0:a.urlMatchType)?n:"icontains"](e.conditions.url,o)}return!1}
2static getWindowLocation(){return null==n?void 0:n.location}static sh(e){if(el(e.conditions)||el(null==(i=e.conditions)?void 0:i.utm))return!0;var t=rY();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 Xu(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];t9.info("[WebExperiments] "+e,i)}eh(e,t,i){this._is_bot()?oR.Xu(oT):"control"!==t?i.forEach(i=>{if(i.selector){oR.Xu("applying transform of variant "+t+" for experiment "+e+" ",i);var s,r=null==(s=document)?void 0:s.querySelectorAll(i.selector);null==r||r.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):oR.Xu("Control variants leave the page unmodified.")}_is_bot(){return o&&this._instance?ar(o,this.Wi.custom_blocked_useragents):void 0}}var oO=ie("[Conversations]"),oM="Conversations not available yet.",oL="console",oA="__posthogHandledLogsRequestError",oD=(e,t)=>{var i=e instanceof Error?e:Error(t);return i[oA]=!0,i},oj=e=>!!e&&"object"==typeof e&&!0===e[oA],oW={featureFlags:class{constructor(e){this.name="featureFlags",this.ah=!1,this.featureFlagEventHandlers=[],this.I=ow,this.oh={},this.lh={},this.uh=[],this.hh=!1,this.dh=!1,this.fh=0,this.ph=!1,this.gh=!1,this.mh=!1,this.yh=!1,this.bh=0,this.It=()=>{var e=this._h();this.bh=0,e&&this.reloadFeatureFlags()},this.wh=()=>{var e,t=this.kh;er(t)||this.Wi.remoteRequestsDisabled||!l||"hidden"===l.visibilityState||Date.now()-(null!=(e=this.Sh)?e:0)<t||(this.reloadFeatureFlags(),this.xh())},this.Et=()=>{"visible"===(null==l?void 0:l.visibilityState)&&this.wh()},"get"in e?this.ls=e:(this.Ch=new ob(e.config,e.ka()),this.ls=this.Ch)}updateConfig(e,t){var i;null==(i=this.Ch)||i.update(e,t),this.ds&&this.Th()}setup(e){return this.$l=e,this.I=e.logger.createLogger("[FeatureFlags]"),oa(e.kv.initialize(),()=>{this.$l===e&&(this.$l=void 0,this.ds=e,this.Mh(e))})}Mh(e){if(this.ds===e)return n&&sw(n,"online",this.It),this.Th(),this.Eh=e.registerDynamicEventProperties(()=>this.Ih()?this.oh:this.lh),this.Rh(),this.initialize()}Th(){var e=this.Wi.refreshIntervalMs,t=!this.Wi.remoteRequestsDisabled&&l&&!er(e)&&e>0?e:void 0;t!==this.kh&&(this.Ph(),er(t)||(this.kh=t,this.xh(),null!=l&&l.addEventListener&&sw(l,so,this.Et)))}xh(){er(this.kh)||(er(this.Ah)||clearInterval(this.Ah),this.Sh=Date.now(),this.Ah=setInterval(this.wh,this.kh))}Ph(){er(this.Ah)||(clearInterval(this.Ah),this.Ah=void 0,null==l||null==l.removeEventListener||l.removeEventListener(so,this.Et)),this.kh=void 0,this.Sh=void 0}destroy(){this.Fh()}dispose(){this.Fh()}Fh(){var e;this.Ph(),this.fh++,this.gh=!1,this.$l=void 0,this.ds&&(this.Oh(),null==(e=this.Eh)||e.dispose(),this.Eh=void 0,this.uh=[],null==n||n.removeEventListener("online",this.It),this.ds=void 0)}get Wi(){return this.ls.get()}Lh(e){var t;return null==(t=this.ds)?void 0:t.kv.get(e)}Hr(e){this.Dh(()=>{var t;return null==(t=this.ds)?void 0:t.kv.set(e)})}$r(e){this.Dh(()=>{var t;return null==(t=this.ds)?void 0:t.kv.remove(e)})}Dh(e){try{e()}catch(e){this.I.error("Failed to update feature flag persistence",e)}}Rh(){var e={};for(var t of[iR,iL,iA,ij]){var i=this.Lh(t);er(i)||(e[t]=i)}this.oh=e;var s=w({},e),r=this.Lh(i$);if(r)for(var n of Object.entries(r))s["$feature/"+n[0]]=n[1];this.lh=s}Ih(){var e=this.Wi.cacheTtlMs;if(!e||0>=e)return!1;var t=this.Lh(iX);return"number"!=typeof t||Date.now()-t>e}$h(){return!!this.Ih()&&(this.yh||this.dh||(this.yh=!0,this.I.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Nh(){var e=this.Wi.evaluationContexts;return null!=e&&e.length?e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.I.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}qh(){var e=this.Wi.flagKeys;if(!er(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||this.I.error("Invalid flag key found:",e,"Expected non-empty string"),t})}initialize(){var e,t,i=this.Wi,s=null!=(e=null==(t=i.bootstrap)?void 0:t.featureFlags)?e:{};
2if(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=>!!s[e]).reduce((e,t)=>(e[t]=s[t]||!1,e),{}),l=Object.keys(a).filter(e=>o[e]).reduce((e,t)=>(e[t]=a[t],e),{});return this.jh({featureFlags:o,featureFlagPayloads:l})}}updateFlags(e,t,i){var s,r,n=null!=i&&i.merge&&null!=(s=this.Lh(i$))?s:{},a=null!=i&&i.merge&&null!=(r=this.Lh(iL))?r:{},o=w({},n,e),l=w({},a,t),u={};for(var h of Object.entries(o)){var c=h[0],d=h[1];u[c]={key:c,enabled:E(d),variant:S(d),reason:void 0,metadata:er(null==l?void 0:l[c])?void 0:{id:0,version:void 0,description:void 0,payload:l[c]}}}this.jh({flags:u})}get hasLoadedFlags(){return this.hh}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.Lh(iM),t=this.Lh(ij),i=this.Lh(iW);if(!i&&!t)return e||{};var s=sg({},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],u=er(l)?null!=(n=null==o?void 0:o.enabled)&&n:!!l,h=er(l)?null==o?void 0:o.variant:"string"==typeof l?l:void 0,c=null==i?void 0:i[r],d=w({},o,{enabled:u,variant:u?null!=h?h:null==o?void 0:o.variant:void 0});u!==(null==o?void 0:o.enabled)&&(d.original_enabled=null==o?void 0:o.enabled),h!==(null==o?void 0:o.variant)&&(d.original_variant=null==o?void 0:o.variant),c&&(d.metadata=w({},null==o?void 0:o.metadata,{payload:c,original_payload:null==o||null==(a=o.metadata)?void 0:a.payload})),s[r]=d}return this.ah||(this.I.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.ah=!0),s}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{var s=e[i];return{key:i,enabled:E(s),variant:S(s),payload:k(t[i])}})}getFlagVariants(){var e=this.Lh(i$),t=this.Lh(ij);if(!t)return e||{};for(var i=sg({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.ah||(this.I.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.ah=!0),i}getFlagPayloads(){var e=this.Lh(iL),t=this.Lh(iW);if(!t)return e||{};for(var i=sg({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.ah||(this.I.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.ah=!0),i}reloadFeatureFlags(){this.ph||this.Wi.featureFlagsDisabled||this._h()||this.Bh||(this.uh.slice().forEach(e=>{try{e()}catch(e){this.I.error("Error while running feature flags reloading callback",e)}}),this.Bh=setTimeout(()=>{this.Hh()},5))}Oh(){clearTimeout(this.Bh),this.Bh=void 0}onReloading(e){return this.uh.push(e),()=>{this.uh=this.uh.filter(t=>t!==e)}}ensureFlagsLoaded(){this.hh||this.dh||this.Bh||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.ph=e}resetFlagCallReported(){this.$r(iJ)}Hh(e){this.Oh();var t=this.ds;if(t&&!this.Wi.remoteRequestsDisabled&&!this._h())if(this.dh)this.gh=!0;else{var i={token:t.projectToken,distinct_id:t.distinctId,groups:t.groups,$anon_distinct_id:this.$anon_distinct_id,person_properties:w({},t.initialPersonProperties,this.Lh(iN)||{},{$lib:t.library.name,$lib_version:t.library.version}),group_properties:this.Lh(iH),timezone:r5()};er(t.deviceId)||(i.$device_id=t.deviceId),(null!=e&&e.disableFlags||this.Wi.featureFlagsDisabled)&&(i.disable_flags=!0);var s=this.Nh();s.length&&(i.evaluation_contexts=s);var r=this.qh();er(r)||(i.flag_keys=r);var n=this.Wi.onlyEvaluateSurveyFeatureFlags,a=this.fh;this.dh=!0;var o=()=>{this.gh&&(this.gh=!1,this.Hh())},l=e=>{this.dh=!1,a===this.fh&&(this.Hr({[iZ]:[oE]}),this.I.error("Feature flag request failed",e)),o()};try{t.sendRequest("/flags/?v=2"+(n?"&only_evaluate_survey_feature_flags=true":""),{target:"flags",method:"POST",body:i,compression:"base64"===this.Wi.compression?ni:void 0,sentAt:"body",timeoutMs:this.Wi.requestTimeoutMs}).then(e=>{var t,s,r=null!=(t=e.json)?t:{},l=200!==e.statusCode;if(this.dh=!1,a===this.fh){if(this.Uh(e.statusCode),l||this.gh||(this.$anon_distinct_id=void 0),!i.disable_flags||this.gh){this.mh=!l;var u=[];e.error?u.push(e.error instanceof Error&&"AbortError"===e.error.name?"timeout":e.error instanceof Error?oE:"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.Hr({[iZ]:u}),h?this.I.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.jh(r,l,{partialResponse:n}),o()}}else o()}).catch(l)}catch(e){l(e)}}}_h(){return rU(this.bh,3)}Uh(e){this.bh=rB(e,this.bh,3,()=>this.I.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.mh)if(this.hh||this.getFlags()&&this.getFlags().length>0){if(!this.$h()){var s=this.getFeatureFlagResult(e,t);return null!=(i=null==s?void 0:s.variant)?i:null==s?void 0:s.enabled}}else this.I.warn('getFeatureFlag for key "'+e+ok)}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var t=this.getFeatureFlagResult(e,{send_event:!1});return null==t?void 0:t.payload}getFeatureFlagResult(e,t){if(void 0===t&&(t={}),!t.fresh||this.mh)if(this.hh||this.getFlags()&&this.getFlags().length>0){if(!this.$h()){var i,s=this.getFlagVariants(),r=e in s,n=s[e],a=this.getFlagPayloads()[e],o=String(n),l=this.Lh(iA)||void 0,u=this.Lh(iX)||void 0,h=this.Lh(iJ)||{};if(this.Wi.deduplicateCallsPerSession){var c,d=null==(c=this.ds)?void 0:c.session.sessionId,p=this.Lh(iY);d&&d!==p&&(h={},i=d)}if(!t.send_event&&"send_event"in t)i&&this.Hr({[iJ]:h,[iY]:i});else if(e in h&&h[e].includes(o))i&&this.Hr({[iJ]:h,[iY]:i});else{ee(h[e])?h[e].push(o):h[e]=[o],this.Hr(w({[iJ]:h},i?{[iY]:i}:{}));var v=this.getFeatureFlagDetails(e),g=[...null!=(_=this.Lh(iZ))?_:[]];er(n)&&g.push("flag_missing");var f={$feature_flag:e,$feature_flag_response:n,$feature_flag_payload:null!=a?a:null,$feature_flag_request_id:l,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:null!=(m=null==(y=this.Wi.bootstrap)||null==(y=y.featureFlags)?void 0:y[e])?m:null,$feature_flag_bootstrapped_payload:null!=(b=null==(x=this.Wi.bootstrap)||null==(x=x.featureFlagPayloads)?void 0:x[e])?b:null,$used_bootstrap_value:!this.mh};er(null==v||null==(E=v.metadata)?void 0:E.has_experiment)||(f.$feature_flag_has_experiment=v.metadata.has_experiment),er(null==v||null==(S=v.metadata)?void 0:S.version)||(f.$feature_flag_version=v.metadata.version);var _,m,y,b,x,E,S,P,I,F,C,T,$,R=null!=(P=null==v||null==(I=v.reason)?void 0:I.description)?P:null==v||null==(F=v.reason)?void 0:F.code;R&&(f.$feature_flag_reason=R),null!=v&&null!=(C=v.metadata)&&C.id&&(f.$feature_flag_id=v.metadata.id),er(null==v?void 0:v.original_variant)&&er(null==v?void 0:v.original_enabled)||(f.$feature_flag_original_response=er(v.original_variant)?v.original_enabled:v.original_variant),null!=v&&null!=(T=v.metadata)&&T.original_payload&&(f.$feature_flag_original_payload=null==v||null==($=v.metadata)?void 0:$.original_payload),g.length&&(f.$feature_flag_error=g.join(",")),this.zh(f)}if(r)return{key:e,enabled:!!n,variant:"string"==typeof n?n:void 0,payload:k(a)}}}else this.I.warn('getFeatureFlagResult for key "'+e+ok)}zh(e){try{var t;null==(t=this.ds)||t.capture("$feature_flag_called",e).catch(e=>{this.I.error("Failed to capture feature flag call",e)}
2)}catch(e){this.I.error("Failed to capture feature flag call",e)}}getRemoteConfigPayload(e,t){this.Wh(e,t)}Wh(e,t){var i=this;return b(function*(){var s=i.ds;if(s){var r={distinct_id:s.distinctId,token:s.projectToken,person_properties:{$lib:s.library.name,$lib_version:s.library.version}},n=i.Nh();n.length&&(r.evaluation_contexts=n);var a,o=i.qh();er(o)||(r.flag_keys=o);try{var l,u=null==(l=(yield s.sendRequest("/flags/?v=2",{target:"flags",method:"POST",body:r,compression:"base64"===i.Wi.compression?ni:void 0,sentAt:"body",timeoutMs:i.Wi.requestTimeoutMs})).json)?void 0:l.featureFlagPayloads;a=(null==u?void 0:u[e])||void 0}catch(e){return void i.I.error("Remote config feature flag request failed",e)}try{t(a)}catch(e){i.I.error("Remote config feature flag callback failed",e)}}})()}isFeatureEnabled(e,t){if(void 0===t&&(t={}),t.fresh&&!this.mh)return t.defaultValue;if(!(this.hh||this.getFlags()&&this.getFlags().length>0))return this.I.warn('isFeatureEnabled for key "'+e+ok),t.defaultValue;var i=this.getFeatureFlag(e,t);return er(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.jh(e,t,i)}jh(e,t,i){if(this.ds){this.hh=!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=ow);var a,o,l=(a=n,(o=e.flags)?w({},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 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)),u=l.flags,h=l.featureFlags,c=l.featureFlagPayloads;if(h){var d=e.requestId,p=e.evaluatedAt;if(ee(h)){n.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var v={};if(h)for(var g=0;h.length>g;g++)v[h[g]]=!0;return{[iR]:h,[i$]:v,[iD]:!1}}var f=h,_=c,m=u;if(null!=r&&r.partialResponse)f=w({},t,f),_=w({},i,_),m=w({},s,m);else if(e.errorsWhileComputingFlags)if(u){var y=new Set(Object.keys(u).filter(e=>{var t;return!(null!=(t=u[e])&&t.failed)}));f=w({},t,Object.fromEntries(Object.entries(f).filter(e=>y.has(e[0])))),_=w({},i,Object.fromEntries(Object.entries(_||{}).filter(e=>y.has(e[0])))),m=w({},s,Object.fromEntries(Object.entries(m||{}).filter(e=>y.has(e[0]))))}else f=w({},t,f),_=w({},i,_),m=w({},s,m);return w({[iR]:Object.keys(oP(f)),[i$]:f||{},[iL]:_||{},[iM]:m||{},[iD]:!0===e.minimalFlagCalledEvents},d?{[iA]:d}:{},p?{[iX]:p}:{})}}(e,this.getFlagVariants(),this.getFlagPayloads(),this.getFlagsWithDetails(),i,this.I);s&&this.Hr(s),t||(this.yh=!1),this.Vh(t)}}override(e,t){void 0===t&&(t=!1),this.I.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){this.Gh(e)}Gh(e){if(this.ds){if(!1===e)return this.$r([ij,iW]),this.Vh(),void ox.info("All overrides cleared");if(ee(e))return this.Hr({[ij]:oS(e)}),this.Vh(),void ox.info("Flag overrides set",{flags:e});if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){this.ah=!!(null!=(t=e.suppressWarning)&&t);var t,i={},s=e.flags,r=e.payloads;return s&&(i[ij]=ee(s)?oS(s):s),r&&(i[iW]=r),Object.keys(i).length&&this.Hr(i),!1===s&&!1===r?this.$r([ij,iW]):!1===s?this.$r(ij):!1===r&&this.$r(iW),this.Vh(),!1===s?ox.info("Flag overrides cleared"):s&&ox.info("Flag overrides set",{flags:s}),void(!1===r?ox.info("Payload overrides cleared"):r&&ox.info("Payload overrides set",{payloads:r}))}if(e&&"object"==typeof e)return this.Hr({[ij]:e}),this.Vh(),void ox.info("Flag overrides set",{flags:e});this.I.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}else this.I.warn("posthog.featureFlags.overrideFeatureFlags called before feature flags were ready")}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.hh){var t=this.Zh(),i=t.flags,s=t.flagVariants;try{e(i,s)}catch(e){this.I.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r=(this.Lh(iO)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:n};r&&(a.$early_access_feature_name=r.name),i&&(a.$feature_enrollment_stage=i);var o=w({},this.getFlagVariants(),{[e]:t});
2this.Hr({[iR]:Object.keys(oP(o)),[i$]:o,[iN]:w({},this.Lh(iN)||{},n)}),this.Vh();try{null==(s=this.ds)||s.capture("$feature_enrollment_update",a).catch(e=>{this.I.error("Failed to capture early access feature enrollment",e)})}catch(e){this.I.error("Failed to capture early access feature enrollment",e)}}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this.Lh(iO);!s||t?this.Qh(e,i):e(s)}Qh(e,t){var i=this;return b(function*(){var s=i.ds;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;i.Hr({[iO]:r=a.json.earlyAccessFeatures})}catch(e){return void i.I.error("Early access feature request failed",e)}try{e(r)}catch(e){i.I.error("Early access feature callback failed",e)}}})()}Zh(){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),{})}}Vh(e){this.Rh();var t=this.Zh(),i=t.flags,s=t.flagVariants;this.featureFlagEventHandlers.forEach(t=>{try{t(i,s,{errorsLoading:e})}catch(e){this.I.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0),this.Jh(e,t)}Jh(e,t){void 0===t&&(t=!0);var i=this.Lh(iN)||{},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.Hr({[iN]:w({},i,n,s)}),t&&this.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=w({},this.Lh(iN)||{});e.forEach(e=>{delete i[e]}),this.Hr({[iN]:i}),t&&this.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this.$r(iN),e&&this.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.Lh(iH)||{},s=w({},i);for(var r of Object.keys(e))s[r]=w({},i[r],e[r]);this.Hr({[iH]:s}),t&&this.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.Lh(iH)||{};this.Hr({[iH]:w({},t,{[e]:{}})})}else this.$r(iH)}reset(){this.fh++,this.gh=!1,this.oh={},this.lh={},this.hh=!1,this.ph=!1,this.mh=!1,this.$anon_distinct_id=void 0,this.Oh(),this.ah=!1,this.bh=0}}},oN=w({productTours:class{get Za(){return this._instance.persistence}constructor(e){this.hv=null,this.dv=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t,i,s=e.config;if("productTours"in s){if(this.Za&&this.Za.register({[iw]:!!s.productTours}),!oi(this._instance))return!this.hv&&el(null==(t=this.Za)?void 0:t.props[iK])||ot.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.hv)||i.stop(),this.hv=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.hv&&oi(this._instance)&&this.Ts(()=>this.vv())}Ts(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?ot.error("Could not load product tours script",t):e()})}vv(){var e;!this.hv&&null!=(e=_.__PosthogExtensions__)&&e.generateProductTours&&(this.hv=_.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!ee(this.dv)||t){var i=this.Za;if(i){var s=i.props[iK];if(ee(s)&&!t)return this.dv=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(oi(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||ot.warn(r):ot.error(r),void e([],{isLoaded:!1,error:r})}var n=ee(t.json.product_tours)?t.json.product_tours:[];this.dv=n,i&&i.register({[iK]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.dv,{isLoaded:!0})}getActiveProductTours(e){el(this.hv)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.hv.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.hv)||t.showTourById(e)}previewTour(e){this.hv?this.hv.previewTour(e):this.Ts(()=>{var t;this.vv(),null==(t=this.hv)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.hv)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.hv)||e.nextStep()}previousStep(){var e;null==(e=this.hv)||e.previousStep()}clearCache(){var e;this.dv=null,null==(e=this.Za)||e.unregister(iK)}resetTour(e){var t;null==(t=this.hv)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.hv)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.hv)||t.cancelPendingTour(e)}}},oW),oH=w({surveys:class extends ou{constructor(e){var t;super(new og(e),{get projectToken(){return t.config.token},kv:new ov(t=e)}),this._instance=e}Hl(e,t){var i=t.query?nK(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})})}}},oW),oq=w({experiments:oR},oW),oU=w({},oW,{sessionRecording:class{get Wi(){return this._instance.config}get Za(){return this._instance.persistence}get started(){var e;return!(null==(e=this.Kh)||!e.isStarted)}get status(){var e,t;return this.Yh===a6||this.Yh===a4?this.Yh:null!=(e=null==(t=this.Kh)?void 0:t.status)?e:this.Yh}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Yh=a3,this.Xh=void 0,this.td=!1,this._t=(()=>
2{if(null==l||!l.visibilityState||"visible"===l.visibilityState)return!0;var e,t=null==n||null==(e=n.performance)||null==e.getEntriesByType?void 0:e.getEntriesByType("visibility-state");return!(null!=t&&t.length)||t.some(e=>"visible"===e.name)})(),this.Et=()=>{var e;"visible"===(null==l?void 0:l.visibilityState)&&(this._t=!0,null==(e=this.Kh)||null==e.setDocumentWasEverVisible||e.setDocumentWasEverVisible(!0))},this._instance=e,!this._instance.sessionManager)throw a7.error("started without valid sessionManager"),Error(a8+" started without valid sessionManager. This is a bug.");if(this.Wi.cookieless_mode===ss)throw Error(a8+' cannot be used with cookieless_mode="always"');null!=l&&l.addEventListener&&sw(l,"visibilitychange",this.Et)}initialize(){this.startIfEnabledOrStop()}dispose(){this.td=!0,null==l||null==l.removeEventListener||l.removeEventListener("visibilitychange",this.Et),this.stopRecording()}get ed(){var e,t=!(null==(e=this._instance.get_property(ik))||!e.enabled),i=!this.Wi.disable_session_recording,s=this.Wi.disable_session_recording||this._instance.consent.isOptedOut();return n&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!(this.td||this.ed&&null!=(t=this.Kh)&&t.isStarted)){var i=!er(Object.assign)&&!er(Array.from);this.ed&&i?(this.rd(e),a7.info("starting")):(this.Yh=a3,this.stopRecording())}}rd(e){var t,i,s;this.ed&&(this.Yh!==a6&&this.Yh!==a4&&(this.Yh=a5),null!=_&&null!=(t=_.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=_.__PosthogExtensions__)&&i.initSessionRecording?this.nd(e):null==(s=_.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.sd,t=>{if(t)return this._instance.register_for_session({[se]:!0}),a7.error("could not load recorder",t);this.nd(e)}))}stopRecording(){var e,t;null==(e=this.Xh)||e.call(this),this.Xh=void 0,null==(t=this.Kh)||t.stop()}ad(){var e,t;null==(e=this.Xh)||e.call(this),this.Xh=void 0,null==(t=this.Kh)||t.discard()}od(){var e,t;null==(e=this.Za)||e.unregister(iT),null==(t=this.Za)||t.unregister(iE)}ld(e,t){if(el(e))return null;var i=eu(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(a7.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}ud(e){if(this.Za){var t,i,s=this.Za,r=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.ld(null==(t=this.Wi.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.ld(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=r?r:n;el(a)&&this.od();var o=null==i?void 0:i.minimumDurationMilliseconds;s.register({[ik]:w({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:w({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:er(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.Xh)||t.call(this),this.Xh=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.ud(t),void this.ad()):(this.ud(t),void this.startIfEnabledOrStop()):(this.Yh===a6&&(this.Yh=a4,a7.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.Kh)&&i.log?this.Kh.log(e,t):a7.warn("log called before recorder was ready")}get sd(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(ik);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}hd(){var e,t=this._instance.get_property(ik);if(!t)return!1;try{e="object"==typeof t?t:JSON.parse(t)}catch(e){return a7.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}
vendor: 11,238 bytes, line 2
2return!el(e.cache_timestamp)&&36e5>=Date.now()-e.cache_timestamp}nd(e){var t,i,s,r;if(!this.td){if(null==(t=_.__PosthogExtensions__)||!t.initSessionRecording)return a7.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[se]:!0});if(this.Kh||(this.Kh=null==(r=_.__PosthogExtensions__)?void 0:r.initSessionRecording(this._instance,this._t),this.Kh._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.hd()){if(this.Yh===a4||this.Yh===a6)return;return this.Yh=a6,a7.info("persisted remote config is stale, requesting fresh config before starting"),void new nd(this._instance).load()}this.Yh=a5,null==(i=(s=this.Kh).setDocumentWasEverVisible)||i.call(s,this._t),this.Kh.start(e)}}onRRwebEmit(e){var t;null==(t=this.Kh)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Kh||null==(t=this.Za)||t.register({[iP]:!0}),null==(e=this.Kh)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Kh||null==(t=this.Za)||t.register({[iS]:!0}),null==(e=this.Kh)||e.overrideSampling()}overrideTrigger(e){var t,i;this.Kh||null==(i=this.Za)||i.register({["url"===e?iI:iF]:!0}),null==(t=this.Kh)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.Kh)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.Kh)||!i.tryAddCustomEvent(e,t))}}},{autocapture:class extends aK{constructor(e){super(new aJ(e)),this.instance=e}},historyAutocapture:class{constructor(e){this._instance=e,this.dd=this.vd()}initialize(){this.startIfEnabled()}get isEnabled(){var e=this.fd();return!!(e.path||e.search||this.pd(e))}startIfEnabled(){this.isEnabled&&(t9.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}startIfEnabledOrStop(){this.stop(),this.dd=this.vd(),this.startIfEnabled()}stop(){this.gd&&this.gd(),this.gd=void 0,this.md&&this.md(),this.md=void 0,t9.info("History API monitoring stopped")}monitorHistoryChanges(){n&&n.history&&(this.yd("pushState"),this.yd("replaceState"),this.bd(),this.pd()&&this._d())}yd(e){var t;if(n&&(null==(t=n.history[e])||!t.__posthog_wrapped__)){var i=this;!function(e,t,i){try{if(!(t in e))return aZ;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)});et(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:s}})),e[t]=r}catch(e){return aZ}}(n.history,e,t=>function(s,r,n){t.call(this,s,r,n),i.wd(e)})}}vd(){var e=null==n?void 0:n.location;if(null!=e&&e.pathname)return{pathname:e.pathname,search:e.search,hash:e.hash}}fd(){var e=this._instance.config.capture_pageview;return"history_change"===e?{path:!0}:ei(e)?e:{}}pd(e){return void 0===e&&(e=this.fd()),!!e.hash&&!this._instance.config.disable_capture_url_hashes}kd(e){var t=this.fd(),i=this.dd;return!(!i||!(t.path&&e.pathname!==i.pathname||t.search&&e.search!==i.search||this.pd(t)&&e.hash!==i.hash))}wd(e){try{var t=this.vd();if(!t)return;this.kd(t)&&this._instance.capture(su,{navigation_type:e}),this.dd=t}catch(t){t9.error("Error capturing "+e+" pageview",t)}}bd(){if(!this.gd){var e=()=>{this.wd("popstate")};sw(n,"popstate",e),this.gd=()=>{n&&n.removeEventListener("popstate",e)}}}_d(){if(!this.md){var e=()=>{this.wd("hashchange")};sw(n,"hashchange",e),this.md=()=>{n&&n.removeEventListener("hashchange",e)}}}},heatmaps:class{get Wi(){return this.instance.config}constructor(e){var t;this.Sd=!1,this.es=!1,this.xd=null,this.instance=e,this.Sd=!(null==(t=this.instance.persistence)||!t.props[iv]),this.rageclicks=new aB(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return ei(this.Wi.capture_heatmaps)&&this.Wi.capture_heatmaps.flush_interval_milliseconds&&(e=this.Wi.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return el(this.Wi.capture_heatmaps)?el(this.Wi.enable_heatmaps)?this.Sd:this.Wi.enable_heatmaps:!1!==this.Wi.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.es||(a9.info("starting..."),this.Cd(),this.Et());else{var e;clearInterval(null!=(e=this.xd)?e:void 0),this.Td(),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({[iv]:i}),this.Sd=i,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.yt;return this.yt=void 0,e}Md(e){oe(e.originalEvent)&&this.Ii(e.originalEvent,"deadclick")}Et(){this.xd&&clearInterval(this.xd),this.xd="visible"===(null==l?void 0:l.visibilityState)?setInterval(this.Na.bind(this),this.flushIntervalMilliseconds):null}Cd(){n&&l&&(this.Ed=this.Na.bind(this),sw(n,sl,this.Ed),this.Id=e=>this.Ii(e||(null==n?void 0:n.event)),sw(l,"click",this.Id,{capture:!0}),this.Rd=e=>this.Pd(e||(null==n?void 0:n.event)),sw(l,"mousemove",this.Rd,{capture:!0}),this.Ad=new rF(this.instance,rP,this.Md.bind(this)),this.Ad.startIfEnabledOrStop(),this.Fd=this.Et.bind(this),sw(l,so,this.Fd),this.es=!0)}Td(){var e;n&&l&&(this.Ed&&n.removeEventListener(sl,this.Ed),this.Id&&l.removeEventListener("click",this.Id,{capture:!0}),this.Rd&&l.removeEventListener("mousemove",this.Rd,{capture:!0}),this.Fd&&l.removeEventListener(so,this.Fd),clearTimeout(this.Od),null==(e=this.Ad)||e.stop(),this.es=!1)}Ld(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),a=function(e,t,i){for(var s=e;s&&s2(s)&&!s3(s,"body")&&s!==i;){var r,a,o,l=void 0;try{l=null==(r=null!=(a=null==(o=s.ownerDocument)?void 0:o.defaultView)?a:n)?void 0:r.getComputedStyle(s).position}catch(e){break}if(G(t,l))return!0;s=rr(s)}return!1}(rt(e),["fixed","sticky"],r);return{x:e.clientX+(a?0:s),y:e.clientY+(a?0:i),target_fixed:a,type:t}}Ii(e,t){var i;if(void 0===t&&(t="click"),!s1(e.target)&&oe(e)){var s=this.Ld(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&rc(rt(e),this.instance.config.rageclick)&&this.zn(w({},s,{type:"rageclick"})),this.zn(s)}}Pd(e){!s1(e.target)&&oe(e)&&(clearTimeout(this.Od),this.Od=setTimeout(()=>{this.zn(this.Ld(e,"mousemove"))},500))}zn(e){if(n){var t=this.Wi.disable_capture_url_hashes?tm(n.location.href):n.location.href,i=this.Wi.custom_personal_data_properties,s=rH(t,this.Wi.mask_personal_data_properties?[...rV,...i||[]]:[],rK);this.yt=this.yt||{},this.yt[s]||(this.yt[s]=[]),this.yt[s].push(e)}}Na(){this.yt&&!es(this.yt)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:rF,webVitalsAutocapture:class{constructor(e){var t;this.Sd=!1,this.es=!1,this.yt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Dd=()=>{clearTimeout(this.$d),this.$d=void 0,0!==this.yt.metrics.length&&(this._instance.capture("$web_vitals",w({$current_url:this.yt.url},this.yt.metrics.reduce((e,t)=>w({},e,{["$web_vitals_"+t.name+"_event"]:w({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{}))),this.yt={navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.Nd=e=>{var t;if(this.yt=this.yt||{navigationKey:void 0,url:void 0,metrics:[],firstMetricTimestamp:void 0},el(null==e?void 0:e.name)||el(null==e?void 0:e.value))aQ.error("Invalid metric received",e);else{var i="string"==typeof e.navigationURL?e.navigationURL:void 0,s=this.qd(i);if(!er(s)){var r=eu(e.navigationId)||"string"==typeof e.navigationId?"navigation:"+e.navigationId:"url:"+s;if(!this.jd||this.jd>e.value){this.yt.navigationKey!==r&&(this.Dd(),this.$d=setTimeout(this.Dd,this.flushToCaptureTimeoutMs)),er(this.yt.navigationKey)&&(this.yt.navigationKey=r,this.yt.url=s),this.yt.firstMetricTimestamp=er(this.yt.firstMetricTimestamp)?Date.now():this.yt.firstMetricTimestamp;var n=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),a=w({},e,i?{navigationURL:s}:{},{$current_url:s,timestamp:Date.now()});if(delete a.entries,ei(e.attribution)&&this.attributionMetrics.indexOf(e.name)>-1){var o={};for(var l of a2){var u="url"===l&&"string"==typeof e.attribution[l]?this.qd(e.attribution[l]):e.attribution[l];er(u)||(o[l]=u)}a.attribution=o}else delete a.attribution;er(n)||(a.$session_id=n.sessionId,a.$window_id=n.windowId),this.yt.metrics.push(a),this.yt.metrics.length===this.allowedMetrics.length&&this.Dd()}else aQ.error("Ignoring metric with value >= "+this.jd,e)}}},this.Bd=()=>{if(!this.es){var e,t,i,s,r=!1,n=_.__PosthogExtensions__,a=null==n?void 0:n.postHogWebVitalsCallbacksByFlavor,o=(null==a?void 0:a[this.Hd])||("web-vitals"===this.Hd&&er(a)?null==n?void 0:n.postHogWebVitalsCallbacks:void 0);if(!er(o)){var l=o.withoutAttribution,u=this.attributionMetrics;r=!er(l),e=u.indexOf("LCP")>-1?o.onLCP:(null==l?void 0:l.onLCP)||o.onLCP,t=u.indexOf("CLS")>-1?o.onCLS:(null==l?void 0:l.onCLS)||o.onCLS,i=u.indexOf("FCP")>-1?o.onFCP:(null==l?void 0:l.onFCP)||o.onFCP,s=u.indexOf("INP")>-1?o.onINP:(null==l?void 0:l.onINP)||o.onINP}if(e&&t&&i&&s){var h={reportSoftNavs:this.useSoftNavs},c=r&&this.attributionMetrics.indexOf("INP")>-1?w({},h,{includeProcessedEventEntries:!1}):h;this.allowedMetrics.indexOf("LCP")>-1&&e(this.Nd.bind(this),h),this.allowedMetrics.indexOf("CLS")>-1&&t(this.Nd.bind(this),h),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Nd.bind(this),h),this.allowedMetrics.indexOf("INP")>-1&&s(this.Nd.bind(this),c),this.es=!0}else aQ.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Sd=!(null==(t=this._instance.persistence)||!t.props[iy]),this.startIfEnabled()}get Ud(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=ei(this.Ud)?null==(e=this.Ud)?void 0:e.web_vitals_allowed_metrics:void 0;return el(i)?(null==(t=this._instance.persistence)?void 0:t.props[ix])||a0:i}get flushToCaptureTimeoutMs(){return(ei(this.Ud)?this.Ud.web_vitals_delayed_flush_ms:void 0)||5e3}get attributionMetrics(){var e=ei(this.Ud)?this.Ud.web_vitals_attribution:void 0;return ec(e)?e?a0:[]:ee(e)?e:a1}get useAttribution(){return this.attributionMetrics.length>0}get useSoftNavs(){var e=ei(this.Ud)?this.Ud.__preview_web_vitals_soft_navs:void 0;return null!=e&&e}get jd(){var e=ei(this.Ud)&&eu(this.Ud.__web_vitals_max_value)?this.Ud.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==u?void 0:u.protocol;if("http:"!==e&&"https:"!==e)return aQ.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=ei(this.Ud)?this.Ud.web_vitals:ec(this.Ud)?this.Ud:void 0;return ec(t)?t:this.Sd}startIfEnabled(){this.isEnabled&&!this.es&&(aQ.info("enabled, starting..."),this.Ts(this.Bd))}onRemoteConfig(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var i=ei(t.capturePerformance)&&!!t.capturePerformance.web_vitals,s=ei(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[iy]:i}),this._instance.persistence.register({[ix]:s})),this.Sd=i,this.startIfEnabled()}}}get Hd(){return this.useSoftNavs?this.useAttribution?"web-vitals-with-attribution-soft-navs":"web-vitals-soft-navs":this.useAttribution?"web-vitals-with-attribution":"web-vitals"}
2Ts(e){var t=_.__PosthogExtensions__,i=this.Hd,s=null==t?void 0:t.postHogWebVitalsCallbacksByFlavor;null!=s&&s[i]||"web-vitals"===i&&er(s)&&null!=t&&t.postHogWebVitalsCallbacks?e():null==t||null==t.loadExternalDependency||t.loadExternalDependency(this._instance,i,t=>{t?aQ.error("failed to load script",t):e()})}qd(e){var t=e||(null==n?void 0:n.location.href);if(t){var i=this._instance.config.disable_capture_url_hashes?tm(t):t,s=this._instance.config.custom_personal_data_properties;return rH(i,this._instance.config.mask_personal_data_properties?[...rV,...s||[]]:[],rK)}aQ.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t;this.Bd=()=>{var e;if(n&&this.isEnabled&&null!=(e=_.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=_.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=_.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=_.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.zd&&this.Wi.capture_unhandled_errors&&(this.zd=t(this.captureException.bind(this))),!this.Wd&&this.Wi.capture_unhandled_rejections&&(this.Wd=i(this.captureException.bind(this))),!this.Vd&&this.Wi.capture_console_errors&&(this.Vd=s(this.captureException.bind(this)))}catch(e){aY.error("failed to start",e),this.Gd()}}},this._instance=e,this.Zd=!(null==(t=this._instance.persistence)||!t.props[ig]),this.oe=new ex(w({},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,I:aY})),this.Wi=this.Qd(),this.startIfEnabledOrStop()}Qd(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return ei(e)?t=w({},t,e):(er(e)?this.Zd:e)&&(t=w({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Wi.capture_console_errors||this.Wi.capture_unhandled_errors||this.Wi.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(aY.info("enabled"),this.Gd(),this.Ts(this.Bd)):this.Gd()}Ts(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return aY.error("failed to load script",t);e()})}Gd(){var e,t,i;null==(e=this.zd)||e.call(this),this.zd=void 0,null==(t=this.Wd)||t.call(this),this.Wd=void 0,null==(i=this.Vd)||i.call(this),this.Vd=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;"autocaptureExceptions"in t&&(this.Zd=!!t.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[ig]:this.Zd}),this.Wi=this.Qd(),this.startIfEnabledOrStop())}}onConfigChange(){this.Wi=this.Qd()}captureException(e){var t,i,s,r=null!=(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)?t:"Exception";this.oe.consumeRateLimit(r)?aY.info("Skipping exception capture because of client rate limiting.",{exception:r}):null==(s=this._instance.exceptions)||s.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,i;this.Jd=[],this.Kd=new tM([new tz,new t1,new tG,new tV,new tQ,new tX,new tJ,new t0],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=tB.test(o)?o.replace(tB,"$1"):o;if(!l.match(/\S*Error: /)){for(var u of i){var h=u(l,e);if(h){r.push(h);break}}if(r.length>=50)break}}}if(!r.length)return[];var c=Array.from(r);return c.reverse(),c.slice(0,50).map(e=>w({},e,{filename:e.filename||(c[c.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",tN,tU)),this._instance=e,this.Jd=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(i_))?t:[],this.Yd=t4(this.Xd()),this.tv=new t8(this.Yd)}onConfigChange(){this.Yd=t4(this.Xd()),this.tv.setConfig(this.Yd)}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.Jd=n,this._instance.persistence&&this._instance.persistence.register({[i_]:this.Jd,[im]:a})}}}get ev(){var e,t=!!this._instance.get_property(im),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this.Kd.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.Yd.enabled)try{if(!en(e)||0===e.trim().length)return void oI.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)=>(t5.has(s)?t.push(s):i[s]=e[s],i),{}),droppedKeys:t}}(this.iv(t)),s=i.sanitizedProperties,r=i.droppedKeys;r.length>0&&oI.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.tv.add(w({[t2]:e,[t3]:(new Date).toISOString()}
2,s))}catch(e){oI.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){var t;try{var i=e.$exception_list;if(this.rv(i)){if(this.nv(i))return this.sv("Exception dropped: matched a suppression rule"),void oI.info("Skipping exception capture because a suppression rule matched");if(!this.ev&&this.av(i))return this.sv("Exception dropped: thrown by a browser extension"),void oI.info("Skipping exception capture because it was thrown by an extension");if(!this.ev&&this.ov(i))return this.sv("Exception dropped: thrown by an injected browser script"),void oI.info("Skipping exception capture because it was thrown by an injected browser script");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.lv(i))return this.sv("Exception dropped: thrown by the PostHog SDK"),void oI.info("Skipping exception capture because it was thrown by the PostHog SDK")}var s=this.Yd.enabled&&el(e.$exception_steps)?this.uv(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",yl:!0});return n&&this.tv.clear(),n}catch(e){return oI.error("Failed to capture exception event. Dropping this exception.",e),void this.tv.clear()}}catch(e){return void oI.error("Failed to process exception event. Ignoring this exception.",e)}}uv(e){try{var t=this.tv.getAttachable();return 0===t.length?e:w({},e,{$exception_steps:t})}catch(t){return oI.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}sv(e){this.Yd.enabled&&this.tv.add({[t2]:e,[t3]:(new Date).toISOString()})}iv(e){return ei(e)?w({},e):{}}Xd(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}nv(e){if(0===e.length)return!1;try{var t=e.reduce((e,t)=>{var i=t.type,s=t.value;return en(i)&&i.length>0&&e.$exception_types.push(i),en(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.Jd.some(e=>{var i=e.values.map(e=>{var i=au[e.operator],s=t[e.key];if(!i||!s)return!1;var r=ee(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 oI.warn("Failed to evaluate suppression rules. Capturing the exception.",e),!1}}av(e){return e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}).some(e=>{var t=e.filename;return!!t&&oF.some(e=>t.startsWith(e))})}ov(e){return e.some(e=>{var t=e.value;return en(t)&&oC.some(e=>t.includes(e))})}lv(e){if(e.length>0){var t,i,s,r,n=null!=(t=null==(i=e[0].stacktrace)?void 0:i.frames)?t:[],a=n[n.length-1];return null!=(s=null==a||null==(r=a.filename)?void 0:r.includes("posthog.com/static"))&&s}return!1}rv(e){return!el(e)&&ee(e)}}},oN,{siteApps:class{constructor(e){this.fv=0,this._instance=e,this.pv=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}gv(e,t){if(t){var i=this.globalsForEvent(t);this.pv.push(i),this.pv.length>1e3&&(this.pv=this.pv.slice(10))}}get siteAppLoaders(){var e;return null==(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.gv.bind(this));this.mv=()=>{e(),this.pv=[],this.mv=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,s,r,n,a,o,l={},u=this._instance.get_property("$groups")||[];for(var h of Object.entries(this._instance.get_property("$stored_group_properties")||{})){var c=h[0];l[c]={id:u[c],type:c,properties:h[1]}}var d=e.$set_once,p=e.$set;return{event:w({},x(e,os),{properties:w({},e.properties,p?{$set:w({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},d?{$set_once:w({},null!=(s=null==(r=e.properties)?void 0:r.$set_once)?s:{},d)}:{}),elements_chain:null!=(n=null==(a=e.properties)?void 0:a.$elements_chain)?n:"",distinct_id:null==(o=e.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}yv(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)||(or.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)||(or.error("prepare_external_dependency_script returned null"),null):e}bv(){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,u=null==l?void 0:l.defaultView,h=null==u||null==(e=u.Node)?void 0:e.prototype;if(!u||!h)return()=>{};if(this.fv++,this._v)return this.wv();var c=[],d=this,p=new WeakSet,v=(e,t,i)=>{if(null!=e&&e[t]){var s=e[t];e[t]=i(s),c.push(()=>{e[t]=s})}},g=e=>{if(p.has(e))return e;var t=d.yv(e);return t&&p.add(t),t},f=e=>e.map(e=>"string"==typeof e?e:g(e)).filter(e=>!eo(e));return v(h,"appendChild",e=>function(t){var i=g(t);return i?e.call(this,i):t}),v(h,"insertBefore",e=>function(t,i){var s=g(t);return s?e.call(this,s,i):t}),v(h,"replaceChild",e=>function(t,i){var s=g(t);return s?e.call(this,s,i):i}),[null==(t=u.Element)?void 0:t.prototype,null==(i=u.Document)?void 0:i.prototype,null==(s=u.DocumentFragment)?void 0:s.prototype].forEach(e
2=>{v(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,f(i))}),v(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,f(i))})}),[null==(r=u.Element)?void 0:r.prototype,null==(n=u.CharacterData)?void 0:n.prototype,null==(a=u.DocumentType)?void 0:a.prototype].forEach(e=>{v(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,f(i))}),v(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,f(i))}),v(e,"replaceWith",e=>function(){for(var t=arguments.length,i=Array(t),s=0;t>s;s++)i[s]=arguments[s];var r=f(i);return i.length&&!r.length?void 0:e.apply(this,r)})}),v(null==(o=u.Element)?void 0:o.prototype,"insertAdjacentElement",e=>function(t,i){var s=g(i);return s?e.call(this,t,s):null}),this._v=()=>{c.forEach(e=>e()),this._v=void 0},this.wv()}wv(){var e=!1;return()=>{var t;e||(e=!0,this.fv--,0===this.fv&&(null==(t=this._v)||t.call(this)))}}Sv(e,t){void 0===t&&(t=!0);var i=this.bv();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.pv.length&&(or.info("Processing "+this.pv.length+" events for site app with id "+e.id),this.pv.forEach(e=>this.Sv(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.mv)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,or.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var n=this.Sv(t=>e.init({posthog:this._instance,callback(e){t(),r(e)}}),!1).processEvent;n&&(t.processEvent=n),s=!0}catch(t){or.error(on+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){or.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}xv(){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)}Cv(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),s=function(s){try{t.Sv(()=>null==s.processEvent?void 0:s.processEvent(i))}catch(t){or.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.xv(),void this._instance.on("eventCaptured",e=>this.Cv(e))):void or.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.mv)||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;_["__$$ph_site_app_"+t]=r._instance,null==(e=_.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(r._instance,i,e=>{if(e)return or.error(on+t,e)})}();else or.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},oH,{tracingHeaders:class{constructor(e){this.Tv=void 0,this.Mv=void 0,this.Ev=void 0,this.Bd=()=>{var e,t,i=this.Iv();i?(er(this.Tv)&&(this.Tv=null==(e=_.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),er(this.Mv)&&(this.Mv=null==(t=_.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Gd()},this._instance=e}initialize(){this.startIfEnabledOrStop()}Ts(e){var t,i;null!=(t=_.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=_.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return aX.error("failed to load script",t);e()})}Rv(){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}Iv(){var e=this.Rv();return ee(e)?(ee(this.Ev)?this.Ev.splice(0,this.Ev.length,...e):this.Ev=[...e],e.length>0?this.Ev:void 0):(ee(this.Ev)&&this.Ev.splice(0),this.Ev=e||void 0,this.Ev)}Gd(){var e,t;null==(e=this.Tv)||e.call(this),null==(t=this.Mv)||t.call(this),this.Tv=void 0,this.Mv=void 0}startIfEnabledOrStop(){this.Iv()?this.Ts(this.Bd):this.Gd()}}},{toolbar:class{constructor(e){this.instance=e}Pv(e){_.ph_toolbar_state=e}Av(){var e;return null!=(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),sx(this.instance.config)||!n||!l)return!1;e=null!=e?e:n.location,i=null!=i?i:n.history;try{if(!t){try{n.localStorage.setItem("test","test"),n.localStorage.removeItem("test")}catch(e){return!1}t=null==n?void 0:n.localStorage}var s,r=of||rq(e.hash,"__posthog")||rq(e.hash,"state"),a=r?s_(()=>JSON.parse(atob(decodeURIComponent(r))))||s_(()=>JSON.parse(decodeURIComponent(r))):null;return a&&"ph_authorize"===a.action?((s=a).source="url",s&&Object.keys(s).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(o_)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(e){return!1}}Fv(e){var t=_.ph_load_toolbar||_.ph_load_editor;!el(t)&&et(t)?t(e,this.instance):om.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==l||!l.getElementById(s0));if(!n||i)return!1;var s="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,r=w({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});return(n.localStorage.setItem(o_,JSON.stringify(w({},r,{source:void 0}))),2===this.Av())?this.Fv(r):0===this.Av()&&(this.Pv(1),null==(t=_.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{e?(om.error("[Toolbar] Failed to load",e),this.Pv(0)):(this.Pv(2),this.Fv(r))}),sw(n,"turbolinks:load",()=>{this.Pv(0),this.loadToolbar(r)})),!0}Ov(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)}}},oq,{conversations:class{constructor(e){this.Lv=void 0,this._conversationsManager=null,this.Dv=!1,this.Me=null,this.$v=!1,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&(this.Nv=e.ok,e.ok)){var t=e.config.conversations;el(t)||(ec(t)?this.Lv=t:(this.Lv=t.enabled,this.Me=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Lv=void 0,this.Me=null,this.Nv=void 0,this.$v=!1}loadIfEnabled(){if(!(this._conversationsManager||this.Dv||this._instance.config.disable_conversations||sx(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==_?void 0:_.__PosthogExtensions__;if(e&&!er(this.Lv)&&this.Lv)if(this.Me&&this.Me.token){this.Dv=!0;try{var t=e.initConversations;if(t)return this.qv(t),void(this.Dv=!1);var i=e.loadExternalDependency;if(!i)return void this.jv(st);i(this._instance,"conversations",t=>{t||!e.initConversations?this.jv("Could not load conversations script",t):this.qv(e.initConversations),this.Dv=!1})}catch(e){this.jv("Error initializing conversations",e),this.Dv=!1}}else oO.error("Conversations enabled but missing token in remote config.")}}qv(e){if(this.Me)try{this._conversationsManager=e(this.Me,this._instance),this.$v=!1,oO.info("Conversations loaded successfully")}catch(e){this.jv("Error completing conversations initialization",e)}else oO.error("Cannot complete initialization: remote config is null")}jv(e,t){oO.error(e,t),this._conversationsManager=null,this.Dv=!1,this.$v=!0}show(){this._conversationsManager?this._conversationsManager.show():oO.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Lv&&!eo(this._conversationsManager)}getUnavailableReason(){return this.isAvailable()?null:this._instance.config.disable_conversations?"disabled_by_config":sx(this._instance.config)?"disabled_for_toolbar":this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut()?"consent_opted_out":!1===this.Nv?"remote_config_failed":er(this.Lv)?this.Nv?"disabled_in_project":"remote_config_pending":this.Lv?el(this.Me)||!this.Me.token?"missing_token":null!=_&&_.__PosthogExtensions__?this.Dv?"initializing":this.$v?"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 b(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(oO.warn(oM),null)})()}getMessages(e,t){var i=this;return b(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(oO.warn(oM),null)})()}markAsRead(e){var t=this;return b(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(oO.warn(oM),null)})()}getTickets(e){var t=this;return b(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(oO.warn(oM),null)})()}requestRestoreLink(e){var t=this;return b(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(oO.warn(oM),null)})()}restoreFromToken(e){var t=this;return b(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(oO.warn(oM),null)})()}restoreFromUrlToken(){var e=this;return b(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(oO.warn(oM),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}Ml(){var e;null==(e=this._conversationsManager)||e.setIdentity()}El(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t,i=this;this.name="logs",this.Bv=!1,this.Hv=!1,this.Uv=!1,this.I=ie("[logs]"),this.zv=w({},this.I,{error(){for(var e=arguments.length,t=Array(e),s=0;e>s;s++)t[s]=arguments[s];t.some(oj)||i.I.error(...t)}}),this.Ta=[],this.Wv=[],this.bh=0,this.os=!1,this.Vv=()=>{var e,t;this.os||(this.bh=0,null==(e=this.Gv)||e.onReconnect(),null==(t=this.Zv)||t.onReconnect())},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.Bv=!0),n&&sw(n,"online",this.Vv)}Qv(e,t,i,s){var r,n,a,o,l,u,h,c,d,p,v,g,f,_,m=(r=null==(_=this._instance)||null==(_=_.config)?void 0:_.logs,d=null!=(n=null==r?void 0:r.flushIntervalMs)?n:3e3,p=null!=(a=null==r?void 0:r.maxBufferSize)?a:100,g=er(v=null!=i&&i.consoleCapture?void 0:null!=(o=null==r?void 0:r.maxLogsPerInterval)?o:1e3)?Math.max(p,2048):Math.max(p,v),{serviceName:null!=(l=null!=(u=null==(f=null==r?void 0:r.resourceAttributes)?void 0:f["service.name"])?u:null==r?void 0:r.serviceName)?l:null==i?void 0:i.serviceNameDefault,serviceVersion:null!=(h=null==f?void 0:f["service.version"])?h:null==r?void 0:r.serviceVersion,environment:null!=(c=null==f?void 0:f["deployment.environment"])?c:null==r?void 0:r.environment,resourceAttributes:f,beforeSend:null==r?void 0:r.beforeSend,flushIntervalMs:d,maxBufferSize:p,maxQueueSize:g,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:v,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0});return[new tC(this.Jv(e,t),m,this.zv,()=>this.Kv(),e=>e(),void 0,s),m]}Yv(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.Gv||this.Xv!==t){null==(i=this.Gv)||i.reset(),this.Xv=t;var i,s=this.Qv(()=>this.Ta,e=>{this.Ta=e});this.Gv=s[0],this.tc=s[1]}return this.Gv}ec(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.Zv||this.ic!==t){null==(i=this.Zv)||i.reset(),this.ic=t;var i,s=this.Qv(()=>this.Wv,e=>{this.Wv=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},oL);this.Zv=s[0],this.rc=s[1]}return this.Zv}setup(e){if(!this.os){this.ds=e;var t=!1,i=e.onRemoteConfig(e=>{var i;t=e.ok&&!0===(null==(i=e.config.logs)?void 0:i.captureConsoleLogs),this.onRemoteConfig(e)});this.os?i.dispose():(this.vs=i,t||this.loadIfEnabled())}}dispose(){var e,t,i,s;this.os||(this.os=!0,null==(e=this.vs)||e.dispose(),this.vs=void 0,this.ds=void 0,this.Uv=!1,null==n||n.removeEventListener("online",this.Vv),null==(t=this.nc)||t.call(this),this.nc=void 0,null==(i=this.Gv)||i.reset(),null==(s=this.Zv)||s.reset())}onRemoteConfig(e){var t;if(!this.os&&e.ok){var i=null==(t=e.config.logs)?void 0:t.captureConsoleLogs;!el(i)&&i&&(this.Bv=!0,this.loadIfEnabled())}}reset(){var e,t;this.Ta=[],null==(e=this.Gv)||e.reset(),this.Wv=[],null==(t=this.Zv)||t.reset(),this.bh=0}captureLog(e){this.os||this.Yv().captureLog(e)}captureConsoleLog(e){this.os||this.ec().captureLog(e)}get logger(){return this.sc||(this.sc={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)=>
2this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.sc}flushLogs(e){e?this.ac(e):(this.Gv&&this.Gv.flush().catch(e=>this.oc(e)),this.Zv&&this.Zv.flush().catch(e=>this.oc(e)))}oc(e){oj(e)||this.I.error("PostHog logs flush failed:",e)}loadIfEnabled(){if(!this.os&&this.Bv&&!this.Hv&&!this.Uv){var e=null==_?void 0:_.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;if(t){this.Uv=!0;try{t(this._instance,"logs",t=>{if(this.Uv=!1,!this.os){var i,s=e.logs;t||null==s||!s.initializeLogs?this.I.error("Could not load logs script",t):(this.nc=s.initializeLogs(null!=(i=this.ds)?i:this._instance),this.Hv=!0)}})}catch(e){throw this.Uv=!1,e}}else this.I.error(st)}else this.I.error("PostHog Extensions not found.")}}Jv(e,t){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:t=>t===$.LogsQueue?e():void 0,setPersistedProperty(e,i){e===$.LogsQueue&&t(null!=i?i:[])},Fn:e=>this.Fn(e),getLibraryId:()=>m.LIB_NAME,getLibraryVersion:()=>m.LIB_VERSION}}Fn(e){return new Promise(t=>{if(rU(this.bh,3))t({kind:"fatal",error:oD(void 0,"logs endpoint is unreachable, dropping batch")});else{var i=!1,s=e=>{i||(i=!0,clearTimeout(r),t(e))},r=setTimeout(()=>{this.I.warn("Logs request timed out before receiving a response"),s({kind:"retry-later",error:oD(void 0,"logs request timed out")})},9e4);this._instance._send_request({method:"POST",url:this.lc(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t,i=e.statusCode;(this.uc(i),i>=200&&300>i)?s({kind:"ok"}):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.I.warn("Logs request failed before receiving an HTTP response"),s({kind:"retry-later",error:oD(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)})}})}})}uc(e){(0!==e||this._instance.__loaded)&&(this.bh=rB(e,this.bh,3,()=>this.I.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.")))}ac(e){this.Ta.length>0&&this.hc(e,this.Ta,this.tc,m.LIB_NAME,e=>{this.Ta=e}),this.Wv.length>0&&this.hc(e,this.Wv,this.rc,oL,e=>{this.Wv=e})}hc(e,t,i,s,r){if(0!==t.length){var n=t.map(e=>e.record);r([]);var a=tF(n,tI(i,m.LIB_NAME,m.LIB_VERSION),s,m.LIB_VERSION);this._instance._send_request({method:"POST",url:this.lc(),data:a,compression:"best-available",batchKey:"logs",transport:e})}}lc(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Kv(){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,el(r)||(t.sessionStartTimestamp=r),el(n)||(t.lastActivityTimestamp=n)}if(null!=_&&null!=(e=_.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?tm(_.location.href):_.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.I=ie("[metrics]"),this._instance=e}initialize(){}Yv(){var e,t,i,s,r,n,a,o,l=null==(a=this._instance)||null==(a=a.config)?void 0:a.metrics;return this.Gv&&this.Xv===l||(null==(o=this.Gv)||o.reset(),this.Xv=l,this.Gv=new tO(this.Jv(),{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.I)),this.Gv}count(e,t,i){void 0===t&&(t=1),this.Yv().count(e,t,i)}
2gauge(e,t,i){this.Yv().gauge(e,t,i)}histogram(e,t,i){this.Yv().histogram(e,t,i)}flush(e){if(!this.Gv)return Promise.resolve();if(e){var t=this.Gv.drainWindow();return t&&this.Qn(t,e),Promise.resolve()}return this.Gv.flush().catch(e=>this.I.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.Gv)||e.reset()}Jv(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Qn:e=>t.Qn(e),getLibraryId:()=>m.LIB_NAME,getLibraryVersion:()=>m.LIB_VERSION}}Qn(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(w({method:"POST",url:this.dc(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t,i=e.statusCode;i>=200&&300>i?r({kind:"ok"}):413===i?r({kind:"too-large"}):0!==i&&408!==i&&429!==i&&500>i?r({kind:"fatal",error:Error("metrics request failed with status "+i)}):r({kind:"retry-later",error:null!=(t=e.error)?t:Error("metrics request failed with status "+i)})}}))})}dc(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});aU.__defaultExtensionClasses=w({},oU);var oB=(m.SDK_DIST_CHANNEL="npm",s=aC[aD]=new aU,function(){function e(){e.done||(e.done=!0,aj=!1,sv(aC,function(e){e._dom_loaded()}))}null!=l&&l.addEventListener?"complete"===l.readyState?e():sw(l,"DOMContentLoaded",e,{capture:!1}):n&&t9.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),s);e.s(["default",0,oB],197507);var oz=e.i(577635),oV=(0,oz.createContext)({get client(){return r},bootstrap:void 0}),oG=function(e){return"function"==typeof e},oK=function(e){return void 0===e},oJ=function(e,t){return(oJ=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])})(e,t)};"function"==typeof SuppressedError&&SuppressedError;var oY=function(e){var t=Object.prototype.toString.call(e);return e instanceof Error||"[object Error]"===t||"[object Exception]"===t||"[object DOMException]"===t||"[object DOMError]"===t},oZ=function(e,t){for(var i=new WeakSet,s=e;!i.has(s);){if(i.add(s),!oY(s.cause)){oK(s.cause)||(t.cause=s.cause),s.cause=t;return}s=s.cause}},oX=function(e,t){if(!t)return e;var i=Error(oY(e)?e.message:"Primitive value captured as exception: ".concat(String(e)));return(i.name="React ErrorBoundary ".concat(oY(e)?e.name:"Error"),i.stack=t,oY(e))?(oZ(e,i),e):i},oQ={componentStack:null,exceptionEvent:null,error:null};!function(e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=i}function i(t){var i=e.call(this,t)||this;return i.state=oQ,i}oJ(i,e),i.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t),i.prototype.componentDidCatch=function(e,t){var i,s=this.props.additionalProperties;oG(s)?i=s(e,t):"object"==typeof s&&(i=s);var r=this.context.client,n=t.componentStack,a=r.captureException(oX(e,n),i);this.setState({error:e,componentStack:null!=n?n:null,exceptionEvent:a})},i.prototype.render=function(){var e=this.props,t=e.children,i=e.fallback,s=this.state;if(null==s.componentStack)return oG(t)?t():t;var r=oG(i)?oz.default.createElement(i,{error:s.error,componentStack:s.componentStack,exceptionEvent:s.exceptionEvent}):i;return oz.default.isValidElement(r)?r:(console.warn("[PostHog.js][PostHogErrorBoundary] Invalid fallback prop, provide a valid React element or a function that returns a valid React element."),oz.default.createElement(oz.default.Fragment,null))},i.contextType=oV}(oz.default.Component),r=oB,e.s(["PostHogProvider",0,function(e){var t,i,s=e.children,n=e.client,a=e.apiKey,o=e.options,l=(0,oz.useRef)(null),u=(0,oz.useMemo)(function(){if(n)return a&&console.warn("[PostHog.js] You have provided both `client` and `apiKey` to `PostHogProvider`. `apiKey` will be ignored in favour of `client`."),o&&console.warn("[PostHog.js] You have provided both `client` and `options` to `PostHogProvider`. `options` will be ignored in favour of `client`."),n;var e=r;return a||console.warn("[PostHog.js] No `apiKey` or `client` were provided to `PostHogProvider`. Using default global `window.posthog` instance. You must initialize it manually. This is not recommended behavior."),e},[n,a,JSON.stringify(o)]);return(0,oz.useEffect)(function(){if(!n&&a){var e=r,t=l.current;t?(a!==t.apiKey&&console.warn("[PostHog.js] You have provided a different `apiKey` to `PostHogProvider` than the one that was already initialized. This is not supported by our provider and we'll keep using the previous key. If you need to toggle between API Keys you need to control the `client` yourself and pass it in as a prop rather than an `apiKey` prop."),o&&!function e(t,i,s){if(void 0===s&&(s=new WeakMap),t===i)return!0;
2if("object"!=typeof t||null===t||"object"!=typeof i||null===i)return!1;if(s.has(t)&&s.get(t)===i)return!0;s.set(t,i);var r=Object.keys(t),n=Object.keys(i);if(r.length!==n.length)return!1;for(var a=0;a<r.length;a++){var o=r[a];if(!n.includes(o)||!e(t[o],i[o],s))return!1}return!0}(o,t.options)&&e.set_config(o)):(e.__loaded&&console.warn("[PostHog.js] `posthog` was already loaded elsewhere. This may cause issues."),e.init(a,o)),l.current={apiKey:a,options:null!=o?o:{}}}},[n,a,JSON.stringify(o)]),oz.default.createElement(oV.Provider,{value:{client:u,bootstrap:null!=(t=null==o?void 0:o.bootstrap)?t:null==(i=null==n?void 0:n.config)?void 0:i.bootstrap}},s)},"useFeatureFlagEnabled",0,function(e,t){var i,s,r=(0,oz.useContext)(oV),n=r.client,a=r.bootstrap,o=(0,oz.useState)(function(){return n.isFeatureEnabled(e)}),l=o[0],u=o[1];(0,oz.useEffect)(function(){return n.onFeatureFlags(function(){u(n.isFeatureEnabled(e))})},[n,e]);var h=null==(i=null==a?void 0:a.featureFlags)?void 0:i[e];return!(null==(s=null==n?void 0:n.featureFlags)?void 0:s.hasLoadedFlags)&&(null==a?void 0:a.featureFlags)?oK(h)?t:!!h:oK(l)?t:l},"usePostHog",0,function(){return(0,oz.useContext)(oV).client}],925174)},416891,e=>{"use strict";var t=e.i(187925),i=e.i(577635),s=e.i(927639),r=e.i(194165),n=e.i(925174),a=e.i(173652),o=e.i(420448),l=e.i(124156),u=e.i(171990),h=e.i(582974),c=e.i(876229),d=e.i(302499),p=e.i(868711);let v=[],g=[2e3,5e3,15e3],f=(0,i.createContext)(void 0);e.s(["UserProvider",0,function({children:e}){let{user:_,mutateUser:m,userError:y}=(0,l.useCurrentUser)(),b=void 0===_&&void 0===y,w=_??null,{authTypeMetadata:x,isLoading:k}=(0,u.useAuthTypeMetadata)(),E=(0,o.useSettings)(),S=(0,n.usePostHog)(),P=E.auto_scroll,I=E.temperature_override_enabled,F=(0,i.useCallback)(e=>e?{...e,preferences:{...e.preferences,auto_scroll:e.preferences?.auto_scroll??P??!1,temperature_override_enabled:e.preferences?.temperature_override_enabled??I??!0}}:null,[P,I]),[C,T]=(0,i.useState)(null);(0,i.useEffect)(()=>{T(F(_??null))},[_,F]);let[$,R]=(0,i.useState)(!1),O=(0,i.useRef)(0),M=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(!y){O.current=0,M.current=null,R(!1);return}if(M.current??=Date.now(),!(0,a.isAuthStatusError)(y)){let e=3e4-(Date.now()-M.current);if(e<=0)return void R(!0);let t=setTimeout(()=>R(!0),e);return()=>clearTimeout(t)}let e=O.current,t=g[e];if(void 0===t)return void R(!0);let i=setTimeout(()=>{O.current=e+1,m()},t);return()=>clearTimeout(i)},[y,m]);let L=void 0===_&&!$,A=null!=_&&null===C,D=L||A?"loading":void 0===_?"unavailable":"resolved";(0,i.useEffect)(()=>{if(S)if(_?.id){let e={email:_.email};_.team_name&&(e.team_name=_.team_name),S.identify(_.id,e)}else S.reset()},[S,_]);let j=(0,i.useCallback)(async()=>{await m()},[m]);(0,u.useTokenRefresh)(C,k,j);let{setTheme:W,theme:N}=(0,c.useTheme)(),H=(0,i.useRef)(!1);(0,i.useEffect)(()=>{if(H.current||!N||!C?.id)return;let e=C?.preferences?.theme_preference;e&&(W(e),H.current=!0)},[C?.id,C?.preferences?.theme_preference,N,W]);let q=(0,d.useRouter)();(0,i.useEffect)(()=>{let e=C?.preferences?.language;(0,p.isSupportedLocale)(e)&&document.documentElement.lang!==e&&q.refresh()},[C?.id,C?.preferences?.language,q]);let U=async e=>{try{if(T(t=>t?{...t,preferences:{...t.preferences,temperature_override_enabled:e}}:t),!(await fetch(`/api/temperature-override-enabled?temperature_override_enabled=${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw await es(),Error("Failed to update user temperature override setting")}catch(e){throw console.error("Error updating user temperature override setting:",e),e}},B=async e=>{try{if(T(t=>t?{...t,preferences:{...t.preferences,temperature_default:e}}:t),!(await fetch("/api/temperature-default",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({temperature_default:e})})).ok)throw await es(),Error("Failed to update user temperature default")}catch(e){throw console.error("Error updating user temperature default:",e),e}},z=async e=>{try{if(T(t=>t?{...t,preferences:{...t.preferences,reasoning_effort_default:e}}:t),!(await fetch("/api/reasoning-effort-default",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({reasoning_effort_default:e})})).ok)throw await es(),Error("Failed to update user reasoning default")}catch(e){throw console.error("Error updating user reasoning default:",e),e}},V=async e=>{try{if(T(t=>t?{...t,preferences:{...t.preferences,shortcut_enabled:e}}:t),!(await fetch(`/api/shortcut-enabled?shortcut_enabled=${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw await es(),Error("Failed to update user shortcut setting")}catch(e){throw console.error("Error updating user shortcut setting:",e),e}},G=async e=>{try{if(T(t=>t?{...t,preferences:{...t.preferences,paste_as_tile:e}}:t),!(await fetch(`/api/paste-as-tile?paste_as_tile=${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"}})).ok)throw await es(),Error("Failed to update paste tile setting")}catch(e){throw console.error("Error updating paste tile setting:",e),e}},K=async e=>{try{let t=await fetch("/api/auto-scroll",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({auto_scroll:e})});if(T(t=>t?{...t,preferences:{...t.preferences,auto_scroll:e}}:t),!t.ok)throw Error("Failed to update auto-scroll setting")}catch(e){throw console.error("Error updating auto-scroll setting:",e),e}},J=async e=>{try{if(T(t=>t?{...t,personalization:e}:t),!(await (0,h.updateUserPersonalization)(e)).ok)throw await es(),Error("Failed to update personalization settings");await es()}catch(e){throw console.error("Error updating personalization settings:",e),e}},Y=async(e,t,i)=>{T(s=>s?{...s,preferences:{...s.preferences,pinned_assistants:i?[...e,t]:e.filter(e=>e!==t)}}:s);let s=i?[...e,t]:e.filter(e=>e!==t);try{if(!(await fetch("/api/user/pinned-assistants",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ordered_assistant_ids:s})})).ok)throw Error("Failed to update pinned assistants");return await es(),!0}catch(e){return console.error("Error updating pinned assistants:",e),!1}},Z=async e=>{H.current=!0;try{if(T(t=>t?{...t,preferences:{...t.preferences,theme_preference:e}}:t),!(await fetch("/api/user/theme-preference",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({theme_preference:e})})).ok)throw await es(),Error("Failed to update theme preference")}catch(e){throw console.error("Error updating theme preference:",e),e}},X=async e=>{try{if(T(t=>t?{...t,preferences:{...t.preferences,language:e}}:t),!(await fetch("/api/user/language",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({language:e})})).ok)throw Error("Failed to update language preference");q.refresh()}catch(e){try{await es()}catch(e){console.error("Error restoring user state after failed language update:",e)}throw console.error("Error updating language preference:",e),e}},Q=async e=>{try{if(T(t=>t?{...t,preferences:{...t.preferences,chat_background:e}}:t),!(await fetch("/api/user/chat-background",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({chat_background:e})})).ok)throw await es(),Error("Failed to update chat background")}catch(e){throw console.error("Error updating chat background:",e),e}},ee=async e=>{try{if(T(t=>t?{...t,preferences:{...t.preferences,default_model:e}}:t),!(await (0,h.setUserDefaultModel)(e)).ok)throw await es(),Error("Failed to update default model")}catch(e){throw console.error("Error updating default model:",e),e}},et=async e=>{try{if(T(t=>t?{...t,preferences:{...t.preferences,default_app_mode:e}}:t),!(await fetch("/api/user/default-app-mode",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({default_app_mode:e})})).ok)throw await es(),Error("Failed to update default app mode")}catch(e){throw console.error("Error updating default app mode:",e),e}},ei=async e=>{try{if(T(t=>t?{...t,preferences:{...t.preferences,voice_auto_send:e.auto_send??t.preferences.voice_auto_send,voice_auto_playback:e.auto_playback??t.preferences.voice_auto_playback,voice_playback_speed:e.playback_speed??t.preferences.voice_playback_speed}}:t),!(await fetch("/api/voice/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw await es(),Error("Failed to update voice settings")}catch(e){throw console.error("Error updating voice settings:",e),e}},es=async()=>{await m()};return(0,t.jsx)(f.Provider,{value:{user:C,userResolution:D,refreshUser:es,authTypeMetadata:x,updateUserAutoScroll:K,updateUserShortcuts:V,updateUserPasteAsTile:G,updateUserTemperatureOverrideEnabled:U,updateUserTemperatureDefault:B,updateUserReasoningEffortDefault:z,updateUserPersonalization:J,updateUserThemePreference:Z,updateUserLanguage:X,updateUserChatBackgroun
2d:Q,updateUserDefaultModel:ee,updateUserDefaultAppMode:et,updateUserVoiceSettings:ei,toggleAgentPinnedStatus:Y,isAdmin:(w?.effective_permissions??v).includes(s.Permission.FULL_ADMIN_PANEL_ACCESS),hasAdminAccess:(0,r.hasAnyAdminPermission)(w?.admin_capabilities??v),permissions:w?.effective_permissions??v,adminCapabilities:w?.admin_capabilities??v,managesAnyOrg:w?.manages_any_org??!1,isPartner:w?.is_partner??!1,isUserLoading:b,isCloudSuperuser:w?.is_cloud_superuser??!1},children:e})},"useUser",0,function(){let e=(0,i.useContext)(f);if(void 0===e)throw Error("useUser must be used within a UserProvider");return e}])}]);
3
4//# debugId=a40d7461-7227-2f8e-933f-6847dac8c549

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.