PageSourceSearch

https://www.upcar.ai/_next/static/chunks/cd24890f.33aa14408e335cae.js

js upcar.ai collected 2026-10-05 15:26:16 UTC 212,557 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[37909],{20932:function(e,t,i){i.r(t),i.d(t,{Compression:function(){return sj},DEFAULT_PRODUCT_TOUR_APPEARANCE:function(){return sD},DisplaySurveyType:function(){return sO},PostHog:function(){return n8},ProductTourEventName:function(){return sC},ProductTourEventProperties:function(){return sM},SurveyEventName:function(){return sI},SurveyEventProperties:function(){return s$},SurveyEventType:function(){return sE},SurveyPosition:function(){return sS},SurveyQuestionBranchingType:function(){return sF},SurveyQuestionType:function(){return sT},SurveySchedule:function(){return sR},SurveyTabPosition:function(){return sk},SurveyType:function(){return sP},SurveyWidgetType:function(){return sx},default:function(){return oB},posthog:function(){return oB},severityLevels:function(){return sq}});var r,s="undefined"!=typeof window?window:void 0,n="undefined"!=typeof globalThis?globalThis:s;"undefined"==typeof self&&(n.self=n),"undefined"==typeof File&&(n.File=function(){});var o=null==n?void 0:n.navigator,a=null==n?void 0:n.document,l=null==n?void 0:n.location,u=null==n?void 0:n.fetch,c=null!=n&&n.XMLHttpRequest&&"withCredentials"in new n.XMLHttpRequest?n.XMLHttpRequest:void 0,h=null==n?void 0:n.AbortController,d=null==n?void 0:n.CompressionStream,p=null==o?void 0:o.userAgent,v=null!=s?s:{},g="1.391.9",_={DEBUG:!1,LIB_VERSION:g,LIB_NAME:"web",JS_SDK_VERSION:g};function f(e,t,i,r,s,n,o){try{var a=e[n](o),l=a.value}catch(e){return void i(e)}a.done?t(l):Promise.resolve(l).then(r,s)}function m(e){return function(){var t=this,i=arguments;return new Promise(function(r,s){var n=e.apply(t,i);function o(e){f(n,r,s,o,a,"next",e)}function a(e){f(n,r,s,o,a,"throw",e)}o(void 0)})}}function y(){return(y=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var i=arguments[t];for(var r in i)({}).hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(null,arguments)}function b(e,t){if(null==e)return{};var i={};for(var r in e)if(({}).hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;i[r]=e[r]}return i}var w,E,x,S,k=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}},P=((w={}).AnonymousId="anonymous_id",w.DistinctId="distinct_id",w.Props="props",w.EnablePersonProcessing="enable_person_processing",w.PersonMode="person_mode",w.FeatureFlagDetails="feature_flag_details",w.FeatureFlags="feature_flags",w.FeatureFlagPayloads="feature_flag_payloads",w.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",w.BootstrapFeatureFlags="bootstrap_feature_flags",w.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",w.OverrideFeatureFlags="override_feature_flags",w.Queue="queue",w.LogsQueue="logs_queue",w.OptedOut="opted_out",w.SessionId="session_id",w.SessionStartTimestamp="session_start_timestamp",w.SessionLastTimestamp="session_timestamp",w.PersonProperties="person_properties",w.GroupProperties="group_properties",w.InstalledAppBuild="installed_app_build",w.InstalledAppVersion="installed_app_version",w.SessionReplay="session_replay",w.SurveyLastSeenDate="survey_last_seen_date",w.SurveysSeen="surveys_seen",w.Surveys="surveys",w.RemoteConfig="remote_config",w.FlagsEndpointWasHit="flags_endpoint_was_hit",w.DeviceId="device_id",w),T=((E={}).GZipJS="gzip-js",E.Base64="base64",E),F=["$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"],R=["token"],I="NativeGzipValidationError",$=e=>e.length>=2&&31===e[0]&&139===e[1],O=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=I,t},C=(x=m(function*(e,t){18>e.size&&D("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));$(i)&&8===i[2]||D("invalid-header");var r=new DataView((yield e.slice(e.size-8).arrayBuffer()));r.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(S)return S;S=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?3988292384^t>>>1:t>>>1;S[e]=t>>>0}return S})(),i=4294967295,r=0;e.length>r;r++)i=t[255&(i^e[r])]^i>>>8;return(4294967295^i)>>>0})(t)&&D("invalid-crc");var s=t.length>>>0;r.getUint32(4,!0)!==s&&D("invalid-size")}),function(e,t){return x.apply(this,arguments)});function M(){return(M=m(function*(e,t,i){void 0===t&&(t=!0);try{var r,s=(new TextEncoder).encode(e),n=new CompressionStream("gzip"),o=n.writable.getWriter(),a=o.write(s).then(()=>o.close()).catch((r=m(function*(e){try{yield o.abort(e)}catch(e){}throw e}),function(e){return r.apply(this,arguments)})),l=new Response(n.readable).blob(),[u]=yield Promise.all([l,a]);return yield C(u,s),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 A=["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"],L=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return A.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function N(e,t){return -1!==e.indexOf(t)}var U=function(e){return e.trim()},q=function(e){return e.replace(/^\$/,"")},j=Object.prototype,H=j.hasOwnProperty,B=j.toString,z=Array.isArray||function(e){return"[object Array]"===B.call(e)},V=e=>"function"==typeof e,W=e=>e===Object(e)&&!z(e),K=e=>{if(W(e)){for(var t in e)if(H.call(e,t))return!1;return!0}return!1},G=e=>void 0===e,Y=e=>"[object String]"==B.call(e),Q=e=>Y(e)&&0===e.trim().length,J=e=>null===e,X=e=>G(e)||J(e),Z=e=>"[object Number]"==B.call(e)&&e==e,ee=e=>Z(e)&&e>0,et=e=>"[object Boolean]"===B.call(e),ei=e=>e instanceof FormData,er=e=>N(F,e),es=e=>N(R,e);function en(e){return null===e||"object"!=typeof e}function eo(e,t){return({}).toString.call(e)==="[object "+t+"]"}function ea(e){return"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var el=[!0,"true",1,"1","yes"],eu=e=>N(el,e),ec=[!1,"false",0,"0","no"];function eh(e,t,i,r,s){return t>i&&(r.warn("min cannot be greater than max."),t=i),Z(e)?e>i?(r.warn(" cannot be  greater than max: "+i+". Using max value instead."),i):t>e?(r.warn(" cannot be less than min: "+t+". Using min value instead."),t):e:(r.warn(" must be a number. using max or fallback. max: "+i+", fallback: "+s),eh(s||i,t,i,r))}class ed{constructor(e){this.$t={},this.Gt=e.Gt,this.Zt=eh(e.bucketSize,0,100,e.Qt),this.Jt=eh(e.refillRate,0,this.Zt,e.Qt),this.Kt=eh(e.refillInterval,0,864e5,e.Qt)}Yt(e,t){var i=Math.floor((t-e.lastAccess)/this.Kt);i>0&&(e.tokens=Math.min(e.tokens+i*this.Jt,this.Zt),e.lastAccess=e.lastAccess+i*this.Kt)}consumeRateLimit(e){var t,i=Date.now(),r=String(e),s=this.$t[r];return s?this.Yt(s,i):this.$t[r]=s={tokens:this.Zt,lastAccess:i},0===s.tokens||(s.tokens--,0===s.tokens&&(null==(t=this.Gt)||t.call(this,e)),0===s.tokens)}stop(){this.$t={}}}var ep="Mobile",ev="Android",eg="Tablet",e_=ev+" "+eg,ef="iPad",em="Apple",ey=em+" Watch",eb="Safari",ew="BlackBerry",eE="Samsung",ex=eE+"Browser",eS=eE+" Internet",ek="Chrome",eP=ek+" OS",eT=ek+" iOS",eF="Internet Explorer",eR=eF+" "+ep,eI="Opera",e$=eI+" Mini",eO="Edge",eD="Microsoft "+eO,eC="Firefox",eM=eC+" iOS",eA="Nintendo",eL="PlayStation",eN="Xbox",eU=ev+" "+ep,eq=ep+" "+eb,ej="Windows",eH=ej+" Phone",eB="Nokia",ez="Ouya",eV="Generic",eW=eV+" "+ep.toLowerCase(),eK=eV+" "+eg.toLowerCase(),eG="Konqueror",eY="Oculus Browser",eQ="Vivaldi",eJ="Yandex",eX="Whale",eZ="DuckDuckGo",e0="Pale Moon",e1="Waterfox",e2="Brave",e3="Google Search App",e5="(\\d+(\\.\\d+)?)",e4=RegExp("Version/"+e5),e6=RegExp(eN,"i"),e8=RegExp(eL+" \\w+","i"),e7=RegExp(eA+" \\w+","i"),e9=RegExp(ew+"|PlayBook|BB10","i"),te={"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"},tt=function(e,t,i,r){var s;return t=t||"",(null!=i&&i.brave?e2:null)||(null!=r&&r.detectGoogleSearchApp&&N(e,"GSA/")?e3:N(e," OPR/")&&N(e,"Mini")?e$:N(e," OPR/")?eI:e9.test(e)?ew:N(e,"IE"+ep)||N(e,"WPDesktop")?eR:N(e,"OculusBrowser")?eY:N(e,ex)?eS:N(e,eO)||N(e,"Edg/")?eD:N(e,eQ+"/")?eQ:N(e,"YaBrowser/")?eJ:N(e,eX+"/")?eX:N(e,eZ+"/")||N(e,"Ddg/")?eZ:N(e,"FBIOS")?"Facebook "+ep:N(e,"UCWEB")||N(e,"UCBrowser")?"UC Browser":N(e,"CriOS")?eT:N(e,"CrMo")||N(e,ek)?ek:N(e,ev)&&N(e,eb)?eU:N(e,"FxiOS")?eM:N(e.toLowerCase(),eG.toLowerCase())?eG:N(e,e2+"/")?e2:(s=t)&&N(s,em)||N(e,eb)&&!N(e,ek)&&!N(e,ev)?N(e,ep)?eq:eb:N(e,"PaleMoon/")?e0:N(e,e1+"/")?e1:N(e,eC)?eC:N(e,"MSIE")||N(e,"Trident/")?eF:N(e,"Gecko")?eC:"")},ti={[eR]:[RegExp("rv:"+e5)],[eD]:[RegExp(eO+"?\\/"+e5)],[ek]:[RegExp("("+ek+"|CrMo)\\/"+e5)],[eT]:[RegExp("CriOS\\/"+e5)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+e5)],[eb]:[e4],[eq]:[e4],[eI]:[RegExp("(Opera|OPR)\\/"+e5)],[eC]:[RegExp(eC+"\\/"+e5)],[eM]:[RegExp("FxiOS\\/"+e5)],[eG]:[RegExp("Konqueror[:/]?"+e5,"i")],[ew]:[RegExp(ew+" "+e5),e4],[eU]:[RegExp("android\\s"+e5,"i")],[eS]:[RegExp(ex+"\\/"+e5)],[eY]:[RegExp("OculusBrowser\\/"+e5)],[eQ]:[RegExp(eQ+"\\/"+e5)],[eJ]:[RegExp("YaBrowser\\/"+e5)],[eX]:[RegExp(eX+"\\/"+e5)],[e2]:[RegExp(e2+"\\/"+e5)],[eZ]:[RegExp("(DuckDuckGo|Ddg)\\/"+e5)],[e0]:[RegExp("PaleMoon\\/"+e5)],[e1]:[RegExp(e1+"\\/"+e5)],[e3]:[RegExp("GSA\\/"+e5)],[eF]:[RegExp("(rv:|MSIE )"+e5)],Mozilla:[RegExp("rv:"+e5)]},tr=function(e,t,i,r){var s=ti[tt(e,t,i,r)];if(G(s))return null;for(var n=0;s.length>n;n++){var o=e.match(s[n]);if(o)return parseFloat(o[o.length-2])}return null},ts=[[RegExp(eN+"; "+eN+" (.*?)[);]","i"),e=>[eN,e&&e[1]||""]],[RegExp(eA,"i"),[eA,""]],[RegExp(eL,"i"),[eL,""]],[e9,[ew,""]],[RegExp(ej,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eH,""];if(new RegExp(ep).test(t)&&!/IEMobile\b/.test(t))return[ej+" "+ep,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=te[i[1]]||"";return/arm/i.test(t)&&(r="RT"),[ej,r]}return[ej,""]}],[/((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=G(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+ev+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+ev+")","i"),e=>e&&e[2]?[ev,[e[2],e[3],e[4]||"0"].join(".")]:[ev,""]],[/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/,[eP,""]],[/Linux|debian/i,["Linux",""]]],tn=function(e){return e7.test(e)?eA:e8.test(e)?eL:e6.test(e)?eN:RegExp(ez,"i").test(e)?ez:RegExp("("+eH+"|WPDesktop)","i").test(e)?eH:/iPad/.test(e)?ef:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?ey:e9.test(e)?ew:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eB,"i").test(e)?eB:/(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(ep).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)?ev:e_:RegExp("(pda|"+ep+")","i").test(e)?eW:RegExp(eg,"i").test(e)&&!RegExp(eg+" pc","i").test(e)?eK:""},to=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function ta(e,t){return"string"==typeof e&&to.test(e)?e:t()}function tl(e,t){var i=setTimeout(e,t);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}var tu=e=>e instanceof Error,tc={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}},th=tc.info;function td(e){var t=[];for(var i in e){var r=e[i];J(r)||G(r)||t.push({key:i,value:function e(t){if(et(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(z(t))return{arrayValue:{values:t.map(t=>e(t))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}(r)})}return t}function tp(e,t,i){return y({},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 tv(e,t,i,r){return{resourceLogs:[{resource:{attributes:td(t)},scopeLogs:[{scope:{name:i,version:r},logRecords:e}]}]}}let tg=class{constructor(e,t,i,r,s,n){var o;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.Dt=t,this.Qt=i,this.Xt=r,this.er=s,this.tr=n,this.rr=null,this.ir=0,this.nr=0,this.sr=0,this.ar=0,this.lr=!1,this.ur=t.maxBufferSize,this.ot=Math.max(null!==(o=t.maxQueueSize)&&void 0!==o?o:t.maxBufferSize,t.maxBufferSize),this.hr=t.flushIntervalMs,this.cr=t.maxBatchRecordsPerPost,this.dr=t.rateCapWindowMs,this.vr=t.maxLogsPerInterval}reset(){this.pr(),this.rr=null,this.sr=0,this.ar=0,this.lr=!1,this.ir=0,this.nr=0,this.cr=this.Dt.maxBatchRecordsPerPost}onReconnect(){this.nr=0,this.gr()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.mr(e);if(null!==t){if(t.body){if(this.yr()){var i={record:function(e,t){var{text:i,number:r}=tc[e.level||"info"]||th,s=String(Date.now())+"000000",n={};t.distinctId&&(n.posthogDistinctId=t.distinctId),t.sessionId&&(n.sessionId=t.sessionId),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 o=y({},n,e.attributes||{}),a={timeUnixNano:s,observedTimeUnixNano:s,severityNumber:r,severityText:i,body:{stringValue:e.body},attributes:td(o)};return e.trace_id&&(a.traceId=e.trace_id),e.span_id&&(a.spanId=e.span_id),G(e.trace_flags)||(a.flags=e.trace_flags),a}(t,this.Xt())};this.er(()=>this.br(i))}}else this.Qt.info("Log was rejected in beforeSend function")}}}mr(e){var t=this.Dt.beforeSend;if(!t)return e;var i=z(t)?t:[t],r=e;for(var s of i)try{var n=s(r);if(!n)return this.Qt.info("Log was rejected in beforeSend function"),null;r=n}catch(e){return this.Qt.error("Error in beforeSend function for log:",e),null}return r}yr(){if(void 0===this.vr)return!0;var e=Date.now(),t=e-this.sr;return this.dr>t&&t>=0||(this.sr=e,this.ar=0,this.lr=!1),this.vr>this.ar?(this.ar++,!0):(this.lr||(this.Qt.warn("captureLog dropping logs: exceeded "+this.vr+" logs per "+this.dr+"ms"),this.lr=!0),!1)}flush(){var e=this;return m(function*(){if(!e._instance.isDisabled)return e.rr||(e.rr=e._r().finally(()=>{e.rr=null})),e.rr})()}_r(){var e=this;return m(function*(){e.pr();var t=null!==(s=e._instance.getPersistedProperty(P.LogsQueue))&&void 0!==s?s:[];if(0!==t.length)for(var i=t.length,r=0;t.length>0&&i>r;){e.ir=0;var s,n,o=Math.min(t.length,e.cr),a=t.slice(0,o),l=tv(a.map(e=>e.record),e.wr(),e._instance.getLibraryId(),e._instance.getLibraryVersion()),u=yield e._instance.kr(l);if("too-large"===u.kind&&a.length>1)e.cr=Math.max(1,Math.floor(a.length/2)),e.Qt.warn("Received 413 when sending logs batch of size "+a.length+", reducing batch size to "+e.cr);else if("retry-later"===u.kind||("too-large"===u.kind?e.Qt.warn("Dropping a single log record after 413 with batch size 1 — the record 
1is larger than the server cap and cannot be split further."):"ok"===u.kind&&e.Dt.maxBatchRecordsPerPost>e.cr&&(e.cr=Math.min(e.Dt.maxBatchRecordsPerPost,e.cr+1)),yield e.Sr(a.length),t=null!==(n=e._instance.getPersistedProperty(P.LogsQueue))&&void 0!==n?n:[],r+=a.length,"fatal"===u.kind))throw u.error}})()}Sr(e){var t=this;return m(function*(){var i,r=Math.max(0,e-t.ir),s=null!==(i=t._instance.getPersistedProperty(P.LogsQueue))&&void 0!==i?i:[];t._instance.setPersistedProperty(P.LogsQueue,s.slice(r)),yield t.tr()})()}wr(){return tp(this.Dt,this._instance.getLibraryId(),this._instance.getLibraryVersion())}br(e){var t;if(!this._instance.optedOut){var i=null!==(t=this._instance.getPersistedProperty(P.LogsQueue))&&void 0!==t?t:[];this.ot>i.length||(i.shift(),this.ir++,this.Qt.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(P.LogsQueue,i),this.ur>i.length?this.Cr():this.gr()}}Cr(e){void 0===e&&(e=this.hr),this.Ir||(this.Ir=tl(()=>{this.Ir=void 0,this.gr()},e))}Tr(){var e=Math.min(Math.max(0,this.nr-1),6);return this.hr*Math.pow(2,e)}Er(){var e=this._instance.getPersistedProperty(P.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return m(function*(){t.pr();var i=t.flush().catch(()=>{});void 0!==e?yield Promise.race([i,new Promise(t=>tl(t,e))]):yield i})()}flushWithTimeout(e){var t=this;return m(function*(){var i=!1,r=t.flush(),s=new Promise(t=>tl(()=>{i=!0,t()},e));try{yield Promise.race([r,s])}finally{i&&r.catch(()=>{})}})()}gr(){this.flush().then(()=>{this.nr=0},e=>{this.nr++,this.Qt.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.Er()&&this.Cr(this.Tr())})}pr(){this.Ir&&(clearTimeout(this.Ir),this.Ir=void 0)}};class t_{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"},r=this.buildCoercingContext(i,t,0).apply(e),s=this.buildParsingContext(t),n=this.parseStacktrace(r,s);return{$exception_list:this.convertToExceptionList(n,i),$exception_level:"error"}}modifyFrames(e){var t=this;return m(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&z(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,r;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.skipFirstLines:0),t.chunkIdMap)),y({},e,{cause:i,stack:r})}applyChunkIds(e,t){return e.map(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 m(function*(){var i=e;for(var r of t.modifiers)i=yield r(i);return i})()}convertToExceptionList(e,t){var i,r,s,n={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(r=t.handled)||void 0===r||r,synthetic:null!==(s=e.synthetic)&&void 0!==s&&s}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var o=[n];return null!=e.cause&&o.push(...this.convertToExceptionList(e.cause,y({},t,{handled:!0}))),o}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return re&&i.length===i9||(i9=i.length,re=i.reduce((i,r)=>{i7||(i7={});var s=i7[r];if(s)i[s[0]]=s[1];else for(var n=e(r),o=n.length-1;o>=0;o--){var a=n[o],l=null==a?void 0:a.filename,u=t[r];if(l&&u){i[l]=u,i7[r]=[l,u];break}}return i},{})),re}}(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var r=(i,r)=>{if(4>=r){var s=this.buildCoercingContext(e,t,r);return this.applyCoercers(i,s)}};return y({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,i),next:e=>r(e,i+1)})}}function tf(e,t,i,r,s){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!0};return G(r)||(n.lineno=r),G(s)||(n.colno=s),n}var tm=(e,t)=>
1{var i=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return i||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},ty=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tb=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tw=/\((\S*)(?::(\d+))(?::(\d+))\)/,tE=(e,t)=>{var i=ty.exec(e);if(i){var[,r,s,n]=i;return tf(t,r,"?",+s,+n)}var o=tb.exec(e);if(o){if(o[2]&&0===o[2].indexOf("eval")){var a=tw.exec(o[2]);a&&(o[2]=a[1],o[3]=a[2],o[4]=a[3])}var[l,u]=tm(o[1]||"?",o[2]);return tf(t,u,l,o[3]?+o[3]:void 0,o[4]?+o[4]:void 0)}},tx=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tS=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tk=(e,t)=>{var i=tx.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=tS.exec(i[3]);r&&(i[1]=i[1]||"eval",i[3]=r[1],i[4]=r[2],i[5]="")}var s=i[3],n=i[1]||"?";return[n,s]=tm(n,s),tf(t,s,n,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},tP=/\(error: (.*)\)/;class tT{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=Y(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return eo(e,"DOMException")}isDOMError(e){return eo(e,"DOMError")}}class tF{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 tR{constructor(){}match(e){return eo(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 tI=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class t${match(e){return"string"==typeof e}coerce(e,t){var i,[r,s]=this.getInfos(e);return{type:null!=r?r:"Error",value:null!=s?s:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,r=e.match(tI);return r&&(t=r[1],i=r[2]),[t,i]}}var tO=["fatal","error","warning","log","info","debug"];function tD(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var s=i.slice(0,r).join(", ");if(t>=s.length)return r===i.length?s:s.length>t?s.slice(0,t)+"...":s}return""}class tC{match(e){return"object"==typeof e&&null!==e}coerce(e,t){var i,r=this.getErrorPropertyFromObject(e);return r?t.apply(r):{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 ea(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: "+tD(e)}isSeverityLevel(e){return Y(e)&&!Q(e)&&tO.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var i=e[t];if(tu(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tM{match(e){return ea(e)}coerce(e,t){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+tD(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tA{match(e){return en(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 tL{match(e){return eo(e,"PromiseRejectionEvent")||this.isCu
1stomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!ea(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,r=this.getUnhandledRejectionReason(e);return en(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}:t.apply(r)}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 tN="$message",tU="$timestamp",tq=new Set([tN,tU]),tj={enabled:!0,max_bytes:32768};function tH(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:tj.enabled,max_bytes:function(e,t){if(!Z(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,tj.max_bytes)}:y({},tj)}class tB{constructor(e){this.Mr=[],this.Rr=0,this.Dt=tH(e)}setConfig(e){this.Dt=tH(e),this.Pr()}add(e){var t=function(e){var t=function(e){var t=new WeakSet;try{return JSON.stringify(e,(e,i)=>{if("bigint"==typeof i)return i.toString();if("function"!=typeof i&&"symbol"!=typeof i){if(i instanceof Date)return i.toISOString();if(i instanceof Error)return{name:i.name,message:i.message,stack:i.stack};if(i&&"object"==typeof i){if(t.has(i))return"[Circular]";t.add(i)}return i}})}catch(e){return}}(e);if(t)try{var i=JSON.parse(t);if(!W(i))return;var r=i[tN],s=i[tU];if(!Y(r)||0===r.trim().length||!Y(s)&&!Z(s))return;return{step:i,json:t}}catch(e){return}}(e);if(t){var i=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e).length;for(var t=encodeURIComponent(e),i=0,r=0;t.length>r;r++)"%"===t[r]?(i+=1,r+=2):i+=1;return i}(t.json);i>this.Dt.max_bytes||(this.Mr.push({step:t.step,bytes:i}),this.Rr+=i,this.Pr())}}getAttachable(){return this.Mr.map(e=>e.step)}clear(){this.Mr=[],this.Rr=0}size(){return this.Mr.length}Pr(){for(;this.Rr>this.Dt.max_bytes&&this.Mr.length>0;){var e=this.Mr.shift();e&&(this.Rr-=e.bytes)}}}var tz=function(e,t){var{debugEnabled:i}=void 0===t?{}:t,r={k(t){if(s&&(_.DEBUG||v.POSTHOG_DEBUG||i)&&!G(s.console)&&s.console){for(var r=("__rrweb_original__"in s.console[t])?s.console[t].__rrweb_original__:s.console[t],n=arguments.length,o=Array(n>1?n-1:0),a=1;n>a;a++)o[a-1]=arguments[a];r(e,...o)}},debug(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.k("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.k("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.k("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.k("error",...t)},critical(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning(e){r.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>tz(e+" "+t,i)};return r},tV=tz("[PostHog.js]"),tW=tV.createLogger,tK=tW("[ExternalScriptsLoader]"),tG=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return tK.warn(t+" was requested but loading of external scripts is disabled."),i("Loading of external scripts is disabled");var r=null==a?void 0:a.querySelectorAll("script");if(r){for(var s,n=0;r.length>n;n++)if(s=function(){if(r[n].src===t){var e=r[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 s.v}var o=()=>{if(!a)return i("document not found");var r=a.createElement("script");if(r.type="text/javascript",r.crossOrigin="anonymous",r.src=t,r.onload=e=>{r.__posthog_loading_callback_fired=!0,i(void 0,e)},r.onerror=e=>i(e),e.config.prepare_external_dependency_script&&(r=e.config.prepare_external_dependency_script(r)),!r)return i("prepare_external_dependency_script returned null");if("head"===e.config.external_scripts_inject_target)a.head.appendChild(r);else{var s,n=a.querySelectorAll("body > script");n.length>0?null==(s=n[0].parentNode)||s.insertBefore(r,n[0]):a.body.appendChild(r)}};null!=a&&a.body?o():null==a||a.addEventListener("DOMContentLoaded",o)};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var r;if(e.config.strict_script_versioning)r=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var s="/static/"+t+".js?v="+e.version;"toolbar"===t&&(s=s+"&t="+3e5*Math.floor(Date.now()/3e5)),r=e.requestRouter.endpointFor("assets",s)}tG(e,r,i)}else{var n=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");tG(e,n,i)}},v.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var r=e.requestRouter.endpointFor("api",t);tG(e,r,i)};var tY="$people_distinct_id",tQ="$device_id",tJ="__alias",tX="__timers",tZ="$autocapture_disabled_server_side",t0="$heatmaps_enabled_server_side",t1="$exception_capture_enabled_server_side",t2="$error_tracking_suppression_rules",t3="$error_tracking_capture_extension_exceptions",t5="$web_vitals_enabled_server_side",t4="$dead_clicks_enabled_server_side",t6="$product_tours_enabled_server_side",t8="$web_vitals_allowed_metrics",t7="$session_recording_remote_config",t9="$replay_sample_rate",ie="$replay_override_sampling",it="$replay_override_linked_flag",ii="$replay_override_url_trigger",ir="$replay_override_event_trigger",is="$sesid",io="$session_is_sampled",ia="$enabled_feature_flags",il="$active_feature_flags",iu="$early_access_features",ic="$feature_flag_details",ih="$feature_flag_payloads",id="$feature_flag_request_id",ip="$override_feature_flags",iv="$override_feature_flag_payloads",ig="$stored_person_properties",i_="$stored_group_properties",im="$surveys",iy="$surveys_loaded_at",ib="$surveys_activated",iw="ph_product_tours",iE="$flag_call_reported",ix="$flag_call_reported_session_id",iS="$feature_flag_errors",ik="$feature_flag_evaluated_at",iP="$user_state",iT="$client_session_props",iF="$capture_rate_limit",iR="$initial_campaign_params",iI="$initial_referrer_info",i$="$initial_person_info",iO="$epp",iD="__POSTHOG_TOOLBAR__",iC="$posthog_cookieless",iM="$sdk_debug_extensions_init_method",iA="$sdk_debug_extensions_init_time_ms",iL="$sdk_debug_recording_script_not_loaded",iN="PostHog loadExternalDependency extension not found.",iU="on_reject",iq="always",ij="anonymous",iH="identified",iB="identified_only",iz="visibilitychange",iV="beforeunload",iW="$pageview",iK="$pageleave",iG="$identify",iY="$groupidentify";function iQ(e,t){z(e)&&e.forEach(t)}
1function iJ(e,t){if(!X(e)){if(z(e))e.forEach(t);else if(ei(e))e.forEach((e,i)=>t(e,i));else for(var i in e)H.call(e,i)&&t(e[i],i)}}var iX=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];for(var s of i)for(var n in s)void 0!==s[n]&&(e[n]=s[n]);return e};function iZ(e){for(var t=Object.keys(e),i=t.length,r=Array(i);i--;)r[i]=[t[i],e[t[i]]];return r}var i0=function(e){try{return e()}catch(e){return}},i1=function(e){return function(){try{for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,i)}catch(e){tV.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),tV.critical(e)}}},i2=function(e){var t={};return iJ(e,function(e,i){(Y(e)&&e.length>0||Z(e))&&(t[i]=e)}),t},i3=["herokuapp.com","vercel.app","netlify.app"];function i5(e,t,i,r){var{capture:s=!1,passive:n=!0}=null!=r?r:{};null==e||e.addEventListener(t,i,{capture:s,passive:n})}function i4(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 Z(e)&&isFinite(e)&&Math.floor(e)===e});class i6{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||0>e||0>t||0>i||0>r||e>0xffffffffffff||t>4095||i>1073741823||r>4294967295)throw RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/1099511627776,s[1]=e/4294967296,s[2]=e/16777216,s[3]=e/65536,s[4]=e/256,s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new i6(s)}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 i6(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 i8{constructor(){this.S=0,this.C=0,this.I=new rr}generate(){var e=this.generateOrAbort();if(G(e)){this.S=0;var t=this.generateOrAbort();if(G(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>4398046511103&&(this.S++,this.M())}return i6.fromFieldsV7(this.S,Math.trunc(this.C/1073741824),1073741823&this.C,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var i7,i9,re,rt,ri=e=>{if("undefined"!=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};s&&!G(s.crypto)&&crypto.getRandomValues&&(ri=e=>crypto.getRandomValues(e));class rr{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(ri(this.R),this.O=0),this.R[this.O++]}}var rs=()=>rn().toString(),rn=()=>(rt||(rt=new i8)).generate(),ro="",ra=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,rl={N:()=>!!a,D(e){tV.error("cookieStore error: "+e)},P(e){if(a){try{for(var t=e+"=",i=a.cookie.split(";").filter(e=>e.length),r=0;i.length>r;r++){for(var s=i[r];" "==s.charAt(0);)s=s.substring(1,s.length);if(0===s.indexOf(t))return decodeURIComponent(s.substring(t.length,s.length))}}catch(e){}return null}},F(e){var t;try{t=JSON.parse(rl.P(e))||{}}catch(e){}return t},A(e,t,i,r,s){if(!a)return!1;try{var n="",o="",l=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=a),ro)return ro;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),r=Math.min(i.length,8),s="dmn_chk_"+rs();!ro&&r--;){var n=i.slice(r).join("."),o=s+"=1;domain=."+n+";path=/";t.cookie=o+";max-age=3",t.cookie.includes(s)&&(t.cookie=o+";max-age=0",ro=n)}return ro}(e);if(!i){var r,s=(r=e.match(ra))?r[0]:"";s!==i&&tV.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}return i?"; domain=."+i:""}return""}(a.location.hostname,r);
1if(i){var u=new Date;u.setTime(u.getTime()+864e5*i),n="; expires="+u.toUTCString()}s&&(o="; secure");var c=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+l+o;return c.length>3686.4&&tV.warn("cookieStore warning: large cookie, len="+c.length),a.cookie=c,!0}catch(e){return!1}},q(e,t){if(null!=a&&a.cookie)try{rl.A(e,"",-1,t)}catch(e){return}}},ru=null,rc={N(){if(!J(ru))return ru;var e=!0;if(G(s))e=!1;else try{var t="__mplssupport__";rc.A(t,"xyz"),'"xyz"'!==rc.P(t)&&(e=!1),rc.q(t)}catch(t){e=!1}return e||tV.error("localStorage unsupported; falling back to cookie store"),ru=e,e},D(e){tV.error("localStorage error: "+e)},P(e){try{return null==s?void 0:s.localStorage.getItem(e)}catch(e){rc.D(e)}return null},F(e){try{return JSON.parse(rc.P(e))||{}}catch(e){}return null},A(e,t){try{return null==s||s.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){rc.D(e)}return!1},q(e){try{null==s||s.localStorage.removeItem(e)}catch(e){rc.D(e)}}},rh=[tQ,"distinct_id",is,io,iO,i$,iP],rd={},rp={N:()=>!0,D(e){tV.error("memoryStorage error: "+e)},P:e=>rd[e]||null,F:e=>rd[e]||null,A:(e,t)=>(rd[e]=t,!0),q(e){delete rd[e]}},rv=null,rg={N(){if(!J(rv))return rv;if(rv=!0,G(s))rv=!1;else try{var e="__support__";rg.A(e,"xyz"),'"xyz"'!==rg.P(e)&&(rv=!1),rg.q(e)}catch(e){rv=!1}return rv},D(e){tV.error("sessionStorage error: ",e)},P(e){try{return null==s?void 0:s.sessionStorage.getItem(e)}catch(e){rg.D(e)}return null},F(e){try{return JSON.parse(rg.P(e))||null}catch(e){}return null},A(e,t){try{return null==s||s.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){rg.D(e)}return!1},q(e){try{null==s||s.sessionStorage.removeItem(e)}catch(e){rg.D(e)}}};class r_{constructor(e){this._instance=e}get Dt(){return this._instance.config}get consent(){return this.Lr()?0:this.Ar}isOptedOut(){return this.Dt.cookieless_mode===iq||this.isRejected()||-1===this.consent&&this.Dt.cookieless_mode===iU}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Dt.opt_out_capturing_by_default}optInOut(e){this.Fr.A(this.Nr,e?1:0,this.Dt.cookie_expiration,this.Dt.cross_subdomain_cookie,this.Dt.secure_cookie)}reset(){this.Fr.q(this.Nr,this.Dt.cross_subdomain_cookie)}get Nr(){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 Ar(){var e=this.Fr.P(this.Nr);return eu(e)?1:N(ec,e)?0:-1}get Fr(){var e=this.Dt.opt_out_capturing_persistence_type,t="localStorage"===e?rc:rl;if(!this.Dr||this.Dr!==t){this.Dr=t;var i="localStorage"===e?rl:rc;i.P(this.Nr)&&(this.Dr.P(this.Nr)||this.optInOut(eu(i.P(this.Nr))),i.q(this.Nr,this.Dt.cross_subdomain_cookie))}return this.Dr}Lr(){return!!this.Dt.respect_dnt&&[null==o?void 0:o.doNotTrack,null==o?void 0:o.msDoNotTrack,v.doNotTrack].some(e=>eu(e))}}function rf(e){return e instanceof Element&&(e.id===iD||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function rm(e){return!!e&&1===e.nodeType}function ry(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function rb(e){return!!e&&3===e.nodeType}function rw(e){return!!e&&11===e.nodeType&&rm(e.host)}function rE(e){return e?U(e).split(/\s+/):[]}function rx(e){var t=null==s?void 0:s.location.href;return!!(t&&e&&e.some(e=>t.match(e)))}function rS(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 rE(t)}function rk(e){return X(e)?null:U(e).split(/(\s+)/).filter(e=>rG(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function rP(e){var t="";return rq(e)&&!rj(e)&&e.childNodes&&e.childNodes.length&&iJ(e.childNodes,function(e){var i;rb(e)&&e.textContent&&(t+=null!==(i=rk(e.textContent))&&void 0!==i?i:"")}),U(t)}function rT(e){var t;return G(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var rF=["a","button","form","input","select","textarea","label"];function rR(e,t){if(G(t))return!0;var i,r=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 s of e)if(i=r(s))return i.v;return!1}function rI(e){var t=e.parentNode;return!(!t||!rm(t))&&t}var r$=[".ph-no-autocapture","[data-ph-no-autocapture]"],rO=["next","previous","prev",">","<"],rD=[...rO,"+","-","−","–"],rC=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,rM=[".ph-no-rageclick",".ph-no-capture"],rA=["","text","search","email","password","url","tel","number"];function rL(e,t){if(!s||rN(e)||(et(t)?(r=!!t&&rM,n=void 0,o=!1):(r=null!==(a=null==t?void 0:t.css_selector_ignorelist)&&void 0!==a?a:rM,n=null==t?void 0:t.content_ignorelist,o=null!==(l=null==t?void 0:t.ignore_text_selection)&&void 0!==l&&l),!1===r)||o&&!(!(i=e)||!rm(i))&&(ry(i,"textarea")||(ry(i,"input")?N(rA,(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,r,n,o,a,l,{targetElementList:u}=rU(e,!1);return!function(e,t){var i;if(!1===e||G(e))return!1;if(!0===e)i=rO;else{if(!z(e))return!1;if(e.length>10)return tV.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:r}=e;return i.some(e=>rC(t,e)||rC(r,e))})}(n,u.map(e=>{var t;return{safeText:rP(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!rR(u,r)}var rN=e=>!e||ry(e,"html")||!rm(e),rU=(e,t)=>{if(!s||rN(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[e],n=e;n.parentNode&&!ry(n,"body");)if(rw(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var o=rI(n);if(!o)break;if(t||rF.indexOf(o.tagName.toLowerCase())>-1)i=!0;else{var a=s.getComputedStyle(o);a&&"pointer"===a.getPropertyValue("cursor")&&(i=!0)}r.push(o),n=o}return{parentIsUsefulElement:i,targetElementList:r}};function rq(e){for(var t=e;t.parentNode&&!ry(t,"body");t=t.parentNode){var i=rS(t);if(N(i,"ph-sensitive")||N(i,"ph-no-capture"))return!1}if(N(rS(e),"ph-include"))return!0;var r=e.type||"";if(Y(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}
1var s=e.name||e.id||"";return!Y(s)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(s.replace(/[^a-zA-Z0-9]/g,""))}function rj(e){return!!(ry(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ry(e,"select")||ry(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var rH="(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})",rB=RegExp("^(?:"+rH+")$"),rz=new RegExp(rH),rV="\\d{3}-?\\d{2}-?\\d{4}",rW=RegExp("^("+rV+")$"),rK=RegExp("("+rV+")");function rG(e,t){return void 0===t&&(t=!0),!(X(e)||Y(e)&&(e=U(e),(t?rB:rz).test((e||"").replace(/[- ]/g,""))||(t?rW:rK).test(e)))}function rY(e){var t=rP(e);return rG(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&iJ(t.childNodes,function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var s=rP(t);i=(i+" "+s).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){tV.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function rQ(e){return e.replace(/"|\\"/g,'\\"')}var rJ=tW("[Dead Clicks]"),rX=()=>!0,rZ=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(t4)),r=e.instance.config.capture_dead_clicks;return et(r)?r:!!W(r)||i};class r0{get lazyLoadedDeadClicksAutocapture(){return this.$r}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({[t4]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.qr(()=>{this.jr()}):this.stop()}qr(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?rJ.error("failed to load script",t):e()})}jr(){var e;if(a){if(!this.$r&&null!=(e=v.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=W(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.$r=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.$r.start(a),rJ.info("starting...")}}else rJ.error("`document` not found. Cannot start.")}stop(){this.$r&&(this.$r.stop(),this.$r=void 0,rJ.info("stopping..."))}}var r1=tW("[SegmentIntegration]"),r2="posthog-js";function r3(e,t){var{organization:i,projectId:r,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:o=!0}=void 0===t?{}:t;return t=>{if("*"!==n&&!n.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var a=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=a,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var l,u,c,h,d,p,v=(null==(l=t.exception)?void 0:l.values)||[],g=v.map(e=>y({},e,{stacktrace:e.stacktrace?y({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>y({},e,{platform:"web:javascript"}))}):void 0})),_={$exception_message:(null==(u=v[0])?void 0:u.value)||t.message,$exception_type:null==(c=v[0])?void 0:c.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(h=v[0])?void 0:h.value)||t.message,$sentry_exception_type:null==(d=v[0])?void 0:d.type,$sentry_tags:t.tags};return i&&r&&(_.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+r+"&query="+t.event_id),o&&(null==(p=e.exceptions)||p.sendExceptionEvent(_)),t}}class r5{constructor(e,t,i,r,s,n){this.name=r2,this.setupOnce=function(o){o(r3(e,{organization:t,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}class r4{constructor(e){this.Br=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(tV.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Hr=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Ur()}Ur(){var e;this.zr=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Br)}destroy(){var e;null==(e=this.zr)||e.call(this),this.zr=void 0}doPageView(e,t){var i,r=this.Vr(e,t);return this.Hr={pathname:null!==(i=null==s?void 0:s.location.pathname)&&void 0!==i?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.Vr(e,null==(t=this.Hr)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Hr)?void 0:e.pageViewId}}Vr(e,t){var i=this.Hr;if(!i)return{$pageview_id:t};var r={$pageview_id:t,$prev_pageview_id:i.pageViewId},s=this._instance.scrollManager.getContext();if(s&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:n,lastScrollY:o,maxScrollY:a,maxContentHeight:l,lastContentY:u,maxContentY:c}=s;if(!(G(n)||G(o)||G(a)||G(l)||G(u)||G(c))){n=Math.ceil(n),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c);var h=n>1?eh(o/n,0,1,tV):1,d=n>1?eh(a/n,0,1,tV):1,p=l>1?eh(u/l,0,1,tV):1,v=l>1?eh(c/l,0,1,tV):1;r=iX(r,{$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:v})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}}var r6=["flags","surveys"],r8={[tY]:{exposure:"hidden"},[tJ]:{exposure:"hidden"},__cmpns:{exposure:"hidden"}
1,[tX]:{exposure:"hidden"},[tZ]:{exposure:"event"},[t0]:{exposure:"hidden"},[t1]:{exposure:"event"},[t2]:{exposure:"hidden"},[t3]:{exposure:"event"},[t5]:{exposure:"event"},[t4]:{exposure:"event"},[t6]:{exposure:"hidden"},[t8]:{exposure:"event"},[t7]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[is]:{exposure:"hidden"},[io]:{exposure:"event"},[t9]:{exposure:"event",shouldSkipFromEventProperties:e=>J(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"},[ia]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!W(e))return{};for(var t={},i=Object.keys(e),r=0;i.length>r;r++)t["$feature/"+i[r]]=e[i[r]];return t}},[il]:{exposure:"event",storageGroup:"flags"},[iu]:{exposure:"hidden"},[ic]:{exposure:"hidden",storageGroup:"flags"},[ih]:{exposure:"event",storageGroup:"flags"},[id]:{exposure:"event",storageGroup:"flags",volatile:!0},[ip]:{exposure:"event"},[iv]:{exposure:"hidden"},[ig]:{exposure:"hidden"},[i_]:{exposure:"hidden"},[im]:{exposure:"hidden",storageGroup:"surveys"},[iy]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[ib]:{exposure:"event"},[iw]:{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"},[iE]:{exposure:"hidden"},[ix]:{exposure:"hidden"},[iS]:{exposure:"hidden"},[ik]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iP]:{exposure:"hidden"},[iT]:{exposure:"hidden"}
1,[iF]:{exposure:"hidden"},[iR]:{exposure:"hidden"},[iI]:{exposure:"hidden"},[i$]:{exposure:"hidden"},[iO]:{exposure:"hidden"},[ie]:{exposure:"event"},[it]:{exposure:"event"},[ii]:{exposure:"event"},[ir]:{exposure:"event"},[iM]:{exposure:"event"},[iA]:{exposure:"event"},[iL]:{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"}},r7=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],r9=e=>{var t=r8[e];if(t)return t;for(var[i,r]of r7)if(0===e.indexOf(i))return r},se=e=>{var t=null==a?void 0:a.createElement("a");return G(t)?null:(t.href=e,t)},st=function(e,t){for(var i,r=((e.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),s=0;r.length>s;s++){var n=r[s].split("=");if(n[0]===t){i=n;break}}if(!z(i)||2>i.length)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){tV.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},si=function(e,t,i){if(!e||!t||!t.length)return e;for(var r=e.split("#"),s=r[1],n=(r[0]||"").split("?"),o=n[1],a=n[0],l=(o||"").split("&"),u=[],c=0;l.length>c;c++){var h=l[c].split("=");z(h)&&(t.includes(h[0])?u.push(h[0]+"="+i):u.push(l[c]))}var d=a;return null!=o&&(d+="?"+u.join("&")),null!=s&&(d+="#"+s),d},sr=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},ss="https?://(.*)",sn=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],so=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...sn],sa="<masked>",sl=["li_fat_id"];function su(e,t,i){if(!a)return{};var r,s=t?[...sn,...i||[]]:[],n=sc(si(a.URL,s,sa),e);return iX((r={},iJ(sl,function(e){var t=rl.P(e);r[e]=t||null}),r),n)}function sc(e,t){var i=so.concat(t||[]),r={};return iJ(i,function(t){var i=st(e,t);r[t]=i||null}),r}function sh(e){var t=e?0===e.search(ss+"google.([^/?]*)")?"google":0===e.search(ss+"bing.com")?"bing":0===e.search(ss+"yahoo.com")?"yahoo":0===e.search(ss+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!J(t)){i.$search_engine=t;var r=a?st(a.referrer,"yahoo"!=t?"q":"p"):"";r.length&&(i.ph_keyword=r)}return i}function sd(){return navigator.language||navigator.userLanguage}var sp="$direct";function sv(){return(null==a?void 0:a.referrer)||sp}function sg(e,t){var i=e?[...sn,...t||[]]:[],r=null==l?void 0:l.href.substring(0,1e3);return{r:sv().substring(0,1e3),u:r?si(r,i,sa):void 0}}function s_(e){var t,{r:i,u:r}=e,s={$referrer:i,$referring_domain:null==i?void 0:i==sp?sp:null==(t=se(i))?void 0:t.host};if(r){s.$current_url=r;var n=se(r);s.$host=null==n?void 0:n.host,s.$pathname=null==n?void 0:n.pathname,iX(s,sc(r))}return i&&iX(s,sh(i)),s}function sf(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var sm={flags:ik,surveys:iy},sy=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],sb="main";class sw{constructor(e,t,i){if(void 0===i&&(i=!0),this.Wr={},this.Gr=!1,this.Zr=!1,this.Dt=e,this.Qr=i,this.props={},this.Jr=!1,this.Kr=(r="",e.token&&(r=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+r+"_posthog"),this.Fr=this.Yr(e),this.Zr=this.Xr(e),this.load(),e.debug&&tV.info("Persistence loaded",e.persistence,y({},this.props)),this.update_config(e,e,t),this.save(),s){var r,n=()=>this.flush();i5(s,"beforeunload",n,{capture:!1}),i5(s,"pagehide",n,{capture:!1})}}ei(){var e,t=null==(e=this.Dt)?void 0:e.persistence_save_debounce_ms;return Z(t)&&t>0?t:0}isDisabled(){return!!this.ti}Yr(e){-1===sy.indexOf(e.persistence.toLowerCase())&&(tV.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");
1var t,i,r,n,o=(t=e.cookie_persisted_properties||[],i=e.__preview_cookie_wins_on_conflict||!1,void 0===t&&(t=[]),void 0===i&&(i=!1),r=[...rh,...t],y({},rc,{F(e){try{var t={};try{t=rl.F(e)||{}}catch(e){}var r,s=JSON.parse(rc.P(e)||"{}");if(i){var n={};for(var o in t){var a=t[o];J(a)||""===a||(n[o]=a)}r=iX(s,n)}else r=iX(t,s);return rc.A(e,r),r}catch(e){}return null},A(e,t,i,s,n,o){var a=rc.A(e,t,void 0,void 0,o);try{var l={};r.forEach(e=>{t[e]&&(l[e]=t[e])}),Object.keys(l).length&&rl.A(e,l,i,s,n,o)}catch(e){rc.D(e)}return a},q(e,t){try{null==s||s.localStorage.removeItem(e),rl.q(e,t)}catch(e){rc.D(e)}}})),a=!1,l=e.persistence.toLowerCase();return"localstorage"===l&&rc.N()?(n=rc,a=!0):"localstorage+cookie"===l&&o.N()?(n=o,a=!0):"sessionstorage"===l&&rg.N()?n=rg:"memory"===l?n=rp:"cookie"===l?n=rl:o.N()?(n=o,a=!0):n=rl,this.Gr=a,n}ri(e){return this.Kr+"__"+e}Xr(e){return this.Gr&&!!e.split_storage}ii(e){var t=null!=e?e:this.Dt.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var i=this.props[ik];return!i||"number"!=typeof i||Date.now()-i>t}properties(){var e={};return iJ(this.props,(t,i)=>{var r=r9(i);if("derived"===(null==r?void 0:r.exposure)){if(null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(t,i===ia?()=>this.ii():()=>!1))return;r.transformToEventProperties&&iX(e,r.transformToEventProperties(t))}else if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(t,()=>!1))return;e[i]=t}}),e}load(){if(!this.ti){var e=this.Fr.F(this.Kr);e&&(this.props=iX({},e)),this.Zr&&this.ni()}}ni(){for(var e of r6){var t=rc.F(this.ri(e));if(t&&!K(t)){var i=this.si(e);i.persisted=!0,this.oi(e)||(i.fingerprint=this.ai(t,e)),this.li(e,t)||iX(this.props,t)}}}oi(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=r9(t))?void 0:i.storageGroup)===e})}li(e,t){var i=sm[e];if(!i)return!1;var r=t[i],s=this.props[i];return Z(r)&&Z(s)&&s>r}refreshKey(e){var t;if(!this.ti){var i=this.Zr?null==(t=r9(e))?void 0:t.storageGroup:void 0,r=i?rc.F(this.ri(i)):this.Fr.F(this.Kr);if(r&&e in r)this.ui(e,r[e]);else{if(i){var s=this.Fr.F(this.Kr);if(s&&e in s)return void this.ui(e,s[e])}this.hi(e)}}}save(){if(!this.ti){var e=this.ei();e>0?G(this.ci)&&(this.ci=setTimeout(()=>{this.ci=void 0,this.di()},e)):this.di()}}flush(){G(this.ci)||(clearTimeout(this.ci),this.ci=void 0,this.di())}di(){this.ti||(this.Zr?this.vi():this.fi(this.Fr,this.Kr,this.props,sb))}vi(){var{main:e,groups:t}=this.pi();for(var i of(this.fi(this.Fr,this.Kr,e,sb),r6)){var r,s=t[i];(!K(s)||null!=(r=this.Wr[i])&&r.persisted)&&this.fi(rc,this.ri(i),s,i)}}pi(){var e={},t={};for(var i of r6)t[i]={};return iJ(this.props,(i,r)=>{var s,n=null==(s=r9(r))?void 0:s.storageGroup;n?t[n][r]=i:e[r]=i}),{main:e,groups:t}}ai(e,t){if(t===sb)return JSON.stringify(e)+"|"+this.gi+"|"+this.mi+"|"+this.yi;var i={};return iJ(e,(e,t)=>{var r;i[t]=null!=(r=r9(t))&&r.volatile?"__volatile__":e}),JSON.stringify(i)}fi(e,t,i,r){var s,n=this.si(r);if(r===sb||n.dirty||G(n.fingerprint)){try{if((s=this.ai(i,r))===n.fingerprint)return void(n.dirty=!1)}catch(e){s=void 0}e.A(t,i,this.gi,this.mi,this.yi,this.Dt.debug)?(n.dirty=!1,r!==sb&&(n.persisted=!0),G(s)||(n.fingerprint=s)):this.Dt.debug&&tV.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var{keepGroupEntries:t=!1}=void 0===e?{}:e;if(G(this.ci)||(clearTimeout(this.ci),this.ci=void 0),this.Fr.q(this.Kr,!1),this.Fr.q(this.Kr,!0),!t&&this.Qr)for(var i of r6)rc.q(this.ri(i));t?delete this.Wr[sb]:this.Wr={}}clear(){this.remove(),this.props={}}register_once(e,t,i){if(W(e)){G(t)&&(t="None"),this.gi=G(i)?this.bi:i;var r=!1;if(iJ(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.ui(i,e),r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(W(e)){this.gi=G(t)?this.bi:t;var i=!1;if(iJ(e,(t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.ui(r,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.hi(e),this.save())}update_campaign_params(){if(!this.Jr){var e=su(this.Dt.custom_campaign_params,this.Dt.mask_personal_data_properties,this.Dt.custom_personal_data_properties);K(i2(e))||this.register(e),this.Jr=!0}}update_search_keyword(){var e;this.register((e=null==a?void 0:a.referrer)?sh(e):{})}update_referrer_info(){var e;this.register_once({$referrer:sv(),$referring_domain:null!=a&&a.referrer&&(null==(e=se(a.referrer))?void 0:e.host)||sp},void 0)}set_initial_person_info(){this.props[iR]||this.props[iI]||this.register_once({[i$]:sg(this.Dt.mask_personal_data_properties,this.Dt.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};iJ([iI,iR],t=>{var i=this.props[t];i&&iJ(i,function(t,i){e["$initial_"+q(i)]=t})});var t,i,r=this.props[i$];return r&&iX(e,(t=s_(r),i={},iJ(t,function(e,t){i["$initial_"+q(t)]=e}),i)),e}safe_merge(e){return iJ(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){this.bi=this.gi=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 r=e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),r=[...t].sort();return i.every((e,t)=>e===r[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),s=r?this.Yr(e):this.Fr,n=this.Xr(e);if(r||n!==this.Zr){var o=this.props;this.clear(),this.Fr=s,this.Zr=n,this.props=o,this.save()}}set_disabled(e){this.ti=e,this.ti?this.remove():this.save()}set_cross_subdomain(e){e!==this.mi&&(this.mi=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.yi&&(this.yi=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[tX]||{};i[e]=t,this.ui(tX,i),this.save()}remove_event_timer(e){var t=this.props[tX]||{},i=t[e];return G(i)||(delete t[e],this.ui(tX,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.ui(e,t),this.save()}ui(e,t){var i;this.props[e]=t,null!=(i=r9(e))&&i.volatile||this.wi(e)}hi(e){delete this.props[e],this.wi(e)}wi(e){var t,i=null==(t=r9(e))?void 0:t.storageGroup;i&&(this.si(i).dirty=!0)}si(e){return this.Wr[e]||(this.Wr[e]={})}}var sE={Activation:"events",Cancellation:"cancelEvents"},sx={Button:"button",Tab:"tab",Selector:"selector"},sS={TopLeft:"top_left",TopRight:"top_right",TopCenter:"top_center",MiddleLeft:"middle_left",MiddleRight:"middle_right",MiddleCenter:"middle_center",Left:"left",Center:"center",Right:"right",NextToTrigger:"next_to_trigger"},sk={Top:"top",Left:"left",Right:"right",Bottom:"bottom"},sP={Popover:"popover",API:"api",Widget:"widget",ExternalSurvey:"external_survey"},sT={Open:"open",MultipleChoice:"multiple_choice",SingleChoice:"single_choice",Rating:"rating",Link:"link"},sF={NextQuestion:"next_question",End:"end",ResponseBased:"response_based",SpecificQuestion:"specific_question"},sR={Once:"once",Recurring:"recurring",Always:"always"},sI={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent",ABANDONED:"survey abandoned"},s$={SURVEY_ID:"$survey_id",SURVEY_NAME:"$survey_name",SURVEY_RESPONSE:"$survey_response",SURVEY_ITERATION:"$survey_iteration",SURVEY_ITERATION_
1START_DATE:"$survey_iteration_start_date",SURVEY_PARTIALLY_COMPLETED:"$survey_partially_completed",SURVEY_SUBMISSION_ID:"$survey_submission_id",SURVEY_QUESTIONS:"$survey_questions",SURVEY_COMPLETED:"$survey_completed",PRODUCT_TOUR_ID:"$product_tour_id",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date",SURVEY_LANGUAGE:"$survey_language"},sO={Popover:"popover",Inline:"inline"},sD={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},sC={SHOWN:"product tour shown",DISMISSED:"product tour dismissed",COMPLETED:"product tour completed",STEP_SHOWN:"product tour step shown",STEP_COMPLETED:"product tour step completed",BUTTON_CLICKED:"product tour button clicked",STEP_SELECTOR_FAILED:"product tour step selector failed",BANNER_CONTAINER_SELECTOR_FAILED:"product tour banner container selector failed",BANNER_ACTION_CLICKED:"product tour banner action clicked"},sM={TOUR_ID:"$product_tour_id",TOUR_NAME:"$product_tour_name",TOUR_ITERATION:"$product_tour_iteration",TOUR_RENDER_REASON:"$product_tour_render_reason",TOUR_STEP_ID:"$product_tour_step_id",TOUR_STEP_ORDER:"$product_tour_step_order",TOUR_STEP_TYPE:"$product_tour_step_type",TOUR_DISMISS_REASON:"$product_tour_dismiss_reason",TOUR_BUTTON_TEXT:"$product_tour_button_text",TOUR_BUTTON_ACTION:"$product_tour_button_action",TOUR_BUTTON_LINK:"$product_tour_button_link",TOUR_BUTTON_TOUR_ID:"$product_tour_button_tour_id",TOUR_STEPS_COUNT:"$product_tour_steps_count",TOUR_STEP_SELECTOR:"$product_tour_step_selector",TOUR_STEP_SELECTOR_FOUND:"$product_tour_step_selector_found",TOUR_STEP_ELEMENT_TAG:"$product_tour_step_element_tag",TOUR_STEP_ELEMENT_ID:"$product_tour_step_element_id",TOUR_STEP_ELEMENT_CLASSES:"$product_tour_step_element_classes",TOUR_STEP_ELEMENT_TEXT:"$product_tour_step_element_text",TOUR_ERROR:"$product_tour_error",TOUR_MATCHES_COUNT:"$product_tour_matches_count",TOUR_FAILURE_PHASE:"$product_tour_failure_phase",TOUR_WAITED_FOR_ELEMENT:"$product_tour_waited_for_element",TOUR_WAIT_DURATION_MS:"$product_tour_wait_duration_ms",TOUR_BANNER_SELECTOR:"$product_tour_banner_selector",TOUR_LINKED_SURVEY_ID:"$product_tour_linked_survey_id",USE_MANUAL_SELECTOR:"$use_manual_selector",INFERENCE_DATA_PRESENT:"$inference_data_present",TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},sA=tW("[RateLimiter]");class sL{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=>{sA.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void sA.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,r,{captureEventsBurstLimit:s,captureEventsPerSecond:n}=this,o=(new Date).getTime(),a=null!==(t=null==(i=this.instance.persistence)?void 0:i.get_property(iF))&&void 0!==t?t:{tokens:s,last:o};a.tokens+=(o-a.last)/1e3*n,a.last=o,a.tokens>s&&(a.tokens=s);var l=1>a.tokens;return l||e||(a.tokens=Math.max(0,a.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 "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(iF,a),{isRateLimited:l,remainingTokens:a.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var sN=tW("[RemoteConfig]");class sU{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}xi(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()}ki(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 sN.info("Using preloaded remote config",this.remoteConfig),this.Si(this.remoteConfig),void this.Ci();if(this._instance.Ii())return void sN.warn("Remote config is disabled. Falling back to local config.");this.xi(e=>{if(!e)return sN.info("No config found after loading remote JS config. Falling back to JSON."),void this.ki(e=>{this.Si(e),this.Ci()});this.Si(e),this.Ci()})}catch(e){sN.error("Error loading remote config",e)}}stop(){this.Ti&&(clearInterval(this.Ti),this.Ti=void 0)}
vendor: 4,361 bytes, line 1
1refresh(){!this._instance.Ii()&&a&&"hidden"!==a.visibilityState&&this._instance.reloadFeatureFlags()}Ci(){var e;if(!this.Ti){var t=null!==(e=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==e?e:3e5;0!==t&&(this.Ti=setInterval(()=>{this.refresh()},t))}}Si(e){var t;e||sN.error("Failed to fetch remote config from PostHog."),this._instance.Si(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 sq=["fatal","error","warning","log","info","debug"],sj={GZipJS:"gzip-js",Base64:"base64"},sH=Uint8Array,sB=Uint16Array,sz=Uint32Array,sV=new sH([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]),sW=new sH([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]),sK=new sH([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),sG=function(e,t){for(var i=new sB(31),r=0;31>r;++r)i[r]=t+=1<<e[r-1];var s=new sz(i[30]);for(r=1;30>r;++r)for(var n=i[r];i[r+1]>n;++n)s[n]=n-i[r]<<5|r;return[i,s]},sY=sG(sV,2),sQ=sY[1];sY[0][28]=258,sQ[258]=28;for(var sJ=sG(sW,0)[1],sX=new sB(32768),sZ=0;32768>sZ;++sZ){var s0=(43690&sZ)>>>1|(21845&sZ)<<1;sX[sZ]=((65280&(s0=(61680&(s0=(52428&s0)>>>2|(13107&s0)<<2))>>>4|(3855&s0)<<4))>>>8|(255&s0)<<8)>>>1}var s1=function(e,t,i){for(var r=e.length,s=0,n=new sB(t);r>s;++s)++n[e[s]-1];var o,a=new sB(t);for(s=0;t>s;++s)a[s]=a[s-1]+n[s-1]<<1;if(i){o=new sB(1<<t);var l=15-t;for(s=0;r>s;++s)if(e[s])for(var u=s<<4|e[s],c=t-e[s],h=a[e[s]-1]++<<c,d=h|(1<<c)-1;d>=h;++h)o[sX[h]>>>l]=u}else for(o=new sB(r),s=0;r>s;++s)o[s]=sX[a[e[s]-1]++]>>>15-e[s];return o},s2=new sH(288);for(sZ=0;144>sZ;++sZ)s2[sZ]=8;for(sZ=144;256>sZ;++sZ)s2[sZ]=9;for(sZ=256;280>sZ;++sZ)s2[sZ]=7;for(sZ=280;288>sZ;++sZ)s2[sZ]=8;var s3=new sH(32);for(sZ=0;32>sZ;++sZ)s3[sZ]=5;var s5=s1(s2,9,0),s4=s1(s3,5,0),s6=function(e){return(e/8>>0)+(7&e&&1)},s8=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var r=new(e instanceof sB?sB:e instanceof sz?sz:sH)(i-t);return r.set(e.subarray(t,i)),r},s7=function(e,t,i){var r=t/8>>0;e[r]|=i<<=7&t,e[r+1]|=i>>>8},s9=function(e,t,i){var r=t/8>>0;e[r]|=i<<=7&t,e[r+1]|=i>>>8,e[r+2]|=i>>>16},ne=function(e,t){for(var i=[],r=0;e.length>r;++r)e[r]&&i.push({s:r,f:e[r]});var s=i.length,n=i.slice();if(!s)return[new sH(0),0];if(1==s){var o=new sH(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,c=1,h=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=s-1;)a=i[i[h].f>i[u].f?u++:h++],l=i[u!=c&&i[h].f>i[u].f?u++:h++],i[c++]={s:-1,f:a.f+l.f,l:a,r:l};var d=n[0].s;for(r=1;s>r;++r)n[r].s>d&&(d=n[r].s);var p=new sB(d+1),v=nt(i[c-1],p,0);if(v>t){r=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});s>r;++r){var m=n[r].s;if(t>=p[m])break;g+=f-(1<<v-p[m]),p[m]=t}for(g>>>=_;g>0;){var y=n[r].s;t>p[y]?g-=1<<t-p[y]++-1:++r}for(;r>=0&&g;--r){var b=n[r].s;p[b]==t&&(--p[b],++g)}v=t}return[new sH(p),v]},nt=function(e,t,i){return -1==e.s?Math.max(nt(e.l,t,i+1),nt(e.r,t,i+1)):t[e.s]=i},ni=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new sB(++t),r=0,s=e[0],n=1,o=function(e){i[r++]=e},a=1;t>=a;++a)if(e[a]==s&&a!=t)++n;else{if(!s&&n>2){for(;n>138;n-=138)o(32754);n>2&&(o(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(o(s),--n;n>6;n-=6)o(8304);n>2&&(o(n-3<<5|8208),n=0)}for(;n--;)o(s);n=1,s=e[a]}return[i.subarray(0,r),t]},nr=function(e,t){for(var i=0,r=0;t.length>r;++r)i+=e[r]*t[r];return i},ns=function(e,t,i){var r=i.length,s=s6(t+2);e[s]=255&r,e[s+1]=r>>>8,e[s+2]=255^e[s],e[s+3]=255^e[s+1];for(var n=0;r>n;++n)e[s+n+4]=i[n];return 8*(s+4+r)},nn=function(e,t,i,r,s,n,o,a,l,u,c){s7(t,c++,i),++s[256];for(var h=ne(s,15),d=h[0],p=h[1],v=ne(n,15),g=v[0],_=v[1],f=ni(d),m=f[0],y=f[1],b=ni(g),w=b[0],E=b[1],x=new sB(19),S=0;m.length>S;++S)x[31&m[S]]++;for(S=0;w.length>S;++S)x[31&w[S]]++;for(var k=ne(x,7),P=k[0],T=k[1],F=19;F>4&&!P[sK[F-1]];--F);var R,I,$,O,D=u+5<<3,C=nr(s,s2)+nr(n,s3)+o,M=nr(s,d)+nr(n,g)+o+14+3*F+nr(x,P)+(2*x[16]+3*x[17]+7*x[18]);if(C>=D&&M>=D)return ns(t,c,e.subarray(l,l+u));if(s7(t,c,1+(C>M)),c+=2,C>M){R=s1(d,p,0),I=d,$=s1(g,_,0),O=g;var A=s1(P,T,0);for(s7(t,c,y-257),s7(t,c+5,E-1),s7(t,c+10,F-4),c+=14,S=0;F>S;++S)s7(t,c+3*S,P[sK[S]]);c+=3*F;for(var L=[m,w],N=0;2>N;++N){var U=L[N];for(S=0;U.length>S;++S)s7(t,c,A[q=31&U[S]]),c+=P[q],q>
115&&(s7(t,c,U[S]>>>5&127),c+=U[S]>>>12)}}else R=s5,I=s2,$=s4,O=s3;for(S=0;a>S;++S)if(r[S]>255){s9(t,c,R[257+(q=r[S]>>>18&31)]),c+=I[q+257],q>7&&(s7(t,c,r[S]>>>23&31),c+=sV[q]);var q,j=31&r[S];s9(t,c,$[j]),c+=O[j],j>3&&(s9(t,c,r[S]>>>5&8191),c+=sW[j])}else s9(t,c,R[r[S]]),c+=I[r[S]];return s9(t,c,R[256]),c+I[256]},no=new sz([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),na=function(){for(var e=new sz(256),t=0;256>t;++t){for(var i=t,r=9;--r;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e}(),nl=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},nu=!!c||!!u,nc="text/plain",nh=!1,nd=(e,t)=>{var[i,r]=e.split("#"),[s,n]=i.split("?");if(!n)return e;var o=n.split("&").filter(e=>e.split("=")[0]!==t).join("&");return s+(o?"?"+o:"")+(r?"#"+r:"")},np=function(e,t,i){void 0===i&&(i=!0);var r,s,n,o,a,[l,u]=e.split("?"),c=y({},t),h=null!==(a=null==u?void 0:u.split("&").map(e=>{var t,[r,s]=e.split("="),n=i&&null!==(t=c[r])&&void 0!==t?t:s;return delete c[r],r+"="+n}))&&void 0!==a?a:[],d=(void 0===r&&(r="&"),o=[],iJ(c,function(e,t){G(e)||G(t)||"undefined"===t||(s=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),o[o.length]=n+"="+s)}),o.join(r));return d&&h.push(d),l+"?"+h.join("&")},nv=(e,t)=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),ng=e=>{if(e.Or)return e.Or;var{data:t,compression:i}=e;if(t){if(i===sj.GZipJS){var r,s,n,o,a,l,u,c,h=(r=function(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new sH(e.length+(e.length>>>1)),s=0,n=function(e){r[s++]=e},o=0;i>o;++o){if(s+5>r.length){var a=new sH(s+8+(i-o<<1));a.set(r),r=a}var l=e.charCodeAt(o);128>l?n(l):(2048>l?n(192|l>>>6):(l>55295&&57344>l?(n(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),n(128|l>>>12&63)):n(224|l>>>12),n(128|l>>>6&63)),n(128|63&l))}return s8(r,0,s)}(nv(t)),s={mtime:0},n=4294967295,o={p(e){for(var t=n,i=0;e.length>i;++i)t=na[255&t^e[i]]^t>>>8;n=t},d:()=>4294967295^n},a=r.length,o.p(r),c=(l=10+(s.filename&&s.filename.length+1||0),u=function(e,t,i,r,s,n){var o=e.length,a=new sH(r+o+5*(1+Math.floor(o/7e3))+8),l=a.subarray(r,a.length-8),u=0;if(!t||8>o)for(var c=0;o>=c;c+=65535){var h=c+65535;o>
1h?u=ns(l,u,e.subarray(c,h)):(l[c]=!0,u=ns(l,u,e.subarray(c,o)))}else{for(var d=no[t-1],p=d>>>13,v=8191&d,g=(1<<i)-1,_=new sB(32768),f=new sB(g+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},w=new sz(25e3),E=new sB(288),x=new sB(32),S=0,k=0,P=(c=0,0),T=0,F=0;o>c;++c){var R=b(c),I=32767&c,$=f[R];if(_[I]=$,f[R]=I,c>=T){var O=o-c;if((S>7e3||P>24576)&&O>423){u=nn(e,l,0,w,E,x,k,P,F,c-F,u),P=S=k=0,F=c;for(var D=0;286>D;++D)E[D]=0;for(D=0;30>D;++D)x[D]=0}var C=2,M=0,A=v,L=I-$&32767;if(O>2&&R==b(c-L))for(var N=Math.min(p,O)-1,U=Math.min(32767,c),q=Math.min(258,O);U>=L&&--A&&I!=$;){if(e[c+C]==e[c+C-L]){for(var j=0;q>j&&e[c+j]==e[c+j-L];++j);if(j>C){if(C=j,M=L,j>N)break;var H=Math.min(L,j-2),B=0;for(D=0;H>D;++D){var z=c-L+D+32768&32767,V=z-_[z]+32768&32767;V>B&&(B=V,$=z)}}}L+=(I=$)-($=_[I])+32768&32767}if(M){w[P++]=268435456|sQ[C]<<18|sJ[M];var W=31&sQ[C],K=31&sJ[M];k+=sV[W]+sW[K],++E[257+W],++x[K],T=c+C,++S}else w[P++]=e[c],++E[e[c]]}}u=nn(e,l,!0,w,E,x,k,P,F,c-F,u)}return s8(a,0,r+s6(u)+8)}(r,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+s.mem,l,8)).length,function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&nl(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var r=0;i.length>=r;++r)e[r+10]=i.charCodeAt(r)}}(u,s),nl(u,c-8,o.d()),nl(u,c-4,a),u);return{contentType:nc,body:h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength),estimatedSize:h.byteLength}}if(i===sj.Base64){let e;var d,p="data="+encodeURIComponent("string"==typeof(e=(d=nv(t))?btoa(encodeURIComponent(d).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):d)?e:nv(e));return{contentType:"application/x-www-form-urlencoded",body:p,estimatedSize:new Blob([p]).size}}var v=nv(t);return{contentType:"application/json",body:v,estimatedSize:new Blob([v]).size}}},n_=e=>{var t,i,r,s=ng(e);return!s||(i=e.compression,r=st(e.url,"compression"),i!==T.GZipJS&&r!==T.GZipJS&&"gzip"!==r)||((t=s.body)instanceof ArrayBuffer?$(new Uint8Array(t)):ArrayBuffer.isView(t)&&$(new Uint8Array(t.buffer,t.byteOffset,t.byteLength)))?{url:e.url,encodedBody:s}:(nh=!0,{url:nd(e.url,"compression"),encodedBody:ng(y({},e,{compression:void 0,Or:void 0}))})},nf=(nW=m(function*(e){var t=nv(e.data),i=yield function(e,t,i){return M.apply(this,arguments)}(t,_.DEBUG,{rethrow:!0});if(!i)return e;var r=yield i.arrayBuffer();return y({},e,{Or:{contentType:nc,body:r,estimatedSize:r.byteLength}})}),function(e){return nW.apply(this,arguments)}),nm=(e,t)=>np(e,{_:(new Date).getTime().toString(),ver:_.JS_SDK_VERSION,compression:t}),ny=[];u&&ny.push({transport:"fetch",method(e){var t,{url:i,encodedBody:r}=n_(e),{contentType:s,body:n,estimatedSize:o}=null!=r?r:{},a=new Headers;iJ(e.headers,function(e,t){a.append(t,e)}),s&&a.append("Content-Type",s);var l=null,c=null;if(h){var d=new h;l={signal:d.signal,timeout:setTimeout(()=>{var t,i;(i=Error("PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":""))).name="AbortError",d.abort(c=i)},e.timeout)}}u(i,y({method:(null==e?void 0:e.method)||"GET",headers:a,keepalive:"POST"===e.method&&52428.8>(o||0),body:n,signal:null==(t=l)?void 0:t.signal},e.fetchOptions)).then(t=>t.text().then(i=>{var r={statusCode:t.status,text:i};if(200===t.status)try{r.json=JSON.parse(i)}catch(e){tV.error(e)}null==e.callback||e.callback(r)})).catch(t=>{t===c?tV.warn(t):tV.error(t),null==e.callback||e.callback({statusCode:0,error:t})}).finally(()=>l?clearTimeout(l.timeout):null)}}),c&&ny.push({transport:"XHR",method(e){var t=new c,{url:i,encodedBody:r}=n_(e);t.open(e.method||"GET",i,!0);var{contentType:s,body:n}=null!=r?r:{};iJ(e.headers,function(e,i){t.setRequestHeader(i,e)}),s&&t.setRequestHeader("Content-Type",s),e.timeout&&(t.timeout=e.timeout),t.onreadystatechange=()=>{if(4===t.readyState){var i={statusCode:t.status,text:t.responseText};if(200===t.status)try{i.json=JSON.parse(t.responseText)}catch(e){}null==e.callback||e.callback(i)}},t.send(n)}}),null!=o&&o.sendBeacon&&ny.push({transport:"sendBeacon",method(e){try{var{url:t,encodedBody:i}=n_(e),{contentType:r,body:s}=null!=i?i:{};if(!s)return;var n=s instanceof Blob?s:new Blob([s],{type:r});o.sendBeacon(t,n)}catch(e){}}});
1class nb{constructor(e,t){this.Ei=!0,this.Mi=[],this.Ri=eh((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,tV.createLogger("flush interval"),3e3),this.Pi=e}enqueue(e){this.Mi.push(e),this.Oi||this.Li()}unload(){this.Ai();var e=Object.values(this.Mi.length>0?this.Fi():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Pi(y({},e,{transport:"sendBeacon"}))})}enable(){this.Ei=!1,this.Li()}Li(){var e=this;this.Ei||(this.Oi=setTimeout(()=>{if(this.Ai(),this.Mi.length>0){var t=this.Fi();for(var i in t)!function(){var r=t[i],s=(new Date).getTime();r.data&&z(r.data)&&iJ(r.data,e=>{e.offset=Math.abs(e.timestamp-s),delete e.timestamp}),e.Pi(r)}()}},this.Ri))}Ai(){clearTimeout(this.Oi),this.Oi=void 0}Fi(){var e={};return iJ(this.Mi,t=>{var i,r=(t?t.batchKey:null)||t.url;G(e[r])&&(e[r]=y({},t,{data:[]})),null==(i=e[r].data)||i.push(t.data)}),this.Mi=[],e}}var nw=["retriesPerformedSoFar"];class nE{constructor(e){this.Ni=!1,this.Di=3e3,this.Mi=[],this._instance=e,this.Mi=[],this.$i=!0,!G(s)&&"onLine"in s.navigator&&(this.$i=s.navigator.onLine,this.qi=()=>{this.$i=!0,this.ji()},this.Bi=()=>{this.$i=!1},i5(s,"online",this.qi),i5(s,"offline",this.Bi))}get length(){return this.Mi.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=b(e,nw);ee(t)&&(i.url=np(i.url,{retry_count:t})),this._instance._send_request(y({},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.br(y({retriesPerformedSoFar:t},i));0===e.statusCode&&tV.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)}}))}br(e){var t,i,r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var s=Math.ceil((i=Math.min(18e5,t=3e3*Math.pow(2,r)))+(Math.random()-.5)*(i-t/2)),n=Date.now()+s;this.Mi.push({retryAt:n,requestOptions:e});var o="Enqueued failed request for retry in "+s;navigator.onLine||(o+=" (Browser is offline)"),tV.warn(o),this.Ni||(this.Ni=!0,this.Hi())}Hi(){if(this.Ui&&clearTimeout(this.Ui),0===this.Mi.length)return this.Ni=!1,void(this.Ui=void 0);this.Ui=setTimeout(()=>{this.$i&&this.Mi.length>0&&this.ji(),this.Hi()},this.Di)}ji(){var e=Date.now(),t=[],i=this.Mi.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.Mi=t,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.Ui&&(clearTimeout(this.Ui),this.Ui=void 0),this.Ni=!1,G(s)||(this.qi&&(s.removeEventListener("online",this.qi),this.qi=void 0),this.Bi&&(s.removeEventListener("offline",this.Bi),this.Bi=void 0)),this.Mi))try{this._instance._send_request(y({},e,{transport:"sendBeacon"}))}catch(e){tV.error(e)}this.Mi=[]}}class nx{constructor(e){this.zi=()=>{this.Vi||(this.Vi={});var e,t,i,r,s=this.scrollElement(),n=this.scrollY(),o=s?Math.max(0,s.scrollHeight-s.clientHeight):0,a=n+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;this.Vi.lastScrollY=Math.ceil(n),this.Vi.maxScrollY=Math.max(n,null!==(e=this.Vi.maxScrollY)&&void 0!==e?e:0),this.Vi.maxScrollHeight=Math.max(o,null!==(t=this.Vi.maxScrollHeight)&&void 0!==t?t:0),this.Vi.lastContentY=a,this.Vi.maxContentY=Math.max(a,null!==(i=this.Vi.maxContentY)&&void 0!==i?i:0),this.Vi.maxContentHeight=Math.max(l,null!==(r=this.Vi.maxContentHeight)&&void 0!==r?r:0)},this._instance=e}get Wi(){return this._instance.config.scroll_root_selector}getContext(){return this.Vi}resetContext(){var e=this.Vi;return setTimeout(this.zi,0),e}startMeasuringScrollPosition(){i5(s,"scroll",this.zi,{capture:!0}),i5(s,"scrollend",this.zi,{capture:!0}),i5(s,"resize",this.zi)}scrollElement(){if(!this.Wi)return null==s?void 0:s.document.documentElement;for(var e of z(this.Wi)?this.Wi:[this.Wi]){var t=null==s?void 0:s.document.querySelector(e);if(t)return t}}Gi(e){if(this.Wi){var t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return s?"y"===e?s.scrollY||s.pageYOffset||s.document.documentElement.scrollTop||0:s.scrollX||s.pageXOffset||s.document.documentElement.scrollLeft||0:0}scrollY(){return this.Gi("y")}scrollX(){return this.Gi("x")}}var nS=e=>sg(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties);
1class nk{constructor(e,t,i,r){this.Zi=e=>{var t=this.Qi();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Ji(this._instance)};this.Ki.register({[iT]:i})}},this._instance=e,this.Yi=t,this.Ki=i,this.Ji=r||nS,this.Yi.onSessionId(this.Zi)}Qi(){return this.Ki.props[iT]}getSetOnceProps(){var e,t=null==(e=this.Qi())?void 0:e.props;return t?"r"in t?s_(t):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return iJ(i2(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+q(i)]=t}),e}}class nP{constructor(){this.Xi={}}on(e,t){return this.Xi[e]||(this.Xi[e]=[]),this.Xi[e].push(t),()=>{this.Xi[e]=this.Xi[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Xi[e]||[])i(t);for(var r of this.Xi["*"]||[])r(e,t)}}var nT=tW("[SessionId]");class nF{on(e,t){return this.en.on(e,t)}constructor(e,t,i){if(this.tn=null,this.rn=[],this.nn=void 0,this.sn=!1,this.en=new nP,this.an=(e,t)=>!(!ee(e)||!ee(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===iq)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Dt=e.config,this.Ki=e.persistence,this.ln=void 0,this.un=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.hn=t||rs,this.cn=i||rs;var r,s=this.Dt.persistence_name||this.Dt.token;if(this._sessionTimeoutMs=1e3*eh(this.Dt.session_idle_timeout_seconds||1800,60,36e3,nT.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.dn(),this.vn="ph_"+s+"_window_id",this.fn="ph_"+s+"_primary_window_exists",this.pn()){var n=rg.F(this.vn),o=rg.F(this.fn);n&&!o?this.ln=n:rg.q(this.vn),rg.A(this.fn,!0)}if(null!=(r=this.Dt.bootstrap)&&r.sessionID)try{var a=(e=>{var t=this.Dt.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.gn(this.Dt.bootstrap.sessionID,(new Date).getTime(),a)}catch(e){nT.error("Invalid sessionID in bootstrap",e)}this.mn()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return G(this.rn)&&(this.rn=[]),this.rn.push(e),this.un&&e(this.un,this.ln),()=>{this.rn=this.rn.filter(t=>t!==e)}}pn(){return"memory"!==this.Dt.persistence&&!this.Ki.ti&&rg.N()}yn(e){e!==this.ln&&(this.ln=e,this.pn()&&rg.A(this.vn,e))}bn(){return this.ln?this.ln:this.pn()?rg.F(this.vn):null}_n(e){var t=this.tn;return!J(t)&&!J(e)&&5e3>Math.abs(e-t)}gn(e,t,i){var r=t!==this._sessionActivityTimestamp,s=!(e!==this.un||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.un=e,s&&!r||s&&this._n(t)||(this.tn=t,this.Ki.register({[is]:[t,e,i]}))}wn(){var e,t=null==(e=this.Dt)?void 0:e.persistence_save_debounce_ms;return ee(t)&&t>0}xn(){this.wn()?this.Ki.refreshKey(is):(this.Ki.flush(),this.Ki.load())}kn(){var e;if(!J(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.tn){this.xn();var[,t,i]=this.Sn();t===this.un&&i===this._sessionStartTimestamp&&(this.tn=this._sessionActivityTimestamp,this.Ki.register({[is]:[this._sessionActivityTimestamp,null!==(e=this.un)&&void 0!==e?e:null,this._sessionStartTimestamp]}),this.Ki.flush())}}Cn(){var[e]=this.Sn();return Math.max(ee(e)?e:0,ee(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}In(e){return this.xn(),this.an(e,this.Cn())}Sn(){var e=this.Ki.props[is];return z(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.tn=null,clearTimeout(this.Tn),this.Tn=void 0,this.gn(null,null,null)}destroy(){this.sn=!0,this.kn(),clearTimeout(this.Tn),this.Tn=void 0,this.nn&&s&&(s.removeEventListener(iV,this.nn,{capture:!1}),this.nn=void 0),this.rn=[]}mn(){this.nn=()=>{this.kn(),this.pn()&&rg.q(this.fn)},i5(s,iV,this.nn,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.Dt.cookieless_mode===iq)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[,r,s]=this.Sn(),n=this.Cn(),o=this.bn(),a=ee(s)&&Math.abs(i-s)>
1864e5,l=!1,u=!1,c=!r,h=r,d=!c&&!e&&this.an(i,n);d&&((d=this.In(i))||nT.info("cross-tab refresh kept the session alive",{sessionId:r}),[,r,s]=this.Sn()),c||d||a?(r=this.hn(),o=this.cn(),nT.info("new session ID generated",{sessionId:r,windowId:o,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:a}}),s=i,l=!0):(o||(o=this.cn(),l=!0),(u=r!==h)&&(nT.info("adopted cross-tab session id",{sessionId:r,windowId:o}),l=!0));var p=ee(n)&&e&&!a?n:i,v=ee(s)?s:(new Date).getTime();this.yn(o),this.gn(r,p,v),e||this.dn();var g={noSessionId:c,activityTimeout:d,sessionPastMaximumLength:a,crossTabAdoption:u};return l&&this.rn.forEach(e=>e(r,o,g)),{sessionId:r,windowId:o,sessionStartTimestamp:v,changeReason:l?g:void 0,lastActivityTimestamp:n}}dn(){this.sn||(clearTimeout(this.Tn),this.Tn=setTimeout(()=>{if(!this.sn){if(this.In((new Date).getTime())){var e=this.un;this.resetSessionId(),this.en.emit("forcedIdleReset",{idleSessionId:e})}else this.dn()}},1.1*this.sessionTimeoutMs))}}var nR=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&L(i,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(e=>L(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver},nI=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 n$(e,t,i){return nv({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var nO={exact:(e,t)=>t.some(t=>e.some(e=>t===e)),is_not:(e,t)=>t.every(t=>e.every(e=>t!==e)),regex:(e,t)=>t.some(t=>e.some(e=>nI(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!nI(t,e))),icontains:(e,t)=>t.map(nD).some(t=>e.map(nD).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(nD).every(t=>e.map(nD).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))})},nD=e=>e.toLowerCase();function nC(e,t){return!e||Object.entries(e).every(e=>{var[i,r]=e,s=null==t?void 0:t[i];if(G(s)||J(s))return!1;var n=[String(s)],o=nO[r.operator];return!!o&&o(r.values,n)})}var nM="custom",nA="i.posthog.com",nL=/^\/static\//;class nN{constructor(e){this.En={},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("."+nA,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.En[this.apiHost]||(this.En[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":nM),this.En[this.apiHost]}Mn(e){if(nL.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.Mn(t);if(i)return""+i+t}if(this.region===nM)return this.apiHost+t;var r=nA+t;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var nU=tW("[Surveys]"),nq="seenSurvey_",nj=[sP.Popover,sP.Widget,sP.API],nH={ignoreConditions:!1,ignoreDelay:!1,displayType:sO.Popover},nB=tW("[PostHog ExternalIntegrations]"),nz={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class nV{constructor(e){this._instance=e}qr(e,t){var i;null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return nB.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,r,n;!s||null!=(i=v.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.qr(nz[e],()=>{var i;null==(i=v.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!s&&null!=(r=v.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]&&(null==(n=v.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[r,s]of Object.entries(null!==(e=this._instance.config.integrations)&&void 0!==e?e:{}))i(r)}}var nW,nK,nG={},nY=0,nQ=()=>{}
1,nJ='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',nX="Surveys module not available",nZ="sanitize_properties is deprecated. Use before_send instead",n0="Invalid value for property_denylist config: ",n1="posthog",n2=!nu&&-1===(null==p?void 0:p.indexOf("MSIE"))&&-1===(null==p?void 0:p.indexOf("Mozilla")),n3=e=>{var t;return y({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(!Y(t))return!1;var i=t.split(".").slice(-2).join(".");for(var r of i3)if(i===r)return!1;return!0}(null==a?void 0:a.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:nQ,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&&Y(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,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==s||null==(t=s.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){tV.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:iB,before_send:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:nQ},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:rD,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-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)})},n5=[["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"]],n4=e=>{var t={};for(var[i,r]of n5)G(e[i])||(t[r]=e[i]);var s=iX({},t,e),n=e.__preview_external_dependency_versioned_paths;return G(n)||(G(e.strict_script_versioning)&&(s.strict_script_versioning=!!n),Y(n)&&G(e.asset_host)&&(s.asset_host=n)),z(e.property_blacklist)&&(G(e.property_denylist)?s.property_denylist=e.property_blacklist:z(e.property_denylist)?s.property_denylist=[...e.property_blacklist,...e.property_denylist]:tV.error(n0+e.property_denylist)),s};class n6{constructor(){this.__forceAllowLocalhost=!1}get Rn(){return this.__forceAllowLocalhost}set Rn(e){tV.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class n8{Pn(e,t){if(e){var i=this.On.indexOf(e);-1!==i&&this.On.splice(i,1)}return this.On.push(t),null==t.initialize||t.initialize(),t}Ln(){return this.config.cookieless_mode===iq||this.config.cookieless_mode===iU&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){this.webPerformance=new n6,this.An=!1,this.version=_.LIB_VERSION,this.Fn=new nP,this.On=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=n3(),this.SentryIntegration=r5,this.sentryIntegration=e=>{var t;return t=r3(this,e),{name:r2,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Nn=!1,this.Dn=null,this.$n=null,this.qn=null,this.scrollManager=new nx(this),this.pageViewManager=new r4(this),this.rateLimiter=new sL(this),this.requestRouter=new nN(this),this.consent=new r_(this),this.externalIntegrations=new nV(this);var e,t=null!==(e=n8.__defaultExtensionClasses)&&void 0!==e?e:{};this.featureFlags=t.featureFlags&&new t.featureFlags(this),this.toolbar=t.toolbar&&new t.toolbar(this),this.surveys=t.surveys&&new t.surveys(this),this.conversations=t.conversations&&new t.conversations(this),this.logs=t.logs&&new t.logs(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,i)=>{var r=Y(e)?{[e]:t}:e;this.setPersonProperties(r),null==i||i({})},set_once:(e,t,i)=>{var r=Y(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",e=>tV.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==n1){var r,s=null!==(r=nG[i])&&void 0!==r?r:new n8;return s._init(e,t,i),nG[i]=s,nG[n1][i]=s,s}return this._init(e,t,i)}_init(e,t,i){void 0===t&&(t={});var r,n,o=Y(e)?e.trim():"";if(!o)return tV.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.jn(t.debug),this.Bn=t,this.Hn=[],t.person_profiles?this.$n=t.person_profiles:t.process_person&&(this.$n=t.process_person);var a=n3(t.defaults),l=n4(t),u=iX({},a,l,{name:i,token:o});W(a.rageclick)&&W(l.rageclick)&&(u.rageclick=iX({},a.rageclick,l.rageclick)),W(a.session_recording)&&W(l.session_recording)&&(u.session_recording=iX({},a.session_recording,l.session_recording)),this.set_config(u),this.config.on_xhr_error&&tV.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:sj.GZipJS;var c=this.Un();this.persistence=new sw(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sw(y({},this.config,{persistence:"sessionStorage"}),c,!1);var h=y({},this.persistence.props),d=y({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.zn=new nb(e=>this.Vn(e),this.config.request_queue_config),this.Wn=new nE(this),this.__request_queue=[];var p=this.Ln();if(p||(this.sessionManager=new nF(this),this.sessionPropsManager=new nk(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(tV.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Gn(p)},0)):(tV.info("Initializing extensions synchronously"),this.Gn(p)),_.DEBUG=_.DEBUG||this.config.debug,_.DEBUG&&tV.info("Starting in debug mode",{this:this,config:t,thisC:y({},this.config),p:h,s:d}),!this.config.identity_distinct_id||null!=(r=t.bootstrap)&&r.distinctID||(t.bootstrap=y({},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(),f=this.persistence.get_property(iP);if(t.bootstrap.isIdentifiedID&&null!=g&&g!==v&&f===ij)this.identify(v);else if(t.bootstrap.isIdentifiedID&&null!=g&&g!==v&&f===iH)tV.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(rs()),b=t.bootstrap.isIdentifiedID?m:v;this.persistence.set_property(iP,t.bootstrap.isIdentifiedID?iH:ij),this.register({distinct_id:v,$device_id:b})}}if(p)this.register_once({distinct_id:iC,$device_id:null},"");else if(!this.get_distinct_id()){var w=this.config.get_device_id(rs());this.register_once({distinct_id:w,$device_id:w},""),this.persistence.set_property(iP,ij)}return i5(s,"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 r=i=>{var r=()=>i.anonymousId()||rs();e.config.get_device_id=r,i.id()&&(e.register({distinct_id:i.id(),$device_id:r()}),e.persistence.set_property(iP,iH)),t()},s=i.user();"then"in s&&V(s.then)?s.then(r):r(s)}(e,()=>{var r;i.register((Promise&&Promise.resolve||r1.warn("This browser does not have Promise support, and can not use the segment integration"),r=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(r1.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(r1.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var r=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>r(e,e.event.event),page:e=>r(e,iW),identify:e=>r(e,iG),screen:e=>r(e,"$screen")})).then(()=>{t()})})}(this,()=>this.Zn()):this.Zn(),V(this.config._onCapture)&&this.config._onCapture!==nQ&&(tV.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&tV.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}Gn(e){var t,i,r,s,n,o,a,l=performance.now(),u=y({},n8.__defaultExtensionClasses,this.config.__extensionClasses),c=[];u.featureFlags&&this.On.push(this.featureFlags=null!==(t=this.featureFlags)&&void 0!==t?t:new u.featureFlags(this)),u.exceptions&&this.On.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new u.exceptions(this)),u.historyAutocapture&&this.On.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.On.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.On.push(this.siteApps=new u.siteApps(this)),u.sessionRecording&&!e&&this.On.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||c.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.On.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.On.push(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new u.surveys(this)),u.logs&&this.On.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new u.logs(this)),u.conversations&&this.On.push(this.conversations=null!==(n=this.conversations)&&void 0!==n?n:new u.conversations(this)),u.productTours&&this.On.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.On.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.On.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.On.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.On.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,rZ)),u.toolbar&&this.On.push(this.toolbar=null!==(o=this.toolbar)&&void 0!==o?o:new u.toolbar(this)),u.experiments&&this.On.push(this.experiments=null!==(a=this.experiments)&&void 0!==a?a:new u.experiments(this)),this.On.forEac
1h(e=>{e.initialize&&c.push(()=>{null==e.initialize||e.initialize()})}),c.push(()=>{if(this.Qn){var e=this.Qn;this.Qn=void 0,this.Si(e)}}),this.Jn(c,l)}Jn(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Jn(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){tV.error("Error initializing extension:",e)}}var r=Math.round(performance.now()-t);this.register_for_session({[iM]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[iA]:r}),this.config.__preview_deferred_init_extensions&&tV.info("PostHog extensions initialized ("+r+"ms)")}Si(e){var t;if(!a||!a.body)return tV.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Si(e)},500);this.config.__preview_deferred_init_extensions&&(this.Qn=e),this.Kn=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=N(e.supportedCompression,sj.GZipJS)?sj.GZipJS:N(e.supportedCompression,sj.Base64)?sj.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.$n?this.$n:iB}),this.On.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}Zn(){try{this.config.loaded(this)}catch(e){tV.critical("`loaded` function failed",e)}if(this.Yn(),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.Ln())&&this.Xn()},1),this.es=new sU(this),this.es.load()}Yn(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.zn)||e.enable())}_dom_loaded(){this.is_capturing()&&iQ(this.__request_queue,e=>this.Vn(e)),this.__request_queue=[],this.Yn()}_handle_unload(){var e,t,i,r;null==(e=this.surveys)||e.handlePageUnload(),this.config.request_batching?(this.ts()&&this.capture(iK),null==(t=this.logs)||t.flushLogs("sendBeacon"),null==(i=this.zn)||i.unload(),null==(r=this.Wn)||r.unload()):this.ts()&&this.capture(iK,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?n2?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=y({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(G(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,r,s=y({},e);s.timeout=s.timeout||6e4,s.url=nm(s.url,s.compression);var n=null!==(t=s.transport)&&void 0!==t?t:"fetch",o=ny.filter(e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport)),a=null!==(i=null==(r=function(e,t){for(var i=0;e.length>i;i++)if(e[i].transport===n)return e[i]}(o))?void 0:r.method)&&void 0!==i?i:o[0].method;if(!a)throw Error("No available transport method");"sendBeacon"!==n&&s.data&&s.compression===sj.GZipJS&&d&&!nh?nf(s).then(e=>{a(e)}).catch(t=>{if(O(t))return nh=!0,void a(y({},s,{compression:void 0,url:nm(e.url,void 0)}));(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return O(e)||t===I})(t)&&(nh=!0),a(s)}):a(s)})(y({},e,{callback:t=>{var i,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}Vn(e){this.Wn?this.Wn.retriableRequest(e):this._send_request(e)}_execute_array(e){nY++;try{var t,i=[],r=[],s=[];iQ(e,e=>{if(e){if(z(t=e[0]))s.push(e);else if(V(e))try{e.call(this)}catch(t){tV.error("Error executing queued PostHog call",e,t)}else z(e)&&"alias"===t?i.push(e):z(e)&&-1!==t.indexOf("capture")&&V(this[t])?s.push(e):r.push(e)}});var n=function(e,t){iQ(e,function(e){try{if(z(e[0])){var i=t;iJ(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){tV.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(r,this),n(s,this)}finally{nY--}}push(e){if(nY>0&&z(e)&&Y(e[0])){var t=n8.prototype[e[0]];V(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var r,s,n,o,a;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.zn){if(this.is_capturing()){if(!G(e)&&Y(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&&!Y(null==t?void 0:t.$current_url)&&(tV.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.rs||tV.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 c=new Date,h=(null==i?void 0:i.timestamp)||c,d=ta(null==i?void 0:i.uuid,r
1s),p={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},h,d)};e===iW&&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.ns(null==i?void 0:i.$set_once,e!==iY,e===iG);if(m&&(p.$set_once=m),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,n=p,o=e=>Y(e)?e.slice(0,s):e,a=new Set,p=function e(t,i){var r;return t!==Object(t)?o?o(t):t:a.has(t)?void 0:(a.add(t),z(t)?(r=[],iQ(t,t=>{r.push(e(t))})):(r={},iJ(t,(t,i)=>{a.has(t)||(r[i]=e(t,i))})),r)}(n)),p.timestamp=h,G(null==i?void 0:i.timestamp)||(p.properties.$event_time_override_provided=!0,p.properties.$event_time_override_system_time=c),e===sI.DISMISSED||e===sI.SENT){var b=null==t?void 0:t[s$.SURVEY_ID],w=null==t?void 0:t[s$.SURVEY_ITERATION];(e=>{try{var t,i=(t=""+nq+e.id,e.current_iteration&&e.current_iteration>0&&(t=""+nq+e.id+"_"+e.current_iteration),t);
1if(localStorage.getItem(i))return;localStorage.setItem(i,"true")}catch(e){nU.error("Failed to persist survey seen state",e)}})({id:b,current_iteration:w}),p.$set=y({},p.$set,{[(g={id:b,current_iteration:w},f="$survey_"+(_=e===sI.SENT?"responded":"dismissed")+"/"+g.id,g.current_iteration&&g.current_iteration>0&&(f="$survey_"+_+"/"+g.id+"/"+g.current_iteration),f)]:!0})}else e===sI.SHOWN&&(p.$set=y({},p.$set,{[s$.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(e===sC.SHOWN){var E=null==t?void 0:t[sM.TOUR_TYPE];E&&(p.$set=y({},p.$set,{[sM.TOUR_LAST_SEEN_DATE+"/"+E]:(new Date).toISOString()}))}var x=y({},p.properties.$set,p.$set);if(K(x)||this.setPersonPropertiesForFlags(x),!X(this.config.before_send)){var S=this.mr(p);if(!S)return;(p=S).uuid=ta(p.uuid,rs)}this.Fn.emit("eventCaptured",p);var k={method:"POST",url:null!==(r=null==i?void 0:i._url)&&void 0!==r?r: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.Vn(k):this.zn.enqueue(k),p}tV.critical("This capture call is ignored due to client rate limiting.")}}else tV.error("No event name provided to posthog.capture")}}else tV.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,r,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var o,u=n?void 0:this.persistence.remove_event_timer(e),c=y({},t);if(c.token=this.config.token,c.$config_defaults=this.config.defaults,this.Ln()&&(c.$cookieless_mode=!0),"$snapshot"===e){var h=y({},this.persistence.properties(),this.sessionPersistence.properties());return c.distinct_id=h.distinct_id,(!Y(c.distinct_id)&&!Z(c.distinct_id)||Q(c.distinct_id))&&tV.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),c}var d,v=function(e,t,i){if(!p)return{};var r,n,o,a,u,c,h,d,v,g,f,m,y=e?[...sn,...t||[]]:[],[b,w]=function(e){for(var t=0;ts.length>t;t++){var[i,r]=ts[t],s=i.exec(e),n=s&&(V(r)?r(s,e):r);if(n)return n}return["",""]}(p),E=null!=(u="undefined"!=typeof navigator?navigator:void 0)&&u.brave?{brave:!0}:{},x={detectGoogleSearchApp:i},S=iX(i2({$os:b,$os_version:w,$browser:tt(p,navigator.vendor,E,x),$device:tn(p),$device_type:(h={userAgentDataPlatform:null==(r=navigator)||null==(r=r.userAgentData)?void 0:r.platform,maxTouchPoints:null==(n=navigator)?void 0:n.maxTouchPoints,screenWidth:null==s||null==(o=s.screen)?void 0:o.width,screenHeight:null==s||null==(a=s.screen)?void 0:a.height,devicePixelRatio:null==s?void 0:s.devicePixelRatio},(m=tn(p))===ef||m===e_||"Kobo"===m||"Kindle Fire"===m||m===eK?eg:m===eA||m===eN||m===eL||m===ez?"Console":m===ey?"Wearable":m?ep:"Android"===(null==h?void 0:h.userAgentDataPlatform)&&(null!==(d=null==h?void 0:h.maxTouchPoints)&&void 0!==d?d:0)>0?600>Math.min(null!==(v=null==h?void 0:h.screenWidth)&&void 0!==v?v:0,null!==(g=null==h?void 0:h.screenHeight)&&void 0!==g?g:0)/(null!==(f=null==h?void 0:h.devicePixelRatio)&&void 0!==f?f:1)?ep:eg:"Desktop"),$timezone:sf(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:si(null==l?void 0:l.href,y,sa),$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:tr(p,navigator.vendor,E,x),$browser_language:sd(),$browser_language_prefix:"string"==typeof(c=sd())?c.split("-")[0]:void 0,$screen_height:null==s?void 0:s.screen.height,$screen_width:null==s?void 0:s.screen.width,$viewport_height:null==s?void 0:s.innerHeight,$viewport_width:null==s?void 0:s.innerWidth,$lib:_.LIB_NAME,$lib_version:_.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return _.SDK_DIST_CHANNEL&&(S.$sdk_dist_channel=_.SDK_DIST_CHANNEL),S}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app);if(this.sessionManager){var{sessionId:g,windowId:f}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());c.$session_id=g,c.$window_id=f}this.sessionPropsManager&&iX(c,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&iX(c,this.sessionRecording.sdkDebugProperties),c.$sdk_debug_retry_queue_size=null==(o=this.Wn)?void 0:o.length}catch(e){c.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===nM&&(c.$lib_custom_api_host=this.config.api_host),d=e!==iW||n?e!==iK||n?this.pageViewM
1anager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),c=iX(c,d),e===iW&&a&&(c.title=a.title),!G(u)){var m=i.getTime()-u;c.$duration=parseFloat((m/1e3).toFixed(3))}p&&this.config.opt_out_useragent_filter&&(c.$browser_type=this._is_bot()?"bot":"browser"),(c=iX({},v,this.persistence.properties(),this.sessionPersistence.properties(),c)).$is_identified=this._isIdentified(),z(this.config.property_denylist)?iJ(this.config.property_denylist,function(e){delete c[e]}):tV.error(n0+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(tV.error(nZ),c=b(c,e));var w=this.ss();return c.$process_person_profile=w,w&&!n&&this.os("_calculate_event_properties"),c}ns(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.ss()||this.An&&!i)return e;var r,s=iX({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(tV.error(nZ),s=n(s,"$set_once")),t&&(this.An=!0),K(s)?void 0:s}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var r;null==(r=this.persistence)||r.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)}ls(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)}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 r;null==(r=this.featureFlags)||r.updateFlags(e,t,i)}updateEarlyAccessFeatureEnrollment(e,t,i){var r;null==(r=this.featureFlags)||r.updateEarlyAccessFeatureEnrollment(e,t,i)}getEarlyAccessFeatures(e,t,i){var r;return void 0===t&&(t=!1),null==(r=this.featureFlags)?void 0:r.getEarlyAccessFeatures(e,t,i)}on(e,t){return this.Fn.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:nX}),()=>{})}onSessionId(e){var t,i;return null!==(t=null==(i=this.sessionManager)?void 0:i.onSessionId(e))&&void 0!==t?t:()=>{}}getSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getSurveys(e,t):e([],{isLoaded:!1,error:nX})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:nX})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=nH),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))&&void 0!==t?t:{visible:!1,disabledReason:nX}}canRenderSurveyAsync(e,t){var i,r;return void 0===t&&(t=!1),null!==(i=null==(r=this.surveys)?void 0:r.canRenderSurveyAsync(e,t))&&void 0!==i?i:Promise.resolve({visible:!1,disabledReason:nX})}us(e){return!e||Q(e)?(tV.critical("Unique user id has not been set in posthog.identify"),!1):e===iC?(tV.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())||(tV.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return tV.uninitializedWarning("posthog.identify");if(Z(e)&&(e=e.toString(),tV.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.us(e)&&this.os("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(tQ)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(tJ)&&(this.unregister(tJ),this.register({distinct_id:e}));var s,n=(this.persistence.get_property(iP)||ij)===ij;e!==r&&n?(this.persistence.set_property(iP,iH),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.capture(iG,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.qn=n$(e,t,i),null==(s=this.featureFlags)||s.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(iE))}}setPersonProperties(e,t){if((e||t)&&this.os("posthog.setPersonProperties")){var i=n$(this.get_distinct_id(),e,t);this.qn!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.qn=i):tV.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(z(e)?e:[e]).filter(e=>Y(e)&&e.length>0);0!==i.length&&this.os("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.qn=null)}group(e,t,i){if(e&&t){var r=this.getGroups(),s=r[e]!==t;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:y({},r,{[e]:t})}),s||i){var n={$group_type:e,$group_key:t};
1i&&(n.$group_set=i),this.capture(iY,n)}i&&this.setGroupPropertiesForFlags({[e]:i}),s&&!i&&this.reloadFeatureFlags()}else tV.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.os("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){if(tV.info("reset"),!this.__loaded)return tV.uninitializedWarning("posthog.reset");var t,i,r,s,n,o,a,l,u,c,h=this.get_property(tQ),d=this.get_property(t7);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),G(d)||null==(c=this.persistence)||c.register({[t7]:d}),null==(r=this.surveys)||r.reset(),null==(s=this.es)||s.stop(),null==(n=this.featureFlags)||n.reset(),null==(o=this.conversations)||o.reset(),null==(a=this.logs)||a.reset(),null==(l=this.persistence)||l.set_property(iP,ij),null==(u=this.sessionManager)||u.resetSessionId(),this.qn=null,this.config.cookieless_mode===iq)this.register_once({distinct_id:iC,$device_id:null},"");else{var p=this.config.get_device_id(rs());this.register_once({distinct_id:p,$device_id:e?p:h},"")}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}setIdentity(e,t){var i;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i.hs()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.cs()}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)&&void 0!==e?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:t,sessionStartTimestamp:i}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t);if(null!=e&&e.withTimestamp&&i){var s,n=null!==(s=e.timestampLookBack)&&void 0!==s?s:10;if(!i)return r;r+="?t="+Math.max(Math.floor(((new Date).getTime()-i)/1e3)-n,0)}return r}alias(e,t){return e===this.get_property(tY)?(tV.critical("Attempting to create alias for existing People user - aborting."),-2):this.os("posthog.alias")?(G(t)&&(t=this.get_distinct_id()),e!==t?(this.ls(tJ,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(tV.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=y({},this.config);if(W(e)){iX(this.config,n4(e));var i,r,s,n,o,a,l,u,c,h,d,p=this.Un();null==(i=this.persistence)||i.update_config(this.config,t,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sw(y({},this.config,{persistence:"sessionStorage"}),p,!1);var v=this.jn(this.config.debug);et(v)&&(this.config.debug=v),et(this.config.debug)&&(this.config.debug?(_.DEBUG=!0,rc.N()&&rc.A("ph_debug",!0),tV.info("set_config",{config:e,oldConfig:t,newConfig:y({},this.config)})):(_.DEBUG=!1,rc.N()&&rc.q("ph_debug"))),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(o=this.tracingHeaders)||o.startIfEnabledOrStop(),null==(a=this.autocapture)||a.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||c.startIfEnabledOrStop(),null==(h=this.surveys)||h.loadIfEnabled(),this.ds(),null==(d=this.externalIntegrations)||d.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){_.LIB_NAME=e,_.LIB_VERSION=t}startSessionRecording(e){var t,i,r,s,n,o=!0===e,a={sampling:o||!(null==e||!e.sampling),linked_flag:o||!(null==e||!e.linked_flag),url_trigger:o||!(null==e||!e.url_trigger),event_trigger:o||!(null==e||!e.event_trigger)};Object.values(a).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),a.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),a.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),a.url_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("url")),a.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"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(y({},r,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)&&void 0!==e?e:n8.vs}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))&&void 0!==t&&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)&&void 0!==e?e:n1;return t!==n1&&(t=n1+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(iP))===iH||(null==(t=this.sessionPersistence)?void 0:t.get_property(iP))===iH}ss(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===iB&&!this._isIdentified()&&K(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[tJ])&&(null==(t=this.persistence)||null==(t=t.props)||!t[iO]))}ts(){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.ss()||this.os("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.os("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}os(e){return"never"===this.config.person_profiles?(tV.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.ls(iO,!0),!0)}Un(){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!==iU)}ds(){var e,t,i,r,s=this.Un();return(null==(e=this.persistence)?void 0:e.ti)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(t=this.sessionPersistence)?void 0:t.t
1i)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==iq){if(this.Ln()){this.reset(!0),null==(s=this.sessionManager)||s.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=new nF(this),this.pageViewManager=new r4(this),this.persistence&&(this.sessionPropsManager=new nk(this,this.sessionManager,this.persistence));var i,r,s,n,o,a,l,u,c=null!==(o=null==(a=this.config.__extensionClasses)?void 0:a.sessionRecording)&&void 0!==o?o:null==(l=n8.__defaultExtensionClasses)?void 0:l.sessionRecording;c&&(this.sessionRecording=this.Pn(this.sessionRecording,new c(this)),this.Kn&&(null==(u=this.sessionRecording)||null==u.onRemoteConfig||u.onRemoteConfig(this.Kn)))}this.consent.optInOut(!0),this.ds(),this.Yn(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==iU&&(null==(i=this.surveys)||i.loadIfEnabled()),(G(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(r=null==e?void 0:e.captureEventName)&&void 0!==r?r:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Xn()}else tV.warn(nJ)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==iq?(this.config.cookieless_mode===iU&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.ds(),this.config.cookieless_mode===iU&&(this.register({distinct_id:iC,$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.Xn(),this.Yn())):tV.warn(nJ)}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===iq||(this.config.cookieless_mode===iU?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.ds()}_is_bot(){return o?nR(o,this.config.custom_blocked_useragents):void 0}Xn(){a&&("visible"===a.visibilityState?this.Nn||(this.Nn=!0,this.capture(iW,{title:a.title},{send_instantly:!0}),this.Dn&&(a.removeEventListener(iz,this.Dn),this.Dn=null)):this.Dn||(this.Dn=this.Xn.bind(this),i5(a,iz,this.Dn)))}debug(e){!1===e?(null==s||s.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==s||s.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}))}Ii(){var e,t,i,r,s=this.Bn||{};return"advanced_disable_flags"in s?!!s.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(tV.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 s&&!X(s[e]),r=t in s&&!X(s[t]),i?s[e]:!!r&&(tV&&tV.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),s[t]))}mr(e){if(X(this.config.before_send))return e;var t,i=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(es),r=z(this.config.before_send)?this.config.before_send:[this.config.before_send],s=e;for(var n of r){if(X(s=n(s))){var o="Event '"+e.event+"' was rejected in beforeSend function";return er(e.event)?tV.warn(o+". This can cause unexpected behavior."):tV.info(o),null}s.properties&&!K(s.properties)||tV.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var a of i)if(s.properties&&X(s.properties[a]))return tV.warn("Event '"+e.event+"' had its '"+a+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return s}getPageViewId(){var e;
1return null==(e=this.pageViewManager.Hr)?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)})}jn(e){var t=et(e)&&!e,i=rc.N()&&"true"===rc.P("ph_debug");return!t&&(!!i||e)}}n8.__defaultExtensionClasses={},n8.vs={trace:nK=()=>{},debug:nK,info:nK,warn:nK,error:nK,fatal:nK},function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=i1(e.prototype[t[i]])}(n8,["identify"]);class n7{constructor(e){this.disabled=!1===e;var t=W(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,i){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<this.thresholdPx&&this.timeoutMs>i-r.timestamp){if(this.clicks.push({x:e,y:t,timestamp:i}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}var n9="$copy_autocapture",oe=tW("[AutoCapture]");function ot(e,t){return t.length>e?t.slice(0,e)+"...":t}var oi=tW("[ExceptionAutocapture]"),or=tW("[TracingHeaders]"),os=tW("[Web Vitals]"),on="disabled",oo="lazy_loading",oa="awaiting_config",ol="missing_config";tW("[SessionRecording]"),tW("[SessionRecording]");var ou="[SessionRecording]",oc=tW(ou),oh=tW("[Heatmaps]");function od(e){return W(e)&&"clientX"in e&&"clientY"in e&&Z(e.clientX)&&Z(e.clientY)}var op=tW("[Product Tours]"),ov=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(t6))},og=["$set_once","$set"],o_=tW("[SiteApps]"),of="Error while initializing PostHog app with config id ";function om(e,t,i){if(X(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 oy{constructor(e){this.fs=new nP,this.ps=(e,t)=>this.gs(e,t)&&this.ys(e,t)&&this.bs(e,t)&&this._s(e,t),this.gs=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.ws=new Set,this.xs=new Set}init(){var e,t;G(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(!G(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e=>{var t,i;null==(t=this.xs)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.ws)||t.add((null==e?void 0:e.event)||"")})}),null!=(i=this._instance)&&i.autocapture)){var r,s=new Set;e.forEach(e=>{var t;null==(t=e.steps)||t.forEach(e=>{null!=e&&e.selector&&s.add(null==e?void 0:e.selector)})}),null==(r=this._instance)||r.autocapture.setElementSelectors(s)}}on(e,t){var i;null!=t&&0!=e.length&&(this.ws.has(e)||this.ws.has(null==t?void 0:t.event))&&this.xs&&(null==(i=this.xs)?void 0:i.size)>0&&this.xs.forEach(e=>{this.ks(t,e)&&this.fs.emit("actionCaptured",e.name)})}Ss(e){this.onAction("actionCaptured",t=>e(t))}ks(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.ps(e,i))return!0;return!1}onAction(e,t){return this.fs.on(e,t)}ys(e,t){if(null!=t&&t.url){var i,r=null==e||null==(i=e.properties)?void 0:i.$current_url;if(!r||"string"!=typeof r||!om(r,t.url,t.url_matching||"contains"))return!1}return!0}bs(e,t){return!!this.Cs(e,t)&&!!this.Is(e,t)&&!!this.Ts(e,t)}Cs(e,t){if(null==t||!t.href)return!0;var i=this.Es(e);if(i.length>0)return i.some(e=>om(e.href,t.href,t.href_matching||"exact"));var r,s,n=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!n&&om((s=n.match(/(?::|")href="(.*?)"/))?s[1]:"",t.href,t.href_matching||"exact")}Is(e,t){if(null==t||!t.text)return!0;var i=this.Es(e);if(i.length>0)return i.some(e=>om(e.text,t.text,t.text_matching||"exact")||om(e.$el_text,t.text,t.text_matching||"exact"));var r,s,n,o,a=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!a&&(s=function(e){for(var t,i=[],r=/(?::|")text="(.*?)"/g;!X(t=r.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(a),n=t.text,o=t.text_matching||"exact",s.some(e=>om(e,n,o)))}Ts(e,t){if(null==t||!t.selector)return!0;var i,r,s=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null!=s&&s.includes(t.selector))return!0;var n=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}Es(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}_s(e,t){return null==t||!t.properties||0===t.properties.length||nC(t.properties.reduce((e,t)=>
1{var i=z(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 ob{constructor(e){this.Ms=[],this._instance=e,this.Rs=new Map,this.Ps=new Map,this.Os=new Map}Ls(e,t){return!!e&&nC(e.propertyFilters,null==t?void 0:t.properties)}As(e,t){var i=new Map;return e.forEach(e=>{var r;null==(r=e.conditions)||null==(r=r[t])||null==(r=r.values)||r.forEach(t=>{if(null!=t&&t.name){var r=i.get(t.name)||[];r.push(e.id),i.set(t.name,r)}})}),i}Fs(e,t,i){var r=(i===sE.Activation?this.Rs:this.Ps).get(e),s=[];return this.Ns(e=>{s=e.filter(e=>null==r?void 0:r.includes(e.id))}),s.filter(r=>{var s,n=null==(s=r.conditions)||null==(s=s[i])||null==(s=s.values)?void 0:s.find(t=>t.name===e);return this.Ls(n,t)})}register(e){var t;G(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.Ds(e),this.$s(e))}$s(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.qs&&(this.qs=new oy(this._instance),this.qs.init(),this.qs.Ss(e=>{this.onAction(e)})),t.forEach(e=>{var t,i,r,s,n;e.conditions&&null!=(t=e.conditions)&&t.actions&&null!=(i=e.conditions)&&null!=(i=i.actions)&&i.values&&(null==(r=e.conditions)||null==(r=r.actions)||null==(r=r.values)?void 0:r.length)>0&&(null==(s=this.qs)||s.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.Os.get(t.name);i&&i.push(e.id),this.Os.set(t.name,i||[e.id])}}))}))}Ds(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}),r=e.filter(e=>{var t,i;return(null==(t=e.conditions)?void 0:t.cancelEvents)&&(null==(i=e.conditions)||null==(i=i.cancelEvents)||null==(i=i.values)?void 0:i.length)>0});0===i.length&&0===r.length||(null==(t=this._instance)||t._addCaptureHook((e,t)=>{this.onEvent(e,t)}),this.Rs=this.As(e,sE.Activation),this.Ps=this.As(e,sE.Cancellation))}onEvent(e,t){var i,r,s=this.ce(),n=(null==t||null==(i=t.properties)?void 0:i.$survey_id)||(null==t||null==(r=t.properties)?void 0:r.$product_tour_id);if(n&&this.getActivatedIds().includes(n)){var o=this.js(e,n);if("consume"===o)return s.info("event consumed activated item, removing it",{event:e,itemId:n}),void this.Bs([n]);if("persist"===o)return s.info("shown item promoted to persisted activation",{event:e,itemId:n}),void this.Hs(n)}if(this.Ps.has(e)){var a=this.Fs(e,t,sE.Cancellation);a.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:a.map(e=>e.id)}),this.Bs(a.map(e=>e.id)),a.forEach(e=>this.Us(e.id)))}if(this.Rs.has(e)){s.info("event name matched",{event:e,eventPayload:t,items:this.Rs.get(e)});var l=this.Fs(e,t,sE.Activation);this.zs(l.map(e=>e.id))}}onAction(e){this.Os.has(e)&&this.zs(this.Os.get(e)||[])}zs(e){0!==e.length&&(this.Ms=[...new Set([...this.Ms,...e])],this.ce().info("updating activated items",{activatedItems:this.getActivatedIds()}))}Hs(e){this.Ms=this.Ms.filter(t=>t!==e);var t=this.Vs();t.includes(e)||this.Ws([...t,e])}Bs(e){var t=new Set(e);this.Ms=this.Ms.filter(e=>!t.has(e));var i=this.Vs(),r=i.filter(e=>!t.has(e));r.length!==i.length&&this.Ws(r)}Vs(){var e,t=this.Gs();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getActivatedIds(){return[...new Set([...this.Vs(),...this.Ms])].filter(e=>!this.Zs(e))}reset(){this.Ms=[],this.Vs().length>0&&this.Ws([])}getEventToItemsMap(){return this.Rs}Qs(){return this.qs}}class ow extends ob{constructor(e){super(e)}Gs(){return ib}Js(){return sI.SHOWN}Ns(e){var t;null==(t=this._instance)||t.getSurveys(e)}Us(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}ce(){return nU}Ws(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[ib]:e})}Zs(){return!1}js(e,t){var i,r,s,n,o,a;return this.Ns(e=>{a=e.find(e=>e.id===t)}),!a||(o=(null!==(r=null==(s=(i=a).conditions)||null==(s=s.events)||null==(s=s.values)?void 0:s.length)&&void 0!==r?r:0)>0,i.schedule===sR.Always||null!=(n=i.conditions)&&null!=(n=n.events)&&n.repeatedActivation&&o)?e===sI.SHOWN?"consume":"ignore":e===sI.SHOWN?"persist":e===sI.DISMISSED||e===sI.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}
1getEventToSurveys(){return this.getEventToItemsMap()}}var oE="SDK is not enabled or survey functionality is not yet loaded",ox="Disabled. Not loading surveys.",oS=null!=s&&s.location?sr(s.location.hash,"__posthog")||sr(location.hash,"state"):null,ok="_postHogToolbarParams",oP=tW("[Toolbar]"),oT=tW("[FeatureFlags]"),oF=tW("[FeatureFlags]",{debugEnabled:!0}),oR="\" failed. Feature flags didn't load in time.",oI=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},o$=e=>{var t={};for(var[i,r]of iZ(e||{}))r&&(t[i]=r);return t},oO=tW("[Error tracking]"),oD="Refusing to render web experiment since the viewer is a likely bot",oC={icontains:(e,t)=>!!s&&t.href.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>!!s&&-1===t.href.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>!!s&&nI(t.href,e),not_regex:(e,t)=>!!s&&!nI(t.href,e),exact:(e,t)=>t.href===e,is_not:(e,t)=>t.href!==e};class oM{get Dt(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{oM.Ks("retrieved web experiments from the server"),t.Ys=new Map,e.forEach(e=>{if(e.feature_flag_key){t.Ys&&(oM.Ks("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.Ys)||i.set(e.feature_flag_key,e));var i,r=t._instance.getFeatureFlag(e.feature_flag_key);Y(r)&&e.variants[r]&&t.Xs(e.name,r,e.variants[r].transforms)}else if(e.variants)for(var s in e.variants){var n=e.variants[s];oM.eo(n)&&t.Xs(e.name,s,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())oM.Ks(oD);else if(!this.Dt.disable_web_experiments){if(X(this.Ys))return this.Ys=new Map,this.loadIfEnabled(),void this.previewWebExperiment();oM.Ks("applying feature flags",e),e.forEach(e=>{var t;if(this.Ys&&null!=(t=this.Ys)&&t.has(e)){var i,r=this._instance.getFeatureFlag(e),s=null==(i=this.Ys)?void 0:i.get(e);r&&null!=s&&s.variants[r]&&this.Xs(s.name,r,s.variants[r].transforms)}})}}previewWebExperiment(){var e=oM.getWindowLocation();if(null!=e&&e.search){var t=st(null==e?void 0:e.search,"__experiment_id"),i=st(null==e?void 0:e.search,"__experiment_variant");t&&i&&(oM.Ks("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.ro(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.Dt.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.Dt.disable_web_experiments&&!i)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this.Dt.token),method:"GET",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}ro(e,t,i){var r=i.filter(t=>t.id===e);r&&r.length>0&&(oM.Ks("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.Xs(r[0].name,t,r[0].variants[t].transforms))}static eo(e){return!X(e.conditions)&&oM.io(e)&&oM.no(e)}static io(e){if(X(e.conditions)||X(null==(t=e.conditions)?void 0:t.url))return!0;var t,i,r,s,n=oM.getWindowLocation();return!!n&&(null==(i=e.conditions)||!i.url||oC[null!==(r=null==(s=e.conditions)?void 0:s.urlMatchType)&&void 0!==r?r:"icontains"](e.conditions.url,n))}
1static getWindowLocation(){return null==s?void 0:s.location}static no(e){if(X(e.conditions)||X(null==(i=e.conditions)?void 0:i.utm))return!0;var t=su();if(t.utm_source){var i,r,s,n,o,a,l,u,c,h=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_campaign)==t.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(o=e.conditions)||null==(o=o.utm)?void 0:o.utm_source)==t.utm_source,p=null==(a=e.conditions)||null==(a=a.utm)||!a.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==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_term)==t.utm_term;return h&&p&&v&&d}return!1}static Ks(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];tV.info("[WebExperiments] "+e,i)}Xs(e,t,i){this._is_bot()?oM.Ks(oD):"control"!==t?i.forEach(i=>{if(i.selector){oM.Ks("applying transform of variant "+t+" for experiment "+e+" ",i);var r,s=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==s||s.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):oM.Ks("Control variants leave the page unmodified.")}_is_bot(){return o&&this._instance?nR(o,this.Dt.custom_blocked_useragents):void 0}}var oA=tW("[Conversations]"),oL="Conversations not available yet.",oN={featureFlags:class{constructor(e){this.so=!1,this.oo=!1,this.ao=!1,this.lo=!1,this.uo=!1,this.ho=!1,this.co=!1,this.do=!1,this._instance=e,this.featureFlagEventHandlers=[]}get Dt(){return this._instance.config}get Ki(){return this._instance.persistence}vo(e){return this._instance.get_property(e)}fo(){var e,t;return null!==(e=null==(t=this.Ki)?void 0:t.ii(this.Dt.feature_flag_cache_ttl_ms))&&void 0!==e&&e}po(){return!!this.fo()&&(this.do||this.ao||(this.do=!0,oT.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}mo(){var e,t=null!==(e=this.Dt.evaluation_contexts)&&void 0!==e?e:this.Dt.evaluation_environments;return!this.Dt.evaluation_environments||this.Dt.evaluation_contexts||this.co||(oT.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.co=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||oT.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}yo(){return this.mo().length>0}bo(){var e=this.Dt.flag_keys;if(!G(e)){if(z(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||oT.error("Invalid flag key found:",e,"Expected non-empty string"),t});oT.error("Invalid flag_keys found:",e,"Expected array of non-empty strings")}}initialize(){var e,t,{config:i}=this._instance,r=null!==(e=null==(t=i.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(r).length){var s,n,o=null!==(s=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)&&void 0!==s?s:{},a=Object.keys(r).filter(e=>!!r[e]).reduce((e,t)=>(e[t]=r[t]||!1,e),{}),l=Object.keys(o).filter(e=>a[e]).reduce((e,t)=>(o[t]&&(e[t]=o[t]),e),{});this.receivedFeatureFlags({featureFlags:a,featureFlagPayloads:l})}}updateFlags(e,t,i){var r,s,n=null!=i&&i.merge&&null!==(r=this.vo(ia))&&void 0!==r?r:{},o=null!=i&&i.merge&&null!==(s=this.vo(ih))&&void 0!==s?s:{},a=y({},n,e),l=y({},o,t),u={};for(var[c,h]of Object.entries(a))u[c]={key:c,enabled:"string"==typeof h||h,variant:"string"==typeof h?h:void 0,reason:void 0,metadata:G(null==l?void 0:l[c])?void 0:{id:0,version:void 0,description:void 0,payload:l[c]}};this.receivedFeatureFlags({flags:u})}get hasLoadedFlags(){return this.oo}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.vo(ic),t=this.vo(ip),i=this.vo(iv);if(!i&&!t)return e||{};var r=iX({},e||{});for(var s of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,o,a=r[s],l=null==t?void 0:t[s],u=G(l)?null!==(n=null==a?void 0:a.enabled)&&void 0!==n&&n:!!l,c=G(l)?a.variant:"string"==typeof l?l:void 0,h=null==i?void 0:i[s],d=y({},a,{enabled:u,variant:u?null!=c?c:null==a?void 0:a.variant:void 0});u!==(null==a?void 0:a.enabled)&&(d.original_enabled=null==a?void 0:a.enabled),c!==(null==a?void 0:a.variant)&&(
1d.original_variant=null==a?void 0:a.variant),h&&(d.metadata=y({},null==a?void 0:a.metadata,{payload:h,original_payload:null==a||null==(o=a.metadata)?void 0:o.payload})),r[s]=d}return this.so||(oT.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.so=!0),r}getFlagVariants(){var e=this.vo(ia),t=this.vo(ip);if(!t)return e||{};for(var i=iX({},e),r=Object.keys(t),s=0;r.length>s;s++)i[r[s]]=t[r[s]];return this.so||(oT.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.so=!0),i}getFlagPayloads(){var e=this.vo(ih),t=this.vo(iv);if(!t)return e||{};for(var i=iX({},e||{}),r=Object.keys(t),s=0;r.length>s;s++)i[r[s]]=t[r[s]];return this.so||(oT.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.so=!0),i}reloadFeatureFlags(){this.lo||this.Dt.advanced_disable_feature_flags||this._o||(this._instance.Fn.emit("featureFlagsReloading",!0),this._o=setTimeout(()=>{this.wo()},5))}xo(){clearTimeout(this._o),this._o=void 0}ensureFlagsLoaded(){this.oo||this.ao||this._o||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.lo=e}wo(e){var t;if(this.xo(),!this._instance.Ii()){if(this.ao)this.uo=!0;else{var i=this.Dt.token,r=this.vo(tQ),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:y({},(null==(t=this.Ki)?void 0:t.get_initial_props())||{},this.vo(ig)||{}),group_properties:this.vo(i_),timezone:sf()};J(r)||G(r)||(s.$device_id=r),(null!=e&&e.disableFlags||this.Dt.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.yo()&&(s.evaluation_contexts=this.mo());var n=this.bo();G(n)||(s.flag_keys=n);var o=!!this.Dt.advanced_only_evaluate_survey_feature_flags,a=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Dt.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.ao=!0,this._instance._send_request({method:"POST",url:a,data:s,compression:this.Dt.disable_compression?void 0:sj.Base64,timeout:this.Dt.feature_flag_request_timeout_ms,callback:e=>{var t,i,r,n=!0;if(200===e.statusCode&&(this.uo||(this.$anon_distinct_id=void 0),n=!1),this.ao=!1,!s.disable_flags||this.uo){this.ho=!n;var a=[];e.error?e.error instanceof Error?a.push("AbortError"===e.error.name?"timeout":"connection_error"):a.push("unknown_error"):200!==e.statusCode&&a.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&a.push("errors_while_computing_flags");var l,u=!(null==(i=e.json)||null==(i=i.quotaLimited)||!i.includes("feature_flags"));(u&&a.push("quota_limited"),null==(r=this.Ki)||r.register({[iS]:a}),u)?oT.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."):(s.disable_flags||this.receivedFeatureFlags(null!==(l=e.json)&&void 0!==l?l:{},n,{partialResponse:o}),this.uo&&(this.uo=!1,this.wo()))}}})}}}getFeatureFlag(e,t){var i;if(void 0===t&&(t={}),!t.fresh||this.ho){if(this.oo||this.getFlags()&&this.getFlags().length>0){if(!this.po()){var r=this.getFeatureFlagResult(e,t);return null!==(i=null==r?void 0:r.variant)&&void 0!==i?i:null==r?void 0:r.enabled}}else oT.warn('getFeatureFlag for key "'+e+oR)}}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.ho){if(this.oo||this.getFlags()&&this.getFlags().length>0){if(!this.po()){var i=this.getFlagVariants(),r=e in i,s=i[e],n=this.getFlagPayloads()[e],o=String(s),a=this.vo(id)||void 0,l=this.vo(ik)||void 0,u=this.vo(iE)||{};if(this.Dt.advanced_feature_flags_dedup_per_session){var c,h=this._instance.get_session_id(),d=this.vo(ix);h&&h!==d&&(u={},null==(c=this.Ki)||c.register({[iE]:u,[ix]:h}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(o))){z(u[e])?u[e].push(o):u[e]=[o],null==(_=this.Ki)||_.register({[iE]:u});var p=this.getFeatureFlagDetails(e),v=[...null!==(f=this.vo(iS))&&void 0!==f?f:[]];G(s)&&v.push("flag_missing");var g={$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:n||null,$feature_flag_request_id:a,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(m=this.Dt.bootstrap)||null==(m
1=m.featureFlags)?void 0:m[e])||null,$feature_flag_bootstrapped_payload:(null==(y=this.Dt.bootstrap)||null==(y=y.featureFlagPayloads)?void 0:y[e])||null,$used_bootstrap_value:!this.ho};G(null==p||null==(b=p.metadata)?void 0:b.version)||(g.$feature_flag_version=p.metadata.version);var _,f,m,y,b,w,E,x,S,P,T,F=null!==(w=null==p||null==(E=p.reason)?void 0:E.description)&&void 0!==w?w:null==p||null==(x=p.reason)?void 0:x.code;F&&(g.$feature_flag_reason=F),null!=p&&null!=(S=p.metadata)&&S.id&&(g.$feature_flag_id=p.metadata.id),G(null==p?void 0:p.original_variant)&&G(null==p?void 0:p.original_enabled)||(g.$feature_flag_original_response=G(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==(T=p.metadata)?void 0:T.original_payload),v.length&&(g.$feature_flag_error=v.join(",")),this._instance.capture("$feature_flag_called",g)}if(r)return{key:e,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:k(n)}}}else oT.warn('getFeatureFlagResult for key "'+e+oR)}}getRemoteConfigPayload(e,t){var i=this.Dt.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.yo()&&(r.evaluation_contexts=this.mo());var s=this.bo();G(s)||(r.flag_keys=s),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Dt.disable_compression?void 0:sj.Base64,timeout:this.Dt.feature_flag_request_timeout_ms,callback(i){var r,s=null==(r=i.json)?void 0:r.featureFlagPayloads;t((null==s?void 0:s[e])||void 0)}})}isFeatureEnabled(e,t){if(void 0===t&&(t={}),!t.fresh||this.ho){if(this.oo||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return G(i)?void 0:!!i}oT.warn('isFeatureEnabled for key "'+e+oR)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){if(this.Ki){this.oo=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),n=this.getFlagsWithDetails();!function(e,t,i,r,s,n){void 0===i&&(i={}),void 0===r&&(r={}),void 0===s&&(s={});var o,a=((o=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(o).map(e=>{var t;return[e,null!==(t=o[e].variant)&&void 0!==t?t:o[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(o).filter(e=>o[e].enabled).filter(e=>{var t;return null==(t=o[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=o[e].metadata)?void 0:t.payload]}))):oT.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),l=a.flags,u=a.featureFlags,c=a.featureFlagPayloads;if(u){var h=e.requestId,d=e.evaluatedAt;if(z(u)){oT.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({[il]:u,[ia]:p})}else{var g=u,_=c,f=l;if(null!=n&&n.partialResponse)g=y({},i,g),_=y({},r,_),f=y({},s,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=y({},i,Object.fromEntries(Object.entries(g).filter(e=>{var[t]=e;return m.has(t)}))),_=y({},r,Object.fromEntries(Object.entries(_||{}).filter(e=>{var[t]=e;return m.has(t)}))),f=y({},s,Object.fromEntries(Object.entries(f||{}).filter(e=>{var[t]=e;return m.has(t)})))}else g=y({},i,g),_=y({},r,_),f=y({},s,f)}t&&t.register(y({[il]:Object.keys(o$(g)),[ia]:g||{},[ih]:_||{},[ic]:f||{}},h?{[id]:h}:{},d?{[ik]:d}:{}))}}}(e,this.Ki,r,s,n,i),t||(this.do=!1),this.ko(t)}}override(e,t){void 0===t&&(t=!1),oT.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.Ki)return oT.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.Ki.unregister(ip),this.Ki.unregister(iv),this.ko(),oF.info("All overrides cleared");if(z(e)){var t,i=oI(e);return this.Ki.register({[ip]:i}),this.ko(),oF.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){if(this.so=!!(null!==(t=e.suppressWarning)&&void 0!==t&&t),"flags"in e){if(!1===e.flags)this.Ki.unregister(ip),oF.info("Flag overrides cleared");else if(e.flags){if(z(e.flags)){var r=oI(e.flags);this.Ki.register({[ip]:r})}else this.Ki.register({[ip]:e.flags});oF.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this.Ki.unregister(iv),oF.info("Payload overrides cleared")):e.payloads&&(this.Ki.register({[iv]:e.payloads}),oF.info("Payload overrides set",{payloads:e.payloads}))),void this.ko()}if(e&&"object"==typeof e)return this.Ki.register({[ip]:e}),this.ko(),oF.info("Flag overrides set",{flags:e});oT.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.oo){var{flags:t,flagVariants:i}=this.So();e(t,i)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var r,s=(this.vo(iu)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},o={$feature_flag:e,$feature_enrollment:t,$set:n};s&&(o.$early_access_feature_name=s.name),i&&(o.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",o),this.setPersonPropertiesForFlags(n,!1);var a=y({},this.getFlagVariants(),{[e]:t});null==(r=this.Ki)||r.register({[il]:Object.keys(o$(a)),[ia]:a}),this.ko()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var r=this.vo(iu),s=i?"&"+i.map(e=>"stage="+e).join("&"):"";if(r&&!t)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this.Dt.token+s),method:"GET",callback:t=>{var i,r;if(t.json){var s=t.json.earlyAccessFeatures;return null==(i=this.Ki)||i.unregister(iu),null==(r=this.Ki)||r.register({[iu]:s}),e(s)}}})}So(){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),{})}}ko(e){var{flags:t,flagVariants:i}=this.So();
1this.featureFlagEventHandlers.forEach(r=>r(t,i,{errorsLoading:e}))}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.vo(ig)||{},r=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),s=null==e?void 0:e.$set_once,n={};if(s)for(var o in s)({}).hasOwnProperty.call(s,o)&&(o in i||(n[o]=s[o]));this._instance.register({[ig]:y({},i,n,r)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=y({},this.vo(ig)||{});e.forEach(e=>{delete i[e]}),this._instance.register({[ig]:i}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this._instance.unregister(ig),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.vo(i_)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=y({},i[t],e[t]),delete e[t]}),this._instance.register({[i_]:y({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.vo(i_)||{};this._instance.register({[i_]:y({},t,{[e]:{}})})}else this._instance.unregister(i_)}reset(){this.oo=!1,this.ao=!1,this.lo=!1,this.uo=!1,this.ho=!1,this.$anon_distinct_id=void 0,this.xo(),this.so=!1}}},oU=y({productTours:class{get Ki(){return this._instance.persistence}constructor(e){this.Aa=null,this.Fa=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if("productTours"in e){var t,i;if(this.Ki&&this.Ki.register({[t6]:!!e.productTours}),!ov(this._instance))return!this.Aa&&X(null==(t=this.Ki)?void 0:t.props[iw])||op.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.Aa)||i.stop(),this.Aa=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Aa&&ov(this._instance)&&this.qr(()=>this.Na())}qr(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?op.error("Could not load product tours script",t):e()})}Na(){var e;!this.Aa&&null!=(e=v.__PosthogExtensions__)&&e.generateProductTours&&(this.Aa=v.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!z(this.Fa)||t){var i=this.Ki;if(i){var r=i.props[iw];if(z(r)&&!t)return this.Fa=r,void e(r,{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(ov(this._instance)){var r=t.statusCode;if(200!==r||!t.json){var s="Product Tours API could not be loaded, status: "+r;return op.error(s),void e([],{isLoaded:!1,error:s})}var n=z(t.json.product_tours)?t.json.product_tours:[];this.Fa=n,i&&i.register({[iw]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Fa,{isLoaded:!0})}getActiveProductTours(e){X(this.Aa)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Aa.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.Aa)||t.showTourById(e)}previewTour(e){this.Aa?this.Aa.previewTour(e):this.qr(()=>{var t;this.Na(),null==(t=this.Aa)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.Aa)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.Aa)||e.nextStep()}previousStep(){var e;null==(e=this.Aa)||e.previousStep()}clearCache(){var e;this.Fa=null,null==(e=this.Ki)||e.unregister(iw)}resetTour(e){var t;null==(t=this.Aa)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.Aa)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.Aa)||t.cancelPendingTour(e)}}},oN),oq=y({surveys:class{get Dt(){return this._instance.config}constructor(e){this.Xa=void 0,this._surveyManager=null,this.el=!1,this.tl=[],this.rl=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Dt.disable_surveys){var t=e.surveys;if(X(t))return nU.warn("Flags not loaded yet. Not loading surveys.");var i=z(t);this.Xa=i?t.length>0:t,nU.info("flags response received, isSurveysEnabled: "+this.Xa),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 r=localStorage.key(i);(null!=r&&r.startsWith(nq)||null!=r&&r.startsWith("inProgressSurvey_"))&&t.push(r)}
1t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this._surveyManager){if(this.el)nU.info("Already initializing surveys, skipping...");else if(this.Dt.disable_surveys)nU.info(ox);else if(this.Dt.cookieless_mode&&this._instance.consent.isOptedOut())nU.info("Not loading surveys in cookieless mode without consent.");else{var e=null==v?void 0:v.__PosthogExtensions__;if(e){if(!G(this.Xa)||this.Dt.advanced_enable_surveys){var t=this.Xa||this.Dt.advanced_enable_surveys;this.el=!0;try{var i=e.generateSurveys;if(i)return void this.il(i,t);var r=e.loadExternalDependency;if(!r)return void this.nl(iN);r(this._instance,"surveys",i=>{i||!e.generateSurveys?this.nl("Could not load surveys script",i):this.il(e.generateSurveys,t)})}catch(e){throw this.nl("Error initializing surveys",e),e}finally{this.el=!1}}}else nU.error("PostHog Extensions not found.")}}}il(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new ow(this._instance),nU.info("Surveys loaded successfully"),this.sl({isLoaded:!0})}nl(e,t){nU.error(e,t),this.sl({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.tl.push(e),this._surveyManager&&this.sl({isLoaded:!0}),()=>{this.tl=this.tl.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Dt.disable_surveys)return nU.info(ox),e([]);var i,r=this._instance.get_property(im);if(r&&!t)return e(r,{isLoaded:!0});"undefined"!=typeof Promise&&this.rl?this.rl.then(t=>{var{surveys:i,context:r}=t;return e(i,r)}):("undefined"!=typeof Promise&&(this.rl=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Dt.token),method:"GET",timeout:this.Dt.surveys_request_timeout_ms,callback:t=>{this.rl=null;var r=t.statusCode;if(200!==r||!t.json){var s="Surveys API could not be loaded, status: "+r;nU.error(s);var n={isLoaded:!1,error:s};return e([],n),void(null==i||i({surveys:[],context:n}))}var o,a,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==(a=this._surveyEventReceiver)||a.register(u)),null==(o=this._instance.persistence)||o.register({[im]:l,[iy]:Date.now()});var c={isLoaded:!0};e(l,c),null==i||i({surveys:l,context:c})}}))}sl(e){for(var t of this.tl)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){nU.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!X(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);nU.warn("init was not called")}ol(e){var t=null;return this.getSurveys(i=>{var r;t=null!==(r=i.find(t=>t.id===e))&&void 0!==r?r:null}),t}al(e){if(X(this._surveyManager))return{eligible:!1,reason:oE};var t="string"==typeof e?this.ol(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(X(this._surveyManager))return nU.warn("init was not called"),{visible:!1,disabledReason:oE};var t=this.al(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return X(this._surveyManager)?(nU.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:oE})):new Promise(i=>{this.getSurveys(t=>{var r,s=null!==(r=t.find(t=>t.id===e))&&void 0!==r?r:null;if(s){var n=this.al(s);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var r;if(X(this._surveyManager))nU.warn("init was not called");else{var s="string"==typeof e?this.ol(e):e;if(null!=s&&s.id){if(nj.includes(s.type)){var n=null==a?void 0:a.querySelector(t);if(n)return null!=(r=s.appearance)&&r.surveyPopupDelaySeconds?(nU.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;nU.info("Rendering survey "+s.id+" with delay of "+(null==(e=s.appearance)?void 0:e.surveyPopupDelaySeconds)+" seconds"),null==(t=this._surveyManager)||t.renderSurvey(s,n,i),nU.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,n,i);nU.warn("Survey element not found")}else nU.warn("Surveys of type "+s.type+" cannot be rendered in the app")}else nU.warn("Survey not found")}}displaySurvey(e,t){var i;if(X(this._surveyManager))nU.warn("init was not called");else{var r=this.ol(e);if(r){var s=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=y({},r,{appearance:y({},r.appearance,{surveyPopupDelaySeconds:0})}
1)),t.displayType!==sO.Popover&&t.initialResponses&&nU.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.canRenderSurvey(r);if(!n.visible)return void nU.warn("Survey is not eligible to be displayed: ",n.disabledReason)}t.displayType!==sO.Inline?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else nU.warn("Survey not found")}}cancelPendingSurvey(e){X(this._surveyManager)?nU.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}},oN),oj=y({experiments:oM},oN),oH=y({},oN,{sessionRecording:class{get Dt(){return this._instance.config}get Ki(){return this._instance.persistence}get started(){var e;return!(null==(e=this.Co)||!e.isStarted)}get status(){var e,t;return this.Io===oa||this.Io===ol?this.Io:null!==(e=null==(t=this.Co)?void 0:t.status)&&void 0!==e?e:this.Io}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.Io=on,this.To=void 0,this._instance=e,!this._instance.sessionManager)throw oc.error("started without valid sessionManager"),Error(ou+" started without valid sessionManager. This is a bug.");if(this.Dt.cookieless_mode===iq)throw Error(ou+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Eo(){var e,t=!(null==(e=this._instance.get_property(t7))||!e.enabled),i=!this.Dt.disable_session_recording,r=this.Dt.disable_session_recording||this._instance.consent.isOptedOut();return s&&t&&i&&!r}startIfEnabledOrStop(e){var t;if(!this.Eo||null==(t=this.Co)||!t.isStarted){var i=!G(Object.assign)&&!G(Array.from);this.Eo&&i?(this.Mo(e),oc.info("starting")):(this.Io=on,this.stopRecording())}}Mo(e){var t,i,r;this.Eo&&(this.Io!==oa&&this.Io!==ol&&(this.Io=oo),null!=v&&null!=(t=v.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=v.__PosthogExtensions__)&&i.initSessionRecording?this.Ro(e):null==(r=v.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.Po,t=>{if(t)return oc.error("could not load recorder",t);this.Ro(e)}))}stopRecording(){var e,t;null==(e=this.To)||e.call(this),this.To=void 0,null==(t=this.Co)||t.stop()}Oo(){var e,t;null==(e=this.To)||e.call(this),this.To=void 0,null==(t=this.Co)||t.discard()}Lo(){var e,t;null==(e=this.Ki)||e.unregister(io),null==(t=this.Ki)||t.unregister(t9)}Ao(e,t){if(X(e))return null;var i=Z(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(oc.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}Fo(e){if(this.Ki){var t,i,r=this.Ki,s=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,s=this.Ao(null==(t=this.Dt.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.Ao(null==i?void 0:i.sampleRate,"remote config sampleRate"),o=null!=s?s:n;X(o)&&this.Lo();var a=null==i?void 0:i.minimumDurationMilliseconds;r.register({[t7]:y({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:y({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:o,minimumDurationMilliseconds:G(a)?null:a,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})})};s(),null==(t=this.To)||t.call(this),this.To=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this.Fo(e),void this.Oo()):(this.Fo(e),void this.startIfEnabledOrStop()):(this.Io===oa&&(this.Io=ol,oc.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.Co)&&i.log?this.Co.log(e,t):oc.warn("log called before recorder was ready")}get Po(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(t7);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}No(){var e,t,i=this._instance.get_property(t7);if(!i)return!1;try{t="object"==typeof i?i:JSON.parse(i)}catch(e){return oc.warn("persisted remote config for session recording is invali
1d and will be ignored",e),!1}var r=null!==(e=t.cache_timestamp)&&void 0!==e?e:Date.now();return 36e5>=Date.now()-r}Ro(e){var t,i;if(null==(t=v.__PosthogExtensions__)||!t.initSessionRecording)return oc.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[iL]:!0});if(this.Co||(this.Co=null==(i=v.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.Co._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.No()){if(this.Io===ol||this.Io===oa)return;return this.Io=oa,oc.info("persisted remote config is stale, requesting fresh config before starting"),void new sU(this._instance).load()}this.Io=oo,this.Co.start(e)}onRRwebEmit(e){var t;null==(t=this.Co)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.Co||null==(t=this.Ki)||t.register({[it]:!0}),null==(e=this.Co)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.Co||null==(t=this.Ki)||t.register({[ie]:!0}),null==(e=this.Co)||e.overrideSampling()}overrideTrigger(e){var t,i;this.Co||null==(i=this.Ki)||i.register({["url"===e?ii:ir]:!0}),null==(t=this.Co)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.Co)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.Co)||!i.tryAddCustomEvent(e,t))}}},{autocapture:class{constructor(e){this.Do=!1,this.$o=null,this.qo=!1,this.instance=e,this.rageclicks=new n7(e.config.rageclick),this.jo=null}initialize(){this.startIfEnabled()}get Dt(){var e,t,i=W(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}Bo(){if(this.isBrowserSupported()){if(s&&a){var e=e=>{e=e||(null==s?void 0:s.event);try{this.Ho(e)}catch(e){oe.error("Failed to capture event",e)}};if(i5(a,"submit",e,{capture:!0}),i5(a,"change",e,{capture:!0}),i5(a,"click",e,{capture:!0}),this.Dt.capture_copied_text){var t=e=>{e=e||(null==s?void 0:s.event);try{this.Ho(e,n9)}catch(e){oe.error("Failed to capture copy/cut event",e)}};i5(a,"copy",t,{capture:!0}),i5(a,"cut",t,{capture:!0})}}}else oe.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Do&&(this.Bo(),this.Do=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.qo=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[tZ]:!!e.autocapture_opt_out}),this.$o=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.jo=e}getElementSelectors(e){var t,i=[];return null==(t=this.jo)||t.forEach(t=>{var r=null==a?void 0:a.querySelectorAll(t);null==r||r.forEach(r=>{e===r&&i.push(t)})}),i}get isEnabled(){var e,t,i=null==(e=this.instance.persistence)?void 0:e.props[tZ];if(J(this.$o)&&!et(i)&&!this.instance.Ii())return!1;var r=null!==(t=this.$o)&&void 0!==t?t:!!i;return!!this.instance.config.autocapture&&!r}Ho(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,r=rT(e);rb(r)&&(r=r.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())&&rL(r,this.instance.config.rageclick)&&this.Ho(e,"$rageclick");var n=t===n9;if(r&&function(e,t,i,r,n){if(void 0===i&&(i=void 0),!s||rN(e)||null!=(o=i)&&o.url_allowlist&&!rx(i.url_allowlist)||null!=(a=i)&&a.url_ignorelist&&rx(i.url_ignorelist))return!1;if(null!=(l=i)&&l.dom_event_allowlist){var o,a,l,u,c,h,d=i.dom_event_allowlist;if(d&&!d.some(e=>t.type===e))return!1}var{parentIsUsefulElement:p,targetElementList:v}=rU(e,r);if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(G(i))return!0;var r,s=function(e){if(i.some(t=>e.tagName.toLowerCase()===t))return{v:!0}};for(var n of e)if(r=s(n))return r.v;return!1}(v,i)||!rR(v,null==(u=i)?void 0:u.css_selector_allowlist)||rR(v,null!==(c=null==(h=i)?void 0:h.css_selector_ignorelist)&&void 0!==c?c:r$))return!1;var g=s.getComputedStyle(e);
1if(g&&"pointer"===g.getPropertyValue("cursor")&&"click"===t.type)return!0;var _=e.tagName.toLowerCase();switch(_){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 p?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(rF.indexOf(_)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.Dt,n,n?["copy","cut"]:void 0)){var{props:o,explicitNoCapture:a}=function(e,t){var i,r,{e:n,maskAllElementAttributes:o,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:u}=t;if(!rm(e))return{props:{}};for(var c=[e],h=e;h.parentNode&&!ry(h,"body");)if(rw(h.parentNode))c.push(h.parentNode.host),h=h.parentNode.host;else{if(!rm(h.parentNode))break;c.push(h.parentNode),h=h.parentNode}var d,p=[],v={},g=!1,_=!1;if(iJ(c,e=>{var t=rq(e);if(ry(e,"a")){var i=e.getAttribute("href");g=t&&!!i&&rG(i)&&i}N(rS(e),"ph-no-capture")&&(_=!0),p.push(function(e,t,i,r){var s=e.tagName.toLowerCase(),n={tag_name:s};rF.indexOf(s)>-1&&!i&&(n.$el_text="a"===s.toLowerCase()||"button"===s.toLowerCase()?ot(1024,rY(e)):ot(1024,rP(e)));var o=rS(e);o.length>0&&(n.classes=o.filter(function(e){return""!==e})),iJ(e.attributes,function(i){var s;if((!rj(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!t&&rG(i.value)&&(!Y(s=i.name)||"_ngcontent"!==s.substring(0,10)&&"_nghost"!==s.substring(0,7))){var o=i.value;"class"===i.name&&(o=rE(o).join(" ")),n["attr__"+i.name]=ot(1024,o)}});for(var a=1,l=1,u=e;u=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!rm(t));return t}(u);)a++,u.tagName===e.tagName&&l++;return n.nth_child=a,n.nth_of_type=l,n}(e,o,a,l)),iX(v,function(e){if(!rq(e))return{};var t={};return iJ(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),r=e.value;i&&r&&rG(r)&&(t[i]=r)}}),t}(e))}),_)return{props:{},explicitNoCapture:_};if(a||(p[0].$el_text=ry(e,"a")||ry(e,"button")?rY(e):rP(e)),g){p[0].attr__href=g;var f,m,b=null==(f=se(g))?void 0:f.host,w=null==s||null==(m=s.location)?void 0:m.host;b&&w&&b!==w&&(d=g)}return{props:iX({$event_type:n.type,$ce_version:1},u?{}:{$elements:p},{$elements_chain:p.map(e=>{var t,i,r,s={text:null==(i=e.$el_text)?void 0:i.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:(t=e.attr__class)?z(t)?t:rE(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return iZ(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return s.attributes[t]=i}),s}).map(e=>{var t,i,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))r+="."+s.replace(/"/g,"");var n=y({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),o={};return iZ(n).sort((e,t)=>{var[i]=e,[r]=t;return i.localeCompare(r)}).forEach(e=>{var[t,i]=e;return o[rQ(t.toString())]=rQ(i.toString())}),(r+=":")+iZ(o).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},null!=(i=p[0])&&i.$el_text?{$el_text:null==(r=p[0])?void 0:r.$el_text}:{},d&&"click"===n.type?{$external_click_url:d}:{},v)}}(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Dt.element_attribute_ignorelist,elementsChainAsString:this.qo});if(a)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(o.$element_selectors=l),t===n9){var u,c=rk(null==s||null==(u=s.getSelection())?void 0:u.toString()),h=e.type||"clipboard";if(!c)return!1;o.$selected_content=c,o.$copy_type=h}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return V(null==a?void 0:a.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Uo=(null==s||null==(t=s.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(tV.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.zo&&this.zo(),this.zo=void 0,tV.info("History API monitoring stopped")}monitorHistoryChanges(){s&&s.history&&(this.Vo("pushState"),this.Vo("replaceState"),this.Wo())}Vo(e){var t;if(s&&(null==(t=s.history[e])||!t.__posthog_wrapped__)){var i=this;!function(e,t,i){try{if(!(t in e))return()=>{};var r=e[t],s=i(r);V(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=s,()=>{e[t]===s&&(e[t]=r)}}catch(e){return()=>{}}}(s.history,e,t=>function(r,s,n){t.call(this,r,s,n),i.Go(e)})}}Go(e){try{var t,i=null==s||null==(t=s.location)?void 0:t.pathname;if(!i)return;i!==this.Uo&&this.isEnabled&&this._instance.capture(iW,{navigation_type:e}),this.Uo=i}catch(t){tV.error("Error capturing "+e+" pageview",t)}}Wo(){if(!this.zo){var e=()=>{this.Go("popstate")};i5(s,"popstate",e),this.zo=()=>{s&&s.removeEventListener("popstate",e)}}}},heatmaps:class{get Dt(){return this.instance.config}constructor(e){var t;this.Zo=!1,this.Do=!1,this.Qo=null,this.instance=e,this.Zo=!(null==(t=this.instance.persistence)||!t.props[t0]),this.rageclicks=new n7(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return W(this.Dt.capture_heatmaps)&&this.Dt.capture_heatmaps.flush_interval_milliseconds&&(e=this.Dt.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return X(this.Dt.capture_heatmaps)?X(this.Dt.enable_heatmaps)?this.Zo:this.Dt.enable_heatmaps:!1!==this.Dt.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.Do||(oh.info("starting..."),this.Jo(),this.Pt());else{var e;clearInterval(null!==(e=this.Qo)&&void 0!==e?e:void 0),this.Ko(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[t0]:t}),this.Zo=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Yo(e){this._t(e.originalEvent,"deadclick")}Pt(){this.Qo&&clearInterval(this.Qo),this.Qo="visible"===(null==a?void 0:a.visibilityState)?setInterval(this.ji.bind(this),this.flushIntervalMilliseconds):null}Jo(){s&&a&&(this.Xo=this.ji.bind(this),i5(s,iV,this.Xo),this.ea=e=>this._t(e||(null==s?void 0:s.event)),i5(a,"click",this.ea,{capture:!0}),this.ta=e=>this.ra(e||(null==s?void 0:s.event)),i5(a,"mousemove",this.ta,{capture:!0}),this.ia=new r0(this.instance,rX,this.Yo.bind(this)),this.ia.startIfEnabledOrStop(),this.na=this.Pt.bind(this),i5(a,iz,this.na),this.Do=!0)}Ko(){var e;s&&a&&(this.Xo&&s.removeEventListener(iV,this.Xo),this.ea&&a.removeEventListener("click",this.ea,{capture:!0}),this.ta&&a.removeEventListener("mousemove",this.ta,{capture:!0}),this.na&&a.removeEventListener(iz,this.na),clearTimeout(this.sa),null==(e=this.ia)||e.stop(),this.Do=!1)}oa(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),o=function(e,t,i){for(var r=e;r&&rm(r)&&!ry(r,"body")&&r!==i;){if(N(t,null==s?void 0:s.getComputedStyle(r).position))return!0;r=rI(r)}return!1}(rT(e),["fixed","sticky"],n);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:i),target_fixed:o,type:t}}_t(e,t){var i;if(void 0===t&&(t="click"),!rf(e.target)&&od(e)){var r=this.oa(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&rL(rT(e),this.instance.config.rageclick)&&this.aa(y({},r,{type:"rageclick"})),this.aa(r)}}ra(e){!rf(e.target)&&od(e)&&(clearTimeout(this.sa),this.sa=setTimeout(()=>{this.aa(this.oa(e,"mousemove"))},500))}aa(e){if(s){var t=s.location.href,i=this.Dt.custom_personal_data_properties,r=si(t,this.Dt.mask_personal_data_properties?[...sn,...i||[]]:[],sa);this.R=this.R||{},this.R[r]||(this.R[r]=[]),this.R[r].push(e)}}ji(){this.R&&!K(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:r0,webVitalsAutocapture:class{constructor(e){var t;this.Zo=!1,this.Do=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.la=()=>{clearTimeout(this.ua),0!==this.R.metrics.length&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((e,t)=>
1y({},e,{["$web_vitals_"+t.name+"_event"]:y({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.vt=e=>{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var t,i=this.ha();if(!G(i)){if(X(null==e?void 0:e.name)||X(null==e?void 0:e.value))os.error("Invalid metric received",e);else if(!this.ca||this.ca>e.value){this.R.url!==i&&(this.la(),this.ua=setTimeout(this.la,this.flushToCaptureTimeoutMs)),G(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=G(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var r=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),s=y({},e,{$current_url:i,timestamp:Date.now()});G(r)||(s.$session_id=r.sessionId,s.$window_id=r.windowId),this.R.metrics.push(s),this.R.metrics.length===this.allowedMetrics.length&&this.la()}else os.error("Ignoring metric with value >= "+this.ca,e)}},this.da=()=>{if(!this.Do){var e,t,i,r,s=v.__PosthogExtensions__;G(s)||G(s.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:r}=s.postHogWebVitalsCallbacks),e&&t&&i&&r?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.vt.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.vt.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.vt.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this.vt.bind(this)),this.Do=!0):os.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Zo=!(null==(t=this._instance.persistence)||!t.props[t5]),this.startIfEnabled()}get va(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=W(this.va)?null==(e=this.va)?void 0:e.web_vitals_allowed_metrics:void 0;return X(i)?(null==(t=this._instance.persistence)?void 0:t.props[t8])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(W(this.va)?this.va.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=W(this.va)?this.va.web_vitals_attribution:void 0;return null!=e&&e}get ca(){var e=W(this.va)&&Z(this.va.__web_vitals_max_value)?this.va.__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 os.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=W(this.va)?this.va.web_vitals:et(this.va)?this.va:void 0;return et(t)?t:this.Zo}startIfEnabled(){this.isEnabled&&!this.Do&&(os.info("enabled, starting..."),this.qr(this.da))}onRemoteConfig(e){if("capturePerformance"in e){var t=W(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=W(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[t5]:t}),this._instance.persistence.register({[t8]:i})),this.Zo=t,this.startIfEnabled()}}qr(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?os.error("failed to load script",t):e()})}ha(){var e=s?s.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return si(e,this._instance.config.mask_personal_data_properties?[...sn,...t||[]]:[],sa)}os.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t,i,r;this.da=()=>{var e;if(s&&this.isEnabled&&null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=v.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=v.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=v.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.fa&&this.Dt.capture_unhandled_errors&&(this.fa=t(this.captureException.bind(this))),!this.pa&&this.Dt.capture_unhandled_rejections&&(this.pa=i(this.captureException.bind(this))),!this.ga&&this.Dt.capture_console_errors&&(this.ga=r(this.captureException.bind(this)))}catch(e){oi.error("failed to start",e),this.ma()}}},this._instance=e,this.ya=!(null==(t=this._instance.persistence)||!t.props[t1]),this.ba=new ed({refillRate:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==i?i:1,bucketSize:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10,refillInterval:1e4,Qt:oi}),this.Dt=this._a(),this.startIfEnabledOrStop()}_a(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return W(e)?t=y({},t,e):(G(e)?this.ya:e)&&(t=y({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Dt.capture_console_errors||this.Dt.capture_unhandled_errors||this.Dt.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(oi.info("enabled"),this.ma(),this.qr(this.da)):this.ma()}qr(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 oi.error("failed to load script",t);e()})}ma(){var e,t,i;null==(e=this.fa)||e.call(this),this.fa=void 0,null==(t=this.pa)||t.call(this),this.pa=void 0,null==(i=this.ga)||i.call(this),this.ga=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.ya=!!e.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[t1]:this.ya}),this.Dt=this._a(),this.startIfEnabledOrStop())}onConfigChange(){this.Dt=this._a()}captureException(e){var t,i,r,s=null!==(t=null==e||null==(i=e.$exception_list)||null==(i=i[0])?void 0:i.type)&&void 0!==t?t:"Exception";this.ba.consumeRateLimit(s)?oi.info("Skipping exception capture because of client rate limiting.",{exception:s}):null==(r=this._instance.exceptions)||r.sendExceptionEvent(e)}},exceptions:class{constructor(e){var t,i;this.wa=[],this.xa=new t_([new tT,new tL,new tR,new tF,new tM,new tC,new t$,new tA],function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];return function(t,r){void 0===r&&(r=0);for(var s=[],n=t.split("\n"),o=r;n.length>o;o++){var a=n[o];if(1024>=a.length){var l=tP.test(a)?a.replace(tP,"$1"):a;if(!l.match(/\S*Error: /)){for(var u of i){var c=u(l,e);if(c){s.push(c);break}}if(s.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>y({},e,{filename:e.filename||(t[t.length-1]||{}).filename,function:e.function||"?"}))}(s)}}("web:javascript",tE,tk)),this._instance=e,this.wa=null!==(t=null==(i=this._instance.persistence)?void 0:i.get_property(t2))&&void 0!==t?t:[],this.ka=tH(this.Sa()),this.Ca=new tB(this.ka)}onConfigChange(){this.ka=tH(this.Sa()),this.Ca.setConfig(this.ka)}onRemoteConfig(e){var t,i,r;if("errorTracking"in e){var s=null!==(t=null==(i=e.errorTracking)?void 0:i.suppressionRules)&&void 0!==t?t:[],n=null==(r=e.errorTracking)?void 0:r.captureExtensionExceptions;this.wa=s,this._instance.persistence&&this._instance.persistence.register({[t2]:this.wa,[t3]:n})}}get Ia(){var e,t=!!this._instance.get_property(t3),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=i?i:t)&&void 0!==e&&e}buildProperties(e,t){return this.xa.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.ka.enabled)try{if(!Y(e)||0===e.trim().length)return void oO.warn("Ignoring exception step because message must be a non-empty string");var i=this.Ta(t),{sanitizedProperties:r,droppedKeys:s}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((i,r)=>(tq.has(r)?t.push(r):i[r]=e[r],i),{}),droppedKeys:t}}(i);s.length>0&&oO.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Ca.add(y({[tN]:e,[tU]:(new Date).toISOString()},r))}catch(e){oO.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Ea(t)){if(this.Ma(t))return this.Ra("Exception dropped: matched a suppression rule"),void oO.info("Skipping exception capture because a suppression rule matched");if(!this.Ia&&this.Pa(t))return this.Ra("Exception dropped: thrown by a browser extension"),void oO.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Oa(t))return this.Ra("Exception dropped: thrown by the PostHog SDK"),void oO.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.ka.enabled&&X(e.$exception_steps)?this.La(e):e;try{var r=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",rs:!0});return r&&this.Ca.clear(),r}catch(e){return oO.error("Failed to capture exception event. Dropping this exception.",e),void this.Ca.clear()}}catch(e){return void oO.error("Failed to process exception event. Ignoring this exception.",e)}}La(e){try{var t=this.Ca.getAttachable();return 0===t.length?e:y({},e,{$exception_steps:t})}catch(t){return oO.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Ra(e){this.ka.enabled&&this.Ca.add({[tN]:e,[tU]:(new Date).toISOString()})}Ta(e){return W(e)?y({},e):{}}Sa(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}}Ma(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>
1{var{type:i,value:r}=t;return Y(i)&&i.length>0&&e.$exception_types.push(i),Y(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this.wa.some(e=>{var i=e.values.map(e=>{var i,r=nO[e.operator],s=z(e.value)?e.value:[e.value],n=null!==(i=t[e.key])&&void 0!==i?i:[];return s.length>0&&r(s,n)});return"OR"===e.type?i.some(Boolean):i.every(Boolean)})}Pa(e){return e.flatMap(e=>{var t,i;return null!==(t=null==(i=e.stacktrace)?void 0:i.frames)&&void 0!==t?t:[]}).some(e=>e.filename&&e.filename.startsWith("chrome-extension://"))}Oa(e){if(e.length>0){var t,i,r,s,n=null!==(t=null==(i=e[0].stacktrace)?void 0:i.frames)&&void 0!==t?t:[],o=n[n.length-1];return null!==(r=null==o||null==(s=o.filename)?void 0:s.includes("posthog.com/static"))&&void 0!==r&&r}return!1}Ea(e){return!X(e)&&z(e)}}},oU,{siteApps:class{constructor(e){this.Da=0,this._instance=e,this.$a=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}qa(e,t){if(t){var i=this.globalsForEvent(t);this.$a.push(i),this.$a.length>1e3&&(this.$a=this.$a.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.qa.bind(this));this.ja=()=>{e(),this.$a=[],this.ja=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,r,s,n,o,a,l={},u=this._instance.get_property("$groups")||[];for(var[c,h]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[c]={id:u[c],type:c,properties:h};var{$set_once:d,$set:p}=e;return{event:y({},b(e,og),{properties:y({},e.properties,p?{$set:y({},null!==(t=null==(i=e.properties)?void 0:i.$set)&&void 0!==t?t:{},p)}:{},d?{$set_once:y({},null!==(r=null==(s=e.properties)?void 0:s.$set_once)&&void 0!==r?r:{},d)}:{}),elements_chain:null!==(n=null==(o=e.properties)?void 0:o.$elements_chain)&&void 0!==n?n:"",distinct_id:null==(a=e.properties)?void 0:a.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}Ba(e){var t,i=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(o_.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(o_.error("prepare_external_dependency_script returned null"),null):e}Ha(){if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var e,t,i,r,s,n,o,l,u=null==a?void 0:a.defaultView,c=null==u||null==(e=u.Node)?void 0:e.prototype;if(!u||!c)return()=>{};if(this.Da++,this.Ua)return this.za();var h=[],d=this,p=new WeakSet,v=(e,t,i)=>{if(null!=e&&e[t]){var r=e[t];e[t]=i(r),h.push(()=>{e[t]=r})}},g=e=>{if(p.has(e))return e;var t=d.Ba(e);return t&&p.add(t),t},_=e=>e.map(e=>"string"==typeof e?e:g(e)).filter(e=>!J(e));return v(c,"appendChild",e=>function(t){var i=g(t);return i?e.call(this,i):t}),v(c,"insertBefore",e=>function(t,i){var r=g(t);return r?e.call(this,r,i):t}),v(c,"replaceChild",e=>function(t,i){var r=g(t);return r?e.call(this,r,i):i}),[null==(t=u.Element)?void 0:t.prototype,null==(i=u.Document)?void 0:i.prototype,null==(r=u.DocumentFragment)?void 0:r.prototype].forEach(e=>{v(e,"append",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,_(i))}),v(e,"prepend",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,_(i))})}),[null==(s=u.Element)?void 0:s.prototype,null==(n=u.CharacterData)?void 0:n.prototype,null==(o=u.DocumentType)?void 0:o.prototype].forEach(e=>{v(e,"before",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,_(i))}),v(e,"after",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,_(i))}),v(e,"replaceWith",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];var s=_(i);return i.length&&!s.length?void 0:e.apply(this,s)})}),v(null==(l=u.Element)?void 0:l.prototype,"insertAdjacentElement",e=>function(t,i){var r=g(i);return r?e.call(this,t,r):null}),this.Ua=()=>
1{h.forEach(e=>e()),this.Ua=void 0},this.za()}za(){var e=!1;return()=>{var t;e||(e=!0,this.Da--,0===this.Da&&(null==(t=this.Ua)||t.call(this)))}}Va(e,t){void 0===t&&(t=!0);var i=this.Ha();try{var r=e(i);return t&&i(),r}catch(e){throw i(),e}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.$a.length&&(o_.info("Processing "+this.$a.length+" events for site app with id "+e.id),this.$a.forEach(e=>this.Va(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this.ja)||i.call(this))},r=!1,s=s=>{t.errored=!s,t.loaded=!0,o_.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&i()};try{var{processEvent:n}=this.Va(t=>e.init({posthog:this._instance,callback(e){t(),s(e)}}),!1);n&&(t.processEvent=n),r=!0}catch(t){o_.error(of+e.id,t),s(!1)}if(r&&t.loaded)try{i()}catch(i){o_.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}Wa(){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)}Ga(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),r=function(r){try{t.Va(()=>null==r.processEvent?void 0:r.processEvent(i))}catch(t){o_.error("Error while processing event "+e.event+" for site app "+r.id,t)}};for(var s of Object.values(this.apps))r(s)}}onRemoteConfig(e){var t,i,r,s=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Wa(),void this._instance.on("eventCaptured",e=>this.Ga(e))):void o_.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this.ja)||i.call(this),null!=(r=e.siteApps)&&r.length){if(this.isEnabled){var n=function(e){var t;v["__$$ph_site_app_"+e]=s._instance,null==(t=v.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(s._instance,a,t=>{if(t)return o_.error(of+e,t)})};for(var{id:o,url:a}of e.siteApps)n(o)}else o_.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},oq,{tracingHeaders:class{constructor(e){this.Za=void 0,this.Qa=void 0,this.Ja=void 0,this.da=()=>{var e,t,i=this.Ka();i?(G(this.Za)&&(this.Za=null==(e=v.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),G(this.Qa)&&(this.Qa=null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.ma()},this._instance=e}initialize(){this.startIfEnabledOrStop()}qr(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 or.error("failed to load script",t);e()})}Ya(){var e,t;return null!==(e=null!==(t=this._instance.config.tracing_headers)&&void 0!==t?t:this._instance.config.addTracingHeaders)&&void 0!==e?e:this._instance.config.__add_tracing_headers}Ka(){var e=this.Ya();return z(e)?(z(this.Ja)?this.Ja.splice(0,this.Ja.length,...e):this.Ja=[...e],e.length>0?this.Ja:void 0):(z(this.Ja)&&this.Ja.splice(0),this.Ja=e||void 0,this.Ja)}ma(){var e,t;null==(e=this.Za)||e.call(this),null==(t=this.Qa)||t.call(this),this.Za=void 0,this.Qa=void 0}startIfEnabledOrStop(){this.Ka()?this.qr(this.da):this.ma()}}},{toolbar:class{constructor(e){this.instance=e}ll(e){v.ph_toolbar_state=e}ul(){var e;return null!==(e=v.ph_toolbar_state)&&void 0!==e?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),i4(this.instance.config)||!s||!a)return!1;e=null!=e?e:s.location,i=null!=i?i:s.history;try{if(!t){try{s.localStorage.setItem("test","test"),s.localStorage.removeItem("test")}catch(e){return!1}t=null==s?void 0:s.localStorage}var r,n=oS||sr(e.hash,"__posthog")||sr(e.hash,"state"),o=n?i0(()=>JSON.parse(atob(decodeURIComponent(n))))||i0(()=>JSON.parse(decodeURIComponent(n))):null;return o&&"ph_authorize"===o.action?((r=o).source="url",r&&Object.keys(r).length>0&&(o.desiredHash?e.hash=o.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(ok)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(e){return!1}}hl(e){var t=v.ph_load_toolbar||v.ph_load_editor;!X(t)&&V(t)?t(e,this.instance):oP.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==a||!a.getElementById(iD));if(!s||i)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=y({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});return(s.localStorage.setItem(ok,JSON.stringify(y({},n,{source:void 0}))),2===this.ul())?this.hl(n):0===this.ul()&&(this.ll(1),null==(t=v.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return oP.error("[Toolbar] Failed to load",e),void this.ll(0);this.ll(2),this.hl(n)}),i5(s,"turbolinks:load",()=>{this.ll(0),this.loadToolbar(n)})),!0}cl(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)}}},oj,{conversations:class{constructor(e){this.dl=void 0,this._conversationsManager=null,this.vl=!1,this.fl=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;X(t)||(et(t)?this.dl=t:(this.dl=t.enabled,this.fl=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.dl=void 0,this.fl=null}loadIfEnabled(){if(!(this._conversationsManager||this.vl||this._instance.config.disable_conversations||i4(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==v?void 0:v.__PosthogExtensions__;if(e&&!G(this.dl)&&this.dl){if(this.fl&&this.fl.token){this.vl=!0;try{var t=e.initConversations;if(t)return this.pl(t),void(this.vl=!1);var i=e.loadExternalDependency;if(!i)return void this.gl(iN);i(this._instance,"conversations",t=>{t||!e.initConversations?this.gl("Could not load conversations script",t):this.pl(e.initConversations),this.vl=!1})}catch(e){this.gl("Error initializing conversations",e),this.vl=!1}}else oA.error("Conversations enabled but missing token in remote config.")}}}pl(e){if(this.fl)try{this._conversationsManager=e(this.fl,this._instance),oA.info("Conversations loaded successfully")}catch(e){this.gl("Error completing conversations initialization",e)}else oA.error("Cannot complete initialization: remote config is null")}gl(e,t){oA.error(e,t),this._conversationsManager=null,this.vl=!1}show(){this._conversationsManager?this._conversationsManager.show():oA.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.dl&&!J(this._conversationsManager)}isVisible(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.isVisible())&&void 0!==e&&e}
1sendMessage(e,t,i){var r=this;return m(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,i):(oA.warn(oL),null)})()}getMessages(e,t){var i=this;return m(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(oA.warn(oL),null)})()}markAsRead(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(oA.warn(oL),null)})()}getTickets(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(oA.warn(oL),null)})()}requestRestoreLink(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(oA.warn(oL),null)})()}restoreFromToken(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(oA.warn(oL),null)})()}restoreFromUrlToken(){var e=this;return m(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(oA.warn(oL),null)})()}getCurrentTicketId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}hs(){var e;null==(e=this._conversationsManager)||e.setIdentity()}cs(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.ml=!1,this.yl=!1,this.Qt=tW("[logs]"),this.Mi=[],this.bl=()=>{var e;null==(e=this._l)||e.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.ml=!0),s&&i5(s,"online",this.bl)}wl(){var e,t,i,r,s,n,o,a,l,u,c,h,d,p=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this._l&&this.xl===p||(null==(t=this._l)||t.reset(),this.xl=p,this.kl=(l=null!==(i=null==p?void 0:p.flushIntervalMs)&&void 0!==i?i:3e3,h=Math.max(u=null!==(r=null==p?void 0:p.maxBufferSize)&&void 0!==r?r:100,c=null!==(s=null==p?void 0:p.maxLogsPerInterval)&&void 0!==s?s:1e3),{serviceName:null!==(n=null==(d=null==p?void 0:p.resourceAttributes)?void 0:d["service.name"])&&void 0!==n?n:null==p?void 0:p.serviceName,serviceVersion:null!==(o=null==d?void 0:d["service.version"])&&void 0!==o?o:null==p?void 0:p.serviceVersion,environment:null!==(a=null==d?void 0:d["deployment.environment"])&&void 0!==a?a:null==p?void 0:p.environment,resourceAttributes:d,beforeSend:null==p?void 0:p.beforeSend,flushIntervalMs:l,maxBufferSize:u,maxQueueSize:h,maxBatchRecordsPerPost:100,rateCapWindowMs:l,maxLogsPerInterval:c,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}),this._l=new tg(this.Sl(),this.kl,this.Qt,()=>this.Cl(),e=>e())),this._l}Il(){return this.wl(),this.kl}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,i=null==(t=e.logs)?void 0:t.captureConsoleLogs;!X(i)&&i&&(this.ml=!0,this.loadIfEnabled())}reset(){var e;this.Mi=[],null==(e=this._l)||e.reset()}captureLog(e){this.wl().captureLog(e)}get logger(){return this.Tl||(this.Tl={trace:(e,t)=>this.captureLog({body:e,level:"trace",attributes:t}),debug:(e,t)=>this.captureLog({body:e,level:"debug",attributes:t}),info:(e,t)=>this.captureLog({body:e,level:"info",attributes:t}),warn:(e,t)=>this.captureLog({body:e,level:"warn",attributes:t}),error:(e,t)=>this.captureLog({body:e,level:"error",attributes:t}),fatal:(e,t)=>this.captureLog({body:e,level:"fatal",attributes:t})}),this.Tl}flushLogs(e){e?this.El(e):this.wl().flush().catch(e=>this.Qt.error("PostHog logs flush failed:",e))}loadIfEnabled(){if(this.ml&&!this.yl){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.Qt.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.yl=!0)}):this.Qt.error(iN)}else this.Qt.error("PostHog Extensions not found.")}}Sl(){var e=this._instance;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},getPersistedProperty:e=>e===P.LogsQueue?this.Mi:void 0,setPersistedProperty:(e,t)=>{e===P.LogsQueue&&(this.Mi=null!=t?t:[])},kr:e=>this.kr(e),getLibraryId:()=>_.LIB_NAME,getLibraryVersion:()=>_.LIB_VERSION}}kr(e){return new Promise(t=>{var i=!1,r=e=>{i||(i=!0,clearTimeout(s),t(e))},s=setTimeout(()=>r({kind:"retry-later",error:Error("logs request timed out")}),9e4);this._instance._send_request({method:"POST",url:this.Ml(),data:e,compression:"best-available",batchKey:"logs",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("logs request failed with status "+i)}):r({kind:"retry-later",error:null!==(t=e.error)&&void 0!==t?t:Error("logs request failed with status "+i)})}})})}El(e){var t=this.Il();if(0!==this.Mi.length){var i=this.Mi.map(e=>e.record);this.Mi=[];var r=tv(i,tp(t,_.LIB_NAME,_.LIB_VERSION),_.LIB_NAME,_.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Ml(),data:r,compression:"best-available",batchKey:"logs",transport:e})}}Ml(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Cl(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:i}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=i}if(null!=v&&null!=(e=v.location)&&e.href&&(t.currentUrl=v.location.href),this._instance.featureFlags){var r=this._instance.featureFlags.getFlags();r&&r.length>0&&(t.activeFeatureFlags=r)}return t}}});n8.__defaultExtensionClasses=y({},oH);var oB=(_.SDK_DIST_CHANNEL="npm",r=nG[n1]=new n8,function(){function e(){e.done||(e.done=!0,n2=!1,iJ(nG,function(e){e._dom_loaded()}))}null!=a&&a.addEventListener?"complete"===a.readyState?e():i5(a,"DOMContentLoaded",e,{capture:!1}):s&&tV.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),r)}}]);

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.