PageSourceSearch

https://www.amintaapp.com/_next/static/chunks/3gj5i5yr4gjq6.js

js amintaapp.com collected 2026-10-02 01:23:01 UTC 220,820 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,20526,e=>{"use strict";var t,i,s,r="u">typeof window?window:void 0,n="u">typeof globalThis?globalThis:r;"u"<typeof self&&(n.self=n),"u"<typeof File&&(n.File=function(){});var a=null==n?void 0:n.navigator,o=null==n?void 0:n.document,l=null==n?void 0:n.location,u=null==n?void 0:n.fetch,h=null!=n&&n.XMLHttpRequest&&"withCredentials"in new n.XMLHttpRequest?n.XMLHttpRequest:void 0,c=null==n?void 0:n.AbortController,d=null==n?void 0:n.CompressionStream,p=null==a?void 0:a.userAgent,v=null!=r?r:{};function g(){return!(!r||!1===r.navigator.onLine)}var _="1.399.0",f={DEBUG:!1,LIB_VERSION:_,LIB_NAME:"web",JS_SDK_VERSION:_};function m(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 y(e){return function(){var t=this,i=arguments;return new Promise(function(s,r){var n=e.apply(t,i);function a(e){m(n,s,r,a,o,"next",e)}function o(e){m(n,s,r,a,o,"throw",e)}a(void 0)})}}function b(){return(b=Object.assign.bind()).apply(null,arguments)}function w(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 x=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function S(e){return"string"==typeof e||e}function k(e){return"string"==typeof e?e:void 0}var E,P,F,A,$=((E={}).AnonymousId="anonymous_id",E.DistinctId="distinct_id",E.Props="props",E.EnablePersonProcessing="enable_person_processing",E.PersonMode="person_mode",E.FeatureFlagDetails="feature_flag_details",E.FeatureFlags="feature_flags",E.FeatureFlagPayloads="feature_flag_payloads",E.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",E.BootstrapFeatureFlags="bootstrap_feature_flags",E.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",E.OverrideFeatureFlags="override_feature_flags",E.Queue="queue",E.LogsQueue="logs_queue",E.OptedOut="opted_out",E.SessionId="session_id",E.SessionStartTimestamp="session_start_timestamp",E.SessionLastTimestamp="session_timestamp",E.PersonProperties="person_properties",E.GroupProperties="group_properties",E.InstalledAppBuild="installed_app_build",E.InstalledAppVersion="installed_app_version",E.SessionReplay="session_replay",E.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",E.SurveyLastSeenDate="survey_last_seen_date",E.SurveysSeen="surveys_seen",E.Surveys="surveys",E.RemoteConfig="remote_config",E.FlagsEndpointWasHit="flags_endpoint_was_hit",E.DeviceId="device_id",E),I=((P={}).GZipJS="gzip-js",P.Base64="base64",P),R=["$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"],T=["token"],C="NativeGzipValidationError",O=e=>e.length>=2&&31===e[0]&&139===e[1],M=(e,t)=>e===I.GZipJS||t===I.GZipJS||"gzip"===t,L=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),D=e=>{var t=Error("Native gzip produced invalid output: "+e);throw t.name=C,t},N=(F=y(function*(e,t){18>e.size&&D("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));O(i)&&8===i[2]||D("invalid-header");var s=new DataView((yield e.slice(e.size-8).arrayBuffer()));s.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(A)return A;A=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?0xedb88320^t>>>1:t>>>1;A[e]=t>>>0}return A})(),i=0xffffffff,s=0;e.length>s;s++)i=t[255&(i^e[s])]^i>>>8;return(0xffffffff^i)>>>0})(t)&&D("invalid-crc");var r=t.length>>>0;s.getUint32(4,!0)!==r&&D("invalid-size")}),function(e,t){return F.apply(this,arguments)});function j(){return(j=y(function*(e,t,i){void 0===t&&(t=!0);try{var s,r=(new TextEncoder).encode(e),n=new CompressionStream("gzip"),a=n.writable.getWriter(),o=a.write(r).then(()=>a.close()).catch((s=y(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]);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=["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","hub
1spot","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"],z=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return q.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function B(e,t){return -1!==e.indexOf(t)}var H=function(e){return e.trim()},U=function(e){return e.replace(/^\$/,"")},V=Object.prototype,G=V.hasOwnProperty,W=V.toString,Y=Array.isArray||function(e){return"[object Array]"===W.call(e)},J=e=>"function"==typeof e,K=e=>e===Object(e)&&!Y(e),Q=e=>{if(K(e)){for(var t in e)if(G.call(e,t))return!1;return!0}return!1},Z=e=>void 0===e,X=e=>"[object String]"==W.call(e),ee=e=>X(e)&&0===e.trim().length,et=e=>null===e,ei=e=>Z(e)||et(e),es=e=>"[object Number]"==W.call(e)&&e==e,er=e=>es(e)&&e>0,en=e=>"[object Boolean]"===W.call(e),ea=e=>B(R,e),eo=e=>B(T,e);function el(e){return null===e||"object"!=typeof e}function eu(e,t){return({}).toString.call(e)==="[object "+t+"]"}function eh(e){return"u">typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var ec=[!0,"true",1,"1","yes"],ed=[!1,"false",0,"0","no"];function ep(e,t,i,s,r){return t>i&&(s.warn("min cannot be greater than max."),t=i),es(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),ep(r||i,t,i,s))}class ev{constructor(e){this.Ee={},this.Pe=e.Pe,this.Fe=ep(e.bucketSize,0,100,e.Ae),this.De=ep(e.refillRate,0,this.Fe,e.Ae),this.$e=ep(e.refillInterval,0,864e5,e.Ae)}Ne(e,t){var i=Math.floor((t-e.lastAccess)/this.$e);i>0&&(e.tokens=Math.min(e.tokens+i*this.De,this.Fe),e.lastAccess=e.lastAccess+i*this.$e)}consumeRateLimit(e){var t,i=Date.now(),s=String(e),r=this.Ee[s];return r?this.Ne(r,i):this.Ee[s]=r={tokens:this.Fe,lastAccess:i},0===r.tokens||(r.tokens--,0===r.tokens&&(null==(t=this.Pe)||t.call(this,e)),0===r.tokens)}stop(){this.Ee={}}}var eg="Mobile",e_="Android",ef="Tablet",em=e_+" "+ef,ey="iPad",eb="Apple",ew=eb+" Watch",ex="Safari",eS="BlackBerry",ek="Samsung",eE=ek+"Browser",eP=ek+" Internet",eF="Chrome",eA=eF+" OS",e$=eF+" iOS",eI="Internet Explorer",eR=eI+" "+eg,eT="Opera",eC=eT+" Mini",eO="Edge",eM="Microsoft "+eO,eL="Firefox",eD=eL+" iOS",eN="Nintendo",ej="PlayStation",eq="Xbox",ez=e_+" "+eg,eB=eg+" "+ex,eH="Windows",eU=eH+" Phone",eV="Nokia",eG="Ouya",eW="Generic",eY=eW+" "+eg.toLowerCase(),eJ=eW+" "+ef.toLowerCase(),eK="Konqueror",eQ="Oculus Browser",eZ="Vivaldi",eX="Yandex",e0="Whale",e1="DuckDuckGo",e2="Pale Moon",e3="Waterfox",e5="Brave",e8="Google Search App",e6="(\\d+(\\.\\d+)?)",e4=RegExp("Version/"+e6),e7=RegExp(eq,"i"),e9=RegExp(ej+" \\w+","i"),te=RegExp(eN+" \\w+","i"),tt=RegExp(eS+"|PlayBook|BB10","i"),ti={"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"},ts=function(e,t,i,s){var r;return t=t||"",(null!=i&&i.brave?e5:null)||(null!=s&&s.detectGoogleSearchApp&&B(e,"GSA/")?e8:B(e," OPR/")&&B(e,"Mini")?eC:B(e," OPR/")?eT:tt.test(e)?eS:B(e,"IE"+eg)||B(e,"WPDesktop")?eR:B(e,"OculusBrowser")?eQ:B(e,eE)?eP:B(e,eO)||B(e,"Edg/")?eM:B(e,eZ+"/")?eZ:B(e,"YaBrowser/")?eX:B(e,e0+"/")?e0:B(e,e1+"/")||B(e,"Ddg/")?e1:B(e,"FBIOS")?"Facebook "+eg:B(e,"UCWEB")||B(e,"UCBrowser")?"UC Browser":B(e,"CriOS")?e$:B(e,"CrMo")||B(e,eF)?eF:B(e,e_)&&B(e,ex)?ez:B(e,"FxiOS")?eD:B(e.toLowerCase(),eK.toLowerCase())?eK:B(e,e5+"/")?e5:(r=t)&&B(r,eb)||B(e,ex)&&!B(e,eF)&&!B(e,e_)?B(e,eg)?eB:ex:B(e,"PaleMoon/")?e2:B(e,e3+"/")?e3:B(e,eL)?eL:B(e,"MSIE")||B(e,"Trident/")?eI:B(e,"Gecko")?eL:"")},tr={[eR]:[RegExp("rv:"+e6)],[eM]:[RegExp(eO+"?\\/"+e6)],[eF]:[RegExp("("+eF+"|CrMo)\\/"+e6)],[e$]:[RegExp("CriOS\\/"+e6)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+e6)],[ex]:[e4],[eB]:[e4],[eT]:[RegExp("(Opera|OPR)\\/"+e6)],[eL]:[RegExp(eL+"\\/"+e6)],[eD]:[RegExp("FxiOS\\/"+e6)],[eK]:[RegExp("Konqueror[:/]?"+e6,"i")],[eS]:[RegExp(eS+" "+e6),e4],[ez]:[RegExp("android\\s"+e6,"i")],[eP]:[RegExp(eE+"\\/"+e6)],[eQ]:[RegExp("OculusBrowser\\/"+e6)],[eZ]:[RegExp(eZ+"\\/"+e6)],[eX]:[RegExp("YaBrowser\\/"+e6)],[e0]:[RegExp(e0+"\\/"+e6)],[e5]:[RegExp(e5+"\\/"+e6)],[e1]:[RegExp("(DuckDuckGo|Ddg)\\/"+e6)],[e2]:[RegExp("PaleMoon\\/"+e6)],[e3]:[RegExp(e3+"\\/"+e6)],[e8]:[RegExp("GSA\\/"+e6)],[eI]:[RegExp("(rv:|MSIE )"+e6)],Mozilla:[RegExp("rv:"+e6)]},tn=function(e,t,i,s){var r=tr[ts(e,t,i,s)];if(Z(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},ta=[[RegExp(eq+"; "+eq+" (.*?)[);]","i"),e=>[eq,e&&e[1]||""]],[RegExp(eN,"i"),[eN,""]],[RegExp(ej,"i"),[ej,""]],[tt,[eS,""]],[RegExp(eH,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eU,""];if(new RegExp(eg).test(t)&&!/IEMobile\b/.test(t))return[eH+" "+eg,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var s=ti[i[1]]||"";return/arm/i.test(t)&&(s="RT"),[eH,s]}return[eH,""]}],[/((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=Z(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+e_+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+e_+")","i"),e=>e&&e[2]?[e_,[e[2],e[3],e[4]||"0"].join(".")]:[e_,""]],[/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",""]]],to=function(e){return te.test(e)?eN:e9.test(e)?ej:e7.test(e)?eq:RegExp(eG,"i").test(e)?eG:RegExp("("+eU+"|WPDesktop)","i").test(e)?eU:/iPad/.test(e)?ey:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ew:tt.test(e)?eS:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eV,"i").test(e)?eV:/(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(eg).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)?e_:em:RegExp("(pda|"+eg+")","i").test(e)?eY:RegExp(ef,"i").test(e)&&!RegExp(ef+" pc","i").test(e)?eJ:""},tl=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function tu(e,t){return"string"==typeof e&&tl.test(e)?e:t()}function th(e){return e?e.split("#")[0]:e}function tc(e,t){var i=setTimeout(e,t);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}var td=e=>e instanceof Error,tp={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}},tv=tp.info;function tg(e){var t=[];for(var i in e){var s=e[i];et(s)||Z(s)||t.push({key:i,value:function e(t){if(en(t))return{boolValue:t};if("number"==typeof t)return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if("string"==typeof t)return{stringValue:t};if(Y(t))return{arrayValue:{values:t.map(t=>e(t))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}(s)})}return t}function t_(e,t,i){return b({},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:tg(t)},scopeLogs:[{scope:{name:i,version:s},logRecords:e}]}]}}let tm=class{constructor(e,t,i,s,r,n,a){var o;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.Se=t,this.Ae=i,this.qe=s,this.Be=r,this.je=n,this.He=a,this.Ue=null,this.ze=0,this.Ve=0,this.We=0,this.Ge=0,this.Ze=!1,this.Qe=t.maxBufferSize,this.Je=Math.max(null!=(o=t.maxQueueSize)?o:t.maxBufferSize,t.maxBufferSize),this.Ke=t.flushIntervalMs,this.Ye=t.maxBatchRecordsPerPost,this.Xe=t.rateCapWindowMs,this.et=t.maxLogsPerInterval}reset(){this.tt(),this.Ue=null,this.We=0,this.Ge=0,this.Ze=!1,this.ze=0,this.Ve=0,this.Ye=this.Se.maxBatchRecordsPerPost}onReconnect(){this.Ve=0,this.rt()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.it(e);
1if(null!==t)if(t.body){if(this.nt()){var i={record:function(e,t){var{text:i,number:s}=tp[e.level||"info"]||tv,r=String(Date.now())+"000000",n={};t.distinctId&&(n.posthogDistinctId=t.distinctId),t.sessionId&&(n.sessionId=t.sessionId),t.windowId&&(n["window.id"]=t.windowId),ei(t.sessionStartTimestamp)||(n.sessionStartTimestamp=String(t.sessionStartTimestamp)),ei(t.lastActivityTimestamp)||(n.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(n["url.full"]=t.currentUrl),t.screenName&&(n["screen.name"]=t.screenName),t.appState&&(n["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(n.feature_flags=t.activeFeatureFlags);var a=b({},n,e.attributes||{}),o={timeUnixNano:r,observedTimeUnixNano:r,severityNumber:s,severityText:i,body:{stringValue:e.body},attributes:tg(a)};return e.trace_id&&(o.traceId=e.trace_id),e.span_id&&(o.spanId=e.span_id),Z(e.trace_flags)||(o.flags=e.trace_flags),o}(t,this.qe())};this.Be(()=>this.st(i))}}else this.Ae.info("Log was rejected in beforeSend function")}}it(e){var t=this.Se.beforeSend;if(!t)return e;var i=Y(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.Ae.info("Log was rejected in beforeSend function"),null;s=n}catch(e){return this.Ae.error("Error in beforeSend function for log:",e),null}return s}nt(){if(void 0===this.et)return!0;var e=Date.now(),t=e-this.We;return this.Xe>t&&t>=0||(this.We=e,this.Ge=0,this.Ze=!1),this.et>this.Ge?(this.Ge++,!0):(this.Ze||(this.Ae.warn("captureLog dropping logs: exceeded "+this.et+" logs per "+this.Xe+"ms"),this.Ze=!0),!1)}flush(){var e=this;return y(function*(){if(!e._instance.isDisabled)return e.Ue||(e.Ue=e.ot().finally(()=>{e.Ue=null})),e.Ue})()}ot(){var e=this;return y(function*(){e.tt();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.ze=0;var r,n,a,o=Math.min(t.length,e.Ye),l=t.slice(0,o),u=tf(l.map(e=>e.record),e.ut(),null!=(n=e.He)?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),h=yield e._instance.ht(u);if("too-large"===h.kind&&l.length>1)e.Ye=Math.max(1,Math.floor(l.length/2)),e.Ae.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.Ye);else if("retry-later"===h.kind||("too-large"===h.kind?e.Ae.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===h.kind&&e.Se.maxBatchRecordsPerPost>e.Ye&&(e.Ye=Math.min(e.Se.maxBatchRecordsPerPost,e.Ye+1)),yield e.dt(l.length),t=null!=(a=e._instance.getPersistedProperty($.LogsQueue))?a:[],s+=l.length,"fatal"===h.kind))throw h.error}})()}dt(e){var t=this;return y(function*(){var i,s=Math.max(0,e-t.ze),r=null!=(i=t._instance.getPersistedProperty($.LogsQueue))?i:[];t._instance.setPersistedProperty($.LogsQueue,r.slice(s)),yield t.je()})()}ut(){return t_(this.Se,this._instance.getLibraryId(),this._instance.getLibraryVersion())}st(e){var t;if(!this._instance.optedOut){var i=null!=(t=this._instance.getPersistedProperty($.LogsQueue))?t:[];this.Je>i.length||(i.shift(),this.ze++,this.Ae.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty($.LogsQueue,i),this.Qe>i.length?this.ct():this.rt()}}ct(e){void 0===e&&(e=this.Ke),this.vt||(this.vt=tc(()=>{this.vt=void 0,this.rt()},e))}ft(){var e=Math.min(Math.max(0,this.Ve-1),6);return this.Ke*Math.pow(2,e)}yt(){var e=this._instance.getPersistedProperty($.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return y(function*(){t.tt();var i=t.flush().catch(()=>{});void 0!==e?yield Promise.race([i,new Promise(t=>tc(t,e))]):yield i})()}flushWithTimeout(e){var t=this;return y(function*(){var i=!1,s=t.flush(),r=new Promise(t=>tc(()=>{i=!0,t()},e));try{yield Promise.race([s,r])}finally{i&&s.catch(()=>{})}})()}rt(){this.flush().then(()=>{this.Ve=0},e=>{this.Ve++,this.Ae.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.yt()&&this.ct(this.ft())})}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}};var ty=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function tb(e){return String(e)+"000000"}function tw(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 tx=class{constructor(e,t,i){this._instance=e,this.Se=t,this.Ae=i,this.bt=new Map,this.Ue=null,this._t=!1,this.wt=new Map,this.xt=new Set}count(e,t,i){void 0===t&&(t=1),this.kt({name:e,type:"count",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}
1gauge(e,t,i){this.kt({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.kt({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.Ue,s=(e=y(function*(){i&&(yield i.catch(()=>{})),yield t.St()}),function(){return e.apply(this,arguments)})().finally(()=>{this.Ue===s&&(this.Ue=null)});return this.Ue=s,s}drainWindow(){if(0===this.bt.size)return null;var e=this.bt;return this.bt=new Map,this._t=!1,this.wt=new Map,this.xt=new Set,this.Ct(e)}reset(){this.tt(),this.bt=new Map,this.Ue=null,this._t=!1,this.wt=new Map,this.xt=new Set}kt(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.it(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.Ae.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{var i=this.wt.get(t.name);void 0===i?this.wt.set(t.name,t.type):i===t.type||this.xt.has(t.name)||(this.xt.add(t.name),this.Ae.warn("Metric name '"+t.name+"' is already used as a "+i+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name."));var s=tw(t.type,t.name,t.unit,t.attributes),r=this.bt.get(s);if(!r){if(this.bt.size>=this.Se.maxSeriesPerFlush)return void(this._t||(this._t=!0,this.Ae.warn("Metric series cap reached ("+this.Se.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")));r={name:t.name,type:t.type,unit:t.unit,attributes:t.attributes?b({},t.attributes):void 0,windowStartMs:Date.now()},this.bt.set(s,r)}this.It(r,t.value),this.ct()}else this.Ae.warn("Dropping metric '"+t.name+"': value must be a finite number");else this.Ae.warn("Dropping metric with empty name")}}It(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(ty.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,ty)]+=1}}it(e){var t=this.Se.beforeSend;if(!t)return e;var i=Y(t)?t:[t],s=e;for(var r of i)try{var n=r(s);if(!n)return this.Ae.info("Metric was rejected in beforeSend function"),null;s=n}catch(e){return this.Ae.error("Error in beforeSend function for metric:",e),null}return s}ct(){this.vt||(this.vt=tc(()=>{this.vt=void 0,this.flush().catch(()=>{})},this.Se.flushIntervalMs))}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}St(){var e=this;return y(function*(){if(0!==e.bt.size){var t=e.bt;e.bt=new Map,e._t=!1,e.wt=new Map,e.xt=new Set;var i=yield e._instance.Tt(e.Ct(t));switch(i.kind){case"ok":return;case"retry-later":return e.Mt(t),void e.ct();case"too-large":return void e.Ae.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.Ae.error("Failed to send metrics batch:",i.error)}}})()}Ct(e){var t,i,s,r,n,a,o;return r=this.Et(e),t=this.Se,i=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),n=b({},t.resourceAttributes,{"service.name":t.serviceName||"unknown_service"},t.environment&&{"deployment.environment":t.environment},t.serviceVersion&&{"service.version":t.serviceVersion},{"telemetry.sdk.name":i,"telemetry.sdk.version":s}),a=this._instance.getLibraryId(),o=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:tg(n)},scopeMetrics:[{scope:{name:a,version:o},metrics:r}]}]}}Et(e){var t=tb(Date.now()),i=new Map;for(var s of e.values()){var r,n=tw(s.type,s.name,s.unit,void 0),a=i.get(n);a||(a=b({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=tg(null!=(r=s.attributes)?r:{}),l=tb(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:ty})}return Array.from(i.values())}Mt(e){var t,i;for(var[s,r]of e){var n=this.bt.get(s);if(n)switch(n.windowStartMs=Math.min(n.windowStartMs,r.windowStartMs),n.type){case"count":n.total=(null!=(t=n.total)?t:0)+(null!=(i=r.total)?i:0);break;case"gauge":break;case"histogram":if(r.hist)if(n.hist){n.hist.count+=r.hist.count,n.hist.sum+=r.hist.sum,n.hist.min=Math.min(n.hist.min,r.hist.min),n.hist.max=Math.max(n.hist.max,r.hist.max);for(var a=0;n.hist.bucketCounts.length>a;a++)n.hist.bucketCounts[a]+=r.hist.bucketCounts[a]}else n.hist=r.hist}else this.bt.set(s,r)}}};class tS{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 y(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&Y(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
1pFirstLines:0),t.chunkIdMap)),b({},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 y(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,b({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return sl&&i.length===so||(so=i.length,sl=i.reduce((i,s)=>{sa||(sa={});var r=sa[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,sa[s]=[l,u];break}}return i},{})),sl}}(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 b({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>s(e,i),next:e=>s(e,i+1)})}}function tk(e,t,i,s,r){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!0};return Z(s)||(n.lineno=s),Z(r)||(n.colno=r),n}var tE=(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]},tP=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tF=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tA=/\((\S*)(?::(\d+))(?::(\d+))\)/,t$=(e,t)=>{var i=tP.exec(e);if(i){var[,s,r,n]=i;return tk(t,s,"?",+r,+n)}var a=tF.exec(e);if(a){if(a[2]&&0===a[2].indexOf("eval")){var o=tA.exec(a[2]);o&&(a[2]=o[1],a[3]=o[2],a[4]=o[3])}var[l,u]=tE(a[1]||"?",a[2]);return tk(t,u,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},tI=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tR=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tT=(e,t)=>{var i=tI.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var s=tR.exec(i[3]);s&&(i[1]=i[1]||"eval",i[3]=s[1],i[4]=s[2],i[5]="")}var r=i[3],n=i[1]||"?";return[n,r]=tE(n,r),tk(t,r,n,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tC=/\(error: (.*)\)/;class tO{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=X(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 eu(e,"DOMException")}isDOMError(e){return eu(e,"DOMError")}}class tM{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var i=e.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(e){return e.stacktrace||e.stack||void 0}}class tL{match(e){return eu(e,"ErrorEvent")&&null!=e.error}coerce(e,t){var i;return t.apply(e.error)||{type:"ErrorEvent",value:e.message,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}var tD=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tN{match(e){return"string"==typeof e}coerce(e,t){var i,[s,r]=this.getInfos(e);return{type:null!=s?s:"Error",value:null!=r?r:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,s=e.match(tD);return s&&(t=s[1],i=s[2]),[t,i]}}var tj=["fatal","error","warning","log","info","debug"];function tq(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(", ");
1if(t>=r.length)return s===i.length?r:r.length>t?r.slice(0,t)+"...":r}return""}class tz{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,s=this.getErrorPropertyFromObject(e);return s?t.apply(s):{type:this.getType(e),value:this.getValue(e),stack:null==(i=t.syntheticException)?void 0:i.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return eh(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+tq(e)}isSeverityLevel(e){return X(e)&&!ee(e)&&tj.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var i=e[t];if(td(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tB{match(e){return eh(e)}coerce(e,t){var i,s=e.constructor.name;return{type:s,value:s+" captured as exception with keys: "+tq(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tH{match(e){return el(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 tU{match(e){return eu(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!eh(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 el(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 tV="$message",tG="$timestamp",tW=new Set([tV,tG]),tY={enabled:!0,max_bytes:32768};function tJ(e){var t;return e?{enabled:null!=(t=e.enabled)?t:tY.enabled,max_bytes:function(e,t){if(!es(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,tY.max_bytes)}:b({},tY)}class tK{constructor(e){this.Pt=[],this.Rt=0,this.Se=tJ(e)}setConfig(e){this.Se=tJ(e),this.Ot()}add(e){var t=function(e){var t,i,s;try{s=[],t=null!=(i=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(;s.length>0&&s[s.length-1]!==this;)s.pop();if(s.includes(t))return"[Circular]";s.push(t)}return t}}))?i:"null"}catch(e){return}try{var r=JSON.parse(t);if(!K(r))return;var n=r[tV],a=r[tG];if(!X(n)||0===n.trim().length||!X(a)&&!es(a))return;return{step:r,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.Se.max_bytes||(this.Pt.push({step:t.step,bytes:i}),this.Rt+=i,this.Ot())}}getAttachable(){return this.Pt.map(e=>e.step)}clear(){this.Pt=[],this.Rt=0}size(){return this.Pt.length}Ot(){for(;this.Rt>this.Se.max_bytes&&this.Pt.length>0;){var e=this.Pt.shift();e&&(this.Rt-=e.bytes)}}}var tQ=function(e,t){var{debugEnabled:i}=void 0===t?{}:t,s={k(t){if(r&&(f.DEBUG||v.POSTHOG_DEBUG||i)&&!Z(r.console)&&r.console){for(var s=("__rrweb_original__"in r.console[t])?r.console[t].__rrweb_original__:r.console[t],n=arguments.length,a=Array(n>1?n-1:0),o=1;n>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.k("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("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)=>tQ(e+" "+t,i)};return s},tZ=tQ("[PostHog.js]"),tX=tZ.createLogger,t0=tX("[ExternalScriptsLoader]"),t1=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return t0.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var s=null==o?void 0:o.querySelectorAll("script");
1if(s){for(var r,n=0;s.length>n;n++)if(r=function(){if(s[n].src===t){var e=s[n];return e.__posthog_loading_callback_fired?{v:i()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,i(void 0,t)}),e.onerror=e=>i(e),{v:void 0})}}())return r.v}var a=()=>{if(!o)return i("document not found");var s=o.createElement("script");if(s.type="text/javascript",s.crossOrigin="anonymous",s.src=t,s.onload=e=>{s.__posthog_loading_callback_fired=!0,i(void 0,e)},s.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(s=e.config.prepare_external_dependency_script(s)),!s)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)o.head.appendChild(s);else{var r,n=o.querySelectorAll("body > script");n.length>0?null==(r=n[0].parentNode)||r.insertBefore(s,n[0]):o.body.appendChild(s)}};null!=o&&o.body?a():null==o||o.addEventListener("DOMContentLoaded",a)};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var s;if(e.config.strict_script_versioning)s=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var r="/static/"+t+".js?v="+e.version;"toolbar"===t&&(r=r+"&t="+3e5*Math.floor(Date.now()/3e5)),s=e.requestRouter.endpointFor("assets",r)}t1(e,s,i)}else{var n=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");t1(e,n,i)}},v.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var s=e.requestRouter.endpointFor("api",t);t1(e,s,i)};var t2="$people_distinct_id",t3="$device_id",t5="$device_model",t8="__alias",t6="__timers",t4="$autocapture_disabled_server_side",t7="$heatmaps_enabled_server_side",t9="$exception_capture_enabled_server_side",ie="$error_tracking_suppression_rules",it="$error_tracking_capture_extension_exceptions",ii="$web_vitals_enabled_server_side",is="$dead_clicks_enabled_server_side",ir="$product_tours_enabled_server_side",ia="$web_vitals_allowed_metrics",io="$session_recording_remote_config",il="$replay_sample_rate",iu="$replay_override_sampling",ih="$replay_override_linked_flag",ic="$replay_override_url_trigger",id="$replay_override_event_trigger",ip="$sesid",iv="$session_is_sampled",ig="$enabled_feature_flags",i_="$active_feature_flags",im="$early_access_features",iy="$feature_flag_details",ib="$feature_flag_payloads",iw="$feature_flag_request_id",ix="$override_feature_flags",iS="$override_feature_flag_payloads",ik="$stored_person_properties",iE="$stored_group_properties",iP="$surveys",iF="$surveys_loaded_at",iA="$surveys_activated",i$="ph_product_tours",iI="$flag_call_reported",iR="$flag_call_reported_session_id",iT="$feature_flag_errors",iC="$feature_flag_evaluated_at",iO="$user_state",iM="$client_session_props",iL="$capture_rate_limit",iD="$initial_campaign_params",iN="$initial_referrer_info",ij="$initial_person_info",iq="$epp",iz="__POSTHOG_TOOLBAR__",iB="$posthog_cookieless",iH="$sdk_debug_extensions_init_method",iU="$sdk_debug_extensions_init_time_ms",iV="$sdk_debug_recording_script_not_loaded",iG="PostHog loadExternalDependency extension not found.",iW="on_reject",iY="always",iJ="anonymous",iK="identified",iQ="identified_only",iZ="visibilitychange",iX="beforeunload",i0="$pageview",i1="$pageleave",i2="$identify",i3="$groupidentify";function i5(e,t){Y(e)&&e.forEach(t)}function i8(e,t){if(!ei(e))if(Y(e))e.forEach(t);else if(e instanceof FormData)e.forEach((e,i)=>t(e,i));else for(var i in e)G.call(e,i)&&t(e[i],i)}var i6=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 i4(e){for(var t=Object.keys(e),i=t.length,s=Array(i);i--;)s[i]=[t[i],e[t[i]]];return s}var i7=function(e){try{return e()}catch(e){return}},i9=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){tZ.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),tZ.critical(e)}}},se=function(e){var t={};return i8(e,function(e,i){(X(e)&&e.length>0||es(e))&&(t[i]=e)}),t},st=["herokuapp.com","vercel.app","netlify.app"];function si(e,t,i,s){var{capture:r=!1,passive:n=!0}=null!=s?s:{};null==e||e.addEventListener(t,i,{capture:r,passive:n})}function ss(e){return"ph_toolbar_internal"===e.name}Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return es(e)&&isFinite(e)&&Math.floor(e)===e});class sr{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");
1var 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 sr(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 sr(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 sn{constructor(){this.S=0,this.C=0,this.I=new sc}generate(){var e=this.generateOrAbort();if(Z(e)){this.S=0;var t=this.generateOrAbort();if(Z(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>0x3ffffffffff&&(this.S++,this.M())}return sr.fromFieldsV7(this.S,Math.trunc(this.C/0x40000000),0x3fffffff&this.C,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var sa,so,sl,su,sh=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};r&&!Z(r.crypto)&&crypto.getRandomValues&&(sh=e=>crypto.getRandomValues(e));class sc{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(sh(this.R),this.O=0),this.R[this.O++]}}var sd=()=>sp().toString(),sp=()=>(su||(su=new sn)).generate(),sv="",sg=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,s_={N:()=>!!o,D(e){tZ.error("cookieStore error: "+e)},A(e){if(o){try{for(var t=e+"=",i=o.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}},F(e){var t;try{t=JSON.parse(s_.A(e))||{}}catch(e){}return t},q(e,t,i,s,r){if(!o)return!1;try{var n="",a="",l=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=o),sv)return sv;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),s=Math.min(i.length,8),r="dmn_chk_"+sd();!sv&&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",sv=n)}return sv}(e);if(!i){var s,r=(s=e.match(sg))?s[0]:"";r!==i&&tZ.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(o.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=/"+l+a;return h.length>3686.4&&tZ.warn("cookieStore warning: large cookie, len="+h.length),o.cookie=h,!0}catch(e){return!1}},P(e,t){if(null!=o&&o.cookie)try{s_.q(e,"",-1,t)}catch(e){return}}},sf=null,sm={N(){if(!et(sf))return sf;var e=!0;if(Z(r))e=!1;else try{var t="__mplssupport__";sm.q(t,"xyz"),'"xyz"'!==sm.A(t)&&(e=!1),sm.P(t)}catch(t){e=!1}return e||tZ.error("localStorage unsupported; falling back to cookie store"),sf=e,e},D(e){tZ.error("localStorage error: "+e)},A(e){try{return null==r?void 0:r.localStorage.getItem(e)}catch(e){sm.D(e)}return null},F(e){try{return JSON.parse(sm.A(e))||{}}catch(e){}return null},q(e,t){try{return null==r||r.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sm.D(e)}return!1},P(e){try{null==r||r.localStorage.removeItem(e)}catch(e){sm.D(e)}}},sy=[t3,"distinct_id",ip,iv,iq,ij,iO],sb={},sw={N:()=>!0,D(e){tZ.error("memoryStorage error: "+e)},A:e=>sb[e]||null,F:e=>sb[e]||null,q:(e,t)=>(sb[e]=t,!0),P(e){delete sb[e]}},sx=null,sS={N(){if(!et(sx))return sx;if(sx=!0,Z(r))sx=!1;else try{var e="__support__";sS.q(e,"xyz"),'"xyz"'!==sS.A(e)&&(sx=!1),sS.P(e)}catch(e){sx=!1}return sx},D(e){tZ.error("sessionStorage error: ",e)},A(e){try{return null==r?void 0:r.sessionStorage.getItem(e)}catch(e){sS.D(e)}return null},F(e){try{return JSON.parse(sS.A(e))||null}catch(e){}return null},q(e,t){try{return null==r||r.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){sS.D(e)}return!1},P(e){try{null==r||r.sessionStorage.removeItem(e)}catch(e){sS.D(e)}}};class sk{constructor(e){this._instance=e}get Se(){return this._instance.config}get consent(){return this.Ft()?0:this.At}
1isOptedOut(){return this.Se.cookieless_mode===iY||this.isRejected()||-1===this.consent&&this.Se.cookieless_mode===iW}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Se.opt_out_capturing_by_default}optInOut(e){this.Dt.q(this.$t,+!!e,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Dt.P(this.$t,this.Se.cross_subdomain_cookie)}get $t(){var{token:e,opt_out_capturing_cookie_prefix:t,consent_persistence_name:i}=this._instance.config;return i||(t?t+e:"__ph_opt_in_out_"+e)}get At(){var e=this.Dt.A(this.$t);return B(ec,e)?1:B(ed,e)?0:-1}get Dt(){var e=this.Se.opt_out_capturing_persistence_type,t="localStorage"===e?sm:s_;if(!this.Nt||this.Nt!==t){this.Nt=t;var i="localStorage"===e?s_:sm;i.A(this.$t)&&(this.Nt.A(this.$t)||this.optInOut(B(ec,i.A(this.$t))),i.P(this.$t,this.Se.cross_subdomain_cookie))}return this.Nt}Ft(){return!!this.Se.respect_dnt&&[null==a?void 0:a.doNotTrack,null==a?void 0:a.msDoNotTrack,v.doNotTrack].some(e=>B(ec,e))}}function sE(e,t){var i,s=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!J(s))return t;try{var r=s(t);return X(r)&&r?r:t}catch(e){return tZ.error("Error in get_current_url, falling back to window.location.href",e),t}}function sP(e){return e instanceof Element&&(e.id===iz||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function sF(e){return!!e&&1===e.nodeType}function sA(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function s$(e){return!!e&&3===e.nodeType}function sI(e){return!!e&&11===e.nodeType&&sF(e.host)}function sR(e){return e?H(e).split(/\s+/):[]}function sT(e,t){var i,s,n=Z(s=null==r||null==(i=r.location)?void 0:i.href)?void 0:sE(t,s);return!!(n&&e&&e.some(e=>n.match(e)))}function sC(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 sR(t)}function sO(e){return ei(e)?null:H(e).split(/(\s+)/).filter(e=>s3(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function sM(e){var t="";return sJ(e)&&!sK(e)&&e.childNodes&&e.childNodes.length&&i8(e.childNodes,function(e){var i;s$(e)&&e.textContent&&(t+=null!=(i=sO(e.textContent))?i:"")}),H(t)}function sL(e){var t;return Z(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var sD=["a","button","form","input","select","textarea","label"];function sN(e,t){if(Z(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 sj(e){var t=e.parentNode;return!(!t||!sF(t))&&t}var sq=[".ph-no-autocapture","[data-ph-no-autocapture]"],sz=["next","previous","prev",">","<"],sB=[...sz,"+","-","−","–"],sH=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,sU=[".ph-no-rageclick",".ph-no-capture"],sV=["","text","search","email","password","url","tel","number"];function sG(e,t){if(!r||sW(e)||(en(t)?(s=!!t&&sU,n=void 0,a=!1):(s=null!=(o=null==t?void 0:t.css_selector_ignorelist)?o:sU,n=null==t?void 0:t.content_ignorelist,a=null!=(l=null==t?void 0:t.ignore_text_selection)&&l),!1===s)||a&&!(!(i=e)||!sF(i))&&(sA(i,"textarea")||(sA(i,"input")?B(sV,(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,n,a,o,l,{targetElementList:u}=sY(e,!1);return!function(e,t){var i;if(!1===e||Z(e))return!1;if(!0===e)i=sz;else{if(!Y(e))return!1;if(e.length>10)return tZ.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=e.map(e=>e.toLowerCase())}return t.some(e=>{var{safeText:t,ariaLabel:s}=e;return i.some(e=>sH(t,e)||sH(s,e))})}(n,u.map(e=>{var t;return{safeText:sM(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!sN(u,s)}var sW=e=>!e||sA(e,"html")||!sF(e),sY=(e,t)=>{if(!r||sW(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,s=[e],n=e;n.parentNode&&!sA(n,"body");)if(sI(n.parentNode))s.push(n.parentNode.host),n=n.parentNode.host;else{var a=sj(n);if(!a)break;if(t||sD.indexOf(a.tagName.toLowerCase())>-1)i=!0;else try{var o=r.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}catch(e){}s.push(a),n=a}return{parentIsUsefulElement:i,targetElementList:s}};function sJ(e){for(var t=e;t.parentNode&&!sA(t,"body");t=t.parentNode){var i=sC(t);if(B(i,"ph-sensitive")||B(i,"ph-no-capture"))return!1}if(B(sC(e),"ph-include"))return!0;var s=e.type||"";if(X(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}
1var r=e.name||e.id||"";return!X(r)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,""))}function sK(e){return!!(sA(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||sA(e,"select")||sA(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var sQ="(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})",sZ=RegExp("^(?:"+sQ+")$"),sX=new RegExp(sQ),s0="\\d{3}-?\\d{2}-?\\d{4}",s1=RegExp("^("+s0+")$"),s2=RegExp("("+s0+")");function s3(e,t){return void 0===t&&(t=!0),!(ei(e)||X(e)&&(e=H(e),(t?sZ:sX).test((e||"").replace(/[- ]/g,""))||(t?s1:s2).test(e)))&&!0}function s5(e){var t=sM(e);return s3(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&i8(t.childNodes,function(t){var s;if(t&&"span"===(null==(s=t.tagName)?void 0:s.toLowerCase()))try{var r=sM(t);i=(i+" "+r).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){tZ.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function s8(e){return e.replace(/"|\\"/g,'\\"')}var s6=tX("[Dead Clicks]"),s4=()=>!0,s7=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(is)),s=e.instance.config.capture_dead_clicks;return en(s)?s:!!K(s)||i};class s9{get lazyLoadedDeadClicksAutocapture(){return this.qt}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[is]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Bt(()=>{this.jt()}):this.stop()}Bt(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?s6.error("failed to load script",t):e()})}jt(){var e;if(o){if(!this.qt&&null!=(e=v.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=K(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.qt=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.qt.start(o),s6.info("starting...")}}else s6.error("`document` not found. Cannot start.")}stop(){this.qt&&(this.qt.stop(),this.qt=void 0,s6.info("stopping..."))}}var re=tX("[SegmentIntegration]"),rt="posthog-js";function ri(e,t){var{organization:i,projectId:s,prefix:r,severityAllowList:n=["error"],sendExceptionsToPostHog:a=!0}=void 0===t?{}:t;return t=>{if("*"!==n&&!n.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var o=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=o,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var l,u,h,c,d,p,v=(null==(l=t.exception)?void 0:l.values)||[],g=v.map(e=>b({},e,{stacktrace:e.stacktrace?b({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>b({},e,{platform:"web:javascript"}))}):void 0})),_={$exception_message:(null==(u=v[0])?void 0:u.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 i&&s&&(_.$sentry_url=(r||"https://sentry.io/organizations/")+i+"/issues/?project="+s+"&query="+t.event_id),a&&(null==(p=e.exceptions)||p.sendExceptionEvent(_)),t}}class rs{constructor(e,t,i,s,r,n){this.name=rt,this.setupOnce=function(a){a(ri(e,{organization:t,projectId:i,prefix:s,severityAllowList:r,sendExceptionsToPostHog:null==n||n}))}}}class rr{constructor(e){this.Ht=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(tZ.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Ut=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.zt()}zt(){var e;this.Vt=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Ht)}destroy(){var e;null==(e=this.Vt)||e.call(this),this.Vt=void 0}doPageView(e,t){var i,s=this.Wt(e,t);return this.Ut={pathname:null!=(i=null==r?void 0:r.location.pathname)?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.Wt(e,null==(t=this.Ut)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Ut)?void 0:e.pageViewId}}Wt(e,t){var i=this.Ut;if(!i)return{$pageview_id:t};var s={$pageview_id:t,$prev_pageview_id:i.pageViewId},r=this._instance.scrollManager.getContext();if(r&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:a,maxScrollY:o,maxContentHeight:l,lastContentY:u,maxContentY:h}=r;if(!(Z(n)||Z(a)||Z(o)||Z(l)||Z(u)||Z(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?ep(a/n,0,1,tZ):1,d=n>1?ep(o/n,0,1,tZ):1,p=l>1?ep(u/l,0,1,tZ):1,v=l>1?ep(h/l,0,1,tZ):1;s=i6(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 rn=["flags","surveys"],ra={[t2]:{exposure:"hidden"},[t8]:{exposure:"hidden"},__cmpns:{exposure:"hidden"}
1,[t6]:{exposure:"hidden"},[t4]:{exposure:"event"},[t7]:{exposure:"hidden"},[t9]:{exposure:"event"},[ie]:{exposure:"hidden"},[it]:{exposure:"event"},[ii]:{exposure:"event"},[is]:{exposure:"event"},[ir]:{exposure:"hidden"},[ia]:{exposure:"event"},[io]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[ip]:{exposure:"hidden"},[iv]:{exposure:"event"},[il]:{exposure:"event",shouldSkipFromEventProperties:e=>et(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"},[ig]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!K(e))return{};for(var t={},i=Object.keys(e),s=0;i.length>s;s++)t["$feature/"+i[s]]=e[i[s]];return t}},[i_]:{exposure:"event",storageGroup:"flags"},[im]:{exposure:"hidden"},[iy]:{exposure:"hidden",storageGroup:"flags"},[ib]:{exposure:"event",storageGroup:"flags"},[iw]:{exposure:"event",storageGroup:"flags",volatile:!0},[ix]:{exposure:"event"},[iS]:{exposure:"hidden"},[ik]:{exposure:"hidden"},[iE]:{exposure:"hidden"},[iP]:{exposure:"hidden",storageGroup:"surveys"}
1,[iF]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[iA]:{exposure:"event"},[i$]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[iI]:{exposure:"hidden"},[iR]:{exposure:"hidden"},[iT]:{exposure:"hidden"},[iC]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iO]:{exposure:"hidden"},[iM]:{exposure:"hidden"},[iL]:{exposure:"hidden"},[iD]:{exposure:"hidden"},[iN]:{exposure:"hidden"},[ij]:{exposure:"hidden"},[iq]:{exposure:"hidden"},[iu]:{exposure:"event"},[ih]:{exposure:"event"},[ic]:{exposure:"event"},[id]:{exposure:"event"},[iH]:{exposure:"event"},[iU]:{exposure:"event"},[iV]:{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"},$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"}},ro=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],rl=e=>{var t=ra[e];if(t)return t;for(var[i,s]of ro)if(0===e.indexOf(i))return s},ru=e=>{var t=null==o?void 0:o.createElement("a");return Z(t)?null:(t.href=e,t)},rh=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(!Y(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(e){tZ.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},rc=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("=");Y(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},rd=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},rp=(e,t)=>e>=t&&g(),rv=(e,t,i,s)=>{if(0===e){if(g()){var r=t+1;return r===i&&s(),r}return t}return 0},rg="https?://(.*)",r_=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],rf=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...r_],rm="<masked>",ry=["li_fat_id"];function rb(e,t,i){if(!o)return{};var s,r=t?[...r_,...i||[]]:[],n=rw(rc(o.URL,r,rm),e);return i6((s={},i8(ry,function(e){var t=s_.A(e);s[e]=t||null}),s),n)}function rw(e,t){var i=rf.concat(t||[]),s={};return i8(i,function(t){var i=rh(e,t);s[t]=i||null}),s}function rx(e){var t=e?0===e.search(rg+"google.([^/?]*)")?"google":0===e.search(rg+"bing.com")?"bing":0===e.search(rg+"yahoo.com")?"yahoo":0===e.search(rg+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!et(t)){i.$search_engine=t;var s=o?rh(o.referrer,"yahoo"!=t?"q":"p"):"";s.length&&(i.ph_keyword=s)}return i}function rS(){return navigator.language||navigator.userLanguage}var rk="$direct";function rE(){return(null==o?void 0:o.referrer)||rk}function rP(e,t,i){void 0===i&&(i=!1);var s=e?[...r_,...t||[]]:[],r=i?th(null==l?void 0:l.href):null==l?void 0:l.href,n=null==r?void 0:r.substring(0,1e3);return{r:rE().substring(0,1e3),u:n?rc(n,s,rm):void 0}}function rF(e,t){void 0===t&&(t=!1);var i,{r:s,u:r}=e,n=t?th(r):r,a={$referrer:s,$referring_domain:null==s?void 0:s==rk?rk:null==(i=ru(s))?void 0:i.host};
1if(n){a.$current_url=n;var o=ru(n);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname,i6(a,rw(n))}return s&&i6(a,rx(s)),a}function rA(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var r$={flags:iC,surveys:iF},rI=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],rR="main";class rT{constructor(e,t,i){if(void 0===i&&(i=!0),this.Gt={},this.Zt=!1,this.Qt=!1,this.Se=e,this.Jt=i,this.props={},this.Kt=!1,this.Yt=(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.Dt=this.Xt(e),this.Qt=this.er(e),this.load(),e.debug&&tZ.info("Persistence loaded",e.persistence,b({},this.props)),this.update_config(e,e,t),this.save(),r){var s=()=>this.flush();si(r,"beforeunload",s,{capture:!1}),si(r,"pagehide",s,{capture:!1})}}tr(){var e,t=null==(e=this.Se)?void 0:e.persistence_save_debounce_ms;return es(t)&&t>0?t:0}isDisabled(){return!!this.rr}Xt(e){-1===rI.indexOf(e.persistence.toLowerCase())&&(tZ.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i,s,n,a=(t=e.cookie_persisted_properties||[],i=e.__preview_cookie_wins_on_conflict||!1,void 0===t&&(t=[]),void 0===i&&(i=!1),s=[...sy,...t],b({},sm,{F(e){try{var t={};try{t=s_.F(e)||{}}catch(e){}var s,r=JSON.parse(sm.A(e)||"{}");if(i){var n={};for(var a in t){var o=t[a];et(o)||""===o||(n[a]=o)}s=i6(r,n)}else s=i6(t,r);return sm.q(e,s),s}catch(e){}return null},q(e,t,i,r,n,a){var o=sm.q(e,t,void 0,void 0,a);try{var l={};s.forEach(e=>{t[e]&&(l[e]=t[e])}),Object.keys(l).length&&s_.q(e,l,i,r,n,a)}catch(e){sm.D(e)}return o},P(e,t){try{null==r||r.localStorage.removeItem(e),s_.P(e,t)}catch(e){sm.D(e)}}})),o=!1,l=e.persistence.toLowerCase();return"localstorage"===l&&sm.N()?(n=sm,o=!0):"localstorage+cookie"===l&&a.N()?(n=a,o=!0):"sessionstorage"===l&&sS.N()?n=sS:"memory"===l?n=sw:"cookie"===l?n=s_:a.N()?(n=a,o=!0):n=s_,this.Zt=o,n}ir(e){return this.Yt+"__"+e}er(e){return this.Zt&&!!e.split_storage}nr(e){var t=null!=e?e:this.Se.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var i=this.props[iC];return!i||"number"!=typeof i||Date.now()-i>t}properties(){var e={};return i8(this.props,(t,i)=>{var s=rl(i);if("derived"===(null==s?void 0:s.exposure)){if(null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t,i===ig?()=>this.nr():()=>!1))return;s.transformToEventProperties&&i6(e,s.transformToEventProperties(t))}else if(!s||"event"===s.exposure){if(null!=s&&null!=s.shouldSkipFromEventProperties&&s.shouldSkipFromEventProperties(t,()=>!1))return;e[i]=t}}),e}load(){if(!this.rr){var e=this.Dt.F(this.Yt);e&&(this.props=i6({},e)),this.Qt&&this.sr()}}sr(){for(var e of rn){var t=sm.F(this.ir(e));if(t&&!Q(t)){var i=this.ar(e);i.persisted=!0,this.lr(e)||(i.fingerprint=this.ur(t,e)),this.hr(e,t)||i6(this.props,t)}}}lr(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=rl(t))?void 0:i.storageGroup)===e})}hr(e,t){var i=r$[e];if(!i)return!1;var s=t[i],r=this.props[i];return es(s)&&es(r)&&r>s}refreshKey(e){var t;if(!this.rr){var i=this.Qt?null==(t=rl(e))?void 0:t.storageGroup:void 0,s=i?sm.F(this.ir(i)):this.Dt.F(this.Yt);if(s&&e in s)this.dr(e,s[e]);else{if(i){var r=this.Dt.F(this.Yt);if(r&&e in r)return void this.dr(e,r[e])}this.cr(e)}}}save(){if(!this.rr){var e=this.tr();e>0?Z(this.vr)&&(this.vr=setTimeout(()=>{this.vr=void 0,this.pr()},e)):this.pr()}}flush(){Z(this.vr)||(clearTimeout(this.vr),this.vr=void 0,this.pr())}pr(){this.rr||(this.Qt?this.gr():this.mr(this.Dt,this.Yt,this.props,rR))}gr(){var{main:e,groups:t}=this.yr();for(var i of(this.mr(this.Dt,this.Yt,e,rR),rn)){var s,r=t[i];(!Q(r)||null!=(s=this.Gt[i])&&s.persisted)&&this.mr(sm,this.ir(i),r,i)}}yr(){var e={},t={};for(var i of rn)t[i]={};return i8(this.props,(i,s)=>{var r,n=null==(r=rl(s))?void 0:r.storageGroup;n?t[n][s]=i:e[s]=i}),{main:e,groups:t}}ur(e,t){if(t===rR)return JSON.stringify(e)+"|"+this.br+"|"+this._r+"|"+this.wr;var i={};return i8(e,(e,t)=>{var s;i[t]=null!=(s=rl(t))&&s.volatile?"__volatile__":e}),JSON.stringify(i)}mr(e,t,i,s){var r,n=this.ar(s);if(s===rR||n.dirty||Z(n.fingerprint)){try{if((r=this.ur(i,s))===n.fingerprint)return void(n.dirty=!1)}catch(e){r=void 0}e.q(t,i,this.br,this._r,this.wr,this.Se.debug)?(n.dirty=!1,s!==rR&&(n.persisted=!0),Z(r)||(n.fingerprint=r)):this.Se.debug&&tZ.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var{keepGroupEntries:t=!1}=void 0===e?{}:e;if(Z(this.vr)||(clearTimeout(this.vr),this.vr=void 0),this.Dt.P(this.Yt,!1),this.Dt.P(this.Yt,!0),!t&&this.Jt)for(var i of rn)sm.P(this.ir(i));t?delete this.Gt[rR]:this.Gt={}}clear(){this.remove(),this.props={}}register_once(e,t,i){if(K(e)){Z(t)&&(t="None"),this.br=Z(i)?this.kr:i;var s=!1;if(i8(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.dr(i,e),s=!0)}),s)return this.save(),!0}return!1}register(e,t){if(K(e)){this.br=Z(t)?this.kr:t;var i=!1;if(i8(e,(t,s)=>{e.hasOwnProperty(s)&&this.props[s]!==t&&(this.dr(s,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.cr(e),this.save())}update_campaign_params(){if(!this.Kt){var e=rb(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);Q(se(e))||this.register(e),this.Kt=!0}}update_search_keyword(){var e;this.register((e=null==o?void 0:o.referrer)?rx(e):{})}update_referrer_info(){var e;this.register_once({$referrer:rE(),$referring_domain:null!=o&&o.referrer&&(null==(e=ru(o.referrer))?void 0:e.host)||rk},void 0)}set_initial_person_info(){this.props[iD]||this.props[iN]||this.register_once({[ij]:rP(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes
1)},void 0)}get_initial_props(){var e,t,i,s={};i8([iN,iD],e=>{var t=this.props[e];t&&i8(t,function(e,t){s["$initial_"+U(t)]=e})});var r=this.props[ij];return r&&i6(s,(void 0===(e=this.Se.disable_capture_url_hashes)&&(e=!1),t=rF(r,e),i={},i8(t,function(e,t){i["$initial_"+U(t)]=e}),i)),s}safe_merge(e){return i8(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){this.kr=this.br=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var s=e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),s=[...t].sort();return i.every((e,t)=>e===s[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),r=s?this.Xt(e):this.Dt,n=this.er(e);if(s||n!==this.Qt){var a=this.props;this.clear(),this.Dt=r,this.Qt=n,this.props=a,this.save()}}set_disabled(e){this.rr=e,this.rr?this.remove():this.save()}set_cross_subdomain(e){e!==this._r&&(this._r=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.wr&&(this.wr=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[t6]||{};i[e]=t,this.dr(t6,i),this.save()}remove_event_timer(e){var t=this.props[t6]||{},i=t[e];return Z(i)||(delete t[e],this.dr(t6,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.dr(e,t),this.save()}dr(e,t){var i;this.props[e]=t,null!=(i=rl(e))&&i.volatile||this.Sr(e)}cr(e){delete this.props[e],this.Sr(e)}Sr(e){var t,i=null==(t=rl(e))?void 0:t.storageGroup;i&&(this.ar(i).dirty=!0)}ar(e){return this.Gt[e]||(this.Gt[e]={})}}var rC="events",rO="cancelEvents",rM="survey shown",rL="survey dismissed",rD="survey sent",rN="popover",rj=tX("[RateLimiter]");class rq{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=>{rj.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void rj.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,s,{captureEventsBurstLimit:r,captureEventsPerSecond:n}=this,a=(new Date).getTime(),o=null!=(t=null==(i=this.instance.persistence)?void 0:i.get_property(iL))?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;return l||e||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+n+" events per second and "+r+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(s=this.instance.persistence)||s.set_property(iL,o),{isRateLimited:l,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var rz=tX("[RemoteConfig]");class rB{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}Cr(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Ir(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback(t){e(t.json)}})}load(){try{if(this.remoteConfig)return rz.info("Using preloaded remote config",this.remoteConfig),this.Tr(this.remoteConfig),void this.Mr();if(this._instance.Er())return void rz.warn("Remote config is disabled. Falling back to local config.");this.Cr(e=>{e?(this.Tr(e),this.Mr()):(rz.info("No config found after loading remote JS config. Falling back to JSON."),this.Ir(e=>{this.Tr(e),this.Mr()}))})}catch(e){rz.error("Error loading remote config",e)}}stop(){this.Pr&&(clearInterval(this.Pr),this.Pr=void 0)}
vendor: 4,280 bytes, line 1
1refresh(){!this._instance.Er()&&o&&"hidden"!==o.visibilityState&&this._instance.reloadFeatureFlags()}Mr(){var e;if(!this.Pr){var t=null!=(e=this._instance.config.remote_config_refresh_interval_ms)?e:3e5;0!==t&&(this.Pr=setInterval(()=>{this.refresh()},t))}}Tr(e){var t;e||rz.error("Failed to fetch remote config from PostHog."),this._instance.Tr(null!=e?e:{}),!1!==(null==e?void 0:e.hasFeatureFlags)&&(this._instance.config.advanced_disable_feature_flags_on_first_load||null==(t=this._instance.featureFlags)||t.ensureFlagsLoaded())}}var rH="gzip-js",rU="base64",rV=Uint8Array,rG=Uint16Array,rW=Uint32Array,rY=new rV([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]),rJ=new rV([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]),rK=new rV([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rQ=function(e,t){for(var i=new rG(31),s=0;31>s;++s)i[s]=t+=1<<e[s-1];var r=new rW(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]},rZ=rQ(rY,2),rX=rZ[1];rZ[0][28]=258,rX[258]=28;for(var r0=rQ(rJ,0)[1],r1=new rG(32768),r2=0;32768>r2;++r2){var r3=(43690&r2)>>>1|(21845&r2)<<1;r1[r2]=((65280&(r3=(61680&(r3=(52428&r3)>>>2|(13107&r3)<<2))>>>4|(3855&r3)<<4))>>>8|(255&r3)<<8)>>>1}var r5=function(e,t,i){for(var s=e.length,r=0,n=new rG(t);s>r;++r)++n[e[r]-1];var a,o=new rG(t);for(r=0;t>r;++r)o[r]=o[r-1]+n[r-1]<<1;if(i){a=new rG(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[r1[c]>>>l]=u}else for(a=new rG(s),r=0;s>r;++r)a[r]=r1[o[e[r]-1]++]>>>15-e[r];return a},r8=new rV(288);for(r2=0;144>r2;++r2)r8[r2]=8;for(r2=144;256>r2;++r2)r8[r2]=9;for(r2=256;280>r2;++r2)r8[r2]=7;for(r2=280;288>r2;++r2)r8[r2]=8;var r6=new rV(32);for(r2=0;32>r2;++r2)r6[r2]=5;var r4=r5(r8,9,0),r7=r5(r6,5,0),r9=function(e){return(e/8|0)+(7&e&&1)},ne=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var s=new(e instanceof rG?rG:e instanceof rW?rW:rV)(i-t);return s.set(e.subarray(t,i)),s},nt=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8},ni=function(e,t,i){var s=t/8|0;e[s]|=i<<=7&t,e[s+1]|=i>>>8,e[s+2]|=i>>>16},ns=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 rV(0),0];if(1==r){var a=new rV(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 rG(d+1),v=nr(i[h-1],p,0);if(v>t){s=0;var g=0,_=v-t,f=1<<_;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+=f-(1<<v-p[m]),p[m]=t}for(g>>>=_;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 rV(p),v]},nr=function(e,t,i){return -1==e.s?Math.max(nr(e.l,t,i+1),nr(e.r,t,i+1)):t[e.s]=i},nn=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new rG(++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]},na=function(e,t){for(var i=0,s=0;t.length>s;++s)i+=e[s]*t[s];return i},no=function(e,t,i){var s=i.length,r=r9(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)},nl=function(e,t,i,s,r,n,a,o,l,u,h){nt(t,h++,i),++r[256];for(var c=ns(r,15),d=c[0],p=c[1],v=ns(n,15),g=v[0],_=v[1],f=nn(d),m=f[0],y=f[1],b=nn(g),w=b[0],x=b[1],S=new rG(19),k=0;m.length>k;++k)S[31&m[k]]++;for(k=0;w.length>k;++k)S[31&w[k]]++;for(var E=ns(S,7),P=E[0],F=E[1],A=19;A>4&&!P[rK[A-1]];--A);var $,I,R,T,C=u+5<<3,O=na(r,r8)+na(n,r6)+a,M=na(r,d)+na(n,g)+a+14+3*A+na(S,P)+(2*S[16]+3*S[17]+7*S[18]);if(O>=C&&M>=C)return no(t,h,e.subarray(l,l+u));if(nt(t,h,1+(O>M)),h+=2,O>M){$=r5(d,p,0),I=d,R=r5(g,_,0),T=g;var L=r5(P,F,0);for(nt(t,h,y-257),nt(t,h+5,x-1),nt(t,h+10,A-4),h+=14,k=0;A>k;++k)nt(t,h+3*k,P[rK[k]]);h+=3*A;for(var D=[m,w],N=0;2>N;++N){var j=D[N];for(k=0;j.length>k;++k)nt(t,h,L[q=31&j[k]]),h+=P[q],q>
115&&(nt(t,h,j[k]>>>5&127),h+=j[k]>>>12)}}else $=r4,I=r8,R=r7,T=r6;for(k=0;o>k;++k)if(s[k]>255){ni(t,h,$[257+(q=s[k]>>>18&31)]),h+=I[q+257],q>7&&(nt(t,h,s[k]>>>23&31),h+=rY[q]);var q,z=31&s[k];ni(t,h,R[z]),h+=T[z],z>3&&(ni(t,h,s[k]>>>5&8191),h+=rJ[z])}else ni(t,h,$[s[k]]),h+=I[s[k]];return ni(t,h,$[256]),h+I[256]},nu=new rW([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nh=function(){for(var e=new rW(256),t=0;256>t;++t){for(var i=t,s=9;--s;)i=(1&i&&0xedb88320)^i>>>1;e[t]=i}return e}(),nc=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},nd=!!h||!!u,np="text/plain",nv=!1,ng=(e,t)=>{var[i,s]=e.split("#"),[r,n]=i.split("?");if(!n)return e;var a=n.split("&").filter(e=>e.split("=")[0]!==t).join("&");return r+(a?"?"+a:"")+(s?"#"+s:"")},n_=function(e,t,i){void 0===i&&(i=!0);var s,r,n,a,o,[l,u]=e.split("?"),h=b({},t),c=null!=(o=null==u?void 0:u.split("&").map(e=>{var t,[s,r]=e.split("="),n=i&&null!=(t=h[s])?t:r;return delete h[s],s+"="+n}))?o:[],d=(void 0===s&&(s="&"),a=[],i8(h,function(e,t){Z(e)||Z(t)||"undefined"===t||(r=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),a[a.length]=n+"="+r)}),a.join(s));return d&&c.push(d),l+"?"+c.join("&")},nf=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),nm=e=>{if(e.Lt)return e.Lt;var{data:t,compression:i}=e;if(t){if(i===rH){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 rV(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 rV(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 ne(i,0,s)}(nf(t)),r={mtime:0},n=0xffffffff,a={p(e){for(var t=n,i=0;e.length>i;++i)t=nh[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 rV(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=no(a,o,e.subarray(l,u)):(a[l]=!0,o=no(a,o,e.subarray(l,r)))}else{for(var h=nu[t-1],c=h>>>13,d=8191&h,p=(1<<i)-1,v=new rG(32768),g=new rG(p+1),_=Math.ceil(i/3),f=2*_,m=function(t){return(e[t]^e[t+1]<<_^e[t+2]<<f)&p},y=new rW(25e3),b=new rG(288),w=new rG(32),x=0,S=0,k=(l=0,0),E=0,P=0;r>l;++l){var F=m(l),A=32767&l,$=g[F];if(v[A]=$,g[F]=A,l>=E){var I=r-l;if((x>7e3||k>24576)&&I>
1423){o=nl(e,a,0,y,b,w,S,k,P,l-P,o),k=x=S=0,P=l;for(var R=0;286>R;++R)b[R]=0;for(R=0;30>R;++R)w[R]=0}var T=2,C=0,O=d,M=A-$&32767;if(I>2&&F==m(l-M))for(var L=Math.min(c,I)-1,D=Math.min(32767,l),N=Math.min(258,I);D>=M&&--O&&A!=$;){if(e[l+T]==e[l+T-M]){for(var j=0;N>j&&e[l+j]==e[l+j-M];++j);if(j>T){if(T=j,C=M,j>L)break;var q=Math.min(M,j-2),z=0;for(R=0;q>R;++R){var B=l-M+R+32768&32767,H=B-v[B]+32768&32767;H>z&&(z=H,$=B)}}}M+=(A=$)-($=v[A])+32768&32767}if(C){y[k++]=0x10000000|rX[T]<<18|r0[C];var U=31&rX[T],V=31&r0[C];S+=rY[U]+rJ[V],++b[257+U],++w[V],E=l+T,++x}else y[k++]=e[l],++b[e[l]]}}o=nl(e,a,!0,y,b,w,S,k,P,l-P,o)}return ne(n,0,s+r9(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&&nc(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),nc(u,h-8,a.d()),nc(u,h-4,o),u);return{contentType:np,body:c.buffer.slice(c.byteOffset,c.byteOffset+c.byteLength),estimatedSize:c.byteLength}}if(i===rU){let e;var d,p="data="+encodeURIComponent("string"==typeof(e=(d=nf(t))?btoa(encodeURIComponent(d).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):d)?e:nf(e));return{contentType:"application/x-www-form-urlencoded",body:p,estimatedSize:new Blob([p]).size}}var v=nf(t);return{contentType:"application/json",body:v,estimatedSize:new Blob([v]).size}}},ny=e=>{var t,i,s=()=>({url:ng(e.url,"compression"),encodedBody:nm(b({},e,{compression:void 0,Lt:void 0}))});try{t=nm(e)}catch(t){if(M(e.compression,rh(e.url,"compression")))return tZ.error("Failed to gzip request body, sending uncompressed payload",t),s();throw t}return!(t&&M(e.compression,rh(e.url,"compression")))||((i=t.body)instanceof ArrayBuffer?O(new Uint8Array(i)):ArrayBuffer.isView(i)&&O(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?{url:e.url,encodedBody:t}:(nv=!0,s())},nb=e=>{try{return ny(e)}catch(t){return tZ.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},nw=(t=y(function*(e){var t=nf(e.data),i=yield function(e,t,i){return j.apply(this,arguments)}(t,f.DEBUG,{rethrow:!0});if(!i)return e;var s=yield i.arrayBuffer();return b({},e,{Lt:{contentType:np,body:s,estimatedSize:s.byteLength}})}),function(e){return t.apply(this,arguments)}),nx=["/e/","/s/"],nS=(e,t)=>{var i,s,r,n=(r=(s=(null==(i=ru(e))?void 0:i.pathname)||e.split(/[?#]/)[0])?"/"===s[0]?s:"/"+s:"/",nx.some(e=>r.slice(r.length-e.length)===e)),a=n?ng(e,"ver"):e;return n_(t===rH?ng(a,"compression"):a,b({_:(new Date).getTime().toString()},n?{}:{ver:f.JS_SDK_VERSION},t===rH?{}:{compression:t}))},nk=[];u&&nk.push({transport:"fetch",method(e){var t,i=nb(e);if(i){var{url:s,encodedBody:r}=i,{contentType:n,body:a,estimatedSize:o}=null!=r?r:{},l=new Headers;i8(e.headers,function(e,t){l.append(t,e)}),n&&l.append("Content-Type",n);var h=null,d=!1;if(c){var p=new c;h={signal:p.signal,timeout:setTimeout(()=>{var t,i;d=!0,p.abort(((i=Error("PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":""))).name="AbortError",i))},e.timeout)}}u(s,b({method:(null==e?void 0:e.method)||"GET",headers:l,keepalive:"POST"===e.method&&52428.8>(o||0),body:a,signal:null==(t=h)?void 0:t.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){tZ.error(e)}null==e.callback||e.callback(s)})).catch(t=>{d&&"AbortError"===(null==t?void 0:t.name)?tZ.warn(t):tZ.error(t),null==e.callback||e.callback({statusCode:0,error:t})}).finally(()=>h?clearTimeout(h.timeout):null)}}}),h&&nk.push({transport:"XHR",method(e){var t=nb(e);if(t){var i=new h,{url:s,encodedBody:r}=t;i.open(e.method||"GET",s,!0);var{contentType:n,body:a}=null!=r?r:{};i8(e.headers,function(e,t){i.setRequestHeader(t,e)}),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(a)}}}),null!=a&&a.sendBeacon&&nk.push({transport:"sendBeacon",method(e){try{var{url:t,encodedBody:i}=ny(e),{contentType:s,body:r}=null!=i?i:{};if(!r)return;var n=r instanceof Blob?r:new Blob([r],{type:s});a.sendBeacon(t,n)}catch(e){}}});
1class nE{constructor(e,t){this.Rr=!0,this.Or=[],this.Lr=ep((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,tZ.createLogger("flush interval"),3e3),this.Fr=e}enqueue(e){this.Or.push(e),this.Ar||this.Dr()}unload(){this.$r();var e=Object.values(this.Or.length>0?this.Nr():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.qr(b({},e,{transport:"sendBeacon"}))})}enable(){this.Rr=!1,this.Dr()}Dr(){var e=this;this.Rr||(this.Ar=setTimeout(()=>{if(this.$r(),this.Or.length>0){var t=this.Nr();for(var i in t)!function(){var s=t[i],r=(new Date).getTime();s.data&&Y(s.data)&&i8(s.data,e=>{e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.qr(s)}()}},this.Lr))}qr(e){try{this.Fr(e)}catch(e){tZ.error(e)}}$r(){clearTimeout(this.Ar),this.Ar=void 0}Nr(){var e={};return i8(this.Or,t=>{var i,s=(t?t.batchKey:null)||t.url;Z(e[s])&&(e[s]=b({},t,{data:[]})),null==(i=e[s].data)||i.push(t.data)}),this.Or=[],e}}var nP=["retriesPerformedSoFar"];class nF{constructor(e){this.Br=!1,this.jr=3e3,this.Or=[],this._instance=e,this.Or=[],this.Hr=!0,!Z(r)&&"onLine"in r.navigator&&(this.Hr=r.navigator.onLine,this.Ur=()=>{this.Hr=!0,this.zr()},this.Vr=()=>{this.Hr=!1},si(r,"online",this.Ur),si(r,"offline",this.Vr))}get length(){return this.Or.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=w(e,nP);er(t)&&(i.url=n_(i.url,{retry_count:t})),this._instance._send_request(b({},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.st(b({retriesPerformedSoFar:t},i));0===e.statusCode&&tZ.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)}}))}st(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.Or.push({retryAt:n,requestOptions:e});var a="Enqueued failed request for retry in "+r;navigator.onLine||(a+=" (Browser is offline)"),tZ.warn(a),this.Br||(this.Br=!0,this.Wr())}Wr(){(this.Gr&&clearTimeout(this.Gr),0===this.Or.length)?(this.Br=!1,this.Gr=void 0):this.Gr=setTimeout(()=>{this.Hr&&this.Or.length>0&&this.zr(),this.Wr()},this.jr)}zr(){var e=Date.now(),t=[],i=this.Or.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.Or=t,i.length>0)for(var{requestOptions:s}of i)this.retriableRequest(s)}unload(){for(var{requestOptions:e}of(this.Gr&&(clearTimeout(this.Gr),this.Gr=void 0),this.Br=!1,Z(r)||(this.Ur&&(r.removeEventListener("online",this.Ur),this.Ur=void 0),this.Vr&&(r.removeEventListener("offline",this.Vr),this.Vr=void 0)),this.Or))try{this._instance._send_request(b({},e,{transport:"sendBeacon"}))}catch(e){tZ.error(e)}this.Or=[]}}class nA{constructor(e){this.Zr=()=>{this.Qr||(this.Qr={});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.Qr.lastScrollY=Math.ceil(n),this.Qr.maxScrollY=Math.max(n,null!=(e=this.Qr.maxScrollY)?e:0),this.Qr.maxScrollHeight=Math.max(a,null!=(t=this.Qr.maxScrollHeight)?t:0),this.Qr.lastContentY=o,this.Qr.maxContentY=Math.max(o,null!=(i=this.Qr.maxContentY)?i:0),this.Qr.maxContentHeight=Math.max(l,null!=(s=this.Qr.maxContentHeight)?s:0)},this._instance=e}get Jr(){return this._instance.config.scroll_root_selector}getContext(){return this.Qr}resetContext(){var e=this.Qr;return setTimeout(this.Zr,0),e}startMeasuringScrollPosition(){si(r,"scroll",this.Zr,{capture:!0}),si(r,"scrollend",this.Zr,{capture:!0}),si(r,"resize",this.Zr)}scrollElement(){if(!this.Jr)return null==r?void 0:r.document.documentElement;for(var e of Y(this.Jr)?this.Jr:[this.Jr]){var t=null==r?void 0:r.document.querySelector(e);if(t)return t}}Kr(e){if(this.Jr){var t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return r?"y"===e?r.scrollY||r.pageYOffset||r.document.documentElement.scrollTop||0:r.scrollX||r.pageXOffset||r.document.documentElement.scrollLeft||0:0}scrollY(){return this.Kr("y")}scrollX(){return this.Kr("x")}}var n$=e=>rP(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
1);class nI{constructor(e,t,i,s){this.Yr=e=>{var t=this.Xr();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.ei(this._instance)};this.ti.register({[iM]:i})}},this._instance=e,this.ri=t,this.ti=i,this.ei=s||n$,this.ri.onSessionId(this.Yr)}Xr(){return this.ti.props[iM]}getSetOnceProps(){var e,t=null==(e=this.Xr())?void 0:e.props;return t?"r"in t?rF(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 i8(se(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+U(i)]=t}),e}}class nR{constructor(){this.ii={}}on(e,t){return this.ii[e]||(this.ii[e]=[]),this.ii[e].push(t),()=>{this.ii[e]=this.ii[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.ii[e]||[])i(t);for(var s of this.ii["*"]||[])s(e,t)}}var nT=tX("[SessionId]");class nC{on(e,t){return this.ni.on(e,t)}constructor(e,t,i){if(this.si=null,this.oi=[],this.ai=void 0,this.li=!1,this.ni=new nR,this.ui=(e,t)=>!(!er(e)||!er(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===iY)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Se=e.config,this.ti=e.persistence,this.hi=void 0,this.di=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ci=t||sd,this.vi=i||sd;var s,r=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*ep(this.Se.session_idle_timeout_seconds||1800,60,36e3,nT.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.fi(),this.pi="ph_"+r+"_window_id",this.gi="ph_"+r+"_primary_window_exists",this.mi()){var n=sS.F(this.pi),a=sS.F(this.gi);
1n&&!a?this.hi=n:sS.P(this.pi),sS.q(this.gi,!0)}if(null!=(s=this.Se.bootstrap)&&s.sessionID)try{var o=(e=>{var t=this.Se.bootstrap.sessionID.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})();this.yi(this.Se.bootstrap.sessionID,(new Date).getTime(),o)}catch(e){nT.error("Invalid sessionID in bootstrap",e)}this.bi()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Z(this.oi)&&(this.oi=[]),this.oi.push(e),this.di&&e(this.di,this.hi),()=>{this.oi=this.oi.filter(t=>t!==e)}}mi(){return"memory"!==this.Se.persistence&&!this.ti.rr&&sS.N()}wi(e){e!==this.hi&&(this.hi=e,this.mi()&&sS.q(this.pi,e))}xi(){return this.hi?this.hi:this.mi()?sS.F(this.pi):null}ki(e){var t=this.si;return!et(t)&&!et(e)&&5e3>Math.abs(e-t)}yi(e,t,i){var s=t!==this._sessionActivityTimestamp,r=e===this.di&&i===this._sessionStartTimestamp;this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.di=e,r&&!s||r&&this.ki(t)||(this.si=t,this.ti.register({[ip]:[t,e,i]}))}Si(){var e,t=null==(e=this.Se)?void 0:e.persistence_save_debounce_ms;return er(t)&&t>0}Ci(){this.Si()?this.ti.refreshKey(ip):(this.ti.flush(),this.ti.load())}Ii(){var e;if(!et(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.si){this.Ci();var[,t,i]=this.Ti();t===this.di&&i===this._sessionStartTimestamp&&(this.si=this._sessionActivityTimestamp,this.ti.register({[ip]:[this._sessionActivityTimestamp,null!=(e=this.di)?e:null,this._sessionStartTimestamp]}),this.ti.flush())}}Mi(){var[e]=this.Ti();return Math.max(er(e)?e:0,er(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}Ei(e){return this.Ci(),this.ui(e,this.Mi())}Ti(){var e=this.ti.props[ip];return Y(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.si=null,clearTimeout(this.Pi),this.Pi=void 0,this.yi(null,null,null)}destroy(){this.li=!0,this.Ii(),clearTimeout(this.Pi),this.Pi=void 0,this.ai&&r&&(r.removeEventListener(iX,this.ai,{capture:!1}),this.ai=void 0),this.oi=[]}bi(){this.ai=()=>{this.Ii(),this.mi()&&sS.P(this.gi)},si(r,iX,this.ai,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.Se.cookieless_mode===iY)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[,s,r]=this.Ti(),n=this.Mi(),a=this.xi(),o=er(r)&&Math.abs(i-r)>864e5,l=!1,u=!1,h=!s,c=s,d=!h&&!e&&this.ui(i,n);d&&((d=this.Ei(i))||nT.info("cross-tab refresh kept the session alive",{sessionId:s}),[,s,r]=this.Ti()),h||d||o?(s=this.ci(),a=this.vi(),nT.info("new session ID generated",{sessionId:s,windowId:a,changeReason:{noSessionId:h,activityTimeout:d,sessionPastMaximumLength:o}}),r=i,l=!0):(a||(a=this.vi(),l=!0),(u=s!==c)&&(nT.info("adopted cross-tab session id",{sessionId:s,windowId:a}),l=!0));var p=er(n)&&e&&!o?n:i,v=er(r)?r:(new Date).getTime();this.wi(a),this.yi(s,p,v),e||this.fi();var g={noSessionId:h,activityTimeout:d,sessionPastMaximumLength:o,crossTabAdoption:u};return l&&this.oi.forEach(e=>e(s,a,g)),{sessionId:s,windowId:a,sessionStartTimestamp:v,changeReason:l?g:void 0,lastActivityTimestamp:n}}fi(){this.li||(clearTimeout(this.Pi),this.Pi=setTimeout(()=>{if(!this.li)if(this.Ei((new Date).getTime())){var e=this.di;this.resetSessionId(),this.ni.emit("forcedIdleReset",{idleSessionId:e})}else this.fi()},1.1*this.sessionTimeoutMs))}}var nO=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&z(i,t))return!0;try{var s=null==e?void 0:e.userAgentData;if(null!=s&&s.brands&&s.brands.some(e=>z(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function nM(){return(nM=y(function*(){var e=null==a?void 0:a.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return X(i)&&i.length>0?i:void 0}catch(e){return void tZ.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}var nL=function(e,t){if(!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t))return!1;try{return new RegExp(t).test(e)}catch(e){return!1}};function nD(e,t,i){return nf({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var nN={exact:(e,t)=>
1t.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=>nL(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!nL(t,e))),icontains:(e,t)=>t.map(nj).some(t=>e.map(nj).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(nj).every(t=>e.map(nj).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))})},nj=e=>e.toLowerCase();function nq(e,t){return!e||Object.entries(e).every(e=>{var[i,s]=e,r=null==t?void 0:t[i];if(Z(r)||et(r))return!1;var n=[String(r)],a=nN[s.operator];return!!a&&a(s.values,n)})}var nz="custom",nB="i.posthog.com",nH=/^\/static\//;class nU{constructor(e){this.Ri={},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("."+nB,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Ri[this.apiHost]||(this.Ri[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":nz),this.Ri[this.apiHost]}Oi(e){if(nH.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if("assets"===e){var i=this.Oi(t);if(i)return""+i+t}if(this.region===nz)return this.apiHost+t;var s=nB+t;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}var nV=tX("[Surveys]"),nG="seenSurvey_",nW=e=>{try{var t,i=(t=""+nG+e.id,e.current_iteration&&e.current_iteration>0&&(t=""+nG+e.id+"_"+e.current_iteration),t);
1if(localStorage.getItem(i))return;localStorage.setItem(i,"true")}catch(e){nV.error("Failed to persist survey seen state",e)}},nY=["popover","widget","api"],nJ={ignoreConditions:!1,ignoreDelay:!1,displayType:rN},nK=tX("[PostHog ExternalIntegrations]"),nQ={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class nZ{constructor(e){this._instance=e}Bt(e,t){var i;null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return nK.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,s,n;!r||null!=(i=v.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.Bt(nQ[e],()=>{var i;null==(i=v.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!r&&null!=(s=v.__PosthogExtensions__)&&null!=(s=s.integrations)&&s[e]&&(null==(n=v.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[s,r]of Object.entries(null!=(e=this._instance.config.integrations)?e:{}))i(s)}}var nX={},n0=0,n1=()=>{},n2='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',n3="Surveys module not available",n5="sanitize_properties is deprecated. Use before_send instead",n8="Invalid value for property_denylist config: ",n6="posthog",n4=!nd&&-1===(null==p?void 0:p.indexOf("MSIE"))&&-1===(null==p?void 0:p.indexOf("Mozilla")),n7=e=>{var t;return b({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(!X(t))return!1;var i=t.split(".").slice(-2).join(".");for(var s of st)if(i===s)return!1;return!0}(null==o?void 0:o.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:n1,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:l&&X(null==l?void 0:l.search)&&-1!==l.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:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==r||null==(t=r.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){tZ.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:iQ,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:n1},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:sB,ignore_text_selection:!0}
1:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,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)})},n9=[["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"]],ae=e=>{var t={};for(var[i,s]of n9)Z(e[i])||(t[s]=e[i]);var r=i6({},t,e),n=e.__preview_external_dependency_versioned_paths;return Z(n)||(Z(e.strict_script_versioning)&&(r.strict_script_versioning=!!n),X(n)&&Z(e.asset_host)&&(r.asset_host=n)),Y(e.property_blacklist)&&(Z(e.property_denylist)?r.property_denylist=e.property_blacklist:Y(e.property_denylist)?r.property_denylist=[...e.property_blacklist,...e.property_denylist]:tZ.error(n8+e.property_denylist)),r};class at{constructor(){this.__forceAllowLocalhost=!1}get Li(){return this.__forceAllowLocalhost}set Li(e){tZ.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class ai{Fi(e,t){if(e){var i=this.Ai.indexOf(e);-1!==i&&this.Ai.splice(i,1)}return this.Ai.push(t),null==t.initialize||t.initialize(),t}Di(){return this.config.cookieless_mode===iY||this.config.cookieless_mode===iW&&this.consent.isRejected()}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 at,this.$i=!1,this.version=f.LIB_VERSION,this.Ni=new nR,this.Ai=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=n7(),this.SentryIntegration=rs,this.sentryIntegration=e=>{var t;return t=ri(this,e),{name:rt,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.qi=!1,this.Bi=null,this.ji=null,this.Hi=null,this.scrollManager=new nA(this),this.pageViewManager=new rr(this),this.rateLimiter=new rq(this),this.requestRouter=new nU(this),this.consent=new sk(this),this.externalIntegrations=new nZ(this);var e,t=null!=(e=ai.__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=X(e)?{[e]:t}:e;this.setPersonProperties(s),null==i||i({})},set_once:(e,t,i)=>{var s=X(e)?{[e]:t}:e;this.setPersonProperties(void 0,s),null==i||i({})}},this.on("eventCaptured",e=>tZ.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==n6){var s,r=null!=(s=nX[i])?s:new ai;return r._init(e,t,i),nX[i]=r,nX[n6][i]=r,r}return this._init(e,t,i)}_init(e,t,i){void 0===t&&(t={});var s,n,a=X(e)?e.trim():"";if(!a)return tZ.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},t.debug=this.Ui(t.debug),this.zi=t,this.Vi=[],t.person_profiles?this.ji=t.person_profiles:t.process_person&&(this.ji=t.process_person);var o=n7(t.defaults),l=ae(t),u=i6({},o,l,{name:i,token:a});K(o.rageclick)&&K(l.rageclick)&&(u.rageclick=i6({},o.rageclick,l.rageclick)),K(o.session_recording)&&K(l.session_recording)&&(u.session_recording=i6({},o.session_recording,l.session_recording)),this.set_config(u),this.config.on_xhr_error&&tZ.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:rH;var h=this.Wi();this.persistence=new rT(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rT(b({},this.config,{persistence:"sessionStorage"}),h,!1);var c=b({},this.persistence.props),d=b({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.Gi=new nE(e=>this.Zi(e),this.config.request_queue_config),this.Qi=new nF(this),this.__request_queue=[];var p=this.Di();if(p||(this.sessionManager=new nC(this),this.sessionPropsManager=new nI(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(tZ.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Ji(p)},0)):(tZ.info("Initializing extensions synchronously"),this.Ji(p)),f.DEBUG=f.DEBUG||this.config.debug,f.DEBUG&&tZ.info("Starting in debug mode",{this:this,config:t,thisC:b({},this.config),p:c,s:d}),!this.config.identity_distinct_id||null!=(s=t.bootstrap)&&s.distinctID||(t.bootstrap=b({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0}
1)),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var v=t.bootstrap.distinctID,g=this.get_distinct_id(),_=this.persistence.get_property(iO);if(t.bootstrap.isIdentifiedID&&null!=g&&g!==v&&_===iJ)this.identify(v);else if(t.bootstrap.isIdentifiedID&&null!=g&&g!==v&&_===iK)tZ.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 m=this.config.get_device_id(sd()),y=t.bootstrap.isIdentifiedID?m:v;this.persistence.set_property(iO,t.bootstrap.isIdentifiedID?iK:iJ),this.register({distinct_id:v,$device_id:y})}}if(p)this.register_once({distinct_id:iB,$device_id:null},"");else if(!this.get_distinct_id()){var w=this.config.get_device_id(sd());this.register_once({distinct_id:w,$device_id:w},""),this.persistence.set_property(iO,iJ)}return si(r,"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()||sd();e.config.get_device_id=s,i.id()&&(e.register({distinct_id:i.id(),$device_id:s()}),e.persistence.set_property(iO,iK)),t()},r=i.user();"then"in r&&J(r.then)?r.then(s):s(r)}(e,()=>{var s;i.register(("u">typeof Promise&&Promise.resolve||re.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()||(re.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(re.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,i0),identify:e=>s(e,i2),screen:e=>s(e,"$screen")})).then(()=>{t()})})}(this,()=>this.Ki()):this.Ki(),J(this.config._onCapture)&&this.config._onCapture!==n1&&(tZ.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&tZ.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 nM.apply(this,arguments)})().then(e=>{e&&this.register({[t5]:e})}).catch(n1),this}Ji(e){var t,i,s,r,n,a,o,l,u=performance.now(),h=b({},ai.__defaultExtensionClasses,this.config.__extensionClasses),c=[];h.featureFlags&&this.Ai.push(this.featureFlags=null!=(t=this.featureFlags)?t:new h.featureFlags(this)),h.exceptions&&this.Ai.push(this.exceptions=null!=(i=this.exceptions)?i:new h.exceptions(this)),h.historyAutocapture&&this.Ai.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.Ai.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this.Ai.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!e&&this.Ai.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||c.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),h.autocapture&&this.Ai.push(this.autocapture=new h.autocapture(this)),h.surveys&&this.Ai.push(this.surveys=null!=(s=this.surveys)?s:new h.surveys(this)),h.logs&&this.Ai.push(this.logs=null!=(r=this.logs)?r:new h.logs(this)),h.metrics&&this.Ai.push(this.metrics=null!=(n=this.metrics)?n:new h.metrics(this)),h.conversations&&this.Ai.push(this.conversations=null!=(a=this.conversations)?a:new h.conversations(this)),h.productTours&&this.Ai.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.Ai.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.Ai.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.Ai.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.Ai.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,s7)),h.toolbar&&this.Ai.push(this.toolbar=null!=(o=this.toolbar)?o:new h.toolbar(this)),h.experiments&&this.Ai.push(this.experiments=null!=(l=this.experiments)?l:new h.experiments(this)),this.Ai.forEac
1h(e=>{e.initialize&&c.push(()=>{null==e.initialize||e.initialize()})}),c.push(()=>{if(this.Yi){var e=this.Yi;this.Yi=void 0,this.Tr(e)}}),this.Xi(c,u)}Xi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Xi(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){tZ.error("Error initializing extension:",e)}}var s=Math.round(performance.now()-t);this.register_for_session({[iH]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[iU]:s}),this.config.__preview_deferred_init_extensions&&tZ.info("PostHog extensions initialized ("+s+"ms)")}Tr(e){var t;o&&o.body?(this.config.__preview_deferred_init_extensions&&(this.Yi=e),this.en=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=B(e.supportedCompression,rH)?rH:B(e.supportedCompression,rU)?rU:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.ji?this.ji:iQ}),this.Ai.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))):(tZ.info("document not ready yet, trying again in 500 milliseconds..."),setTimeout(()=>{this.Tr(e)},500))}Ki(){try{this.config.loaded(this)}catch(e){tZ.critical("`loaded` function failed",e)}if(this.tn(),this.config.internal_or_test_user_hostname&&null!=l&&l.hostname){var e=l.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.Di())&&this.rn()},1),this.nn=new rB(this),this.nn.load()}tn(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.Gi)||e.enable())}_dom_loaded(){this.is_capturing()&&i5(this.__request_queue,e=>this.Zi(e)),this.__request_queue=[],this.tn()}_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.sn()&&this.capture(i1),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(s=this.Gi)||s.unload(),null==(r=this.Qi)||r.unload()):this.sn()&&this.capture(i1,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?n4?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=b({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(Z(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,s,r=b({},e);r.timeout=r.timeout||6e4,r.url=nS(r.url,r.compression);var n=null!=(t=r.transport)?t:"fetch",a=nk.filter(e=>!r.disableTransport||!e.transport||!r.disableTransport.includes(e.transport)),o=null!=(i=null==(s=function(e){for(var t=0;e.length>t;t++)if(e[t].transport===n)return e[t]}(a))?void 0:s.method)?i:a[0].method;if(!o)throw Error("No available transport method");"sendBeacon"!==n&&r.data&&r.compression===rH&&d&&"u">typeof Promise&&!nv?nw(r).then(e=>{o(e)}).catch(t=>{L(t)?(nv=!0,o(b({},r,{compression:void 0,url:nS(e.url,void 0)}))):((e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return L(e)||t===C})(t)&&(nv=!0),o(r))}):o(r)})(b({},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}))}Zi(e){this.Qi?this.Qi.retriableRequest(e):this._send_request(e)}_execute_array(e){n0++;try{var t,i=[],s=[],r=[];i5(e,e=>{if(e)if(Y(t=e[0]))r.push(e);else if(J(e))try{e.call(this)}catch(t){tZ.error("Error executing queued PostHog call",e,t)}else Y(e)&&"alias"===t?i.push(e):Y(e)&&-1!==t.indexOf("capture")&&J(this[t])?r.push(e):s.push(e)});var n=function(e,t){i5(e,function(e){try{if(Y(e[0])){var i=t;i8(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){tZ.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(s,this),n(r,this)}finally{n0--}}push(e){if(n0>0&&Y(e)&&X(e[0])){var t=ai.prototype[e[0]];J(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.Gi){if(this.is_capturing())if(!Z(e)&&X(e)){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&&!X(null==t?void 0:t.$current_url)&&(tZ.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.an||tZ.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=new Date,c=(null==i?void 0:i.timestamp)||h,d=tu(null==i?void 0:i.uuid,sd),p={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},c,d)};e===i0&&this.config.__preview_capture_bot_pageviews&&l&&(p.event="$bot_pageview",p.properties.$browser_type="bot"),u&&(p.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens),(null==i?void 0:i.$set)&&(p.$set=null==i?void 0:i.$set);var v=null==i?void 0:i.$unset;v&&(p.$unset=v);var g,_,f,m=this.ln(null==i?void 0:i.$set_once,e!==i3,e===i2);if(m&&(p.$set_once=m),null!=i&&i._noTruncate||(r=this.config.properties_string_max_length,n=p,a=e=>X(e)?e.slice(0,r):e,o=new Set,p=function e(t,i){var s;return t!==Object(t)?a?a(t):t:o.has(t)?void 0:(o.add(t),Y(t)?(s=[],i5(t,t=>{s.push(e(t))})):(s={},i8(t,(t,i)=>{o.has(t)||(s[i]=e(t,i))}
1)),s)}(n)),p.timestamp=c,Z(null==i?void 0:i.timestamp)||(p.properties.$event_time_override_provided=!0,p.properties.$event_time_override_system_time=h),e===rL||e===rD){var y=null==t?void 0:t.$survey_id,w=null==t?void 0:t.$survey_iteration;nW({id:y,current_iteration:w}),p.$set=b({},p.$set,{[(g={id:y,current_iteration:w},f="$survey_"+(_=e===rD?"responded":"dismissed")+"/"+g.id,g.current_iteration&&g.current_iteration>0&&(f="$survey_"+_+"/"+g.id+"/"+g.current_iteration),f)]:!0})}else e===rM&&(p.$set=b({},p.$set,{$survey_last_seen_date:(new Date).toISOString()}));if("product tour shown"===e){var x=null==t?void 0:t.$product_tour_type;x&&(p.$set=b({},p.$set,{["$product_tour_last_seen_date/"+x]:(new Date).toISOString()}))}var S=b({},p.properties.$set,p.$set);if(Q(S)||this.setPersonPropertiesForFlags(S),!ei(this.config.before_send)){var k=this.it(p);if(!k)return;(p=k).uuid=tu(p.uuid,sd)}this.Ni.emit("eventCaptured",p);var E={method:"POST",url:null!=(s=null==i?void 0:i._url)?s:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:p,compression:"best-available",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.Zi(E):this.Gi.enqueue(E),p}tZ.critical("This capture call is ignored due to client rate limiting.")}}else tZ.error("No event name provided to posthog.capture")}else tZ.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,s,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var a,u=n?void 0:this.persistence.remove_event_timer(e),h=b({},t);if(h.token=this.config.token,h.$config_defaults=this.config.defaults,this.Di()&&(h.$cookieless_mode=!0),"$snapshot"===e){var c=b({},this.persistence.properties(),this.sessionPersistence.properties());return h.distinct_id=c.distinct_id,(!X(h.distinct_id)&&!es(h.distinct_id)||ee(h.distinct_id))&&tZ.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),h}var d,v=function(e,t,i,s){if(void 0===s&&(s=!1),!p)return{};var n,a,o,u,h,c,d,v,g,_,m,y,b=e?[...r_,...t||[]]:[],[w,x]=function(e){for(var t=0;ta.length>t;t++){var[i,s]=ta[t],r=i.exec(e),n=r&&(J(s)?s(r,e):s);if(n)return n}return["",""]}(p),S=null!=(h="u">typeof navigator?navigator:void 0)&&h.brave?{brave:!0}:{},k={detectGoogleSearchApp:i},E=i6(se({$os:w,$os_version:x,$browser:ts(p,navigator.vendor,S,k),$device:to(p),$device_type:(d={userAgentDataPlatform:null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,maxTouchPoints:null==(a=navigator)?void 0:a.maxTouchPoints,screenWidth:null==r||null==(o=r.screen)?void 0:o.width,screenHeight:null==r||null==(u=r.screen)?void 0:u.height,devicePixelRatio:null==r?void 0:r.devicePixelRatio},(y=to(p))===ey||y===em||"Kobo"===y||"Kindle Fire"===y||y===eJ?ef:y===eN||y===eq||y===ej||y===eG?"Console":y===ew?"Wearable":y?eg:"Android"===(null==d?void 0:d.userAgentDataPlatform)&&(null!=(v=null==d?void 0:d.maxTouchPoints)?v:0)>0?600>Math.min(null!=(g=null==d?void 0:d.screenWidth)?g:0,null!=(_=null==d?void 0:d.screenHeight)?_:0)/(null!=(m=null==d?void 0:d.devicePixelRatio)?m:1)?eg:ef:"Desktop"),$timezone:rA(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:rc(s?th(null==l?void 0:l.href):null==l?void 0:l.href,b,rm),$host:null==l?void 0:l.host,$pathname:null==l?void 0:l.pathname,$raw_user_agent:p.length>1e3?p.substring(0,997)+"...":p,$browser_version:tn(p,navigator.vendor,S,k),$browser_language:rS(),$browser_language_prefix:"string"==typeof(c=rS())?c.split("-")[0]:void 0,$screen_height:null==r?void 0:r.screen.height,$screen_width:null==r?void 0:r.screen.width,$viewport_height:null==r?void 0:r.innerHeight,$viewport_width:null==r?void 0:r.innerWidth,$lib:f.LIB_NAME,$lib_version:f.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return f.SDK_DIST_CHANNEL&&(E.$sdk_dist_channel=f.SDK_DIST_CHANNEL),E}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes
1);if(this.sessionManager){var{sessionId:g,windowId:_}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());h.$session_id=g,h.$window_id=_}this.sessionPropsManager&&i6(h,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&i6(h,this.sessionRecording.sdkDebugProperties),h.$sdk_debug_retry_queue_size=null==(a=this.Qi)?void 0:a.length}catch(e){h.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===nz&&(h.$lib_custom_api_host=this.config.api_host),d=e!==i0||n?e!==i1||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),h=i6(h,d),e===i0&&o&&(h.title=o.title),!Z(u)){var m=i.getTime()-u;h.$duration=parseFloat((m/1e3).toFixed(3))}p&&this.config.opt_out_useragent_filter&&(h.$browser_type=this._is_bot()?"bot":"browser"),(h=i6({},v,this.persistence.properties(),this.sessionPersistence.properties(),h)).$is_identified=this._isIdentified(),Y(this.config.property_denylist)?i8(this.config.property_denylist,function(e){delete h[e]}):tZ.error(n8+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var y=this.config.sanitize_properties;y&&(tZ.error(n5),h=y(h,e));var w=this.un();return h.$process_person_profile=w,w&&!n&&this.hn("_calculate_event_properties"),h}ln(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.un()||this.$i&&!i)return e;var s,r=i6({},this.persistence.get_initial_props(),(null==(s=this.sessionPropsManager)?void 0:s.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(tZ.error(n5),r=n(r,"$set_once")),t&&(this.$i=!0),Q(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;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}dn(e,t){this.register({[e]:t})}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;return null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(e,t)}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.Ni.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:n3}),()=>{})}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:n3})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:n3})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=nJ),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:n3}}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:n3})}cn(e){return!e||ee(e)?(tZ.critical("Unique user id has not been set in posthog.identify"),!1):e===iB?(tZ.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())||(tZ.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
1ot a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return tZ.uninitializedWarning("posthog.identify");if(es(e)&&(e=e.toString(),tZ.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.cn(e)&&this.hn("posthog.identify")){var s=this.get_distinct_id();this.register({$user_id:e}),this.get_property(t3)||this.register_once({$had_persisted_distinct_id:!0,$device_id:s},""),e!==s&&e!==this.get_property(t8)&&(this.unregister(t8),this.register({distinct_id:e}));var r,n=(this.persistence.get_property(iO)||iJ)===iJ;e!==s&&n?(this.persistence.set_property(iO,iK),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.capture(i2,{distinct_id:e,$anon_distinct_id:s},{$set:t||{},$set_once:i||{}}),this.Hi=nD(e,t,i),null==(r=this.featureFlags)||r.setAnonymousDistinctId(s)):(t||i)&&this.setPersonProperties(t,i),e!==s&&(this.reloadFeatureFlags(),this.unregister(iI))}}setPersonProperties(e,t){if((e||t)&&this.hn("posthog.setPersonProperties")){var i=nD(this.get_distinct_id(),e,t);this.Hi!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Hi=i):tZ.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(Y(e)?e:[e]).filter(e=>X(e)&&e.length>0);0!==i.length&&this.hn("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Hi=null)}group(e,t,i){if(e&&t){var s=this.getGroups(),r=s[e]!==t;if(r&&this.resetGroupPropertiesForFlags(e),this.register({$groups:b({},s,{[e]:t})}),r||i){var n={$group_type:e,$group_key:t};i&&(n.$group_set=i),this.capture(i3,n)}i&&this.setGroupPropertiesForFlags({[e]:i}),r&&!i&&this.reloadFeatureFlags()}else tZ.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.hn("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){if(tZ.info("reset"),!this.__loaded)return tZ.uninitializedWarning("posthog.reset");var t,i,s,r,n,a,o,l,u,h,c,d=this.get_property(t3),p=this.get_property(t5),v=this.get_property(io);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),Z(v)||null==(c=this.persistence)||c.register({[io]:v}),null==(s=this.surveys)||s.reset(),null==(r=this.nn)||r.stop(),null==(n=this.featureFlags)||n.reset(),null==(a=this.conversations)||a.reset(),null==(o=this.logs)||o.reset(),null==(l=this.metrics)||l.reset(),null==(u=this.persistence)||u.set_property(iO,iJ),null==(h=this.sessionManager)||h.resetSessionId(),this.Hi=null,this.config.cookieless_mode===iY)this.register_once({distinct_id:iB,$device_id:null},"");else{var g=this.config.get_device_id(sd());this.register_once({distinct_id:g,$device_id:e?g:d},""),e||Z(p)||this.register({[t5]:p})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var t=this;return y(function*(){var e,i,s,r,n;t.__loaded?(null==(e=t.logs)||e.flushLogs("sendBeacon"),null==(i=t.metrics)||i.flush("sendBeacon"),null==(s=t.Gi)||s.unload(),null==(r=t.Qi)||r.unload(),null==(n=t.featureFlags)||n.destroy()):tZ.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.vn()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.fn()}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,t;return null!=(e=null==(t=this.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),s=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var r,n=null!=(r=e.timestampLookBack)?r:10;if(!i)return s;s+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return s}alias(e,t){return e===this.get_property(t2)?(tZ.critical("Attempting to create alias for existing People user - aborting."),-2):this.hn("posthog.alias")?(Z(t)&&(t=this.get_distinct_id()),e!==t?(this.dn(t8,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(tZ.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=b({},this.config);
1if(K(e)){i6(this.config,ae(e));var i,s,r,n,a,o,l,u,h,c,d,p=this.Wi();null==(i=this.persistence)||i.update_config(this.config,t,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new rT(b({},this.config,{persistence:"sessionStorage"}),p,!1);var v=this.Ui(this.config.debug);en(v)&&(this.config.debug=v),en(this.config.debug)&&(this.config.debug?(f.DEBUG=!0,sm.N()&&sm.q("ph_debug",!0),tZ.info("set_config",{config:e,oldConfig:t,newConfig:b({},this.config)})):(f.DEBUG=!1,sm.N()&&sm.P("ph_debug"))),null==(s=this.exceptionObserver)||s.onConfigChange(),null==(r=this.exceptions)||r.onConfigChange(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(h=this.deadClicksAutocapture)||h.startIfEnabledOrStop(),null==(c=this.surveys)||c.loadIfEnabled(),this.pn(),null==(d=this.externalIntegrations)||d.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){f.LIB_NAME=e,f.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(b({},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:ai.gn}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:n6;return t!==n6&&(t=n6+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(iO))===iK||(null==(t=this.sessionPersistence)?void 0:t.get_property(iO))===iK}un(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===iQ&&!this._isIdentified()&&Q(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[t8])&&(null==(t=this.persistence)||null==(t=t.props)||!t[iq]))}sn(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&(!0===this.config.capture_pageview||"history_change"===this.config.capture_pageview)}createPersonProfile(){this.un()||this.hn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.hn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}hn(e){return"never"===this.config.person_profiles?(tZ.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.dn(iq,!0),!0)}Wi(){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!==iW)}pn(){var e,t,i,s,r=this.Wi();return(null==(e=this.persistence)?void 0:e.rr)!==r&&(null==(i=this.persistence)||i.set_disabled(r)),(null==(t=this.sessionPersistence)?void 0:t.rr)!==r&&(null==(s=this.sessionPersistence)||s.set_disabled(r)),r}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==iY){if(this.Di()){this.reset(!0),null==(r=this.sessionManager)||r.destroy(),null==(n=this.pageViewM
1anager)||n.destroy(),this.sessionManager=new nC(this),this.pageViewManager=new rr(this),this.persistence&&(this.sessionPropsManager=new nI(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=ai.__defaultExtensionClasses)?void 0:l.sessionRecording;h&&(this.sessionRecording=this.Fi(this.sessionRecording,new h(this)),this.en&&(null==(u=this.sessionRecording)||null==u.onRemoteConfig||u.onRemoteConfig(this.en)))}this.consent.optInOut(!0),this.pn(),this.tn(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==iW&&(null==(i=this.surveys)||i.loadIfEnabled()),(Z(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.rn()}else tZ.warn(n2)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==iY?(this.config.cookieless_mode===iW&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.pn(),this.config.cookieless_mode===iW&&(this.register({distinct_id:iB,$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.rn(),this.tn())):tZ.warn(n2)}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===iY||(this.config.cookieless_mode===iW?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.pn()}_is_bot(){return a?nO(a,this.config.custom_blocked_useragents):void 0}rn(){o&&("visible"===o.visibilityState?this.qi||(this.qi=!0,this.capture(i0,{title:o.title},{send_instantly:!0}),this.Bi&&(o.removeEventListener(iZ,this.Bi),this.Bi=null)):this.Bi||(this.Bi=this.rn.bind(this),si(o,iZ,this.Bi)))}debug(e){!1===e?(null==r||r.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==r||r.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}))}Er(){var e,t,i,s,r=this.zi||{};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?(tZ.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&&!ei(r[e]),s=t in r&&!ei(r[t]),i?r[e]:!!s&&(tZ&&tZ.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),r[t]))}it(e){if(ei(this.config.before_send))return e;var t,i=Object.keys(null!=(t=e.properties)?t:{}).filter(eo),s=Y(this.config.before_send)?this.config.before_send:[this.config.before_send],r=e;for(var n of s){if(ei(r=n(r))){var a="Event '"+e.event+"' was rejected in beforeSend function";return ea(e.event)?tZ.warn(a+". This can cause unexpected behavior."):tZ.info(a),null}r.properties&&!Q(r.properties)||tZ.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var o of i)if(r.properties&&ei(r.properties[o]))return tZ.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.Ut)?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)})}Ui(e){var t=en(e)&&!e,i=sm.N()&&"true"===sm.A("ph_debug");return!t&&(!!i||e)}}ai.__defaultExtensionClasses={},ai.gn={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]]=i9(e.prototype[t[i]])}(ai,["identify"]);class as{constructor(e){this.disabled=!1===e;var t=K(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 ar="$copy_autocapture",an=tX("[AutoCapture]");function aa(e,t){return t.length>e?t.slice(0,e)+"...":t}var ao=tX("[ExceptionAutocapture]"),al=()=>{},au=tX("[TracingHeaders]"),ah=tX("[Web Vitals]"),ac="disabled",ad="lazy_loading",ap="awaiting_config",av="missing_config";tX("[SessionRecording]"),tX("[SessionRecording]");var ag="[SessionRecording]",a_=tX(ag),af=tX("[Heatmaps]");function am(e){return K(e)&&"clientX"in e&&"clientY"in e&&es(e.clientX)&&es(e.clientY)}var ay=tX("[Product Tours]"),ab=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(ir))},aw=["$set_once","$set"],ax=tX("[SiteApps]"),aS="Error while initializing PostHog app with config id ";function ak(e,t,i){if(ei(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 aE{constructor(e){this.mn=new nR,this.yn=(e,t)=>this.bn(e,t)&&this._n(e,t)&&this.wn(e,t)&&this.xn(e,t),this.bn=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.kn=new Set,this.Sn=new Set}init(){var e,t;Z(null==(e=this._instance)?void 0:e._addCaptureHook)||null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.on(e,t)})}register(e){var t,i;if(!Z(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e
1=>{var t,i;null==(t=this.Sn)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.kn)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var s,r=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&r.add(null==e?void 0:e.selector)})}),null==(s=this._instance)||s.autocapture.setElementSelectors(r)}}on(e,t){var i;null!=t&&0!=e.length&&(this.kn.has(e)||this.kn.has(null==t?void 0:t.event))&&this.Sn&&(null==(i=this.Sn)?void 0:i.size)>0&&this.Sn.forEach(e=>{this.Cn(t,e)&&this.mn.emit("actionCaptured",e.name)})}In(e){this.onAction("actionCaptured",t=>e(t))}Cn(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.yn(e,i))return!0;return!1}onAction(e,t){return this.mn.on(e,t)}_n(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||!ak(s,t.url,t.url_matching||"contains"))return!1}return!0}wn(e,t){return!!this.Tn(e,t)&&!!this.Mn(e,t)&&!!this.En(e,t)}Tn(e,t){if(null==t||!t.href)return!0;var i=this.Pn(e);if(i.length>0)return i.some(e=>ak(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&&ak((r=n.match(/(?::|")href="(.*?)"/))?r[1]:"",t.href,t.href_matching||"exact")}Mn(e,t){if(null==t||!t.text)return!0;var i=this.Pn(e);if(i.length>0)return i.some(e=>ak(e.text,t.text,t.text_matching||"exact")||ak(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;!ei(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=>ak(e,n,a)))}En(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}Pn(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}xn(e,t){return null==t||!t.properties||0===t.properties.length||nq(t.properties.reduce((e,t)=>{var i=Y(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 aP{constructor(e){this.Rn=[],this._instance=e,this.On=new Map,this.Ln=new Map,this.Fn=new Map}An(e,t){return!!e&&nq(e.propertyFilters,null==t?void 0:t.properties)}Dn(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}$n(e,t,i){var s=(i===rC?this.On:this.Ln).get(e),r=[];return this.Nn(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.An(n,t)})}register(e){var t;Z(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.qn(e),this.Bn(e))}Bn(e){var t=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.actions)&&(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)?void 0:i.length)>0});0!==t.length&&(null==this.jn&&(this.jn=new aE(this._instance),this.jn.init(),this.jn.In(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,s,r,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(s=e.conditions)||null==(s=s.actions)||null==(s=s.values)?void 0:s.length)>0&&(null==(r=this.jn)||r.register(e.conditions.actions.values),null==(n=e.conditions)||null==(n=n.actions)||null==(n=n.values)||n.forEach(t=>{if(t&&t.name){var i=this.Fn.get(t.name);i&&i.push(e.id),this.Fn.set(t.name,i||[e.id])}}))}))}qn(e){var t,i=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.events)&&(null==(i=e.conditions)||null==(i=i.events)||null==(i=i.values)?void 0:i.length)>0}),s=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(i=e.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0});0===i.length&&0===s.length||(null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),this.On=this.Dn(e,rC),this.Ln=this.Dn(e,rO))}onEvent(e,t){var i,s,r=this.Hn(),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.Un(e,n);if("consume"===a)return r.info("event consumed activated item, remov
1ing it",{event:e,itemId:n}),void this.zn([n]);if("persist"===a)return r.info("shown item promoted to persisted activation",{event:e,itemId:n}),void this.Vn(n)}if(this.Ln.has(e)){var o=this.$n(e,t,rO);o.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:o.map(e=>e.id)}),this.zn(o.map(e=>e.id)),o.forEach(e=>this.Wn(e.id)))}if(this.On.has(e)){r.info("event name matched",{event:e,eventPayload:t,items:this.On.get(e)});var l=this.$n(e,t,rC);this.Gn(l.map(e=>e.id))}}onAction(e){this.Fn.has(e)&&this.Gn(this.Fn.get(e)||[])}Gn(e){0!==e.length&&(this.Rn=[...new Set([...this.Rn,...e])],this.Hn().info("updating activated items",{activatedItems:this.getActivatedIds()}))}Vn(e){this.Rn=this.Rn.filter(t=>t!==e);var t=this.Zn();t.includes(e)||this.Qn([...t,e])}zn(e){var t=new Set(e);this.Rn=this.Rn.filter(e=>!t.has(e));var i=this.Zn(),s=i.filter(e=>!t.has(e));s.length!==i.length&&this.Qn(s)}Zn(){var e,t=this.Jn();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getActivatedIds(){return[...new Set([...this.Zn(),...this.Rn])].filter(e=>!this.Kn(e))}reset(){this.Rn=[],this.Zn().length>0&&this.Qn([])}getEventToItemsMap(){return this.On}Yn(){return this.jn}}class aF extends aP{constructor(e){super(e)}Jn(){return iA}Xn(){return rM}Nn(e){var t;null==(t=this._instance)||t.getSurveys(e)}Wn(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}Hn(){return nV}Qn(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iA]:e})}Kn(){return!1}Un(e,t){var i,s,r,n,a,o;return this.Nn(e=>{o=e.find(e=>e.id===t)}),!o||(a=(null!=(s=null==(r=(i=o).conditions)||null==(r=r.events)||null==(r=r.values)?void 0:r.length)?s:0)>0,"always"===i.schedule||null!=(n=i.conditions)&&null!=(n=n.events)&&n.repeatedActivation&&a)?e===rM?"consume":"ignore":e===rM?"persist":e===rL||e===rD?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var aA="SDK is not enabled or survey functionality is not yet loaded",a$="Disabled. Not loading surveys.",aI=null!=r&&r.location?rd(r.location.hash,"__posthog")||rd(location.hash,"state"):null,aR="_postHogToolbarParams",aT=tX("[Toolbar]"),aC=tX("[FeatureFlags]"),aO=tX("[FeatureFlags]",{debugEnabled:!0}),aM="\" failed. Feature flags didn't load in time.",aL=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},aD=e=>{var t={};for(var[i,s]of i4(e||{}))s&&(t[i]=s);return t},aN=tX("[Error tracking]"),aj="Refusing to render web experiment since the viewer is a likely bot",aq={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>nL(t,e),not_regex:(e,t)=>!nL(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e};class az{get Se(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{az.es("retrieved web experiments from the server"),t.ts=new Map,e.forEach(e=>{if(e.feature_flag_key){t.ts&&(az.es("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.ts)||i.set(e.feature_flag_key,e));var i,s=t._instance.getFeatureFlag(e.feature_flag_key);X(s)&&e.variants[s]&&t.rs(e.name,s,e.variants[s].transforms)}else if(e.variants)for(var r in e.variants){var n=e.variants[r];az.ns(n,t._instance)&&t.rs(e.name,r,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())az.es(aj);else if(!this.Se.disable_web_experiments){if(ei(this.ts))return this.ts=new Map,this.loadIfEnabled(),void this.previewWebExperiment();az.es("applying feature flags",e),e.forEach(e=>{var t;if(this.ts&&null!=(t=this.ts)&&t.has(e)){var i,s=this._instance.getFeatureFlag(e),r=null==(i=this.ts)?void 0:i.get(e);s&&null!=r&&r.variants[s]&&this.rs(r.name,s,r.variants[s].transforms)}})}}previewWebExperiment(){var e=az.getWindowLocation();if(null!=e&&e.search){var t=rh(null==e?void 0:e.search,"__experiment_id"),i=rh(null==e?void 0:e.search,"__experiment_variant");t&&i&&(az.es("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.ss(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.Se.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.Se.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.Se.token),method:"GET",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}ss(e,t,i){var s=i.filter(t=>t.id===e);s&&s.length>0&&(az.es("Previewing web experiment ["+s[0].name+"] with variant ["+t+"]"),this.rs(s[0].name,t,s[0].variants[t].transforms))}static ns(e,t){return!ei(e.conditions)&&az.os(e,t)&&az.ls(e)}static os(e,t){if(ei(e.conditions)||ei(null==(s=e.conditions)?void 0:s.url))return!0;
1var i=az.getWindowLocation();if(i){var s,r,n,a,o=sE(t,i.href);return null==(r=e.conditions)||!r.url||aq[null!=(n=null==(a=e.conditions)?void 0:a.urlMatchType)?n:"icontains"](e.conditions.url,o)}return!1}static getWindowLocation(){return null==r?void 0:r.location}static ls(e){if(ei(e.conditions)||ei(null==(i=e.conditions)?void 0:i.utm))return!0;var t=rb();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 es(e){for(var t=arguments.length,i=Array(t>1?t-1:0),s=1;t>s;s++)i[s-1]=arguments[s];tZ.info("[WebExperiments] "+e,i)}rs(e,t,i){this._is_bot()?az.es(aj):"control"!==t?i.forEach(i=>{if(i.selector){az.es("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)})}}):az.es("Control variants leave the page unmodified.")}_is_bot(){return a&&this._instance?nO(a,this.Se.custom_blocked_useragents):void 0}}var aB=tX("[Conversations]"),aH="Conversations not available yet.",aU="console",aV={featureFlags:class{constructor(e){this.us=!1,this.hs=!1,this.ds=!1,this.cs=!1,this.vs=!1,this.fs=!1,this.ps=!1,this.gs=!1,this.ys=0,this.bs=()=>{var e=this._s();this.ys=0,e&&this.reloadFeatureFlags()},this._instance=e,this.featureFlagEventHandlers=[],r&&si(r,"online",this.bs)}destroy(){null==r||r.removeEventListener("online",this.bs)}get Se(){return this._instance.config}get ti(){return this._instance.persistence}ws(e){return this._instance.get_property(e)}xs(){var e,t;return null!=(e=null==(t=this.ti)?void 0:t.nr(this.Se.feature_flag_cache_ttl_ms))&&e}ks(){return!!this.xs()&&(this.gs||this.ds||(this.gs=!0,aC.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Ss(){var e,t=null!=(e=this.Se.evaluation_contexts)?e:this.Se.evaluation_environments;return!this.Se.evaluation_environments||this.Se.evaluation_contexts||this.ps||(aC.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.ps=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||aC.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}Cs(){return this.Ss().length>0}Is(){var e=this.Se.flag_keys;if(!Z(e)){if(Y(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||aC.error("Invalid flag key found:",e,"Expected non-empty string"),t});aC.error("Invalid flag_keys found:",e,"Expected array of non-empty strings")}}initialize(){var e,t,{config:i}=this._instance,s=null!=(e=null==(t=i.bootstrap)?void 0:t.featureFlags)?e:{};if(Object.keys(s).length){var r,n,a=null!=(r=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)?r:{},o=Object.keys(s).filter(e=>!!s[e]).reduce((e,t)=>(e[t]=s[t]||!1,e),{}),l=Object.keys(a).filter(e=>o[e]).reduce((e,t)=>(a[t]&&(e[t]=a[t]),e),{});this.receivedFeatureFlags({featureFlags:o,featureFlagPayloads:l})}}updateFlags(e,t,i){var s,r,n=null!=i&&i.merge&&null!=(s=this.ws(ig))?s:{},a=null!=i&&i.merge&&null!=(r=this.ws(ib))?r:{},o=b({},n,e),l=b({},a,t),u={};for(var[h,c]of Object.entries(o))u[h]={key:h,enabled:S(c),variant:k(c),reason:void 0,metadata:Z(null==l?void 0:l[h])?void 0:{id:0,version:void 0,description:void 0,payload:l[h]}};this.receivedFeatureFlags({flags:u})}get hasLoadedFlags(){return this.hs}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.ws(iy),t=this.ws(ix),i=this.ws(iS);if(!i&&!t)return e||{};var s=i6({},e||{});for(var r of[...new Set([...Object.keys(i||{}),...Object.keys(t||{}
1)])]){var n,a,o=s[r],l=null==t?void 0:t[r],u=Z(l)?null!=(n=null==o?void 0:o.enabled)&&n:!!l,h=Z(l)?o.variant:"string"==typeof l?l:void 0,c=null==i?void 0:i[r],d=b({},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=b({},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.us||(aC.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:s}),this.us=!0),s}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{var s=e[i];return{key:i,enabled:S(s),variant:k(s),payload:x(t[i])}})}getFlagVariants(){var e=this.ws(ig),t=this.ws(ix);if(!t)return e||{};for(var i=i6({},e),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.us||(aC.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.us=!0),i}getFlagPayloads(){var e=this.ws(ib),t=this.ws(iS);if(!t)return e||{};for(var i=i6({},e||{}),s=Object.keys(t),r=0;s.length>r;r++)i[s[r]]=t[s[r]];return this.us||(aC.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.us=!0),i}reloadFeatureFlags(){this.cs||this.Se.advanced_disable_feature_flags||this._s()||this.Ts||(this._instance.Ni.emit("featureFlagsReloading",!0),this.Ts=setTimeout(()=>{this.Ms()},5))}Es(){clearTimeout(this.Ts),this.Ts=void 0}ensureFlagsLoaded(){this.hs||this.ds||this.Ts||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.cs=e}Ms(e){var t;if(this.Es(),!this._instance.Er()&&!this._s())if(this.ds)this.vs=!0;else{var i=this.Se.token,s=this.ws(t3),r={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:b({},(null==(t=this.ti)?void 0:t.get_initial_props())||{},this.ws(ik)||{}),group_properties:this.ws(iE),timezone:rA()};et(s)||Z(s)||(r.$device_id=s),(null!=e&&e.disableFlags||this.Se.advanced_disable_feature_flags)&&(r.disable_flags=!0),this.Cs()&&(r.evaluation_contexts=this.Ss());var n=this.Is();Z(n)||(r.flag_keys=n);var a=!!this.Se.advanced_only_evaluate_survey_feature_flags,o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Se.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.ds=!0,this._instance._send_request({method:"POST",url:o,data:r,compression:this.Se.disable_compression?void 0:rU,timeout:this.Se.feature_flag_request_timeout_ms,callback:e=>{var t,i,s,n=!0;if(this.Ps(e.statusCode),200===e.statusCode&&(this.vs||(this.$anon_distinct_id=void 0),n=!1),this.ds=!1,!r.disable_flags||this.vs){this.fs=!n;var o=[];e.error?e.error instanceof Error?o.push("AbortError"===e.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==e.statusCode&&o.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var l,u=!(null==(i=e.json)||null==(i=i.quotaLimited)||!i.includes("feature_flags"));(u&&o.push("quota_limited"),null==(s=this.ti)||s.register({[iT]:o}),u)?aC.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset.  Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(r.disable_flags||this.receivedFeatureFlags(null!=(l=e.json)?l:{},n,{partialResponse:a}),this.vs&&(this.vs=!1,this.Ms()))}}})}}_s(){return rp(this.ys,3)}Ps(e){this.ys=rv(e,this.ys,3,()=>aC.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.fs)if(this.hs||this.getFlags()&&this.getFlags().length>0){if(!this.ks()){var s=this.getFeatureFlagResult(e,t);return null!=(i=null==s?void 0:s.variant)?i:null==s?void 0:s.enabled}}else aC.warn('getFeatureFlag for key "'+e+aM)}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.fs)if(this.hs||this.getFlags()&&this.getFlags().length>0){if(!this.ks()){var i=this.getFlagVariants(),s=e in i,r=i[e],n=this.getFlagPayloads()[e],a=String(r),o=this.ws(iw)||void 0,l=this.ws(iC)||void 0,u=this.ws(iI)||{};if(this.Se.advanced_feature_flags_dedup_per_session){var h,c=this._instance.get_session_id(),d=this.ws(iR);c&&c!==d&&(u={},null==(h=this.ti)||h.register({[iI]:u,[iR]:c}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(a))){Y(u[e])?u[e].push(a):u[e]=[a],null==(_=this.ti)||_.register({[iI]:u});var p=this.getFeatureFlagDetails(e),v=[...null!=(f=this.ws(iT))?f:[]];Z(r)&&v.push("flag_missing");var g={$feature_flag:e,$feature_flag_response:r,$feature_flag_payload:n||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(m=this.Se.bootstrap)||null==(m
1=m.featureFlags)?void 0:m[e])||null,$feature_flag_bootstrapped_payload:(null==(y=this.Se.bootstrap)||null==(y=y.featureFlagPayloads)?void 0:y[e])||null,$used_bootstrap_value:!this.fs};Z(null==p||null==(b=p.metadata)?void 0:b.version)||(g.$feature_flag_version=p.metadata.version);var _,f,m,y,b,w,S,k,E,P,F,A=null!=(w=null==p||null==(S=p.reason)?void 0:S.description)?w:null==p||null==(k=p.reason)?void 0:k.code;A&&(g.$feature_flag_reason=A),null!=p&&null!=(E=p.metadata)&&E.id&&(g.$feature_flag_id=p.metadata.id),Z(null==p?void 0:p.original_variant)&&Z(null==p?void 0:p.original_enabled)||(g.$feature_flag_original_response=Z(p.original_variant)?p.original_enabled:p.original_variant),null!=p&&null!=(P=p.metadata)&&P.original_payload&&(g.$feature_flag_original_payload=null==p||null==(F=p.metadata)?void 0:F.original_payload),v.length&&(g.$feature_flag_error=v.join(",")),this._instance.capture("$feature_flag_called",g)}if(s)return{key:e,enabled:!!r,variant:"string"==typeof r?r:void 0,payload:x(n)}}}else aC.warn('getFeatureFlagResult for key "'+e+aM)}getRemoteConfigPayload(e,t){var i=this.Se.token,s={distinct_id:this._instance.get_distinct_id(),token:i};this.Cs()&&(s.evaluation_contexts=this.Ss());var r=this.Is();Z(r)||(s.flag_keys=r),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:s,compression:this.Se.disable_compression?void 0:rU,timeout:this.Se.feature_flag_request_timeout_ms,callback(i){var s,r=null==(s=i.json)?void 0:s.featureFlagPayloads;t((null==r?void 0:r[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this.fs){if(this.hs||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return Z(i)?void 0:!!i}aC.warn('isFeatureEnabled for key "'+e+aM)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){if(this.ti){this.hs=!0;var s=this.getFlagVariants(),r=this.getFlagPayloads(),n=this.getFlagsWithDetails();!function(e,t,i,s,r,n){void 0===i&&(i={}),void 0===s&&(s={}),void 0===r&&(r={});var a,o=((a=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(a).map(e=>{var t;return[e,null!=(t=a[e].variant)?t:a[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(a).filter(e=>a[e].enabled).filter(e=>{var t;return null==(t=a[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=a[e].metadata)?void 0:t.payload]}))):e.featureFlags&&aC.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),l=o.flags,u=o.featureFlags,h=o.featureFlagPayloads;if(u){var c=e.requestId,d=e.evaluatedAt;if(Y(u)){aC.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var p={};if(u)for(var v=0;u.length>v;v++)p[u[v]]=!0;t&&t.register({[i_]:u,[ig]:p})}else{var g=u,_=h,f=l;if(null!=n&&n.partialResponse)g=b({},i,g),_=b({},s,_),f=b({},r,f);else if(e.errorsWhileComputingFlags)if(l){var m=new Set(Object.keys(l).filter(e=>{var t;return!(null!=(t=l[e])&&t.failed)}));g=b({},i,Object.fromEntries(Object.entries(g).filter(e=>{var[t]=e;return m.has(t)}))),_=b({},s,Object.fromEntries(Object.entries(_||{}).filter(e=>{var[t]=e;return m.has(t)}))),f=b({},r,Object.fromEntries(Object.entries(f||{}).filter(e=>{var[t]=e;return m.has(t)})))}else g=b({},i,g),_=b({},s,_),f=b({},r,f);t&&t.register(b({[i_]:Object.keys(aD(g)),[ig]:g||{},[ib]:_||{},[iy]:f||{}},c?{[iw]:c}:{},d?{[iC]:d}:{}))}}}(e,this.ti,s,r,n,i),t||(this.gs=!1),this.Rs(t)}}override(e,t){void 0===t&&(t=!1),aC.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.ti)return aC.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.ti.unregister(ix),this.ti.unregister(iS),this.Rs(),aO.info("All overrides cleared");if(Y(e)){var t,i=aL(e);return this.ti.register({[ix]:i}),this.Rs(),aO.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){if(this.us=!!(null!=(t=e.suppressWarning)&&t),"flags"in e){if(!1===e.flags)this.ti.unregister(ix),aO.info("Flag overrides cleared");else if(e.flags){if(Y(e.flags)){var s=aL(e.flags);this.ti.register({[ix]:s}
1)}else this.ti.register({[ix]:e.flags});aO.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this.ti.unregister(iS),aO.info("Payload overrides cleared")):e.payloads&&(this.ti.register({[iS]:e.payloads}),aO.info("Payload overrides set",{payloads:e.payloads}))),void this.Rs()}if(e&&"object"==typeof e)return this.ti.register({[ix]:e}),this.Rs(),aO.info("Flag overrides set",{flags:e});aC.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.hs){var{flags:t,flagVariants:i}=this.Os();try{e(t,i)}catch(e){aC.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var s,r=(this.ws(im)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:n};r&&(a.$early_access_feature_name=r.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=b({},this.getFlagVariants(),{[e]:t});null==(s=this.ti)||s.register({[i_]:Object.keys(aD(o)),[ig]:o}),this.Rs()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var s=this.ws(im),r=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(s&&!t)return e(s);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Se.token+r),method:"GET",callback:t=>{var i,s;if(t.json){var r=t.json.earlyAccessFeatures;return null==(i=this.ti)||i.unregister(im),null==(s=this.ti)||s.register({[im]:r}),e(r)}}})}Os(){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),{})}}Rs(e){var{flags:t,flagVariants:i}=this.Os();this.featureFlagEventHandlers.forEach(s=>{try{s(t,i,{errorsLoading:e})}catch(e){aC.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.ws(ik)||{},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._instance.register({[ik]:b({},i,n,s)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=b({},this.ws(ik)||{});e.forEach(e=>{delete i[e]}),this._instance.register({[ik]:i}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this._instance.unregister(ik),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.ws(iE)||{};
10!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=b({},i[t],e[t]),delete e[t]}),this._instance.register({[iE]:b({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.ws(iE)||{};this._instance.register({[iE]:b({},t,{[e]:{}})})}else this._instance.unregister(iE)}reset(){this.hs=!1,this.ds=!1,this.cs=!1,this.vs=!1,this.fs=!1,this.$anon_distinct_id=void 0,this.Es(),this.us=!1,this.ys=0}}},aG=b({productTours:class{get ti(){return this._instance.persistence}constructor(e){this.zo=null,this.Vo=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if("productTours"in e){var t,i;if(this.ti&&this.ti.register({[ir]:!!e.productTours}),!ab(this._instance))return!this.zo&&ei(null==(t=this.ti)?void 0:t.props[i$])||ay.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.zo)||i.stop(),this.zo=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.zo&&ab(this._instance)&&this.Bt(()=>this.Wo())}Bt(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?ay.error("Could not load product tours script",t):e()})}Wo(){var e;!this.zo&&null!=(e=v.__PosthogExtensions__)&&e.generateProductTours&&(this.zo=v.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!Y(this.Vo)||t){var i=this.ti;if(i){var s=i.props[i$];if(Y(s)&&!t)return this.Vo=s,void e(s,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:t=>{if(ab(this._instance)){var s=t.statusCode;if(200!==s||!t.json){var r="Product Tours API could not be loaded, status: "+s;return ay.error(r),void e([],{isLoaded:!1,error:r})}var n=Y(t.json.product_tours)?t.json.product_tours:[];this.Vo=n,i&&i.register({[i$]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Vo,{isLoaded:!0})}getActiveProductTours(e){ei(this.zo)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.zo.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.zo)||t.showTourById(e)}previewTour(e){this.zo?this.zo.previewTour(e):this.Bt(()=>{var t;this.Wo(),null==(t=this.zo)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.zo)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.zo)||e.nextStep()}previousStep(){var e;null==(e=this.zo)||e.previousStep()}clearCache(){var e;this.Vo=null,null==(e=this.ti)||e.unregister(i$)}resetTour(e){var t;null==(t=this.zo)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.zo)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.zo)||t.cancelPendingTour(e)}}},aV),aW=b({surveys:class{get Se(){return this._instance.config}constructor(e){this.ua=void 0,this._surveyManager=null,this.ha=!1,this.da=[],this.ca=null,this.va=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Se.disable_surveys){var t=e.surveys;if(ei(t))return nV.warn("Flags not loaded yet. Not loading surveys.");var i=Y(t);this.ua=i?t.length>0:t,nV.info("flags response received, isSurveysEnabled: "+this.ua),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(nG)||null!=s&&s.startsWith("inProgressSurvey_"))&&t.push(s)}t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this._surveyManager)if(this.ha)nV.info("Already initializing surveys, skipping...");else if(this.Se.disable_surveys)nV.info(a$);else if(this.Se.cookieless_mode&&this._instance.consent.isOptedOut())nV.info("Not loading surveys in cookieless mode without consent.");else{var e=null==v?void 0:v.__PosthogExtensions__;if(e){if(!Z(this.ua)||this.Se.advanced_enable_surveys){var t=this.ua||this.Se.advanced_enable_surveys;this.ha=!0;try{var i=e.generateSurveys;if(i)return void this.fa(i,t);var s=e.loadExternalDependency;if(!s)return void this.pa(iG);s(this._instance,"surveys",i=>{i||!e.generateSurveys?this.pa("Could not load surveys script",i):this.fa(e.generateSurveys,t)})}catch(e){throw this.pa("Error initializing surveys",e),e}finally{this.ha=!1}}}else nV.error("PostHog Extensions not found.")}}fa(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new aF(this._instance),nV.info("Surveys loaded successfully"),this.ga({isLoaded:!0})}pa(e,t){nV.error(e,t),this.ga({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.da.push(e),this._surveyManager&&this.ga({isLoaded:!0}),()=>{this.da=this.da.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Se.disable_surveys)return nV.info(a$),e([]);var i,s=this._instance.get_property(iP);s&&!t?(e(s,{isLoaded:!0}
1),this.ma()&&this.getSurveys(()=>{},!0)):"u">typeof Promise&&this.ca?this.ca.then(t=>{var{surveys:i,context:s}=t;return e(i,s)}):("u">typeof Promise&&(this.ca=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Se.token),method:"GET",timeout:this.Se.surveys_request_timeout_ms,callback:t=>{this.ca=null;var s=t.statusCode;if(200!==s||!t.json){var r="Surveys API could not be loaded, status: "+s;nV.error(r),this.va=Date.now();var n={isLoaded:!1,error:r};return e([],n),void(null==i||i({surveys:[],context:n}))}this.va=null;var a,o,l=t.json.surveys||[],u=l.filter(e=>{var t,i;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)||!i.length))});u.length>0&&(null==(o=this._surveyEventReceiver)||o.register(u)),null==(a=this._instance.persistence)||a.register({[iP]:l,[iF]:Date.now()});var h={isLoaded:!0};e(l,h),null==i||i({surveys:l,context:h})}}))}ma(){return this.ya()&&!this.ca&&!this.ba()}ya(){var e=this._instance.get_property(iF);return es(e)&&Date.now()-e>3e5}ba(){return es(this.va)&&3e5>Date.now()-this.va}markSurveyAsSeen(e,t){var i;nW({id:e,current_iteration:null!=(i=null==t?void 0:t.iteration)?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}ga(e){for(var t of this.da)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){nV.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!ei(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);nV.warn("init was not called")}_a(e){var t=null;return this.getSurveys(i=>{var s;t=null!=(s=i.find(t=>t.id===e))?s:null}),t}wa(e){if(ei(this._surveyManager))return{eligible:!1,reason:aA};var t="string"==typeof e?this._a(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(ei(this._surveyManager))return nV.warn("init was not called"),{visible:!1,disabledReason:aA};var t=this.wa(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return ei(this._surveyManager)?(nV.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:aA})):new Promise(i=>{this.getSurveys(t=>{var s,r=null!=(s=t.find(t=>t.id===e))?s:null;if(r){var n=this.wa(r);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var s;if(ei(this._surveyManager))nV.warn("init was not called");else{var r="string"==typeof e?this._a(e):e;if(null!=r&&r.id)if(nY.includes(r.type)){var n=null==o?void 0:o.querySelector(t);if(n)return null!=(s=r.appearance)&&s.surveyPopupDelaySeconds?(nV.info("Rendering survey "+r.id+" with delay of "+r.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;nV.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),nV.info("Survey "+r.id+" rendered")},1e3*r.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(r,n,i);nV.warn("Survey element not found")}else nV.warn("Surveys of type "+r.type+" cannot be rendered in the app");else nV.warn("Survey not found")}}displaySurvey(e,t){var i;if(ei(this._surveyManager))nV.warn("init was not called");else{var s=this._a(e);if(s){var r=s;if(null!=(i=s.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(r=b({},s,{appearance:b({},s.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==rN&&t.initialResponses&&nV.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.canRenderSurvey(s);if(!n.visible)return void nV.warn("Survey is not eligible to be displayed: ",n.disabledReason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(r,t):this.renderSurvey(r,t.selector,t.properties)}else nV.warn("Survey not found")}}cancelPendingSurvey(e){ei(this._surveyManager)?nV.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}},aV),aY=b({experiments:az},aV),aJ=b({},aV,{sessionRecording:class{get Se(){return this._instance.config}get ti(){return this._instance.persistence}get started(){var e;return!(null==(e=this.Ls)||!e.isStarted)}get status(){var e,t;return this.Fs===ap||this.Fs===av?this.Fs:null!=(e=null==(t=this.Ls)?void 0:t.status)?e:this.Fs}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Fs=ac,this.As=void 0,this._instance=e,!this._instance.sessionManager)throw a_.error("started without valid sessionManager"),Error(ag+" started without valid sessionManager. This is a bug.");
1if(this.Se.cookieless_mode===iY)throw Error(ag+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Ds(){var e,t=!(null==(e=this._instance.get_property(io))||!e.enabled),i=!this.Se.disable_session_recording,s=this.Se.disable_session_recording||this._instance.consent.isOptedOut();return r&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!this.Ds||null==(t=this.Ls)||!t.isStarted){var i=!Z(Object.assign)&&!Z(Array.from);this.Ds&&i?(this.$s(e),a_.info("starting")):(this.Fs=ac,this.stopRecording())}}$s(e){var t,i,s;this.Ds&&(this.Fs!==ap&&this.Fs!==av&&(this.Fs=ad),null!=v&&null!=(t=v.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=v.__PosthogExtensions__)&&i.initSessionRecording?this.Ns(e):null==(s=v.__PosthogExtensions__)||null==s.loadExternalDependency||s.loadExternalDependency(this._instance,this.qs,t=>{if(t)return a_.error("could not load recorder",t);this.Ns(e)}))}stopRecording(){var e,t;null==(e=this.As)||e.call(this),this.As=void 0,null==(t=this.Ls)||t.stop()}Bs(){var e,t;null==(e=this.As)||e.call(this),this.As=void 0,null==(t=this.Ls)||t.discard()}js(){var e,t;null==(e=this.ti)||e.unregister(iv),null==(t=this.ti)||t.unregister(il)}Hs(e,t){if(ei(e))return null;var i=es(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(a_.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}Us(e){if(this.ti){var t,i,s=this.ti,r=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,r=this.Hs(null==(t=this.Se.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.Hs(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=r?r:n;ei(a)&&this.js();var o=null==i?void 0:i.minimumDurationMilliseconds;s.register({[io]:b({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:b({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:Z(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.As)||t.call(this),this.As=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(r)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this.Us(e),void this.Bs()):(this.Us(e),void this.startIfEnabledOrStop()):(this.Fs===ap&&(this.Fs=av,a_.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.Ls)&&i.log?this.Ls.log(e,t):a_.warn("log called before recorder was ready")}get qs(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(io);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}zs(){var e,t,i=this._instance.get_property(io);if(!i)return!1;try{t="object"==typeof i?i:JSON.parse(i)}catch(e){return a_.warn("persisted remote config for session recording is invalid and will be ignored",e),!1}var s=null!=(e=t.cache_timestamp)?e:Date.now();return 36e5>=Date.now()-s}Ns(e){var t,i;if(null==(t=v.__PosthogExtensions__)||!t.initSessionRecording)return a_.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[iV]:!0});if(this.Ls||(this.Ls=null==(i=v.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.Ls._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.zs()){if(this.Fs===av||this.Fs===ap)return;return this.Fs=ap,a_.info("persisted remote config is stale, requesting fresh config before starting"),void new rB(this._instance).load()}this.Fs=ad,this.Ls.start(e)}onRRwebEmit(e){var t;null==(t=this.Ls)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Ls||null==(t=this.ti)||t.register({[ih]:!0}),null==(e=this.Ls)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Ls||null==(t=this.ti)||t.register({[iu]:!0}),null==(e=this.Ls)||e.overrideSampling()}overrideTrigger(e){var t,i;this.Ls||null==(i=this.ti)||i.register({["url"===e?ic:id]:!0}),null==(t=this.Ls)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.Ls)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.Ls)||!i.tryAddCustomEvent(e,t))}}},{autocapture:class{constructor(e){this.Vs=!1,this.Ws=null,this.Gs=!1,this.instance=e,this.rageclicks=new as(e.config.rageclick),this.Zs=null}initialize(){this.startIfEnabled()}get Se(){var e,t,i=K(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(e=>new RegExp(e)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),i}
1Qs(){if(this.isBrowserSupported()){if(r&&o){var e=e=>{e=e||(null==r?void 0:r.event);try{this.Js(e)}catch(e){an.error("Failed to capture event",e)}};if(si(o,"submit",e,{capture:!0}),si(o,"change",e,{capture:!0}),si(o,"click",e,{capture:!0}),this.Se.capture_copied_text){var t=e=>{e=e||(null==r?void 0:r.event);try{this.Js(e,ar)}catch(e){an.error("Failed to capture copy/cut event",e)}};si(o,"copy",t,{capture:!0}),si(o,"cut",t,{capture:!0})}}}else an.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Vs&&(this.Qs(),this.Vs=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.Gs=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[t4]:!!e.autocapture_opt_out}),this.Ws=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Zs=e}getElementSelectors(e){var t,i=[];return null==(t=this.Zs)||t.forEach(t=>{var s=null==o?void 0:o.querySelectorAll(t);null==s||s.forEach(s=>{e===s&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[t4];if(et(this.Ws)&&!en(i)&&!this.instance.Er())return!1;var s=null!=(t=this.Ws)?t:!!i;return!!this.instance.config.autocapture&&!s}Js(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,s=sL(e);s$(s)&&(s=s.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&sG(s,this.instance.config.rageclick)&&this.Js(e,"$rageclick");var n=t===ar;if(s&&function(e,t,i,s,n,a){if(void 0===i&&(i=void 0),!r||sW(e)||null!=(o=i)&&o.url_allowlist&&!sT(i.url_allowlist,a)||null!=(l=i)&&l.url_ignorelist&&sT(i.url_ignorelist,a))return!1;if(null!=(u=i)&&u.dom_event_allowlist){var o,l,u,h,c,d,p=i.dom_event_allowlist;if(p&&!p.some(e=>t.type===e))return!1}var{parentIsUsefulElement:v,targetElementList:g}=sY(e,s);if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(Z(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}(g,i)||!sN(g,null==(h=i)?void 0:h.css_selector_allowlist)||sN(g,null!=(c=null==(d=i)?void 0:d.css_selector_ignorelist)?c:sq))return!1;try{var _=r.getComputedStyle(e);if(_&&"pointer"===_.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var f=e.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return v?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(sD.indexOf(f)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,this.Se,n,n?["copy","cut"]:void 0,this.instance)){var{props:a,explicitNoCapture:o}=function(e,t){var i,s,{e:n,maskAllElementAttributes:a,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:u,disableCaptureUrlHashes:h}=t;if(!sF(e))return{props:{}};for(var c=[e],d=e;d.parentNode&&!sA(d,"body");)if(sI(d.parentNode))c.push(d.parentNode.host),d=d.parentNode.host;else{if(!sF(d.parentNode))break;c.push(d.parentNode),d=d.parentNode}var p,v=[],g={},_=!1,f=!1;if(i8(c,e=>{var t=sJ(e);if(sA(e,"a")){var i=e.getAttribute("href");_=!!(t&&i&&s3(i))&&(h?th(i):i)}B(sC(e),"ph-no-capture")&&(f=!0),v.push(function(e,t,i,s,r){void 0===r&&(r=!1);var n=e.tagName.toLowerCase(),a={tag_name:n};sD.indexOf(n)>-1&&!i&&(a.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?aa(1024,s5(e)):aa(1024,sM(e)));var o=sC(e);o.length>0&&(a.classes=o.filter(function(e){return""!==e})),i8(e.attributes,function(i){var n;if((!sK(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==s||!s.includes(i.name))&&!t&&s3(i.value)&&(!X(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=i.value;"class"===i.name&&(o=sR(o).join(" ")),a["attr__"+i.name]=aa(1024,"href"===i.name&&r?th(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&&!sF(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)),i6(g,function(e){if(!sJ(e))return{};var t={};return i8(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&&s3(s)&&(t[i]=s)}}),t}(e))}),f)return{props:{},explicitNoCapture:f};if(o||(v[0].$el_text=sA(e,"a")||sA(e,"button")?s5(e):sM(e)),_){v[0].attr__href=_;var m,y,w=null==(m=ru(_))?void 0:m.host,x=null==r||null==(y=r.location)?void 0:y.host;w&&x&&w!==x&&(p=_)}return{props:i6({$event_type:n.type,$ce_version:1},u?{}:{$elements:v},{$elements_chain:v.map(e=>{var t,i,s,r={text:null==(i=e.$el_text)?void 0:i.slice(0,400),tag_name:e.tag_name,href:null==(s=e.attr__href)?void 0:s.slice(0,2048),attr_class:(t=e.attr__class)?Y(t)?t:sR(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return i4(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}
1).forEach(e=>{var[t,i]=e;return r.attributes[t]=i}),r}).map(e=>{var t,i,s="";if(e.tag_name&&(s+=e.tag_name),e.attr_class)for(var r of(e.attr_class.sort(),e.attr_class))s+="."+r.replace(/"/g,"");var n=b({},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 i4(n).sort((e,t)=>{var[i]=e,[s]=t;return i.localeCompare(s)}).forEach(e=>{var[t,i]=e;return a[s8(t.toString())]=s8(i.toString())}),(s+=":")+i4(a).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},null!=(i=v[0])&&i.$el_text?{$el_text:null==(s=v[0])?void 0:s.$el_text}:{},p&&"click"===n.type?{$external_click_url:p}:{},g)}}(s,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsChainAsString:this.Gs,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes});if(o)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(a.$element_selectors=l),t===ar){var u,h=sO(null==r||null==(u=r.getSelection())?void 0:u.toString()),c=e.type||"clipboard";if(!h)return!1;a.$selected_content=h,a.$copy_type=c}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return J(null==o?void 0:o.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Ks=(null==r||null==(t=r.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(tZ.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Ys&&this.Ys(),this.Ys=void 0,tZ.info("History API monitoring stopped")}monitorHistoryChanges(){r&&r.history&&(this.Xs("pushState"),this.Xs("replaceState"),this.eo())}Xs(e){var t;if(r&&(null==(t=r.history[e])||!t.__posthog_wrapped__)){var i=this;!function(e,t,i){try{if(!(t in e))return al;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)});J(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 al}}(r.history,e,t=>function(s,r,n){t.call(this,s,r,n),i.ro(e)})}}ro(e){try{var t,i=null==r||null==(t=r.location)?void 0:t.pathname;if(!i)return;i!==this.Ks&&this.isEnabled&&this._instance.capture(i0,{navigation_type:e}),this.Ks=i}catch(t){tZ.error("Error capturing "+e+" pageview",t)}}eo(){if(!this.Ys){var e=()=>{this.ro("popstate")};si(r,"popstate",e),this.Ys=()=>{r&&r.removeEventListener("popstate",e)}}}},heatmaps:class{get Se(){return this.instance.config}constructor(e){var t;this.io=!1,this.Vs=!1,this.no=null,this.instance=e,this.io=!(null==(t=this.instance.persistence)||!t.props[t7]),this.rageclicks=new as(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return K(this.Se.capture_heatmaps)&&this.Se.capture_heatmaps.flush_interval_milliseconds&&(e=this.Se.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return ei(this.Se.capture_heatmaps)?ei(this.Se.enable_heatmaps)?this.io:this.Se.enable_heatmaps:!1!==this.Se.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.Vs||(af.info("starting..."),this.so(),this.ke());else{var e;clearInterval(null!=(e=this.no)?e:void 0),this.oo(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[t7]:t}),this.io=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}ao(e){this.fe(e.originalEvent,"deadclick")}ke(){this.no&&clearInterval(this.no),this.no="visible"===(null==o?void 0:o.visibilityState)?setInterval(this.zr.bind(this),this.flushIntervalMilliseconds):null}so(){r&&o&&(this.lo=this.zr.bind(this),si(r,iX,this.lo),this.uo=e=>this.fe(e||(null==r?void 0:r.event)),si(o,"click",this.uo,{capture:!0}),this.ho=e=>this.do(e||(null==r?void 0:r.event)),si(o,"mousemove",this.ho,{capture:!0}),this.co=new s9(this.instance,s4,this.ao.bind(this)),this.co.startIfEnabledOrStop(),this.vo=this.ke.bind(this),si(o,iZ,this.vo),this.Vs=!0)}oo(){var e;r&&o&&(this.lo&&r.removeEventListener(iX,this.lo),this.uo&&o.removeEventListener("click",this.uo,{capture:!0}),this.ho&&o.removeEventListener("mousemove",this.ho,{capture:!0}),this.vo&&o.removeEventListener(iZ,this.vo),clearTimeout(this.fo),null==(e=this.co)||e.stop(),this.Vs=!1)}po(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),a=function(e,t,i){for(var s=e;s&&sF(s)&&!sA(s,"body")&&s!==i;){var n,a,o,l=void 0;try{l=null==(n=null!=(a=null==(o=s.ownerDocument)?void 0:o.defaultView)?a:r)?void 0:n.getComputedStyle(s).position}catch(e){break}if(B(t,l))return!0;s=sj(s)}return!1}(sL(e),["fixed","sticky"],n);return{x:e.clientX+(a?0:s),y:e.clientY+(a?0:i),target_fixed:a,type:t}}fe(e,t){var i;if(void 0===t&&(t="click"),!sP(e.target)&&am(e)){var s=this.po(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&sG(sL(e),this.instance.config.rageclick)&&this.kt(b({}
1,s,{type:"rageclick"})),this.kt(s)}}do(e){!sP(e.target)&&am(e)&&(clearTimeout(this.fo),this.fo=setTimeout(()=>{this.kt(this.po(e,"mousemove"))},500))}kt(e){if(r){var t=this.Se.disable_capture_url_hashes?th(r.location.href):r.location.href,i=this.Se.custom_personal_data_properties,s=rc(t,this.Se.mask_personal_data_properties?[...r_,...i||[]]:[],rm);this.R=this.R||{},this.R[s]||(this.R[s]=[]),this.R[s].push(e)}}zr(){this.R&&!Q(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:s9,webVitalsAutocapture:class{constructor(e){var t;this.io=!1,this.Vs=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.mo=()=>{clearTimeout(this.yo),0!==this.R.metrics.length&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((e,t)=>b({},e,{["$web_vitals_"+t.name+"_event"]:b({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.bo=e=>{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var t,i=this._o();if(!Z(i))if(ei(null==e?void 0:e.name)||ei(null==e?void 0:e.value))ah.error("Invalid metric received",e);else if(!this.wo||this.wo>e.value){this.R.url!==i&&(this.mo(),this.yo=setTimeout(this.mo,this.flushToCaptureTimeoutMs)),Z(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=Z(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var s=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),r=b({},e,{$current_url:i,timestamp:Date.now()});Z(s)||(r.$session_id=s.sessionId,r.$window_id=s.windowId),this.R.metrics.push(r),this.R.metrics.length===this.allowedMetrics.length&&this.mo()}else ah.error("Ignoring metric with value >= "+this.wo,e)},this.xo=()=>{if(!this.Vs){var e,t,i,s,r=v.__PosthogExtensions__;Z(r)||Z(r.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:s}=r.postHogWebVitalsCallbacks),e&&t&&i&&s?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.bo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.bo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.bo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&s(this.bo.bind(this)),this.Vs=!0):ah.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.io=!(null==(t=this._instance.persistence)||!t.props[ii]),this.startIfEnabled()}get ko(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=K(this.ko)?null==(e=this.ko)?void 0:e.web_vitals_allowed_metrics:void 0;return ei(i)?(null==(t=this._instance.persistence)?void 0:t.props[ia])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(K(this.ko)?this.ko.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=K(this.ko)?this.ko.web_vitals_attribution:void 0;return null!=e&&e}get wo(){var e=K(this.ko)&&es(this.ko.__web_vitals_max_value)?this.ko.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==l?void 0:l.protocol;if("http:"!==e&&"https:"!==e)return ah.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=K(this.ko)?this.ko.web_vitals:en(this.ko)?this.ko:void 0;return en(t)?t:this.io}startIfEnabled(){this.isEnabled&&!this.Vs&&(ah.info("enabled, starting..."),this.Bt(this.xo))}onRemoteConfig(e){if("capturePerformance"in e){var t=K(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=K(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[ii]:t}),this._instance.persistence.register({[ia]:i})),this.io=t,this.startIfEnabled()}}Bt(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",t=>{t?ah.error("failed to load script",t):e()})}_o(){var e=r?this._instance.config.disable_capture_url_hashes?th(r.location.href):r.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return rc(e,this._instance.config.mask_personal_data_properties?[...r_,...t||[]]:[],rm)}ah.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t,i,s;this.xo=()=>{var e;if(r&&this.isEnabled&&null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=v.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=v.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=v.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.So&&this.Se.capture_unhandled_errors&&(this.So=t(this.captureException.bind(this))),!this.Co&&this.Se.capture_unhandled_rejections&&(this.Co=i(this.captureException.bind(this))),!this.Io&&this.Se.capture_console_errors&&(this.Io=s(this.captureException.bind(this)))}catch(e){ao.error("failed to start",e),this.To()}}},this._instance=e,this.Mo=!(null==(t=this._instance.persistence)||!t.props[t9]),this.Eo=new ev({refillRate:null!=(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)?i:1,bucketSize:null!=(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)?s:10,refillInterval:1e4,Ae:ao}),this.Se=this.Po(),this.startIfEnabledOrStop()}Po(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};
1return K(e)?t=b({},t,e):(Z(e)?this.Mo:e)&&(t=b({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Se.capture_console_errors||this.Se.capture_unhandled_errors||this.Se.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(ao.info("enabled"),this.To(),this.Bt(this.xo)):this.To()}Bt(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return ao.error("failed to load script",t);e()})}To(){var e,t,i;null==(e=this.So)||e.call(this),this.So=void 0,null==(t=this.Co)||t.call(this),this.Co=void 0,null==(i=this.Io)||i.call(this),this.Io=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.Mo=!!e.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[t9]:this.Mo}),this.Se=this.Po(),this.startIfEnabledOrStop())}onConfigChange(){this.Se=this.Po()}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.Eo.consumeRateLimit(r)?ao.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.Ro=[],this.Oo=new tS([new tO,new tU,new tL,new tM,new tB,new tz,new tN,new tH],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=tC.test(o)?o.replace(tC,"$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=>b({},e,{filename:e.filename||(c[c.length-1]||{}).filename,function:e.function||"?"}))}}("web:javascript",t$,tT)),this._instance=e,this.Ro=null!=(t=null==(i=this._instance.persistence)?void 0:i.get_property(ie))?t:[],this.Lo=tJ(this.Fo()),this.Ao=new tK(this.Lo)}onConfigChange(){this.Lo=tJ(this.Fo()),this.Ao.setConfig(this.Lo)}onRemoteConfig(e){var t,i,s;if("errorTracking"in e){var r=null!=(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)?t:[],n=null==(s=e.errorTracking)?void 0:s.captureExtensionExceptions;this.Ro=r,this._instance.persistence&&this._instance.persistence.register({[ie]:this.Ro,[it]:n})}}get Do(){var e,t=!!this._instance.get_property(it),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!=(e=null!=i?i:t)&&e}buildProperties(e,t){return this.Oo.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.Lo.enabled)try{if(!X(e)||0===e.trim().length)return void aN.warn("Ignoring exception step because message must be a non-empty string");var i=this.$o(t),{sanitizedProperties:s,droppedKeys:r}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((i,s)=>(tW.has(s)?t.push(s):i[s]=e[s],i),{}),droppedKeys:t}}(i);r.length>0&&aN.warn("Ignoring reserved exception step fields",{droppedKeys:r}),this.Ao.add(b({[tV]:e,[tG]:(new Date).toISOString()},s))}catch(e){aN.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.No(t)){if(this.qo(t))return this.Bo("Exception dropped: matched a suppression rule"),void aN.info("Skipping exception capture because a suppression rule matched");if(!this.Do&&this.jo(t))return this.Bo("Exception dropped: thrown by a browser extension"),void aN.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Ho(t))return this.Bo("Exception dropped: thrown by the PostHog SDK"),void aN.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.Lo.enabled&&ei(e.$exception_steps)?this.Uo(e):e;try{var s=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",an:!0});return s&&this.Ao.clear(),s}catch(e){return aN.error("Failed to capture exception event. Dropping this exception.",e),void this.Ao.clear()}}catch(e){return void aN.error("Failed to process exception event. Ignoring this exception.",e)}}Uo(e){try{var t=this.Ao.getAttachable();return 0===t.length?e:b({},e,{$exception_steps:t})}catch(t){return aN.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Bo(e){this.Lo.enabled&&this.Ao.add({[tV]:e,[tG]:(new Date).toISOString()})}$o(e){return K(e)?b({},e):{}}Fo(){var e,t;return null!=(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)?e:{}}qo(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>
1{var{type:i,value:s}=t;return X(i)&&i.length>0&&e.$exception_types.push(i),X(s)&&s.length>0&&e.$exception_values.push(s),e},{$exception_types:[],$exception_values:[]});return this.Ro.some(e=>{var i=e.values.map(e=>{var i,s=nN[e.operator],r=Y(e.value)?e.value:[e.value],n=null!=(i=t[e.key])?i:[];return r.length>0&&s(r,n)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}jo(e){return e.flatMap(e=>{var t,i;return null!=(t=null==(i=e.stacktrace)?void 0:i.frames)?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}Ho(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}No(e){return!ei(e)&&Y(e)}}},aG,{siteApps:class{constructor(e){this.Go=0,this._instance=e,this.Zo=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}Qo(e,t){if(t){var i=this.globalsForEvent(t);this.Zo.push(i),this.Zo.length>1e3&&(this.Zo=this.Zo.slice(10))}}get siteAppLoaders(){var e;return null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.Qo.bind(this));this.Jo=()=>{e(),this.Zo=[],this.Jo=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,c]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[h]={id:u[h],type:h,properties:c};var{$set_once:d,$set:p}=e;return{event:b({},w(e,aw),{properties:b({},e.properties,p?{$set:b({},null!=(t=null==(i=e.properties)?void 0:i.$set)?t:{},p)}:{},d?{$set_once:b({},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}}Ko(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)||(ax.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)||(ax.error("prepare_external_dependency_script returned null"),null):e}Yo(){if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var e,t,i,s,r,n,a,l,u=null==o?void 0:o.defaultView,h=null==u||null==(e=u.Node)?void 0:e.prototype;if(!u||!h)return()=>{};if(this.Go++,this.Xo)return this.ea();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.Ko(e);return t&&p.add(t),t},_=e=>e.map(e=>"string"==typeof e?e:g(e)).filter(e=>!et(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=>{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,_(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,_(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,_(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,_(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=_(i);return i.length&&!r.length?void 0:e.apply(this,r)})}),v(null==(l=u.Element)?void 0:l.prototype,"insertAdjacentElement",e=>function(t,i){var s=g(i);return s?e.call(this,t,s):null}),this.Xo=()=>
1{c.forEach(e=>e()),this.Xo=void 0},this.ea()}ea(){var e=!1;return()=>{var t;e||(e=!0,this.Go--,0===this.Go&&(null==(t=this.Xo)||t.call(this)))}}ta(e,t){void 0===t&&(t=!0);var i=this.Yo();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.Zo.length&&(ax.info("Processing "+this.Zo.length+" events for site app with id "+e.id),this.Zo.forEach(e=>this.ta(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.Jo)||i.call(this))},s=!1,r=r=>{t.errored=!r,t.loaded=!0,ax.info("Site app with id "+e.id+" "+(r?"loaded":"errored")),s&&i()};try{var{processEvent:n}=this.ta(t=>e.init({posthog:this._instance,callback(e){t(),r(e)}}),!1);n&&(t.processEvent=n),s=!0}catch(t){ax.error(aS+e.id,t),r(!1)}if(s&&t.loaded)try{i()}catch(i){ax.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}ra(){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)}ia(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),s=function(s){try{t.ta(()=>null==s.processEvent?void 0:s.processEvent(i))}catch(t){ax.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.ra(),void this._instance.on("eventCaptured",e=>this.ia(e))):void ax.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.Jo)||i.call(this),null!=(s=e.siteApps)&&s.length)if(this.isEnabled){var n=function(e){var t;v["__$$ph_site_app_"+e]=r._instance,null==(t=v.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(r._instance,o,t=>{if(t)return ax.error(aS+e,t)})};for(var{id:a,url:o}of e.siteApps)n(a)}else ax.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},aW,{tracingHeaders:class{constructor(e){this.na=void 0,this.sa=void 0,this.oa=void 0,this.xo=()=>{var e,t,i=this.aa();i?(Z(this.na)&&(this.na=null==(e=v.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),Z(this.sa)&&(this.sa=null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.To()},this._instance=e}initialize(){this.startIfEnabledOrStop()}Bt(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return au.error("failed to load script",t);e()})}la(){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}aa(){var e=this.la();return Y(e)?(Y(this.oa)?this.oa.splice(0,this.oa.length,...e):this.oa=[...e],e.length>0?this.oa:void 0):(Y(this.oa)&&this.oa.splice(0),this.oa=e||void 0,this.oa)}To(){var e,t;null==(e=this.na)||e.call(this),null==(t=this.sa)||t.call(this),this.na=void 0,this.sa=void 0}startIfEnabledOrStop(){this.aa()?this.Bt(this.xo):this.To()}}},{toolbar:class{constructor(e){this.instance=e}xa(e){v.ph_toolbar_state=e}ka(){var e;return null!=(e=v.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),ss(this.instance.config)||!r||!o)return!1;e=null!=e?e:r.location,i=null!=i?i:r.history;try{if(!t){try{r.localStorage.setItem("test","test"),r.localStorage.removeItem("test")}catch(e){return!1}t=null==r?void 0:r.localStorage}var s,n=aI||rd(e.hash,"__posthog")||rd(e.hash,"state"),a=n?i7(()=>JSON.parse(atob(decodeURIComponent(n))))||i7(()=>JSON.parse(decodeURIComponent(n))):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(aR)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(e){return!1}}Sa(e){var t=v.ph_load_toolbar||v.ph_load_editor;!ei(t)&&J(t)?t(e,this.instance):aT.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==o||!o.getElementById(iz));if(!r||i)return!1;var s="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=b({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});return(r.localStorage.setItem(aR,JSON.stringify(b({},n,{source:void 0}))),2===this.ka())?this.Sa(n):0===this.ka()&&(this.xa(1),null==(t=v.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{e?(aT.error("[Toolbar] Failed to load",e),this.xa(0)):(this.xa(2),this.Sa(n))}),si(r,"turbolinks:load",()=>{this.xa(0),this.loadToolbar(n)})),!0}Ca(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)}}},aY,{conversations:class{constructor(e){this.Ia=void 0,this._conversationsManager=null,this.Ta=!1,this.Ma=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;ei(t)||(en(t)?this.Ia=t:(this.Ia=t.enabled,this.Ma=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Ia=void 0,this.Ma=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ta||this._instance.config.disable_conversations||ss(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==v?void 0:v.__PosthogExtensions__;if(e&&!Z(this.Ia)&&this.Ia)if(this.Ma&&this.Ma.token){this.Ta=!0;try{var t=e.initConversations;if(t)return this.Ea(t),void(this.Ta=!1);var i=e.loadExternalDependency;if(!i)return void this.Pa(iG);i(this._instance,"conversations",t=>{t||!e.initConversations?this.Pa("Could not load conversations script",t):this.Ea(e.initConversations),this.Ta=!1})}catch(e){this.Pa("Error initializing conversations",e),this.Ta=!1}}else aB.error("Conversations enabled but missing token in remote config.")}}Ea(e){if(this.Ma)try{this._conversationsManager=e(this.Ma,this._instance),aB.info("Conversations loaded successfully")}catch(e){this.Pa("Error completing conversations initialization",e)}else aB.error("Cannot complete initialization: remote config is null")}Pa(e,t){aB.error(e,t),this._conversationsManager=null,this.Ta=!1}show(){this._conversationsManager?this._conversationsManager.show():aB.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Ia&&!et(this._conversationsManager)}isVisible(){var e,t;return null!=(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&e}sendMessage(e,t,i){var s=this;return y(function*(){return s._conversationsManager?s._conversationsManager.sendMessage(e,t,i):(aB.warn(aH),null)})()}getMessages(e,t){var i=this;return y(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(aB.warn(aH),null)})()}markAsRead(e){var t=this;return y(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(aB.warn(aH),null)})()}getTickets(e){var t=this;return y(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(aB.warn(aH),null)})()}requestRestoreLink(e){var t=this;return y(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(aB.warn(aH),null)})()}restoreFromToken(e){var t=this;return y(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(aB.warn(aH),null)})()}restoreFromUrlToken(){var e=this;return y(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(aB.warn(aH),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}vn(){var e;null==(e=this._conversationsManager)||e.setIdentity()}fn(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.Ra=!1,this.Oa=!1,this.Ae=tX("[logs]"),this.Or=[],this.La=[],this.ys=0,this.Fa=()=>{var e,t;this.ys=0,null==(e=this.Aa)||e.onReconnect(),null==(t=this.Da)||t.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.Ra=!0),r&&si(r,"online",this.Fa)}$a(e,t,i,s){var r,n,a,o,l,u,h,c,d,p,v,g,_,f,m=(r=null==(f=this._instance)||null==(f=f.config)?void 0:f.logs,d=null!=(n=null==r?void 0:r.flushIntervalMs)?n:3e3,p=null!=(a=null==r?void 0:r.maxBufferSize)?a:100,g=Z(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==(_=null==r?void 0:r.resourceAttributes)?void 0:_["service.name"])?u:null==r?void 0:r.serviceName)?l:null==i?void 0:i.serviceNameDefault,serviceVersion:null!=(h=null==_?void 0:_["service.version"])?h:null==r?void 0:r.serviceVersion,environment:null!=(c=null==_?void 0:_["deployment.environment"])?c:null==r?void 0:r.environment,resourceAttributes:_,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 tm(this.Na(e,t),m,this.Ae,()=>this.qa(),e=>e(),void 0,s),m]}Ba(){var e,t,i=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.Aa&&this.ja===i||(null==(t=this.Aa)||t.reset(),this.ja=i,[this.Aa,this.Ha]=this.$a(()=>this.Or,e=>{this.Or=e})),this.Aa}Ua(){var e,t,i=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.Da&&this.za===i||(null==(t=this.Da)||t.reset(),this.za=i,[this.Da,this.Va]=this.$a(()=>this.La,e=>{this.La=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},aU)),this.Da}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,i=null==(t=e.logs)?void 0:t.captureConsoleLogs;!ei(i)&&i&&(this.Ra=!0,this.loadIfEnabled())}reset(){var e,t;this.Or=[],null==(e=this.Aa)||e.reset(),this.La=[],null==(t=this.Da)||t.reset(),this.ys=0}captureLog(e){this.Ba().captureLog(e)}le(e){this.Ua().captureLog(e)}get logger(){return this.Wa||(this.Wa={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)=>
1this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Wa}flushLogs(e){e?this.Ga(e):(this.Aa&&this.Aa.flush().catch(e=>this.Ae.error("PostHog logs flush failed:",e)),this.Da&&this.Da.flush().catch(e=>this.Ae.error("PostHog logs flush failed:",e)))}loadIfEnabled(){if(this.Ra&&!this.Oa){var e=null==v?void 0:v.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",t=>{var i;t||null==(i=e.logs)||!i.initializeLogs?this.Ae.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.Oa=!0)}):this.Ae.error(iG)}else this.Ae.error("PostHog Extensions not found.")}}Na(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:[])},ht:e=>this.ht(e),getLibraryId:()=>f.LIB_NAME,getLibraryVersion:()=>f.LIB_VERSION}}ht(e){return new Promise(t=>{if(rp(this.ys,3))t({kind:"fatal",error:Error("logs endpoint is unreachable, dropping batch")});else{var i=!1,s=e=>{i||(i=!0,clearTimeout(r),t(e))},r=setTimeout(()=>s({kind:"retry-later",error:Error("logs request timed out")}),9e4);this._instance._send_request({method:"POST",url:this.Za(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t,i=e.statusCode;(this.Qa(i),i>=200&&300>i)?s({kind:"ok"}):413===i?s({kind:"too-large"}):0!==i&&429!==i&&500>i?s({kind:"fatal",error:Error("logs request failed with status "+i)}):s({kind:"retry-later",error:null!=(t=e.error)?t:Error("logs request failed with status "+i)})}})}})}Qa(e){(0!==e||this._instance.__loaded)&&(this.ys=rv(e,this.ys,3,()=>this.Ae.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.")))}Ga(e){this.Or.length>0&&this.Ja(e,this.Or,this.Ha,f.LIB_NAME,e=>{this.Or=e}),this.La.length>0&&this.Ja(e,this.La,this.Va,aU,e=>{this.La=e})}Ja(e,t,i,s,r){if(0!==t.length){var n=t.map(e=>e.record);r([]);var a=tf(n,t_(i,f.LIB_NAME,f.LIB_VERSION),s,f.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Za(),data:a,compression:"best-available",batchKey:"logs",transport:e})}}Za(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}qa(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:i,windowId:s,sessionStartTimestamp:r,lastActivityTimestamp:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=i,t.windowId=s,ei(r)||(t.sessionStartTimestamp=r),ei(n)||(t.lastActivityTimestamp=n)}if(null!=v&&null!=(e=v.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?th(v.location.href):v.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.Ae=tX("[metrics]"),this._instance=e}initialize(){}Ba(){var e,t,i,s,r,n,a,o,l=null==(e=this._instance)||null==(e=e.config)?void 0:e.metrics;return this.Aa&&this.ja===l||(null==(t=this.Aa)||t.reset(),this.ja=l,this.Aa=new tx(this.Na(),{serviceName:null!=(i=null==(o=null==l?void 0:l.resourceAttributes)?void 0:o["service.name"])?i:null==l?void 0:l.serviceName,serviceVersion:null!=(s=null==o?void 0:o["service.version"])?s:null==l?void 0:l.serviceVersion,environment:null!=(r=null==o?void 0:o["deployment.environment"])?r:null==l?void 0:l.environment,resourceAttributes:o,beforeSend:null==l?void 0:l.beforeSend,flushIntervalMs:null!=(n=null==l?void 0:l.flushIntervalMs)?n:1e4,maxSeriesPerFlush:null!=(a=null==l?void 0:l.maxSeriesPerFlush)?a:1e3},this.Ae)),this.Aa}count(e,t,i){void 0===t&&(t=1),this.Ba().count(e,t,i)}gauge(e,t,i){this.Ba().gauge(e,t,i)}histogram(e,t,i){this.Ba().histogram(e,t,i)}flush(e){if(!this.Aa)return Promise.resolve();if(e){var t=this.Aa.drainWindow();return t&&this.Tt(t,e),Promise.resolve()}return this.Aa.flush().catch(e=>this.Ae.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.Aa)||e.reset()}Na(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Tt:e=>t.Tt(e),getLibraryId:()=>f.LIB_NAME,getLibraryVersion:()=>f.LIB_VERSION}}Tt(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(b({method:"POST",url:this.Ka(),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&&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)})}}))})}Ka(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}});ai.__defaultExtensionClasses=b({},aJ);var aK=(f.SDK_DIST_CHANNEL="npm",s=nX[n6]=new ai,function(){function e(){e.done||(e.done=!0,n4=!1,i8(nX,function(e){e._dom_loaded()}))}null!=o&&o.addEventListener?"complete"===o.readyState?e():si(o,"DOMContentLoaded",e,{capture:!1}):r&&tZ.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),s);e.s(["default",0,aK])}]);

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.