PageSourceSearch

https://cdn.crowdparty.app/118.f03a8ea13b30348cbec3.esm.js

js crowdparty.app collected 2026-10-04 12:37:15 UTC 198,282 bytes, 1 lines download raw bytes

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

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.