PageSourceSearch

https://www.wego.co.in/roxana/5476.5088a0ea.bundle.js

js wego.co.in collected 2026-09-24 13:08:30 UTC 230,011 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkroxana=self.webpackChunkroxana||[]).push([[5476],{55476(e,t,i){i.d(t,{Ay:()=>Rl});var r="undefined"!=typeof window?window:void 0,s="undefined"!=typeof globalThis?globalThis:r,n=null==s?void 0:s.navigator,a=null==s?void 0:s.document,o=null==s?void 0:s.location,l=null==s?void 0:s.fetch,u=null!=s&&s.XMLHttpRequest&&"withCredentials"in new s.XMLHttpRequest?s.XMLHttpRequest:void 0,h=null==s?void 0:s.AbortController,c=null==s?void 0:s.CompressionStream,d=null==n?void 0:n.userAgent;function p(){return!(!r||!1===r.navigator.onLine)}var v="undefined"!=typeof globalThis?globalThis:r;v&&"undefined"==typeof self&&(v.self=v),v&&"undefined"==typeof File&&(v.File=function(){});var g=null!=r?r:{},f={DEBUG:!1,LIB_VERSION:"0.2.2",LIB_NAME:"browser-common"};function _(e,t,i,r,s,n,a){try{var o=e[n](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(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 a(e){_(n,r,s,a,o,"next",e)}function o(e){_(n,r,s,a,o,"throw",e)}a(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},y.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=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function x(e){return"string"==typeof e||e}function k(e){return"string"==typeof e?e:void 0}var E,S=["$feature_flag","$feature_flag_response","$feature_flag_has_experiment","$feature_flag_id","$feature_flag_version","$feature_flag_reason","$feature_flag_request_id","$feature_flag_evaluated_at","$feature_flag_error","locally_evaluated","$groups","$process_person_profile","$geoip_disable","$current_url","$pathname","$session_id","$window_id","$lib","$lib_version","$device_id","$is_server"],P=function(e){return e.AnonymousId="anonymous_id",e.DistinctId="distinct_id",e.Props="props",e.EnablePersonProcessing="enable_person_processing",e.PersonMode="person_mode",e.FeatureFlagDetails="feature_flag_details",e.FeatureFlags="feature_flags",e.FeatureFlagPayloads="feature_flag_payloads",e.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",e.BootstrapFeatureFlags="bootstrap_feature_flags",e.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",e.OverrideFeatureFlags="override_feature_flags",e.Queue="queue",e.AiQueue="ai_queue",e.LogsQueue="logs_queue",e.OptedOut="opted_out",e.SessionId="session_id",e.SessionStartTimestamp="session_start_timestamp",e.SessionLastTimestamp="session_timestamp",e.PersonProperties="person_properties",e.GroupProperties="group_properties",e.InstalledAppBuild="installed_app_build",e.InstalledAppVersion="installed_app_version",e.SessionReplay="session_replay",e.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",e.SurveyLastSeenDate="survey_last_seen_date",e.SurveysSeen="surveys_seen",e.Surveys="surveys",e.RemoteConfig="remote_config",e.FlagsEndpointWasHit="flags_endpoint_was_hit",e.DeviceId="device_id",e}({}),T=function(e){return 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"],$=["token"],I="NativeGzipValidationError",M=e=>e.length>=2&&31===e[0]&&139===e[1],R=(e,t)=>e===T.GZipJS||t===T.GZipJS||"gzip"===t,C=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),O=e=>{var t=new Error("Native gzip produced invalid output: "+e);throw t.name=I,t},A=function(){var e=m(function*(e,t){18>e.size&&O("too-short");var i=new Uint8Array(yield e.slice(0,10).arrayBuffer());M(i)&&8===i[2]||O("invalid-header");var r=new DataView(yield e.slice(e.size-8).arrayBuffer());r.getUint32(0,!0)!==(e=>{for(var t=(()=>
1{if(E)return E;E=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?3988292384^t>>>1:t>>>1;E[e]=t>>>0}return E})(),i=4294967295,r=0;e.length>r;r++)i=t[255&(i^e[r])]^i>>>8;return(4294967295^i)>>>0})(t)&&O("invalid-crc");var s=t.length>>>0;r.getUint32(4,!0)!==s&&O("invalid-size")});return function(t,i){return e.apply(this,arguments)}}();function L(){return L=m(function*(e,t,i){void 0===t&&(t=!0);try{var r=(new TextEncoder).encode(e),s=new globalThis.CompressionStream("gzip"),n=s.writable.getWriter(),a=n.write(r).then(()=>n.close()).catch(function(){var e=m(function*(e){try{yield n.abort(e)}catch(e){}throw e});return function(t){return e.apply(this,arguments)}}()),o=new Response(s.readable).blob(),l=(yield Promise.all([o,a]))[0];return yield A(l,r),l}catch(e){if(null!=i&&i.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}}),L.apply(this,arguments)}var D=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],N=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return D.concat(t).some(e=>{var t=e.toLowerCase();return-1!==i.indexOf(t)})};function j(e,t){return-1!==e.indexOf(t)}var q=function(e){return e.trim()},z=function(e){return e.replace(/^\$/,"")};function H(e){var t,i=[];return null!==(t=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;i.length>0&&i[i.length-1]!==this;)i.pop();if(i.includes(t))return"[Circular]";i.push(t)}return t}}))&&void 0!==t?t:"null"}var G=Object.prototype,B=G.hasOwnProperty,U=G.toString,V=Array.isArray||function(e){return"[object Array]"===U.call(e)},W=e=>"function"==typeof e,K=e=>e===Object(e)&&!V(e),J=e=>{if(K(e)){for(var t in e)if(B.call(e,t))return!1;return!0}return!1},Y=e=>void 0===e,Z=e=>"[object String]"==U.call(e),X=e=>Z(e)&&0===e.trim().length,Q=e=>null===e,ee=e=>Y(e)||Q(e),te=e=>"[object Number]"==U.call(e)&&e==e,ie=e=>te(e)&&e>0,re=e=>"[object Boolean]"===U.call(e),se=e=>j(F,e),ne=e=>j($,e);function ae(e){return null===e||"object"!=typeof e}function oe(e,t){return{}.toString.call(e)==="[object "+t+"]"}function le(e){return"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var ue=[!0,"true",1,"1","yes"],he=e=>j(ue,e),ce=[!1,"false",0,"0","no"];function de(e,t,i,r,s){return t>i&&(r.warn("min cannot be greater than max."),t=i),te(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),de(s||i,t,i,r))}class pe{constructor(e){this.$e={},this.ze=e.ze,this.Ze=de(e.bucketSize,0,100,e.Ge),this.Qe=de(e.refillRate,0,this.Ze,e.Ge),this.Je=de(e.refillInterval,0,864e5,e.Ge)}Ke(e,t){var i=Math.floor((t-e.lastAccess)/this.Je);i>0&&(e.tokens=Math.min(e.tokens+i*this.Qe,this.Ze),e.lastAccess=e.lastAccess+i*this.Je)}consumeRateLimit(e){var t,i=Date.now(),r=String(e),s=this.$e[r];return s?this.Ke(s,i):this.$e[r]=s={tokens:this.Ze,lastAccess:i},0===s.tokens||(s.tokens--,0===s.tokens&&(null==(t=this.ze)||t.call(this,e)),0===s.tokens)}stop(){this.$e={}}}var ve="Mobile",ge="iOS",fe="Android",_e="Tablet",me=fe+" "+_e,ye="iPad",be="Apple",we=be+" Watch",xe="Safari",ke="BlackBerry",Ee="Samsung",Se=Ee+"Browser",Pe=Ee+" Internet",Te="Chrome",Fe=Te+" OS",$e=Te+" "+ge,Ie="Internet Explorer",Me=Ie+" "+ve,Re="Opera",Ce=Re+" Mini",Oe="Edge",Ae="Microsoft "+Oe,Le="Firefox",De=Le+" "+ge,Ne="Nintendo",je="PlayStation",qe="Xbox",ze=fe+" "+ve,He=ve+" "+xe,Ge="Windows",Be=Ge+" Phone",Ue="Nokia",Ve="Ouya",We="Generic",Ke=We+" "+ve.toLowerCase(),Je=We+" "+_e.toLowerCase(),Ye="Konqueror",Ze="Oculus Browser",Xe="Vivaldi",Qe="Yandex",et="Whale",tt="DuckDuckGo",it="Pale Moon",rt="Waterfox",st="Brave",nt="Google Search App",at="(\\d+(\\.\\d+)?)",ot=new RegExp("Version/"+at),lt=new RegExp(qe,"i"),ut=new RegExp(je+" \\w+","i"),ht=new RegExp(Ne+" \\w+","i"),ct=new RegExp(ke+"|PlayBook|BB10","i"),dt={"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"},pt=function(e,t,i,r){t=t||"";var s=function(e){return null!=e&&e.brave?st:null}(i);return s||(null!=r&&r.detectGoogleSearchApp&&j(e,"GSA/")?nt:j(e," OPR/")&&j(e,"Mini")?Ce:j(e," OPR/")?Re:ct.test(e)?ke:j(e,"IE"+ve)||j(e,"WPDesktop")?Me:j(e,"OculusBrowser")?Ze:j(e,Se)?Pe:j(e,Oe)||j(e,"Edg/")?Ae:j(e,Xe+"/")?Xe:j(e,"YaBrowser/")?Qe:j(e,et+"/")?et:j(e,tt+"/")||j(e,"Ddg/")?tt:j(e,"FBIOS")?"Facebook "+ve:j(e,"UCWEB")||j(e,"UCBrowser")?"UC Browser":j(e,"CriOS")?$e:j(e,"CrMo")||j(e,Te)?Te:j(e,fe)&&j(e,xe)?ze:j(e,"FxiOS")?De:j(e.toLowerCase(),Ye.toLowerCase())?Ye:j(e,st+"/")?st:((e,t)=>t&&j(t,be)||function(e){return j(e,xe)&&!j(e,Te)&&!j(e,fe)}(e))(e,t)?j(e,ve)?He:xe:j(e,"PaleMoon/")?it:j(e,rt+"/")?rt:j(e,Le)?Le:j(e,"MSIE")||j(e,"Trident/")?Ie:j(e,"Gecko")?Le:"")},vt={[Me]:[new RegExp("rv:"+at)],[Ae]:[new RegExp(Oe+"?\\/"+at)],[Te]:[new RegExp("("+Te+"|CrMo)\\/"+at)],[$e]:[new RegExp("CriOS\\/"+at)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+at)],[xe]:[ot],[He]:[ot],[Re]:[new RegExp("(Opera|OPR)\\/"+at)],[Le]:[new RegExp(Le+"\\/"+at)],[De]:[new RegExp("FxiOS\\/"+at)],[Ye]:[new RegExp("Konqueror[:/]?"+at,"i")],[ke]:[new RegExp(ke+" "+at),ot],[ze]:[new RegExp("android\\s"+at,"i")],[Pe]:[new RegExp(Se+"\\/"+at)],[Ze]:[new RegExp("OculusBrowser\\/"+at)],[Xe]:[new RegExp(Xe+"\\/"+at)],[Qe]:[new RegExp("YaBrowser\\/"+at)],[et]:[new RegExp(et+"\\/"+at)],[st]:[new RegExp(st+"\\/"+at)],[tt]:[new RegExp("(DuckDuckGo|Ddg)\\/"+at)],[it]:[new RegExp("PaleMoon\\/"+at)],[rt]:[new RegExp(rt+"\\/"+at)],[nt]:[new RegExp("GSA\\/"+at)],[Ie]:[new RegExp("(rv:|MSIE )"+at)],Mozilla:[new RegExp("rv:"+at)]},gt=function(e,t,i,r){var s=pt(e,t,i,r),n=vt[s];if(Y(n))return null;for(var a=0;n.length>a;a++){var o=e.match(n[a]);if(o)return parseFloat(o[o.length-2])}return null},ft=[[new RegExp(qe+"; "+qe+" (.*?)[);]","i"),e=>[qe,e&&e[1]||""]],[new RegExp(Ne,"i"),[Ne,""]],[new RegExp(je,"i"),[je,""]],[ct,[ke,""]],[new RegExp(Ge,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[Be,""];if(new RegExp(ve).test(t)&&!/IEMobile\b/.test(t))return[Ge+" "+ve,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=dt[i[1]]||"";return/arm/i.test(t)&&(r="RT"),[Ge,r]}return[Ge,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?[ge,[e[3],e[4],e[5]||"0"].join(".")]:[ge,""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=Y(e[2])?e[3]:e[2]),["watchOS",t]}],[new RegExp("("+fe+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+fe+")","i"),e=>e&&e[2]?[fe,[e[2],e[3],e[4]||"0"].join(".")]:[fe,""]],[/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/,[Fe,""]],[/Linux|debian/i,["Linux",""]]],_t=function(e){return ht.test(e)?Ne:ut.test(e)?je:lt.test(e)?qe:new RegExp(Ve,"i").test(e)?Ve:new RegExp("("+Be+"|WPDesktop)","i").test(e)?Be:/iPad/.test(e)?ye:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?we:ct.test(e)?ke:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":new RegExp(Ue,"i").test(e)?Ue:/(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(ve).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)?fe:me:new RegExp("(pda|"+ve+")","i").test(e)?Ke:new RegExp(_e,"i").test(e)&&!new RegExp(_e+" pc","i").test(e)?Je:""},mt=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function yt(e,t){return"string"==typeof(i=e)&&mt.test(i)?e:t();var i}function bt(e){return e?e.split("#")[0]:e}function wt(e,t){var i=setTimeout(e,t);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}var xt=e=>e instanceof Error,kt={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}},Et=kt.info;function St(e){if(re(e))return{boolValue:e};if("number"==typeof e)return Number.isFinite(e)?Number.isInteger(e)?{intValue:e}:{doubleValue:e}:{stringValue:String(e)};if("string"==typeof e)return{stringValue:e};if(V(e))return{arrayValue:{values:e.map(e=>St(e))}};try{return{stringValue:JSON.stringify(e)}}catch(t){return{stringValue:String(e)}}}function Pt(e){var t=[];for(var i in e){var r=e[i];Q(r)||Y(r)||t.push({key:i,value:St(r)})}return t}function Tt(e,t){var i=kt[e.level||"info"]||Et,r=i.text,s=i.number,n=String(Date.now())+"000000",a={};t.distinctId&&(a.posthogDistinctId=t.distinctId),t.sessionId&&(a.sessionId=t.sessionId),t.windowId&&(a["window.id"]=t.windowId),ee(t.sessionStartTimestamp)||(a.sessionStartTimestamp=String(t.sessionStartTimestamp)),ee(t.lastActivityTimestamp)||(a.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(a["url.full"]=t.currentUrl),t.screenName&&(a["screen.name"]=t.screenName),t.appState&&(a["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(a.feature_flags=t.activeFeatureFlags);var o=y({},a,e.attributes||{}),l={timeUnixNano:n,observedTimeUnixNano:n,severityNumber:s,severityText:r,body:{stringValue:e.body},attributes:Pt(o)};return e.trace_id&&(l.traceId=e.trace_id),e.span_id&&(l.spanId=e.span_id),Y(e.trace_flags)||(l.flags=e.trace_flags),l}function Ft(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 $t(e,t,i,r){return{resourceLogs:[{resource:{attributes:Pt(t)},scopeLogs:[{scope:{name:i,version:r},logRecords:e}]}]}}let It=class{constructor(e,t,i,r,s,n,a){var o;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.Te=t,this.Ge=i,this.Ye=r,this.Xe=s,this.et=n,this.tt
1=a,this.rt=null,this.it=0,this.nt=0,this.st=0,this.ot=0,this.ut=!1,this.ht=t.maxBufferSize,this.dt=Math.max(null!==(o=t.maxQueueSize)&&void 0!==o?o:t.maxBufferSize,t.maxBufferSize),this.ct=t.flushIntervalMs,this.vt=t.maxBatchRecordsPerPost,this.ft=t.rateCapWindowMs,this.yt=t.maxLogsPerInterval}reset(){this.bt(),this.rt=null,this.st=0,this.ot=0,this.ut=!1,this.it=0,this.nt=0,this.vt=this.Te.maxBatchRecordsPerPost}onReconnect(){this.nt=0,this._t()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.wt(e);if(null!==t)if(t.body){if(this.xt()){var i={record:Tt(t,this.Ye())};this.Xe(()=>this.kt(i))}}else this.Ge.info("Log was rejected in beforeSend function")}}wt(e){var t=this.Te.beforeSend;if(!t)return e;var i=V(t)?t:[t],r=e;for(var s of i)try{var n=s(r);if(!n)return this.Ge.info("Log was rejected in beforeSend function"),null;r=n}catch(e){return this.Ge.error("Error in beforeSend function for log:",e),null}return r}xt(){if(void 0===this.yt)return!0;var e=Date.now(),t=e-this.st;return this.ft>t&&t>=0||(this.st=e,this.ot=0,this.ut=!1),this.yt>this.ot?(this.ot++,!0):(this.ut||(this.Ge.warn("captureLog dropping logs: exceeded "+this.yt+" logs per "+this.ft+"ms"),this.ut=!0),!1)}flush(){var e=this;return m(function*(){if(!e._instance.isDisabled)return e.rt||(e.rt=e.St().finally(()=>{e.rt=null})),e.rt})()}St(){var e=this;return m(function*(){var t;e.bt();var i=null!==(t=e._instance.getPersistedProperty(P.LogsQueue))&&void 0!==t?t:[];if(0!==i.length)for(var r=i.length,s=0;i.length>0&&r>s;){var n,a;e.it=0;var o=Math.min(i.length,e.vt),l=i.slice(0,o),u=$t(l.map(e=>e.record),e.Ct(),null!==(n=e.tt)&&void 0!==n?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),h=yield e._instance.Tt(u);if("too-large"===h.kind&&l.length>1)e.vt=Math.max(1,Math.floor(l.length/2)),e.Ge.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.vt);else{if("retry-later"===h.kind)throw h.error;if("too-large"===h.kind?e.Ge.warn("Dropping a single log record after 413 with batch size 1 — the record is larger than the server cap and cannot be split further."):"ok"===h.kind&&e.Te.maxBatchRecordsPerPost>e.vt&&(e.vt=Math.min(e.Te.maxBatchRecordsPerPost,e.vt+1)),yield e.It(l.length),i=null!==(a=e._instance.getPersistedProperty(P.LogsQueue))&&void 0!==a?a:[],s+=l.length,"fatal"===h.kind)throw h.error}}})()}It(e){var t=this;return m(function*(){var i,r=Math.max(0,e-t.it),s=null!==(i=t._instance.getPersistedProperty(P.LogsQueue))&&void 0!==i?i:[];t._instance.setPersistedProperty(P.LogsQueue,s.slice(r)),yield t.et()})()}Ct(){return Ft(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion())}kt(e){var t;if(!this._instance.optedOut){var i=null!==(t=this._instance.getPersistedProperty(P.LogsQueue))&&void 0!==t?t:[];this.dt>i.length||(i.shift(),this.it++,this.Ge.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(P.LogsQueue,i),this.ht>i.length?this.Mt():this._t()}}Mt(e){void 0===e&&(e=this.ct),this.Et||(this.Et=wt(()=>{this.Et=void 0,this._t()},e))}Rt(){var e=Math.min(Math.max(0,this.nt-1),6);return this.ct*Math.pow(2,e)}Pt(){var e=this._instance.getPersistedProperty(P.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return m(function*(){t.bt();var i=t.flush().catch(()=>{});void 0!==e?yield Promise.race([i,new Promise(t=>wt(t,e))]):yield i})()}flushWithTimeout(e){var t=this;return m(function*(){var i=!1,r=t.flush(),s=new Promise(t=>wt(()=>{i=!0,t()},e));try{yield Promise.race([r,s])}finally{i&&r.catch(()=>{})}})()}_t(){this.flush().then(()=>{this.nt=0},e=>{this.nt++,this.Ge.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.Pt()&&this.Mt(this.Rt())})}bt(){this.Et&&(clearTimeout(this.Et),this.Et=void 0)}};var Mt=[0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4];function Rt(e){return String(e)+"000000"}function Ct(e,t,i,r){var s="";return r&&(s=Object.keys(r).sort().map(e=>JSON.stringify(e)+":"+JSON.stringify(r[e])).join(",")),e+"\0"+t+"\0"+(null!=i?i:"")+"\0"+s}let Ot=class{constructor(e,t,i){this._instance=e,this.Te=t,this.Ge=i,this.Ot=new Map,this.rt=null,this.Ft=!1,this.Lt=ne
vendor: 6,774 bytes, line 1
1w Map,this.$t=new Set,this.At=0}count(e,t,i){void 0===t&&(t=1),this.Nt({name:e,type:"count",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}gauge(e,t,i){this.Nt({name:e,type:"gauge",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}histogram(e,t,i){this.Nt({name:e,type:"histogram",value:t,unit:null==i?void 0:i.unit,attributes:null==i?void 0:i.attributes})}flush(){var e=this,t=this.rt,i=function(){var i=m(function*(){t&&(yield t.catch(()=>{})),yield e.Dt()});return function(){return i.apply(this,arguments)}}(),r=i().finally(()=>{this.rt===r&&(this.rt=null)});return this.rt=r,r}drainWindow(){if(0===this.Ot.size)return null;var e=this.Ot;return this.Ot=new Map,this.Ft=!1,this.Lt=new Map,this.$t=new Set,this.qt(e)}reset(){this.At++,this.bt(),this.Ot=new Map,this.rt=null,this.Ft=!1,this.Lt=new Map,this.$t=new Set}Nt(e){if(!this._instance.isDisabled&&!this._instance.optedOut){var t=this.wt(e);if(null!==t)if(t.name&&"string"==typeof t.name)if("number"==typeof t.value&&Number.isFinite(t.value))if("count"===t.type&&0>t.value)this.Ge.warn("Dropping count '"+t.name+"': counters are monotonic, value must be >= 0");else{var i,r;try{i=t.attributes?y({},t.attributes):void 0,r=Ct(t.type,t.name,t.unit,i)}catch(e){return void this.Ge.warn("Dropping metric '"+t.name+"': attributes could not be serialized",e)}var s=this.Ot.get(r);if(!s){if(!this.jt())return;s={name:t.name,type:t.type,unit:t.unit,attributes:i,windowStartMs:Date.now()},this.Ot.set(r,s)}var n=this.Lt.get(t.name);void 0===n?this.Lt.set(t.name,t.type):n===t.type||this.$t.has(t.name)||(this.$t.add(t.name),this.Ge.warn("Metric name '"+t.name+"' is already used as a "+n+"; recording it as a "+t.type+" too will blend both series in charts. Use a distinct name.")),this.Ht(s,t.value),this.Mt()}else this.Ge.warn("Dropping metric '"+t.name+"': value must be a finite number");else this.Ge.warn("Dropping metric with empty name")}}jt(){return this.Te.maxSeriesPerFlush>this.Ot.size||(this.Ft||(this.Ft=!0,this.Ge.warn("Metric series cap reached ("+this.Te.maxSeriesPerFlush+" per flush window); dropping new series until the next flush. Reduce attribute cardinality.")),!1)}Ht(e,t){var i;switch(e.type){case"count":e.total=(null!==(i=e.total)&&void 0!==i?i:0)+t;break;case"gauge":e.last=t;break;case"histogram":e.hist||(e.hist={count:0,sum:0,min:t,max:t,bucketCounts:new Array(Mt.length+1).fill(0)});var r=e.hist;r.count+=1,r.sum+=t,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.bucketCounts[function(e,t){for(var i=0;t.length>i;i++)if(t[i]>=e)return i;return t.length}(t,Mt)]+=1}}wt(e){var t=this.Te.beforeSend;if(!t)return e;var i=V(t)?t:[t],r=e;for(var s of i)try{var n=s(r);if(!n)return this.Ge.info("Metric was rejected in beforeSend function"),null;r=n}catch(e){return this.Ge.error("Error in beforeSend function for metric:",e),null}return r}Mt(){this.Et||(this.Et=wt(()=>{this.Et=void 0,this.flush().catch(e=>{this.Ge.error("Metrics flush failed:",e)})},this.Te.flushIntervalMs))}bt(){this.Et&&(clearTimeout(this.Et),this.Et=void 0)}Dt(){var e=this;return m(function*(){if(0!==e.Ot.size){var t=e.Ot;e.Ot=new Map,e.Ft=!1,e.Lt=new Map,e.$t=new Set;var i=e.At,r=yield e._instance.Bt(e.qt(t));if(i===e.At)switch(r.kind){case"ok":return;case"retry-later":return e.Ut(t),void e.Mt();case"too-large":return void e.Ge.warn("Metrics batch exceeded the server size limit and was dropped");case"fatal":return void e.Ge.error("Failed to send metrics batch:",r.error)}}})()}qt(e){return t=this.zt(e),i=function(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})}(this.Te,this._instance.getLibraryId(),this._instance.getLibraryVersion()),r=this._instance.getLibraryId(),s=this._instance.getLibraryVersion(),{resourceMetrics:[{resource:{attributes:Pt(i)},scopeMetrics:[{scope:{name:r,version:s},metrics:t}]}]};var t,i,r,s}zt(e){var t=Rt(Date.now()),i=new Map;for(var r of e.values()){var s,n=Ct(r.type,r.name,r.unit,void 0),a=i.get(n);a||(a=y({name:r.name},r.unit&&{unit:r.unit}),"count"===r.type?a.sum={aggregationTemporality:1,isMonotonic:!0,dataPoints:[]}:"gauge"===r.type?a.gauge={dataPoints:[]}:a.histogram={aggregationTemporality:1,dataPoints:[]},i.set(n,a));var o=Pt(null!==(s=r.attributes)&&void 0!==s?s:{}),l=Rt(r.windowStartMs);if("count"===r.type){var u,h={attributes:o,startTimeUnixNano:l,timeUnixNano:t,asDouble:null!==(u=r.total)&&void 0!==u?u:0};a.sum.dataPoints.push(h)}else if("gauge"===r.type){var c,d={attributes:o,timeUnixNano:t,asDouble:null!==(c=r.last)&&void 0!==c?c:0};a.gauge.dataPoints.push(d)}else r.hist&&a.histogram.dataPoints.push({attributes:o,startTimeUnixNano:l,timeUnixNano:t,count:r.hist.count,sum:r.hist.sum,min:r.hist.min,max:r.hist.max,bucketCounts:r.hist.bucketCounts,explicitBounds:Mt})}return Array.from(i.values())}Ut(e){var t,i;for(var r of e){var s=r[0],n=r[1],a=this.Ot.get(s);if(a)switch(a.windowStartMs=Math.min(a.windowStartMs,n.windowStartMs),a.type){case"count":a.total=(null!==(t=a.total)&&void 0!==t?t:0)+(null!==(i=n.total)&&void 0!==i?i:0);break;case"gauge":break;case"histogram":if(n.hist)if(a.hist){a.hist.count+=n.hist.count,a.hist.sum+=n.hist.sum,a.hist.min=Math.min(a.hist.min,n.hist.min),a.hist.max=Math.max(a.hist.max,n.hist.max);for(var o=0;a.hist.bucketCounts.length>o;o++)a.hist.bucketCounts[o]+=n.hist.bucketCounts[o]}else a.hist=n.hist}else this.jt()&&this.Ot.set(s,n)}}};var At,Lt,Dt;function Nt(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return Dt&&i.length===Lt||(Lt=i.length,Dt=i.reduce((i,r)=>{At||(At={});var s=At[r];if(s)i[s[0]]=s[1];else for(var n=e(r),a=n.length-1;a>=0;a--){var o=n[a],l=null==o?void 0:o.filename,u=t[r];if(l&&u){i[l]=u,At[r]=[l,u];break}}return i},{})),Dt}}class jt{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&&V(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.ski
1pFirstLines: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 a=[n];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,y({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:Nt(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)})}}var qt="?";function zt(e,t,i,r,s){var n={platform:e,filename:t,function:"<anonymous>"===i?qt:i,in_app:!0};return Y(r)||(n.lineno=r),Y(s)||(n.colno=s),n}var Ht=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return i||r?[-1!==e.indexOf("@")?e.split("@")[0]:qt,i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},Gt=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Bt=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ut=/\((\S*)(?::(\d+))(?::(\d+))\)/,Vt=(e,t)=>{var i=Gt.exec(e);if(i)return zt(t,i[1],qt,+i[2],+i[3]);var r=Bt.exec(e);if(r){if(r[2]&&0===r[2].indexOf("eval")){var s=Ut.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}var n=Ht(r[1]||qt,r[2]);return zt(t,n[1],n[0],r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Wt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Kt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Jt=(e,t)=>{var i=Wt.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=Kt.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]||qt,a=Ht(n,s);return zt(t,s=a[1],n=a[0],i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},Yt=/\(error: (.*)\)/;class Zt{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=Z(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 oe(e,"DOMException")}isDOMError(e){return oe(e,"DOMError")}}class Xt{match(e){return(e=>e instanceof Error)(e)}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 Qt{constructor(){}match(e){return oe(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 ei=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class ti{match(e){return"string"==typeof e}coerce(e,t){var i,r=this.getInfos(e),s=r[0],n=r[1];return{type:null!=s?s:"Error",value:null!=n?n:e,stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}getInfos(e){var t="Error",i=e,r=e.match(ei);return r&&(t=r[1],i=r[2]),[t,i]}}var ii=["fatal","error","warning","log","info","debug"];function ri(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(", ");
1if(t>=s.length)return r===i.length?s:s.length>t?s.slice(0,t)+"...":s}return""}class si{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 le(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: "+ri(e)}isSeverityLevel(e){return Z(e)&&!X(e)&&ii.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if({}.hasOwnProperty.call(e,t)){var i=e[t];if(xt(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class ni{match(e){return le(e)}coerce(e,t){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+ri(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class ai{match(e){return ae(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 oi{match(e){return oe(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!le(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 ae(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 li="$message",ui="$timestamp",hi=new Set([li,ui]),ci={enabled:!0,max_bytes:32768};function di(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:ci.enabled,max_bytes:vi(e.max_bytes,ci.max_bytes)}:y({},ci)}class pi{constructor(e){this.Vt=[],this.Wt=0,this.Te=di(e)}setConfig(e){this.Te=di(e),this.Zt()}add(e){var t=function(e){var t;try{t=H(e)}catch(e){return}try{var i=JSON.parse(t);if(!K(i))return;var r=i,s=r[li],n=r[ui];if(!Z(s)||0===s.trim().length)return;if(!Z(n)&&!te(n))return;return{step:r,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.Te.max_bytes||(this.Vt.push({step:t.step,bytes:i}),this.Wt+=i,this.Zt())}}getAttachable(){return this.Vt.map(e=>e.step)}clear(){this.Vt=[],this.Wt=0}size(){return this.Vt.length}Zt(){for(;this.Wt>this.Te.max_bytes&&this.Vt.length>0;){var e=this.Vt.shift();e&&(this.Wt-=e.bytes)}}}function vi(e,t){if(!te(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}var gi=function(e,t){var i=(void 0===t?{}:t).debugEnabled,s={k(t){if(r&&(f.DEBUG||r.POSTHOG_DEBUG||i)&&!Y(r.console)&&r.console){for(var s=("__rrweb_original__"in r.console[t]?r.console[t].__rrweb_original__:r.console[t]),n=arguments.length,a=new Array(n>1?n-1:0),o=1;n>o;o++)a[o-1]=arguments[o];s(e,...a)}},debug(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("debug",...t)},info(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("log",...t)},warn(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("warn",...t)},error(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];s.k("error",...t)},critical(){for(var t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning(e){s.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>gi(e+" "+t,i)};return s},fi=gi("[PostHog.js]"),_i=fi.createLogger,mi=_i("[ExternalScriptsLoader]"),yi=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return mi.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");
1if(r)for(var s,n=function(){if(r[o].src===t){var e=r[o];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})}},o=0;r.length>o;o++)if(s=n())return s.v;var l=()=>{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?l():null==a||a.addEventListener("DOMContentLoaded",l)};g.__PosthogExtensions__=g.__PosthogExtensions__||{},g.__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;if("toolbar"===t){var n=3e5;
1s=s+"&t="+Math.floor(Date.now()/n)*n}r=e.requestRouter.endpointFor("assets",s)}yi(e,r,i)}else{var a=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");yi(e,a,i)}},g.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var r=e.requestRouter.endpointFor("api",t);yi(e,r,i)},f.DEBUG=!1,f.LIB_VERSION="1.407.3",f.LIB_NAME="web";var bi="$people_distinct_id",wi="$device_id",xi="$device_model",ki="__alias",Ei="__timers",Si="$autocapture_disabled_server_side",Pi="$heatmaps_enabled_server_side",Ti="$exception_capture_enabled_server_side",Fi="$error_tracking_suppression_rules",$i="$error_tracking_capture_extension_exceptions",Ii="$web_vitals_enabled_server_side",Mi="$dead_clicks_enabled_server_side",Ri="$product_tours_enabled_server_side",Ci="$web_vitals_allowed_metrics",Oi="$session_recording_remote_config",Ai="$replay_sample_rate",Li="$replay_override_sampling",Di="$replay_override_linked_flag",Ni="$replay_override_url_trigger",ji="$replay_override_event_trigger",qi="$sesid",zi="$session_is_sampled",Hi="$enabled_feature_flags",Gi="$active_feature_flags",Bi="$early_access_features",Ui="$feature_flag_details",Vi="$feature_flag_payloads",Wi="$feature_flag_request_id",Ki="$minimal_flag_called_events",Ji="$override_feature_flags",Yi="$override_feature_flag_payloads",Zi="$stored_person_properties",Xi="$stored_group_properties",Qi="$surveys",er="$surveys_loaded_at",tr="$surveys_activated",ir="$surveys_activated_session",rr="ph_product_tours",sr="$flag_call_reported",nr="$flag_call_reported_session_id",ar="$feature_flag_errors",or="$feature_flag_evaluated_at",lr="$user_state",ur="$client_session_props",hr="$capture_rate_limit",cr="$initial_campaign_params",dr="$initial_referrer_info",pr="$initial_person_info",vr="$epp",gr="$posthog_cookieless",fr="$cookieless_mode",_r="$sdk_debug_extensions_init_method",mr="$sdk_debug_extensions_init_time_ms",yr="$sdk_debug_recording_script_not_loaded",br="PostHog loadExternalDependency extension not found.",wr="on_reject",xr="always",kr="anonymous",Er="identified",Sr="identified_only",Pr="visibilitychange",Tr="beforeunload",Fr="$pageview",$r="$pageleave",Ir="$identify",Mr="$groupidentify";function Rr(e,t){V(e)&&e.forEach(t)}function Cr(e,t){if(!ee(e))if(V(e))e.forEach(t);else if((e=>e instanceof FormData)(e))e.forEach((e,i)=>t(e,i));else for(var i in e)B.call(e,i)&&t(e[i],i)}var Or=function(e){for(var t=arguments.length,i=new 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 Ar(e){for(var t=Object.keys(e),i=t.length,r=new Array(i);i--;)r[i]=[t[i],e[t[i]]];return r}var Lr=function(e){try{return e()}catch(e){return}},Dr=function(e){return function(){try{for(var t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,i)}catch(e){fi.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),fi.critical(e)}}},Nr=function(e){var t={};return Cr(e,function(e,i){(Z(e)&&e.length>0||te(e))&&(t[i]=e)}),t},jr=["herokuapp.com","vercel.app","netlify.app"];function qr(e){var t=null==e?void 0:e.hostname;if(!Z(t))return!1;var i=t.split(".").slice(-2).join(".");for(var r of jr)if(i===r)return!1;return!0}function zr(e,t,i,r){var s=null!=r?r:{},n=s.capture,a=s.passive;null==e||e.addEventListener(t,i,{capture:void 0!==n&&n,passive:void 0===a||a})}function Hr(e){return"ph_toolbar_internal"===e.name}var Gr=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}};Math.trunc||(Math.trunc=function(e){return 0>e?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return te(e)&&isFinite(e)&&Math.floor(e)===e});class Br{constructor(e){if(this.bytes=e,16!==e.length)throw new 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 new RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/Math.pow(2,40),s[1]=e/Math.pow(2,32),s[2]=e/Math.pow(2,24),s[3]=e/Math.pow(2,16),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 Br(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 new Error("Invalid UUIDv7 was generated");return e}clone(){return new Br(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 Ur{generate(){var e=this.generateOrAbort();if(!Y(e))return e;this.S=0;var t=this.generateOrAbort();if(Y(t))throw new Error("Could not generate UUID after timestamp reset");return t}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.C();else{if(this.S>=e+1e4)return;this.I++,this.I>4398046511103&&(this.S++,this.C())}return Br.fromFieldsV7(this.S,Math.trunc(this.I/Math.pow(2,30)),this.I&Math.pow(2,30)-1,this.M.nextUint32())}C(){this.I=1024*this.M.nextUint32()+(1023&this.M.nextUint32())}constructor(){this.S=0,this.I=0,this.M=new Kr}}var Vr,Wr=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};r&&!Y(r.crypto)&&crypto.getRandomValues&&(Wr=e=>crypto.getRandomValues(e));class Kr{nextUint32(){return this.R.length>this.O||(Wr(this.R),this.O=0),this.R[this.O++]}constructor(){this.R=new Uint32Array(8),this.O=1/0}}var Jr=()=>Yr().toString(),Yr=()=>(Vr||(Vr=new Ur)).generate(),Zr="",Xr=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,Qr={N:()=>!!a,D(e){fi.error("cookieStore error: "+e)},A:Gr,F(e){var t;try{t=JSON.parse(Qr.A(e))||{}}catch(e){}return t},q(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),Zr)return Zr;if(!t)return"";if(["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),r=Math.min(i.length,8),s="dmn_chk_"+Jr();!Zr&&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",Zr=n)}return Zr}(e);if(!i){var r=(e=>{var t=e.match(Xr);return t?t[0]:""})(e);r!==i&&fi.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}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 h=e+"="+encodeURIComponent(JSON.stringify(t))+n+"; SameSite=Lax; path=/"+l+o;return h.length>3686.4&&fi.warn("cookieStore warning: large cookie, len="+h.length),a.cookie=h,!0}catch(e){return!1}},P(e,t){if(null!=a&&a.cookie)try{Qr.q(e,"",-1,t)}catch(e){return}}},es=null,ts={N(){if(!Q(es))return es;var e=!0;if(Y(r))e=!1;else try{var t="__mplssupport__";ts.q(t,"xyz"),'"xyz"'!==ts.A(t)&&(e=!1),ts.P(t)}catch(t){e=!1}return e||fi.error("localStorage unsupported; falling back to cookie store"),es=e,e},D(e){fi.error("localStorage error: "+e)},A(e){try{return null==r?void 0:r.localStorage.getItem(e)}catch(e){ts.D(e)}return null},F(e){try{return JSON.parse(ts.A(e))||{}}catch(e){}return null},q(e,t){try{return null==r||r.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){ts.D(e)}return!1},P(e){try{null==r||r.localStorage.removeItem(e)}catch(e){ts.D(e)}}},is=[wi,"distinct_id",qi,zi,vr,pr,lr],rs={},ss={N:()=>!0,D(e){fi.error("memoryStorage error: "+e)},A:e=>rs[e]||null,F:e=>rs[e]||null,q:(e,t)=>(rs[e]=t,!0),P(e){delete rs[e]}},ns=null,as={N(){if(!Q(ns))return ns;if(ns=!0,Y(r))ns=!1;else try{var e="__support__";as.q(e,"xyz"),'"xyz"'!==as.A(e)&&(ns=!1),as.P(e)}catch(e){ns=!1}return ns},D(e){fi.error("sessionStorage error: ",e)},A(e){try{return null==r?void 0:r.sessionStorage.getItem(e)}catch(e){as.D(e)}return null},F(e){try{return JSON.parse(as.A(e))||null}catch(e){}return null},q(e,t){try{return null==r||r.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){as.D(e)}return!1},P(e){try{null==r||r.sessionStorage.removeItem(e)}catch(e){as.D(e)}}};class os{constructor(e){this._instance=e}get Te(){return this._instance.config}get consent(){return this.Gt()?0:this.Qt}isOptedOut(){return this.Te.cookieless_mode===xr||this.isRejected()||-1===this.consent&&this.Te.cookieless_mode===wr}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Te.opt_out_capturing_by_default}optInOut(e){this.Jt.q(this.Kt,e?1:0,this.Te.cookie_expiration,this.Te.cross_subdomain_cookie,this.Te.secure_cookie)}reset(){this.Jt.P(this.Kt,this.Te.cross_subdomain_cookie)}get Kt(){var e=this._instance.config,t=e.token,i=e.opt_out_capturing_cookie_prefix;return e.consent_persistence_name||(i?i+t:"__ph_opt_in_out_"+t)}get Qt(){var e=this.Jt.A(this.Kt);return he(e)?1:j(ce,e)?0:-1}get Jt(){var e=this.Te.opt_out_capturing_persistence_type,t="localStorage"===e?ts:Qr;if(!this.Yt||this.Yt!==t){this.Yt=t;var i="localStorage"===e?Qr:ts;i.A(this.Kt)&&(this.Yt.A(this.Kt)||this.optInOut(he(i.A(this.Kt))),i.P(this.Kt,this.Te.cross_subdomain_cookie))}return this.Yt}Gt(){return!!this.Te.respect_dnt&&[null==n?void 0:n.doNotTrack,null==n?void 0:n.msDoNotTrack,g.doNotTrack].some(e=>he(e))}}function ls(e,t){var i,r=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!W(r))return t;try{var s=r(t);return Z(s)&&s?s:t}catch(e){return fi.error("Error in get_current_url, falling back to window.location.href",e),t}}var us="__POSTHOG_TOOLBAR__";function hs(e){return e instanceof Element&&(e.id===us||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function cs(e){return!!e&&1===e.nodeType}function ds(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function ps(e){return!!e&&3===e.nodeType}function vs(e){return!!e&&11===e.nodeType&&cs(e.host)}function gs(e){return e?q(e).split(/\s+/):[]}function fs(e,t){var i=function(e){var t,i=null==r||null==(t=r.location)?void 0:t.href;return Y(i)?void 0:ls(e,i)}(t);return!!(i&&e&&e.some(e=>i.match(e)))}function _s(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 gs(t)}function ms(e){return ee(e)?null:q(e).split(/(\s+)/).filter(e=>zs(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ys(e){var t="";return Cs(e)&&!Os(e)&&e.childNodes&&e.childNodes.length&&Cr(e.childNodes,function(e){var i;ps(e)&&e.textContent&&(t+=null!==(i=ms(e.textContent))&&void 0!==i?i:"")}),q(t)}function bs(e){var t;return Y(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var ws=["a","button","form","input","select","textarea","label"];function xs(e,t){if(Y(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 ks(e){var t=e.parentNode;return!(!t||!cs(t))&&t}var Es=[".ph-no-autocapture","[data-ph-no-autocapture]"],Ss=["next","previous","prev",">","<"],Ps=[...Ss,"+","-","−","–"],Ts=(e,t)=>/[a-z0-9]/i.test(t)?e.includes(t):e===t,Fs=[".ph-no-rageclick",".ph-no-capture"],$s=["","text","search","email","password","url","tel","number"];function Is(e,t){if(!r||Ms(e))return!1;var i,s,n,a,o;if(re(t)?(i=!!t&&Fs,s=void 0,n=!1):(i=null!==(a=null==t?void 0:t.css_selector_ignorelist)&&void 0!==a?a:Fs,s=null==t?void 0:t.content_ignorelist,n=null!==(o=null==t?void 0:t.ignore_text_selection)&&void 0!==o&&o),!1===i)return!1;if(n&&function(e){return!(!e||!cs(e))&&(!!ds(e,"textarea")||(ds(e,"input")?j($s,(e.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(e)))}(e))return!1;var l=Rs(e,!1).targetElementList;return!function(e,t){if(!1===e||Y(e))return!1;var i;if(!0===e)i=Ss;else{if(!V(e))return!1;if(e.length>10)return fi.error("[PostHog] content_ignorelist array cannot exceed 10 items. Use css_selector_ignorelist for more complex matching."),!1;i=e.map(e=>e.toLowerCase())}return t.some(e=>{var t=e.safeText,r=e.ariaLabel;return i.some(e=>Ts(t,e)||Ts(r,e))})}(s,l.map(e=>{var t;return{safeText:ys(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!xs(l,i)}var Ms=e=>!e||ds(e,"html")||!cs(e),Rs=(e,t)=>{if(!r||Ms(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,s=[e],n=e;n.parentNode&&!ds(n,"body");)if(vs(n.parentNode))s.push(n.parentNode.host),n=n.parentNode.host;else{var a=ks(n);if(!a)break;if(t||ws.indexOf(a.tagName.toLowerCase())>-1)i=!0;else try{var o=r.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}catch(e){}s.push(a),n=a}return{parentIsUsefulElement:i,targetElementList:s}};function Cs(e){for(var t=new Set,i=0,r=e;r.parentNode&&!ds(r,"body");r=r.parentNode){if(i++>=1e3||t.has(r))return!1;t.add(r);var s=_s(r);if(j(s,"ph-sensitive")||j(s,"ph-no-capture"))return!1}if(j(_s(e),"ph-include"))return!0;var n=e.type||"";if(Z(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}
1var a=e.name||e.id||"";return!Z(a)||!/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(a.replace(/[^a-zA-Z0-9]/g,""))}function Os(e){return!!(ds(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ds(e,"select")||ds(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var As="(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})",Ls=new RegExp("^(?:"+As+")$"),Ds=new RegExp(As),Ns="\\d{3}-?\\d{2}-?\\d{4}",js=new RegExp("^("+Ns+")$"),qs=new RegExp("("+Ns+")");function zs(e,t){if(void 0===t&&(t=!0),ee(e))return!1;if(Z(e)){if(e=q(e),(t?Ls:Ds).test((e||"").replace(/[- ]/g,"")))return!1;if((t?js:qs).test(e))return!1}return!0}function Hs(e){var t=ys(e);return zs(t=(t+" "+Gs(e)).trim())?t:""}function Gs(e){var t="";return e&&e.childNodes&&e.childNodes.length&&Cr(e.childNodes,function(e){var i;if(e&&"span"===(null==(i=e.tagName)?void 0:i.toLowerCase()))try{var r=ys(e);t=(t+" "+r).trim(),e.childNodes&&e.childNodes.length&&(t=(t+" "+Gs(e)).trim())}catch(e){fi.error("[AutoCapture]",e)}}),t}function Bs(e){return e.replace(/"|\\"/g,'\\"')}function Us(e){var t=e.attr__class;if(t)return V(t)?t:gs(t)}var Vs=_i("[Dead Clicks]"),Ws=()=>!0,Ks=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(Mi)),r=e.instance.config.capture_dead_clicks;return re(r)?r:!!K(r)||i};class Js{get lazyLoadedDeadClicksAutocapture(){return this.Xt}constructor(e,t,i){this.instance=e,this.isEnabled=t,this.onCapture=i,this.startIfEnabledOrStop()}onRemoteConfig(e){if(e.ok){var t=e.config;"captureDeadClicks"in t&&(this.instance.persistence&&this.instance.persistence.register({[Mi]:t.captureDeadClicks}),this.startIfEnabledOrStop())}}startIfEnabledOrStop(){this.isEnabled(this)?this.er(()=>{this.tr()}):this.stop()}er(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?Vs.error("failed to load script",t):e()})}tr(){var e;if(a){if(!this.Xt&&null!=(e=g.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=K(this.instance.config.capture_dead_clicks)?y({},this.instance.config.capture_dead_clicks):{};t.__onCapture=this.onCapture,this.onCapture&&(t.capture_dead_swipes=!1),this.Xt=g.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Xt.start(a),Vs.info("starting...")}}else Vs.error("`document` not found. Cannot start.")}stop(){this.Xt&&(this.Xt.stop(),this.Xt=void 0,Vs.info("stopping..."))}}var Ys=_i("[SegmentIntegration]"),Zs="posthog-js";function Xs(e,t){var i=void 0===t?{}:t,r=i.organization,s=i.projectId,n=i.prefix,a=i.severityAllowList,o=void 0===a?["error"]:a,l=i.sendExceptionsToPostHog,u=void 0===l||l;return t=>{var i,a,l,h,c;if("*"!==o&&!o.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var d=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/person/"+e.get_distinct_id());t.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var p,v=(null==(i=t.exception)?void 0:i.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})),f={$exception_message:(null==(a=v[0])?void 0:a.value)||t.message,$exception_type:null==(l=v[0])?void 0:l.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(h=v[0])?void 0:h.value)||t.message,$sentry_exception_type:null==(c=v[0])?void 0:c.type,$sentry_tags:t.tags};return r&&s&&(f.$sentry_url=(n||"https://sentry.io/organizations/")+r+"/issues/?project="+s+"&query="+t.event_id),u&&(null==(p=e.exceptions)||p.sendExceptionEvent(f)),t}}class Qs{constructor(e,t,i,r,s,n){this.name=Zs,this.setupOnce=function(a){a(Xs(e,{organization:t,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}class en{constructor(e){this.rr=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(fi.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.ir=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.nr()}nr(){var e;this.sr=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.rr)}destroy(){var e;null==(e=this.sr)||e.call(this),this.sr=void 0}doPageView(e,t){var i,s=this.ar(e,t);return this.ir={pathname:null!==(i=null==r?void 0:r.location.pathname)&&void 0!==i?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),s}doPageLeave(e){var t;return this.ar(e,null==(t=this.ir)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.ir)?void 0:e.pageViewId}}ar(e,t){var i=this.ir;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 n=s.maxScrollHeight,a=s.lastScrollY,o=s.maxScrollY,l=s.maxContentHeight,u=s.lastContentY,h=s.maxContentY;if(!(Y(n)||Y(a)||Y(o)||Y(l)||Y(u)||Y(h))){n=Math.ceil(n),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),h=Math.ceil(h);var c=n>1?de(a/n,0,1,fi):1,d=n>1?de(o/n,0,1,fi):1,p=l>1?de(u/l,0,1,fi):1,v=l>1?de(h/l,0,1,fi):1;r=Or(r,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:c,$prev_pageview_max_scroll:o,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:v})}}return i.pathname&&(r.$prev_pageview_pathname=i.pathname),i.timestamp&&(r.$prev_pageview_duration=(e.getTime()-i.timestamp.getTime())/1e3),r}}var tn=["flags","surveys"],rn={[bi]:{exposure:"hidden"},[ki]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[Ei]:{exposure:"hidden"},[Si]:{exposure:"event"},[Pi]:{exposure:"hidden"}
1,[Ti]:{exposure:"event"},[Fi]:{exposure:"hidden"},[$i]:{exposure:"event"},[Ii]:{exposure:"event"},[Mi]:{exposure:"event"},[Ri]:{exposure:"hidden"},[Ci]:{exposure:"event"},[Oi]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[qi]:{exposure:"hidden"},[zi]:{exposure:"event"},[Ai]:{exposure:"event",shouldSkipFromEventProperties:e=>Q(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"},[Hi]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!K(e))return{};for(var t={},i=Object.keys(e),r=0;i.length>r;r++)t["$feature/"+i[r]]=e[i[r]];return t}},[Gi]:{exposure:"event",storageGroup:"flags"},[Bi]:{exposure:"hidden"},[Ui]:{exposure:"hidden",storageGroup:"flags"},[Vi]:{exposure:"event",storageGroup:"flags"},[Wi]:{exposure:"event",storageGroup:"flags",volatile:!0},[Ki]:{exposure:"hidden",storageGroup:"flags"},[Ji]:{exposure:"event"},[Yi]:{exposure:"hidden"},[Zi]:{exposure:"hidden"},[Xi]:{exposure:"hidden"},[Qi]:{exposure:"hidden",storageGroup:"surveys"},[er]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[tr]:{exposure:"event"},[ir]:{exposure:"hidden"},[rr]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$product_tours_activated_session:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[sr]:{exposure:"hidden"},[nr]:{exposure:"hidden"},[ar]:{exposure:"hidden"},[or]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[lr]:{exposure:"hidden"},[ur]:{exposure:"hidden"},[hr]:{exposure:"hidden"},[cr]:{exposure:"hidden"},[dr]:{exposure:"hidden"},[pr]:{exposure:"hidden"},[vr]:{exposure:"hidden"},[Li]:{exposure:"event"},[Di]:{exposure:"event"},[Ni]:{exposure:"event"},[ji]:{exposure:"event"},[_r]:{exposure:"event"},[mr]:{exposure:"event"},[yr]:{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"}},sn=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],nn=e=>{var t=rn[e];if(t)return t;for(var i of sn){var r=i[1];if(0===e.indexOf(i[0]))return r}},an=(e,t)=>{try{return JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t)}catch(t){return H(e)}},on=e=>{var t=null==a?void 0:a.createElement("a");return Y(t)?null:(t.href=e,t)},ln=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(!V(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(e){fi.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},un=function(e,t,i){if(!e||!t||!t.length)return e;for(var r=e.split("#"),s=r[1],n=(r[0]||"").split("?"),a=n[1],o=n[0],l=(a||"").split("&"),u=[],h=0;l.length>h;h++){var c=l[h].split("=");V(c)&&(t.includes(c[0])?u.push(c[0]+"="+i):u.push(l[h]))}var d=o;return null!=a&&(d+="?"+u.join("&")),null!=s&&(d+="#"+s),d},hn=function(e,t){var i=e.match(new RegExp(t+"=([^&]*)"));return i?i[1]:null},cn=(e,t)=>e>=t&&p(),dn=(e,t,i,r)=>{if(0===e){if(p()){var s=t+1;return s===i&&r(),s}return t}return 0},pn="https?://(.*)",vn=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],gn=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...vn],fn="<masked>",_n=["li_fat_id"];function mn(e,t,i){if(!a)return{};var r,s=t?[...vn,...i||[]]:[],n=yn(un(a.URL,s,fn),e),o=(r={},Cr(_n,function(e){var t=Gr(e);r[e]=t||null}),r);return Or(o,n)}function yn(e,t){var i=gn.concat(t||[]),r={};return Cr(i,function(t){var i=ln(e,t);r[t]=i||null}),r}function bn(e){var t=function(e){return e?0===e.search(pn+"google.([^/?]*)")?"google":0===e.search(pn+"bing.com")?"bing":0===e.search(pn+"yahoo.com")?"yahoo":0===e.search(pn+"duckduckgo.com")?"duckduckgo":null:null}(e),i="yahoo"!=t?"q":"p",r={};if(!Q(t)){r.$search_engine=t;var s=a?ln(a.referrer,i):"";s.length&&(r.ph_keyword=s)}return r}function wn(){return navigator.language||navigator.userLanguage}var xn="$direct";function kn(){return(null==a?void 0:a.referrer)||xn}function En(e,t,i){void 0===i&&(i=!1);var r=e?[...vn,...t||[]]:[],s=i?bt(null==o?void 0:o.href):null==o?void 0:o.href,n=null==s?void 0:s.substring(0,1e3);return{r:kn().substring(0,1e3),u:n?un(n,r,fn):void 0}}function Sn(e,t){var i;void 0===t&&(t=!1);var r=e.r,s=e.u,n=t?bt(s):s,a={$referrer:r,$referring_domain:null==r?void 0:r==xn?xn:null==(i=on(r))?void 0:i.host};
1if(n){a.$current_url=n;var o=on(n);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname;var l=yn(n);Or(a,l)}if(r){var u=bn(r);Or(a,u)}return a}function Pn(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}function Tn(){try{return(new Date).getTimezoneOffset()}catch(e){return}}var Fn={flags:or,surveys:er},$n=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],In="main";class Mn{constructor(e,t,i){if(void 0===i&&(i=!0),this.lr={},this.ur=!1,this.hr=!1,this.Te=e,this.dr=i,this.props={},this.cr=!1,this.vr=(e=>{var t="";return e.token&&(t=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+t+"_posthog"})(e),this.Jt=this.pr(e),this.hr=this.gr(e),this.load(),e.debug&&fi.info("Persistence loaded",e.persistence,y({},this.props)),this.update_config(e,e,t),this.save(),r){var s=()=>this.flush();zr(r,"beforeunload",s,{capture:!1}),zr(r,"pagehide",s,{capture:!1})}}mr(){var e,t=null==(e=this.Te)?void 0:e.persistence_save_debounce_ms;return te(t)&&t>0?t:0}isDisabled(){return!!this.yr}pr(e){-1===$n.indexOf(e.persistence.toLowerCase())&&(fi.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i=function(e,t){void 0===e&&(e=[]),void 0===t&&(t=!1);var i=[...is,...e];return y({},ts,{F(e){try{var i={};try{i=Qr.F(e)||{}}catch(e){}var r,s=JSON.parse(ts.A(e)||"{}");if(t){var n={};for(var a in i){var o=i[a];Q(o)||""===o||(n[a]=o)}r=Or(s,n)}else r=Or(i,s);return ts.q(e,r),r}catch(e){}return null},q(e,t,r,s,n,a){var o=ts.q(e,t,void 0,void 0,a);try{var l={};i.forEach(e=>{t[e]&&(l[e]=t[e])}),Object.keys(l).length&&Qr.q(e,l,r,s,n,a)}catch(e){ts.D(e)}return o},P(e,t){try{null==r||r.localStorage.removeItem(e),Qr.P(e,t)}catch(e){ts.D(e)}}})}(e.cookie_persisted_properties||[],e.__preview_cookie_wins_on_conflict||!1),s=!1,n=e.persistence.toLowerCase();return"localstorage"===n&&ts.N()?(t=ts,s=!0):"localstorage+cookie"===n&&i.N()?(t=i,s=!0):"sessionstorage"===n&&as.N()?t=as:"memory"===n?t=ss:"cookie"===n?t=Qr:i.N()?(t=i,s=!0):t=Qr,this.ur=s,t}br(e){return this.vr+"__"+e}gr(e){return this.ur&&!!e.split_storage}_r(e){var t=null!=e?e:this.Te.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var i=this.props[or];return!i||"number"!=typeof i||Date.now()-i>t}properties(){var e={};return Cr(this.props,(t,i)=>{var r=nn(i);if("derived"===(null==r?void 0:r.exposure)){if(null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(t,i===Hi?()=>this._r():()=>!1))return;r.transformToEventProperties&&Or(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.yr){var e=this.Jt.F(this.vr);e&&(this.props=Or({},e)),this.hr&&this.wr()}}wr(){for(var e of tn){var t=ts.F(this.br(e));if(t&&!J(t)){var i=this.kr(e);i.persisted=!0,this.Sr(e)||(i.fingerprint=this.Cr(t,e)),this.Tr(e,t)||Or(this.props,t)}}}Sr(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=nn(t))?void 0:i.storageGroup)===e})}Tr(e,t){var i=Fn[e];if(!i)return!1;var r=t[i],s=this.props[i];return te(r)&&te(s)&&s>r}refreshKey(e){var t;if(!this.yr){var i=this.hr?null==(t=nn(e))?void 0:t.storageGroup:void 0,r=i?ts.F(this.br(i)):this.Jt.F(this.vr);if(r&&e in r)this.Ir(e,r[e]);else{if(i){var s=this.Jt.F(this.vr);if(s&&e in s)return void this.Ir(e,s[e])}this.Mr(e)}}}save(){if(!this.yr){var e=this.mr();e>0?Y(this.Er)&&(this.Er=setTimeout(()=>{this.Er=void 0,this.Rr()},e)):this.Rr()}}flush(){Y(this.Er)||(clearTimeout(this.Er),this.Er=void 0,this.Rr())}Rr(){this.yr||(this.hr?this.Pr():this.Or(this.Jt,this.vr,this.props,In))}Pr(){var e=this.Fr(),t=e.main,i=e.groups;for(var r of(this.Or(this.Jt,this.vr,t,In),tn)){var s,n=i[r];(!J(n)||null!=(s=this.lr[r])&&s.persisted)&&this.Or(ts,this.br(r),n,r)}}Fr(){var e={},t={flags:{},surveys:{}};return Cr(this.props,(i,r)=>{var s,n=null==(s=nn(r))?void 0:s.storageGroup;n?t[n][r]=i:e[r]=i}),{main:e,groups:t}}Cr(e,t){if(t===In)return JSON.stringify(e)+"|"+this.Lr+"|"+this.$r+"|"+this.Ar;var i={};return Cr(e,(e,t)=>{var r;i[t]=null!=(r=nn(t))&&r.volatile?"__volatile__":e}),JSON.stringify(i)}Or(e,t,i,r){var s=this.kr(r);if(r===In||s.dirty||Y(s.fingerprint)){var n;try{if((n=this.Cr(i,r))===s.fingerprint)return void(s.dirty=!1)}catch(e){n=void 0}e.q(t,i,this.Lr,this.$r,this.Ar,this.Te.debug)?(s.dirty=!1,r!==In&&(s.persisted=!0),Y(n)||(s.fingerprint=n)):this.Te.debug&&fi.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var t=(void 0===e?{}:e).keepGroupEntries,i=void 0!==t&&t;if(Y(this.Er)||(clearTimeout(this.Er),this.Er=void 0),this.Jt.P(this.vr,!1),this.Jt.P(this.vr,!0),!i&&this.dr)for(var r of tn)ts.P(this.br(r));i?delete this.lr[In]:this.lr={}}clear(){this.remove(),this.props={}}register_once(e,t,i){if(K(e)){Y(t)&&(t="None"),this.Lr=Y(i)?this.Nr:i;var r=!1;if(Cr(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.Ir(i,e),r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(K(e)){this.Lr=Y(t)?this.Nr:t;var i=!1;if(Cr(e,(t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.Ir(r,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.Mr(e),this.save())}update_campaign_params(){if(!this.cr){var e=mn(this.Te.custom_campaign_params,this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties);J(Nr(e))||this.register(e),this.cr=!0}}update_search_keyword(){var e;this.register((e=null==a?void 0:a.referrer)?bn(e):{})}update_referrer_info(){var e;this.register_once({$referrer:kn(),$referring_domain:null!=a&&a.referrer&&(null==(e=on(a.referrer))?void 0:e.host)||xn},void 0)}set_initial_person_info(){this.props[cr]||this.props[dr]||this.register_once({[pr]:En(this.Te.mask_personal_data_properties,this.Te.custom_personal_data_properties,this.Te.disable_capture_url_hashes
1)},void 0)}get_initial_props(){var e={};Cr([dr,cr],t=>{var i=this.props[t];i&&Cr(i,function(t,i){e["$initial_"+z(i)]=t})});var t=this.props[pr];if(t){var i=function(e,t){void 0===t&&(t=!1);var i=Sn(e,t),r={};return Cr(i,function(e,t){r["$initial_"+z(t)]=e}),r}(t,this.Te.disable_capture_url_hashes);Or(e,i)}return e}safe_merge(e){return Cr(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){this.Nr=this.Lr=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.pr(e):this.Jt,n=this.gr(e);if(r||n!==this.hr){var a=this.props;this.clear(),this.Jt=s,this.hr=n,this.props=a,this.save()}}set_disabled(e){this.yr=e,this.yr?this.remove():this.save()}set_cross_subdomain(e){e!==this.$r&&(this.$r=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.Ar&&(this.Ar=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[Ei]||{};i[e]=t,this.Ir(Ei,i),this.save()}remove_event_timer(e){var t=this.props[Ei]||{},i=t[e];return Y(i)||(delete t[e],this.Ir(Ei,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.Ir(e,t),this.save()}Ir(e,t){var i;this.props[e]=t,null!=(i=nn(e))&&i.volatile||this.Dr(e)}Mr(e){delete this.props[e],this.Dr(e)}Dr(e){var t,i=null==(t=nn(e))?void 0:t.storageGroup;i&&(this.kr(i).dirty=!0)}kr(e){return this.lr[e]||(this.lr[e]={})}}var Rn="gzip-js",Cn="base64",On="events",An="cancelEvents",Ln="survey shown",Dn="survey dismissed",Nn="survey sent",jn="$survey_last_seen_date",qn="popover",zn=_i("[RateLimiter]");class Hn{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=>{zn.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void zn.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){var t,i,r;void 0===e&&(e=!1);var s=this.captureEventsBurstLimit,n=this.captureEventsPerSecond,a=(new Date).getTime(),o=null!==(t=null==(i=this.instance.persistence)?void 0:i.get_property(hr))&&void 0!==t?t:{tokens:s,last:a};o.tokens+=(a-o.last)/1e3*n,o.last=a,o.tokens>s&&(o.tokens=s);var l=1>o.tokens;return l||e||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+n+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(hr,o),{isRateLimited:l,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var Gn=_i("[RemoteConfig]");class Bn{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=g._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}qr(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}jr(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 Gn.info("Using preloaded remote config",this.remoteConfig),this.Hr(this.remoteConfig),void this.Br();if(this._instance.Ur())return void Gn.warn("Remote config is disabled. Falling back to local config.");this.qr(e=>{if(!e)return Gn.info("No config found after loading remote JS config. Falling back to JSON."),void this.jr(e=>{this.Hr(e),this.Br()});this.Hr(e),this.Br()})}catch(e){Gn.error("Error loading remote config",e)}}stop(){this.zr&&(clearInterval(this.zr),this.zr=void 0)}
vendor: 4,281 bytes, line 1
1refresh(){!this._instance.Ur()&&a&&"hidden"!==a.visibilityState&&this._instance.reloadFeatureFlags()}Br(){var e;if(!this.zr){var t=null!==(e=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==e?e:3e5;0!==t&&(this.zr=setInterval(()=>{this.refresh()},t))}}Hr(e){var t;e||Gn.error("Failed to fetch remote config from PostHog."),this._instance.Hr(e?{ok:!0,config:e}:{ok:!1}),!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 Un=Uint8Array,Vn=Uint16Array,Wn=Uint32Array,Kn=new Un([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]),Jn=new Un([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]),Yn=new Un([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Zn=function(e,t){for(var i=new Vn(31),r=0;31>r;++r)i[r]=t+=1<<e[r-1];var s=new Wn(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]},Xn=Zn(Kn,2),Qn=Xn[1];Xn[0][28]=258,Qn[258]=28;for(var ea=Zn(Jn,0)[1],ta=new Vn(32768),ia=0;32768>ia;++ia){var ra=(43690&ia)>>>1|(21845&ia)<<1;ta[ia]=((65280&(ra=(61680&(ra=(52428&ra)>>>2|(13107&ra)<<2))>>>4|(3855&ra)<<4))>>>8|(255&ra)<<8)>>>1}var sa=function(e,t,i){for(var r=e.length,s=0,n=new Vn(t);r>s;++s)++n[e[s]-1];var a,o=new Vn(t);for(s=0;t>s;++s)o[s]=o[s-1]+n[s-1]<<1;if(i){a=new Vn(1<<t);var l=15-t;for(s=0;r>s;++s)if(e[s])for(var u=s<<4|e[s],h=t-e[s],c=o[e[s]-1]++<<h,d=c|(1<<h)-1;d>=c;++c)a[ta[c]>>>l]=u}else for(a=new Vn(r),s=0;r>s;++s)a[s]=ta[o[e[s]-1]++]>>>15-e[s];return a},na=new Un(288);for(ia=0;144>ia;++ia)na[ia]=8;for(ia=144;256>ia;++ia)na[ia]=9;for(ia=256;280>ia;++ia)na[ia]=7;for(ia=280;288>ia;++ia)na[ia]=8;var aa=new Un(32);for(ia=0;32>ia;++ia)aa[ia]=5;var oa=sa(na,9,0),la=sa(aa,5,0),ua=function(e){return(e/8|0)+(7&e&&1)},ha=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var r=new(e instanceof Vn?Vn:e instanceof Wn?Wn:Un)(i-t);return r.set(e.subarray(t,i)),r},ca=function(e,t,i){var r=t/8|0;e[r]|=i<<=7&t,e[r+1]|=i>>>8},da=function(e,t,i){var r=t/8|0;e[r]|=i<<=7&t,e[r+1]|=i>>>8,e[r+2]|=i>>>16},pa=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 Un(0),0];if(1==s){var a=new Un(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var o=i[0],l=i[1],u=0,h=1,c=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};h!=s-1;)o=i[i[c].f>i[u].f?u++:c++],l=i[u!=h&&i[c].f>i[u].f?u++:c++],i[h++]={s:-1,f:o.f+l.f,l:o,r:l};var d=n[0].s;for(r=1;s>r;++r)n[r].s>d&&(d=n[r].s);var p=new Vn(d+1),v=va(i[h-1],p,0);if(v>t){r=0;var g=0,f=v-t,_=1<<f;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});s>r;++r){var m=n[r].s;if(t>=p[m])break;g+=_-(1<<v-p[m]),p[m]=t}for(g>>>=f;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 Un(p),v]},va=function(e,t,i){return-1==e.s?Math.max(va(e.l,t,i+1),va(e.r,t,i+1)):t[e.s]=i},ga=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new Vn(++t),r=0,s=e[0],n=1,a=function(e){i[r++]=e},o=1;t>=o;++o)if(e[o]==s&&o!=t)++n;else{if(!s&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(s),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(s);n=1,s=e[o]}return[i.subarray(0,r),t]},fa=function(e,t){for(var i=0,r=0;t.length>r;++r)i+=e[r]*t[r];return i},_a=function(e,t,i){var r=i.length,s=ua(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)},ma=function(e,t,i,r,s,n,a,o,l,u,h){ca(t,h++,i),++s[256];for(var c=pa(s,15),d=c[0],p=c[1],v=pa(n,15),g=v[0],f=v[1],_=ga(d),m=_[0],y=_[1],b=ga(g),w=b[0],x=b[1],k=new Vn(19),E=0;m.length>E;++E)k[31&m[E]]++;for(E=0;w.length>E;++E)k[31&w[E]]++;for(var S=pa(k,7),P=S[0],T=S[1],F=19;F>4&&!P[Yn[F-1]];--F);var $,I,M,R,C=u+5<<3,O=fa(s,na)+fa(n,aa)+a,A=fa(s,d)+fa(n,g)+a+14+3*F+fa(k,P)+(2*k[16]+3*k[17]+7*k[18]);if(O>=C&&A>=C)return _a(t,h,e.subarray(l,l+u));if(ca(t,h,1+(O>A)),h+=2,O>A){$=sa(d,p,0),I=d,M=sa(g,f,0),R=g;var L=sa(P,T,0);for(ca(t,h,y-257),ca(t,h+5,x-1),ca(t,h+10,F-4),h+=14,E=0;F>E;++E)ca(t,h+3*E,P[Yn[E]]);h+=3*F;for(var D=[m,w],N=0;2>N;++N){var j=D[N];for(E=0;j.length>E;++E)ca(t,h,L[q=31&j[E]]),h+=P[q],q>
115&&(ca(t,h,j[E]>>>5&127),h+=j[E]>>>12)}}else $=oa,I=na,M=la,R=aa;for(E=0;o>E;++E)if(r[E]>255){var q;da(t,h,$[257+(q=r[E]>>>18&31)]),h+=I[q+257],q>7&&(ca(t,h,r[E]>>>23&31),h+=Kn[q]);var z=31&r[E];da(t,h,M[z]),h+=R[z],z>3&&(da(t,h,r[E]>>>5&8191),h+=Jn[z])}else da(t,h,$[r[E]]),h+=I[r[E]];return da(t,h,$[256]),h+I[256]},ya=new Wn([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),ba=function(){for(var e=new Wn(256),t=0;256>t;++t){for(var i=t,r=9;--r;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e}(),wa=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},xa=!!u||!!l,ka="text/plain",Ea=!1,Sa=(e,t)=>{var i=e.split("#"),r=i[1],s=i[0].split("?"),n=s[0],a=s[1];if(!a)return e;var o=a.split("&").filter(e=>e.split("=")[0]!==t).join("&");return n+(o?"?"+o:"")+(r?"#"+r:"")},Pa=function(e,t,i){var r;void 0===i&&(i=!0);var s=e.split("?"),n=s[0],a=s[1],o=y({},t),l=null!==(r=null==a?void 0:a.split("&").map(e=>{var t,r=e.split("="),s=r[0],n=i&&null!==(t=o[s])&&void 0!==t?t:r[1];return delete o[s],s+"="+n}))&&void 0!==r?r:[],u=function(e,t){var i,r;void 0===t&&(t="&");var s=[];return Cr(e,function(e,t){Y(e)||Y(t)||"undefined"===t||(i=encodeURIComponent((e=>e instanceof File)(e)?e.name:e.toString()),r=encodeURIComponent(t),s[s.length]=r+"="+i)}),s.join(t)}(o);return u&&l.push(u),l.length>0?n+"?"+l.join("&"):n},Ta=e=>{if(e.Vr)return e.Vr;var t=e.data,i=e.compression;if(t){if(i===Rn){var r=function(e,t){void 0===t&&(t={});var i=function(){var e=4294967295;return{p(t){for(var i=e,r=0;t.length>r;++r)i=ba[255&i^t[r]]^i>>>8;e=i},d:()=>4294967295^e}}(),r=e.length;i.p(e);var s,n,a,o,l=(o=10+((s=t).filename&&s.filename.length+1||0),function(e,t,i,r){var s=e.length,n=new Un(r+s+5*(1+Math.floor(s/7e3))+8),a=n.subarray(r,n.length-8),o=0;if(!t||8>s)for(var l=0;s>=l;l+=65535){var u=l+65535;s>u?o=_a(a,o,e.subarray(l,u)):(a[l]=!0,o=_a(a,o,e.subarray(l,s)))}else{for(var h=ya[t-1],c=h>>>13,d=8191&h,p=(1<<i)-1,v=new Vn(32768),g=new Vn(p+1),f=Math.ceil(i/3),_=2*f,m=function(t){return(e[t]^e[t+1]<<f^e[t+2]<<_)&p},y=new Wn(25e3),b=new Vn(288),w=new Vn(32),x=0,k=0,E=(l=0,0),S=0,P=0;s>l;++l){var T=m(l),F=32767&l,$=g[T];if(v[F]=$,g[T]=F,l>=S){var I=s-l;if((x>7e3||E>24576)&&I>423){o=ma(e,a,0,y,b,w,k,E,P,l-P,o),E=x=k=0,P=l;for(var M=0;286>M;++M)b[M]=0;for(M=0;30>M;++M)w[M]=0}var R=2,C=0,O=d,A=F-$&32767;if(I>2&&T==m(l-A))for(var L=Math.min(c,I)-1,D=Math.min(32767,l),N=Math.min(258,I);D>=A&&--O&&F!=$;){if(e[l+R]==e[l+R-A]){for(var j=0;N>j&&e[l+j]==e[l+j-A];++j);if(j>R){if(R=j,C=A,j>L)break;var q=Math.min(A,j-2),z=0;for(M=0;q>M;++M){var H=l-A+M+32768&32767,G=H-v[H]+32768&32767;G>z&&(z=G,$=H)}}}A+=(F=$)-($=v[F])+32768&32767}if(C){y[E++]=268435456|Qn[R]<<18|ea[C];var B=31&Qn[R],U=31&ea[C];k+=Kn[B]+Jn[U],++b[257+B],++w[U],S=l+R,++x}else y[E++]=e[l],++b[e[l]]}}o=ma(e,a,!0,y,b,w,k,E,P,l-P,o)}return ha(n,0,r+ua(o)+8)}(n=e,null==(a=t).level?6:a.level,null==a.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(n.length)))):12+a.mem,o)),u=l.length;return 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&&wa(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)}}(l,t),wa(l,u-8,i.d()),wa(l,u-4,r),l}(function(e){var t=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var i=new Un(e.length+(e.length>>>1)),r=0,s=function(e){i[r++]=e},n=0;t>n;++n){if(r+5>i.length){var a=new Un(r+8+(t-n<<1));a.set(i),i=a}var o=e.charCodeAt(n);128>o?s(o):2048>o?(s(192|o>>>6),s(128|63&o)):o>55295&&57344>o?(s(240|(o=65536+(1047552&o)|1023&e.charCodeAt(++n))>>>18),s(128|o>>>12&63),s(128|o>>>6&63),s(128|63&o)):(s(224|o>>>12),s(128|o>>>6&63),s(128|63&o))}return ha(i,0,r)}(an(t)),{mtime:0});return{contentType:ka,body:r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),estimatedSize:r.byteLength}}if(i===Cn){var s=function(e){return e?btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):e}(an(t)),n=(e=>"data="+encodeURIComponent("string"==typeof e?e:an(e)))(s);return{contentType:"application/x-www-form-urlencoded",body:n,estimatedSize:new Blob([n]).size}}var a=an(t);return{contentType:"application/json",body:a,estimatedSize:new Blob([a]).size}}},Fa=e=>{var t,i,r=()=>"sendBeacon"===e.transport?{url:Pa(e.url,{compression:Cn}),encodedBody:Ta(y({},e,{compression:Cn,Vr:void 0}))}:{url:Sa(e.url,"compression"),encodedBody:Ta(y({},e,{compression:void 0,Vr:void 0}))};try{t=Ta(e)}catch(t){if(R(e.compression,ln(e.url,"compression")))return fi.error("Failed to gzip request body, sending uncompressed payload",t),r();throw t}return t&&R(e.compression,ln(e.url,"compression"))&&!((i=t.body)instanceof ArrayBuffer?M(new Uint8Array(i)):ArrayBuffer.isView(i)&&M(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?(Ea=!0,r()):{url:e.url,encodedBody:t}},$a=e=>{try{return Fa(e)}catch(t){return fi.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},Ia=function(){var e=m(function*(e){var t=an(e.data),i=yield function(e,t,i){return L.apply(this,arguments)}(t,f.DEBUG,{rethrow:!0});if(!i)return e;var r=yield i.arrayBuffer();return y({},e,{Vr:{contentType:ka,body:r,estimatedSize:r.byteLength}})});return function(t){return e.apply(this,arguments)}}(),Ma=/Failed to fetch|NetworkError|Load failed/i,Ra=e=>{var t=$a(e);if(t){var i=t.url,r=t.encodedBody,s=null!=r?r:{},n=s.contentType,a=s.body,o=s.estimatedSize,u=new Headers;Cr(e.headers,function(e,t){u.append(t,e)}),n&&u.append("Content-Type",n);var c=null,d=!1;if(h){var p=new h;c={signal:p.signal,timeout:setTimeout(()=>{var t,i;d=!0,p.abort((t=e.timeout,(i=new Error("PostHog request timed out"+(t?" after "+t+"ms":""))).name="AbortError",i))},e.timeout)}}var v=t=>{d&&"AbortError"===(null==t?void 0:t.name)||(e=>"TypeError"===(null==e?void 0:e.name)&&Ma.test((null==e?void 0:e.message)||""))(t)?fi.warn(t):fi.error(t),null==e.callback||e.callback({statusCode:0,error:t})};try{var g;l(i,y({method:(null==e?void 0:e.method)||"GET",headers:u,keepalive:"POST"===e.method&&!e.Wr&&52428.8>(o||0),body:a,signal:null==(g=c)?void 0:g.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){fi.error(e)}null==e.callback||e.callback(r)}
1)).catch(v).finally(()=>c?clearTimeout(c.timeout):null)}catch(e){c&&clearTimeout(c.timeout),v(e)}}},Ca=e=>{try{var t,i=Fa(e),r=i.url,s=i.encodedBody,a=null!=s?s:{},o=a.body,l=a.estimatedSize;if(!o)return;var u=o instanceof Blob?o:new Blob([o],{type:a.contentType});if(n.sendBeacon(r,u))return;var h=V(e.data)?e.data:null==(t=e.data)?void 0:t.batch;if(V(h)&&h.length>1&&(null!=l?l:0)>16384){var c=Math.ceil(h.length/2),d=t=>V(e.data)?t:y({},e.data,{batch:t});return Ca(y({},e,{data:d(h.slice(0,c))})),void Ca(y({},e,{data:d(h.slice(c))}))}fi.warn("Beacon of ~"+(null!=l?l:0)+" bytes was rejected by the browser, falling back to fetch"),Ra(y({},e,{Wr:!0}))}catch(e){fi.warn("Beacon send failed",e)}},Oa=(e,t,i,r)=>{var s="query"===r?"POST"===t?"sent_at":"_":void 0;return Pa(i===Rn?Sa(e,"compression"):e,y({},s?{[s]:Date.now().toString()}:{},i===Rn?{}:{compression:i}))},Aa=[];l&&Aa.push({transport:"fetch",method:Ra}),u&&Aa.push({transport:"XHR",method(e){var t=$a(e);if(t){var i=new u,r=t.encodedBody;i.open(e.method||"GET",t.url,!0);var s=null!=r?r:{},n=s.contentType,a=s.body;Cr(e.headers,function(e,t){i.setRequestHeader(t,e)}),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(a)}}}),null!=n&&n.sendBeacon&&Aa.push({transport:"sendBeacon",method:Ca});var La=3e3;class Da{constructor(e,t){this.Zr=!0,this.Gr=[],this.Qr=de((null==t?void 0:t.flush_interval_ms)||La,250,5e3,fi.createLogger("flush interval"),La),this.Jr=e}enqueue(e){this.Gr.push(e),this.Kr||this.Yr()}unload(){this.Xr();var e=this.Gr.length>0?this.ei():{},t=Object.values(e);[...t.filter(e=>0===e.url.indexOf("/e")),...t.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.ti(y({},e,{transport:"sendBeacon"}))})}enable(){this.Zr=!1,this.Yr()}Yr(){var e=this;this.Zr||(this.Kr=setTimeout(()=>{if(this.Xr(),this.Gr.length>0){var t=this.ei(),i=function(){var i=t[r],s=(new Date).getTime();i.data&&V(i.data)&&Cr(i.data,e=>{e.offset=Math.abs(e.timestamp-s),delete e.timestamp}),e.ti(i)};for(var r in t)i()}},this.Qr))}ti(e){try{this.Jr(e)}catch(e){fi.error(e)}}Xr(){clearTimeout(this.Kr),this.Kr=void 0}ei(){var e={};return Cr(this.Gr,t=>{var i,r=t,s=(r?r.batchKey:null)||r.url;Y(e[s])&&(e[s]=y({},r,{data:[]})),null==(i=e[s].data)||i.push(r.data)}),this.Gr=[],e}}var Na=["retriesPerformedSoFar"];class ja{constructor(e){this.ri=!1,this.ii=3e3,this.Gr=[],this._instance=e,this.Gr=[],this.ni=!0,!Y(r)&&"onLine"in r.navigator&&(this.ni=r.navigator.onLine,this.si=()=>{this.ni=!0,this.oi()},this.ai=()=>{this.ni=!1},zr(r,"online",this.si),zr(r,"offline",this.ai))}get length(){return this.Gr.length}retriableRequest(e){var t=e.retriesPerformedSoFar,i=b(e,Na);ie(t)&&(i.url=Pa(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.kt(y({retriesPerformedSoFar:t},i));0===e.statusCode&&fi.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)}}))}kt(e){var t=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=t+1;var i=function(e){var t=3e3*Math.pow(2,e),i=t/2,r=Math.min(18e5,t),s=Math.random()-.5;return Math.ceil(r+s*(r-i))}(t),r=Date.now()+i;this.Gr.push({retryAt:r,requestOptions:e});var s="Enqueued failed request for retry in "+i;navigator.onLine||(s+=" (Browser is offline)"),fi.warn(s),this.ri||(this.ri=!0,this.li())}li(){if(this.ui&&clearTimeout(this.ui),0===this.Gr.length)return this.ri=!1,void(this.ui=void 0);this.ui=setTimeout(()=>{this.ni&&this.Gr.length>0&&this.oi(),this.li()},this.ii)}oi(){var e=Date.now(),t=[],i=this.Gr.filter(i=>e>i.retryAt||(t.push(i),!1));if(this.Gr=t,i.length>0)for(var r of i)this.retriableRequest(r.requestOptions)}unload(){for(var e of(this.ui&&(clearTimeout(this.ui),this.ui=void 0),this.ri=!1,Y(r)||(this.si&&(r.removeEventListener("online",this.si),this.si=void 0),this.ai&&(r.removeEventListener("offline",this.ai),this.ai=void 0)),this.Gr)){var t=e.requestOptions;try{this._instance._send_request(y({},t,{transport:"sendBeacon"}))}catch(e){fi.error(e)}}this.Gr=[]}}class qa{constructor(e){this.hi=()=>{var e,t,i,r;this.di||(this.di={});var s=this.scrollElement(),n=this.scrollY(),a=s?Math.max(0,s.scrollHeight-s.clientHeight):0,o=n+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;this.di.lastScrollY=Math.ceil(n),this.di.maxScrollY=Math.max(n,null!==(e=this.di.maxScrollY)&&void 0!==e?e:0),this.di.maxScrollHeight=Math.max(a,null!==(t=this.di.maxScrollHeight)&&void 0!==t?t:0),this.di.lastContentY=o,this.di.maxContentY=Math.max(o,null!==(i=this.di.maxContentY)&&void 0!==i?i:0),this.di.maxContentHeight=Math.max(l,null!==(r=this.di.maxContentHeight)&&void 0!==r?r:0)},this._instance=e}get ci(){return this._instance.config.scroll_root_selector}getContext(){return this.di}resetContext(){var e=this.di;return setTimeout(this.hi,0),e}startMeasuringScrollPosition(){zr(r,"scroll",this.hi,{capture:!0}),zr(r,"scrollend",this.hi,{capture:!0}),zr(r,"resize",this.hi)}scrollElement(){if(!this.ci)return null==r?void 0:r.document.documentElement;var e=V(this.ci)?this.ci:[this.ci];for(var t of e){var i=null==r?void 0:r.document.querySelector(t);if(i)return i}}vi(e){var t="y"===e?"scrollTop":"scrollLeft";if(this.ci){var i=this.scrollElement();return i&&i[t]||0}return r?"y"===e?r.scrollY||r.pageYOffset||r.document.documentElement.scrollTop||0:r.scrollX||r.pageXOffset||r.document.documentElement.scrollLeft||0:0}scrollY(){return this.vi("y")}scrollX(){return this.vi("x")}}var za=e=>En(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes
vendor: 4,109 bytes, line 1
1);class Ha{constructor(e,t,i,r){this.fi=e=>{var t=this.pi();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.gi(this._instance)};this.mi.register({[ur]:i})}},this._instance=e,this.yi=t,this.mi=i,this.gi=r||za,this.yi.onSessionId(this.fi)}pi(){return this.mi.props[ur]}getSetOnceProps(){var e,t=null==(e=this.pi())?void 0:e.props;return t?"r"in t?Sn(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return Cr(Nr(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+z(i)]=t}),e}}class Ga{on(e,t){return this.bi[e]||(this.bi[e]=[]),this.bi[e].push(t),()=>{this.bi[e]=this.bi[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.bi[e]||[])i(t);for(var r of this.bi["*"]||[])r(e,t)}constructor(){this.bi={}}}var Ba=_i("[SessionId]");class Ua{on(e,t){return this.wi.on(e,t)}constructor(e,t,i){var r;if(this.xi=null,this.ki=[],this.Si=void 0,this.Ci=!1,this.wi=new Ga,this.Ti=(e,t)=>!(!ie(e)||!ie(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===xr)throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Te=e.config,this.mi=e.persistence,this.Ii=void 0,this.Mi=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.Ei=t||Jr,this.Ri=i||Jr;var s=this.Te.persistence_name||this.Te.token;if(this._sessionTimeoutMs=1e3*de(this.Te.session_idle_timeout_seconds||1800,60,36e3,Ba.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.Pi(),this.Oi="ph_"+s+"_window_id",this.Fi="ph_"+s+"_primary_window_exists",this.Li()){var n=as.F(this.Oi),a=as.F(this.Fi);n&&!a?this.Ii=n:as.P(this.Oi),as.q(this.Fi,!0)}if(null!=(r=this.Te.bootstrap)&&r.sessionID)try{var o=(()=>{var e=this.Te.bootstrap.sessionID.replace(/-/g,"");if(32!==e.length)throw new Error("Not a valid UUID");if("7"!==e[12])throw new Error("Not a UUIDv7");return parseInt(e.substring(0,12),16)})();this.$i(this.Te.bootstrap.sessionID,(new Date).getTime(),o)}catch(e){Ba.error("Invalid sessionID in bootstrap",e)}this.Ai()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Y(this.ki)&&(this.ki=[]),this.ki.push(e),this.Mi&&e(this.Mi,this.Ii),()=>{this.ki=this.ki.filter(t=>t!==e)}}Li(){return"memory"!==this.Te.persistence&&!this.mi.yr&&as.N()}Ni(e){e!==this.Ii&&(this.Ii=e,this.Li()&&as.q(this.Oi,e))}Di(){return this.Ii?this.Ii:this.Li()?as.F(this.Oi):null}qi(e){var t=this.xi;return!Q(t)&&!Q(e)&&5e3>Math.abs(e-t)}$i(e,t,i){var r=t!==this._sessionActivityTimestamp,s=!(e!==this.Mi||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.Mi=e,s&&!r||s&&this.qi(t)||(this.xi=t,this.mi.register({[qi]:[t,e,i]}))}ji(){var e,t=null==(e=this.Te)?void 0:e.persistence_save_debounce_ms;return ie(t)&&t>0}Hi(){this.ji()?this.mi.refreshKey(qi):(this.mi.flush(),this.mi.load())}Bi(){var e;if(!Q(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.xi){this.Hi();var t=this.Ui();t[1]===this.Mi&&t[2]===this._sessionStartTimestamp&&(this.xi=this._sessionActivityTimestamp,this.mi.register({[qi]:[this._sessionActivityTimestamp,null!==(e=this.Mi)&&void 0!==e?e:null,this._sessionStartTimestamp]}),this.mi.flush())}}zi(){var e=this.Ui()[0],t=ie(e)?e:0,i=ie(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0;return Math.max(t,i)}Vi(e){return this.Hi(),this.Ti(e,this.zi())}Ui(){var e=this.mi.props[qi];return V(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.xi=null,clearTimeout(this.Wi),this.Wi=void 0,this.$i(null,null,null)}destroy(){this.Ci=!0,this.Bi(),clearTimeout(this.Wi),this.Wi=void 0,this.Si&&r&&(r.removeEventListener(Tr,this.Si,{capture:!1}),this.Si=void 0),this.ki=[]}Ai(){this.Si=()=>{this.Bi(),this.Li()&&as.P(this.Fi)},zr(r,Tr,this.Si,{capture:!1})}
1checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.Te.cookieless_mode===xr)throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),r=this.Ui(),s=r[1],n=r[2],a=this.zi(),o=this.Di(),l=ie(n)&&Math.abs(i-n)>864e5,u=!1,h=!1,c=!s,d=s,p=!c&&!e&&this.Ti(i,a);if(p){(p=this.Vi(i))||Ba.info("cross-tab refresh kept the session alive",{sessionId:s});var v=this.Ui();s=v[1],n=v[2]}c||p||l?(s=this.Ei(),o=this.Ri(),Ba.info("new session ID generated",{sessionId:s,windowId:o,changeReason:{noSessionId:c,activityTimeout:p,sessionPastMaximumLength:l}}),n=i,u=!0):(o||(o=this.Ri(),u=!0),(h=s!==d)&&(Ba.info("adopted cross-tab session id",{sessionId:s,windowId:o}),u=!0));var g=ie(a)&&e&&!l?a:i,f=ie(n)?n:(new Date).getTime();this.Ni(o),this.$i(s,g,f),e||this.Pi();var _={noSessionId:c,activityTimeout:p,sessionPastMaximumLength:l,crossTabAdoption:h};return u&&this.ki.forEach(e=>e(s,o,_)),{sessionId:s,windowId:o,sessionStartTimestamp:f,changeReason:u?_:void 0,lastActivityTimestamp:a}}Pi(){this.Ci||(clearTimeout(this.Wi),this.Wi=setTimeout(()=>{if(!this.Ci)if(this.Vi((new Date).getTime())){var e=this.Mi;this.resetSessionId(),this.wi.emit("forcedIdleReset",{idleSessionId:e})}else this.Pi()},1.1*this.sessionTimeoutMs))}}var Va=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&N(i,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(e=>N(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function Wa(){return(Wa=m(function*(){var e=null==n?void 0:n.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return Z(i)&&i.length>0?i:void 0}catch(e){return void fi.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}var Ka=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 Ja(e,t,i){return an({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var Ya={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=>Ka(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!Ka(t,e))),icontains:(e,t)=>t.map(Za).some(t=>e.map(Za).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(Za).every(t=>e.map(Za).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))})},Za=e=>e.toLowerCase();function Xa(e,t){return!e||Object.entries(e).every(e=>{var i=e[1],r=null==t?void 0:t[e[0]];if(Y(r)||Q(r))return!1;var s=[String(r)],n=Ya[i.operator];return!!n&&n(i.values,s)})}var Qa="custom",eo="i.posthog.com",to=/^\/static\//;class io{constructor(e){this.Zi={},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("."+eo,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.Zi[this.apiHost]||(this.Zi[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":Qa),this.Zi[this.apiHost]}Gi(e){if(to.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.Gi(t);if(i)return""+i+t}if(this.region===Qa)return this.apiHost+t;var r=eo+t;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}function ro(e){var t;return!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)}var so=_i("[Surveys]"),no="seenSurvey_",ao=e=>{try{var t=(e=>((e,t)=>""+no+function(e){return e.current_iteration&&e.current_iteration>0?e.id+"_"+e.current_iteration:e.id}(t))(0,e))(e);if(localStorage.getItem(t))return;localStorage.setItem(t,"true")}catch(e){so.error("Failed to persist survey seen state",e)}}
1,oo=["popover","widget","api"],lo={ignoreConditions:!1,ignoreDelay:!1,displayType:qn},uo=_i("[PostHog ExternalIntegrations]"),ho={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class co{constructor(e){this._instance=e}er(e,t){var i;null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return uo.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e=this,t=function(){var t,r,s,n=i[0],a=i[1];!a||null!=(t=g.__PosthogExtensions__)&&null!=(t=t.integrations)&&t[n]||e.er(ho[n],()=>{var t;null==(t=g.__PosthogExtensions__)||null==(t=t.integrations)||null==(t=t[n])||t.start(e._instance)}),!a&&null!=(r=g.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[n]&&(null==(s=g.__PosthogExtensions__)||null==(s=s.integrations)||null==(s=s[n])||s.stop())};for(var i of Object.entries(null!==(r=this._instance.config.integrations)&&void 0!==r?r:{})){var r;t()}}}var po={},vo=0,go=()=>{},fo='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',_o="Surveys module not available",mo="sanitize_properties is deprecated. Use before_send instead",yo="Invalid value for property_denylist config: ",bo=["token","distinct_id",fr],wo="posthog",xo=!xa&&-1===(null==d?void 0:d.indexOf("MSIE"))&&-1===(null==d?void 0:d.indexOf("Mozilla")),ko=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:qr(null==a?void 0:a.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:go,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:o&&Z(null==o?void 0:o.search)&&-1!==o.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==r||null==(t=r.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){fi.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:Sr,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:La},error_tracking:{},_onCapture:go},(e=>({rageclick:e&&e>="2026-05-30"?{content_ignorelist:Ps,ignore_text_selection:!0}
1:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e)}))(e))},Eo=[["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"]],So=e=>{var t={};for(var i of Eo){var r=i[0],s=i[1];Y(e[r])||(t[s]=e[r])}var n=Or({},t,e),a=e.__preview_external_dependency_versioned_paths;return Y(a)||(Y(e.strict_script_versioning)&&(n.strict_script_versioning=!!a),Z(a)&&Y(e.asset_host)&&(n.asset_host=a)),V(e.property_blacklist)&&(Y(e.property_denylist)?n.property_denylist=e.property_blacklist:V(e.property_denylist)?n.property_denylist=[...e.property_blacklist,...e.property_denylist]:fi.error(yo+e.property_denylist)),n};class Po{constructor(){this.__forceAllowLocalhost=!1}get Qi(){return this.__forceAllowLocalhost}set Qi(e){fi.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class To{Ji(e,t){if(e){var i=this.Ki.indexOf(e);-1!==i&&this.Ki.splice(i,1)}return this.Ki.push(t),null==t.initialize||t.initialize(),t}Yi(){return this.config.cookieless_mode===xr||this.config.cookieless_mode===wr&&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(){var e;this.webPerformance=new Po,this.Xi=!1,this.version=f.LIB_VERSION,this.en=new Ga,this.Ki=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=ko(),this.SentryIntegration=Qs,this.sentryIntegration=e=>function(e,t){var i=Xs(e,t);return{name:Zs,processEvent:e=>i(e)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.tn=!1,this.rn=null,this.nn=null,this.sn=null,this.scrollManager=new qa(this),this.pageViewManager=new en(this),this.rateLimiter=new Hn(this),this.requestRouter=new io(this),this.consent=new os(this),this.externalIntegrations=new co(this);var t=null!==(e=To.__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.metrics=t.metrics&&new t.metrics(this),this.experiments=t.experiments&&new t.experiments(this),this.exceptions=t.exceptions&&new t.exceptions(this),this.people={set:(e,t,i)=>{var r=Z(e)?{[e]:t}:e;this.setPersonProperties(r),null==i||i({})},set_once:(e,t,i)=>{var r=Z(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",e=>fi.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==wo){var r,s=null!==(r=po[i])&&void 0!==r?r:new To;return s._init(e,t,i),po[i]=s,po[wo][i]=s,s}return this._init(e,t,i)}_init(e,t,i){var s,n;void 0===t&&(t={});var a=Z(e)?e.trim():"";if(!a)return fi.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=ko(t.defaults),t.debug=this.an(t.debug),this.ln=t,this.un=[],t.person_profiles?this.nn=t.person_profiles:t.process_person&&(this.nn=t.process_person);var o=ko(t.defaults),l=So(t),u=Or({},o,l,{name:i,token:a});K(o.rageclick)&&K(l.rageclick)&&(u.rageclick=Or({},o.rageclick,l.rageclick)),K(o.session_recording)&&K(l.session_recording)&&(u.session_recording=Or({},o.session_recording,l.session_recording)),this.set_config(u),this.config.on_xhr_error&&fi.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:Rn;var h=this.hn();this.persistence=new Mn(this.config,h),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Mn(y({},this.config,{persistence:"sessionStorage"}),h,!1);var c=y({},this.persistence.props),d=y({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.dn=new Da(e=>this.cn(e),this.config.request_queue_config),this.vn=new ja(this),this.__request_queue=[];var p=this.Yi();
1if(p||(this.sessionManager=new Ua(this),this.sessionPropsManager=new Ha(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(fi.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.fn(p)},0)):(fi.info("Initializing extensions synchronously"),this.fn(p)),f.DEBUG=f.DEBUG||this.config.debug,f.DEBUG&&fi.info("Starting in debug mode",{this:this,config:t,thisC:y({},this.config),p:c,s:d}),!this.config.identity_distinct_id||null!=(s=t.bootstrap)&&s.distinctID||(t.bootstrap=y({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var v=t.bootstrap.distinctID,g=this.get_distinct_id(),_=this.persistence.get_property(lr);if(t.bootstrap.isIdentifiedID&&null!=g&&g!==v&&_===kr)this.identify(v);else if(t.bootstrap.isIdentifiedID&&null!=g&&g!==v&&_===Er)fi.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(Jr()),b=t.bootstrap.isIdentifiedID?m:v;this.persistence.set_property(lr,t.bootstrap.isIdentifiedID?Er:kr),this.register({distinct_id:v,$device_id:b})}}if(p)this.register_once({distinct_id:gr,$device_id:null},"");else if(!this.get_distinct_id()){var w=this.config.get_device_id(Jr());this.register_once({distinct_id:w,$device_id:w},""),this.persistence.set_property(lr,kr)}return zr(r,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var r=i=>{var r=()=>i.anonymousId()||Jr();e.config.get_device_id=r,i.id()&&(e.register({distinct_id:i.id(),$device_id:r()}),e.persistence.set_property(lr,Er)),t()},s=i.user();"then"in s&&W(s.then)?s.then(r):r(s)}(e,()=>{i.register((e=>{"undefined"!=typeof Promise&&Promise.resolve||Ys.warn("This browser does not have Promise support, and can not use the segment integration");var t=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(Ys.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(Ys.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};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>t(e,e.event.event),page:e=>t(e,Fr),identify:e=>t(e,Ir),screen:e=>t(e,"$screen")}})(e)).then(()=>{t()})})}(this,()=>this.pn()):this.pn(),W(this.config._onCapture)&&this.config._onCapture!==go&&(fi.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&fi.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||function(){return Wa.apply(this,arguments)}().then(e=>{e&&this.register({[xi]:e})}).catch(go),this}fn(e){var t,i,r,s,n,a,o,l,u=performance.now(),h=y({},To.__defaultExtensionClasses,this.config.__extensionClasses),c=[];h.featureFlags&&this.Ki.push(this.featureFlags=null!==(t=this.featureFlags)&&void 0!==t?t:new h.featureFlags(this)),h.exceptions&&this.Ki.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new h.exceptions(this)),h.historyAutocapture&&this.Ki.push(this.historyAutocapture=new h.historyAutocapture(this)),h.tracingHeaders&&this.Ki.push(this.tracingHeaders=new h.tracingHeaders(this)),h.siteApps&&this.Ki.push(this.siteApps=new h.siteApps(this)),h.sessionRecording&&!e&&this.Ki.push(this.sessionRecording=new h.sessionRecording(this)),this.config.disable_scroll_properties||c.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),h.autocapture&&this.Ki.push(this.autocapture=new h.autocapture(this)),h.surveys&&this.Ki.push(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new h.surveys(this)),h.logs&&this.Ki.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new h.logs(this)),h.metrics&&this.Ki.push(this.metrics=null!==(n=this.metrics)&&void 0!==n?n:new h.metrics(this)),h.conversations&&this.Ki.push(this.conversations=null!==(a=this.conversations)&&void 0!==a?a:new h.conversations(this)),h.productTours&&this.Ki.push(this.productTours=new h.productTours(this)),h.heatmaps&&this.Ki.push(this.heatmaps=new h.heatmaps(this)),h.webVitalsAutocapture&&this.Ki.push(this.webVitalsAutocapture=new h.webVitalsAutocapture(this)),h.exceptionObserver&&this.Ki.push(this.exceptionObserver=new h.exceptionObserver(this)),h.deadClicksAutocapture&&this.Ki.push(this.deadClicksAutocapture=new h.deadClicksAutocapture(this,Ks)),h.toolbar&&this.Ki.push(this.toolbar=null!==(o=this.toolbar)&&void 0!==o?o:new h.toolbar(this)),h.experiments&&this.Ki.push(this.experiments=null!==(l=this.experiments)&&void 0!==l?l:new h.experiments(this)),this.Ki.forEach(e
1=>{e.initialize&&c.push(()=>{null==e.initialize||e.initialize()})}),c.push(()=>{if(this.gn){var e=this.gn;this.gn=void 0,this.Hr(e)}}),this.mn(c,u)}mn(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.mn(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){fi.error("Error initializing extension:",e)}}var r=Math.round(performance.now()-t);this.register_for_session({[_r]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[mr]:r}),this.config.__preview_deferred_init_extensions&&fi.info("PostHog extensions initialized ("+r+"ms)")}Hr(e){if(!a||!a.body)return fi.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Hr(e)},500);if(this.config.__preview_deferred_init_extensions&&(this.gn=e),this.yn=e,this.compression=void 0,e.ok){var t,i=e.config;i.supportedCompression&&!this.config.disable_compression&&(this.compression=j(i.supportedCompression,Rn)?Rn:j(i.supportedCompression,Cn)?Cn:void 0),null!=(t=i.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=i.analytics.endpoint)}this.set_config({person_profiles:this.nn?this.nn:Sr}),this.Ki.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}pn(){try{this.config.loaded(this)}catch(e){fi.critical("`loaded` function failed",e)}if(this.bn(),this.config.internal_or_test_user_hostname&&null!=o&&o.hostname){var e=o.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.Yi())&&this._n()},1),this.wn=new Bn(this),this.wn.load()}bn(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.dn)||e.enable())}_dom_loaded(){this.is_capturing()&&Rr(this.__request_queue,e=>this.cn(e)),this.__request_queue=[],this.bn()}_handle_unload(){var e,t,i,r,s;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),null==(t=this.metrics)||t.flush("sendBeacon"),this.config.request_batching?(this.xn()&&this.capture($r),null==(i=this.logs)||i.flushLogs("sendBeacon"),null==(r=this.dn)||r.unload(),null==(s=this.vn)||s.unload()):this.xn()&&this.capture($r,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?xo?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,(Y(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;var n,a,o,l,u,h=null!==(t=s.transport)&&void 0!==t?t:"fetch";"sendBeacon"===h&&Y(s.compression)&&s.data&&(s.compression=Cn),"POST"===s.method&&s.data&&("capture-body"===s.timestampMode?s.data={api_key:null!==(a=null==(u=(l=V(n=s.data)?n:[n])[0])||null==(o=u.properties)?void 0:o.token)&&void 0!==a?a:null==u?void 0:u.token,batch:l,sent_at:(new Date).toISOString()}:"body"!==s.timestampMode||V(s.data)||(s.data=y({},s.data,{sent_at:(new Date).toISOString()}))),s.url=Oa(s.url,s.method,s.compression,s.timestampMode);var d=Aa.filter(e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport)),p=null!==(i=null==(r=function(e){for(var t=0;e.length>t;t++)if(e[t].transport===h)return e[t]}
1(d))?void 0:r.method)&&void 0!==i?i:d[0].method;if(!p)throw new Error("No available transport method");"sendBeacon"!==h&&s.data&&s.compression===Rn&&c&&"undefined"!=typeof Promise&&!Ea?Ia(s).then(e=>{p(e)}).catch(t=>{if(C(t))return Ea=!0,void p(y({},s,{compression:void 0,url:Oa(e.url,e.method,void 0,e.timestampMode)}));(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return C(e)||t===I})(t)&&(Ea=!0),p(s)}):p(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}))}cn(e){this.vn?this.vn.retriableRequest(e):this._send_request(e)}_execute_array(e){vo++;try{var t,i=[],r=[],s=[];Rr(e,e=>{if(e)if(V(t=e[0]))s.push(e);else if(W(e))try{e.call(this)}catch(t){fi.error("Error executing queued PostHog call",e,t)}else V(e)&&"alias"===t?i.push(e):V(e)&&-1!==t.indexOf("capture")&&W(this[t])?s.push(e):r.push(e)});var n=function(e,t){Rr(e,function(e){try{if(V(e[0])){var i=t;Cr(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){fi.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(r,this),n(s,this)}finally{vo--}}push(e){if(vo>0&&V(e)&&Z(e[0])){var t=To.prototype[e[0]];W(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var r,s,n,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.dn){if(this.is_capturing())if(!Y(e)&&Z(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&&!Z(null==t?void 0:t.$current_url)&&(fi.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.kn||fi.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var h=new Date,c=(null==i?void 0:i.timestamp)||h,d=yt(null==i?void 0:i.uuid,Jr),p={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},c,d)};e===Fr&&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);var v="$feature_flag_called"===e&&!1===p.properties.$feature_flag_has_experiment&&!0===this.get_property(Ki);(null==i?void 0:i.$set)&&!v&&(p.$set=null==i?void 0:i.$set);var g=null==i?void 0:i.$unset;g&&(p.$unset=g);var f,_,m,b=v?void 0:this.Sn(null==i?void 0:i.$set_once,e!==Mr,e===Ir);if(b&&(p.$set_once=b),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,n=p,a=e=>Z(e)?e.slice(0,s):e,o=new Set,p=function e(t,i){if(t!==Object(t))return a?a(t):t;if(!o.has(t)){var r;if(o.add(t),V(t))r=[],Rr(t,t=>{r.push(e(t))});else{var s={};Cr(t,(t,i)=>{o.has(t)||(s[i]=e(t))}),r=s}return r}}(n)),p.timestamp=c,Y(null==i?void 0:i.timestamp)||(p.properties.$event_time_override_provided=!0,p.properties.$event_time_override_system_time=h),v&&(p.properties=function(e,t){void 0===t&&(t=[]);var i={},r=t=>{void 0!==e[t]&&(i[t]=e[t])};return S.forEach(r),t.forEach(r),i}(p.properties,bo)),e===Dn||e===Nn){var w=null==t?void 0:t.$survey_id,x=null==t?void 0:t.$survey_iteration;ao({id:w,current_iteration:x}),p.$set=y({},p.$set,{[(f={id:w,current_iteration:x},_=e===Nn?"responded":"dismissed",m="$survey_"+_+"/"+f.id,f.current_iteration&&f.current_iteration>0&&(m="$survey_"+_+"/"+f.id+"/"+f.current_iteration),m)]:!0})}else e===Ln&&(p.$set=y({},p.$set,{[jn]:(new Date).toISOString()}));if("product tour shown"===e){var k=null==t?void 0:t.$product_tour_type;k&&(p.$set=y({},p.$set,{["$product_tour_last_seen_date/"+k]:(new Date).toISOString()}))}var E=y({},p.properties.$set,p.$set);if(J(E)||this.setPersonPropertiesForFlags(E),!ee(this.config.before_send)){var P=this.wt(p);if(!P)return;(p=P).uuid=yt(p.uuid,Jr)}this.en.emit("eventCaptured",p);var T=null!==(r=null==i?void 0:i._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),F={method:"POST",url:T,data:p,compression:"best-available",timestampMode:"recordings"===(null==i?void 0:i._batchKey)||/\/s\/(?:\?|$)/.test(T)?"query":"capture-body",batchKey:null==i?void 0:i._batchKey,transport:null==i?void 0:i.transport};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this.cn(F):this.dn.enqueue(F),p}fi.critical("This capture call is ignored due to client rate limiting.")}}else fi.error("No event name provided to posthog.capture")}else fi.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,s,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var l=n?void 0:this.persistence.remove_event_timer(e),u=y({},t);if(u.token=this.config.token,u.$config_defaults=this.config.defaults,this.Yi()&&(u[fr]=!0),"$
1snapshot"===e){var h=y({},this.persistence.properties(),this.sessionPersistence.properties());return u.distinct_id=h.distinct_id,(!Z(u.distinct_id)&&!te(u.distinct_id)||X(u.distinct_id))&&fi.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),u}var c,p=function(e,t,i,s){var n,a,l,u;if(void 0===s&&(s=!1),!d)return{};var h,c=e?[...vn,...t||[]]:[],p=function(e){for(var t=0;ft.length>t;t++){var i=ft[t],r=i[1],s=i[0].exec(e),n=s&&(W(r)?r(s,e):r);if(n)return n}return["",""]}(d),v=p[0],g=p[1],_=null!=(h="undefined"!=typeof navigator?navigator:void 0)&&h.brave?{brave:!0}:{},m={};Y(i)||(m.detectGoogleSearchApp=i);var y={},b=null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,w=null==(a=navigator)?void 0:a.maxTouchPoints,x=null==r||null==(l=r.screen)?void 0:l.width,k=null==r||null==(u=r.screen)?void 0:u.height,E=null==r?void 0:r.devicePixelRatio;Y(b)||(y.userAgentDataPlatform=b),Y(w)||(y.maxTouchPoints=w),Y(x)||(y.screenWidth=x),Y(k)||(y.screenHeight=k),Y(E)||(y.devicePixelRatio=E);var S,P,T,F,$,I,M,R,C=Or(Nr({$os:v,$os_version:g,$browser:pt(d,navigator.vendor,_,m),$device:_t(d),$device_type:(P=d,T=y,R=_t(P),R===ye||R===me||"Kobo"===R||"Kindle Fire"===R||R===Je?_e:R===Ne||R===qe||R===je||R===Ve?"Console":R===we?"Wearable":R?ve:"Android"===(null==T?void 0:T.userAgentDataPlatform)&&(null!==(F=null==T?void 0:T.maxTouchPoints)&&void 0!==F?F:0)>0?600>Math.min(null!==($=null==T?void 0:T.screenWidth)&&void 0!==$?$:0,null!==(I=null==T?void 0:T.screenHeight)&&void 0!==I?I:0)/(null!==(M=null==T?void 0:T.devicePixelRatio)&&void 0!==M?M:1)?ve:_e:"Desktop"),$timezone:Pn(),$timezone_offset:Tn()}),{$current_url:un(s?bt(null==o?void 0:o.href):null==o?void 0:o.href,c,fn),$host:null==o?void 0:o.host,$pathname:null==o?void 0:o.pathname,$raw_user_agent:d.length>1e3?d.substring(0,997)+"...":d,$browser_version:gt(d,navigator.vendor,_,m),$browser_language:wn(),$browser_language_prefix:(S=wn(),"string"==typeof S?S.split("-")[0]:void 0),$screen_height:null==r?void 0:r.screen.height,$screen_width:null==r?void 0:r.screen.width,$viewport_height:null==r?void 0:r.innerHeight,$viewport_width:null==r?void 0:r.innerWidth,$lib:f.LIB_NAME,$lib_version:f.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return f.SDK_DIST_CHANNEL&&(C.$sdk_dist_channel=f.SDK_DIST_CHANNEL),C}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes);if(this.sessionManager){var v=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime()),g=v.windowId;u.$session_id=v.sessionId,u.$window_id=g}this.sessionPropsManager&&Or(u,this.sessionPropsManager.getSessionProps());try{var _;this.sessionRecording&&Or(u,this.sessionRecording.sdkDebugProperties),u.$sdk_debug_retry_queue_size=null==(_=this.vn)?void 0:_.length}catch(e){u.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===Qa&&(u.$lib_custom_api_host=this.config.api_host),c=e!==Fr||n?e!==$r||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,s),u=Or(u,c),e===Fr&&a&&(u.title=a.title),!Y(l)){var m=i.getTime()-l;u.$duration=parseFloat((m/1e3).toFixed(3))}d&&this.config.opt_out_useragent_filter&&(u.$browser_type=this._is_bot()?"bot":"browser");var b=this.persistence.properties(),w=this.sessionPersistence.properties();Cr(["$referrer","$referring_domain"],e=>{e in b&&delete w[e]}),(u=Or({},p,b,w,u)).$is_identified=this._isIdentified(),V(this.config.property_denylist)?Cr(this.config.property_denylist,function(e){delete u[e]}):fi.error(yo+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var x=this.config.sanitize_properties;x&&(fi.error(mo),u=x(u,e));var k=this.Cn();return u.$process_person_profile=k,k&&!n&&this.Tn("_calculate_event_properties"),u}Sn(e,t,i){var r;if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.Cn())return e;if(this.Xi&&!i)return e;var s=this.persistence.get_initial_props(),n=null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps(),a=Or({},s,n||{},e||{}),o=this.config.sanitize_properties;return o&&(fi.error(mo),a=o(a,"$set_once")),t&&(this.Xi=!0),J(a)?void 0:a}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)}In(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())&&void 0!==e?e:[]}isFeatureEnabled(e,t){var i,r;return null!==(i=null==(r=this.featureFlags)?void 0:r.isFeatureEnabled(e,t))&&void 0!==i?i:null==t?void 0:t.defaultValue}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.en.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:_o}),()=>{})}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:_o})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:_o})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=lo),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:_o}}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:_o})}Mn(e){return!e||X(e)?(fi.critical("Unique user id has not been set in posthog.identify"),!1):e===gr?(fi.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())||(fi.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and n
1ot a hardcoded string.'),!1)}identify(e,t,i){if(!this.__loaded||!this.persistence)return fi.uninitializedWarning("posthog.identify");if(te(e)&&(e=e.toString(),fi.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Mn(e)&&this.Tn("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(wi)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(ki)&&(this.unregister(ki),this.register({distinct_id:e}));var s,n=(this.persistence.get_property(lr)||kr)===kr;e!==r&&n?(this.persistence.set_property(lr,Er),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.capture(Ir,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.sn=Ja(e,t,i),null==(s=this.featureFlags)||s.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(sr))}}setPersonProperties(e,t){if((e||t)&&this.Tn("posthog.setPersonProperties")){var i=Ja(this.get_distinct_id(),e,t);this.sn!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.sn=i):fi.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(V(e)?e:[e]).filter(e=>Z(e)&&e.length>0);0!==i.length&&this.Tn("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.sn=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};i&&(n.$group_set=i),this.capture(Mr,n)}i&&this.setGroupPropertiesForFlags({[e]:i}),s&&!i&&this.reloadFeatureFlags()}else fi.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.Tn("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){var t,i,r,s,n,a,o,l,u,h;if(fi.info("reset"),!this.__loaded)return fi.uninitializedWarning("posthog.reset");var c,d=this.get_property(wi),p=this.get_property(xi),v=this.get_property(Oi);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),Y(v)||null==(c=this.persistence)||c.register({[Oi]:v}),null==(r=this.surveys)||r.reset(),null==(s=this.wn)||s.stop(),null==(n=this.featureFlags)||n.reset(),null==(a=this.conversations)||a.reset(),null==(o=this.logs)||o.reset(),null==(l=this.metrics)||l.reset(),null==(u=this.persistence)||u.set_property(lr,kr),null==(h=this.sessionManager)||h.resetSessionId(),this.sn=null,this.config.cookieless_mode===xr)this.register_once({distinct_id:gr,$device_id:null},"");else{var g=this.config.get_device_id(Jr());this.register_once({distinct_id:g,$device_id:e?g:d},""),e||Y(p)||this.register({[xi]:p})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var t=this;return m(function*(){var e,i,r,s,n;t.__loaded?(null==(e=t.logs)||e.flushLogs("sendBeacon"),null==(i=t.metrics)||i.flush("sendBeacon"),null==(r=t.dn)||r.unload(),null==(s=t.vn)||s.unload(),null==(n=t.featureFlags)||n.destroy()):fi.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var i;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i.En()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.Rn()}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 t=this.sessionManager.checkAndGetSessionAndWindowId(!0),i=t.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+t.sessionId);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(bi)?(fi.critical("Attempting to create alias for existing People user - aborting."),-2):this.Tn("posthog.alias")?(Y(t)&&(t=this.get_distinct_id()),e!==t?(this.In(ki,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(fi.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=y({},this.config);if(K(e)){var i,r,s,n,a,o,l,u,h,c,d;Or(this.config,So(e));var p=this.hn();null==(i=this.persistence)||i.update_config(this.config,t,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new Mn(y({},this.config,{persistence:"sessionStorage"}),p,!1);var v=this.an(this.config.debug);re(v)&&(this.config.debug=v),re(this.config.debug)&&(this.config.debug?(f.DEBUG=!0,ts.N()&&ts.q("ph_debug",!0),fi.info("set_config",{config:e,oldConfig:t,newConfig:y({},this.config)})):(f.DEBUG=!1,ts.N()&&ts.P("ph_debug"))),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(h=this.deadClicksAutocapture)||h.startIfEnabledOrStop(),null==(c=this.surveys)||c.loadIfEnabled(),this.Pn(),null==(d=this.externalIntegrations)||d.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){f.LIB_NAME=e,f.LIB_VERSION=t}startSessionRecording(e){var t,i,r,s,n,a=!0===e,o={sampling:a||!(null==e||!e.sampling),linked_flag:a||!(null==e||!e.linked_flag),url_trigger:a||!(null==e||!e.url_trigger),event_trigger:a||!(null==e||!e.event_trigger)};Object.values(o).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),o.url_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("url")),o.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var i=new 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:To.On}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:wo;return t!==wo&&(t=wo+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(lr))===Er||(null==(t=this.sessionPersistence)?void 0:t.get_property(lr))===Er}Cn(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===Sr&&!this._isIdentified()&&J(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[ki])&&(null==(t=this.persistence)||null==(t=t.props)||!t[vr]))}xn(){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.Cn()||this.Tn("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Tn("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Tn(e){return"never"===this.config.person_profiles?(fi.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.In(vr,!0),!0)}hn(){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!==wr)}Pn(){var e,t,i,r,s=this.hn();return(null==(e=this.persistence)?void 0:e.yr)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(t=this.sessionPersistence)?void 0:t.yr)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==xr){if(this.Yi()){var i,r,s,n,a;this.reset(!0),null==(i=this.sessionManager)||i.destroy(),null==(r=this.pageViewM
1anager)||r.destroy(),this.sessionManager=new Ua(this),this.pageViewManager=new en(this),this.persistence&&(this.sessionPropsManager=new Ha(this,this.sessionManager,this.persistence));var o,l=null!==(s=null==(n=this.config.__extensionClasses)?void 0:n.sessionRecording)&&void 0!==s?s:null==(a=To.__defaultExtensionClasses)?void 0:a.sessionRecording;l&&(this.sessionRecording=this.Ji(this.sessionRecording,new l(this)),this.yn&&(null==(o=this.sessionRecording)||null==o.onRemoteConfig||o.onRemoteConfig(this.yn)))}var u,h;this.consent.optInOut(!0),this.Pn(),this.bn(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==wr&&(null==(u=this.surveys)||u.loadIfEnabled()),(Y(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(h=null==e?void 0:e.captureEventName)&&void 0!==h?h:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this._n()}else fi.warn(fo)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==xr?(this.config.cookieless_mode===wr&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.Pn(),this.config.cookieless_mode===wr&&(this.register({distinct_id:gr,$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._n(),this.bn())):fi.warn(fo)}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===xr||(this.config.cookieless_mode===wr?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.Pn()}_is_bot(){return n?Va(n,this.config.custom_blocked_useragents):void 0}_n(){a&&("visible"===a.visibilityState?this.tn||(this.tn=!0,this.capture(Fr,{title:a.title},{send_instantly:!0}),this.rn&&(a.removeEventListener(Pr,this.rn),this.rn=null)):this.rn||(this.rn=this._n.bind(this),zr(a,Pr,this.rn)))}debug(e){!1===e?(null==r||r.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==r||r.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Ur(){var e=this.ln||{};return"advanced_disable_flags"in e?!!e.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(fi.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):function(e,t,i,r,s){var n=t in e&&!ee(e[t]),a=i in e&&!ee(e[i]);return n?e[t]:!!a&&(s&&s.warn("Config field '"+i+"' is deprecated. Please use '"+t+"' instead. The old field will be removed in a future major version."),e[i])}(e,"advanced_disable_flags","advanced_disable_decide",0,fi)}wt(e){var t;if(ee(this.config.before_send))return e;var i=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(ne),r=V(this.config.before_send)?this.config.before_send:[this.config.before_send],s=e;for(var n of r){if(s=n(s),ee(s)){var a="Event '"+e.event+"' was rejected in beforeSend function";return se(e.event)?fi.warn(a+". This can cause unexpected behavior."):fi.info(a),null}s.properties&&!J(s.properties)||fi.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var o of i)if(s.properties&&ee(s.properties[o]))return fi.warn("Event '"+e.event+"' had its '"+o+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return s}getPageViewId(){var e;return null==(e=this.pageViewManager.ir)?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)})}an(e){var t=re(e)&&!e,i=ts.N()&&"true"===ts.A("ph_debug");return!t&&(!!i||e)}}To.__defaultExtensionClasses={},To.On=(()=>{var e=()=>{};return{trace:e,debug:e,info:e,warn:e,error:e,fatal:e}})(),function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=Dr(e.prototype[t[i]])}(To,["identify"]);class Fo{constructor(e){this.disabled=!1===e;var t=K(e)?e:{};this.thresholdPx=t.threshold_px||30,this.timeoutMs=t.timeout_ms||1e3,this.clickCount=t.click_count||3,this.clicks=[]}isRageClick(e,t,i){if(this.disabled)return!1;var 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 $o="$copy_autocapture",Io=_i("[AutoCapture]");function Mo(e,t){return t.length>e?t.slice(0,e)+"...":t}function Ro(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do{t=t.previousSibling}while(t&&!cs(t));return t}var Co=_i("[ExceptionAutocapture]"),Oo=()=>{},Ao=_i("[TracingHeaders]"),Lo=_i("[Web Vitals]"),Do=9e5,No="disabled",jo="lazy_loading",qo="awaiting_config",zo="missing_config";_i("[SessionRecording]"),_i("[SessionRecording]");var Ho="[SessionRecording]",Go=_i(Ho),Bo=_i("[Heatmaps]");function Uo(e){return K(e)&&"clientX"in e&&"clientY"in e&&te(e.clientX)&&te(e.clientY)}var Vo=_i("[Product Tours]"),Wo=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(Ri))},Ko=["$set_once","$set"],Jo=_i("[SiteApps]"),Yo="Error while initializing PostHog app with config id ";function Zo(e,t,i){if(ee(e))return!1;switch(i){case"exact":return e===t;case"contains":var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(r,"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class Xo{constructor(e){this.Fn=new Ga,this.Ln=(e,t)=>this.$n(e,t)&&this.An(e,t)&&this.Nn(e,t)&&this.Dn(e,t),this.$n=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.qn=new Set,this.jn=new Set}init(){var e,t;Y(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(!Y(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e
1=>{var t,i;null==(t=this.jn)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.qn)||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.qn.has(e)||this.qn.has(t.event))&&this.jn&&(null==(i=this.jn)?void 0:i.size)>0&&this.jn.forEach(e=>{this.Hn(t,e)&&this.Fn.emit("actionCaptured",e.name)})}Bn(e){this.onAction("actionCaptured",t=>e(t))}Hn(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.Ln(e,i))return!0;return!1}onAction(e,t){return this.Fn.on(e,t)}An(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)return!1;if(!Zo(r,t.url,t.url_matching||"contains"))return!1}return!0}Nn(e,t){return!!this.Un(e,t)&&!!this.zn(e,t)&&!!this.Vn(e,t)}Un(e,t){var i;if(null==t||!t.href)return!0;var r=this.Wn(e);if(r.length>0)return r.some(e=>Zo(e.href,t.href,t.href_matching||"exact"));var s,n=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";return!!n&&Zo((s=n.match(/(?::|")href="(.*?)"/))?s[1]:"",t.href,t.href_matching||"exact")}zn(e,t){var i;if(null==t||!t.text)return!0;var r=this.Wn(e);if(r.length>0)return r.some(e=>Zo(e.text,t.text,t.text_matching||"exact")||Zo(e.$el_text,t.text,t.text_matching||"exact"));var s,n,a,o=(null==e||null==(i=e.properties)?void 0:i.$elements_chain)||"";return!!o&&(s=function(e){for(var t,i=[],r=/(?::|")text="(.*?)"/g;!ee(t=r.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(o),n=t.text,a=t.text_matching||"exact",s.some(e=>Zo(e,n,a)))}Vn(e,t){var i,r;if(null==t||!t.selector)return!0;var 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}return!1}Wn(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}Dn(e,t){return null==t||!t.properties||0===t.properties.length||Xa(t.properties.reduce((e,t)=>{var i=V(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 Qo{constructor(e){var t;this.Zn=[],this._instance=e,this.Gn=new Map,this.Qn=new Map,this.Jn=new Map,null==(t=this._instance)||null==t.onSessionId||t.onSessionId(e=>this.Kn(e))}Yn(e,t){return!!e&&Xa(e.propertyFilters,null==t?void 0:t.properties)}Xn(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}es(e,t,i){var r=(i===On?this.Gn:this.Qn).get(e),s=[];return this.ts(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.Yn(n,t)})}register(e){var t;Y(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.rs(e),this.ns(e))}ns(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.ss&&(this.ss=new Xo(this._instance),this.ss.init(),this.ss.Bn(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.ss)||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.Jn.get(t.name);i&&i.push(e.id),this.Jn.set(t.name,i||[e.id])}}))}))}rs(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.Gn=this.Xn(e,On),this.Qn=this.Xn(e,An))}onEvent(e,t){var i,r,s=this.os(),n=(null==t||null==(i=t.properties)?void 0:i.$survey_id)||(null==t||null==(r=t.properties)?void 0:r.$product_tour_id);
1if(n&&this.getActivatedIds().includes(n)){var a=this.ls(e,n);if("consume"===a)return s.info("event consumed activated item, removing it",{event:e,itemId:n}),void this.us([n]);if("persist"===a)return s.info("shown item promoted to persisted activation",{event:e,itemId:n}),void this.hs(n)}if(this.Qn.has(e)){var o=this.es(e,t,An);o.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:o.map(e=>e.id)}),this.us(o.map(e=>e.id)),o.forEach(e=>this.ds(e.id)))}if(this.Gn.has(e)){s.info("event name matched",{event:e,eventPayload:t,items:this.Gn.get(e)});var l=this.es(e,t,On);this.cs(l.map(e=>e.id))}}onAction(e){this.Jn.has(e)&&this.cs(this.Jn.get(e)||[])}cs(e){0!==e.length&&(this.Zn=[...new Set([...this.Zn,...e])],this.os().info("updating activated items",{activatedItems:this.getActivatedIds()}))}hs(e){this.Zn=this.Zn.filter(t=>t!==e);var t=this.vs();t.includes(e)||(this.fs([...t,e]),this.ps())}us(e){var t=new Set(e);this.Zn=this.Zn.filter(e=>!t.has(e));var i=this.gs(),r=i.filter(e=>!t.has(e));r.length!==i.length&&(this.fs(r),0===r.length&&this.ys())}gs(){var e,t=this.bs();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}vs(){var e,t,i=this.gs();if(0===i.length)return[];var r=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[this._s()],s=null==(t=this._instance)||null==t.get_session_id?void 0:t.get_session_id();return s&&r===s?i:[]}ps(){var e,t=null==(e=this._instance)||null==e.get_session_id?void 0:e.get_session_id();t&&this.ws(t)}ys(){this.xs()}Kn(e){var t,i=null==(t=this._instance)||null==(t=t.persistence)?void 0:t.props[this._s()];i&&i!==e&&(this.gs().length>0&&this.fs([]),this.ys())}getActivatedIds(){return[...new Set([...this.vs(),...this.Zn])].filter(e=>!this.ks(e))}reset(){this.Zn=[],this.gs().length>0&&this.fs([]),this.ys()}getEventToItemsMap(){return this.Gn}Ss(){return this.ss}}class el extends Qo{constructor(e){super(e)}bs(){return tr}_s(){return ir}Cs(){return Ln}ts(e){var t;null==(t=this._instance)||t.getSurveys(e)}ds(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}os(){return so}fs(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[tr]:e})}ws(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[ir]:e})}xs(){var e;null==(e=this._instance)||null==(e=e.persistence)||e.unregister(ir)}ks(){return!1}ls(e,t){var i;this.ts(e=>{i=e.find(e=>e.id===t)});var r=!i||function(e){var t;return ro(e)&&!(null==(t=e.conditions)||null==(t=t.events)||!t.repeatedActivation)||"always"===e.schedule}(i);return r?e===Ln?"consume":"ignore":e===Ln?"persist":e===Dn||e===Nn?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var tl="SDK is not enabled or survey functionality is not yet loaded",il="Disabled. Not loading surveys.",rl=null!=r&&r.location?hn(r.location.hash,"__posthog")||hn(location.hash,"state"):null,sl="_postHogToolbarParams",nl=_i("[Toolbar]"),al=_i("[FeatureFlags]"),ol=_i("[FeatureFlags]",{debugEnabled:!0}),ll="\" failed. Feature flags didn't load in time.",ul=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},hl=e=>{var t={};for(var i of Ar(e||{})){var r=i[1];r&&(t[i[0]]=r)}return t},cl=_i("[Error tracking]"),dl="Refusing to render web experiment since the viewer is a likely bot",pl={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>Ka(t,e),not_regex:(e,t)=>!Ka(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e};class vl{get Te(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{vl.Ts("retrieved web experiments from the server"),t.Is=new Map,e.forEach(e=>{if(e.feature_flag_key){var i;t.Is&&(vl.Ts("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.Is)||i.set(e.feature_flag_key,e));var r=t._instance.getFeatureFlag(e.feature_flag_key);Z(r)&&e.variants[r]&&t.Ms(e.name,r,e.variants[r].transforms)}else if(e.variants)for(var s in e.variants){var n=e.variants[s];vl.Es(n,t._instance)&&t.Ms(e.name,s,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())vl.Ts(dl);else if(!this.Te.disable_web_experiments){if(ee(this.Is))return this.Is=new Map,this.loadIfEnabled(),void this.previewWebExperiment();
vendor: 1,563 bytes, line 1
1vl.Ts("applying feature flags",e),e.forEach(e=>{var t;if(this.Is&&null!=(t=this.Is)&&t.has(e)){var i,r=this._instance.getFeatureFlag(e),s=null==(i=this.Is)?void 0:i.get(e);r&&null!=s&&s.variants[r]&&this.Ms(s.name,r,s.variants[r].transforms)}})}}previewWebExperiment(){var e=vl.getWindowLocation();if(null!=e&&e.search){var t=ln(null==e?void 0:e.search,"__experiment_id"),i=ln(null==e?void 0:e.search,"__experiment_variant");t&&i&&(vl.Ts("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.Rs(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.Te.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.Te.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.Te.token),method:"GET",timestampMode:"query",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Rs(e,t,i){var r=i.filter(t=>t.id===e);r&&r.length>0&&(vl.Ts("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.Ms(r[0].name,t,r[0].variants[t].transforms))}static Es(e,t){return!ee(e.conditions)&&vl.Ps(e,t)&&vl.Os(e)}static Ps(e,t){var i;if(ee(e.conditions)||ee(null==(i=e.conditions)?void 0:i.url))return!0;var r=vl.getWindowLocation();if(r){var s,n,a,o=ls(t,r.href);return null==(s=e.conditions)||!s.url||pl[null!==(n=null==(a=e.conditions)?void 0:a.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url,o)}return!1}
1static getWindowLocation(){return null==r?void 0:r.location}static Os(e){var t;if(ee(e.conditions)||ee(null==(t=e.conditions)?void 0:t.utm))return!0;var i=mn();if(i.utm_source){var r,s,n,a,o,l,u,h,c=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_campaign)==i.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(a=e.conditions)||null==(a=a.utm)?void 0:a.utm_source)==i.utm_source,p=null==(o=e.conditions)||null==(o=o.utm)||!o.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==i.utm_medium,v=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(h=e.conditions)||null==(h=h.utm)?void 0:h.utm_term)==i.utm_term;return c&&p&&v&&d}return!1}static Ts(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];fi.info("[WebExperiments] "+e,i)}Ms(e,t,i){this._is_bot()?vl.Ts(dl):"control"!==t?i.forEach(i=>{if(i.selector){var r;vl.Ts("applying transform of variant "+t+" for experiment "+e+" ",i);var s=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==s||s.forEach(e=>{var t=e;i.html&&(t.innerHTML=i.html),i.css&&t.setAttribute("style",i.css)})}}):vl.Ts("Control variants leave the page unmodified.")}_is_bot(){return n&&this._instance?Va(n,this.Te.custom_blocked_useragents):void 0}}var gl=_i("[Conversations]"),fl="Conversations not available yet.",_l="console",ml={featureFlags:class{constructor(e){this.Fs=!1,this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.qs=!1,this.js=!1,this.Hs=0,this.Bs=()=>{var e=this.Us();this.Hs=0,e&&this.reloadFeatureFlags()},this._instance=e,this.featureFlagEventHandlers=[],r&&zr(r,"online",this.Bs)}destroy(){null==r||r.removeEventListener("online",this.Bs)}get Te(){return this._instance.config}get mi(){return this._instance.persistence}zs(e){return this._instance.get_property(e)}Vs(){var e,t;return null!==(e=null==(t=this.mi)?void 0:t._r(this.Te.feature_flag_cache_ttl_ms))&&void 0!==e&&e}Ws(){return!!this.Vs()&&(this.js||this.$s||(this.js=!0,al.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}Zs(){var e,t=null!==(e=this.Te.evaluation_contexts)&&void 0!==e?e:this.Te.evaluation_environments;return!this.Te.evaluation_environments||this.Te.evaluation_contexts||this.qs||(al.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.qs=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||al.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}Gs(){return this.Zs().length>0}Qs(){var e=this.Te.flag_keys;if(!Y(e)){if(V(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||al.error("Invalid flag key found:",e,"Expected non-empty string"),t});al.error("Invalid flag_keys found:",e,"Expected array of non-empty strings")}}initialize(){var e,t,i=this._instance.config,r=null!==(e=null==(t=i.bootstrap)?void 0:t.featureFlags)&&void 0!==e?e:{};if(Object.keys(r).length){var s,n,a=null!==(s=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)&&void 0!==s?s:{},o=Object.keys(r).filter(e=>!!r[e]).reduce((e,t)=>(e[t]=r[t]||!1,e),{}),l=Object.keys(a).filter(e=>o[e]).reduce((e,t)=>(a[t]&&(e[t]=a[t]),e),{});this.receivedFeatureFlags({featureFlags:o,featureFlagPayloads:l})}}updateFlags(e,t,i){var r,s,n=null!=i&&i.merge&&null!==(r=this.zs(Hi))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(s=this.zs(Vi))&&void 0!==s?s:{},o=y({},n,e),l=y({},a,t),u={};for(var h of Object.entries(o)){var c=h[0],d=h[1];u[c]={key:c,enabled:x(d),variant:k(d),reason:void 0,metadata:Y(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.Ls}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.zs(Ui),t=this.zs(Ji),i=this.zs(Yi);if(!i&&!t)return e||{};var r=Or({},e||{}),s=[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])];for(var n of s){var a,o,l=r[n],u=null==t?void 0:t[n],h=Y(u)?null!==(a=null==l?void 0:l.enabled)&&void 0!==a&&a:!!u,c=Y(u)?l.variant:"string"==typeof u?u:void 0,d=null==i?void 0:i[n],p=y({},l,{enabled:h,variant:h?null!=c?c:null==l?void 0:l.variant:void 0});h!==(null==l?void 0:l.enabled)&&(p.original_enabled=null==l?void 0:l.enabled),c!==(null==l?void 0:l.variant)&&(p.original_variant=null==l?void 0:l.variant),d&&(p.metadata=y({},null==l?void 0:l.metadata,{payload:d,original_payload:null==l||null==(o=l.metadata)?void 0:o.payload})),r[n]=p}return this.Fs||(al.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.Fs=!0),r}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{var r=e[i];return{key:i,enabled:x(r),variant:k(r),payload:w(t[i])}})}
1getFlagVariants(){var e=this.zs(Hi),t=this.zs(Ji);if(!t)return e||{};for(var i=Or({},e),r=Object.keys(t),s=0;r.length>s;s++)i[r[s]]=t[r[s]];return this.Fs||(al.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.Fs=!0),i}getFlagPayloads(){var e=this.zs(Vi),t=this.zs(Yi);if(!t)return e||{};for(var i=Or({},e||{}),r=Object.keys(t),s=0;r.length>s;s++)i[r[s]]=t[r[s]];return this.Fs||(al.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.Fs=!0),i}reloadFeatureFlags(){this.As||this.Te.advanced_disable_feature_flags||this.Us()||this.Js||(this._instance.en.emit("featureFlagsReloading",!0),this.Js=setTimeout(()=>{this.Ks()},5))}Ys(){clearTimeout(this.Js),this.Js=void 0}ensureFlagsLoaded(){this.Ls||this.$s||this.Js||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.As=e}Ks(e){var t;if(this.Ys(),!this._instance.Ur()&&!this.Us())if(this.$s)this.Ns=!0;else{var i=this.Te.token,r=this.zs(wi),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.mi)?void 0:t.get_initial_props())||{},this.zs(Zi)||{},{$lib:f.LIB_NAME,$lib_version:f.LIB_VERSION}),group_properties:this.zs(Xi),timezone:Pn()};Q(r)||Y(r)||(s.$device_id=r),(null!=e&&e.disableFlags||this.Te.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.Gs()&&(s.evaluation_contexts=this.Zs());var n=this.Qs();Y(n)||(s.flag_keys=n);var a=!!this.Te.advanced_only_evaluate_survey_feature_flags,o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Te.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.$s=!0,this._instance._send_request({method:"POST",url:o,data:s,compression:this.Te.disable_compression?void 0:Cn,timestampMode:"body",timeout:this.Te.feature_flag_request_timeout_ms,callback:e=>{var t,i,r,n=!0;if(this.Xs(e.statusCode),200===e.statusCode&&(this.Ns||(this.$anon_distinct_id=void 0),n=!1),this.$s=!1,!s.disable_flags||this.Ns){this.Ds=!n;var o=[];e.error?e.error instanceof Error?o.push("AbortError"===e.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==e.statusCode&&o.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var l,u=!(null==(i=e.json)||null==(i=i.quotaLimited)||!i.includes("feature_flags"));u&&o.push("quota_limited"),null==(r=this.mi)||r.register({[ar]:o}),u?al.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:a}),this.Ns&&(this.Ns=!1,this.Ks()))}}})}}Us(){return cn(this.Hs,3)}Xs(e){this.Hs=dn(e,this.Hs,3,()=>al.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t){var i;if(void 0===t&&(t={}),!t.fresh||this.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){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 al.warn('getFeatureFlag for key "'+e+ll)}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.Ds)if(this.Ls||this.getFlags()&&this.getFlags().length>0){if(!this.Ws()){var i=this.getFlagVariants(),r=e in i,s=i[e],n=this.getFlagPayloads()[e],a=String(s),o=this.zs(Wi)||void 0,l=this.zs(or)||void 0,u=this.zs(sr)||{};if(this.Te.advanced_feature_flags_dedup_per_session){var h,c=this._instance.get_session_id(),d=this.zs(nr);c&&c!==d&&(u={},null==(h=this.mi)||h.register({[sr]:u,[nr]:c}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(a))){var p,v,g,f,_,m,y,b,x,k,E;V(u[e])?u[e].push(a):u[e]=[a],null==(p=this.mi)||p.register({[sr]:u});var S=this.getFeatureFlagDetails(e),P=[...null!==(v=this.zs(ar))&&void 0!==v?v:[]];Y(s)&&P.push("flag_missing");var T={$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:n||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(g=this.Te.bootstrap)||null==(g=g.featureFlags)?void 0:g[e])||null,$feature_flag_bootstrapped_payload:(null==(f=this.Te.bootstrap)||null==(f=f.featureFlagPayloads)?void 0:f[e])||null,$used_bootstrap_value:!this.Ds};Y(null==S||null==(_=S.metadata)?void 0:_.has_experiment)||(T.$feature_flag_has_experiment=S.metadata.has_experiment),Y(null==S||null==(m
1=S.metadata)?void 0:m.version)||(T.$feature_flag_version=S.metadata.version);var F,$=null!==(y=null==S||null==(b=S.reason)?void 0:b.description)&&void 0!==y?y:null==S||null==(x=S.reason)?void 0:x.code;$&&(T.$feature_flag_reason=$),null!=S&&null!=(k=S.metadata)&&k.id&&(T.$feature_flag_id=S.metadata.id),Y(null==S?void 0:S.original_variant)&&Y(null==S?void 0:S.original_enabled)||(T.$feature_flag_original_response=Y(S.original_variant)?S.original_enabled:S.original_variant),null!=S&&null!=(E=S.metadata)&&E.original_payload&&(T.$feature_flag_original_payload=null==S||null==(F=S.metadata)?void 0:F.original_payload),P.length&&(T.$feature_flag_error=P.join(",")),this._instance.capture("$feature_flag_called",T)}if(r)return{key:e,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:w(n)}}}else al.warn('getFeatureFlagResult for key "'+e+ll)}getRemoteConfigPayload(e,t){var i=this.Te.token,r={distinct_id:this._instance.get_distinct_id(),token:i,person_properties:{$lib:f.LIB_NAME,$lib_version:f.LIB_VERSION}};this.Gs()&&(r.evaluation_contexts=this.Zs());var s=this.Qs();Y(s)||(r.flag_keys=s),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Te.disable_compression?void 0:Cn,timestampMode:"body",timeout:this.Te.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.Ds)return t.defaultValue;if(!(this.Ls||this.getFlags()&&this.getFlags().length>0))return al.warn('isFeatureEnabled for key "'+e+ll),t.defaultValue;var i=this.getFeatureFlag(e,t);return Y(i)?t.defaultValue:!!i}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){if(this.mi){this.Ls=!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 a=(e=>{var t=e.flags;return t?(e.featureFlags=Object.fromEntries(Object.keys(t).map(e=>{var i;return[e,null!==(i=t[e].variant)&&void 0!==i?i:t[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(t).filter(e=>t[e].enabled).filter(e=>{var i;return null==(i=t[e].metadata)?void 0:i.payload}).map(e=>{var i;return[e,null==(i=t[e].metadata)?void 0:i.payload]}))):e.featureFlags&&al.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e})(e),o=a.flags,l=a.featureFlags,u=a.featureFlagPayloads;if(l){var h=e.requestId,c=e.evaluatedAt;if(V(l)){al.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var d={};if(l)for(var p=0;l.length>p;p++)d[l[p]]=!0;t&&t.register({[Gi]:l,[Hi]:d,[Ki]:!1})}else{var v=l,g=u,f=o;if(null!=n&&n.partialResponse)v=y({},i,v),g=y({},r,g),f=y({},s,f);else if(e.errorsWhileComputingFlags)if(o){var _=new Set(Object.keys(o).filter(e=>{var t;return!(null!=(t=o[e])&&t.failed)}));v=y({},i,Object.fromEntries(Object.entries(v).filter(e=>_.has(e[0])))),g=y({},r,Object.fromEntries(Object.entries(g||{}).filter(e=>_.has(e[0])))),f=y({},s,Object.fromEntries(Object.entries(f||{}).filter(e=>_.has(e[0]))))}else v=y({},i,v),g=y({},r,g),f=y({},s,f);t&&t.register(y({[Gi]:Object.keys(hl(v)),[Hi]:v||{},[Vi]:g||{},[Ui]:f||{},[Ki]:!0===e.minimalFlagCalledEvents},h?{[Wi]:h}:{},c?{[or]:c}:{}))}}}(e,this.mi,r,s,n,i),t||(this.js=!1),this.eo(t)}}override(e,t){void 0===t&&(t=!1),al.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.mi)return al.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.mi.unregister(Ji),this.mi.unregister(Yi),this.eo(),ol.info("All overrides cleared");if(V(e)){var t=ul(e);return this.mi.register({[Ji]:t}),this.eo(),ol.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){var i,r=e;if(this.Fs=Boolean(null!==(i=r.suppressWarning)&&void 0!==i&&i),"flags"in r)if(!1===r.flags)this.mi.unregister(Ji),ol.info("Flag overrides cleared");else if(r.flags){if(V(r.flags)){var s=ul(r.flags);this.mi.register({[Ji]:s})}else this.mi.register({[Ji]:r.flags});ol.info("Flag overrides set",{flags:r.flags})}return"payloads"in r&&(!1===r.payloads?(this.mi.unregister(Yi),ol.info("Payload overrides cleared")):r.payloads&&(this.mi.register({[Yi]:r.payloads}),ol.info("Payload overrides set",{payloads:r.payloads}))),void this.eo()}if(e&&"object"==typeof e)return this.mi.register({[Ji]:e}),this.eo(),ol.info("Flag overrides set",{flags:e});al.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Ls){var t=this.ro(),i=t.flags,r=t.flagVariants;try{e(i,r)}catch(e){al.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var r,s=(this.zs(Bi)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:n};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=y({},this.getFlagVariants(),{[e]:t});null==(r=this.mi)||r.register({[Gi]:Object.keys(hl(o)),[Hi]:o}),this.eo()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var r=this.zs(Bi),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.Te.token+s),method:"GET",timestampMode:"query",callback:t=>{var i,r;if(t.json){var s=t.json.earlyAccessFeatures;return null==(i=this.mi)||i.unregister(Bi),null==(r=this.mi)||r.register({[Bi]:s}),e(s)}}})}ro(){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),{})}}eo(e){var t=this.ro(),i=t.flags,r=t.flagVariants;
1this.featureFlagEventHandlers.forEach(t=>{try{t(i,r,{errorsLoading:e})}catch(e){al.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.zs(Zi)||{},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 a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(n[a]=s[a]));this._instance.register({[Zi]:y({},i,n,r)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=y({},this.zs(Zi)||{});e.forEach(e=>{delete i[e]}),this._instance.register({[Zi]:i}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this._instance.unregister(Zi),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.zs(Xi)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=y({},i[t],e[t]),delete e[t]}),this._instance.register({[Xi]:y({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.zs(Xi)||{};this._instance.register({[Xi]:y({},t,{[e]:{}})})}else this._instance.unregister(Xi)}reset(){this.Ls=!1,this.$s=!1,this.As=!1,this.Ns=!1,this.Ds=!1,this.$anon_distinct_id=void 0,this.Ys(),this.Fs=!1,this.Hs=0}}},yl={sessionRecording:class{get Te(){return this._instance.config}get mi(){return this._instance.persistence}get started(){var e;return!(null==(e=this.io)||!e.isStarted)}get status(){var e,t;return this.no===qo||this.no===zo?this.no:null!==(e=null==(t=this.io)?void 0:t.status)&&void 0!==e?e:this.no}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.no=No,this.so=void 0,this._instance=e,!this._instance.sessionManager)throw Go.error("started without valid sessionManager"),new Error(Ho+" started without valid sessionManager. This is a bug.");if(this.Te.cookieless_mode===xr)throw new Error(Ho+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get oo(){var e,t=!(null==(e=this._instance.get_property(Oi))||!e.enabled),i=!this.Te.disable_session_recording,s=this.Te.disable_session_recording||this._instance.consent.isOptedOut();return r&&t&&i&&!s}startIfEnabledOrStop(e){var t;if(!this.oo||null==(t=this.io)||!t.isStarted){var i=!Y(Object.assign)&&!Y(Array.from);this.oo&&i?(this.ao(e),Go.info("starting")):(this.no=No,this.stopRecording())}}ao(e){var t,i,r;this.oo&&(this.no!==qo&&this.no!==zo&&(this.no=jo),null!=g&&null!=(t=g.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=g.__PosthogExtensions__)&&i.initSessionRecording?this.lo(e):null==(r=g.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.uo,t=>{if(t)return Go.error("could not load recorder",t);this.lo(e)}))}stopRecording(){var e,t;null==(e=this.so)||e.call(this),this.so=void 0,null==(t=this.io)||t.stop()}ho(){var e,t;null==(e=this.so)||e.call(this),this.so=void 0,null==(t=this.io)||t.discard()}do(){var e,t;null==(e=this.mi)||e.unregister(zi),null==(t=this.mi)||t.unregister(Ai)}co(e,t){if(ee(e))return null;var i,r=te(e)?e:parseFloat(e);return"number"!=typeof(i=r)||!Number.isFinite(i)||0>i||i>1?(Go.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):r}vo(e){if(this.mi){var t,i,r=this.mi,s=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,s=this.co(null==(t=this.Te.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.co(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:n;ee(a)&&this.do();var o=null==i?void 0:i.minimumDurationMilliseconds;r.register({[Oi]: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:a,minimumDurationMilliseconds:Y(o)?null:o,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(t=this.so)||t.call(this),this.so=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){var t=e.ok?e.config:void 0;return t&&"sessionRecording"in t?!1===t.sessionRecording?(this.vo(t),void this.ho()):(this.vo(t),void this.startIfEnabledOrStop()):(this.no===qo&&(this.no=zo,Go.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.io)&&i.log?this.io.log(e,t):Go.warn("log called before recorder was ready")}get uo(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(Oi);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}fo(){var e,t,i=this._instance.get_property(Oi);if(!i)return!1;try{t="object"==typeof i?i:JSON.parse(i)}catch(e){return Go.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}lo(e){var t,i;if(null==(t=g.__PosthogExtensions__)||!t.initSessionRecording)return Go.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[yr]:!0});if(this.io||(this.io=null==(i=g.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.io._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.fo()){if(this.no===zo||this.no===qo)return;return this.no=qo,Go.info("persisted remote config is stale, requesting fresh config before starting"),void new Bn(this._instance).load()}this.no=jo,this.io.start(e)}onRRwebEmit(e){var t;null==(t=this.io)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.io||null==(t=this.mi)||t.register({[Di]:!0}),null==(e=this.io)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.io||null==(t=this.mi)||t.register({[Li]:!0}),null==(e=this.io)||e.overrideSampling()}overrideTrigger(e){var t,i;this.io||null==(i=this.mi)||i.register({["url"===e?Ni:ji]:!0}),null==(t=this.io)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.io)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.io)||!i.tryAddCustomEvent(e,t))}}},bl={autocapture:class{constructor(e){this.po=!1,this.mo=null,this.yo=!1,this.bo=!1,this.instance=e,this.rageclicks=new Fo(e.config.rageclick),this._o=null}initialize(){this.startIfEnabled()}get Te(){var e,t,i=K(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null==(e=i.url_allowlist)?void 0:e.map(e=>new RegExp(e)),i.url_ignorelist=null==(t=i.url_ignorelist)?void 0:t.map(e=>new RegExp(e)),i}wo(){if(this.isBrowserSupported()){if(r&&a){var e=e=>{e=e||(null==r?void 0:r.event);try{this.xo(e)}catch(e){Io.error("Failed to capture event",e)}};if(zr(a,"submit",e,{capture:!0}),zr(a,"change",e,{capture:!0}),zr(a,"click",e,{capture:!0}),this.Te.capture_copied_text){var t=e=>{e=e||(null==r?void 0:r.event);try{this.xo(e,$o)}catch(e){Io.error("Failed to capture copy/cut event",e)}};zr(a,"copy",t,{capture:!0}),zr(a,"cut",t,{capture:!0})}}}else Io.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.po&&(this.wo(),this.po=!0)}onRemoteConfig(e){if(this.yo=!0,e.ok){var t=e.config;t.elementsChainAsString&&(this.bo=t.elementsChainAsString);var i=t.autocapture_opt_out;re(i)&&(this.instance.persistence&&this.instance.persistence.register({[Si]:i}),this.mo=i),this.startIfEnabled()}else this.startIfEnabled()}setElementSelectors(e){this._o=e}getElementSelectors(e){var t,i=[];return null==(t=this._o)||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[Si],r=this.mo,s=this.instance.Ur()&&!this.yo;if(Q(r)&&!re(i)&&!s)return!1;var n=null!==(t=this.mo)&&void 0!==t?t:!!i;return!!this.instance.config.autocapture&&!n}xo(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,s=bs(e);ps(s)&&(s=s.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&Is(s,this.instance.config.rageclick)&&this.xo(e,"$rageclick");var n=t===$o;if(s&&function(e,t,i,s,n,a){var o;if(!r||Ms(e))return!1;if(null!=i&&i.url_allowlist&&!fs(i.url_allowlist,a))return!1;if(null!=i&&i.url_ignorelist&&fs(i.url_ignorelist,a))return!1;if(null!=i&&i.dom_event_allowlist){var l=i.dom_event_allowlist;if(l&&!l.some(e=>t.type===e))return!1}var u=Rs(e,s),h=u.parentIsUsefulElement,c=u.targetElementList;if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(Y(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}(c,i))return!1;if(!xs(c,null==i?void 0:i.css_selector_allowlist))return!1;if(xs(c,null!==(o=null==i?void 0:i.css_selector_ignorelist)&&void 0!==o?o:Es))return!1;try{var d=r.getComputedStyle(e);
1if(d&&"pointer"===d.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var p=e.tagName.toLowerCase();switch(p){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return h?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(ws.indexOf(p)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,this.Te,n,n?["copy","cut"]:void 0,this.instance)){var a=function(e,t){var i,s,n=t.e,a=t.maskAllElementAttributes,o=t.maskAllText,l=t.elementAttributeIgnoreList,u=t.elementsChainAsString,h=t.disableCaptureUrlHashes;if(!cs(e))return{props:{}};for(var c=[e],d=new Set([e]),p=e;p.parentNode&&!ds(p,"body")&&1e3>c.length;)if(vs(p.parentNode)){var v=p.parentNode.host;if(d.has(v))break;d.add(v),c.push(v),p=v}else{if(!cs(p.parentNode))break;if(d.has(p.parentNode))break;d.add(p.parentNode),c.push(p.parentNode),p=p.parentNode}var g,f,_=[],m={},b=!1,w=!1;if(Cr(c,e=>{var t=Cs(e);if(ds(e,"a")){var i=e.getAttribute("href");b=!!(t&&i&&zs(i))&&(h?bt(i):i)}j(_s(e),"ph-no-capture")&&(w=!0),_.push(function(e,t,i,r,s){void 0===s&&(s=!1);var n=e.tagName.toLowerCase(),a={tag_name:n};ws.indexOf(n)>-1&&!i&&(a.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?Mo(1024,Hs(e)):Mo(1024,ys(e)));var o=_s(e);o.length>0&&(a.classes=o.filter(function(e){return""!==e})),Cr(e.attributes,function(i){var n;if((!Os(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!t&&zs(i.value)&&(!Z(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=i.value;"class"===i.name&&(o=gs(o).join(" ")),a["attr__"+i.name]=Mo(1024,"href"===i.name&&s?bt(o):o)}});for(var l=1,u=1,h=e;h=Ro(h);)l++,h.tagName===e.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(e,a,o,l,h));var r=function(e){if(!Cs(e))return{};var t={};return Cr(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&&zs(r)&&(t[i]=r)}}),t}(e);Or(m,r)}),w)return{props:{},explicitNoCapture:w};if(o||(_[0].$el_text=ds(e,"a")||ds(e,"button")?Hs(e):ys(e)),b){var x,k;_[0].attr__href=b;var E=null==(x=on(b))?void 0:x.host,S=null==r||null==(k=r.location)?void 0:k.host;E&&S&&E!==S&&(g=b)}return{props:Or({$event_type:n.type,$ce_version:1},u?{}:{$elements:_},{$elements_chain:(f=_,function(e){return e.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),a={};return Ar(n).sort((e,t)=>e[0].localeCompare(t[0])).forEach(e=>{var t=e[1];return a[Bs(e[0].toString())]=Bs(t.toString())}),(r+=":")+Ar(a).map(e=>e[0]+'="'+e[1]+'"').join("")}).join(";")}(function(e){return e.map(e=>{var t,i,r={text:null==(t=e.$el_text)?void 0:t.slice(0,400),tag_name:e.tag_name,href:null==(i=e.attr__href)?void 0:i.slice(0,2048),attr_class:Us(e),attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return Ar(e).filter(e=>0===e[0].indexOf("attr__")).forEach(e=>r.attributes[e[0]]=e[1]),r})}(f)))},null!=(i=_[0])&&i.$el_text?{$el_text:null==(s=_[0])?void 0:s.$el_text}:{},g&&"click"===n.type?{$external_click_url:g}:{},m)}}(s,{e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Te.element_attribute_ignorelist,elementsChainAsString:this.bo,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes}),o=a.props;if(a.explicitNoCapture)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(o.$element_selectors=l),t===$o){var u,h=ms(null==r||null==(u=r.getSelection())?void 0:u.toString()),c=e.type||"clipboard";if(!h)return!1;o.$selected_content=h,o.$copy_type=c}return this.instance.capture(t,o),!0}}}isBrowserSupported(){return W(null==a?void 0:a.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.ko=(null==r||null==(t=r.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(fi.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.So&&this.So(),this.So=void 0,fi.info("History API monitoring stopped")}monitorHistoryChanges(){r&&r.history&&(this.Co("pushState"),this.Co("replaceState"),this.To())}Co(e){var t;if(r&&(null==(t=r.history[e])||!t.__posthog_wrapped__)){var i=this;!function(e,t,i){try{if(!(t in e))return Oo;
vendor: 4,339 bytes, line 1
1var r={next:e[t]},s=i(function(){for(var e=arguments.length,t=new Array(e),i=0;e>i;i++)t[i]=arguments[i];return r.next.apply(this,t)});return W(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0},__posthog_layer__:{enumerable:!1,value:r}})),e[t]=s,()=>{if(e[t]!==s)for(var i=e[t];W(i)&&i.__posthog_layer__;){var n=i.__posthog_layer__;if(n.next===s)return void(n.next=r.next);i=n.next}else e[t]=r.next}}catch(e){return Oo}}(r.history,e,t=>function(r,s,n){t.call(this,r,s,n),i.Io(e)})}}Io(e){try{var t,i=null==r||null==(t=r.location)?void 0:t.pathname;if(!i)return;i!==this.ko&&this.isEnabled&&this._instance.capture(Fr,{navigation_type:e}),this.ko=i}catch(t){fi.error("Error capturing "+e+" pageview",t)}}To(){if(!this.So){var e=()=>{this.Io("popstate")};zr(r,"popstate",e),this.So=()=>{r&&r.removeEventListener("popstate",e)}}}},heatmaps:class{get Te(){return this.instance.config}constructor(e){var t;this.Mo=!1,this.po=!1,this.Eo=null,this.instance=e,this.Mo=!(null==(t=this.instance.persistence)||!t.props[Pi]),this.rageclicks=new Fo(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return K(this.Te.capture_heatmaps)&&this.Te.capture_heatmaps.flush_interval_milliseconds&&(e=this.Te.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return ee(this.Te.capture_heatmaps)?ee(this.Te.enable_heatmaps)?this.Mo:this.Te.enable_heatmaps:!1!==this.Te.capture_heatmaps}startIfEnabled(){if(this.isEnabled){if(this.po)return;Bo.info("starting..."),this.Ro(),this.ke()}else{var e;clearInterval(null!==(e=this.Eo)&&void 0!==e?e:void 0),this.Po(),this.getAndClearBuffer()}}onRemoteConfig(e){if(e.ok){var t=e.config;if("heatmaps"in t){var i=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Pi]:i}),this.Mo=i,this.startIfEnabled()}}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Oo(e){Uo(e.originalEvent)&&this.pe(e.originalEvent,"deadclick")}ke(){this.Eo&&clearInterval(this.Eo),this.Eo="visible"===(null==a?void 0:a.visibilityState)?setInterval(this.oi.bind(this),this.flushIntervalMilliseconds):null}Ro(){r&&a&&(this.Fo=this.oi.bind(this),zr(r,Tr,this.Fo),this.Lo=e=>this.pe(e||(null==r?void 0:r.event)),zr(a,"click",this.Lo,{capture:!0}),this.$o=e=>this.Ao(e||(null==r?void 0:r.event)),zr(a,"mousemove",this.$o,{capture:!0}),this.No=new Js(this.instance,Ws,this.Oo.bind(this)),this.No.startIfEnabledOrStop(),this.Do=this.ke.bind(this),zr(a,Pr,this.Do),this.po=!0)}Po(){var e;r&&a&&(this.Fo&&r.removeEventListener(Tr,this.Fo),this.Lo&&a.removeEventListener("click",this.Lo,{capture:!0}),this.$o&&a.removeEventListener("mousemove",this.$o,{capture:!0}),this.Do&&a.removeEventListener(Pr,this.Do),clearTimeout(this.qo),null==(e=this.No)||e.stop(),this.po=!1)}jo(e,t){var i=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),a=function(e,t,i){for(var s=e;s&&cs(s)&&!ds(s,"body");){if(s===i)return!1;var n=void 0;try{var a,o,l;n=null==(a=null!==(o=null==(l=s.ownerDocument)?void 0:l.defaultView)&&void 0!==o?o:r)?void 0:a.getComputedStyle(s).position}catch(e){return!1}if(j(t,n))return!0;s=ks(s)}return!1}(bs(e),["fixed","sticky"],n);return{x:e.clientX+(a?0:s),y:e.clientY+(a?0:i),target_fixed:a,type:t}}pe(e,t){var i;if(void 0===t&&(t="click"),!hs(e.target)&&Uo(e)){var r=this.jo(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&Is(bs(e),this.instance.config.rageclick)&&this.Nt(y({},r,{type:"rageclick"})),this.Nt(r)}}Ao(e){!hs(e.target)&&Uo(e)&&(clearTimeout(this.qo),this.qo=setTimeout(()=>{this.Nt(this.jo(e,"mousemove"))},500))}Nt(e){if(r){var t=this.Te.disable_capture_url_hashes?bt(r.location.href):r.location.href,i=this.Te.custom_personal_data_properties,s=this.Te.mask_personal_data_properties?[...vn,...i||[]]:[],n=un(t,s,fn);this.R=this.R||{},this.R[n]||(this.R[n]=[]),this.R[n].push(e)}}oi(){this.R&&!J(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Js,webVitalsAutocapture:class{constructor(e){var t;this.Mo=!1,this.po=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Ho=()=>{clearTimeout(this.Bo),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.Uo=e=>{var t;this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.zo();if(!Y(i))if(ee(null==e?void 0:e.name)||ee(null==e?void 0:e.value))Lo.error("Invalid metric received",e);else if(!this.Vo||this.Vo>e.value){this.R.url!==i&&(this.Ho(),this.Bo=setTimeout(this.Ho,this.flushToCaptureTimeoutMs)),Y(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=Y(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()});Y(r)||(s.$session_id=r.sessionId,s.$window_id=r.windowId),this.R.metrics.push(s),this.R.metrics.length===this.allowedMetrics.length&&this.Ho()}else Lo.error("Ignoring metric with value >= "+this.Vo,e)},this.Wo=()=>{if(!this.po){var e,t,i,r,s=g.__PosthogExtensions__;if(!Y(s)&&!Y(s.postHogWebVitalsCallbacks)){var n=s.postHogWebVitalsCallbacks;e=n.onLCP,t=n.onCLS,i=n.onFCP,r=n.onINP}e&&t&&i&&r?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.Uo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.Uo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.Uo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this.Uo.bind(this)),this.po=!0):Lo.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Mo=!(null==(t=this._instance.persistence)||!t.props[Ii]),this.startIfEnabled()}get Zo(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=K(this.Zo)?null==(e=this.Zo)?void 0:e.web_vitals_allowed_metrics:void 0;return ee(i)?(null==(t=this._instance.persistence)?void 0:t.props[Ci])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(K(this.Zo)?this.Zo.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=K(this.Zo)?this.Zo.web_vitals_attribution:void 0;return null!=e&&e}get Vo(){var e=K(this.Zo)&&te(this.Zo.__web_vitals_max_value)?this.Zo.__web_vitals_max_value:Do;return e>0&&6e4>=e?Do:e}get isEnabled(){var e=null==o?void 0:o.protocol;if("http:"!==e&&"https:"!==e)return Lo.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=K(this.Zo)?this.Zo.web_vitals:re(this.Zo)?this.Zo:void 0;return re(t)?t:this.Mo}startIfEnabled(){this.isEnabled&&!this.po&&(Lo.info("enabled, starting..."),this.er(this.Wo))}onRemoteConfig(e){if(e.ok){var t=e.config;if("capturePerformance"in t){var i=K(t.capturePerformance)&&!!t.capturePerformance.web_vitals,r=K(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Ii]:i}),this._instance.persistence.register({[Ci]:r})),this.Mo=i,this.startIfEnabled()}}}er(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",t=>{t?Lo.error("failed to load script",t):e()})}zo(){var e=r?this._instance.config.disable_capture_url_hashes?bt(r.location.href):r.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties,i=this._instance.config.mask_personal_data_properties?[...vn,...t||[]]:[];return un(e,i,fn)}Lo.error("Could not determine current URL")}}},wl={exceptionObserver:class{constructor(e){var t;this.Wo=()=>{var e;if(r&&this.isEnabled&&null!=(e=g.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=g.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=g.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,s=g.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.Go&&this.Te.capture_unhandled_errors&&(this.Go=t(this.captureException.bind(this))),!this.Qo&&this.Te.capture_unhandled_rejections&&(this.Qo=i(this.captureException.bind(this))),!this.Jo&&this.Te.capture_console_errors&&(this.Jo=s(this.captureException.bind(this)))}catch(e){Co.error("failed to start",e),this.Ko()}}},this._instance=e,this.Yo=!(null==(t=this._instance.persistence)||!t.props[Ti]),this.Xo=new pe(y({},function(e){var t,i,r,s;return void 0===e&&(e={}),{refillRate:null!==(t=null!==(i=e.exceptionRateLimiterRefillRate)&&void 0!==i?i:e.__exceptionRateLimiterRefillRate)&&void 0!==t?t:1,bucketSize:null!==(r=null!==(s=e.exceptionRateLimiterBucketSize)&&void 0!==s?s:e.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10}}(this._instance.config.error_tracking),{refillInterval:1e4,Ge:Co})),this.Te=this.ea(),this.startIfEnabledOrStop()}ea(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return K(e)?t=y({},t,e):(Y(e)?this.Yo:e)&&(t=y({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Te.capture_console_errors||this.Te.capture_unhandled_errors||this.Te.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(Co.info("enabled"),this.Ko(),this.er(this.Wo)):this.Ko()}er(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return Co.error("failed to load script",t);e()})}Ko(){var e,t,i;null==(e=this.Go)||e.call(this),this.Go=void 0,null==(t=this.Qo)||t.call(this),this.Qo=void 0,null==(i=this.Jo)||i.call(this),this.Jo=void 0}onRemoteConfig(e){if(e.ok){var t=e.config;"autocaptureExceptions"in t&&(this.Yo=!!t.autocaptureExceptions||!1,this._instance.persistence&&this._instance.persistence.register({[Ti]:this.Yo}),this.Te=this.ea(),this.startIfEnabledOrStop())}}onConfigChange(){this.Te=this.ea()}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.Xo.consumeRateLimit(s)?Co.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.ta=[],this.ra=new jt([new Zt,new oi,new Qt,new Xt,new ni,new si,new ti,new ai],function(e){for(var t=arguments.length,i=new 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"),a=r;n.length>a;a++){var o=n[a];if(1024>=o.length){var l=Yt.test(o)?o.replace(Yt,"$1"):o;if(!l.match(/\S*Error: /)){for(var u of i){var h=u(l,e);if(h){s.push(h);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=>{return y({},e,{filename:e.filename||(i=t,i[i.length-1]||{}).filename,function:e.function||qt});var i})}(s)}}("web:javascript",Vt,Jt)),this._instance=e,this.ta=null!==(t=null==(i=this._instance.persistence)?void 0:i.get_property(Fi))&&void 0!==t?t:[],this.ia=di(this.na()),this.sa=new pi(this.ia)}onConfigChange(){this.ia=di(this.na()),this.sa.setConfig(this.ia)}onRemoteConfig(e){var t,i,r;if(e.ok){var s=e.config;if("errorTracking"in s){var n=null!==(t=null==(i=s.errorTracking)?void 0:i.suppressionRules)&&void 0!==t?t:[],a=null==(r=s.errorTracking)?void 0:r.captureExtensionExceptions;this.ta=n,this._instance.persistence&&this._instance.persistence.register({[Fi]:this.ta,[$i]:a})}}}get oa(){var e,t=!!this._instance.get_property($i),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=i?i:t)&&void 0!==e&&e}buildProperties(e,t){return this.ra.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.ia.enabled)try{if(!Z(e)||0===e.trim().length)return void cl.warn("Ignoring exception step because message must be a non-empty string");var i=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((i,r)=>hi.has(r)?(t.push(r),i):(i[r]=e[r],i),{}),droppedKeys:t}}(this.aa(t)),r=i.sanitizedProperties,s=i.droppedKeys;s.length>0&&cl.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.sa.add(y({[li]:e,[ui]:(new Date).toISOString()},r))}catch(e){cl.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.la(t)){if(this.ua(t))return this.ha("Exception dropped: matched a suppression rule"),void cl.info("Skipping exception capture because a suppression rule matched");if(!this.oa&&this.da(t))return this.ha("Exception dropped: thrown by a browser extension"),void cl.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ca(t))return this.ha("Exception dropped: thrown by the PostHog SDK"),void cl.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.ia.enabled&&ee(e.$exception_steps)?this.va(e):e;try{var r=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",kn:!0});return r&&this.sa.clear(),r}catch(e){return cl.error("Failed to capture exception event. Dropping this exception.",e),void this.sa.clear()}}catch(e){return void cl.error("Failed to process exception event. Ignoring this exception.",e)}}va(e){try{var t=this.sa.getAttachable();return 0===t.length?e:y({},e,{$exception_steps:t})}catch(t){return cl.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}ha(e){this.ia.enabled&&this.sa.add({[li]:e,[ui]:(new Date).toISOString()})}aa(e){return K(e)?y({},e):{}}na(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}}ua(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>
vendor: 11,223 bytes, line 1
1{var i=t.type,r=t.value;return Z(i)&&i.length>0&&e.$exception_types.push(i),Z(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this.ta.some(e=>{var i=e.values.map(e=>{var i,r=Ya[e.operator],s=V(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)})}da(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://"))}ca(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:[],a=n[n.length-1];return null!==(r=null==a||null==(s=a.filename)?void 0:s.includes("posthog.com/static"))&&void 0!==r&&r}return!1}la(e){return!ee(e)&&V(e)}}},xl=y({productTours:class{get mi(){return this._instance.persistence}constructor(e){this.fa=null,this.pa=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(e.ok){var t=e.config;if("productTours"in t){var i,r;if(this.mi&&this.mi.register({[Ri]:!!t.productTours}),!Wo(this._instance))return!this.fa&&ee(null==(i=this.mi)?void 0:i.props[rr])||Vo.info("product tours disabled; stopping and clearing cached tours"),null==(r=this.fa)||r.stop(),this.fa=null,void this.clearCache();this.loadIfEnabled()}}}loadIfEnabled(){!this.fa&&Wo(this._instance)&&this.er(()=>this.ga())}er(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?Vo.error("Could not load product tours script",t):e()})}ga(){var e;!this.fa&&null!=(e=g.__PosthogExtensions__)&&e.generateProductTours&&(this.fa=g.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!V(this.pa)||t){var i=this.mi;if(i){var r=i.props[rr];if(V(r)&&!t)return this.pa=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",timestampMode:"query",callback:t=>{if(Wo(this._instance)){var r=t.statusCode;if(200!==r||!t.json){var s="Product Tours API could not be loaded, status: "+r;return Vo.error(s),void e([],{isLoaded:!1,error:s})}var n=V(t.json.product_tours)?t.json.product_tours:[];this.pa=n,i&&i.register({[rr]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.pa,{isLoaded:!0})}getActiveProductTours(e){ee(this.fa)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.fa.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.fa)||t.showTourById(e)}previewTour(e){this.fa?this.fa.previewTour(e):this.er(()=>{var t;this.ga(),null==(t=this.fa)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.fa)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.fa)||e.nextStep()}previousStep(){var e;null==(e=this.fa)||e.previousStep()}clearCache(){var e;this.pa=null,null==(e=this.mi)||e.unregister(rr)}resetTour(e){var t;null==(t=this.fa)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.fa)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.fa)||t.cancelPendingTour(e)}}},ml),kl={siteApps:class{constructor(e){this.ma=0,this._instance=e,this.ya=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}ba(e,t){if(t){var i=this.globalsForEvent(t);this.ya.push(i),this.ya.length>1e3&&(this.ya=this.ya.slice(10))}}get siteAppLoaders(){var e;return null==(e=g._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.ba.bind(this));this._a=()=>{e(),this.ya=[],this._a=void 0}}}globalsForEvent(e){var t,i,r,s,n,a,o;if(!e)throw new Error("Event payload is required");var l={},u=this._instance.get_property("$groups")||[],h=this._instance.get_property("$stored_group_properties")||{};for(var c of Object.entries(h)){var d=c[0];l[d]={id:u[d],type:d,properties:c[1]}}var p=e.$set_once,v=e.$set;return{event:y({},b(e,Ko),{properties:y({},e.properties,v?{$set:y({},null!==(t=null==(i=e.properties)?void 0:i.$set)&&void 0!==t?t:{},v)}:{},p?{$set_once:y({},null!==(r=null==(s=e.properties)?void 0:s.$set_once)&&void 0!==r?r:{},p)}:{}),elements_chain:null!==(n=null==(a=e.properties)?void 0:a.$elements_chain)&&void 0!==n?n:"",distinct_id:null==(o=e.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}wa(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)||(Jo.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)||(Jo.error("prepare_external_dependency_script returned null"),null):e}xa(){var e,t,i,r,s,n,o,l;if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var u=null==a?void 0:a.defaultView,h=null==u||null==(e=u.Node)?void 0:e.prototype;if(!u||!h)return()=>{};if(this.ma++,this.ka)return this.Sa();var c=[],d=this,p=new WeakSet,v=(e,t,i)=>{if(null!=e&&e[t]){var r=e[t];e[t]=i(r),c.push(()=>{e[t]=r})}},g=e=>{if(p.has(e))return e;var t=d.wa(e);return t&&p.add(t),t},f=e=>e.map(e=>"string"==typeof e?e:g(e)).filter(e=>!Q(e));return v(h,"appendChild",e=>function(t){var i=g(t);return i?e.call(this,i):t}),v(h,"insertBefore",e=>function(t,i){var r=g(t);return r?e.call(this,r,i):t}),v(h,"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=new Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,f(i))}),v(e,"prepend",e=>function(){for(var t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,f(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=new Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,f(i))}),v(e,"after",e=>function(){for(var t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,f(i))}),v(e,"replaceWith",e=>function(){for(var t=arguments.length,i=new Array(t),r=0;t>r;r++)i[r]=arguments[r];var s=f(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.ka=()=>{c.forEach(e=>e()),this.ka=void 0},this.Sa()}Sa(){var e=!1;return()=>{var t;e||(e=!0,this.ma--,0===this.ma&&(null==(t=this.ka)||t.call(this)))}}Ca(e,t){void 0===t&&(t=!0);var i=this.xa();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.ya.length&&(Jo.info("Processing "+this.ya.length+" events for site app with id "+e.id),this.ya.forEach(e=>this.Ca(()=>null==t.processEvent?void 0:t.processEvent(e))),t.processedBuffer=!0),Object.values(this.apps).every(e=>e.processedBuffer||e.errored)&&(null==(i=this._a)||i.call(this))},r=!1,s=s=>{t.errored=!s,t.loaded=!0,Jo.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&i()};try{var n=this.Ca(t=>e.init({posthog:this._instance,callback(e){t(),s(e)}}),!1).processEvent;n&&(t.processEvent=n),r=!0}catch(t){Jo.error(Yo+e.id,t),s(!1)}if(r&&t.loaded)try{i()}catch(i){Jo.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}Ta(){var e=this.siteAppLoaders||[];for(var t of e)this.apps[t.id]={id:t.id,loaded:!1,errored:!1,processedBuffer:!1};for(var i of e)this.setupSiteApp(i)}Ia(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),r=function(r){try{t.Ca(()=>null==r.processEvent?void 0:r.processEvent(i))}catch(t){Jo.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.Ta(),void this._instance.on("eventCaptured",e=>this.Ia(e))):void Jo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if(null==(i=this._a)||i.call(this),e.ok){var n=e.config;if(null!=(r=n.siteApps)&&r.length)if(this.isEnabled){var a=function(){var e,t=o.id,i=o.url;g["__$$ph_site_app_"+t]=s._instance,null==(e=g.__PosthogExtensions__)||null==e.loadSiteApp||e.loadSiteApp(s._instance,i,e=>{if(e)return Jo.error(Yo+t,e)})};for(var o of n.siteApps)a()}else Jo.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},El={tracingHeaders:class{constructor(e){this.Ma=void 0,this.Ea=void 0,this.Ra=void 0,this.Wo=()=>{var e,t,i=this.Pa();i?(Y(this.Ma)&&(this.Ma=null==(e=g.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),Y(this.Ea)&&(this.Ea=null==(t=g.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.Ko()},this._instance=e}initialize(){this.startIfEnabledOrStop()}er(e){var t,i;null!=(t=g.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=g.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return Ao.error("failed to load script",t);e()})}Oa(){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}Pa(){var e=this.Oa();return V(e)?(V(this.Ra)?this.Ra.splice(0,this.Ra.length,...e):this.Ra=[...e],e.length>0?this.Ra:void 0):(V(this.Ra)&&this.Ra.splice(0),this.Ra=e||void 0,this.Ra)}Ko(){var e,t;null==(e=this.Ma)||e.call(this),null==(t=this.Ea)||t.call(this),this.Ma=void 0,this.Ea=void 0}startIfEnabledOrStop(){this.Pa()?this.er(this.Wo):this.Ko()}}},Sl=y({surveys:class{get Te(){return this._instance.config}constructor(e){this.Fa=void 0,this._surveyManager=null,this.La=!1,this.$a=[],this.Aa=null,this.Na=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Te.disable_surveys){if(!e.ok)return so.warn("Remote config unavailable. Not loading surveys.");var t=e.config.surveys;if(ee(t))return so.warn("Flags not loaded yet. Not loading surveys.");var i=V(t);this.Fa=i?t.length>0:t,so.info("flags response received, isSurveysEnabled: "+this.Fa),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(no)||null!=r&&r.startsWith("inProgressSurvey_"))&&t.push(r)}
1t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this._surveyManager)if(this.La)so.info("Already initializing surveys, skipping...");else if(this.Te.disable_surveys)so.info(il);else if(this.Te.cookieless_mode&&this._instance.consent.isOptedOut())so.info("Not loading surveys in cookieless mode without consent.");else{var e=null==g?void 0:g.__PosthogExtensions__;if(e){if(!Y(this.Fa)||this.Te.advanced_enable_surveys){var t=this.Fa||this.Te.advanced_enable_surveys;this.La=!0;try{var i=e.generateSurveys;if(i)return void this.Da(i,t);var r=e.loadExternalDependency;if(!r)return void this.qa(br);r(this._instance,"surveys",i=>{i||!e.generateSurveys?this.qa("Could not load surveys script",i):this.Da(e.generateSurveys,t)})}catch(e){throw this.qa("Error initializing surveys",e),e}finally{this.La=!1}}}else so.error("PostHog Extensions not found.")}}Da(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new el(this._instance),so.info("Surveys loaded successfully"),this.ja({isLoaded:!0})}qa(e,t){so.error(e,t),this.ja({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.$a.push(e),this._surveyManager&&this.ja({isLoaded:!0}),()=>{this.$a=this.$a.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Te.disable_surveys)return so.info(il),e([]);var i,r=this._instance.get_property(Qi);if(r&&!t)return e(r,{isLoaded:!0}),void(this.Ha()&&this.getSurveys(()=>{},!0));"undefined"!=typeof Promise&&this.Aa?this.Aa.then(t=>e(t.surveys,t.context)):("undefined"!=typeof Promise&&(this.Aa=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Te.token),method:"GET",timestampMode:"query",timeout:this.Te.surveys_request_timeout_ms,callback:t=>{var r;this.Aa=null;var s=t.statusCode;if(200!==s||!t.json){var n="Surveys API could not be loaded, status: "+s;so.error(n),this.Na=Date.now();var a={isLoaded:!1,error:n};return e([],a),void(null==i||i({surveys:[],context:a}))}this.Na=null;var o,l=t.json.surveys||[],u=l.filter(e=>function(e){return!(!e.start_date||e.end_date)}(e)&&(ro(e)||function(e){var t;return!(null==(t=e.conditions)||null==(t=t.actions)||null==(t=t.values)||!t.length)}(e)));u.length>0&&(null==(o=this._surveyEventReceiver)||o.register(u)),null==(r=this._instance.persistence)||r.register({[Qi]:l,[er]:Date.now()});var h={isLoaded:!0};e(l,h),null==i||i({surveys:l,context:h})}}))}Ha(){return this.Ba()&&!this.Aa&&!this.Ua()}Ba(){var e=this._instance.get_property(er);return te(e)&&Date.now()-e>3e5}Ua(){return te(this.Na)&&3e5>Date.now()-this.Na}markSurveyAsSeen(e,t){var i,r={id:e,current_iteration:null!==(i=null==t?void 0:t.iteration)&&void 0!==i?i:null};ao(r);try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}ja(e){for(var t of this.$a)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){so.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!ee(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);so.warn("init was not called")}za(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}Va(e){if(ee(this._surveyManager))return{eligible:!1,reason:tl};var t="string"==typeof e?this.za(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}Wa(e){if(ee(this._surveyManager))return{eligible:!1,reason:tl};var t="string"==typeof e?this.za(e):e;return t?this._surveyManager.checkSurveyRenderability(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(ee(this._surveyManager))return so.warn("init was not called"),{visible:!1,disabledReason:tl};var t=this.Wa(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return ee(this._surveyManager)?(so.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:tl})):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.Wa(s);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var r;if(ee(this._surveyManager))so.warn("init was not called");else{var s="string"==typeof e?this.za(e):e;if(null!=s&&s.id)if(oo.includes(s.type)){var n=null==a?void 0:a.querySelector(t);if(n)return null!=(r=s.appearance)&&r.surveyPopupDelaySeconds?(so.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;so.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),so.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,n,i);so.warn("Survey element not found")}else so.warn("Surveys of type "+s.type+" cannot be rendered in the app");else so.warn("Survey not found")}}displaySurvey(e,t){var i;if(ee(this._surveyManager))so.warn("init was not called");else{var r=this.za(e);if(r){var s=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=y({},r,{appearance:y({},r.appearance,{surveyPopupDelaySeconds:0})}
vendor: 4,575 bytes, line 1
1)),t.displayType!==qn&&t.initialResponses&&so.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),!1===t.ignoreConditions){var n=this.Va(r);if(!n.eligible)return void so.warn("Survey is not eligible to be displayed: ",n.reason)}"inline"!==t.displayType?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else so.warn("Survey not found")}}cancelPendingSurvey(e){ee(this._surveyManager)?so.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||null==e.handlePageUnload||e.handlePageUnload()}}},ml),Pl={toolbar:class{constructor(e){this.instance=e}Za(e){g.ph_toolbar_state=e}Ga(){var e;return null!==(e=g.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),Hr(this.instance.config))return!1;if(!r||!a)return!1;e=null!=e?e:r.location,i=null!=i?i:r.history;try{if(!t){try{r.localStorage.setItem("test","test"),r.localStorage.removeItem("test")}catch(e){return!1}t=null==r?void 0:r.localStorage}var s,n=rl||hn(e.hash,"__posthog")||hn(e.hash,"state"),o=n?Lr(()=>JSON.parse(atob(decodeURIComponent(n))))||Lr(()=>JSON.parse(decodeURIComponent(n))):null;return o&&"ph_authorize"===o.action?((s=o).source="url",s&&Object.keys(s).length>0&&(o.desiredHash?e.hash=o.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((s=JSON.parse(t.getItem(sl)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token||(this.loadToolbar(s),0))}catch(e){return!1}}Qa(e){var t=g.ph_load_toolbar||g.ph_load_editor;!ee(t)&&W(t)?t(e,this.instance):nl.warn("No toolbar load function found")}loadToolbar(e){var t=!(null==a||!a.getElementById(us));if(!r||t)return!1;var i="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=y({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},i?{instrument:!1}:{});if(r.localStorage.setItem(sl,JSON.stringify(y({},s,{source:void 0}))),2===this.Ga())this.Qa(s);else if(0===this.Ga()){var n;this.Za(1),null==(n=g.__PosthogExtensions__)||null==n.loadExternalDependency||n.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return nl.error("[Toolbar] Failed to load",e),void this.Za(0);this.Za(2),this.Qa(s)}),zr(r,"turbolinks:load",()=>{this.Za(0),this.loadToolbar(s)})}return!0}Ja(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)}}},Tl=y({experiments:vl},ml),Fl={conversations:class{constructor(e){this.Ka=void 0,this._conversationsManager=null,this.Ya=!1,this.Xa=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations&&e.ok){var t=e.config.conversations;ee(t)||(re(t)?this.Ka=t:(this.Ka=t.enabled,this.Xa=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.Ka=void 0,this.Xa=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ya||this._instance.config.disable_conversations||Hr(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==g?void 0:g.__PosthogExtensions__;if(e&&!Y(this.Ka)&&this.Ka)if(this.Xa&&this.Xa.token){this.Ya=!0;try{var t=e.initConversations;if(t)return this.el(t),void(this.Ya=!1);var i=e.loadExternalDependency;if(!i)return void this.tl(br);i(this._instance,"conversations",t=>{t||!e.initConversations?this.tl("Could not load conversations script",t):this.el(e.initConversations),this.Ya=!1})}catch(e){this.tl("Error initializing conversations",e),this.Ya=!1}}else gl.error("Conversations enabled but missing token in remote config.")}}el(e){if(this.Xa)try{this._conversationsManager=e(this.Xa,this._instance),gl.info("Conversations loaded successfully")}catch(e){this.tl("Error completing conversations initialization",e)}else gl.error("Cannot complete initialization: remote config is null")}tl(e,t){gl.error(e,t),this._conversationsManager=null,this.Ya=!1}show(){this._conversationsManager?this._conversationsManager.show():gl.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.Ka&&!Q(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):(gl.warn(fl),null)})()}getMessages(e,t){var i=this;return m(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(gl.warn(fl),null)})()}markAsRead(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(gl.warn(fl),null)})()}getTickets(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(gl.warn(fl),null)})()}requestRestoreLink(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(gl.warn(fl),null)})()}restoreFromToken(e){var t=this;return m(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(gl.warn(fl),null)})()}restoreFromUrlToken(){var e=this;return m(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(gl.warn(fl),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}En(){var e;null==(e=this._conversationsManager)||e.setIdentity()}Rn(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},$l={logs:class{constructor(e){var t;this.rl=!1,this.il=!1,this.Ge=_i("[logs]"),this.Gr=[],this.nl=[],this.Hs=0,this.sl=()=>{var e,t;this.Hs=0,null==(e=this.ol)||e.onReconnect(),null==(t=this.al)||t.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.rl=!0),r&&zr(r,"online",this.sl)}ll(e,t,i,r){var s,n=function(e,t){var i,r,s,n,a,o,l,u=null!==(i=null==e?void 0:e.flushIntervalMs)&&void 0!==i?i:3e3,h=null!==(r=null==e?void 0:e.maxBufferSize)&&void 0!==r?r:100,c=null!=t&&t.consoleCapture?void 0:null!==(s=null==e?void 0:e.maxLogsPerInterval)&&void 0!==s?s:1e3,d=Y(c)?Math.max(h,2048):Math.max(h,c),p=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(n=null!==(a=null==p?void 0:p["service.name"])&&void 0!==a?a:null==e?void 0:e.serviceName)&&void 0!==n?n:null==t?void 0:t.serviceNameDefault,serviceVersion:null!==(o=null==p?void 0:p["service.version"])&&void 0!==o?o:null==e?void 0:e.serviceVersion,environment:null!==(l=null==p?void 0:p["deployment.environment"])&&void 0!==l?l:null==e?void 0:e.environment,resourceAttributes:p,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:u,maxBufferSize:h,maxQueueSize:d,maxBatchRecordsPerPost:100,rateCapWindowMs:u,maxLogsPerInterval:c,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0}}(null==(s=this._instance)||null==(s=s.config)?void 0:s.logs,i);return[new It(this.ul(e,t),n,this.Ge,()=>this.hl(),e=>e(),void 0,r),n]}dl(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.ol||this.cl!==t){var i;null==(i=this.ol)||i.reset(),this.cl=t;var r=this.ll(()=>this.Gr,e=>{this.Gr=e});this.ol=r[0],this.vl=r[1]}return this.ol}fl(){var e,t=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;if(!this.al||this.pl!==t){var i;null==(i=this.al)||i.reset(),this.pl=t;var r=this.ll(()=>this.nl,e=>{this.nl=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},_l);this.al=r[0],this.gl=r[1]}return this.al}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t;if(e.ok){var i=null==(t=e.config.logs)?void 0:t.captureConsoleLogs;!ee(i)&&i&&(this.rl=!0,this.loadIfEnabled())}}reset(){var e,t;this.Gr=[],null==(e=this.ol)||e.reset(),this.nl=[],null==(t=this.al)||t.reset(),this.Hs=0}captureLog(e){this.dl().captureLog(e)}le(e){this.fl().captureLog(e)}get logger(){return this.ml||(this.ml={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.ml}flushLogs(e){e?this.yl(e):(this.ol&&this.ol.flush().catch(e=>this.Ge.error("PostHog logs flush failed:",e)),this.al&&this.al.flush().catch(e=>this.Ge.error("PostHog logs flush failed:",e)))}loadIfEnabled(){if(this.rl&&!this.il){var e=null==g?void 0:g.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",t=>{var i;t||null==(i=e.logs)||!i.initializeLogs?this.Ge.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.il=!0)}):this.Ge.error(br)}else this.Ge.error("PostHog Extensions not found.")}}ul(e,t){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:t=>t===P.LogsQueue?e():void 0,setPersistedProperty(e,i){var r;e===P.LogsQueue&&t(null!==(r=i)&&void 0!==r?r:[])},Tt:e=>this.Tt(e),getLibraryId:()=>f.LIB_NAME,getLibraryVersion:()=>f.LIB_VERSION}}Tt(e){return new Promise(t=>{if(cn(this.Hs,3))t({kind:"fatal",error:new Error("logs endpoint is unreachable, dropping batch")});else{var i=!1,r=e=>{i||(i=!0,clearTimeout(s),t(e))},s=setTimeout(()=>r({kind:"retry-later",error:new Error("logs request timed out")}),9e4);this._instance._send_request({method:"POST",url:this.bl(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t=e.statusCode;if(this._l(t),t>=200&&300>t)r({kind:"ok"});else if(413===t)r({kind:"too-large"});else if(0!==t&&429!==t&&500>t)r({kind:"fatal",error:new Error("logs request failed with status "+t)});else{var i;r({kind:"retry-later",error:null!==(i=e.error)&&void 0!==i?i:new Error("logs request failed with status "+t)})}}})}})}_l(e){(0!==e||this._instance.__loaded)&&(this.Hs=dn(e,this.Hs,3,()=>this.Ge.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}yl(e){this.Gr.length>0&&this.wl(e,this.Gr,this.vl,f.LIB_NAME,e=>{this.Gr=e}),this.nl.length>0&&this.wl(e,this.nl,this.gl,_l,e=>{this.nl=e})}wl(e,t,i,r,s){if(0!==t.length){var n=t.map(e=>e.record);s([]);var a=$t(n,Ft(i,f.LIB_NAME,f.LIB_VERSION),r,f.LIB_VERSION);this._instance._send_request({method:"POST",url:this.bl(),data:a,compression:"best-available",batchKey:"logs",transport:e})}}bl(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}hl(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var i=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0),r=i.windowId,s=i.sessionStartTimestamp,n=i.lastActivityTimestamp;t.sessionId=i.sessionId,t.windowId=r,ee(s)||(t.sessionStartTimestamp=s),ee(n)||(t.lastActivityTimestamp=n)}if(null!=g&&null!=(e=g.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?bt(g.location.href):g.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(t.activeFeatureFlags=a)}return t}}},Il={metrics:class{constructor(e){this.Ge=_i("[metrics]"),this._instance=e}initialize(){}dl(){var e,t,i=null==(e=this._instance)||null==(e=e.config)?void 0:e.metrics;return this.ol&&this.cl===i||(null==(t=this.ol)||t.reset(),this.cl=i,this.ol=new Ot(this.ul(),function(e){var t,i,r,s,n,a=null==e?void 0:e.resourceAttributes;return{serviceName:null!==(t=null==a?void 0:a["service.name"])&&void 0!==t?t:null==e?void 0:e.serviceName,serviceVersion:null!==(i=null==a?void 0:a["service.version"])&&void 0!==i?i:null==e?void 0:e.serviceVersion,environment:null!==(r=null==a?void 0:a["deployment.environment"])&&void 0!==r?r:null==e?void 0:e.environment,resourceAttributes:a,beforeSend:null==e?void 0:e.beforeSend,flushIntervalMs:null!==(s=null==e?void 0:e.flushIntervalMs)&&void 0!==s?s:1e4,maxSeriesPerFlush:null!==(n=null==e?void 0:e.maxSeriesPerFlush)&&void 0!==n?n:1e3}}(i),this.Ge)),this.ol}count(e,t,i){void 0===t&&(t=1),this.dl().count(e,t,i)}
1gauge(e,t,i){this.dl().gauge(e,t,i)}histogram(e,t,i){this.dl().histogram(e,t,i)}flush(e){if(!this.ol)return Promise.resolve();if(e){var t=this.ol.drainWindow();return t&&this.Bt(t,e),Promise.resolve()}return this.ol.flush().catch(e=>this.Ge.error("PostHog metrics flush failed:",e))}reset(){var e;null==(e=this.ol)||e.reset()}ul(){var e=this._instance,t=this;return{get isDisabled(){return!1},get optedOut(){return!e.is_capturing()},Bt:e=>t.Bt(e),getLibraryId:()=>f.LIB_NAME,getLibraryVersion:()=>f.LIB_VERSION}}Bt(e,t){return new Promise(i=>{var r=!1,s=e=>{r||(r=!0,clearTimeout(n),i(e))},n=setTimeout(()=>s({kind:"retry-later",error:new Error("metrics request timed out")}),9e4);this._instance._send_request(y({method:"POST",url:this.xl(),data:e,compression:"best-available",batchKey:"metrics"},t&&{transport:t},{fireCallbackOnDrop:!0,callback(e){var t=e.statusCode;if(t>=200&&300>t)s({kind:"ok"});else if(413===t)s({kind:"too-large"});else if(0!==t&&429!==t&&500>t)s({kind:"fatal",error:new Error("metrics request failed with status "+t)});else{var i;s({kind:"retry-later",error:null!==(i=e.error)&&void 0!==i?i:new Error("metrics request failed with status "+t)})}}}))})}xl(){return this._instance.requestRouter.endpointFor("api","/i/v1/metrics")+"?token="+encodeURIComponent(this._instance.config.token)}}},Ml=y({},ml,yl,bl,wl,xl,kl,Sl,El,Pl,Tl,Fl,$l,Il);To.__defaultExtensionClasses=y({},Ml);var Rl=function(){f.SDK_DIST_CHANNEL="npm";var e=po[wo]=new To;return function(){function e(){e.done||(e.done=!0,xo=!1,Cr(po,function(e){e._dom_loaded()}))}null!=a&&a.addEventListener?"complete"===a.readyState?e():zr(a,"DOMContentLoaded",e,{capture:!1}):r&&fi.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),e}()}}]);

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.