PageSourceSearch

https://www.woodshopnews.com/_next/static/chunks/67a3bf3c.4f10c9dd58927933.js

js woodshopnews.com collected 2026-09-24 21:39:31 UTC 230,814 bytes, 2 lines download raw bytes

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

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.