1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{7238:function(e,t,i){"use strict";var r,s;e.exports=(null==(r=i.g.process)?void 0:r.env)&&"object"==typeof(null==(s=i.g.process)?void 0:s.env)?i.g.process:i(6242)},1045:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return i(7757)}])},436:function(e,t,i){"use strict";i.d(t,{Hh:function(){return a},Ik:function(){return h},Mj:function(){return r},QS:function(){return s},lV:function(){return d},nw:function(){return c},sk:function(){return o}});let r=[{code:"ab",label:"Abkhaz",available:!0},{code:"ace",label:"Acehnese",available:!0},{code:"ach",label:"Acholi",available:!0},{code:"aa",label:"Afar",available:!0},{code:"af",label:"Afrikaans",available:!0},{code:"ak",label:"Akan (Twi)",available:!0},{code:"sq",label:"Albanian",available:!0},{code:"alz",label:"Alur",available:!0},{code:"am",label:"Amharic",available:!0},{code:"ar",label:"Arabic",available:!0},{code:"hy",label:"Armenian",available:!0},{code:"as",label:"Assamese",available:!0},{code:"av",label:"Avar",available:!0},{code:"awa",label:"Awadhi",available:!0},{code:"ay",label:"Aymara",available:!0},{code:"az",label:"Azerbaijani",available:!0},{code:"ban",label:"Balinese",available:!0},{code:"bal",label:"Baluchi",available:!0},{code:"bm",label:"Bambara",available:!0},{code:"bci",label:"Baoul\xe9",available:!0},{code:"ba",label:"Bashkir",available:!0},{code:"eu",label:"Basque",available:!0},{code:"btx",label:"Batak Karo",available:!0},{code:"bts",label:"Batak Simalungun",available:!0},{code:"bbc",label:"Batak Toba",available:!0},{code:"be",label:"Belarusian",available:!0},{code:"bem",label:"Bemba",available:!0},{code:"bn",label:"Bengali",available:!0},{code:"bew",label:"Betawi",available:!0},{code:"bho",label:"Bhojpuri",available:!0},{code:"bik",label:"Bikol",available:!0},{code:"bs",label:"Bosnian",available:!0},{code:"br",label:"Breton",available:!0},{code:"bg",label:"Bulgarian",available:!0},{code:"bua",label:"Buryat",available:!0},{code:"yue",label:"Cantonese",available:!0},{code:"ca",label:"Catalan",available:!0},{code:"ceb",label:"Cebuano",available:!0},{code:"ch",label:"Chamorro",available:!0},{code:"ce",label:"Chechen",available:!0},{code:"ny",label:"Chichewa (Nyanja)",available:!0},{code:"zh-CN",label:"Chinese (Simplified)",available:!0},{code:"zh-TW",label:"Chinese (Traditional)",available:!0},{code:"chk",label:"Chuukese",available:!0},{code:"cv",label:"Chuvash",available:!0},{code:"co",label:"Corsican",available:!0},{code:"crh",label:"Crimean Tatar",available:!0},{code:"crh-Latn",label:"Crimean Tatar (Latin)",available:!0},{code:"hr",label:"Croatian",available:!0},{code:"cs",label:"Czech",available:!0},{code:"da",label:"Danish",available:!0},{code:"fa-AF",label:"Dari",available:!0},{code:"din",label:"Dinka",available:!0},{code:"dv",label:"Divehi",available:!0},{code:"doi",label:"Dogri",available:!0},{code:"dov",label:"Dombe",available:!0},{code:"nl",label:"Dutch",available:!0},{code:"dyu",label:"Dyula",available:!0},{code:"dz",label:"Dzongkha",available:!0},{code:"en",label:"English",available:!0},{code:"eo",label:"Esperanto",available:!0},{code:"et",label:"Estonian",available:!0},{code:"ee",label:"Ewe",available:!0},{code:"fo",label:"Faroese",available:!0},{code:"fj",label:"Fijian",available:!0},{code:"tl",label:"Filipino (Tagalog)",available:!0},{code:"fi",label:"Finnish",available:!0},{code:"fon",label:"Fon",available:!0},{code:"fr",label:"French",available:!0},{code:"fr-FR",label:"French (France)",available:!0},{code:"fr-CA",label:"French (Canadian)",available:!0},{code:"fy",label:"Frisian",available:!0},{code:"fur",label:"Friulian",available:!0},{code:"ff",label:"Fulfulde",available:!0},{code:"gaa",label:"Ga",available:!0},{code:"gl",label:"Galician",available:!0},{code:"lg",label:"Ganda (Luganda)",available:!0},{code:"ka",label:"Georgian",available:!0},{code:"de",label:"German",available:!0},{code:"el",label:"Greek",available:!0},{code:"gn",label:"Guarani",available:!0},{code:"gu",label:"Gujarati",available:!0},{code:"ht",label:"Haitian Creole",available:!0},{code:"cnh",label:"Hakha Chin",available:!0},{code:"ha",label:"Hausa",available:!0},{code:"haw",label:"Hawaiian",available:!0},{code:"iw",label:"Hebrew",available:!0},{code:"hil",label:"Hiligaynon",available:!0},{code:"hi",label:"Hindi",available:!0},{code:"hmn",label:"Hmong",available:!0},{code:"hu",label:"Hungarian",available:!0},{code:"hrx",label:"Hunsrik",available:!0},{code:"iba",label:"Iban",available:!0},{code:"is",label:"Icelandic",available:!0},{code:"ig",label:"Igbo",available:!0},{code:"ilo",label:"Iloko",available:!0},{code:"id",label:"Indonesian",available:!0},{code:"iu-Latn",label:"Inuktut (Latin)",available:!0},{code:"iu",label:"Inuktut (Syllabics)",available:!0},{code:"ga",label:"Irish",available:!0},{code:"it",label:"Italian",available:!0},{code:"jam",label:"Jamaican Patois",available:!0},{code:"ja",label:"Japanese",available:!0},{code:"jw",label:"Javanese",available:!0},{code:"kac",label:"Jingpo",available:!0},{code:"kl",label:"Kalaallisut",available:!0},{code:"kn",label:"Kannada",available:!0},{code:"kr",label:"Kanuri",available:!0},{code:"pam",label:"Kapampangan",available:!0},{code:"kk",label:"Kazakh",available:!0},{code:"kha",label:"Khasi",available:!0},{code:"km",label:"Khmer",available:!0},{code:"cgg",label:"Kiga",available:!0},{code:"kg",label:"Kikongo",available:!0},{code:"rw",label:"Kinyarwanda",available:!0},{code:"ktu",label:"Kituba",available:!0},{code:"trp",label:"Kokborok",available:!0},{code:"kv",label:"Komi",available:!0},{code:"gom",label:"Konkani",available:!0},{code:"ko",label:"Korean",available:!0},{code:"kri",label:"Krio",available:!0},{code:"ku",label:"Kurdish (Kurmanji)",available:!0},{code:"ckb",label:"Kurdish (Sorani)",available:!0},{code:"ky",label:"Kyrgyz",available:!0},{code:"lo",label:"Lao",available:!0},{code:"ltg",label:"Latgalian",available:!0},{code:"la",label:"Latin",available:!0},{code:"lv",label:"Latvian",available:!0},{code:"lij",label:"Ligurian",available:!0},{code:"li",label:"Limburgan",available:!0},{code:"ln",label:"Lingala",available:!0},{code:"lt",label:"Lithuanian",available:!0},{code:"lmo",label:"Lombard",available:!0},{code:"luo",label:"Luo",available:!0},{code:"lb",label:"Luxembourgish",available:!0},{code:"mk",label:"Macedonian",available:!0},{code:"mad",label:"Madurese",available:!0},{code:"mai",label:"Maithili",available:!0},{code:"mak",label:"Makassar",available:!0},{code:"mg",label:"Malagasy",available:!0},{code:"ms",label:"Malay",available:!0},{code:"ms-Arab",label:"Malay (Jawi)",available:!0},{code:"ml",label:"Malayalam",available:!0},{code:"mt",label:"Maltese",available:!0},{code:"mam",label:"Mam",available:!0},{code:"gv",label:"Manx",available:!0},{code:"mi",label:"Maori",available:!0},{code:"mr",label:"Marathi",available:!0},{code:"mh",label:"Marshallese",available:!0},{code:"mwr",label:"Marwadi",available:!0},{code:"mfe",label:"Mauritian Creole",available:!0},{code:"chm",label:"Meadow Mari",available:!0},{code:"mni-Mtei",label:"Meiteilon (Manipuri)",available:!0},{code:"min",label:"Minang",available:!0},{code:"lus",label:"Mizo",available:!0},{code:"mn",label:"Mongolian",available:!0},{code:"my",label:"Myanmar (Burmese)",available:!0},{code:"nhe",label:"Nahuatl (Eastern Huasteca)",available:!0},{code:"ndc-ZW",label:"Ndau",available:!0},{code:"nr",label:"Ndebele (South)",available:!0},{code:"new",label:"Nepalbhasa (Newari)",available:!0},{code:"ne",label:"Nepali",available:!0},{code:"bm-Nkoo",label:"NKo",available:!0},{code:"nso",label:"Northern Sotho (Sepedi)",available:!0},{code:"no",label:"Norwegian",available:!0},{code:"nus",label:"Nuer",available:!0},{code:"oc",label:"Occitan",available:!0},{code:"or",label:"Odia (Oriya)",available:!0},{code:"om",label:"Oromo",available:!0},{code:"os",label:"Ossetian",available:!0},{code:"pag",label:"Pangasinan",available:!0},{code:"pap",label:"Papiamento",available:!0},{code:"ps",label:"Pashto",available:!0},{code:"fa",label:"Persian",available:!0},{code:"pl",label:"Polish",available:!0},{code:"pt",label:"Portuguese",available:!0},{code:"pt-PT",label:"Portuguese (Portugal)",available:!0},{code:"pt-BR",label:"Portuguese (Brazil)",available:!0},{code:"pa",label:"Punjabi",available:!0}
1,{code:"pa-Arab",label:"Punjabi (Shahmukhi)",available:!0},{code:"qu",label:"Quechua",available:!0},{code:"kek",label:"Qʼeqchiʼ",available:!0},{code:"rom",label:"Romani",available:!0},{code:"ro",label:"Romanian",available:!0},{code:"rn",label:"Rundi",available:!0},{code:"ru",label:"Russian",available:!0},{code:"se",label:"Sami (North)",available:!0},{code:"sm",label:"Samoan",available:!0},{code:"sg",label:"Sango",available:!0},{code:"sa",label:"Sanskrit",available:!0},{code:"sat-Latn",label:"Santali (Latin)",available:!0},{code:"sat",label:"Santali (Ol Chiki)",available:!0},{code:"gd",label:"Scots Gaelic",available:!0},{code:"sr",label:"Serbian",available:!0},{code:"st",label:"Sesotho",available:!0},{code:"crs",label:"Seychellois Creole",available:!0},{code:"shn",label:"Shan",available:!0},{code:"sn",label:"Shona",available:!0},{code:"scn",label:"Sicilian",available:!0},{code:"szl",label:"Silesian",available:!0},{code:"sd",label:"Sindhi",available:!0},{code:"si",label:"Sinhala (Sinhalese)",available:!0},{code:"sk",label:"Slovak",available:!0},{code:"sl",label:"Slovenian",available:!0},{code:"so",label:"Somali",available:!0},{code:"es",label:"Spanish",available:!0},{code:"su",label:"Sundanese",available:!0},{code:"sus",label:"Susu",available:!0},{code:"sw",label:"Swahili",available:!0},{code:"ss",label:"Swati",available:!0},{code:"sv",label:"Swedish",available:!0},{code:"ty",label:"Tahitian",available:!0},{code:"tg",label:"Tajik",available:!0},{code:"ber-Latn",label:"Tamazight",available:!0},{code:"ber",label:"Tamazight (Tifinagh)",available:!0},{code:"ta",label:"Tamil",available:!0},{code:"tt",label:"Tatar",available:!0},{code:"te",label:"Telugu",available:!0},{code:"tet",label:"Tetum",available:!0},{code:"th",label:"Thai",available:!0},{code:"bo",label:"Tibetan",available:!0},{code:"ti",label:"Tigrinya",available:!0},{code:"tiv",label:"Tiv",available:!0},{code:"tpi",label:"Tok Pisin",available:!0},{code:"to",label:"Tongan",available:!0},{code:"lua",label:"Tshiluba",available:!0},{code:"ts",label:"Tsonga",available:!0},{code:"tn",label:"Tswana",available:!0},{code:"tcy",label:"Tulu",available:!0},{code:"tum",label:"Tumbuka",available:!0},{code:"tr",label:"Turkish",available:!0},{code:"tk",label:"Turkmen",available:!0},{code:"tyv",label:"Tuvan",available:!0},{code:"udm",label:"Udmurt",available:!0},{code:"uk",label:"Ukrainian",available:!0},{code:"ur",label:"Urdu",available:!0},{code:"ug",label:"Uyghur",available:!0},{code:"uz",label:"Uzbek",available:!0},{code:"ve",label:"Venda",available:!0},{code:"vec",label:"Venetian",available:!0},{code:"vi",label:"Vietnamese",available:!0},{code:"war",label:"Waray",available:!0},{code:"cy",label:"Welsh",available:!0},{code:"wo",label:"Wolof",available:!0},{code:"xh",label:"Xhosa",available:!0},{code:"sah",label:"Yakut",available:!0},{code:"yi",label:"Yiddish",available:!0},{code:"yo",label:"Yoruba",available:!0},{code:"yua",label:"Yucatec Maya",available:!0},{code:"zap",label:"Zapotec",available:!0},{code:"zu",label:"Zulu",available:!0}],s=249,n=new Set(["ar","zh-cn","zh-tw","cs","da","nl","eo","fi","fr","fr-fr","fr-ca","de","el","ht","haw","he","hi","hu","id","ga","it","ja","ko","la","no","pl","pt","pt-br","ro","ru","gd","es","sw","sv","tr","uk","vi","cy","yi","zu"]),a=e=>n.has(c(e)),o="/images/logos/logo-32.png",l={he:"iw"},u=e=>{var t;let i=e.toLowerCase();return null!==(t=l[i])&&void 0!==t?t:i},c=e=>{let t=e.toLowerCase();return"iw"===t?"he":t},h=e=>r.find(t=>t.code.toLowerCase()===u(e)),d=e=>"learn-".concat(e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""))},7757:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return y}});var r=i(2676),s=i(2268),n=i.n(s),a=i(5271),o=i(9422),l=i.n(o),u=i(2354),c=i(7238),h=()=>{window.va||(window.va=function(...e){(window.vaq=window.vaq||[]).push(e)})};function d(){return"undefined"!=typeof window}function p(){return"production"}function v(){return"development"===((d()?window.vam:p())||"production")}function g(e){return(0,a.useEffect)(()=>{var t;e.beforeSend&&(null==(t=window.va)||t.call(window,"beforeSend",e.beforeSend))},[e.beforeSend]),(0,a.useEffect)(()=>{!function(e={debug:!0}){var t;if(!d())return;(function(e="auto"){if("auto"===e){window.vam=p();return}window.vam=e})(e.mode),h(),e.beforeSend&&(null==(t=window.va)||t.call(window,"beforeSend",e.beforeSend));let i=e.scriptSrc?e.scriptSrc:v()?"https://va.vercel-scripts.com/v1/script.debug.js":e.basePath?`${e.basePath}
1/insights/script.js`:"/_vercel/insights/script.js";if(document.head.querySelector(`script[src*="${i}"]`))return;let r=document.createElement("script");r.src=i,r.defer=!0,r.dataset.sdkn="@vercel/analytics"+(e.framework?`/${e.framework}`:""),r.dataset.sdkv="1.5.0",e.disableAutoTrack&&(r.dataset.disableAutoTrack="1"),e.endpoint?r.dataset.endpoint=e.endpoint:e.basePath&&(r.dataset.endpoint=`${e.basePath}/insights`),e.dsn&&(r.dataset.dsn=e.dsn),r.onerror=()=>{let e=v()?"Please check if any ad blockers are enabled and try again.":"Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.";console.log(`[Vercel Web Analytics] Failed to load script from ${i}. ${e}`)},v()&&!1===e.debug&&(r.dataset.debug="false"),document.head.appendChild(r)}({framework:e.framework||"react",basePath:e.basePath??function(){if(void 0!==c&&void 0!==c.env)return c.env.REACT_APP_VERCEL_OBSERVABILITY_BASEPATH}(),...void 0!==e.route&&{disableAutoTrack:!0},...e})},[]),(0,a.useEffect)(()=>{e.route&&e.path&&function({route:e,path:t}){var i;null==(i=window.va)||i.call(window,"pageview",{route:e,path:t})}({route:e.route,path:e.path})},[e.route,e.path]),null}var _=i(9264);i(1229),i(5176);var f=i(436);_.ZP.__loaded||_.ZP.init("phc_QXrvno4gyzOZReMNnokjMDVJNWUy6I15TxNv08wNV5O",{api_host:"https://eu.i.posthog.com",persistence:"memory",respect_dnt:!0,capture_pageview:!1});let m=()=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("link",{rel:"icon",href:"/favicon.ico?v=2"}),(0,r.jsx)("link",{rel:"apple-touch-icon",sizes:"180x180",href:"/images/logos/logo-256.png?v=2"}),(0,r.jsx)("link",{rel:"icon",type:"image/x-icon",sizes:"32x32",href:"/images/favicons/logo-32.ico?v=2"}),(0,r.jsx)("link",{rel:"icon",type:"image/x-icon",sizes:"48x48",href:"/images/favicons/logo-48.ico?v=2"}),(0,r.jsx)("link",{rel:"icon",type:"image/x-icon",sizes:"64x64",href:"/images/favicons/logo-64.ico?v=2"}),(0,r.jsx)("link",{rel:"icon",type:"image/x-icon",sizes:"128x128",href:"/images/favicons/logo-128.ico?v=2"}),(0,r.jsx)("link",{rel:"icon",type:"image/x-icon",sizes:"256x256",href:"/images/favicons/logo-256.ico?v=2"})]}),b=e=>{let{title:t,description:i,locale:s,currentUrl:n,ogType:a,ogImage:o}=e;return(0,r.jsxs)(l(),{children:[(0,r.jsx)("meta",{charSet:"utf-8"},"charset"),(0,r.jsx)("meta",{name:"viewport",content:"width=device-width, initial-scale=1"},"viewport"),(0,r.jsx)("link",{rel:"preconnect",href:"https://www.youtube.com"}),(0,r.jsx)("link",{rel:"preconnect",href:"https://fonts.googleapis.com"}),(0,r.jsx)("link",{rel:"preconnect",href:"https://fonts.gstatic.com",crossOrigin:"anonymous"}),(0,r.jsx)(m,{}),(0,r.jsx)("title",{children:t},"title"),(0,r.jsx)("meta",{name:"description",content:i},"description"),(0,r.jsx)("meta",{httpEquiv:"Content-Language",content:s},"content-language"),(0,r.jsx)("meta",{name:"language",content:s},"language"),(0,r.jsx)("link",{rel:"canonical",href:n.startsWith("https://www.")?n:n.replace("https://","https://www.")},"canonical"),(0,r.jsx)("meta",{property:"og:type",content:a},"og:type"),(0,r.jsx)("meta",{property:"og:site_name",content:"Vocabo"},"og:site_name"),(0,r.jsx)("meta",{property:"og:url",content:n},"og:url"),(0,r.jsx)("meta",{property:"og:title",content:t},"og:title"),(0,r.jsx)("meta",{property:"og:description",content:i},"og:description"),(0,r.jsx)("meta",{property:"og:image",content:o},"og:image"),(0,r.jsx)("meta",{property:"og:image:width",content:"1400"},"og:image:width"),(0,r.jsx)("meta",{property:"og:image:height",content:"560"},"og:image:height"),(0,r.jsx)("meta",{property:"og:image:alt",content:"Vocabo Logo"},"og:image:alt"),(0,r.jsx)("meta",{property:"og:locale",content:s},"og:locale"),(0,r.jsx)("meta",{name:"twitter:card",content:"summary_large_image"},"twitter:card"),(0,r.jsx)("meta",{name:"twitter:site",content:"@vocabo"},"twitter:site"),(0,r.jsx)("meta",{name:"twitter:title",content:t},"twitter:title"),(0,r.jsx)("meta",{name:"twitter:description",content:i},"twitter:description"),(0,r.jsx)("meta",{name:"twitter:image",content:o},"twitter:image"),(0,r.jsx)("meta",{name:"twitter:image:alt",content:"Vocabo Logo"},"twitter:image:alt")]})};function y(e){var t;let{Component:i,pageProps:s}=e,o=(0,u.useRouter)(),{locale:l="en"}=o;(0,a.useEffect)(()=>{_.ZP.capture("$pageview");let e=()=>_.ZP.capture("$pageview");return o.events.on("routeChangeComplete",e),()=>o.events.off("routeChangeComplete",e)},[o.events]);let{title:c="Vocabo â learn any language free while you browse the web",description:h="Vocabo is a free Chrome extension that helps you learn vocabulary in ".concat(f.QS,"+ languages while you browse. No sign-up needed â just install and start learning."),ogType:d="website",ogImage:p="/images/og-image.png"}=(null===(t=i.getLayoutProps)||void 0===t?void 0:t.call(i,s))||{},v="https://www.vocabo.io".concat(o.asPath),m=p.startsWith("http")?p:"https://www.vocabo.io".concat(p);return(0,r.jsxs)("div",{className:n().className,children:[(0,r.jsx)(b,{title:c,description:h,locale:l,currentUrl:v,ogType:d,ogImage:m}),(0,r.jsxs)("main",{children:[(0,r.jsx)(i,{...s}),(0,r.jsx)(g,{})]})]})}},5176:function(){},1229:function(){},2268:function(e){e.exports={style:{fontFamily:"'__Inter_f367f3', '__Inter_Fallback_f367f3'",fontStyle:"normal"},className:"__className_f367f3"}},6242:function(e){!function(){var t={229:function(e){var t,i,r,s=e.exports={};function n(){throw Error("setTimeout has not been defined")}function a(){throw Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===n||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(i){try{return t.call(null,e,0)}catch(i){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:n}catch(e){t=n}try{i="function"==typeof clearTimeout?clearTimeout:a}catch(e){i=a}}();var l=[],u=!1,c=-1;function h(){u&&r&&(u=!1,r.length?l=r.concat(l):c=-1,l.length&&d())}function d(){if(!u){var e=o(h);u=!0;for(var t=l.length;t;){for(r=l,l=[];++c<t;)r&&r[c].run();c=-1,t=l.length}r=null,u=!1,function(e){if(i===clearTimeout)return clearTimeout(e);if((i===a||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{i(e)}catch(t){try{return i.call(null,e)}catch(t){return i.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function v(){}s.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];l.push(new p(e,t)),1!==l.length||u||o(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={},s.on=v,s.addListener=v,s.once=v,s.off=v,s.removeListener=v,s.removeAllListeners=v,s.emit=v,s.prependListener=v,s.prependOnceListener=v,s.listeners=function(e){return[]},s.binding=function(e){throw Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(e){throw Error("process.chdir is not supported")},s.umask=function(){return 0}}},i={};function r(e){var s=i[e];if(void 0!==s)return s.exports;var n=i[e]={exports:{}},a=!0;try{t[e](n,n.exports,r),a=!1}finally{a&&delete i[e]}return n.exports}r.ab="//";var s=r(229);e.exports=s}()},9422:function(e,t,i){e.exports=i(5444)},2354:function(e,t,i){e.exports=i(7856)},9264:function(e,t,i){"use strict";i.d(t,{ZP:function(){return aK}});var r,s="undefined"!=typeof window?window:void 0,n="undefined"!=typeof globalThis?globalThis:s;"undefined"==typeof self&&(n.self=n),"undefined"==typeof File&&(n.File=function(){});var a=null==n?void 0:n.navigator,o=null==n?void 0:n.document,l=null==n?void 0:n.location,u=null==n?void 0:n.fetch,c=null!=n&&n.XMLHttpRequest&&"withCredentials"in new n.XMLHttpRequest?n.XMLHttpRequest:void 0,h=null==n?void 0:n.AbortController,d=null==n?void 0:n.CompressionStream,p=null==a?void 0:a.userAgent,v=null!=s?s:{};function g(){return!(!s||!1===s.navigator.onLine)}var _="1.398.0",f={DEBUG:!1,LIB_VERSION:_,LIB_NAME:"web",JS_SDK_VERSION:_};function m(e,t,i,r,s,n,a){try{var o=e[n](a),l=o.value}catch(e){return void i(e)}o.done?t(l):Promise.resolve(l).then(r,s)}function b(e){return function(){var t=this,i=arguments;return new Promise(function(r,s){var n=e.apply(t,i);function a(e){m(n,r,s,a,o,"next",e)}function o(e){m(n,r,s,a,o,"throw",e)}a(void 0)})}}function y(){return(y=Object.assign?Object.assign.bind():function(e){for(var t=1;arguments.length>t;t++){var i=arguments[t];for(var r in i)({}).hasOwnProperty.call(i,r)&&(e[r]=i[r])}return e}).apply(null,arguments)}function w(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 x=e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}};function S(e){return"string"==typeof e||e}function k(e){return"string"==typeof e?e:void 0}var E,P,F,T,C=((E={}).AnonymousId="anonymous_id",E.DistinctId="distinct_id",E.Props="props",E.EnablePersonProcessing="enable_person_processing",E.PersonMode="person_mode",E.FeatureFlagDetails="feature_flag_details",E.FeatureFlags="feature_flags",E.FeatureFlagPayloads="feature_flag_payloads",E.BootstrapFeatureFlagDetails="bootstrap_feature_flag_details",E.BootstrapFeatureFlags="bootstrap_feature_flags",E.BootstrapFeatureFlagPayloads="bootstrap_feature_flag_payloads",E.OverrideFeatureFlags="override_feature_flags",E.Queue="queue",E.LogsQueue="logs_queue",E.OptedOut="opted_out",E.SessionId="session_id",E.SessionStartTimestamp="session_start_timestamp",E.SessionLastTimestamp="session_timestamp",E.PersonProperties="person_properties",E.GroupProperties="group_properties",E.InstalledAppBuild="installed_app_build",E.InstalledAppVersion="installed_app_version",E.SessionReplay="session_replay",E.SessionReplayEventTriggerActivatedSession="session_replay_event_trigger_activated_session",E.SurveyLastSeenDate="survey_last_seen_date",E.SurveysSeen="surveys_seen",E.Surveys="surveys",E.RemoteConfig="remote_config",E.FlagsEndpointWasHit="flags_endpoint_was_hit",E.DeviceId="device_id",E),I=((P={}).GZipJS="gzip-js",P.Base64="base64",P),$=["$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"],A=["token"],R="NativeGzipValidationError",M=e=>e.length>=2&&31===e[0]&&139===e[1],O=(e,t)=>e===I.GZipJS||t===I.GZipJS||"gzip"===t,L=e=>!(!e||"object"!=typeof e)&&"NotReadableError"===("name"in e?String(e.name):""),D=e=>
1{var t=Error("Native gzip produced invalid output: "+e);throw t.name=R,t},N=(F=b(function*(e,t){18>e.size&&D("too-short");var i=new Uint8Array((yield e.slice(0,10).arrayBuffer()));M(i)&&8===i[2]||D("invalid-header");var r=new DataView((yield e.slice(e.size-8).arrayBuffer()));r.getUint32(0,!0)!==(e=>{for(var t=(()=>{if(T)return T;T=[];for(var e=0;256>e;e++){for(var t=e,i=0;8>i;i++)t=1&t?3988292384^t>>>1:t>>>1;T[e]=t>>>0}return T})(),i=4294967295,r=0;e.length>r;r++)i=t[255&(i^e[r])]^i>>>8;return(4294967295^i)>>>0})(t)&&D("invalid-crc");var s=t.length>>>0;r.getUint32(4,!0)!==s&&D("invalid-size")}),function(e,t){return F.apply(this,arguments)});function j(){return(j=b(function*(e,t,i){void 0===t&&(t=!0);try{var r,s=(new TextEncoder).encode(e),n=new CompressionStream("gzip"),a=n.writable.getWriter(),o=a.write(s).then(()=>a.close()).catch((r=b(function*(e){try{yield a.abort(e)}catch(e){}throw e}),function(e){return r.apply(this,arguments)})),l=new Response(n.readable).blob(),[u]=yield Promise.all([l,o]);return yield N(u,s),u}catch(e){if(null!=i&&i.rethrow)throw e;return t&&console.error("Failed to gzip compress data",e),null}})).apply(this,arguments)}var z=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],q=function(e,t){if(void 0===t&&(t=[]),!e)return!1;var i=e.toLowerCase();return z.concat(t).some(e=>{var t=e.toLowerCase();return -1!==i.indexOf(t)})};function B(e,t){return -1!==e.indexOf(t)}var H=function(e){return e.trim()},U=function(e){return e.replace(/^\$/,"")},V=Object.prototype,W=V.hasOwnProperty,G=V.toString,K=Array.isArray||function(e){return"[object Array]"===G.call(e)},J=e=>"function"==typeof e,Y=e=>e===Object(e)&&!K(e),X=e=>{if(Y(e)){for(var t in e)if(W.call(e,t))return!1;return!0}return!1},Q=e=>void 0===e,Z=e=>"[object String]"==G.call(e),ee=e=>Z(e)&&0===e.trim().length,et=e=>null===e,ei=e=>Q(e)||et(e),er=e=>"[object Number]"==G.call(e)&&e==e,es=e=>er(e)&&e>0,en=e=>"[object Boolean]"===G.call(e),ea=e=>e instanceof FormData,eo=e=>B($,e),el=e=>B(A,e);function eu(e){return null===e||"object"!=typeof e}function ec(e,t){return({}).toString.call(e)==="[object "+t+"]"}function eh(e){return"undefined"!=typeof Event&&function(e,t){try{return e instanceof t}catch(e){return!1}}(e,Event)}var ed=[!0,"true",1,"1","yes"],ep=e=>B(ed,e),ev=[!1,"false",0,"0","no"];function eg(e,t,i,r,s){return t>i&&(r.warn("min cannot be greater than max."),t=i),er(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),eg(s||i,t,i,r))}class e_{constructor(e){this.Ee={},this.Pe=e.Pe,this.Fe=eg(e.bucketSize,0,100,e.Ae),this.$e=eg(e.refillRate,0,this.Fe,e.Ae),this.De=eg(e.refillInterval,0,864e5,e.Ae)}Ne(e,t){var i=Math.floor((t-e.lastAccess)/this.De);i>0&&(e.tokens=Math.min(e.tokens+i*this.$e,this.Fe),e.lastAccess=e.lastAccess+i*this.De)}consumeRateLimit(e){var t,i=Date.now(),r=String(e),s=this.Ee[r];return s?this.Ne(s,i):this.Ee[r]=s={tokens:this.Fe,lastAccess:i},0===s.tokens||(s.tokens--,0===s.tokens&&(null==(t=this.Pe)||t.call(this,e)),0===s.tokens)}stop(){this.Ee={}}}var ef="Mobile",em="Android",eb="Tablet",ey=em+" "+eb,ew="iPad",ex="Apple",eS=ex+" Watch",ek="Safari",eE="BlackBerry",eP="Samsung",eF=eP+"Browser",eT=eP+" Internet",eC="Chrome",eI=eC+" OS",e$=eC+" iOS",eA="Internet Explorer",eR=eA+" "+ef,eM="Opera",eO=eM+" Mini",eL="Edge",eD="Microsoft "+eL,eN="Firefox",ej=eN+" iOS",ez="Nintendo",eq="PlayStation",eB="Xbox",eH=em+" "+ef,eU=ef+" "+ek,eV="Windows",eW=eV+" Phone",eG="Nokia",eK="Ouya",eJ="Generic",eY=eJ+" "+ef.toLowerCase(),eX=eJ+" "+eb.toLowerCase(),eQ="Konqueror",eZ="Oculus Browser",e0="Vivaldi",e1="Yandex",e2="Whale",e3="DuckDuckGo",e5="Pale Moon",e6="Waterfox",e4="Brave",e8="Google Search App",e7="(\\d+(\\.\\d+)?)",e9=RegExp("Version/"+e7),te=RegExp(eB,"i"),tt=RegExp(eq+" \\w+","i"),ti=RegExp(ez+" \\w+","i"),tr=RegExp(eE+"|PlayBook|BB10","i"),ts={"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"},tn=function(e,t,i,r){var s;return t=t||"",(null!=i&&i.brave?e4:null)||(null!=r&&r.detectGoogleSearchApp&&B(e,"GSA/")?e8:B(e," OPR/")&&B(e,"Mini")?eO:B(e," OPR/")?eM:tr.test(e)?eE:B(e,"IE"+ef)||B(e,"WPDesktop")?eR:B(e,"OculusBrowser")?eZ:B(e,eF)?eT:B(e,eL)||B(e,"Edg/")?eD:B(e,e0+"/")?e0:B(e,"YaBrowser/")?e1:B(e,e2+"/")?e2:B(e,e3+"/")||B(e,"Ddg/")?e3:B(e,"FBIOS")?"Facebook "+ef:B(e,"UCWEB")||B(e,"UCBrowser")?"UC Browser":B(e,"CriOS")?e$:B(e,"CrMo")||B(e,eC
1)?eC:B(e,em)&&B(e,ek)?eH:B(e,"FxiOS")?ej:B(e.toLowerCase(),eQ.toLowerCase())?eQ:B(e,e4+"/")?e4:(s=t)&&B(s,ex)||B(e,ek)&&!B(e,eC)&&!B(e,em)?B(e,ef)?eU:ek:B(e,"PaleMoon/")?e5:B(e,e6+"/")?e6:B(e,eN)?eN:B(e,"MSIE")||B(e,"Trident/")?eA:B(e,"Gecko")?eN:"")},ta={[eR]:[RegExp("rv:"+e7)],[eD]:[RegExp(eL+"?\\/"+e7)],[eC]:[RegExp("("+eC+"|CrMo)\\/"+e7)],[e$]:[RegExp("CriOS\\/"+e7)],"UC Browser":[RegExp("(UCBrowser|UCWEB)\\/"+e7)],[ek]:[e9],[eU]:[e9],[eM]:[RegExp("(Opera|OPR)\\/"+e7)],[eN]:[RegExp(eN+"\\/"+e7)],[ej]:[RegExp("FxiOS\\/"+e7)],[eQ]:[RegExp("Konqueror[:/]?"+e7,"i")],[eE]:[RegExp(eE+" "+e7),e9],[eH]:[RegExp("android\\s"+e7,"i")],[eT]:[RegExp(eF+"\\/"+e7)],[eZ]:[RegExp("OculusBrowser\\/"+e7)],[e0]:[RegExp(e0+"\\/"+e7)],[e1]:[RegExp("YaBrowser\\/"+e7)],[e2]:[RegExp(e2+"\\/"+e7)],[e4]:[RegExp(e4+"\\/"+e7)],[e3]:[RegExp("(DuckDuckGo|Ddg)\\/"+e7)],[e5]:[RegExp("PaleMoon\\/"+e7)],[e6]:[RegExp(e6+"\\/"+e7)],[e8]:[RegExp("GSA\\/"+e7)],[eA]:[RegExp("(rv:|MSIE )"+e7)],Mozilla:[RegExp("rv:"+e7)]},to=function(e,t,i,r){var s=ta[tn(e,t,i,r)];if(Q(s))return null;for(var n=0;s.length>n;n++){var a=e.match(s[n]);if(a)return parseFloat(a[a.length-2])}return null},tl=[[RegExp(eB+"; "+eB+" (.*?)[);]","i"),e=>[eB,e&&e[1]||""]],[RegExp(ez,"i"),[ez,""]],[RegExp(eq,"i"),[eq,""]],[tr,[eE,""]],[RegExp(eV,"i"),(e,t)=>{if(/Phone/.test(t)||/WPDesktop/.test(t))return[eW,""];if(new RegExp(ef).test(t)&&!/IEMobile\b/.test(t))return[eV+" "+ef,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var r=ts[i[1]]||"";return/arm/i.test(t)&&(r="RT"),[eV,r]}return[eV,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,e=>e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,e=>{var t="";return e&&e.length>=3&&(t=Q(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+em+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+em+")","i"),e=>e&&e[2]?[em,[e[2],e[3],e[4]||"0"].join(".")]:[em,""]],[/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/,[eI,""]],[/Linux|debian/i,["Linux",""]]],tu=function(e){return ti.test(e)?ez:tt.test(e)?eq:te.test(e)?eB:RegExp(eK,"i").test(e)?eK:RegExp("("+eW+"|WPDesktop)","i").test(e)?eW:/iPad/.test(e)?ew:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?eS:tr.test(e)?eE:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(eG,"i").test(e)?eG:/(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(ef).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)?em:ey:RegExp("(pda|"+ef+")","i").test(e)?eY:RegExp(eb,"i").test(e)&&!RegExp(eb+" pc","i").test(e)?eX:""},tc=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function th(e,t){return"string"==typeof e&&tc.test(e)?e:t()}function td(e){return e?e.split("#")[0]:e}function tp(e,t){var i=setTimeout(e,t);return(null==i?void 0:i.unref)&&(null==i||i.unref()),i}var tv=e=>e instanceof Error,tg={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}},t_=tg.info;function tf(e){var t=[];for(var i in e){var r=e[i];et(r)||Q(r)||t.push({key:i,value:function e(t){if(en(t))return{boolValue:t};if("number"==typeof t)return Number.isFinite(t)?Number.isInteger(t)?{intValue:t}:{doubleValue:t}:{stringValue:String(t)};if("string"==typeof t)return{stringValue:t};if(K(t))return{arrayValue:{values:t.map(t=>e(t))}};try{return{stringValue:JSON.stringify(t)}}catch(e){return{stringValue:String(t)}}}(r)})}return t}function tm(e,t,i){return y({},e.resourceAttributes,{"service.name":e.serviceName||"unknown_service"},e.environment&&{"deployment.environment":e.environment},e.serviceVersion&&{"service.version":e.serviceVersion},{"telemetry.sdk.name":t,"telemetry.sdk.version":i})}function tb(e,t,i,r){return{resourceLogs:[{resource:{attributes:tf(t)},scopeLogs:[{scope:{name:i,version:r},logRecords:e}]}]}}let ty=class{constructor(e,t,i,r,s,n,a){var o;void 0===n&&(n=()=>Promise.resolve()),this._instance=e,this.Se=t,this.Ae=i,this.qe=r,this.Be=s,this.je=n,this.He=a,this.Ue=null,this.ze=0,this.Ve=0,this.We=0,this.Ge=0,this.Ze=!1,this.Qe=t.maxBufferSize,this.Je=Math.max(null!==(o=t.maxQueueSize)&&void 0!==o?o:t.maxBufferSize,t.maxBufferSize),this.Ye=t.flushIntervalMs,this.Ke=t.maxBatchRecordsPerPost,this.Xe=t.rateCapWindowMs,this.et=t.maxLogsPerInterval}reset(){this.tt(),this.Ue=null,this.We=0,this.Ge=0,this.Ze=!1,this.ze=0,this.Ve=0,this.Ke=this.Se.maxBatchRecordsPerPost}onReconnect(){this.Ve=0,this.rt()}captureLog(e){if(!this._instance.isDisabled&&!this._instance.optedOut&&null!=e&&e.body){var t=this.it(e);
1if(null!==t){if(t.body){if(this.nt()){var i={record:function(e,t){var{text:i,number:r}=tg[e.level||"info"]||t_,s=String(Date.now())+"000000",n={};t.distinctId&&(n.posthogDistinctId=t.distinctId),t.sessionId&&(n.sessionId=t.sessionId),t.windowId&&(n["window.id"]=t.windowId),ei(t.sessionStartTimestamp)||(n.sessionStartTimestamp=String(t.sessionStartTimestamp)),ei(t.lastActivityTimestamp)||(n.lastActivityTimestamp=String(t.lastActivityTimestamp)),t.currentUrl&&(n["url.full"]=t.currentUrl),t.screenName&&(n["screen.name"]=t.screenName),t.appState&&(n["app.state"]=t.appState),t.activeFeatureFlags&&t.activeFeatureFlags.length>0&&(n.feature_flags=t.activeFeatureFlags);var a=y({},n,e.attributes||{}),o={timeUnixNano:s,observedTimeUnixNano:s,severityNumber:r,severityText:i,body:{stringValue:e.body},attributes:tf(a)};return e.trace_id&&(o.traceId=e.trace_id),e.span_id&&(o.spanId=e.span_id),Q(e.trace_flags)||(o.flags=e.trace_flags),o}(t,this.qe())};this.Be(()=>this.st(i))}}else this.Ae.info("Log was rejected in beforeSend function")}}}it(e){var t=this.Se.beforeSend;if(!t)return e;var i=K(t)?t:[t],r=e;for(var s of i)try{var n=s(r);if(!n)return this.Ae.info("Log was rejected in beforeSend function"),null;r=n}catch(e){return this.Ae.error("Error in beforeSend function for log:",e),null}return r}nt(){if(void 0===this.et)return!0;var e=Date.now(),t=e-this.We;return this.Xe>t&&t>=0||(this.We=e,this.Ge=0,this.Ze=!1),this.et>this.Ge?(this.Ge++,!0):(this.Ze||(this.Ae.warn("captureLog dropping logs: exceeded "+this.et+" logs per "+this.Xe+"ms"),this.Ze=!0),!1)}flush(){var e=this;return b(function*(){if(!e._instance.isDisabled)return e.Ue||(e.Ue=e.ot().finally(()=>{e.Ue=null})),e.Ue})()}ot(){var e=this;return b(function*(){e.tt();var t=null!==(s=e._instance.getPersistedProperty(C.LogsQueue))&&void 0!==s?s:[];if(0!==t.length)for(var i=t.length,r=0;t.length>0&&i>r;){e.ze=0;var s,n,a,o=Math.min(t.length,e.Ke),l=t.slice(0,o),u=tb(l.map(e=>e.record),e.ut(),null!==(n=e.He)&&void 0!==n?n:e._instance.getLibraryId(),e._instance.getLibraryVersion()),c=yield e._instance.ht(u);if("too-large"===c.kind&&l.length>1)e.Ke=Math.max(1,Math.floor(l.length/2)),e.Ae.warn("Received 413 when sending logs batch of size "+l.length+", reducing batch size to "+e.Ke);else if("retry-later"===c.kind||("too-large"===c.kind?e.Ae.warn("Dropping a single log record after 413 with batch size 1 â the record is larger than the server cap and cannot be split further."):"ok"===c.kind&&e.Se.maxBatchRecordsPerPost>e.Ke&&(e.Ke=Math.min(e.Se.maxBatchRecordsPerPost,e.Ke+1)),yield e.dt(l.length),t=null!==(a=e._instance.getPersistedProperty(C.LogsQueue))&&void 0!==a?a:[],r+=l.length,"fatal"===c.kind))throw c.error}})()}dt(e){var t=this;return b(function*(){var i,r=Math.max(0,e-t.ze),s=null!==(i=t._instance.getPersistedProperty(C.LogsQueue))&&void 0!==i?i:[];t._instance.setPersistedProperty(C.LogsQueue,s.slice(r)),yield t.je()})()}ut(){return tm(this.Se,this._instance.getLibraryId(),this._instance.getLibraryVersion())}st(e){var t;if(!this._instance.optedOut){var i=null!==(t=this._instance.getPersistedProperty(C.LogsQueue))&&void 0!==t?t:[];this.Je>i.length||(i.shift(),this.ze++,this.Ae.info("Logs queue is full, dropping oldest record.")),i.push(e),this._instance.setPersistedProperty(C.LogsQueue,i),this.Qe>i.length?this.ct():this.rt()}}ct(e){void 0===e&&(e=this.Ye),this.vt||(this.vt=tp(()=>{this.vt=void 0,this.rt()},e))}ft(){var e=Math.min(Math.max(0,this.Ve-1),6);return this.Ye*Math.pow(2,e)}yt(){var e=this._instance.getPersistedProperty(C.LogsQueue);return!!e&&e.length>0}shutdown(e){var t=this;return b(function*(){t.tt();var i=t.flush().catch(()=>{});void 0!==e?yield Promise.race([i,new Promise(t=>tp(t,e))]):yield i})()}flushWithTimeout(e){var t=this;return b(function*(){var i=!1,r=t.flush(),s=new Promise(t=>tp(()=>{i=!0,t()},e));try{yield Promise.race([r,s])}finally{i&&r.catch(()=>{})}})()}rt(){this.flush().then(()=>{this.Ve=0},e=>{this.Ve++,this.Ae.error("PostHog logs flush failed:",e)}).finally(()=>{!this._instance.isDisabled&&this.yt()&&this.ct(this.ft())})}tt(){this.vt&&(clearTimeout(this.vt),this.vt=void 0)}};class tw{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 b(function*(){for(var i of e)i.stacktrace&&i.stacktrace.frames&&K(i.stacktrace.frames)&&(i.stacktrace.frames=yield t.applyModifiers(i.stacktrace.frames));return e})()}coerceFallback(e){var t;return{type:"Error",value:"Unknown error",stack:null==(t=e.syntheticException)?void 0:t.stack,synthetic:!0}}parseStacktrace(e,t){var i,r;return null!=e.cause&&(i=this.parseStacktrace(e.cause,t)),""!=e.stack&&null!=e.stack&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?t.ski
1pFirstLines:0),t.chunkIdMap)),y({},e,{cause:i,stack:r})}applyChunkIds(e,t){return e.map(e=>(e.filename&&t&&(e.chunk_id=t[e.filename]),e))}applyCoercers(e,t){for(var i of this.coercers)if(i.match(e))return i.coerce(e,t);return this.coerceFallback(t)}applyModifiers(e){var t=this;return b(function*(){var i=e;for(var r of t.modifiers)i=yield r(i);return i})()}convertToExceptionList(e,t){var i,r,s,n={type:e.type,value:e.value,mechanism:{type:null!==(i=t.type)&&void 0!==i?i:"generic",handled:null===(r=t.handled)||void 0===r||r,synthetic:null!==(s=e.synthetic)&&void 0!==s&&s}};e.stack&&(n.stacktrace={type:"raw",frames:e.stack});var a=[n];return null!=e.cause&&a.push(...this.convertToExceptionList(e.cause,y({},t,{handled:!0}))),a}buildParsingContext(e){var t;return{chunkIdMap:function(e){var t=globalThis._posthogChunkIds;if(t){var i=Object.keys(t);return ra&&i.length===rn||(rn=i.length,ra=i.reduce((i,r)=>{rs||(rs={});var s=rs[r];if(s)i[s[0]]=s[1];else for(var n=e(r),a=n.length-1;a>=0;a--){var o=n[a],l=null==o?void 0:o.filename,u=t[r];if(l&&u){i[l]=u,rs[r]=[l,u];break}}return i},{})),ra}}(this.stackParser),skipFirstLines:null!==(t=e.skipFirstLines)&&void 0!==t?t:1}}buildCoercingContext(e,t,i){void 0===i&&(i=0);var r=(i,r)=>{if(4>=r){var s=this.buildCoercingContext(e,t,r);return this.applyCoercers(i,s)}};return y({},t,{syntheticException:0==i?t.syntheticException:void 0,mechanism:e,apply:e=>r(e,i),next:e=>r(e,i+1)})}}function tx(e,t,i,r,s){var n={platform:e,filename:t,function:"<anonymous>"===i?"?":i,in_app:!0};return Q(r)||(n.lineno=r),Q(s)||(n.colno=s),n}var tS=(e,t)=>{var i=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return i||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",i?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]},tk=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,tE=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,tP=/\((\S*)(?::(\d+))(?::(\d+))\)/,tF=(e,t)=>{var i=tk.exec(e);if(i){var[,r,s,n]=i;return tx(t,r,"?",+s,+n)}var a=tE.exec(e);if(a){if(a[2]&&0===a[2].indexOf("eval")){var o=tP.exec(a[2]);o&&(a[2]=o[1],a[3]=o[2],a[4]=o[3])}var[l,u]=tS(a[1]||"?",a[2]);return tx(t,u,l,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},tT=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tC=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,tI=(e,t)=>{var i=tT.exec(e);if(i){if(i[3]&&i[3].indexOf(" > eval")>-1){var r=tC.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]=tS(n,s),tx(t,s,n,i[4]?+i[4]:void 0,i[5]?+i[5]:void 0)}},t$=/\(error: (.*)\)/;class tA{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,t){var i=Z(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:i?e.stack:void 0,cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var t=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?t+": "+e.message:t}isDOMException(e){return ec(e,"DOMException")}isDOMError(e){return ec(e,"DOMError")}}class tR{match(e){return e instanceof Error}coerce(e,t){return{type:this.getType(e),value:this.getMessage(e,t),stack:this.getStack(e),cause:e.cause?t.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,t){var i=e.message;return String(i.error&&"string"==typeof i.error.message?i.error.message:i)}getStack(e){return e.stacktrace||e.stack||void 0}}class tM{constructor(){}match(e){return ec(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 tO=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class tL{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(tO);return r&&(t=r[1],i=r[2]),[t,i]}}var tD=["fatal","error","warning","log","info","debug"];function tN(e,t){void 0===t&&(t=40);var i=Object.keys(e);if(i.sort(),!i.length)return"[object has no keys]";for(var r=i.length;r>0;r--){var s=i.slice(0,r).join(", ");
1if(t>=s.length)return r===i.length?s:s.length>t?s.slice(0,t)+"...":s}return""}class tj{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 eh(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&"string"==typeof e.name){var t="'"+e.name+"' captured as exception";return"message"in e&&"string"==typeof e.message&&(t+=" with message: '"+e.message+"'"),t}if("message"in e&&"string"==typeof e.message)return e.message;var i=this.getObjectClassName(e);return(i&&"Object"!==i?"'"+i+"'":"Object")+" captured as exception with keys: "+tN(e)}isSeverityLevel(e){return Z(e)&&!ee(e)&&tD.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var t in e)if(({}).hasOwnProperty.call(e,t)){var i=e[t];if(tv(i))return i}}getObjectClassName(e){try{var t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch(e){return}}}class tz{match(e){return eh(e)}coerce(e,t){var i,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+tN(e),stack:null==(i=t.syntheticException)?void 0:i.stack,synthetic:!0}}}class tq{match(e){return eu(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 tB{match(e){return ec(e,"PromiseRejectionEvent")||this.isCustomEventWrappingRejection(e)}isCustomEventWrappingRejection(e){if(!eh(e))return!1;try{var t=e.detail;return null!=t&&"object"==typeof t&&"reason"in t}catch(e){return!1}}coerce(e,t){var i,r=this.getUnhandledRejectionReason(e);return eu(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 tH="$message",tU="$timestamp",tV=new Set([tH,tU]),tW={enabled:!0,max_bytes:32768};function tG(e){var t;return e?{enabled:null!==(t=e.enabled)&&void 0!==t?t:tW.enabled,max_bytes:function(e,t){if(!er(e)||e===1/0||e===-1/0)return t;var i=Math.floor(e);return 0>i?t:i}(e.max_bytes,tW.max_bytes)}:y({},tW)}class tK{constructor(e){this.bt=[],this._t=0,this.Se=tG(e)}setConfig(e){this.Se=tG(e),this.wt()}add(e){var t=function(e){var t,i,r;try{r=[],t=null!==(i=JSON.stringify(e,function(e,t){if("bigint"==typeof t)return t.toString();if("function"!=typeof t&&"symbol"!=typeof t){if(t instanceof Error)return{name:t.name,message:t.message,stack:t.stack};if(t&&"object"==typeof t){for(;r.length>0&&r[r.length-1]!==this;)r.pop();if(r.includes(t))return"[Circular]";r.push(t)}return t}}))&&void 0!==i?i:"null"}catch(e){return}try{var s=JSON.parse(t);if(!Y(s))return;var n=s[tH],a=s[tU];if(!Z(n)||0===n.trim().length||!Z(a)&&!er(a))return;return{step:s,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.Se.max_bytes||(this.bt.push({step:t.step,bytes:i}),this._t+=i,this.wt())}}getAttachable(){return this.bt.map(e=>e.step)}clear(){this.bt=[],this._t=0}size(){return this.bt.length}wt(){for(;this._t>this.Se.max_bytes&&this.bt.length>0;){var e=this.bt.shift();e&&(this._t-=e.bytes)}}}var tJ=function(e,t){var{debugEnabled:i}=void 0===t?{}:t,r={k(t){if(s&&(f.DEBUG||v.POSTHOG_DEBUG||i)&&!Q(s.console)&&s.console){for(var r=("__rrweb_original__"in s.console[t])?s.console[t].__rrweb_original__:s.console[t],n=arguments.length,a=Array(n>1?n-1:0),o=1;n>o;o++)a[o-1]=arguments[o];r(e,...a)}},debug(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.k("debug",...t)},info(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.k("log",...t)},warn(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.k("warn",...t)},error(){for(var e=arguments.length,t=Array(e),i=0;e>i;i++)t[i]=arguments[i];r.k("error",...t)},critical(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];console.error(e,...i)},uninitializedWarning(e){r.error("You must initialize PostHog before calling "+e)},createLogger:(t,i)=>tJ(e+" "+t,i)};return r},tY=tJ("[PostHog.js]"),tX=tY.createLogger,tQ=tX("[ExternalScriptsLoader]"),tZ=(e,t,i)=>{if(e.config.disable_external_dependency_loading)return tQ.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");
1if(r){for(var s,n=0;r.length>n;n++)if(s=function(){if(r[n].src===t){var e=r[n];return e.__posthog_loading_callback_fired?{v:i()}:(e.addEventListener("load",t=>{e.__posthog_loading_callback_fired=!0,i(void 0,t)}),e.onerror=e=>i(e),{v:void 0})}}())return s.v}var a=()=>{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?a():null==o||o.addEventListener("DOMContentLoaded",a)};v.__PosthogExtensions__=v.__PosthogExtensions__||{},v.__PosthogExtensions__.loadExternalDependency=(e,t,i)=>{if("remote-config"!==t){var r;if(e.config.strict_script_versioning)r=e.requestRouter.endpointFor("assets","/static/"+e.version+"/"+t+".js");else{var s="/static/"+t+".js?v="+e.version;"toolbar"===t&&(s=s+"&t="+3e5*Math.floor(Date.now()/3e5)),r=e.requestRouter.endpointFor("assets",s)}tZ(e,r,i)}else{var n=e.requestRouter.endpointFor("assets","/array/"+e.config.token+"/config.js");tZ(e,n,i)}},v.__PosthogExtensions__.loadSiteApp=(e,t,i)=>{var r=e.requestRouter.endpointFor("api",t);tZ(e,r,i)};var t0="$people_distinct_id",t1="$device_id",t2="$device_model",t3="__alias",t5="__timers",t6="$autocapture_disabled_server_side",t4="$heatmaps_enabled_server_side",t8="$exception_capture_enabled_server_side",t7="$error_tracking_suppression_rules",t9="$error_tracking_capture_extension_exceptions",ie="$web_vitals_enabled_server_side",it="$dead_clicks_enabled_server_side",ii="$product_tours_enabled_server_side",ir="$web_vitals_allowed_metrics",is="$session_recording_remote_config",ia="$replay_sample_rate",io="$replay_override_sampling",il="$replay_override_linked_flag",iu="$replay_override_url_trigger",ic="$replay_override_event_trigger",ih="$sesid",id="$session_is_sampled",ip="$enabled_feature_flags",iv="$active_feature_flags",ig="$early_access_features",i_="$feature_flag_details",im="$feature_flag_payloads",ib="$feature_flag_request_id",iy="$override_feature_flags",iw="$override_feature_flag_payloads",ix="$stored_person_properties",iS="$stored_group_properties",ik="$surveys",iE="$surveys_loaded_at",iP="$surveys_activated",iF="ph_product_tours",iT="$flag_call_reported",iC="$flag_call_reported_session_id",iI="$feature_flag_errors",i$="$feature_flag_evaluated_at",iA="$user_state",iR="$client_session_props",iM="$capture_rate_limit",iO="$initial_campaign_params",iL="$initial_referrer_info",iD="$initial_person_info",iN="$epp",ij="__POSTHOG_TOOLBAR__",iz="$posthog_cookieless",iq="$sdk_debug_extensions_init_method",iB="$sdk_debug_extensions_init_time_ms",iH="$sdk_debug_recording_script_not_loaded",iU="PostHog loadExternalDependency extension not found.",iV="on_reject",iW="always",iG="anonymous",iK="identified",iJ="identified_only",iY="visibilitychange",iX="beforeunload",iQ="$pageview",iZ="$pageleave",i0="$identify",i1="$groupidentify";function i2(e,t){K(e)&&e.forEach(t)}function i3(e,t){if(!ei(e)){if(K(e))e.forEach(t);else if(ea(e))e.forEach((e,i)=>t(e,i));else for(var i in e)W.call(e,i)&&t(e[i],i)}}var i5=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];for(var s of i)for(var n in s)void 0!==s[n]&&(e[n]=s[n]);return e};function i6(e){for(var t=Object.keys(e),i=t.length,r=Array(i);i--;)r[i]=[t[i],e[t[i]]];return r}var i4=function(e){try{return e()}catch(e){return}},i8=function(e){return function(){try{for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,i)}catch(e){tY.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),tY.critical(e)}}},i7=function(e){var t={};return i3(e,function(e,i){(Z(e)&&e.length>0||er(e))&&(t[i]=e)}),t},i9=["herokuapp.com","vercel.app","netlify.app"];function re(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 rt(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 er(e)&&isFinite(e)&&Math.floor(e)===e});class ri{constructor(e){if(this.bytes=e,16!==e.length)throw TypeError("not 128-bit length")}static fromFieldsV7(e,t,i,r){if(!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(r)||0>e||0>t||0>i||0>r||e>0xffffffffffff||t>4095||i>1073741823||r>4294967295)throw RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=e/1099511627776,s[1]=e/4294967296,s[2]=e/16777216,s[3]=e/65536,s[4]=e/256,s[5]=e,s[6]=112|t>>>8,s[7]=t,s[8]=128|i>>>24,s[9]=i>>>16,s[10]=i>>>8,s[11]=i,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new ri(s)}toString(){for(var e="",t=0;this.bytes.length>t;t++)e=e+(this.bytes[t]>>>4).toString(16)+(15&this.bytes[t]).toString(16),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}clone(){return new ri(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 rr{constructor(){this.S=0,this.C=0,this.I=new ru}generate(){var e=this.generateOrAbort();if(Q(e)){this.S=0;var t=this.generateOrAbort();if(Q(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}generateOrAbort(){var e=Date.now();if(e>this.S)this.S=e,this.M();else{if(this.S>=e+1e4)return;this.C++,this.C>4398046511103&&(this.S++,this.M())}return ri.fromFieldsV7(this.S,Math.trunc(this.C/1073741824),1073741823&this.C,this.I.nextUint32())}M(){this.C=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var rs,rn,ra,ro,rl=e=>{if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;e.length>t;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};s&&!Q(s.crypto)&&crypto.getRandomValues&&(rl=e=>crypto.getRandomValues(e));class ru{constructor(){this.R=new Uint32Array(8),this.O=1/0}nextUint32(){return this.R.length>this.O||(rl(this.R),this.O=0),this.R[this.O++]}}var rc=()=>rh().toString(),rh=()=>(ro||(ro=new rr)).generate(),rd="",rp=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,rv={N:()=>!!o,D(e){tY.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(rv.A(e))||{}}catch(e){}return t},q(e,t,i,r,s){if(!o)return!1;try{var n="",a="",l=function(e,t){if(t){var i=function(e,t){if(void 0===t&&(t=o),rd)return rd;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),r=Math.min(i.length,8),s="dmn_chk_"+rc();!rd&&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",rd=n)}return rd}(e);if(!i){var r,s=(r=e.match(rp))?r[0]:"";s!==i&&tY.info("Warning: cookie subdomain discovery mismatch",s,i),i=s}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&&tY.warn("cookieStore warning: large cookie, len="+c.length),o.cookie=c,!0}catch(e){return!1}},P(e,t){if(null!=o&&o.cookie)try{rv.q(e,"",-1,t)}catch(e){return}}},rg=null,r_={N(){if(!et(rg))return rg;var e=!0;if(Q(s))e=!1;else try{var t="__mplssupport__";r_.q(t,"xyz"),'"xyz"'!==r_.A(t)&&(e=!1),r_.P(t)}catch(t){e=!1}return e||tY.error("localStorage unsupported; falling back to cookie store"),rg=e,e},D(e){tY.error("localStorage error: "+e)},A(e){try{return null==s?void 0:s.localStorage.getItem(e)}catch(e){r_.D(e)}return null},F(e){try{return JSON.parse(r_.A(e))||{}}catch(e){}return null},q(e,t){try{return null==s||s.localStorage.setItem(e,JSON.stringify(t)),!0}catch(e){r_.D(e)}return!1},P(e){try{null==s||s.localStorage.removeItem(e)}catch(e){r_.D(e)}}},rf=[t1,"distinct_id",ih,id,iN,iD,iA],rm={},rb={N:()=>!0,D(e){tY.error("memoryStorage error: "+e)},A:e=>rm[e]||null,F:e=>rm[e]||null,q:(e,t)=>(rm[e]=t,!0),P(e){delete rm[e]}},ry=null,rw={N(){if(!et(ry))return ry;if(ry=!0,Q(s))ry=!1;else try{var e="__support__";rw.q(e,"xyz"),'"xyz"'!==rw.A(e)&&(ry=!1),rw.P(e)}catch(e){ry=!1}return ry},D(e){tY.error("sessionStorage error: ",e)},A(e){try{return null==s?void 0:s.sessionStorage.getItem(e)}catch(e){rw.D(e)}return null},F(e){try{return JSON.parse(rw.A(e))||null}catch(e){}return null},q(e,t){try{return null==s||s.sessionStorage.setItem(e,JSON.stringify(t)),!0}catch(e){rw.D(e)}return!1},P(e){try{null==s||s.sessionStorage.removeItem(e)}catch(e){rw.D(e)}}};class rx{constructor(e){this._instance=e}get Se(){return this._instance.config}get consent(){return this.kt()?0:this.St}
1isOptedOut(){return this.Se.cookieless_mode===iW||this.isRejected()||-1===this.consent&&this.Se.cookieless_mode===iV}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return 0===this.consent}isRejected(){return 0===this.consent||-1===this.consent&&this.Se.opt_out_capturing_by_default}optInOut(e){this.Ct.q(this.It,e?1:0,this.Se.cookie_expiration,this.Se.cross_subdomain_cookie,this.Se.secure_cookie)}reset(){this.Ct.P(this.It,this.Se.cross_subdomain_cookie)}get It(){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 St(){var e=this.Ct.A(this.It);return ep(e)?1:B(ev,e)?0:-1}get Ct(){var e=this.Se.opt_out_capturing_persistence_type,t="localStorage"===e?r_:rv;if(!this.Tt||this.Tt!==t){this.Tt=t;var i="localStorage"===e?rv:r_;i.A(this.It)&&(this.Tt.A(this.It)||this.optInOut(ep(i.A(this.It))),i.P(this.It,this.Se.cross_subdomain_cookie))}return this.Tt}kt(){return!!this.Se.respect_dnt&&[null==a?void 0:a.doNotTrack,null==a?void 0:a.msDoNotTrack,v.doNotTrack].some(e=>ep(e))}}function rS(e,t){var i,r=null==e||null==(i=e.config)?void 0:i.get_current_url;if(!J(r))return t;try{var s=r(t);return Z(s)&&s?s:t}catch(e){return tY.error("Error in get_current_url, falling back to window.location.href",e),t}}function rk(e){return e instanceof Element&&(e.id===ij||!(null==e.closest||!e.closest(".toolbar-global-fade-container")))}function rE(e){return!!e&&1===e.nodeType}function rP(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function rF(e){return!!e&&3===e.nodeType}function rT(e){return!!e&&11===e.nodeType&&rE(e.host)}function rC(e){return e?H(e).split(/\s+/):[]}function rI(e,t){var i,r,n=Q(r=null==s||null==(i=s.location)?void 0:i.href)?void 0:rS(t,r);return!!(n&&e&&e.some(e=>n.match(e)))}function r$(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 rC(t)}function rA(e){return ei(e)?null:H(e).split(/(\s+)/).filter(e=>r1(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function rR(e){var t="";return rG(e)&&!rK(e)&&e.childNodes&&e.childNodes.length&&i3(e.childNodes,function(e){var i;rF(e)&&e.textContent&&(t+=null!==(i=rA(e.textContent))&&void 0!==i?i:"")}),H(t)}function rM(e){var t;return Q(e.target)?e.srcElement||null:null!=(t=e.target)&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}var rO=["a","button","form","input","select","textarea","label"];function rL(e,t){if(Q(t))return!0;var i,r=function(e){if(t.some(t=>(function(e,t){var i=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;try{return!!i&&i.call(e,t)}catch(e){return!1}})(e,t)))return{v:!0}};for(var s of e)if(i=r(s))return i.v;return!1}function rD(e){var t=e.parentNode;return!(!t||!rE(t))&&t}var rN=[".ph-no-autocapture","[data-ph-no-autocapture]"],rj=["next","previous","prev",">","<"],rz=[...rj,"+","-","â","â"],rq=(e,t)=>
1/[a-z0-9]/i.test(t)?e.includes(t):e===t,rB=[".ph-no-rageclick",".ph-no-capture"],rH=["","text","search","email","password","url","tel","number"];function rU(e,t){if(!s||rV(e)||(en(t)?(r=!!t&&rB,n=void 0,a=!1):(r=null!==(o=null==t?void 0:t.css_selector_ignorelist)&&void 0!==o?o:rB,n=null==t?void 0:t.content_ignorelist,a=null!==(l=null==t?void 0:t.ignore_text_selection)&&void 0!==l&&l),!1===r)||a&&!(!(i=e)||!rE(i))&&(rP(i,"textarea")||(rP(i,"input")?B(rH,(i.getAttribute("type")||"").toLowerCase()):function(e){if(e.isContentEditable)return!0;var t=null==e.getAttribute?void 0:e.getAttribute("contenteditable");return"true"===t||""===t}(i))))return!1;var i,r,n,a,o,l,{targetElementList:u}=rW(e,!1);return!function(e,t){var i;if(!1===e||Q(e))return!1;if(!0===e)i=rj;else{if(!K(e))return!1;if(e.length>10)return tY.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=>rq(t,e)||rq(r,e))})}(n,u.map(e=>{var t;return{safeText:rR(e).toLowerCase(),ariaLabel:(null==(t=e.getAttribute("aria-label"))?void 0:t.toLowerCase().trim())||""}}))&&!rL(u,r)}var rV=e=>!e||rP(e,"html")||!rE(e),rW=(e,t)=>{if(!s||rV(e))return{parentIsUsefulElement:!1,targetElementList:[]};for(var i=!1,r=[e],n=e;n.parentNode&&!rP(n,"body");)if(rT(n.parentNode))r.push(n.parentNode.host),n=n.parentNode.host;else{var a=rD(n);if(!a)break;if(t||rO.indexOf(a.tagName.toLowerCase())>-1)i=!0;else try{var o=s.getComputedStyle(a);o&&"pointer"===o.getPropertyValue("cursor")&&(i=!0)}catch(e){}r.push(a),n=a}return{parentIsUsefulElement:i,targetElementList:r}};function rG(e){for(var t=e;t.parentNode&&!rP(t,"body");t=t.parentNode){var i=r$(t);if(B(i,"ph-sensitive")||B(i,"ph-no-capture"))return!1}if(B(r$(e),"ph-include"))return!0;var r=e.type||"";if(Z(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var s=e.name||e.id||"";return!Z(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 rK(e){return!!(rP(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||rP(e,"select")||rP(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var rJ="(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})",rY=RegExp("^(?:"+rJ+")$"),rX=new RegExp(rJ),rQ="\\d{3}-?\\d{2}-?\\d{4}",rZ=RegExp("^("+rQ+")$"),r0=RegExp("("+rQ+")");function r1(e,t){return void 0===t&&(t=!0),!(ei(e)||Z(e)&&(e=H(e),(t?rY:rX).test((e||"").replace(/[- ]/g,""))||(t?rZ:r0).test(e)))}function r2(e){var t=rR(e);return r1(t=(t+" "+function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&i3(t.childNodes,function(t){var r;if(t&&"span"===(null==(r=t.tagName)?void 0:r.toLowerCase()))try{var s=rR(t);i=(i+" "+s).trim(),t.childNodes&&t.childNodes.length&&(i=(i+" "+e(t)).trim())}catch(e){tY.error("[AutoCapture]",e)}}),i}(e)).trim())?t:""}function r3(e){return e.replace(/"|\\"/g,'\\"')}var r5=tX("[Dead Clicks]"),r6=()=>!0,r4=e=>{var t,i=!(null==(t=e.instance.persistence)||!t.get_property(it)),r=e.instance.config.capture_dead_clicks;return en(r)?r:!!Y(r)||i};class r8{get lazyLoadedDeadClicksAutocapture(){return this.Et}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({[it]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.Mt(()=>{this.Pt()}):this.stop()}Mt(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.initDeadClicksAutocapture?e():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this.instance,"dead-clicks-autocapture",t=>{t?r5.error("failed to load script",t):e()})}Pt(){var e;if(o){if(!this.Et&&null!=(e=v.__PosthogExtensions__)&&e.initDeadClicksAutocapture){var t=Y(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};t.__onCapture=this.onCapture,this.Et=v.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,t),this.Et.start(o),r5.info("starting...")}}else r5.error("`document` not found. Cannot start.")}stop(){this.Et&&(this.Et.stop(),this.Et=void 0,r5.info("stopping..."))}}var r7=tX("[SegmentIntegration]"),r9="posthog-js";function se(e,t){var{organization:i,projectId:r,prefix:s,severityAllowList:n=["error"],sendExceptionsToPostHog:a=!0}=void 0===t?{}:t;return t=>{if("*"!==n&&!n.includes(t.level)||!e.__loaded)return t;t.tags||(t.tags={});var o=e.requestRouter.endpointFor("ui","/project/"+e.config.token+"/pers
1on/"+e.get_distinct_id());t.tags["PostHog Person URL"]=o,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var l,u,c,h,d,p,v=(null==(l=t.exception)?void 0:l.values)||[],g=v.map(e=>y({},e,{stacktrace:e.stacktrace?y({},e.stacktrace,{type:"raw",frames:(e.stacktrace.frames||[]).map(e=>y({},e,{platform:"web:javascript"}))}):void 0})),_={$exception_message:(null==(u=v[0])?void 0:u.value)||t.message,$exception_type:null==(c=v[0])?void 0:c.type,$exception_level:t.level,$exception_list:g,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null==(h=v[0])?void 0:h.value)||t.message,$sentry_exception_type:null==(d=v[0])?void 0:d.type,$sentry_tags:t.tags};return i&&r&&(_.$sentry_url=(s||"https://sentry.io/organizations/")+i+"/issues/?project="+r+"&query="+t.event_id),a&&(null==(p=e.exceptions)||p.sendExceptionEvent(_)),t}}class st{constructor(e,t,i,r,s,n){this.name=r9,this.setupOnce=function(a){a(se(e,{organization:t,projectId:i,prefix:r,severityAllowList:s,sendExceptionsToPostHog:null==n||n}))}}}class si{constructor(e){this.Rt=(e,t,i)=>{i&&(i.noSessionId||i.activityTimeout||i.sessionPastMaximumLength||i.crossTabAdoption)&&(tY.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:e,changeReason:i}),this.Ot=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.Lt()}Lt(){var e;this.Ft=null==(e=this._instance.sessionManager)?void 0:e.onSessionId(this.Rt)}destroy(){var e;null==(e=this.Ft)||e.call(this),this.Ft=void 0}doPageView(e,t){var i,r=this.At(e,t);return this.Ot={pathname:null!==(i=null==s?void 0:s.location.pathname)&&void 0!==i?i:"",pageViewId:t,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var t;return this.At(e,null==(t=this.Ot)?void 0:t.pageViewId)}doEvent(){var e;return{$pageview_id:null==(e=this.Ot)?void 0:e.pageViewId}}At(e,t){var i=this.Ot;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:a,maxScrollY:o,maxContentHeight:l,lastContentY:u,maxContentY:c}=s;if(!(Q(n)||Q(a)||Q(o)||Q(l)||Q(u)||Q(c))){n=Math.ceil(n),a=Math.ceil(a),o=Math.ceil(o),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c);var h=n>1?eg(a/n,0,1,tY):1,d=n>1?eg(o/n,0,1,tY):1,p=l>1?eg(u/l,0,1,tY):1,v=l>1?eg(c/l,0,1,tY):1;r=i5(r,{$prev_pageview_last_scroll:a,$prev_pageview_last_scroll_percentage:h,$prev_pageview_max_scroll:o,$prev_pageview_max_scroll_percentage:d,$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:p,$prev_pageview_max_content: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 sr=["flags","surveys"],ss={[t0]:{exposure:"hidden"},[t3]:{exposure:"hidden"},__cmpns:{exposure:"hidden"},[t5]:{exposure:"hidden"},[t6]:{exposure:"event"},[t4]:{exposure:"hidden"},[t8]:{exposure:"event"},[t7]:{exposure:"hidden"},[t9]:{exposure:"event"},[ie]:{exposure:"event"},[it]:{exposure:"event"},[ii]:{exposure:"hidden"},[ir]:{exposure:"event"},[is]:{exposure:"hidden"},$session_recording_enabled_server_side:{exposure:"hidden"},[ih]:{exposure:"hidden"},[id]:{exposure:"event"},[ia]:{exposure:"event",shouldSkipFromEventProperties:e=>et(e)},$session_past_minimum_duration:{exposure:"event"},$session_recording_url_trigger_activated_session:{exposure:"event"},$session_recording_event_trigger_activated_session:{exposure:"event"},$debug_first_full_snapshot_timestamp:{exposure:"event"},$sess_rec_flush_size:{exposure:"hidden"},[ip]:{exposure:"derived",storageGroup:"flags",shouldSkipFromEventProperties:(e,t)=>t(),transformToEventProperties(e){if(!Y(e))return{};for(var t={},i=Object.keys(e),r=0;i.length>r;r++)t["$feature/"+i[r]]=e[i[r]];return t}},[iv]:{exposure:"event",storageGroup:"flags"},[ig]:{exposure:"hidden"},[i_]:{exposure:"hidden",storageGroup:"flags"},[im]:{exposure:"event",storageGroup:"flags"},[ib]:{exposure:"event",storageGroup:"flags",volatile:!0},[iy]:{exposure:"event"},[iw]:{exposure:"hidden"},[ix]:{exposure:"hidden"},[iS]:{exposure:"hidden"},[ik]:{exposure:"hidden",storageGroup:"surveys"},[iE]:{exposure:"hidden",storageGroup:"surveys",volatile:!0},[iP]:{exposure:"event"}
1,[iF]:{exposure:"hidden"},$product_tours_activated:{exposure:"hidden"},$conversations_widget_session_id:{exposure:"event"},$conversations_ticket_id:{exposure:"event"},$conversations_widget_state:{exposure:"event"},$conversations_user_traits:{exposure:"event"},[iT]:{exposure:"hidden"},[iC]:{exposure:"hidden"},[iI]:{exposure:"hidden"},[i$]:{exposure:"hidden",storageGroup:"flags",volatile:!0},[iA]:{exposure:"hidden"},[iR]:{exposure:"hidden"},[iM]:{exposure:"hidden"},[iO]:{exposure:"hidden"},[iL]:{exposure:"hidden"},[iD]:{exposure:"hidden"},[iN]:{exposure:"hidden"},[io]:{exposure:"event"},[il]:{exposure:"event"},[iu]:{exposure:"event"},[ic]:{exposure:"event"},[iq]:{exposure:"event"},[iB]:{exposure:"event"},[iH]:{exposure:"event"},$sdk_debug_replay_event_trigger_status:{exposure:"event"},$sdk_debug_replay_linked_flag_trigger_status:{exposure:"event"},$sdk_debug_replay_matched_recording_trigger_groups:{exposure:"event"},$sdk_debug_replay_remote_trigger_matching_config:{exposure:"event"},$sdk_debug_replay_trigger_groups_count:{exposure:"event"},$sdk_debug_replay_url_trigger_status:{exposure:"event"},$session_recording_start_reason:{exposure:"event"}},sn=[["$posthog_sr_group_event_trigger_",{exposure:"hidden"}],["$posthog_sr_group_url_trigger_",{exposure:"hidden"}],["$posthog_sr_group_sampling_",{exposure:"hidden"}]],sa=e=>{var t=ss[e];if(t)return t;for(var[i,r]of sn)if(0===e.indexOf(i))return r},so=e=>{var t=null==o?void 0:o.createElement("a");return Q(t)?null:(t.href=e,t)},sl=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(!K(i)||2>i.length)return"";var a=i[1];try{a=decodeURIComponent(a)}catch(e){tY.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},su=function(e,t,i){if(!e||!t||!t.length)return e;for(var r=e.split("#"),s=r[1],n=(r[0]||"").split("?"),a=n[1],o=n[0],l=(a||"").split("&"),u=[],c=0;l.length>c;c++){var h=l[c].split("=");K(h)&&(t.includes(h[0])?u.push(h[0]+"="+i):u.push(l[c]))}var d=o;return null!=a&&(d+="?"+u.join("&")),null!=s&&(d+="#"+s),d},sc=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},sh=(e,t)=>e>=t&&g(),sd=(e,t,i,r)=>{if(0===e){if(g()){var s=t+1;return s===i&&r(),s}return t}return 0},sp="https?://(.*)",sv=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],sg=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid",...sv],s_="<masked>",sf=["li_fat_id"];function sm(e,t,i){if(!o)return{};var r,s=t?[...sv,...i||[]]:[],n=sb(su(o.URL,s,s_),e);return i5((r={},i3(sf,function(e){var t=rv.A(e);r[e]=t||null}),r),n)}function sb(e,t){var i=sg.concat(t||[]),r={};return i3(i,function(t){var i=sl(e,t);r[t]=i||null}),r}function sy(e){var t=e?0===e.search(sp+"google.([^/?]*)")?"google":0===e.search(sp+"bing.com")?"bing":0===e.search(sp+"yahoo.com")?"yahoo":0===e.search(sp+"duckduckgo.com")?"duckduckgo":null:null,i={};if(!et(t)){i.$search_engine=t;var r=o?sl(o.referrer,"yahoo"!=t?"q":"p"):"";r.length&&(i.ph_keyword=r)}return i}function sw(){return navigator.language||navigator.userLanguage}var sx="$direct";function sS(){return(null==o?void 0:o.referrer)||sx}function sk(e,t,i){void 0===i&&(i=!1);var r=e?[...sv,...t||[]]:[],s=i?td(null==l?void 0:l.href):null==l?void 0:l.href,n=null==s?void 0:s.substring(0,1e3);return{r:sS().substring(0,1e3),u:n?su(n,r,s_):void 0}}function sE(e,t){void 0===t&&(t=!1);var i,{r:r,u:s}=e,n=t?td(s):s,a={$referrer:r,$referring_domain:null==r?void 0:r==sx?sx:null==(i=so(r))?void 0:i.host};
1if(n){a.$current_url=n;var o=so(n);a.$host=null==o?void 0:o.host,a.$pathname=null==o?void 0:o.pathname,i5(a,sb(n))}return r&&i5(a,sy(r)),a}function sP(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(e){return}}var sF={flags:i$,surveys:iE},sT=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],sC="main";class sI{constructor(e,t,i){if(void 0===i&&(i=!0),this.$t={},this.Dt=!1,this.Nt=!1,this.Se=e,this.qt=i,this.props={},this.Bt=!1,this.jt=(r="",e.token&&(r=e.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),e.persistence_name?"ph_"+e.persistence_name:"ph_"+r+"_posthog"),this.Ct=this.Ht(e),this.Nt=this.Ut(e),this.load(),e.debug&&tY.info("Persistence loaded",e.persistence,y({},this.props)),this.update_config(e,e,t),this.save(),s){var r,n=()=>this.flush();re(s,"beforeunload",n,{capture:!1}),re(s,"pagehide",n,{capture:!1})}}zt(){var e,t=null==(e=this.Se)?void 0:e.persistence_save_debounce_ms;return er(t)&&t>0?t:0}isDisabled(){return!!this.Vt}Ht(e){-1===sT.indexOf(e.persistence.toLowerCase())&&(tY.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t,i,r,n,a=(t=e.cookie_persisted_properties||[],i=e.__preview_cookie_wins_on_conflict||!1,void 0===t&&(t=[]),void 0===i&&(i=!1),r=[...rf,...t],y({},r_,{F(e){try{var t={};try{t=rv.F(e)||{}}catch(e){}var r,s=JSON.parse(r_.A(e)||"{}");if(i){var n={};for(var a in t){var o=t[a];et(o)||""===o||(n[a]=o)}r=i5(s,n)}else r=i5(t,s);return r_.q(e,r),r}catch(e){}return null},q(e,t,i,s,n,a){var o=r_.q(e,t,void 0,void 0,a);try{var l={};r.forEach(e=>{t[e]&&(l[e]=t[e])}),Object.keys(l).length&&rv.q(e,l,i,s,n,a)}catch(e){r_.D(e)}return o},P(e,t){try{null==s||s.localStorage.removeItem(e),rv.P(e,t)}catch(e){r_.D(e)}}})),o=!1,l=e.persistence.toLowerCase();return"localstorage"===l&&r_.N()?(n=r_,o=!0):"localstorage+cookie"===l&&a.N()?(n=a,o=!0):"sessionstorage"===l&&rw.N()?n=rw:"memory"===l?n=rb:"cookie"===l?n=rv:a.N()?(n=a,o=!0):n=rv,this.Dt=o,n}Wt(e){return this.jt+"__"+e}Ut(e){return this.Dt&&!!e.split_storage}Gt(e){var t=null!=e?e:this.Se.feature_flag_cache_ttl_ms;if(!t||0>=t)return!1;var i=this.props[i$];return!i||"number"!=typeof i||Date.now()-i>t}properties(){var e={};return i3(this.props,(t,i)=>{var r=sa(i);if("derived"===(null==r?void 0:r.exposure)){if(null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(t,i===ip?()=>this.Gt():()=>!1))return;r.transformToEventProperties&&i5(e,r.transformToEventProperties(t))}else if(!r||"event"===r.exposure){if(null!=r&&null!=r.shouldSkipFromEventProperties&&r.shouldSkipFromEventProperties(t,()=>!1))return;e[i]=t}}),e}load(){if(!this.Vt){var e=this.Ct.F(this.jt);e&&(this.props=i5({},e)),this.Nt&&this.Zt()}}Zt(){for(var e of sr){var t=r_.F(this.Wt(e));if(t&&!X(t)){var i=this.Qt(e);i.persisted=!0,this.Jt(e)||(i.fingerprint=this.Yt(t,e)),this.Kt(e,t)||i5(this.props,t)}}}Jt(e){return Object.keys(this.props).some(t=>{var i;return(null==(i=sa(t))?void 0:i.storageGroup)===e})}Kt(e,t){var i=sF[e];if(!i)return!1;var r=t[i],s=this.props[i];return er(r)&&er(s)&&s>r}refreshKey(e){var t;if(!this.Vt){var i=this.Nt?null==(t=sa(e))?void 0:t.storageGroup:void 0,r=i?r_.F(this.Wt(i)):this.Ct.F(this.jt);if(r&&e in r)this.Xt(e,r[e]);else{if(i){var s=this.Ct.F(this.jt);if(s&&e in s)return void this.Xt(e,s[e])}this.er(e)}}}save(){if(!this.Vt){var e=this.zt();e>0?Q(this.tr)&&(this.tr=setTimeout(()=>{this.tr=void 0,this.rr()},e)):this.rr()}}flush(){Q(this.tr)||(clearTimeout(this.tr),this.tr=void 0,this.rr())}rr(){this.Vt||(this.Nt?this.ir():this.nr(this.Ct,this.jt,this.props,sC))}ir(){var{main:e,groups:t}=this.sr();for(var i of(this.nr(this.Ct,this.jt,e,sC),sr)){var r,s=t[i];(!X(s)||null!=(r=this.$t[i])&&r.persisted)&&this.nr(r_,this.Wt(i),s,i)}}sr(){var e={},t={};for(var i of sr)t[i]={};return i3(this.props,(i,r)=>{var s,n=null==(s=sa(r))?void 0:s.storageGroup;n?t[n][r]=i:e[r]=i}),{main:e,groups:t}}Yt(e,t){if(t===sC)return JSON.stringify(e)+"|"+this.ar+"|"+this.lr+"|"+this.ur;var i={};return i3(e,(e,t)=>{var r;i[t]=null!=(r=sa(t))&&r.volatile?"__volatile__":e}),JSON.stringify(i)}nr(e,t,i,r){var s,n=this.Qt(r);if(r===sC||n.dirty||Q(n.fingerprint)){try{if((s=this.Yt(i,r))===n.fingerprint)return void(n.dirty=!1)}catch(e){s=void 0}e.q(t,i,this.ar,this.lr,this.ur,this.Se.debug)?(n.dirty=!1,r!==sC&&(n.persisted=!0),Q(s)||(n.fingerprint=s)):this.Se.debug&&tY.warn('failed to persist storage entry "'+t+'"; will retry on next save')}}remove(e){var{keepGroupEntries:t=!1}=void 0===e?{}:e;if(Q(this.tr)||(clearTimeout(this.tr),this.tr=void 0),this.Ct.P(this.jt,!1),this.Ct.P(this.jt,!0),!t&&this.qt)for(var i of sr)r_.P(this.Wt(i));
1t?delete this.$t[sC]:this.$t={}}clear(){this.remove(),this.props={}}register_once(e,t,i){if(Y(e)){Q(t)&&(t="None"),this.ar=Q(i)?this.hr:i;var r=!1;if(i3(e,(e,i)=>{this.props.hasOwnProperty(i)&&this.props[i]!==t||(this.Xt(i,e),r=!0)}),r)return this.save(),!0}return!1}register(e,t){if(Y(e)){this.ar=Q(t)?this.hr:t;var i=!1;if(i3(e,(t,r)=>{e.hasOwnProperty(r)&&this.props[r]!==t&&(this.Xt(r,t),i=!0)}),i)return this.save(),!0}return!1}unregister(e){e in this.props&&(this.er(e),this.save())}update_campaign_params(){if(!this.Bt){var e=sm(this.Se.custom_campaign_params,this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties);X(i7(e))||this.register(e),this.Bt=!0}}update_search_keyword(){var e;this.register((e=null==o?void 0:o.referrer)?sy(e):{})}update_referrer_info(){var e;this.register_once({$referrer:sS(),$referring_domain:null!=o&&o.referrer&&(null==(e=so(o.referrer))?void 0:e.host)||sx},void 0)}set_initial_person_info(){this.props[iO]||this.props[iL]||this.register_once({[iD]:sk(this.Se.mask_personal_data_properties,this.Se.custom_personal_data_properties,this.Se.disable_capture_url_hashes)},void 0)}get_initial_props(){var e,t,i,r={};i3([iL,iO],e=>{var t=this.props[e];t&&i3(t,function(e,t){r["$initial_"+U(t)]=e})});var s=this.props[iD];return s&&i5(r,(void 0===(e=this.Se.disable_capture_url_hashes)&&(e=!1),t=sE(s,e),i={},i3(t,function(e,t){i["$initial_"+U(t)]=e}),i)),r}safe_merge(e){return i3(this.props,function(t,i){i in e||(e[i]=t)}),e}update_config(e,t,i){this.hr=this.ar=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!i),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie);var r=e.persistence!==t.persistence||!((e,t)=>{if(e.length!==t.length)return!1;var i=[...e].sort(),r=[...t].sort();return i.every((e,t)=>e===r[t])})(e.cookie_persisted_properties||[],t.cookie_persisted_properties||[]),s=r?this.Ht(e):this.Ct,n=this.Ut(e);if(r||n!==this.Nt){var a=this.props;this.clear(),this.Ct=s,this.Nt=n,this.props=a,this.save()}}set_disabled(e){this.Vt=e,this.Vt?this.remove():this.save()}set_cross_subdomain(e){e!==this.lr&&(this.lr=e,this.remove({keepGroupEntries:!0}),this.save())}set_secure(e){e!==this.ur&&(this.ur=e,this.remove({keepGroupEntries:!0}),this.save())}set_event_timer(e,t){var i=this.props[t5]||{};i[e]=t,this.Xt(t5,i),this.save()}remove_event_timer(e){var t=this.props[t5]||{},i=t[e];return Q(i)||(delete t[e],this.Xt(t5,t),this.save()),i}get_property(e){return this.props[e]}set_property(e,t){this.Xt(e,t),this.save()}Xt(e,t){var i;this.props[e]=t,null!=(i=sa(e))&&i.volatile||this.dr(e)}er(e){delete this.props[e],this.dr(e)}dr(e){var t,i=null==(t=sa(e))?void 0:t.storageGroup;i&&(this.Qt(i).dirty=!0)}Qt(e){return this.$t[e]||(this.$t[e]={})}}var s$={Activation:"events",Cancellation:"cancelEvents"},sA={Always:"always"},sR={SHOWN:"survey shown",DISMISSED:"survey dismissed",SENT:"survey sent"},sM={SURVEY_ID:"$survey_id",SURVEY_ITERATION:"$survey_iteration",SURVEY_LAST_SEEN_DATE:"$survey_last_seen_date"},sO={Popover:"popover",Inline:"inline"},sL={SHOWN:"product tour shown"},sD={TOUR_LAST_SEEN_DATE:"$product_tour_last_seen_date",TOUR_TYPE:"$product_tour_type"},sN=tX("[RateLimiter]");class sj{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=>{sN.info((e||"events")+" is quota limited."),this.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void sN.warn('could not rate limit - continuing. Error: "'+(null==e?void 0:e.message)+'"',{text:t})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return(null==(e=this.instance.config.rate_limiting)?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max((null==(e=this.instance.config.rate_limiting)?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){void 0===e&&(e=!1);var t,i,r,{captureEventsBurstLimit:s,captureEventsPerSecond:n}=this,a=(new Date).getTime(),o=null!==(t=null==(i=this.instance.persistence)?void 0:i.get_property(iM))&&void 0!==t?t:{tokens:s,last:a};o.tokens+=(a-o.last)/1e3*n,o.last=a,o.tokens>s&&(o.tokens=s);var l=1>o.tokens;return l||e||(o.tokens=Math.max(0,o.tokens-1)),!l||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+n+" events per second and "+s+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=l,null==(r=this.instance.persistence)||r.set_property(iM,o),{isRateLimited:l,remainingTokens:o.tokens}}isServerRateLimited(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}var sz=tX("[RemoteConfig]");class sq{constructor(e){this._instance=e}get remoteConfig(){var e;return null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.config}cr(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.loadExternalDependency?null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}vr(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 sz.info("Using preloaded remote config",this.remoteConfig),this.pr(this.remoteConfig),void this.gr();if(this._instance.mr())return void sz.warn("Remote config is disabled. Falling back to local config.");this.cr(e=>{if(!e)return sz.info("No config found after loading remote JS config. Falling back to JSON."),void this.vr(e=>{this.pr(e),this.gr()});this.pr(e),this.gr()})}catch(e){sz.error("Error loading remote config",e)}}stop(){this.yr&&(clearInterval(this.yr),this.yr=void 0)}
1refresh(){!this._instance.mr()&&o&&"hidden"!==o.visibilityState&&this._instance.reloadFeatureFlags()}gr(){var e;if(!this.yr){var t=null!==(e=this._instance.config.remote_config_refresh_interval_ms)&&void 0!==e?e:3e5;0!==t&&(this.yr=setInterval(()=>{this.refresh()},t))}}pr(e){var t;e||sz.error("Failed to fetch remote config from PostHog."),this._instance.pr(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 sB={GZipJS:"gzip-js",Base64:"base64"},sH=Uint8Array,sU=Uint16Array,sV=Uint32Array,sW=new sH([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),sG=new sH([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),sK=new sH([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),sJ=function(e,t){for(var i=new sU(31),r=0;31>r;++r)i[r]=t+=1<<e[r-1];var s=new sV(i[30]);for(r=1;30>r;++r)for(var n=i[r];i[r+1]>n;++n)s[n]=n-i[r]<<5|r;return[i,s]},sY=sJ(sW,2),sX=sY[1];sY[0][28]=258,sX[258]=28;for(var sQ=sJ(sG,0)[1],sZ=new sU(32768),s0=0;32768>s0;++s0){var s1=(43690&s0)>>>1|(21845&s0)<<1;sZ[s0]=((65280&(s1=(61680&(s1=(52428&s1)>>>2|(13107&s1)<<2))>>>4|(3855&s1)<<4))>>>8|(255&s1)<<8)>>>1}var s2=function(e,t,i){for(var r=e.length,s=0,n=new sU(t);r>s;++s)++n[e[s]-1];var a,o=new sU(t);for(s=0;t>s;++s)o[s]=o[s-1]+n[s-1]<<1;if(i){a=new sU(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=o[e[s]-1]++<<c,d=h|(1<<c)-1;d>=h;++h)a[sZ[h]>>>l]=u}else for(a=new sU(r),s=0;r>s;++s)a[s]=sZ[o[e[s]-1]++]>>>15-e[s];return a},s3=new sH(288);for(s0=0;144>s0;++s0)s3[s0]=8;for(s0=144;256>s0;++s0)s3[s0]=9;for(s0=256;280>s0;++s0)s3[s0]=7;for(s0=280;288>s0;++s0)s3[s0]=8;var s5=new sH(32);for(s0=0;32>s0;++s0)s5[s0]=5;var s6=s2(s3,9,0),s4=s2(s5,5,0),s8=function(e){return(e/8>>0)+(7&e&&1)},s7=function(e,t,i){(null==i||i>e.length)&&(i=e.length);var r=new(e instanceof sU?sU:e instanceof sV?sV:sH)(i-t);return r.set(e.subarray(t,i)),r},s9=function(e,t,i){var r=t/8>>0;e[r]|=i<<=7&t,e[r+1]|=i>>>8},ne=function(e,t,i){var r=t/8>>0;e[r]|=i<<=7&t,e[r+1]|=i>>>8,e[r+2]|=i>>>16},nt=function(e,t){for(var i=[],r=0;e.length>r;++r)e[r]&&i.push({s:r,f:e[r]});var s=i.length,n=i.slice();if(!s)return[new sH(0),0];if(1==s){var a=new sH(i[0].s+1);return a[i[0].s]=1,[a,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var o=i[0],l=i[1],u=0,c=1,h=2;for(i[0]={s:-1,f:o.f+l.f,l:o,r:l};c!=s-1;)o=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:o.f+l.f,l:o,r:l};var d=n[0].s;for(r=1;s>r;++r)n[r].s>d&&(d=n[r].s);var p=new sU(d+1),v=ni(i[c-1],p,0);if(v>t){r=0;var g=0,_=v-t,f=1<<_;for(n.sort(function(e,t){return p[t.s]-p[e.s]||e.f-t.f});s>r;++r){var m=n[r].s;if(t>=p[m])break;g+=f-(1<<v-p[m]),p[m]=t}for(g>>>=_;g>0;){var b=n[r].s;t>p[b]?g-=1<<t-p[b]++-1:++r}for(;r>=0&&g;--r){var y=n[r].s;p[y]==t&&(--p[y],++g)}v=t}return[new sH(p),v]},ni=function(e,t,i){return -1==e.s?Math.max(ni(e.l,t,i+1),ni(e.r,t,i+1)):t[e.s]=i},nr=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new sU(++t),r=0,s=e[0],n=1,a=function(e){i[r++]=e},o=1;t>=o;++o)if(e[o]==s&&o!=t)++n;else{if(!s&&n>2){for(;n>138;n-=138)a(32754);n>2&&(a(n>10?n-11<<5|28690:n-3<<5|12305),n=0)}else if(n>3){for(a(s),--n;n>6;n-=6)a(8304);n>2&&(a(n-3<<5|8208),n=0)}for(;n--;)a(s);n=1,s=e[o]}return[i.subarray(0,r),t]},ns=function(e,t){for(var i=0,r=0;t.length>r;++r)i+=e[r]*t[r];return i},nn=function(e,t,i){var r=i.length,s=s8(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)},na=function(e,t,i,r,s,n,a,o,l,u,c){s9(t,c++,i),++s[256];for(var h=nt(s,15),d=h[0],p=h[1],v=nt(n,15),g=v[0],_=v[1],f=nr(d),m=f[0],b=f[1],y=nr(g),w=y[0],x=y[1],S=new sU(19),k=0;m.length>k;++k)S[31&m[k]]++;for(k=0;w.length>k;++k)S[31&w[k]]++;for(var E=nt(S,7),P=E[0],F=E[1],T=19;T>4&&!P[sK[T-1]];--T);var C,I,$,A,R=u+5<<3,M=ns(s,s3)+ns(n,s5)+a,O=ns(s,d)+ns(n,g)+a+14+3*T+ns(S,P)+(2*S[16]+3*S[17]+7*S[18]);if(M>=R&&O>=R)return nn(t,c,e.subarray(l,l+u));if(s9(t,c,1+(M>O)),c+=2,M>O){C=s2(d,p,0),I=d,$=s2(g,_,0),A=g;var L=s2(P,F,0);for(s9(t,c,b-257),s9(t,c+5,x-1),s9(t,c+10,T-4),c+=14,k=0;T>k;++k)s9(t,c+3*k,P[sK[k]]);c+=3*T;for(var D=[m,w],N=0;2>N;++N){var j=D[N];for(k=0;j.length>k;++k)s9(t,c,L[z=31&j[k]]),c+=P[z],z>15&&(s9(t,c,j[k]>>>5&127),c+=j[k]>>>12)}}else C=s6,I=s3,$=s4,A=s5;for(k=0;o>k;++k)if(r[k]>255){ne(t,c,C[257+(z=r[k]>>>18&31)]),c+=I[z+257],z>7&&(s9(t,c,r[k]>>>23&31),c+=sW[z]);var z,q=31&r[k];ne(t,c,$[q]),c+=A[q],q>3&&(ne(t,c,r[k]>>>5&8191),c+=sG[q])}else ne(t,c,C[r[k]]),c+=I[r[k]];return ne(t,c,C[256]),c+I[256]},no=new sV([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nl=function(){for(var e=new sV(256),t=0;256>t;++t){for(var i=t,r=9;--r;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e}(),nu=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},nc=!!c||!!u,nh="text/plain",nd=!1,np=(e,t)=>{var[i,r]=e.split("#"),[s,n]=i.split("?");if(!n)return e;var a=n.split("&").filter(e=>e.split("=")[0]!==t).join("&");return s+(a?"?"+a:"")+(r?"#"+r:"")},nv=function(e,t,i){void 0===i&&(i=!0);var r,s,n,a,o,[l,u]=e.split("?"),c=y({},t),h=null!==(o=null==u?void 0:u.split("&").map(e=>{var t,[r,s]=e.split("="),n=i&&null!==(t=c[r])&&void 0!==t?t:s;return delete c[r],r+"="+n}))&&void 0!==o?o:[],d=(void 0===r&&(r="&"),a=[],i3(c,function(e,t){Q(e)||Q(t)||"undefined"===t||(s=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(t),a[a.length]=n+"="+s)}),a.join(r));return d&&h.push(d),l+"?"+h.join("&")},ng=(e,t)=>
1JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString():t,t),n_=e=>{if(e.xt)return e.xt;var{data:t,compression:i}=e;if(t){if(i===sB.GZipJS){var r,s,n,a,o,l,u,c,h=(r=function(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new sH(e.length+(e.length>>>1)),s=0,n=function(e){r[s++]=e},a=0;i>a;++a){if(s+5>r.length){var o=new sH(s+8+(i-a<<1));o.set(r),r=o}var l=e.charCodeAt(a);128>l?n(l):(2048>l?n(192|l>>>6):(l>55295&&57344>l?(n(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++a))>>>18),n(128|l>>>12&63)):n(224|l>>>12),n(128|l>>>6&63)),n(128|63&l))}return s7(r,0,s)}(ng(t)),s={mtime:0},n=4294967295,a={p(e){for(var t=n,i=0;e.length>i;++i)t=nl[255&t^e[i]]^t>>>8;n=t},d:()=>4294967295^n},o=r.length,a.p(r),c=(l=10+(s.filename&&s.filename.length+1||0),u=function(e,t,i,r,s,n){var a=e.length,o=new sH(r+a+5*(1+Math.floor(a/7e3))+8),l=o.subarray(r,o.length-8),u=0;if(!t||8>a)for(var c=0;a>=c;c+=65535){var h=c+65535;a>h?u=nn(l,u,e.subarray(c,h)):(l[c]=!0,u=nn(l,u,e.subarray(c,a)))}else{for(var d=no[t-1],p=d>>>13,v=8191&d,g=(1<<i)-1,_=new sU(32768),f=new sU(g+1),m=Math.ceil(i/3),b=2*m,y=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<b)&g},w=new sV(25e3),x=new sU(288),S=new sU(32),k=0,E=0,P=(c=0,0),F=0,T=0;a>c;++c){var C=y(c),I=32767&c,$=f[C];if(_[I]=$,f[C]=I,c>=F){var A=a-c;if((k>7e3||P>24576)&&A>423){u=na(e,l,0,w,x,S,E,P,T,c-T,u),P=k=E=0,T=c;for(var R=0;286>R;++R)x[R]=0;for(R=0;30>R;++R)S[R]=0}var M=2,O=0,L=v,D=I-$&32767;if(A>2&&C==y(c-D))for(var N=Math.min(p,A)-1,j=Math.min(32767,c),z=Math.min(258,A);j>=D&&--L&&I!=$;){if(e[c+M]==e[c+M-D]){for(var q=0;z>q&&e[c+q]==e[c+q-D];++q);if(q>M){if(M=q,O=D,q>N)break;var B=Math.min(D,q-2),H=0;for(R=0;B>R;++R){var U=c-D+R+32768&32767,V=U-_[U]+32768&32767;V>H&&(H=V,$=U)}}}D+=(I=$)-($=_[I])+32768&32767}if(O){w[P++]=268435456|sX[M]<<18|sQ[O];var W=31&sX[M],G=31&sQ[O];E+=sW[W]+sG[G],++x[257+W],++S[G],F=c+M,++k}else w[P++]=e[c],++x[e[c]]}}u=na(e,l,!0,w,x,S,E,P,T,c-T,u)}return s7(o,0,r+s8(u)+8)}(r,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(r.length)))):12+s.mem,l,8)).length,function(e,t){var i=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=2>t.level?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&nu(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var r=0;i.length>=r;++r)e[r+10]=i.charCodeAt(r)}}(u,s),nu(u,c-8,a.d()),nu(u,c-4,o),u);return{contentType:nh,body:h.buffer.slice(h.byteOffset,h.byteOffset+h.byteLength),estimatedSize:h.byteLength}}if(i===sB.Base64){let e;var d,p="data="+encodeURIComponent("string"==typeof(e=(d=ng(t))?btoa(encodeURIComponent(d).replace(/%([0-9A-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))):d)?e:ng(e));return{contentType:"application/x-www-form-urlencoded",body:p,estimatedSize:new Blob([p]).size}}var v=ng(t);return{contentType:"application/json",body:v,estimatedSize:new Blob([v]).size}}},nf=e=>{var t,i,r=()=>({url:np(e.url,"compression"),encodedBody:n_(y({},e,{compression:void 0,xt:void 0}))});try{t=n_(e)}catch(t){if(O(e.compression,sl(e.url,"compression")))return tY.error("Failed to gzip request body, sending uncompressed payload",t),r();throw t}return!(t&&O(e.compression,sl(e.url,"compression")))||((i=t.body)instanceof ArrayBuffer?M(new Uint8Array(i)):ArrayBuffer.isView(i)&&M(new Uint8Array(i.buffer,i.byteOffset,i.byteLength)))?{url:e.url,encodedBody:t}:(nd=!0,r())},nm=e=>{try{return nf(e)}catch(t){return tY.error(t),void(null==e.callback||e.callback({statusCode:0,error:t}))}},nb=(nY=b(function*(e){var t=ng(e.data),i=yield function(e,t,i){return j.apply(this,arguments)}(t,f.DEBUG,{rethrow:!0});if(!i)return e;var r=yield i.arrayBuffer();return y({},e,{xt:{contentType:nh,body:r,estimatedSize:r.byteLength}})}),function(e){return nY.apply(this,arguments)}),ny=(e,t)=>nv(e,{_:(new Date).getTime().toString(),ver:f.JS_SDK_VERSION,compression:t}),nw=[];u&&nw.push({transport:"fetch",method(e){var t,i=nm(e);if(i){var{url:r,encodedBody:s}=i,{contentType:n,body:a,estimatedSize:o}=null!=s?s:{},l=new Headers;i3(e.headers,function(e,t){l.append(t,e)}),n&&l.append("Content-Type",n);var c=null,d=!1;if(h){var p=new h;c={signal:p.signal,timeout:setTimeout(()=>{var t,i;d=!0,p.abort(((i=Error("PostHog request timed out"+((t=e.timeout)?" after "+t+"ms":""))).name="AbortError",i))},e.timeout)}}u(r,y({method:(null==e?void 0:e.method)||"GET",headers:l,keepalive:"POST"===e.method&&52428.8>(o||0),body:a,signal:null==(t=c)?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){tY.error(e)}null==e.callback||e.callback(r)}
1)).catch(t=>{d&&"AbortError"===(null==t?void 0:t.name)?tY.warn(t):tY.error(t),null==e.callback||e.callback({statusCode:0,error:t})}).finally(()=>c?clearTimeout(c.timeout):null)}}}),c&&nw.push({transport:"XHR",method(e){var t=nm(e);if(t){var i=new c,{url:r,encodedBody:s}=t;i.open(e.method||"GET",r,!0);var{contentType:n,body:a}=null!=s?s:{};i3(e.headers,function(e,t){i.setRequestHeader(t,e)}),n&&i.setRequestHeader("Content-Type",n),e.timeout&&(i.timeout=e.timeout),i.onreadystatechange=()=>{if(4===i.readyState){var t={statusCode:i.status,text:i.responseText};if(200===i.status)try{t.json=JSON.parse(i.responseText)}catch(e){}null==e.callback||e.callback(t)}},i.send(a)}}}),null!=a&&a.sendBeacon&&nw.push({transport:"sendBeacon",method(e){try{var{url:t,encodedBody:i}=nf(e),{contentType:r,body:s}=null!=i?i:{};if(!s)return;var n=s instanceof Blob?s:new Blob([s],{type:r});a.sendBeacon(t,n)}catch(e){}}});class nx{constructor(e,t){this.br=!0,this._r=[],this.wr=eg((null==t?void 0:t.flush_interval_ms)||3e3,250,5e3,tY.createLogger("flush interval"),3e3),this.kr=e}enqueue(e){this._r.push(e),this.Sr||this.Cr()}unload(){this.Ir();var e=Object.values(this._r.length>0?this.Tr():{});[...e.filter(e=>0===e.url.indexOf("/e")),...e.filter(e=>0!==e.url.indexOf("/e"))].map(e=>{this.Er(y({},e,{transport:"sendBeacon"}))})}enable(){this.br=!1,this.Cr()}Cr(){var e=this;this.br||(this.Sr=setTimeout(()=>{if(this.Ir(),this._r.length>0){var t=this.Tr();for(var i in t)!function(){var r=t[i],s=(new Date).getTime();r.data&&K(r.data)&&i3(r.data,e=>{e.offset=Math.abs(e.timestamp-s),delete e.timestamp}),e.Er(r)}()}},this.wr))}Er(e){try{this.kr(e)}catch(e){tY.error(e)}}Ir(){clearTimeout(this.Sr),this.Sr=void 0}Tr(){var e={};return i3(this._r,t=>{var i,r=(t?t.batchKey:null)||t.url;Q(e[r])&&(e[r]=y({},t,{data:[]})),null==(i=e[r].data)||i.push(t.data)}),this._r=[],e}}var nS=["retriesPerformedSoFar"];class nk{constructor(e){this.Mr=!1,this.Pr=3e3,this._r=[],this._instance=e,this._r=[],this.Rr=!0,!Q(s)&&"onLine"in s.navigator&&(this.Rr=s.navigator.onLine,this.Or=()=>{this.Rr=!0,this.Lr()},this.Fr=()=>{this.Rr=!1},re(s,"online",this.Or),re(s,"offline",this.Fr))}get length(){return this._r.length}retriableRequest(e){var{retriesPerformedSoFar:t}=e,i=w(e,nS);es(t)&&(i.url=nv(i.url,{retry_count:t})),this._instance._send_request(y({},i,{callback:e=>{if(200!==e.statusCode&&(400>e.statusCode||e.statusCode>=500)){if((0===e.statusCode?3:10)>(null!=t?t:0))return void this.st(y({retriesPerformedSoFar:t},i));0===e.statusCode&&tY.warn("Request failed before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped retrying after "+(null!=t?t:0)+" retries.")}null==i.callback||i.callback(e)}}))}st(e){var t,i,r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var s=Math.ceil((i=Math.min(18e5,t=3e3*Math.pow(2,r)))+(Math.random()-.5)*(i-t/2)),n=Date.now()+s;this._r.push({retryAt:n,requestOptions:e});var a="Enqueued failed request for retry in "+s;navigator.onLine||(a+=" (Browser is offline)"),tY.warn(a),this.Mr||(this.Mr=!0,this.Ar())}Ar(){if(this.$r&&clearTimeout(this.$r),0===this._r.length)return this.Mr=!1,void(this.$r=void 0);this.$r=setTimeout(()=>{this.Rr&&this._r.length>0&&this.Lr(),this.Ar()},this.Pr)}Lr(){var e=Date.now(),t=[],i=this._r.filter(i=>e>i.retryAt||(t.push(i),!1));if(this._r=t,i.length>0)for(var{requestOptions:r}of i)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.$r&&(clearTimeout(this.$r),this.$r=void 0),this.Mr=!1,Q(s)||(this.Or&&(s.removeEventListener("online",this.Or),this.Or=void 0),this.Fr&&(s.removeEventListener("offline",this.Fr),this.Fr=void 0)),this._r))try{this._instance._send_request(y({},e,{transport:"sendBeacon"}))}catch(e){tY.error(e)}this._r=[]}}class nE{constructor(e){this.Dr=()=>{this.Nr||(this.Nr={});var e,t,i,r,s=this.scrollElement(),n=this.scrollY(),a=s?Math.max(0,s.scrollHeight-s.clientHeight):0,o=n+((null==s?void 0:s.clientHeight)||0),l=(null==s?void 0:s.scrollHeight)||0;this.Nr.lastScrollY=Math.ceil(n),this.Nr.maxScrollY=Math.max(n,null!==(e=this.Nr.maxScrollY)&&void 0!==e?e:0),this.Nr.maxScrollHeight=Math.max(a,null!==(t=this.Nr.maxScrollHeight)&&void 0!==t?t:0),this.Nr.lastContentY=o,this.Nr.maxContentY=Math.max(o,null!==(i=this.Nr.maxContentY)&&void 0!==i?i:0),this.Nr.maxContentHeight=Math.max(l,null!==(r=this.Nr.maxContentHeight)&&void 0!==r?r:0)},this._instance=e}get qr(){return this._instance.config.scroll_root_selector}getContext(){return this.Nr}resetContext(){var e=this.Nr;return setTimeout(this.Dr,0),e}startMeasuringScrollPosition(){re(s,"scroll",this.Dr,{capture:!0}),re(s,"scrollend",this.Dr,{capture:!0}),re(s,"resize",this.Dr)}scrollElement(){if(!this.qr)return null==s?void 0:s.document.documentElement;for(var e of K(this.qr)?this.qr:[this.qr]){var t=null==s?void 0:s.document.querySelector(e);
1if(t)return t}}Br(e){if(this.qr){var t=this.scrollElement();return t&&t["y"===e?"scrollTop":"scrollLeft"]||0}return s?"y"===e?s.scrollY||s.pageYOffset||s.document.documentElement.scrollTop||0:s.scrollX||s.pageXOffset||s.document.documentElement.scrollLeft||0:0}scrollY(){return this.Br("y")}scrollX(){return this.Br("x")}}var nP=e=>sk(null==e?void 0:e.config.mask_personal_data_properties,null==e?void 0:e.config.custom_personal_data_properties,null==e?void 0:e.config.disable_capture_url_hashes);class nF{constructor(e,t,i,r){this.jr=e=>{var t=this.Hr();if(!t||t.sessionId!==e){var i={sessionId:e,props:this.Ur(this._instance)};this.zr.register({[iR]:i})}},this._instance=e,this.Vr=t,this.zr=i,this.Ur=r||nP,this.Vr.onSessionId(this.jr)}Hr(){return this.zr.props[iR]}getSetOnceProps(){var e,t=null==(e=this.Hr())?void 0:e.props;return t?"r"in t?sE(t,this._instance.config.disable_capture_url_hashes):{$referring_domain:t.referringDomain,$pathname:t.initialPathName,utm_source:t.utm_source,utm_campaign:t.utm_campaign,utm_medium:t.utm_medium,utm_content:t.utm_content,utm_term:t.utm_term}:{}}getSessionProps(){var e={};return i3(i7(this.getSetOnceProps()),(t,i)=>{"$current_url"===i&&(i="url"),e["$session_entry_"+U(i)]=t}),e}}class nT{constructor(){this.Wr={}}on(e,t){return this.Wr[e]||(this.Wr[e]=[]),this.Wr[e].push(t),()=>{this.Wr[e]=this.Wr[e].filter(e=>e!==t)}}emit(e,t){for(var i of this.Wr[e]||[])i(t);for(var r of this.Wr["*"]||[])r(e,t)}}var nC=tX("[SessionId]");class nI{on(e,t){return this.Gr.on(e,t)}constructor(e,t,i){if(this.Zr=null,this.Qr=[],this.Jr=void 0,this.Yr=!1,this.Gr=new nT,this.Kr=(e,t)=>
1!(!es(e)||!es(t))&&Math.abs(e-t)>this.sessionTimeoutMs,!e.persistence)throw Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode===iW)throw Error('SessionIdManager cannot be used with cookieless_mode="always"');this.Se=e.config,this.zr=e.persistence,this.Xr=void 0,this.ei=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.ti=t||rc,this.ri=i||rc;var r,s=this.Se.persistence_name||this.Se.token;if(this._sessionTimeoutMs=1e3*eg(this.Se.session_idle_timeout_seconds||1800,60,36e3,nC.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ii(),this.ni="ph_"+s+"_window_id",this.si="ph_"+s+"_primary_window_exists",this.oi()){var n=rw.F(this.ni),a=rw.F(this.si);n&&!a?this.Xr=n:rw.P(this.ni),rw.q(this.si,!0)}if(null!=(r=this.Se.bootstrap)&&r.sessionID)try{var o=(e=>{var t=this.Se.bootstrap.sessionID.replace(/-/g,"");if(32!==t.length)throw Error("Not a valid UUID");if("7"!==t[12])throw Error("Not a UUIDv7");return parseInt(t.substring(0,12),16)})();this.ai(this.Se.bootstrap.sessionID,(new Date).getTime(),o)}catch(e){nC.error("Invalid sessionID in bootstrap",e)}this.li()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return Q(this.Qr)&&(this.Qr=[]),this.Qr.push(e),this.ei&&e(this.ei,this.Xr),()=>{this.Qr=this.Qr.filter(t=>t!==e)}}oi(){return"memory"!==this.Se.persistence&&!this.zr.Vt&&rw.N()}ui(e){e!==this.Xr&&(this.Xr=e,this.oi()&&rw.q(this.ni,e))}hi(){return this.Xr?this.Xr:this.oi()?rw.F(this.ni):null}di(e){var t=this.Zr;return!et(t)&&!et(e)&&5e3>Math.abs(e-t)}ai(e,t,i){var r=t!==this._sessionActivityTimestamp,s=!(e!==this.ei||i!==this._sessionStartTimestamp);this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this.ei=e,s&&!r||s&&this.di(t)||(this.Zr=t,this.zr.register({[ih]:[t,e,i]}))}ci(){var e,t=null==(e=this.Se)?void 0:e.persistence_save_debounce_ms;return es(t)&&t>0}vi(){this.ci()?this.zr.refreshKey(ih):(this.zr.flush(),this.zr.load())}fi(){var e;if(!et(this._sessionActivityTimestamp)&&this._sessionActivityTimestamp!==this.Zr){this.vi();var[,t,i]=this.pi();t===this.ei&&i===this._sessionStartTimestamp&&(this.Zr=this._sessionActivityTimestamp,this.zr.register({[ih]:[this._sessionActivityTimestamp,null!==(e=this.ei)&&void 0!==e?e:null,this._sessionStartTimestamp]}),this.zr.flush())}}gi(){var[e]=this.pi();return Math.max(es(e)?e:0,es(this._sessionActivityTimestamp)?this._sessionActivityTimestamp:0)}mi(e){return this.vi(),this.Kr(e,this.gi())}pi(){var e=this.zr.props[ih];return K(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Zr=null,clearTimeout(this.yi),this.yi=void 0,this.ai(null,null,null)}destroy(){this.Yr=!0,this.fi(),clearTimeout(this.yi),this.yi=void 0,this.Jr&&s&&(s.removeEventListener(iX,this.Jr,{capture:!1}),this.Jr=void 0),this.Qr=[]}li(){this.Jr=()=>{this.fi(),this.oi()&&rw.P(this.si)},re(s,iX,this.Jr,{capture:!1})}checkAndGetSessionAndWindowId(e,t){if(void 0===e&&(e=!1),void 0===t&&(t=null),this.Se.cookieless_mode===iW)throw Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var i=t||(new Date).getTime(),[,r,s]=this.pi(),n=this.gi(),a=this.hi(),o=es(s)&&Math.abs(i-s)>864e5,l=!1,u=!1,c=!r,h=r,d=!c&&!e&&this.Kr(i,n);d&&((d=this.mi(i))||nC.info("cross-tab refresh kept the session alive",{sessionId:r}),[,r,s]=this.pi()),c||d||o?(r=this.ti(),a=this.ri(),nC.info("new session ID generated",{sessionId:r,windowId:a,changeReason:{noSessionId:c,activityTimeout:d,sessionPastMaximumLength:o}}),s=i,l=!0):(a||(a=this.ri(),l=!0),(u=r!==h)&&(nC.info("adopted cross-tab session id",{sessionId:r,windowId:a}),l=!0));var p=es(n)&&e&&!o?n:i,v=es(s)?s:(new Date).getTime();this.ui(a),this.ai(r,p,v),e||this.ii();var g={noSessionId:c,activityTimeout:d,sessionPastMaximumLength:o,crossTabAdoption:u};return l&&this.Qr.forEach(e=>e(r,a,g)),{sessionId:r,windowId:a,sessionStartTimestamp:v,changeReason:l?g:void 0,lastActivityTimestamp:n}}ii(){this.Yr||(clearTimeout(this.yi),this.yi=setTimeout(()=>{if(!this.Yr){if(this.mi((new Date).getTime())){var e=this.ei;this.resetSessionId(),this.Gr.emit("forcedIdleReset",{idleSessionId:e})}else this.ii()}},1.1*this.sessionTimeoutMs))}}var n$=function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&q(i,t))return!0;try{var r=null==e?void 0:e.userAgentData;if(null!=r&&r.brands&&r.brands.some(e=>q(null==e?void 0:e.brand,t)))return!0}catch(e){}return!!e.webdriver};function nA(){return(nA=b(function*(){var e=null==a?void 0:a.userAgentData;if(null!=e&&e.getHighEntropyValues)try{var t=yield e.getHighEntropyValues(["model"]),i=null==t?void 0:t.model;return Z(i)&&i.length>0?i:void 0}catch(e){return void tY.info("Unable to resolve $device_model from userAgentData.getHighEntropyValues",e)}})).apply(this,arguments)}var nR=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 nM(e,t,i){return ng({distinct_id:e,userPropertiesToSet:t,userPropertiesToSetOnce:i})}var nO={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=>nR(t,e))),not_regex:(e,t)=>t.every(t=>e.every(e=>!nR(t,e))),icontains:(e,t)=>t.map(nL).some(t=>e.map(nL).some(e=>t.includes(e))),not_icontains:(e,t)=>t.map(nL).every(t=>e.map(nL).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))})},nL=e=>e.toLowerCase();function nD(e,t){return!e||Object.entries(e).every(e=>{var[i,r]=e,s=null==t?void 0:t[i];if(Q(s)||et(s))return!1;var n=[String(s)],a=nO[r.operator];return!!a&&a(r.values,n)})}var nN="custom",nj="i.posthog.com",nz=/^\/static\//;class nq{constructor(e){this.bi={},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("."+nj,".posthog.com")),"https://app.posthog.com"===t?"https://us.posthog.com":t}get region(){return this.bi[this.apiHost]||(this.bi[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":nN),this.bi[this.apiHost]}wi(e){if(nz.test(e)){var t=this.instance.config.asset_host;if("string"==typeof t)return t.trim().replace(/\/$/,"")||void 0}}endpointFor(e,t){if(void 0===t&&(t=""),t&&(t="/"===t[0]?t:"/"+t),"ui"===e)return this.uiHost+t;if("flags"===e)return this.flagsApiHost+t;if("assets"===e){var i=this.wi(t);if(i)return""+i+t}if(this.region===nN)return this.apiHost+t;var r=nj+t;switch(e){case"assets":return"https://"+this.region+"-assets."+r;case"api":return"https://"+this.region+"."+r}}}var nB=tX("[Surveys]"),nH="seenSurvey_",nU=e=>{try{var t,i=(t=""+nH+e.id,e.current_iteration&&e.current_iteration>0&&(t=""+nH+e.id+"_"+e.current_iteration),t);
1if(localStorage.getItem(i))return;localStorage.setItem(i,"true")}catch(e){nB.error("Failed to persist survey seen state",e)}},nV=["popover","widget","api"],nW={ignoreConditions:!1,ignoreDelay:!1,displayType:sO.Popover},nG=tX("[PostHog ExternalIntegrations]"),nK={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class nJ{constructor(e){this._instance=e}Mt(e,t){var i;null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,e,e=>{if(e)return nG.error("failed to load script",e);t()})}startIfEnabledOrStop(){var e,t=this,i=function(e){var i,r,n;!s||null!=(i=v.__PosthogExtensions__)&&null!=(i=i.integrations)&&i[e]||t.Mt(nK[e],()=>{var i;null==(i=v.__PosthogExtensions__)||null==(i=i.integrations)||null==(i=i[e])||i.start(t._instance)}),!s&&null!=(r=v.__PosthogExtensions__)&&null!=(r=r.integrations)&&r[e]&&(null==(n=v.__PosthogExtensions__)||null==(n=n.integrations)||null==(n=n[e])||n.stop())};for(var[r,s]of Object.entries(null!==(e=this._instance.config.integrations)&&void 0!==e?e:{}))i(r)}}var nY,nX,nQ={},nZ=0,n0=()=>{},n1='Consent opt in/out is not valid with cookieless_mode="always" and will be ignored',n2="Surveys module not available",n3="sanitize_properties is deprecated. Use before_send instead",n5="Invalid value for property_denylist config: ",n6="posthog",n4=!nc&&-1===(null==p?void 0:p.indexOf("MSIE"))&&-1===(null==p?void 0:p.indexOf("Mozilla")),n8=e=>{var t;return y({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,asset_host:null,token:"",autocapture:!0,cross_subdomain_cookie:function(e){var t=null==e?void 0:e.hostname;if(!Z(t))return!1;var i=t.split(".").slice(-2).join(".");for(var r of i9)if(i===r)return!1;return!0}(null==o?void 0:o.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:n0,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:null!=e?e:"unset",__preview_deferred_init_extensions:!1,__preview_external_dependency_versioned_paths:!1,__preview_cookie_wins_on_conflict:!1,debug:l&&Z(null==l?void 0:l.search)&&-1!==l.search.indexOf("__posthog_debug=true")||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disableDeviceModel:!1,disable_external_dependency_loading:!1,strict_script_versioning:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==s||null==(t=s.location)?void 0:t.protocol),ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_feature_flags_dedup_per_session:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error(e){tY.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:iJ,before_send:void 0,get_current_url:void 0,request_queue_config:{flush_interval_ms:3e3},error_tracking:{},_onCapture:n0},{rageclick:e&&e>="2026-05-30"?{content_ignorelist:rz,ignore_text_selection:!0}
1:!e||"2025-11-30">e||{content_ignorelist:!0},capture_pageview:!e||"2025-05-24">e||"history_change",session_recording:e&&e>="2026-06-25"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6},streamNetworkBody:!0}:e&&e>="2026-05-30"?{strictMinimumDuration:!0,canvasCapture:{resolutionScale:.6}}:e&&e>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:e&&e>="2026-01-30"?"head":"body",internal_or_test_user_hostname:e&&e>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0,persistence_save_debounce_ms:e&&e>="2026-05-30"?250:0,split_storage:!(!e||"2026-05-30">e),detect_google_search_app:!(!e||"2026-05-30">e),disable_capture_url_hashes:!(!e||"2026-06-25">e)})},n7=[["process_person","person_profiles"],["xhr_headers","request_headers"],["cookie_name","persistence_name"],["disable_cookie","disable_persistence"],["__preview_disable_beacon","disable_beacon"],["store_google","save_campaign_params"],["verbose","debug"]],n9=e=>{var t={};for(var[i,r]of n7)Q(e[i])||(t[r]=e[i]);var s=i5({},t,e),n=e.__preview_external_dependency_versioned_paths;return Q(n)||(Q(e.strict_script_versioning)&&(s.strict_script_versioning=!!n),Z(n)&&Q(e.asset_host)&&(s.asset_host=n)),K(e.property_blacklist)&&(Q(e.property_denylist)?s.property_denylist=e.property_blacklist:K(e.property_denylist)?s.property_denylist=[...e.property_blacklist,...e.property_denylist]:tY.error(n5+e.property_denylist)),s};class ae{constructor(){this.__forceAllowLocalhost=!1}get xi(){return this.__forceAllowLocalhost}set xi(e){tY.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class at{ki(e,t){if(e){var i=this.Si.indexOf(e);-1!==i&&this.Si.splice(i,1)}return this.Si.push(t),null==t.initialize||t.initialize(),t}Ci(){return this.config.cookieless_mode===iW||this.config.cookieless_mode===iV&&this.consent.isRejected()}get decideEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}get flagsEndpointWasHit(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.hasLoadedFlags)&&void 0!==e&&e}constructor(){this.webPerformance=new ae,this.Ii=!1,this.version=f.LIB_VERSION,this.Ti=new nT,this.Si=[],this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=n8(),this.SentryIntegration=st,this.sentryIntegration=e=>{var t;return t=se(this,e),{name:r9,processEvent:e=>t(e)}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ei=!1,this.Mi=null,this.Pi=null,this.Ri=null,this.scrollManager=new nE(this),this.pageViewManager=new si(this),this.rateLimiter=new sj(this),this.requestRouter=new nq(this),this.consent=new rx(this),this.externalIntegrations=new nJ(this);var e,t=null!==(e=at.__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=Z(e)?{[e]:t}:e;this.setPersonProperties(r),null==i||i({})},set_once:(e,t,i)=>{var r=Z(e)?{[e]:t}:e;this.setPersonProperties(void 0,r),null==i||i({})}},this.on("eventCaptured",e=>tY.info('send "'+(null==e?void 0:e.event)+'"',e))}init(e,t,i){if(i&&i!==n6){var r,s=null!==(r=nQ[i])&&void 0!==r?r:new at;return s._init(e,t,i),nQ[i]=s,nQ[n6][i]=s,s}return this._init(e,t,i)}_init(e,t,i){void 0===t&&(t={});var r,n,a=Z(e)?e.trim():"";if(!a)return tY.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.Oi(t.debug),this.Li=t,this.Fi=[],t.person_profiles?this.Pi=t.person_profiles:t.process_person&&(this.Pi=t.process_person);var o=n8(t.defaults),l=n9(t),u=i5({},o,l,{name:i,token:a});
1Y(o.rageclick)&&Y(l.rageclick)&&(u.rageclick=i5({},o.rageclick,l.rageclick)),Y(o.session_recording)&&Y(l.session_recording)&&(u.session_recording=i5({},o.session_recording,l.session_recording)),this.set_config(u),this.config.on_xhr_error&&tY.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=t.disable_compression?void 0:sB.GZipJS;var c=this.Ai();this.persistence=new sI(this.config,c),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sI(y({},this.config,{persistence:"sessionStorage"}),c,!1);var h=y({},this.persistence.props),d=y({},this.sessionPersistence.props);this.register({$initialization_time:(new Date).toISOString()}),this.$i=new nx(e=>this.Di(e),this.config.request_queue_config),this.Ni=new nk(this),this.__request_queue=[];var p=this.Ci();if(p||(this.sessionManager=new nI(this),this.sessionPropsManager=new nF(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?(tY.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.qi(p)},0)):(tY.info("Initializing extensions synchronously"),this.qi(p)),f.DEBUG=f.DEBUG||this.config.debug,f.DEBUG&&tY.info("Starting in debug mode",{this:this,config:t,thisC:y({},this.config),p:h,s:d}),!this.config.identity_distinct_id||null!=(r=t.bootstrap)&&r.distinctID||(t.bootstrap=y({},t.bootstrap,{distinctID:this.config.identity_distinct_id,isIdentifiedID:!0})),void 0!==(null==(n=t.bootstrap)?void 0:n.distinctID)){var v=t.bootstrap.distinctID,g=this.get_distinct_id(),_=this.persistence.get_property(iA);if(t.bootstrap.isIdentifiedID&&null!=g&&g!==v&&_===iG)this.identify(v);else if(t.bootstrap.isIdentifiedID&&null!=g&&g!==v&&_===iK)tY.warn("Bootstrap distinctID differs from an already-identified user. The existing identity is preserved. Call reset() before reinitializing if you intend to switch users.");else{var m=this.config.get_device_id(rc()),b=t.bootstrap.isIdentifiedID?m:v;this.persistence.set_property(iA,t.bootstrap.isIdentifiedID?iK:iG),this.register({distinct_id:v,$device_id:b})}}if(p)this.register_once({distinct_id:iz,$device_id:null},"");else if(!this.get_distinct_id()){var w=this.config.get_device_id(rc());this.register_once({distinct_id:w,$device_id:w},""),this.persistence.set_property(iA,iG)}return re(s,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),t.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var r=i=>{var r=()=>i.anonymousId()||rc();e.config.get_device_id=r,i.id()&&(e.register({distinct_id:i.id(),$device_id:r()}),e.persistence.set_property(iA,iK)),t()},s=i.user();"then"in s&&J(s.then)?s.then(r):r(s)}(e,()=>{var r;i.register(("undefined"!=typeof Promise&&Promise.resolve||r7.warn("This browser does not have Promise support, and can not use the segment integration"),r=(t,i)=>{if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(r7.info("No userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(r7.info("UserId set, identifying with PostHog"),e.identify(t.event.userId));var r=e.calculateEventProperties(i,t.event.properties);return t.event.properties=Object.assign({},r,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:e=>r(e,e.event.event),page:e=>r(e,iQ),identify:e=>r(e,i0),screen:e=>r(e,"$screen")})).then(()=>{t()})})}(this,()=>this.Bi()):this.Bi(),J(this.config._onCapture)&&this.config._onCapture!==n0&&(tY.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",e=>this.config._onCapture(e.event,e))),this.config.ip&&tY.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this.config.disableDeviceModel||(function(){return nA.apply(this,arguments)})().then(e=>{e&&this.register({[t2]:e})}).catch(n0),this}qi(e){var t,i,r,s,n,a,o,l=performance.now(),u=y({},at.__defaultExtensionClasses,this.config.__extensionClasses),c=[];u.featureFlags&&this.Si.push(this.featureFlags=null!==(t=this.featureFlags)&&void 0!==t?t:new u.featureFlags(this)),u.exceptions&&this.Si.push(this.exceptions=null!==(i=this.exceptions)&&void 0!==i?i:new u.exceptions(this)),u.historyAutocapture&&this.Si.push(this.historyAutocapture=new u.historyAutocapture(this)),u.tracingHeaders&&this.Si.push(this.tracingHeaders=new u.tracingHeaders(this)),u.siteApps&&this.Si.push(this.siteApps=new u.
1siteApps(this)),u.sessionRecording&&!e&&this.Si.push(this.sessionRecording=new u.sessionRecording(this)),this.config.disable_scroll_properties||c.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),u.autocapture&&this.Si.push(this.autocapture=new u.autocapture(this)),u.surveys&&this.Si.push(this.surveys=null!==(r=this.surveys)&&void 0!==r?r:new u.surveys(this)),u.logs&&this.Si.push(this.logs=null!==(s=this.logs)&&void 0!==s?s:new u.logs(this)),u.conversations&&this.Si.push(this.conversations=null!==(n=this.conversations)&&void 0!==n?n:new u.conversations(this)),u.productTours&&this.Si.push(this.productTours=new u.productTours(this)),u.heatmaps&&this.Si.push(this.heatmaps=new u.heatmaps(this)),u.webVitalsAutocapture&&this.Si.push(this.webVitalsAutocapture=new u.webVitalsAutocapture(this)),u.exceptionObserver&&this.Si.push(this.exceptionObserver=new u.exceptionObserver(this)),u.deadClicksAutocapture&&this.Si.push(this.deadClicksAutocapture=new u.deadClicksAutocapture(this,r4)),u.toolbar&&this.Si.push(this.toolbar=null!==(a=this.toolbar)&&void 0!==a?a:new u.toolbar(this)),u.experiments&&this.Si.push(this.experiments=null!==(o=this.experiments)&&void 0!==o?o:new u.experiments(this)),this.Si.forEach(e=>{e.initialize&&c.push(()=>{null==e.initialize||e.initialize()})}),c.push(()=>{if(this.ji){var e=this.ji;this.ji=void 0,this.pr(e)}}),this.Hi(c,l)}Hi(e,t){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-t>=30&&e.length>0)return void setTimeout(()=>{this.Hi(e,t)},0);var i=e.shift();if(i)try{i()}catch(e){tY.error("Error initializing extension:",e)}}var r=Math.round(performance.now()-t);this.register_for_session({[iq]:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",[iB]:r}),this.config.__preview_deferred_init_extensions&&tY.info("PostHog extensions initialized ("+r+"ms)")}pr(e){var t;if(!o||!o.body)return tY.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.pr(e)},500);this.config.__preview_deferred_init_extensions&&(this.ji=e),this.Ui=e,this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=B(e.supportedCompression,sB.GZipJS)?sB.GZipJS:B(e.supportedCompression,sB.Base64)?sB.Base64:void 0),null!=(t=e.analytics)&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.Pi?this.Pi:iJ}),this.Si.forEach(t=>null==t.onRemoteConfig?void 0:t.onRemoteConfig(e))}Bi(){try{this.config.loaded(this)}catch(e){tY.critical("`loaded` function failed",e)}if(this.zi(),this.config.internal_or_test_user_hostname&&null!=l&&l.hostname){var e=l.hostname,t=this.config.internal_or_test_user_hostname;("string"==typeof t?e===t:t.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.Ci())&&this.Vi()},1),this.Wi=new sq(this),this.Wi.load()}zi(){var e;this.is_capturing()&&this.config.request_batching&&(null==(e=this.$i)||e.enable())}_dom_loaded(){this.is_capturing()&&i2(this.__request_queue,e=>this.Di(e)),this.__request_queue=[],this.zi()}_handle_unload(){var e,t,i,r;null==(e=this.surveys)||null==e.handlePageUnload||e.handlePageUnload(),this.config.request_batching?(this.Gi()&&this.capture(iZ),null==(t=this.logs)||t.flushLogs("sendBeacon"),null==(i=this.$i)||i.unload(),null==(r=this.Ni)||r.unload()):this.Gi()&&this.capture(iZ,null,{transport:"sendBeacon"})}_send_request(e){this.__loaded?n4?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)?e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:429})):(e.transport=e.transport||this.config.api_transport,e.headers=y({},this.config.request_headers,e.headers),e.compression="best-available"===e.compression?this.compression:e.compression,(Q(this.config.disable_beacon)?this.config.__preview_disable_beacon:this.config.disable_beacon)&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(e=>{var t,i,r,s=y({},e);s.timeout=s.timeout||6e4,s.url=ny(s.url,s.compression);var n=null!==(t=s.transport)&&void 0!==t?t:"fetch",a=nw.filter(e=>!s.disableTransport||!e.transport||!s.disableTransport.includes(e.transport)),o=null!==(i=null==(r=function(e,t){for(var i=0;e.length>i;i++)if(e[i].transport===n)return e[i]}(a))?void 0:r.method)&&void 0!==i?i:a[0].method;if(!o)throw Error("No available transport method");"sendBeacon"!==n&&s.data&&s.compression===sB.GZipJS&&d&&"undefined"!=typeof Promise&&!nd?nb(s).then(e=>{o(e)}).catch(t=>{if(L(t))return nd=!0,void o(y({},s,{compression:void 0,url:ny(e.url,void 0)}));(e=>{if(!e||"object"!=typeof e)return!1;var t="name"in e?String(e.name):"";return L(e)||t===R})(t)&&(nd=!0),o(s)}):o(s)})(y({},e,{callback:t=>{var i,r;this.rateLimiter.checkForLimiting(t),400>t.statusCode||null==(i=(r=this.config).on_request_error)||i.call(r,t),null==e.callback||e.callback(t)}}))):e.fireCallbackOnDrop&&(null==e.callback||e.callback({statusCode:0}))}Di(e){this.Ni?this.Ni.retriableRequest(e):this._send_request(e)}_execute_array(e){nZ++;try{var t,i=[],r=[],s=[];i2(e,e=>{if(e){if(K(t=e[0]))s.push(e);else if(J(e))try{e.call(this)}catch(t){tY.error("Error executing queued PostHog call",e,t)}else K(e)&&"alias"===t?i.push(e):K(e)&&-1!==t.indexOf("capture")&&J(this[t])?s.push(e):r.push(e)}});var n=function(e,t){i2(e,function(e){try{if(K(e[0])){var i=t;i3(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else t[e[0]].apply(t,e.slice(1))}catch(t){tY.error("Error executing queued PostHog call",e,t)}})};n(i,this),n(r,this),n(s,this)}finally{nZ--}}push(e){if(nZ>0&&K(e)&&Z(e[0])){var t=at.prototype[e[0]];J(t)&&t.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,t,i){var r,s,n,a,o;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.$i){if(this.is_capturing()){if(!Q(e)&&Z(e)){var l=!this.config.opt_out_useragent_filter&&this._is_bot();if(!l||this.config.__preview_capture_bot_pageviews){var u=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==u||!u.isRateLimited){null!=t&&t.$current_url&&!Z(null==t?void 0:t.$current_url)&&(tY.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.Zi||tY.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=th(null==i?void 0:i.uuid,rc),p={uuid:d,event:e,properties:this.calculateEventProperties(e,t||{},h,d)};e===iQ&&this.config.__preview_capture_bot_pageviews&&l&&(p.event="$bot_pageview",p.properties.$browser_type="bot"),u&&(p.properties.$lib_rate_limit_remaining_tokens=u.remainingTokens),(null==i?void 0:i.$set)&&(p.$set=null==i?void 0:i.$set);var v=null==i?void 0:i.$unset;v&&(p.$unset=v);var g,_,f,m=this.Qi(null==i?void 0:i.$set_once,e!==i1,e===i0);if(m&&(p.$set_once=m),null!=i&&i._noTruncate||(s=this.config.properties_string_max_length,n=p,a=e=>Z(e)?e.slice(0,s):e,o=new Set,p=function e(t,i){var r;return t!==Object(t)?a?a(t):t:o.has(t)?void 0:(o.add(t),K(t)?(r=[],i2(t,t=>{r.push(e(t))})):(r={},i3(t,(t,i)=>{o.has(t)||(r[i]=e(t,i))}
1)),r)}(n)),p.timestamp=h,Q(null==i?void 0:i.timestamp)||(p.properties.$event_time_override_provided=!0,p.properties.$event_time_override_system_time=c),e===sR.DISMISSED||e===sR.SENT){var b=null==t?void 0:t[sM.SURVEY_ID],w=null==t?void 0:t[sM.SURVEY_ITERATION];nU({id:b,current_iteration:w}),p.$set=y({},p.$set,{[(g={id:b,current_iteration:w},f="$survey_"+(_=e===sR.SENT?"responded":"dismissed")+"/"+g.id,g.current_iteration&&g.current_iteration>0&&(f="$survey_"+_+"/"+g.id+"/"+g.current_iteration),f)]:!0})}else e===sR.SHOWN&&(p.$set=y({},p.$set,{[sM.SURVEY_LAST_SEEN_DATE]:(new Date).toISOString()}));if(e===sL.SHOWN){var x=null==t?void 0:t[sD.TOUR_TYPE];x&&(p.$set=y({},p.$set,{[sD.TOUR_LAST_SEEN_DATE+"/"+x]:(new Date).toISOString()}))}var S=y({},p.properties.$set,p.$set);if(X(S)||this.setPersonPropertiesForFlags(S),!ei(this.config.before_send)){var k=this.it(p);if(!k)return;(p=k).uuid=th(p.uuid,rc)}this.Ti.emit("eventCaptured",p);var E={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.Di(E):this.$i.enqueue(E),p}tY.critical("This capture call is ignored due to client rate limiting.")}}else tY.error("No event name provided to posthog.capture")}}else tY.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",t=>e(t.event,t))}calculateEventProperties(e,t,i,r,n){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var a,u=n?void 0:this.persistence.remove_event_timer(e),c=y({},t);if(c.token=this.config.token,c.$config_defaults=this.config.defaults,this.Ci()&&(c.$cookieless_mode=!0),"$snapshot"===e){var h=y({},this.persistence.properties(),this.sessionPersistence.properties());return c.distinct_id=h.distinct_id,(!Z(c.distinct_id)&&!er(c.distinct_id)||ee(c.distinct_id))&&tY.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),c}var d,v=function(e,t,i,r){if(void 0===r&&(r=!1),!p)return{};var n,a,o,u,c,h,d,v,g,_,m,b,y=e?[...sv,...t||[]]:[],[w,x]=function(e){for(var t=0;tl.length>t;t++){var[i,r]=tl[t],s=i.exec(e),n=s&&(J(r)?r(s,e):r);if(n)return n}return["",""]}(p),S=null!=(c="undefined"!=typeof navigator?navigator:void 0)&&c.brave?{brave:!0}:{},k={detectGoogleSearchApp:i},E=i5(i7({$os:w,$os_version:x,$browser:tn(p,navigator.vendor,S,k),$device:tu(p),$device_type:(d={userAgentDataPlatform:null==(n=navigator)||null==(n=n.userAgentData)?void 0:n.platform,maxTouchPoints:null==(a=navigator)?void 0:a.maxTouchPoints,screenWidth:null==s||null==(o=s.screen)?void 0:o.width,screenHeight:null==s||null==(u=s.screen)?void 0:u.height,devicePixelRatio:null==s?void 0:s.devicePixelRatio},(b=tu(p))===ew||b===ey||"Kobo"===b||"Kindle Fire"===b||b===eX?eb:b===ez||b===eB||b===eq||b===eK?"Console":b===eS?"Wearable":b?ef:"Android"===(null==d?void 0:d.userAgentDataPlatform)&&(null!==(v=null==d?void 0:d.maxTouchPoints)&&void 0!==v?v:0)>0?600>Math.min(null!==(g=null==d?void 0:d.screenWidth)&&void 0!==g?g:0,null!==(_=null==d?void 0:d.screenHeight)&&void 0!==_?_:0)/(null!==(m=null==d?void 0:d.devicePixelRatio)&&void 0!==m?m:1)?ef:eb:"Desktop"),$timezone:sP(),$timezone_offset:function(){try{return(new Date).getTimezoneOffset()}catch(e){return}}()}),{$current_url:su(r?td(null==l?void 0:l.href):null==l?void 0:l.href,y,s_),$host:null==l?void 0:l.host,$pathname:null==l?void 0:l.pathname,$raw_user_agent:p.length>1e3?p.substring(0,997)+"...":p,$browser_version:to(p,navigator.vendor,S,k),$browser_language:sw(),$browser_language_prefix:"string"==typeof(h=sw())?h.split("-")[0]:void 0,$screen_height:null==s?void 0:s.screen.height,$screen_width:null==s?void 0:s.screen.width,$viewport_height:null==s?void 0:s.innerHeight,$viewport_width:null==s?void 0:s.innerWidth,$lib:f.LIB_NAME,$lib_version:f.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3});return f.SDK_DIST_CHANNEL&&(E.$sdk_dist_channel=f.SDK_DIST_CHANNEL),E}(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties,this.config.detect_google_search_app,this.config.disable_capture_url_hashes
1);if(this.sessionManager){var{sessionId:g,windowId:_}=this.sessionManager.checkAndGetSessionAndWindowId(n,i.getTime());c.$session_id=g,c.$window_id=_}this.sessionPropsManager&&i5(c,this.sessionPropsManager.getSessionProps());try{this.sessionRecording&&i5(c,this.sessionRecording.sdkDebugProperties),c.$sdk_debug_retry_queue_size=null==(a=this.Ni)?void 0:a.length}catch(e){c.$sdk_debug_error_capturing_properties=String(e)}if(this.requestRouter.region===nN&&(c.$lib_custom_api_host=this.config.api_host),d=e!==iQ||n?e!==iZ||n?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(i):this.pageViewManager.doPageView(i,r),c=i5(c,d),e===iQ&&o&&(c.title=o.title),!Q(u)){var m=i.getTime()-u;c.$duration=parseFloat((m/1e3).toFixed(3))}p&&this.config.opt_out_useragent_filter&&(c.$browser_type=this._is_bot()?"bot":"browser"),(c=i5({},v,this.persistence.properties(),this.sessionPersistence.properties(),c)).$is_identified=this._isIdentified(),K(this.config.property_denylist)?i3(this.config.property_denylist,function(e){delete c[e]}):tY.error(n5+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var b=this.config.sanitize_properties;b&&(tY.error(n3),c=b(c,e));var w=this.Ji();return c.$process_person_profile=w,w&&!n&&this.Yi("_calculate_event_properties"),c}Qi(e,t,i){if(void 0===t&&(t=!0),void 0===i&&(i=!1),!this.persistence||!this.Ji()||this.Ii&&!i)return e;var r,s=i5({},this.persistence.get_initial_props(),(null==(r=this.sessionPropsManager)?void 0:r.getSetOnceProps())||{},e||{}),n=this.config.sanitize_properties;return n&&(tY.error(n3),s=n(s,"$set_once")),t&&(this.Ii=!0),X(s)?void 0:s}register(e,t){var i;null==(i=this.persistence)||i.register(e,t)}register_once(e,t,i){var r;null==(r=this.persistence)||r.register_once(e,t,i)}register_for_session(e){var t;null==(t=this.sessionPersistence)||t.register(e)}unregister(e){var t;null==(t=this.persistence)||t.unregister(e)}unregister_for_session(e){var t;null==(t=this.sessionPersistence)||t.unregister(e)}Ki(e,t){this.register({[e]:t})}getFeatureFlag(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlag(e,t)}getFeatureFlagPayload(e){var t;return null==(t=this.featureFlags)?void 0:t.getFeatureFlagPayload(e)}getFeatureFlagResult(e,t){var i;return null==(i=this.featureFlags)?void 0:i.getFeatureFlagResult(e,t)}getAllFeatureFlags(){var e,t;return null!==(e=null==(t=this.featureFlags)?void 0:t.getAllFeatureFlags())&&void 0!==e?e:[]}isFeatureEnabled(e,t){var i;return null==(i=this.featureFlags)?void 0:i.isFeatureEnabled(e,t)}reloadFeatureFlags(){var e;null==(e=this.featureFlags)||e.reloadFeatureFlags()}updateFlags(e,t,i){var 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.Ti.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:n2}),()=>{})}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:n2})}getActiveMatchingSurveys(e,t){void 0===t&&(t=!1),this.surveys?this.surveys.getActiveMatchingSurveys(e,t):e([],{isLoaded:!1,error:n2})}renderSurvey(e,t){var i;null==(i=this.surveys)||i.renderSurvey(e,t)}displaySurvey(e,t){var i;void 0===t&&(t=nW),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:n2}}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:n2})}Xi(e){return!e||ee(e)?(tY.critical("Unique user id has not been set in posthog.identify"),!1):e===iz?(tY.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())||(tY.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 tY.uninitializedWarning("posthog.identify");if(er(e)&&(e=e.toString(),tY.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),this.Xi(e)&&this.Yi("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property(t1)||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(t3)&&(this.unregister(t3),this.register({distinct_id:e}));var s,n=(this.persistence.get_property(iA)||iG)===iG;e!==r&&n?(this.persistence.set_property(iA,iK),this.setPersonPropertiesForFlags({$set:t||{},$set_once:i||{}},!1),this.capture(i0,{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:i||{}}),this.Ri=nM(e,t,i),null==(s=this.featureFlags)||s.setAnonymousDistinctId(r)):(t||i)&&this.setPersonProperties(t,i),e!==r&&(this.reloadFeatureFlags(),this.unregister(iT))}}setPersonProperties(e,t){if((e||t)&&this.Yi("posthog.setPersonProperties")){var i=nM(this.get_distinct_id(),e,t);this.Ri!==i?(this.setPersonPropertiesForFlags({$set:e||{},$set_once:t||{}},!0),this.capture("$set",{$set:e||{},$set_once:t||{}}),this.Ri=i):tY.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}unsetPersonProperties(e){var t,i=(K(e)?e:[e]).filter(e=>Z(e)&&e.length>0);0!==i.length&&this.Yi("posthog.unsetPersonProperties")&&(null==(t=this.featureFlags)||t.unsetPersonPropertiesForFlags(i,!0),this.capture("$set",{$unset:i}),this.Ri=null)}group(e,t,i){if(e&&t){var r=this.getGroups(),s=r[e]!==t;if(s&&this.resetGroupPropertiesForFlags(e),this.register({$groups:y({},r,{[e]:t})}),s||i){var n={$group_type:e,$group_key:t};i&&(n.$group_set=i),this.capture(i1,n)}i&&this.setGroupPropertiesForFlags({[e]:i}),s&&!i&&this.reloadFeatureFlags()}else tY.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),null==(i=this.featureFlags)||i.setPersonPropertiesForFlags(e,t)}resetPersonPropertiesForFlags(e){var t;void 0===e&&(e=!0),null==(t=this.featureFlags)||t.resetPersonPropertiesForFlags(e)}setGroupPropertiesForFlags(e,t){var i;void 0===t&&(t=!0),this.Yi("posthog.setGroupPropertiesForFlags")&&(null==(i=this.featureFlags)||i.setGroupPropertiesForFlags(e,t))}resetGroupPropertiesForFlags(e){var t;null==(t=this.featureFlags)||t.resetGroupPropertiesForFlags(e)}reset(e){if(tY.info("reset"),!this.__loaded)return tY.uninitializedWarning("posthog.reset");var t,i,r,s,n,a,o,l,u,c,h=this.get_property(t1),d=this.get_property(t2),p=this.get_property(is);if(this.consent.reset(),null==(t=this.persistence)||t.clear(),null==(i=this.sessionPersistence)||i.clear(),Q(p)||null==(c=this.persistence)||c.register({[is]:p}),null==(r=this.surveys)||r.reset(),null==(s=this.Wi)||s.stop(),null==(n=this.featureFlags)||n.reset(),null==(a=this.conversations)||a.reset(),null==(o=this.logs)||o.reset(),null==(l=this.persistence)||l.set_property(iA,iG),null==(u=this.sessionManager)||u.resetSessionId(),this.Ri=null,this.config.cookieless_mode===iW)this.register_once({distinct_id:iz,$device_id:null},"");else{var v=this.config.get_device_id(rc());this.register_once({distinct_id:v,$device_id:e?v:h},""),e||Q(d)||this.register({[t2]:d})}this.register({$last_posthog_reset:(new Date).toISOString()},1),delete this.config.identity_distinct_id,delete this.config.identity_hash,this.reloadFeatureFlags()}shutdown(e){var t=this;return b(function*(){var e,i,r,s;t.__loaded?(null==(e=t.logs)||e.flushLogs("sendBeacon"),null==(i=t.$i)||i.unload(),null==(r=t.Ni)||r.unload(),null==(s=t.featureFlags)||s.destroy()):tY.uninitializedWarning("posthog.shutdown")})()}setIdentity(e,t){var i;this.config.identity_distinct_id=e,this.config.identity_hash=t,this.alias(e),null==(i=this.conversations)||i.en()}clearIdentity(){var e;delete this.config.identity_distinct_id,delete this.config.identity_hash,null==(e=this.conversations)||e.tn()}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(t0)?(tY.critical("Attempting to create alias for existing People user - aborting."),-2):this.Yi("posthog.alias")?(Q(t)&&(t=this.get_distinct_id()),e!==t?(this.Ki(t3,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(tY.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var t=y({},this.config);if(Y(e)){i5(this.config,n9(e));var i,r,s,n,a,o,l,u,c,h,d,p=this.Ai();null==(i=this.persistence)||i.update_config(this.config,t,p),this.sessionPersistence="sessionStorage"===this.config.persistence||"memory"===this.config.persistence?this.persistence:new sI(y({},this.config,{persistence:"sessionStorage"}),p,!1);var v=this.Oi(this.config.debug);en(v)&&(this.config.debug=v),en(this.config.debug)&&(this.config.debug?(f.DEBUG=!0,r_.N()&&r_.q("ph_debug",!0),tY.info("set_config",{config:e,oldConfig:t,newConfig:y({},this.config)})):(f.DEBUG=!1,r_.N()&&r_.P("ph_debug"))),null==(r=this.exceptionObserver)||r.onConfigChange(),null==(s=this.exceptions)||s.onConfigChange(),null==(n=this.sessionRecording)||n.startIfEnabledOrStop(),null==(a=this.tracingHeaders)||a.startIfEnabledOrStop(),null==(o=this.autocapture)||o.startIfEnabled(),null==(l=this.heatmaps)||l.startIfEnabled(),null==(u=this.exceptionObserver)||u.startIfEnabledOrStop(),null==(c=this.deadClicksAutocapture)||
1c.startIfEnabledOrStop(),null==(h=this.surveys)||h.loadIfEnabled(),this.rn(),null==(d=this.externalIntegrations)||d.startIfEnabledOrStop()}}_overrideSDKInfo(e,t){f.LIB_NAME=e,f.LIB_VERSION=t}startSessionRecording(e){var t,i,r,s,n,a=!0===e,o={sampling:a||!(null==e||!e.sampling),linked_flag:a||!(null==e||!e.linked_flag),url_trigger:a||!(null==e||!e.url_trigger),event_trigger:a||!(null==e||!e.event_trigger)};Object.values(o).some(Boolean)&&(null==(t=this.sessionManager)||t.checkAndGetSessionAndWindowId(),o.sampling&&(null==(i=this.sessionRecording)||i.overrideSampling()),o.linked_flag&&(null==(r=this.sessionRecording)||r.overrideLinkedFlag()),o.url_trigger&&(null==(s=this.sessionRecording)||s.overrideTrigger("url")),o.event_trigger&&(null==(n=this.sessionRecording)||n.overrideTrigger("event"))),this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!(null==(e=this.sessionRecording)||!e.started)}captureException(e,t){if(this.exceptions){var i=Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:i});return this.exceptions.sendExceptionEvent(y({},r,t))}}addExceptionStep(e,t){var i;null==(i=this.exceptions)||i.addExceptionStep(e,t)}captureLog(e){var t;null==(t=this.logs)||t.captureLog(e)}get logger(){var e,t;return null!==(e=null==(t=this.logs)?void 0:t.logger)&&void 0!==e?e:at.nn}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:n6;return t!==n6&&(t=n6+"."+t),t}_isIdentified(){var e,t;return(null==(e=this.persistence)?void 0:e.get_property(iA))===iK||(null==(t=this.sessionPersistence)?void 0:t.get_property(iA))===iK}Ji(){var e,t;return!("never"===this.config.person_profiles||this.config.person_profiles===iJ&&!this._isIdentified()&&X(this.getGroups())&&(null==(e=this.persistence)||null==(e=e.props)||!e[t3])&&(null==(t=this.persistence)||null==(t=t.props)||!t[iN]))}Gi(){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.Ji()||this.Yi("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.Yi("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}Yi(e){return"never"===this.config.person_profiles?(tY.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.Ki(iN,!0),!0)}Ai(){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!==iV)}rn(){var e,t,i,r,s=this.Ai();return(null==(e=this.persistence)?void 0:e.Vt)!==s&&(null==(i=this.persistence)||i.set_disabled(s)),(null==(t=this.sessionPersistence)?void 0:t.Vt)!==s&&(null==(r=this.sessionPersistence)||r.set_disabled(s)),s}opt_in_capturing(e){var t;if(this.config.cookieless_mode!==iW){if(this.Ci()){this.reset(!0),null==(s=this.sessionManager)||s.destroy(),null==(n=this.pageViewManager)||n.destroy(),this.sessionManager=new nI(this),this.pageViewManager=new si(this),this.persistence&&(this.sessionPropsManager=new nF(this,this.sessionManager,this.persistence));var i,r,s,n,a,o,l,u,c=null!==(a=null==(o=this.config.__extensionClasses)?void 0:o.sessionRecording)&&void 0!==a?a:null==(l=at.__defaultExtensionClasses)?void 0:l.sessionRecording;c&&(this.sessionRecording=this.ki(this.sessionRecording,new c(this)),this.Ui&&(null==(u=this.sessionRecording)||null==u.onRemoteConfig||u.onRemoteConfig(this.Ui)))}this.consent.optInOut(!0),this.rn(),this.zi(),null==(t=this.sessionRecording)||t.startIfEnabledOrStop(),this.config.cookieless_mode==iV&&(null==(i=this.surveys)||i.loadIfEnabled()),(Q(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(r=null==e?void 0:e.captureEventName)&&void 0!==r?r:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.Vi()}else tY.warn(n1)}opt_out_capturing(){var e,t,i;this.config.cookieless_mode!==iW?(this.config.cookieless_mode===iV&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.rn(),this.config.cookieless_mode===iV&&(this.register({distinct_id:iz,$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.config.capture_pageview&&this.Vi(),this.zi())):tY.warn(n1)}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===iW||(this.config.cookieless_mode===iV?this.consent.isRejected()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.rn()}_is_bot(){return a?n$(a,this.config.custom_blocked_useragents):void 0}Vi(){o&&("visible"===o.visibilityState?this.Ei||(this.Ei=!0,this.capture(iQ,{title:o.title},{send_instantly:!0}),this.Mi&&(o.removeEventListener(iY,this.Mi),this.Mi=null)):this.Mi||(this.Mi=this.Vi.bind(this),re(o,iY,this.Mi)))}debug(e){!1===e?(null==s||s.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(null==s||s.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}mr(){var e,t,i,r,s=this.Li||{};return"advanced_disable_flags"in s?!!s.advanced_disable_flags:!1!==this.config.advanced_disable_flags?!!this.config.advanced_disable_flags:!0===this.config.advanced_disable_decide?(tY.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(t="advanced_disable_decide",i=(e="advanced_disable_flags")in s&&!ei(s[e]),r=t in s&&!ei(s[t]),i?s[e]:!!r&&(tY&&tY.warn("Config field '"+t+"' is deprecated. Please use '"+e+"' instead. The old field will be removed in a future major version."),s[t]))}it(e){if(ei(this.config.before_send))return e;var t,i=Object.keys(null!==(t=e.properties)&&void 0!==t?t:{}).filter(el),r=K(this.config.before_send)?this.config.before_send:[this.config.before_send],s=e;for(var n of r){if(ei(s=n(s))){var a="Event '"+e.event+"' was rejected in beforeSend function";return eo(e.event)?tY.warn(a+". This can cause unexpected behavior."):tY.info(a),null}s.properties&&!X(s.properties)||tY.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}for(var o of i)if(s.properties&&ei(s.properties[o]))return tY.warn("Event '"+e.event+"' had its '"+o+"' property removed in a beforeSend function. This property is required for ingestion, so the event will be dropped."),null;return s}getPageViewId(){var e;return null==(e=this.pageViewManager.Ot)?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)})}Oi(e){var t=en(e)&&!e,i=r_.N()&&"true"===r_.A("ph_debug");return!t&&(!!i||e)}}at.__defaultExtensionClasses={},at.nn={trace:nX=()=>{},debug:nX,info:nX,warn:nX,error:nX,fatal:nX},function(e,t){for(var i=0;t.length>i;i++)e.prototype[t[i]]=i8(e.prototype[t[i]])}(at,["identify"]);class ai{constructor(e){this.disabled=!1===e;var t=Y(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 ar="$copy_autocapture",as=tX("[AutoCapture]");function an(e,t){return t.length>e?t.slice(0,e)+"...":t}var aa=tX("[ExceptionAutocapture]"),ao=tX("[TracingHeaders]"),al=tX("[Web Vitals]"),au="disabled",ac="lazy_loading",ah="awaiting_config",ad="missing_config";tX("[SessionRecording]"),tX("[SessionRecording]");var ap="[SessionRecording]",av=tX(ap),ag=tX("[Heatmaps]");function a_(e){return Y(e)&&"clientX"in e&&"clientY"in e&&er(e.clientX)&&er(e.clientY)}var af=tX("[Product Tours]"),am=e=>{var t;return!e.config.disable_product_tours&&!(null==(t=e.persistence)||!t.get_property(ii))},ab=["$set_once","$set"],ay=tX("[SiteApps]"),aw="Error while initializing PostHog app with config id ";function ax(e,t,i){if(ei(e))return!1;switch(i){case"exact":return e===t;case"contains":return RegExp(t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*"),"i").test(e);case"regex":try{return new RegExp(t).test(e)}catch(e){return!1}default:return!1}}class aS{constructor(e){this.sn=new nT,this.an=(e,t)=>this.ln(e,t)&&this.un(e,t)&&this.hn(e,t)&&this.dn(e,t),this.ln=(e,t)=>null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event),this._instance=e,this.cn=new Set,this.vn=new Set}init(){var e,t;Q(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(!Q(null==(t=this._instance)?void 0:t._addCaptureHook)&&(e.forEach(e
vendor: 4,675 bytes, line 1
1=>{var t,i;null==(t=this.vn)||t.add(e),null==(i=e.steps)||i.forEach(e=>{var t;null==(t=this.cn)||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.cn.has(e)||this.cn.has(null==t?void 0:t.event))&&this.vn&&(null==(i=this.vn)?void 0:i.size)>0&&this.vn.forEach(e=>{this.fn(t,e)&&this.sn.emit("actionCaptured",e.name)})}pn(e){this.onAction("actionCaptured",t=>e(t))}fn(e,t){if(null==(null==t?void 0:t.steps))return!1;for(var i of t.steps)if(this.an(e,i))return!0;return!1}onAction(e,t){return this.sn.on(e,t)}un(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||!ax(r,t.url,t.url_matching||"contains"))return!1}return!0}hn(e,t){return!!this.gn(e,t)&&!!this.mn(e,t)&&!!this.yn(e,t)}gn(e,t){if(null==t||!t.href)return!0;var i=this.bn(e);if(i.length>0)return i.some(e=>ax(e.href,t.href,t.href_matching||"exact"));var r,s,n=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!n&&ax((s=n.match(/(?::|")href="(.*?)"/))?s[1]:"",t.href,t.href_matching||"exact")}mn(e,t){if(null==t||!t.text)return!0;var i=this.bn(e);if(i.length>0)return i.some(e=>ax(e.text,t.text,t.text_matching||"exact")||ax(e.$el_text,t.text,t.text_matching||"exact"));var r,s,n,a,o=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";return!!o&&(s=function(e){for(var t,i=[],r=/(?::|")text="(.*?)"/g;!ei(t=r.exec(e));)i.includes(t[1])||i.push(t[1]);return i}(o),n=t.text,a=t.text_matching||"exact",s.some(e=>ax(e,n,a)))}yn(e,t){if(null==t||!t.selector)return!0;var i,r,s=null==e||null==(i=e.properties)?void 0:i.$element_selectors;if(null!=s&&s.includes(t.selector))return!0;var n=(null==e||null==(r=e.properties)?void 0:r.$elements_chain)||"";if(t.selector_regex&&n)try{return new RegExp(t.selector_regex).test(n)}catch(e){}return!1}bn(e){var t;return null==(null==e||null==(t=e.properties)?void 0:t.$elements)?[]:null==e?void 0:e.properties.$elements}dn(e,t){return null==t||!t.properties||0===t.properties.length||nD(t.properties.reduce((e,t)=>{var i=K(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 ak{constructor(e){this._n=[],this._instance=e,this.wn=new Map,this.xn=new Map,this.kn=new Map}Sn(e,t){return!!e&&nD(e.propertyFilters,null==t?void 0:t.properties)}Cn(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}In(e,t,i){var r=(i===s$.Activation?this.wn:this.xn).get(e),s=[];return this.Tn(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.Sn(n,t)})}register(e){var t;Q(null==(t=this._instance)?void 0:t._addCaptureHook)||(this.En(e),this.Mn(e))}Mn(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.Pn&&(this.Pn=new aS(this._instance),this.Pn.init(),this.Pn.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.Pn)||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.kn.get(t.name);i&&i.push(e.id),this.kn.set(t.name,i||[e.id])}}))}))}En(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.wn=this.Cn(e,s$.Activation),this.xn=this.Cn(e,s$.Cancellation))}onEvent(e,t){var i,r,s=this.Rn(),n=(null==t||null==(i=t.properties)?void 0:i.$survey_id)||(null==t||null==(r=t.properties)?void 0:r.$product_tour_id);if(n&&this.getActivatedIds().includes(n)){var a=this.On(e,n);if("consume"===a)return s.info("event consumed activated item, remov
1ing it",{event:e,itemId:n}),void this.Ln([n]);if("persist"===a)return s.info("shown item promoted to persisted activation",{event:e,itemId:n}),void this.Fn(n)}if(this.xn.has(e)){var o=this.In(e,t,s$.Cancellation);o.length>0&&(s.info("cancel event matched, cancelling items",{event:e,itemsToCancel:o.map(e=>e.id)}),this.Ln(o.map(e=>e.id)),o.forEach(e=>this.An(e.id)))}if(this.wn.has(e)){s.info("event name matched",{event:e,eventPayload:t,items:this.wn.get(e)});var l=this.In(e,t,s$.Activation);this.$n(l.map(e=>e.id))}}onAction(e){this.kn.has(e)&&this.$n(this.kn.get(e)||[])}$n(e){0!==e.length&&(this._n=[...new Set([...this._n,...e])],this.Rn().info("updating activated items",{activatedItems:this.getActivatedIds()}))}Fn(e){this._n=this._n.filter(t=>t!==e);var t=this.Dn();t.includes(e)||this.Nn([...t,e])}Ln(e){var t=new Set(e);this._n=this._n.filter(e=>!t.has(e));var i=this.Dn(),r=i.filter(e=>!t.has(e));r.length!==i.length&&this.Nn(r)}Dn(){var e,t=this.qn();return(null==(e=this._instance)||null==(e=e.persistence)?void 0:e.props[t])||[]}getActivatedIds(){return[...new Set([...this.Dn(),...this._n])].filter(e=>!this.Bn(e))}reset(){this._n=[],this.Dn().length>0&&this.Nn([])}getEventToItemsMap(){return this.wn}jn(){return this.Pn}}class aE extends ak{constructor(e){super(e)}qn(){return iP}Hn(){return sR.SHOWN}Tn(e){var t;null==(t=this._instance)||t.getSurveys(e)}An(e){var t;null==(t=this._instance)||t.cancelPendingSurvey(e)}Rn(){return nB}Nn(e){var t;null==(t=this._instance)||null==(t=t.persistence)||t.register({[iP]:e})}Bn(){return!1}On(e,t){var i,r,s,n,a,o;return this.Tn(e=>{o=e.find(e=>e.id===t)}),!o||(a=(null!==(r=null==(s=(i=o).conditions)||null==(s=s.events)||null==(s=s.values)?void 0:s.length)&&void 0!==r?r:0)>0,i.schedule===sA.Always||null!=(n=i.conditions)&&null!=(n=n.events)&&n.repeatedActivation&&a)?e===sR.SHOWN?"consume":"ignore":e===sR.SHOWN?"persist":e===sR.DISMISSED||e===sR.SENT?"consume":"ignore"}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}var aP="SDK is not enabled or survey functionality is not yet loaded",aF="Disabled. Not loading surveys.",aT=null!=s&&s.location?sc(s.location.hash,"__posthog")||sc(location.hash,"state"):null,aC="_postHogToolbarParams",aI=tX("[Toolbar]"),a$=tX("[FeatureFlags]"),aA=tX("[FeatureFlags]",{debugEnabled:!0}),aR="\" failed. Feature flags didn't load in time.",aM=e=>{for(var t={},i=0;e.length>i;i++)t[e[i]]=!0;return t},aO=e=>{var t={};for(var[i,r]of i6(e||{}))r&&(t[i]=r);return t},aL=tX("[Error tracking]"),aD="Refusing to render web experiment since the viewer is a likely bot",aN={icontains:(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())>-1,not_icontains:(e,t)=>-1===t.toLowerCase().indexOf(e.toLowerCase()),regex:(e,t)=>nR(t,e),not_regex:(e,t)=>!nR(t,e),exact:(e,t)=>t===e,is_not:(e,t)=>t!==e};class aj{get Se(){return this._instance.config}constructor(e){var t=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(e){void 0===e&&(e=!1),t.getWebExperiments(e=>{aj.Un("retrieved web experiments from the server"),t.zn=new Map,e.forEach(e=>{if(e.feature_flag_key){t.zn&&(aj.Un("setting flag key ",e.feature_flag_key," to web experiment ",e),null==(i=t.zn)||i.set(e.feature_flag_key,e));var i,r=t._instance.getFeatureFlag(e.feature_flag_key);Z(r)&&e.variants[r]&&t.Vn(e.name,r,e.variants[r].transforms)}else if(e.variants)for(var s in e.variants){var n=e.variants[s];aj.Wn(n,t._instance)&&t.Vn(e.name,s,n.transforms)}})},e)},this._instance=e,this._instance.onFeatureFlags(e=>{this.onFeatureFlags(e)})}initialize(){}onFeatureFlags(e){if(this._is_bot())aj.Un(aD);else if(!this.Se.disable_web_experiments){if(ei(this.zn))return this.zn=new Map,this.loadIfEnabled(),void this.previewWebExperiment();aj.Un("applying feature flags",e),e.forEach(e=>{var t;if(this.zn&&null!=(t=this.zn)&&t.has(e)){var i,r=this._instance.getFeatureFlag(e),s=null==(i=this.zn)?void 0:i.get(e);r&&null!=s&&s.variants[r]&&this.Vn(s.name,r,s.variants[r].transforms)}})}}previewWebExperiment(){var e=aj.getWindowLocation();if(null!=e&&e.search){var t=sl(null==e?void 0:e.search,"__experiment_id"),i=sl(null==e?void 0:e.search,"__experiment_variant");t&&i&&(aj.Un("previewing web experiments "+t+" && "+i),this.getWebExperiments(e=>{this.Gn(parseInt(t),i,e)},!1,!0))}}loadIfEnabled(){this.Se.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,t,i){if(this.Se.disable_web_experiments&&!i)return e([]);var 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.Se.token),method:"GET",callback:t=>e(200===t.statusCode&&t.json&&t.json.experiments||[])})}Gn(e,t,i){var r=i.filter(t=>t.id===e);r&&r.length>0&&(aj.Un("Previewing web experiment ["+r[0].name+"] with variant ["+t+"]"),this.Vn(r[0].name,t,r[0].variants[t].transforms))}static Wn(e,t){return!ei(e.conditions)&&aj.Zn(e,t)&&aj.Qn(e)}static Zn(e,t){if(ei(e.conditions)||ei(null==(r=e.conditions)?void 0:r.url))return!0;var i=aj.getWindowLocation();if(i){var r,s,n,a,o=rS(t,i.href);return null==(s=e.conditions)||!s.url||aN[null!==(n=null==(a=e.conditions)?void 0:a.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url,o)}return!1}
1static getWindowLocation(){return null==s?void 0:s.location}static Qn(e){if(ei(e.conditions)||ei(null==(i=e.conditions)?void 0:i.utm))return!0;var t=sm();if(t.utm_source){var i,r,s,n,a,o,l,u,c,h=null==(r=e.conditions)||null==(r=r.utm)||!r.utm_campaign||(null==(s=e.conditions)||null==(s=s.utm)?void 0:s.utm_campaign)==t.utm_campaign,d=null==(n=e.conditions)||null==(n=n.utm)||!n.utm_source||(null==(a=e.conditions)||null==(a=a.utm)?void 0:a.utm_source)==t.utm_source,p=null==(o=e.conditions)||null==(o=o.utm)||!o.utm_medium||(null==(l=e.conditions)||null==(l=l.utm)?void 0:l.utm_medium)==t.utm_medium,v=null==(u=e.conditions)||null==(u=u.utm)||!u.utm_term||(null==(c=e.conditions)||null==(c=c.utm)?void 0:c.utm_term)==t.utm_term;return h&&p&&v&&d}return!1}static Un(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];tY.info("[WebExperiments] "+e,i)}Vn(e,t,i){this._is_bot()?aj.Un(aD):"control"!==t?i.forEach(i=>{if(i.selector){aj.Un("applying transform of variant "+t+" for experiment "+e+" ",i);var r,s=null==(r=document)?void 0:r.querySelectorAll(i.selector);null==s||s.forEach(e=>{i.html&&(e.innerHTML=i.html),i.css&&e.setAttribute("style",i.css)})}}):aj.Un("Control variants leave the page unmodified.")}_is_bot(){return a&&this._instance?n$(a,this.Se.custom_blocked_useragents):void 0}}var az=tX("[Conversations]"),aq="Conversations not available yet.",aB="console",aH={featureFlags:class{constructor(e){this.Jn=!1,this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.rs=!1,this.ns=!1,this.ss=0,this.os=()=>{var e=this.ls();this.ss=0,e&&this.reloadFeatureFlags()},this._instance=e,this.featureFlagEventHandlers=[],s&&re(s,"online",this.os)}destroy(){null==s||s.removeEventListener("online",this.os)}get Se(){return this._instance.config}get zr(){return this._instance.persistence}us(e){return this._instance.get_property(e)}hs(){var e,t;return null!==(e=null==(t=this.zr)?void 0:t.Gt(this.Se.feature_flag_cache_ttl_ms))&&void 0!==e&&e}ds(){return!!this.hs()&&(this.ns||this.Kn||(this.ns=!0,a$.warn("Feature flag cache is stale, triggering refresh..."),this.reloadFeatureFlags()),!0)}cs(){var e,t=null!==(e=this.Se.evaluation_contexts)&&void 0!==e?e:this.Se.evaluation_environments;return!this.Se.evaluation_environments||this.Se.evaluation_contexts||this.rs||(a$.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.rs=!0),null!=t&&t.length?t.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||a$.error("Invalid evaluation context found:",e,"Expected non-empty string"),t}):[]}vs(){return this.cs().length>0}fs(){var e=this.Se.flag_keys;if(!Q(e)){if(K(e))return e.filter(e=>{var t=e&&"string"==typeof e&&e.trim().length>0;return t||a$.error("Invalid flag key found:",e,"Expected non-empty string"),t});a$.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,a=null!==(s=null==(n=i.bootstrap)?void 0:n.featureFlagPayloads)&&void 0!==s?s:{},o=Object.keys(r).filter(e=>!!r[e]).reduce((e,t)=>(e[t]=r[t]||!1,e),{}),l=Object.keys(a).filter(e=>o[e]).reduce((e,t)=>(a[t]&&(e[t]=a[t]),e),{});this.receivedFeatureFlags({featureFlags:o,featureFlagPayloads:l})}}updateFlags(e,t,i){var r,s,n=null!=i&&i.merge&&null!==(r=this.us(ip))&&void 0!==r?r:{},a=null!=i&&i.merge&&null!==(s=this.us(im))&&void 0!==s?s:{},o=y({},n,e),l=y({},a,t),u={};for(var[c,h]of Object.entries(o))u[c]={key:c,enabled:S(h),variant:k(h),reason:void 0,metadata:Q(null==l?void 0:l[c])?void 0:{id:0,version:void 0,description:void 0,payload:l[c]}};this.receivedFeatureFlags({flags:u})}get hasLoadedFlags(){return this.Yn}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this.us(i_),t=this.us(iy),i=this.us(iw);if(!i&&!t)return e||{};var r=i5({},e||{});for(var s of[...new Set([...Object.keys(i||{}),...Object.keys(t||{})])]){var n,a,o=r[s],l=null==t?void 0:t[s],u=Q(l)?null!==(n=null==o?void 0:o.enabled)&&void 0!==n&&n:!!l,c=Q(l)?o.variant:"string"==typeof l?l:void 0,h=null==i?void 0:i[s],d=y({},o,{enabled:u,variant:u?null!=c?c:null==o?void 0:o.variant:void 0});u!==(null==o?void 0:o.enabled)&&(d.original_enabled=null==o?void 0:o.enabled),c!==(null==o?void 0:o.variant)&&(
1d.original_variant=null==o?void 0:o.variant),h&&(d.metadata=y({},null==o?void 0:o.metadata,{payload:h,original_payload:null==o||null==(a=o.metadata)?void 0:a.payload})),r[s]=d}return this.Jn||(a$.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:i,finalDetails:r}),this.Jn=!0),r}getAllFeatureFlags(){var e=this.getFlagVariants(),t=this.getFlagPayloads();return Object.keys(e).map(i=>{var r=e[i];return{key:i,enabled:S(r),variant:k(r),payload:x(t[i])}})}getFlagVariants(){var e=this.us(ip),t=this.us(iy);if(!t)return e||{};for(var i=i5({},e),r=Object.keys(t),s=0;r.length>s;s++)i[r[s]]=t[r[s]];return this.Jn||(a$.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this.Jn=!0),i}getFlagPayloads(){var e=this.us(im),t=this.us(iw);if(!t)return e||{};for(var i=i5({},e||{}),r=Object.keys(t),s=0;r.length>s;s++)i[r[s]]=t[r[s]];return this.Jn||(a$.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:t,finalPayloads:i}),this.Jn=!0),i}reloadFeatureFlags(){this.Xn||this.Se.advanced_disable_feature_flags||this.ls()||this.ps||(this._instance.Ti.emit("featureFlagsReloading",!0),this.ps=setTimeout(()=>{this.gs()},5))}ys(){clearTimeout(this.ps),this.ps=void 0}ensureFlagsLoaded(){this.Yn||this.Kn||this.ps||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.Xn=e}gs(e){var t;if(this.ys(),!this._instance.mr()&&!this.ls()){if(this.Kn)this.es=!0;else{var i=this.Se.token,r=this.us(t1),s={token:i,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:y({},(null==(t=this.zr)?void 0:t.get_initial_props())||{},this.us(ix)||{}),group_properties:this.us(iS),timezone:sP()};et(r)||Q(r)||(s.$device_id=r),(null!=e&&e.disableFlags||this.Se.advanced_disable_feature_flags)&&(s.disable_flags=!0),this.vs()&&(s.evaluation_contexts=this.cs());var n=this.fs();Q(n)||(s.flag_keys=n);var a=!!this.Se.advanced_only_evaluate_survey_feature_flags,o=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+(this.Se.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":""));this.Kn=!0,this._instance._send_request({method:"POST",url:o,data:s,compression:this.Se.disable_compression?void 0:sB.Base64,timeout:this.Se.feature_flag_request_timeout_ms,callback:e=>{var t,i,r,n=!0;if(this.bs(e.statusCode),200===e.statusCode&&(this.es||(this.$anon_distinct_id=void 0),n=!1),this.Kn=!1,!s.disable_flags||this.es){this.ts=!n;var o=[];e.error?e.error instanceof Error?o.push("AbortError"===e.error.name?"timeout":"connection_error"):o.push("unknown_error"):200!==e.statusCode&&o.push("api_error_"+e.statusCode),null!=(t=e.json)&&t.errorsWhileComputingFlags&&o.push("errors_while_computing_flags");var l,u=!(null==(i=e.json)||null==(i=i.quotaLimited)||!i.includes("feature_flags"));(u&&o.push("quota_limited"),null==(r=this.zr)||r.register({[iI]:o}),u)?a$.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more."):(s.disable_flags||this.receivedFeatureFlags(null!==(l=e.json)&&void 0!==l?l:{},n,{partialResponse:a}),this.es&&(this.es=!1,this.gs()))}}})}}}ls(){return sh(this.ss,3)}bs(e){this.ss=sd(e,this.ss,3,()=>a$.warn("Feature flag requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped refreshing feature flags; will try again when connectivity changes."))}getFeatureFlag(e,t){var i;if(void 0===t&&(t={}),!t.fresh||this.ts){if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ds()){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 a$.warn('getFeatureFlag for key "'+e+aR)}}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.ts){if(this.Yn||this.getFlags()&&this.getFlags().length>0){if(!this.ds()){var i=this.getFlagVariants(),r=e in i,s=i[e],n=this.getFlagPayloads()[e],a=String(s),o=this.us(ib)||void 0,l=this.us(i$)||void 0,u=this.us(iT)||{};if(this.Se.advanced_feature_flags_dedup_per_session){var c,h=this._instance.get_session_id(),d=this.us(iC);h&&h!==d&&(u={},null==(c=this.zr)||c.register({[iT]:u,[iC]:h}))}if((t.send_event||!("send_event"in t))&&(!(e in u)||!u[e].includes(a))){K(u[e])?u[e].push(a):u[e]=[a],null==(_=this.zr)||_.register({[iT]:u});var p=this.getFeatureFlagDetails(e),v=[...null!==(f=this.us(iI))&&void 0!==f?f:[]];Q(s)&&v.push("flag_missing");var g={$feature_flag:e,$feature_flag_response:s,$feature_flag_payload:n||null,$feature_flag_request_id:o,$feature_flag_evaluated_at:l,$feature_flag_bootstrapped_response:(null==(m=this.Se.bootstrap)||null==(m
1=m.featureFlags)?void 0:m[e])||null,$feature_flag_bootstrapped_payload:(null==(b=this.Se.bootstrap)||null==(b=b.featureFlagPayloads)?void 0:b[e])||null,$used_bootstrap_value:!this.ts};Q(null==p||null==(y=p.metadata)?void 0:y.version)||(g.$feature_flag_version=p.metadata.version);var _,f,m,b,y,w,S,k,E,P,F,T=null!==(w=null==p||null==(S=p.reason)?void 0:S.description)&&void 0!==w?w:null==p||null==(k=p.reason)?void 0:k.code;T&&(g.$feature_flag_reason=T),null!=p&&null!=(E=p.metadata)&&E.id&&(g.$feature_flag_id=p.metadata.id),Q(null==p?void 0:p.original_variant)&&Q(null==p?void 0:p.original_enabled)||(g.$feature_flag_original_response=Q(p.original_variant)?p.original_enabled:p.original_variant),null!=p&&null!=(P=p.metadata)&&P.original_payload&&(g.$feature_flag_original_payload=null==p||null==(F=p.metadata)?void 0:F.original_payload),v.length&&(g.$feature_flag_error=v.join(",")),this._instance.capture("$feature_flag_called",g)}if(r)return{key:e,enabled:!!s,variant:"string"==typeof s?s:void 0,payload:x(n)}}}else a$.warn('getFeatureFlagResult for key "'+e+aR)}}getRemoteConfigPayload(e,t){var i=this.Se.token,r={distinct_id:this._instance.get_distinct_id(),token:i};this.vs()&&(r.evaluation_contexts=this.cs());var s=this.fs();Q(s)||(r.flag_keys=s),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this.Se.disable_compression?void 0:sB.Base64,timeout:this.Se.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.ts){if(this.Yn||this.getFlags()&&this.getFlags().length>0){var i=this.getFeatureFlag(e,t);return Q(i)?void 0:!!i}a$.warn('isFeatureEnabled for key "'+e+aR)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(t=>t!==e)}receivedFeatureFlags(e,t,i){if(this.zr){this.Yn=!0;var r=this.getFlagVariants(),s=this.getFlagPayloads(),n=this.getFlagsWithDetails();!function(e,t,i,r,s,n){void 0===i&&(i={}),void 0===r&&(r={}),void 0===s&&(s={});var a,o=((a=e.flags)?(e.featureFlags=Object.fromEntries(Object.keys(a).map(e=>{var t;return[e,null!==(t=a[e].variant)&&void 0!==t?t:a[e].enabled]})),e.featureFlagPayloads=Object.fromEntries(Object.keys(a).filter(e=>a[e].enabled).filter(e=>{var t;return null==(t=a[e].metadata)?void 0:t.payload}).map(e=>{var t;return[e,null==(t=a[e].metadata)?void 0:t.payload]}))):e.featureFlags&&a$.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),e),l=o.flags,u=o.featureFlags,c=o.featureFlagPayloads;if(u){var h=e.requestId,d=e.evaluatedAt;if(K(u)){a$.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var p={};if(u)for(var v=0;u.length>v;v++)p[u[v]]=!0;t&&t.register({[iv]:u,[ip]:p})}else{var g=u,_=c,f=l;if(null!=n&&n.partialResponse)g=y({},i,g),_=y({},r,_),f=y({},s,f);else if(e.errorsWhileComputingFlags){if(l){var m=new Set(Object.keys(l).filter(e=>{var t;return!(null!=(t=l[e])&&t.failed)}));g=y({},i,Object.fromEntries(Object.entries(g).filter(e=>{var[t]=e;return m.has(t)}))),_=y({},r,Object.fromEntries(Object.entries(_||{}).filter(e=>{var[t]=e;return m.has(t)}))),f=y({},s,Object.fromEntries(Object.entries(f||{}).filter(e=>{var[t]=e;return m.has(t)})))}else g=y({},i,g),_=y({},r,_),f=y({},s,f)}t&&t.register(y({[iv]:Object.keys(aO(g)),[ip]:g||{},[im]:_||{},[i_]:f||{}},h?{[ib]:h}:{},d?{[i$]:d}:{}))}}}(e,this.zr,r,s,n,i),t||(this.ns=!1),this._s(t)}}override(e,t){void 0===t&&(t=!1),a$.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:t})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this.zr)return a$.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(!1===e)return this.zr.unregister(iy),this.zr.unregister(iw),this._s(),aA.info("All overrides cleared");if(K(e)){var t,i=aM(e);return this.zr.register({[iy]:i}),this._s(),aA.info("Flag overrides set",{flags:e})}if(e&&"object"==typeof e&&("flags"in e||"payloads"in e)){if(this.Jn=!!(null!==(t=e.suppressWarning)&&void 0!==t&&t),"flags"in e){if(!1===e.flags)this.zr.unregister(iy),aA.info("Flag overrides cleared");else if(e.flags){if(K(e.flags)){var r=aM(e.flags);this.zr.register({[iy]:r})}else this.zr.register({[iy]:e.flags});aA.info("Flag overrides set",{flags:e.flags})}}return"payloads"in e&&(!1===e.payloads?(this.zr.unregister(iw),aA.info("Payload overrides cleared")):e.payloads&&(this.zr.register({[iw]:e.payloads}),aA.info("Payload overrides set",{payloads:e.payloads}))),void this._s()}if(e&&"object"==typeof e)return this.zr.register({[iy]:e}),this._s(),aA.info("Flag overrides set",{flags:e});a$.warn("Invalid overrideOptions provided to overrideFeatureFlags",{overrideOptions:e})}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.Yn){var{flags:t,flagVariants:i}=this.ws();try{e(t,i)}catch(e){a$.error("Error while running feature flags callback",e)}}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,t,i){var r,s=(this.us(ig)||[]).find(t=>t.flagKey===e),n={["$feature_enrollment/"+e]:t},a={$feature_flag:e,$feature_enrollment:t,$set:n};s&&(a.$early_access_feature_name=s.name),i&&(a.$feature_enrollment_stage=i),this._instance.capture("$feature_enrollment_update",a),this.setPersonPropertiesForFlags(n,!1);var o=y({},this.getFlagVariants(),{[e]:t});null==(r=this.zr)||r.register({[iv]:Object.keys(aO(o)),[ip]:o}),this._s()}getEarlyAccessFeatures(e,t,i){void 0===t&&(t=!1);var r=this.us(ig),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.Se.token+s),method:"GET",callback:t=>{var i,r;if(t.json){var s=t.json.earlyAccessFeatures;return null==(i=this.zr)||i.unregister(ig),null==(r=this.zr)||r.register({[ig]:s}),e(s)}}})}ws(){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),{})}}_s(e){var{flags:t,flagVariants:i}=this.ws();
1this.featureFlagEventHandlers.forEach(r=>{try{r(t,i,{errorsLoading:e})}catch(e){a$.error("Error while running feature flags callback",e)}})}setPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.us(ix)||{},r=(null==e?void 0:e.$set)||(null!=e&&e.$set_once?{}:e),s=null==e?void 0:e.$set_once,n={};if(s)for(var a in s)({}).hasOwnProperty.call(s,a)&&(a in i||(n[a]=s[a]));this._instance.register({[ix]:y({},i,n,r)}),t&&this._instance.reloadFeatureFlags()}unsetPersonPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=y({},this.us(ix)||{});e.forEach(e=>{delete i[e]}),this._instance.register({[ix]:i}),t&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(e){void 0===e&&(e=!0),this._instance.unregister(ix),e&&this._instance.reloadFeatureFlags()}setGroupPropertiesForFlags(e,t){void 0===t&&(t=!0);var i=this.us(iS)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(t=>{i[t]=y({},i[t],e[t]),delete e[t]}),this._instance.register({[iS]:y({},i,e)}),t&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var t=this.us(iS)||{};this._instance.register({[iS]:y({},t,{[e]:{}})})}else this._instance.unregister(iS)}reset(){this.Yn=!1,this.Kn=!1,this.Xn=!1,this.es=!1,this.ts=!1,this.$anon_distinct_id=void 0,this.ys(),this.Jn=!1,this.ss=0}}},aU=y({productTours:class{get zr(){return this._instance.persistence}constructor(e){this.Fo=null,this.Ao=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if("productTours"in e){var t,i;if(this.zr&&this.zr.register({[ii]:!!e.productTours}),!am(this._instance))return!this.Fo&&ei(null==(t=this.zr)?void 0:t.props[iF])||af.info("product tours disabled; stopping and clearing cached tours"),null==(i=this.Fo)||i.stop(),this.Fo=null,void this.clearCache();this.loadIfEnabled()}}loadIfEnabled(){!this.Fo&&am(this._instance)&&this.Mt(()=>this.$o())}Mt(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.generateProductTours?e():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"product-tours",t=>{t?af.error("Could not load product tours script",t):e()})}$o(){var e;!this.Fo&&null!=(e=v.__PosthogExtensions__)&&e.generateProductTours&&(this.Fo=v.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(e,t){if(void 0===t&&(t=!1),!K(this.Ao)||t){var i=this.zr;if(i){var r=i.props[iF];if(K(r)&&!t)return this.Ao=r,void e(r,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:t=>{if(am(this._instance)){var r=t.statusCode;if(200!==r||!t.json){var s="Product Tours API could not be loaded, status: "+r;return af.error(s),void e([],{isLoaded:!1,error:s})}var n=K(t.json.product_tours)?t.json.product_tours:[];this.Ao=n,i&&i.register({[iF]:n}),e(n,{isLoaded:!0})}else e([],{isLoaded:!0})}})}else e(this.Ao,{isLoaded:!0})}getActiveProductTours(e){ei(this.Fo)?e([],{isLoaded:!1,error:"Product tours not loaded"}):this.Fo.getActiveProductTours(e)}showProductTour(e){var t;null==(t=this.Fo)||t.showTourById(e)}previewTour(e){this.Fo?this.Fo.previewTour(e):this.Mt(()=>{var t;this.$o(),null==(t=this.Fo)||t.previewTour(e)})}dismissProductTour(){var e;null==(e=this.Fo)||e.dismissTour("user_clicked_skip")}nextStep(){var e;null==(e=this.Fo)||e.nextStep()}previousStep(){var e;null==(e=this.Fo)||e.previousStep()}clearCache(){var e;this.Ao=null,null==(e=this.zr)||e.unregister(iF)}resetTour(e){var t;null==(t=this.Fo)||t.resetTour(e)}resetAllTours(){var e;null==(e=this.Fo)||e.resetAllTours()}cancelPendingTour(e){var t;null==(t=this.Fo)||t.cancelPendingTour(e)}}},aH),aV=y({surveys:class{get Se(){return this._instance.config}constructor(e){this.Xo=void 0,this._surveyManager=null,this.ea=!1,this.ta=[],this.ra=null,this.ia=null,this._instance=e,this._surveyEventReceiver=null}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this.Se.disable_surveys){var t=e.surveys;if(ei(t))return nB.warn("Flags not loaded yet. Not loading surveys.");var i=K(t);this.Xo=i?t.length>
10:t,nB.info("flags response received, isSurveysEnabled: "+this.Xo),this.loadIfEnabled()}}reset(){try{var e;null==(e=this._surveyEventReceiver)||e.reset(),localStorage.removeItem("lastSeenSurveyDate");for(var t=[],i=0;i<localStorage.length;i++){var r=localStorage.key(i);(null!=r&&r.startsWith(nH)||null!=r&&r.startsWith("inProgressSurvey_"))&&t.push(r)}t.forEach(e=>localStorage.removeItem(e))}catch(e){}}loadIfEnabled(){if(!this._surveyManager){if(this.ea)nB.info("Already initializing surveys, skipping...");else if(this.Se.disable_surveys)nB.info(aF);else if(this.Se.cookieless_mode&&this._instance.consent.isOptedOut())nB.info("Not loading surveys in cookieless mode without consent.");else{var e=null==v?void 0:v.__PosthogExtensions__;if(e){if(!Q(this.Xo)||this.Se.advanced_enable_surveys){var t=this.Xo||this.Se.advanced_enable_surveys;this.ea=!0;try{var i=e.generateSurveys;if(i)return void this.na(i,t);var r=e.loadExternalDependency;if(!r)return void this.sa(iU);r(this._instance,"surveys",i=>{i||!e.generateSurveys?this.sa("Could not load surveys script",i):this.na(e.generateSurveys,t)})}catch(e){throw this.sa("Error initializing surveys",e),e}finally{this.ea=!1}}}else nB.error("PostHog Extensions not found.")}}}na(e,t){this._surveyManager=e(this._instance,t),this._surveyEventReceiver=new aE(this._instance),nB.info("Surveys loaded successfully"),this.oa({isLoaded:!0})}sa(e,t){nB.error(e,t),this.oa({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.ta.push(e),this._surveyManager&&this.oa({isLoaded:!0}),()=>{this.ta=this.ta.filter(t=>t!==e)}}getSurveys(e,t){if(void 0===t&&(t=!1),this.Se.disable_surveys)return nB.info(aF),e([]);var i,r=this._instance.get_property(ik);if(r&&!t)return e(r,{isLoaded:!0}),void(this.aa()&&this.getSurveys(()=>{},!0));"undefined"!=typeof Promise&&this.ra?this.ra.then(t=>{var{surveys:i,context:r}=t;return e(i,r)}):("undefined"!=typeof Promise&&(this.ra=new Promise(e=>{i=e})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this.Se.token),method:"GET",timeout:this.Se.surveys_request_timeout_ms,callback:t=>{this.ra=null;var r=t.statusCode;if(200!==r||!t.json){var s="Surveys API could not be loaded, status: "+r;nB.error(s),this.ia=Date.now();var n={isLoaded:!1,error:s};return e([],n),void(null==i||i({surveys:[],context:n}))}this.ia=null;var a,o,l=t.json.surveys||[],u=l.filter(e=>{var t,i;return!(!e.start_date||e.end_date)&&(!(null==(t=e.conditions)||null==(t=t.events)||null==(t=t.values)||!t.length)||!(null==(i=e.conditions)||null==(i=i.actions)||null==(i=i.values)||!i.length))});u.length>0&&(null==(o=this._surveyEventReceiver)||o.register(u)),null==(a=this._instance.persistence)||a.register({[ik]:l,[iE]:Date.now()});var c={isLoaded:!0};e(l,c),null==i||i({surveys:l,context:c})}}))}aa(){return this.la()&&!this.ra&&!this.ua()}la(){var e=this._instance.get_property(iE);return er(e)&&Date.now()-e>3e5}ua(){return er(this.ia)&&3e5>Date.now()-this.ia}markSurveyAsSeen(e,t){var i;nU({id:e,current_iteration:null!==(i=null==t?void 0:t.iteration)&&void 0!==i?i:null});try{localStorage.setItem("lastSeenSurveyDate",(new Date).toISOString())}catch(e){}}oa(e){for(var t of this.ta)try{if(!e.isLoaded)return t([],e);this.getSurveys(t)}catch(e){nB.error("Error in survey callback",e)}}getActiveMatchingSurveys(e,t){if(void 0===t&&(t=!1),!ei(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,t);nB.warn("init was not called")}ha(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}da(e){if(ei(this._surveyManager))return{eligible:!1,reason:aP};var t="string"==typeof e?this.ha(e):e;return t?this._surveyManager.checkSurveyEligibility(t):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(ei(this._surveyManager))return nB.warn("init was not called"),{visible:!1,disabledReason:aP};var t=this.da(e);return{visible:t.eligible,disabledReason:t.reason}}canRenderSurveyAsync(e,t){return ei(this._surveyManager)?(nB.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:aP})):new Promise(i=>
1{this.getSurveys(t=>{var r,s=null!==(r=t.find(t=>t.id===e))&&void 0!==r?r:null;if(s){var n=this.da(s);i({visible:n.eligible,disabledReason:n.reason})}else i({visible:!1,disabledReason:"Survey not found"})},t)})}renderSurvey(e,t,i){var r;if(ei(this._surveyManager))nB.warn("init was not called");else{var s="string"==typeof e?this.ha(e):e;if(null!=s&&s.id){if(nV.includes(s.type)){var n=null==o?void 0:o.querySelector(t);if(n)return null!=(r=s.appearance)&&r.surveyPopupDelaySeconds?(nB.info("Rendering survey "+s.id+" with delay of "+s.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var e,t;nB.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),nB.info("Survey "+s.id+" rendered")},1e3*s.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(s,n,i);nB.warn("Survey element not found")}else nB.warn("Surveys of type "+s.type+" cannot be rendered in the app")}else nB.warn("Survey not found")}}displaySurvey(e,t){var i;if(ei(this._surveyManager))nB.warn("init was not called");else{var r=this.ha(e);if(r){var s=r;if(null!=(i=r.appearance)&&i.surveyPopupDelaySeconds&&t.ignoreDelay&&(s=y({},r,{appearance:y({},r.appearance,{surveyPopupDelaySeconds:0})})),t.displayType!==sO.Popover&&t.initialResponses&&nB.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 nB.warn("Survey is not eligible to be displayed: ",n.disabledReason)}t.displayType!==sO.Inline?this._surveyManager.handlePopoverSurvey(s,t):this.renderSurvey(s,t.selector,t.properties)}else nB.warn("Survey not found")}}cancelPendingSurvey(e){ei(this._surveyManager)?nB.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;null==(e=this._surveyManager)||e.handlePageUnload()}}},aH),aW=y({experiments:aj},aH),aG=y({},aH,{sessionRecording:class{get Se(){return this._instance.config}get zr(){return this._instance.persistence}get started(){var e;return!(null==(e=this.xs)||!e.isStarted)}get status(){var e,t;return this.ks===ah||this.ks===ad?this.ks:null!==(e=null==(t=this.xs)?void 0:t.status)&&void 0!==e?e:this.ks}constructor(e){if(this._forceAllowLocalhostNetworkCapture=!1,this.ks=au,this.Ss=void 0,this._instance=e,!this._instance.sessionManager)throw av.error("started without valid sessionManager"),Error(ap+" started without valid sessionManager. This is a bug.");if(this.Se.cookieless_mode===iW)throw Error(ap+' cannot be used with cookieless_mode="always"')}initialize(){this.startIfEnabledOrStop()}get Cs(){var e,t=!(null==(e=this._instance.get_property(is))||!e.enabled),i=!this.Se.disable_session_recording,r=this.Se.disable_session_recording||this._instance.consent.isOptedOut();return s&&t&&i&&!r}startIfEnabledOrStop(e){var t;if(!this.Cs||null==(t=this.xs)||!t.isStarted){var i=!Q(Object.assign)&&!Q(Array.from);this.Cs&&i?(this.Is(e),av.info("starting")):(this.ks=au,this.stopRecording())}}Is(e){var t,i,r;this.Cs&&(this.ks!==ah&&this.ks!==ad&&(this.ks=ac),null!=v&&null!=(t=v.__PosthogExtensions__)&&null!=(t=t.rrweb)&&t.record&&null!=(i=v.__PosthogExtensions__)&&i.initSessionRecording?this.Ts(e):null==(r=v.__PosthogExtensions__)||null==r.loadExternalDependency||r.loadExternalDependency(this._instance,this.Es,t=>{if(t)return av.error("could not load recorder",t);this.Ts(e)}))}stopRecording(){var e,t;null==(e=this.Ss)||e.call(this),this.Ss=void 0,null==(t=this.xs)||t.stop()}Ms(){var e,t;null==(e=this.Ss)||e.call(this),this.Ss=void 0,null==(t=this.xs)||t.discard()}Ps(){var e,t;null==(e=this.zr)||e.unregister(id),null==(t=this.zr)||t.unregister(ia)}Rs(e,t){if(ei(e))return null;var i=er(e)?e:parseFloat(e);return"number"!=typeof i||!Number.isFinite(i)||0>i||i>1?(av.warn(t+" must be between 0 and 1. Ignoring invalid value:",e),null):i}Os(e){if(this.zr){var t,i,r=this.zr,s=()=>{var t,i=!1===e.sessionRecording?void 0:e.sessionRecording,s=this.Rs(null==(t=this.Se.session_recording)?void 0:t.sampleRate,"session_recording.sampleRate"),n=this.Rs(null==i?void 0:i.sampleRate,"remote config sampleRate"),a=null!=s?s:n;ei(a)&&this.Ps();var o=null==i?void 0:i.minimumDurationMilliseconds;r.register({[is]:y({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:y({capturePerformance:e.capturePerformance},null==i?void 0:i.networkPayloadCapture),canvasRecording:{enabled:null==i?void 0:i.recordCanvas,fps:null==i?void 0:i.canvasFps,quality:null==i?void 0:i.canvasQuality},sampleRate:a,minimumDurationMilliseconds:Q(o)?null:o,endpoint:null==i?void 0:i.endpoint,triggerMatchType:null==i?void 0:i.triggerMatchType,masking:null==i?void 0:i.masking,urlTriggers:null==i?void 0:i.urlTriggers,version:null==i?void 0:i.version,triggerGroups:null==i?void 0:i.triggerGroups})})};s(),null==(t=this.Ss)||t.call(this),this.Ss=null==(i=this._instance.sessionManager)?void 0:i.onSessionId(s)}}onRemoteConfig(e){return"sessionRecording"in e?!1===e.sessionRecording?(this.Os(e),void this.Ms()):(this.Os(e),void this.startIfEnabledOrStop()):(this.ks===ah&&(this.ks=ad,av.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.xs)&&i.log?this.xs.log(e,t):av.warn("log called before recorder was ready")}get Es(){var e,t,i=null==(e=this._instance)||null==(e=e.persistence)?void 0:e.get_property(is);return(null==i||null==(t=i.scriptConfig)?void 0:t.script)||"lazy-recorder"}Ls(){var e,t,i=this._instance.get_property(is);if(!i)return!1;try{t="object"==typeof i?i:JSON.parse(i)}catch(e){return av.warn("persisted remote config for session recording is invali
1d and will be ignored",e),!1}var r=null!==(e=t.cache_timestamp)&&void 0!==e?e:Date.now();return 36e5>=Date.now()-r}Ts(e){var t,i;if(null==(t=v.__PosthogExtensions__)||!t.initSessionRecording)return av.warn("Called on script loaded before session recording is available. This can be caused by adblockers."),void this._instance.register_for_session({[iH]:!0});if(this.xs||(this.xs=null==(i=v.__PosthogExtensions__)?void 0:i.initSessionRecording(this._instance),this.xs._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),!this.Ls()){if(this.ks===ad||this.ks===ah)return;return this.ks=ah,av.info("persisted remote config is stale, requesting fresh config before starting"),void new sq(this._instance).load()}this.ks=ac,this.xs.start(e)}onRRwebEmit(e){var t;null==(t=this.xs)||null==t.onRRwebEmit||t.onRRwebEmit(e)}overrideLinkedFlag(){var e,t;this.xs||null==(t=this.zr)||t.register({[il]:!0}),null==(e=this.xs)||e.overrideLinkedFlag()}overrideSampling(){var e,t;this.xs||null==(t=this.zr)||t.register({[io]:!0}),null==(e=this.xs)||e.overrideSampling()}overrideTrigger(e){var t,i;this.xs||null==(i=this.zr)||i.register({["url"===e?iu:ic]:!0}),null==(t=this.xs)||t.overrideTrigger(e)}get sdkDebugProperties(){var e;return(null==(e=this.xs)?void 0:e.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(e,t){var i;return!(null==(i=this.xs)||!i.tryAddCustomEvent(e,t))}}},{autocapture:class{constructor(e){this.Fs=!1,this.As=null,this.$s=!1,this.instance=e,this.rageclicks=new ai(e.config.rageclick),this.Ds=null}initialize(){this.startIfEnabled()}get Se(){var e,t,i=Y(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}Ns(){if(this.isBrowserSupported()){if(s&&o){var e=e=>{e=e||(null==s?void 0:s.event);try{this.qs(e)}catch(e){as.error("Failed to capture event",e)}};if(re(o,"submit",e,{capture:!0}),re(o,"change",e,{capture:!0}),re(o,"click",e,{capture:!0}),this.Se.capture_copied_text){var t=e=>{e=e||(null==s?void 0:s.event);try{this.qs(e,ar)}catch(e){as.error("Failed to capture copy/cut event",e)}};re(o,"copy",t,{capture:!0}),re(o,"cut",t,{capture:!0})}}}else as.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.Fs&&(this.Ns(),this.Fs=!0)}onRemoteConfig(e){e.elementsChainAsString&&(this.$s=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[t6]:!!e.autocapture_opt_out}),this.As=!!e.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(e){this.Ds=e}getElementSelectors(e){var t,i=[];return null==(t=this.Ds)||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[t6];if(et(this.As)&&!en(i)&&!this.instance.mr())return!1;var r=null!==(t=this.As)&&void 0!==t?t:!!i;return!!this.instance.config.autocapture&&!r}qs(e,t){if(void 0===t&&(t="$autocapture"),this.isEnabled){var i,r=rM(e);rF(r)&&(r=r.parentNode||null),"$autocapture"===t&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,e.timeStamp||(new Date).getTime())&&rU(r,this.instance.config.rageclick)&&this.qs(e,"$rageclick");var n=t===ar;if(r&&function(e,t,i,r,n,a){if(void 0===i&&(i=void 0),!s||rV(e)||null!=(o=i)&&o.url_allowlist&&!rI(i.url_allowlist,a)||null!=(l=i)&&l.url_ignorelist&&rI(i.url_ignorelist,a))return!1;if(null!=(u=i)&&u.dom_event_allowlist){var o,l,u,c,h,d,p=i.dom_event_allowlist;if(p&&!p.some(e=>t.type===e))return!1}var{parentIsUsefulElement:v,targetElementList:g}=rW(e,r);if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(Q(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}(g,i)||!rL(g,null==(c=i)?void 0:c.css_selector_allowlist)||rL(g,null!==(h=null==(d=i)?void 0:d.css_selector_ignorelist)&&void 0!==h?h:rN))return!1;try{var _=s.getComputedStyle(e);
1if(_&&"pointer"===_.getPropertyValue("cursor")&&"click"===t.type)return!0}catch(e){}var f=e.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(n||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(n||["change","click"]).indexOf(t.type)>=0;default:return v?(n||["click"]).indexOf(t.type)>=0:(n||["click"]).indexOf(t.type)>=0&&(rO.indexOf(f)>-1||"true"===e.getAttribute("contenteditable"))}}(r,e,this.Se,n,n?["copy","cut"]:void 0,this.instance)){var{props:a,explicitNoCapture:o}=function(e,t){var i,r,{e:n,maskAllElementAttributes:a,maskAllText:o,elementAttributeIgnoreList:l,elementsChainAsString:u,disableCaptureUrlHashes:c}=t;if(!rE(e))return{props:{}};for(var h=[e],d=e;d.parentNode&&!rP(d,"body");)if(rT(d.parentNode))h.push(d.parentNode.host),d=d.parentNode.host;else{if(!rE(d.parentNode))break;h.push(d.parentNode),d=d.parentNode}var p,v=[],g={},_=!1,f=!1;if(i3(h,e=>{var t=rG(e);if(rP(e,"a")){var i=e.getAttribute("href");_=!!(t&&i&&r1(i))&&(c?td(i):i)}B(r$(e),"ph-no-capture")&&(f=!0),v.push(function(e,t,i,r,s){void 0===s&&(s=!1);var n=e.tagName.toLowerCase(),a={tag_name:n};rO.indexOf(n)>-1&&!i&&(a.$el_text="a"===n.toLowerCase()||"button"===n.toLowerCase()?an(1024,r2(e)):an(1024,rR(e)));var o=r$(e);o.length>0&&(a.classes=o.filter(function(e){return""!==e})),i3(e.attributes,function(i){var n;if((!rK(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==r||!r.includes(i.name))&&!t&&r1(i.value)&&(!Z(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var o=i.value;"class"===i.name&&(o=rC(o).join(" ")),a["attr__"+i.name]=an(1024,"href"===i.name&&s?td(o):o)}});for(var l=1,u=1,c=e;c=function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!rE(t));return t}(c);)l++,c.tagName===e.tagName&&u++;return a.nth_child=l,a.nth_of_type=u,a}(e,a,o,l,c)),i5(g,function(e){if(!rG(e))return{};var t={};return i3(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&&r1(r)&&(t[i]=r)}}),t}(e))}),f)return{props:{},explicitNoCapture:f};if(o||(v[0].$el_text=rP(e,"a")||rP(e,"button")?r2(e):rR(e)),_){v[0].attr__href=_;var m,b,w=null==(m=so(_))?void 0:m.host,x=null==s||null==(b=s.location)?void 0:b.host;w&&x&&w!==x&&(p=_)}return{props:i5({$event_type:n.type,$ce_version:1},u?{}:{$elements:v},{$elements_chain:v.map(e=>{var t,i,r,s={text:null==(i=e.$el_text)?void 0:i.slice(0,400),tag_name:e.tag_name,href:null==(r=e.attr__href)?void 0:r.slice(0,2048),attr_class:(t=e.attr__class)?K(t)?t:rC(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return i6(e).filter(e=>{var[t]=e;return 0===t.indexOf("attr__")}).forEach(e=>{var[t,i]=e;return s.attributes[t]=i}),s}).map(e=>{var t,i,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class)for(var s of(e.attr_class.sort(),e.attr_class))r+="."+s.replace(/"/g,"");var n=y({},e.text?{text:e.text}:{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{},e.attr_id?{attr_id:e.attr_id}:{},e.attributes),a={};return i6(n).sort((e,t)=>{var[i]=e,[r]=t;return i.localeCompare(r)}).forEach(e=>{var[t,i]=e;return a[r3(t.toString())]=r3(i.toString())}),(r+=":")+i6(a).map(e=>{var[t,i]=e;return t+'="'+i+'"'}).join("")}).join(";")},null!=(i=v[0])&&i.$el_text?{$el_text:null==(r=v[0])?void 0:r.$el_text}:{},p&&"click"===n.type?{$external_click_url:p}:{},g)}}(r,{e:e,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.Se.element_attribute_ignorelist,elementsChainAsString:this.$s,disableCaptureUrlHashes:this.instance.config.disable_capture_url_hashes});if(o)return!1;var l=this.getElementSelectors(r);if(l&&l.length>0&&(a.$element_selectors=l),t===ar){var u,c=rA(null==s||null==(u=s.getSelection())?void 0:u.toString()),h=e.type||"clipboard";if(!c)return!1;a.$selected_content=c,a.$copy_type=h}return this.instance.capture(t,a),!0}}}isBrowserSupported(){return J(null==o?void 0:o.querySelectorAll)}},historyAutocapture:class{constructor(e){var t;this._instance=e,this.Bs=(null==s||null==(t=s.location)?void 0:t.pathname)||""}initialize(){this.startIfEnabled()}get isEnabled(){return"history_change"===this._instance.config.capture_pageview}startIfEnabled(){this.isEnabled&&(tY.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.js&&this.js(),this.js=void 0,tY.info("History API monitoring stopped")}monitorHistoryChanges(){s&&s.history&&(this.Hs("pushState"),this.Hs("replaceState"),this.Us())}Hs(e){var t;if(s&&(null==(t=s.history[e])||!t.__posthog_wrapped__)){var i=this;!function(e,t,i){try{if(!(t in e))return()=>{};var r=e[t],s=i(r);J(s)&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__posthog_wrapped__:{enumerable:!1,value:!0}})),e[t]=s,()=>{e[t]===s&&(e[t]=r)}}catch(e){return()=>{}}}(s.history,e,t=>function(r,s,n){t.call(this,r,s,n),i.zs(e)})}}zs(e){try{var t,i=null==s||null==(t=s.location)?void 0:t.pathname;if(!i)return;i!==this.Bs&&this.isEnabled&&this._instance.capture(iQ,{navigation_type:e}),this.Bs=i}catch(t){tY.error("Error capturing "+e+" pageview",t)}}Us(){if(!this.js){var e=()=>{this.zs("popstate")};re(s,"popstate",e),this.js=()=>{s&&s.removeEventListener("popstate",e)}}}},heatmaps:class{get Se(){return this.instance.config}constructor(e){var t;this.Vs=!1,this.Fs=!1,this.Ws=null,this.instance=e,this.Vs=!(null==(t=this.instance.persistence)||!t.props[t4]),this.rageclicks=new ai(e.config.rageclick)}initialize(){this.startIfEnabled()}get flushIntervalMilliseconds(){var e=5e3;return Y(this.Se.capture_heatmaps)&&this.Se.capture_heatmaps.flush_interval_milliseconds&&(e=this.Se.capture_heatmaps.flush_interval_milliseconds),e}get isEnabled(){return ei(this.Se.capture_heatmaps)?ei(this.Se.enable_heatmaps)?this.Vs:this.Se.enable_heatmaps:!1!==this.Se.capture_heatmaps}startIfEnabled(){if(this.isEnabled)this.Fs||(ag.info("starting..."),this.Gs(),this.ke());else{var e;clearInterval(null!==(e=this.Ws)&&void 0!==e?e:void 0),this.Zs(),this.getAndClearBuffer()}}onRemoteConfig(e){if("heatmaps"in e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register({[t4]:t}),this.Vs=t,this.startIfEnabled()}}getAndClearBuffer(){var e=this.R;return this.R=void 0,e}Qs(e){this.fe(e.originalEvent,"deadclick")}ke(){this.Ws&&clearInterval(this.Ws),this.Ws="visible"===(null==o?void 0:o.visibilityState)?setInterval(this.Lr.bind(this),this.flushIntervalMilliseconds):null}Gs(){s&&o&&(this.Js=this.Lr.bind(this),re(s,iX,this.Js),this.Ys=e=>this.fe(e||(null==s?void 0:s.event)),re(o,"click",this.Ys,{capture:!0}),this.Ks=e=>
1this.Xs(e||(null==s?void 0:s.event)),re(o,"mousemove",this.Ks,{capture:!0}),this.eo=new r8(this.instance,r6,this.Qs.bind(this)),this.eo.startIfEnabledOrStop(),this.ro=this.ke.bind(this),re(o,iY,this.ro),this.Fs=!0)}Zs(){var e;s&&o&&(this.Js&&s.removeEventListener(iX,this.Js),this.Ys&&o.removeEventListener("click",this.Ys,{capture:!0}),this.Ks&&o.removeEventListener("mousemove",this.Ks,{capture:!0}),this.ro&&o.removeEventListener(iY,this.ro),clearTimeout(this.io),null==(e=this.eo)||e.stop(),this.Fs=!1)}no(e,t){var i=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),n=this.instance.scrollManager.scrollElement(),a=function(e,t,i){for(var r=e;r&&rE(r)&&!rP(r,"body")&&r!==i;){var n,a,o,l=void 0;try{l=null==(n=null!==(a=null==(o=r.ownerDocument)?void 0:o.defaultView)&&void 0!==a?a:s)?void 0:n.getComputedStyle(r).position}catch(e){break}if(B(t,l))return!0;r=rD(r)}return!1}(rM(e),["fixed","sticky"],n);return{x:e.clientX+(a?0:r),y:e.clientY+(a?0:i),target_fixed:a,type:t}}fe(e,t){var i;if(void 0===t&&(t="click"),!rk(e.target)&&a_(e)){var r=this.no(e,t);null!=(i=this.rageclicks)&&i.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&rU(rM(e),this.instance.config.rageclick)&&this.so(y({},r,{type:"rageclick"})),this.so(r)}}Xs(e){!rk(e.target)&&a_(e)&&(clearTimeout(this.io),this.io=setTimeout(()=>{this.so(this.no(e,"mousemove"))},500))}so(e){if(s){var t=this.Se.disable_capture_url_hashes?td(s.location.href):s.location.href,i=this.Se.custom_personal_data_properties,r=su(t,this.Se.mask_personal_data_properties?[...sv,...i||[]]:[],s_);this.R=this.R||{},this.R[r]||(this.R[r]=[]),this.R[r].push(e)}}Lr(){this.R&&!X(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:r8,webVitalsAutocapture:class{constructor(e){var t;this.Vs=!1,this.Fs=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.oo=()=>{clearTimeout(this.ao),0!==this.R.metrics.length&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((e,t)=>y({},e,{["$web_vitals_"+t.name+"_event"]:y({},t),["$web_vitals_"+t.name+"_value"]:t.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.lo=e=>{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var t,i=this.uo();if(!Q(i)){if(ei(null==e?void 0:e.name)||ei(null==e?void 0:e.value))al.error("Invalid metric received",e);else if(!this.ho||this.ho>e.value){this.R.url!==i&&(this.oo(),this.ao=setTimeout(this.oo,this.flushToCaptureTimeoutMs)),Q(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=Q(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,e.attribution&&e.attribution.interactionTargetElement&&(e.attribution.interactionTargetElement=void 0);var r=null==(t=this._instance.sessionManager)?void 0:t.checkAndGetSessionAndWindowId(!0),s=y({},e,{$current_url:i,timestamp:Date.now()});Q(r)||(s.$session_id=r.sessionId,s.$window_id=r.windowId),this.R.metrics.push(s),this.R.metrics.length===this.allowedMetrics.length&&this.oo()}else al.error("Ignoring metric with value >= "+this.ho,e)}},this.do=()=>{if(!this.Fs){var e,t,i,r,s=v.__PosthogExtensions__;Q(s)||Q(s.postHogWebVitalsCallbacks)||({onLCP:e,onCLS:t,onFCP:i,onINP:r}=s.postHogWebVitalsCallbacks),e&&t&&i&&r?(this.allowedMetrics.indexOf("LCP")>-1&&e(this.lo.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&t(this.lo.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&i(this.lo.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&r(this.lo.bind(this)),this.Fs=!0):al.error("web vitals callbacks not loaded - not starting")}},this._instance=e,this.Vs=!(null==(t=this._instance.persistence)||!t.props[ie]),this.startIfEnabled()}get co(){return this._instance.config.capture_performance}get allowedMetrics(){var e,t,i=Y(this.co)?null==(e=this.co)?void 0:e.web_vitals_allowed_metrics:void 0;return ei(i)?(null==(t=this._instance.persistence)?void 0:t.props[ir])||["CLS","FCP","INP","LCP"]:i}get flushToCaptureTimeoutMs(){return(Y(this.co)?this.co.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var e=Y(this.co)?this.co.web_vitals_attribution:void 0;return null!=e&&e}get ho(){var e=Y(this.co)&&er(this.co.__web_vitals_max_value)?this.co.__web_vitals_max_value:9e5;return e>0&&6e4>=e?9e5:e}get isEnabled(){var e=null==l?void 0:l.protocol;if("http:"!==e&&"https:"!==e)return al.info("Web Vitals are disabled on non-http/https protocols"),!1;var t=Y(this.co)?this.co.web_vitals:en(this.co)?this.co:void 0;return en(t)?t:this.Vs}startIfEnabled(){this.isEnabled&&!this.Fs&&(al.info("enabled, starting..."),this.Mt(this.do))}onRemoteConfig(e){if("capturePerformance"in e){var t=Y(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=Y(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[ie]:t}),this._instance.persistence.register({[ir]:i})),this.Vs=t,this.startIfEnabled()}}Mt(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.postHogWebVitalsCallbacks?e():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,this.useAttribution?"web-vitals-with-attribution":"web-vitals",t=>{t?al.error("failed to load script",t):e()})}uo(){var e=s?this._instance.config.disable_capture_url_hashes?td(s.location.href):s.location.href:void 0;if(e){var t=this._instance.config.custom_personal_data_properties;return su(e,this._instance.config.mask_personal_data_properties?[...sv,...t||[]]:[],s_)}al.error("Could not determine current URL")}}},{exceptionObserver:class{constructor(e){var t,i,r;this.do=()=>{var e;if(s&&this.isEnabled&&null!=(e=v.__PosthogExtensions__)&&e.errorWrappingFunctions){var t=v.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,i=v.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,r=v.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.vo&&this.Se.capture_unhandled_errors&&(this.vo=t(this.captureException.bind(this))),!this.fo&&this.Se.capture_unhandled_rejections&&(this.fo=i(this.captureException.bind(this))),!this.po&&this.Se.capture_console_errors&&(this.po=r(this.captureException.bind(this)))}catch(e){aa.error("failed to start",e),this.mo()}}},this._instance=e,this.yo=!(null==(t=this._instance.persistence)||!t.props[t8]),this.bo=new e_({refillRate:null!==(i=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)&&void 0!==i?i:1,bucketSize:null!==(r=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)&&void 0!==r?r:10,refillInterval:1e4,Ae:aa}),this.Se=this._o(),this.startIfEnabledOrStop()}_o(){var e=this._instance.config.capture_exceptions,t={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Y(e)?t=y({},t,e):(Q(e)?this.yo:e)&&(t=y({},t,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),t}get isEnabled(){return this.Se.capture_console_errors||this.Se.capture_unhandled_errors||this.Se.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(aa.info("enabled"),this.mo(),this.Mt(this.do)):this.mo()}Mt(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.errorWrappingFunctions?e():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"exception-autocapture",t=>{if(t)return aa.error("failed to load script",t);e()})}mo(){var e,t,i;null==(e=this.vo)||e.call(this),this.vo=void 0,null==(t=this.fo)||t.call(this),this.fo=void 0,null==(i=this.po)||i.call(this),this.po=void 0}onRemoteConfig(e){"autocaptureExceptions"in e&&(this.yo=!!e.autocaptureExceptions,this._instance.persistence&&this._instance.persistence.register({[t8]:this.yo}),this.Se=this._o(),this.startIfEnabledOrStop())}onConfigChange(){this.Se=this._o()}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.bo.consumeRateLimit(s)?aa.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.wo=[],this.xo=new tw([new tA,new tB,new tM,new tR,new tz,new tj,new tL,new tq],function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),r=1;t>r;r++)i[r-1]=arguments[r];return function(t,r){void 0===r&&(r=0);for(var s=[],n=t.split("\n"),a=r;n.length>a;a++){var o=n[a];if(1024>=o.length){var l=t$.test(o)?o.replace(t$,"$1"):o;if(!l.match(/\S*Error: /)){for(var u of i){var c=u(l,e);if(c){s.push(c);break}}if(s.length>=50)break}}}return function(e){if(!e.length)return[];var t=Array.from(e);return t.reverse(),t.slice(0,50).map(e=>y({},e,{filename:e.filename||(t[t.length-1]||{}).filename,function:e.function||"?"}))}(s)}}("web:javascript",tF,tI)),this._instance=e,this.wo=null!==(t=null==(i=this._instance.persistence)?void 0:i.get_property(t7))&&void 0!==t?t:[],this.ko=tG(this.So()),this.Co=new tK(this.ko)}onConfigChange(){this.ko=tG(this.So()),this.Co.setConfig(this.ko)}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.wo=s,this._instance.persistence&&this._instance.persistence.register({[t7]:this.wo,[t9]:n})}}get Io(){var e,t=!!this._instance.get_property(t9),i=this._instance.config.error_tracking.captureExtensionExceptions;return null!==(e=null!=i?i:t)&&void 0!==e&&e}buildProperties(e,t){return this.xo.buildFromUnknown(e,{syntheticException:null==t?void 0:t.syntheticException,mechanism:{handled:null==t?void 0:t.handled}})}addExceptionStep(e,t){if(this.ko.enabled)try{if(!Z(e)||0===e.trim().length)return void aL.warn("Ignoring exception step because message must be a non-empty string");var i=this.To(t),{sanitizedProperties:r,droppedKeys:s}=function(e){if(!e)return{sanitizedProperties:{},droppedKeys:[]};var t=[];return{sanitizedProperties:Object.keys(e).reduce((i,r)=>(tV.has(r)?t.push(r):i[r]=e[r],i),{}),droppedKeys:t}}(i);s.length>0&&aL.warn("Ignoring reserved exception step fields",{droppedKeys:s}),this.Co.add(y({[tH]:e,[tU]:(new Date).toISOString()},r))}catch(e){aL.error("Failed to add exception step. Ignoring breadcrumb.",e)}}sendExceptionEvent(e){try{var t=e.$exception_list;if(this.Eo(t)){if(this.Mo(t))return this.Po("Exception dropped: matched a suppression rule"),void aL.info("Skipping exception capture because a suppression rule matched");if(!this.Io&&this.Ro(t))return this.Po("Exception dropped: thrown by a browser extension"),void aL.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.Oo(t))return this.Po("Exception dropped: thrown by the PostHog SDK"),void aL.info("Skipping exception capture because it was thrown by the PostHog SDK")}var i=this.ko.enabled&&ei(e.$exception_steps)?this.Lo(e):e;try{var r=this._instance.capture("$exception",i,{_noTruncate:!0,_batchKey:"exceptionEvent",Zi:!0});return r&&this.Co.clear(),r}catch(e){return aL.error("Failed to capture exception event. Dropping this exception.",e),void this.Co.clear()}}catch(e){return void aL.error("Failed to process exception event. Ignoring this exception.",e)}}Lo(e){try{var t=this.Co.getAttachable();return 0===t.length?e:y({},e,{$exception_steps:t})}catch(t){return aL.error("Failed to read buffered exception steps. Capturing exception without steps.",t),e}}Po(e){this.ko.enabled&&this.Co.add({[tH]:e,[tU]:(new Date).toISOString()})}To(e){return Y(e)?y({},e):{}}So(){var e,t;return null!==(e=null==(t=this._instance.config.error_tracking)?void 0:t.exception_steps)&&void 0!==e?e:{}}Mo(e){if(0===e.length)return!1;var t=e.reduce((e,t)=>
1{var{type:i,value:r}=t;return Z(i)&&i.length>0&&e.$exception_types.push(i),Z(r)&&r.length>0&&e.$exception_values.push(r),e},{$exception_types:[],$exception_values:[]});return this.wo.some(e=>{var i=e.values.map(e=>{var i,r=nO[e.operator],s=K(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)})}Ro(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://"))}Oo(e){if(e.length>0){var t,i,r,s,n=null!==(t=null==(i=e[0].stacktrace)?void 0:i.frames)&&void 0!==t?t:[],a=n[n.length-1];return null!==(r=null==a||null==(s=a.filename)?void 0:s.includes("posthog.com/static"))&&void 0!==r&&r}return!1}Eo(e){return!ei(e)&&K(e)}}},aU,{siteApps:class{constructor(e){this.Do=0,this._instance=e,this.No=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}qo(e,t){if(t){var i=this.globalsForEvent(t);this.No.push(i),this.No.length>1e3&&(this.No=this.No.slice(10))}}get siteAppLoaders(){var e;return null==(e=v._POSTHOG_REMOTE_CONFIG)||null==(e=e[this._instance.config.token])?void 0:e.siteApps}initialize(){if(this.isEnabled){var e=this._instance._addCaptureHook(this.qo.bind(this));this.Bo=()=>{e(),this.No=[],this.Bo=void 0}}}globalsForEvent(e){if(!e)throw Error("Event payload is required");var t,i,r,s,n,a,o,l={},u=this._instance.get_property("$groups")||[];for(var[c,h]of Object.entries(this._instance.get_property("$stored_group_properties")||{}))l[c]={id:u[c],type:c,properties:h};var{$set_once:d,$set:p}=e;return{event:y({},w(e,ab),{properties:y({},e.properties,p?{$set:y({},null!==(t=null==(i=e.properties)?void 0:i.$set)&&void 0!==t?t:{},p)}:{},d?{$set_once:y({},null!==(r=null==(s=e.properties)?void 0:s.$set_once)&&void 0!==r?r:{},d)}:{}),elements_chain:null!==(n=null==(a=e.properties)?void 0:a.$elements_chain)&&void 0!==n?n:"",distinct_id:null==(o=e.properties)?void 0:o.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:l}}jo(e){var t,i=null==(t=e.tagName)?void 0:t.toLowerCase();return"style"===i&&this._instance.config.prepare_external_dependency_stylesheet?this._instance.config.prepare_external_dependency_stylesheet(e)||(ay.error("prepare_external_dependency_stylesheet returned null"),null):"script"===i&&this._instance.config.prepare_external_dependency_script?this._instance.config.prepare_external_dependency_script(e)||(ay.error("prepare_external_dependency_script returned null"),null):e}Ho(){if(!this._instance.config.prepare_external_dependency_stylesheet&&!this._instance.config.prepare_external_dependency_script)return()=>{};var e,t,i,r,s,n,a,l,u=null==o?void 0:o.defaultView,c=null==u||null==(e=u.Node)?void 0:e.prototype;if(!u||!c)return()=>{};if(this.Do++,this.Uo)return this.zo();var h=[],d=this,p=new WeakSet,v=(e,t,i)=>{if(null!=e&&e[t]){var r=e[t];e[t]=i(r),h.push(()=>{e[t]=r})}},g=e=>{if(p.has(e))return e;var t=d.jo(e);return t&&p.add(t),t},_=e=>e.map(e=>"string"==typeof e?e:g(e)).filter(e=>!et(e));return v(c,"appendChild",e=>function(t){var i=g(t);return i?e.call(this,i):t}),v(c,"insertBefore",e=>function(t,i){var r=g(t);return r?e.call(this,r,i):t}),v(c,"replaceChild",e=>function(t,i){var r=g(t);return r?e.call(this,r,i):i}),[null==(t=u.Element)?void 0:t.prototype,null==(i=u.Document)?void 0:i.prototype,null==(r=u.DocumentFragment)?void 0:r.prototype].forEach(e=>{v(e,"append",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,_(i))}),v(e,"prepend",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,_(i))})}),[null==(s=u.Element)?void 0:s.prototype,null==(n=u.CharacterData)?void 0:n.prototype,null==(a=u.DocumentType)?void 0:a.prototype].forEach(e=>{v(e,"before",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,_(i))}),v(e,"after",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];return e.apply(this,_(i))}),v(e,"replaceWith",e=>function(){for(var t=arguments.length,i=Array(t),r=0;t>r;r++)i[r]=arguments[r];var s=_(i);return i.length&&!s.length?void 0:e.apply(this,s)})}),v(null==(l=u.Element)?void 0:l.prototype,"insertAdjacentElement",e=>function(t,i){var r=g(i);return r?e.call(this,t,r):null}),this.Uo=()=>
1{h.forEach(e=>e()),this.Uo=void 0},this.zo()}zo(){var e=!1;return()=>{var t;e||(e=!0,this.Do--,0===this.Do&&(null==(t=this.Uo)||t.call(this)))}}Vo(e,t){void 0===t&&(t=!0);var i=this.Ho();try{var r=e(i);return t&&i(),r}catch(e){throw i(),e}}setupSiteApp(e){var t=this.apps[e.id],i=()=>{var i;!t.errored&&this.No.length&&(ay.info("Processing "+this.No.length+" events for site app with id "+e.id),this.No.forEach(e=>this.Vo(()=>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,ay.info("Site app with id "+e.id+" "+(s?"loaded":"errored")),r&&i()};try{var{processEvent:n}=this.Vo(t=>e.init({posthog:this._instance,callback(e){t(),s(e)}}),!1);n&&(t.processEvent=n),r=!0}catch(t){ay.error(aw+e.id,t),s(!1)}if(r&&t.loaded)try{i()}catch(i){ay.error("Error while processing buffered events PostHog app with config id "+e.id,i),t.errored=!0}}Wo(){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)}Go(e){var t=this;if(0!==Object.keys(this.apps).length){var i=this.globalsForEvent(e),r=function(r){try{t.Vo(()=>null==r.processEvent?void 0:r.processEvent(i))}catch(t){ay.error("Error while processing event "+e.event+" for site app "+r.id,t)}};for(var s of Object.values(this.apps))r(s)}}onRemoteConfig(e){var t,i,r,s=this;if(null!=(t=this.siteAppLoaders)&&t.length)return this.isEnabled?(this.Wo(),void this._instance.on("eventCaptured",e=>this.Go(e))):void ay.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;v["__$$ph_site_app_"+e]=s._instance,null==(t=v.__PosthogExtensions__)||null==t.loadSiteApp||t.loadSiteApp(s._instance,o,t=>{if(t)return ay.error(aw+e,t)})};for(var{id:a,url:o}of e.siteApps)n(a)}else ay.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}},aV,{tracingHeaders:class{constructor(e){this.Zo=void 0,this.Qo=void 0,this.Jo=void 0,this.do=()=>{var e,t,i=this.Yo();i?(Q(this.Zo)&&(this.Zo=null==(e=v.__PosthogExtensions__)||null==(e=e.tracingHeadersPatchFns)?void 0:e._patchXHR(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager)),Q(this.Qo)&&(this.Qo=null==(t=v.__PosthogExtensions__)||null==(t=t.tracingHeadersPatchFns)?void 0:t._patchFetch(i,()=>this._instance.get_distinct_id(),this._instance.sessionManager))):this.mo()},this._instance=e}initialize(){this.startIfEnabledOrStop()}Mt(e){var t,i;null!=(t=v.__PosthogExtensions__)&&t.tracingHeadersPatchFns?e():null==(i=v.__PosthogExtensions__)||null==i.loadExternalDependency||i.loadExternalDependency(this._instance,"tracing-headers",t=>{if(t)return ao.error("failed to load script",t);e()})}Ko(){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}Yo(){var e=this.Ko();return K(e)?(K(this.Jo)?this.Jo.splice(0,this.Jo.length,...e):this.Jo=[...e],e.length>0?this.Jo:void 0):(K(this.Jo)&&this.Jo.splice(0),this.Jo=e||void 0,this.Jo)}mo(){var e,t;null==(e=this.Zo)||e.call(this),null==(t=this.Qo)||t.call(this),this.Zo=void 0,this.Qo=void 0}startIfEnabledOrStop(){this.Yo()?this.Mt(this.do):this.mo()}}},{toolbar:class{constructor(e){this.instance=e}ca(e){v.ph_toolbar_state=e}va(){var e;return null!==(e=v.ph_toolbar_state)&&void 0!==e?e:0}initialize(){return this.maybeLoadToolbar()}maybeLoadToolbar(e,t,i){if(void 0===e&&(e=void 0),void 0===t&&(t=void 0),void 0===i&&(i=void 0),rt(this.instance.config)||!s||!o)return!1;e=null!=e?e:s.location,i=null!=i?i:s.history;try{if(!t){try{s.localStorage.setItem("test","test"),s.localStorage.removeItem("test")}catch(e){return!1}t=null==s?void 0:s.localStorage}var r,n=aT||sc(e.hash,"__posthog")||sc(e.hash,"state"),a=n?i4(()=>JSON.parse(atob(decodeURIComponent(n))))||i4(()=>JSON.parse(decodeURIComponent(n))):null;return a&&"ph_authorize"===a.action?((r=a).source="url",r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:i?i.replaceState(i.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(t.getItem(aC)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token||(this.loadToolbar(r),0))}catch(e){return!1}}fa(e){var t=v.ph_load_toolbar||v.ph_load_editor;!ei(t)&&J(t)?t(e,this.instance):aI.warn("No toolbar load function found")}loadToolbar(e){var t,i=!(null==o||!o.getElementById(ij));if(!s||i)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,n=y({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});return(s.localStorage.setItem(aC,JSON.stringify(y({},n,{source:void 0}))),2===this.va())?this.fa(n):0===this.va()&&(this.ca(1),null==(t=v.__PosthogExtensions__)||null==t.loadExternalDependency||t.loadExternalDependency(this.instance,"toolbar",e=>{if(e)return aI.error("[Toolbar] Failed to load",e),void this.ca(0);this.ca(2),this.fa(n)}),re(s,"turbolinks:load",()=>{this.ca(0),this.loadToolbar(n)})),!0}pa(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)}}},aW,{conversations:class{constructor(e){this.ga=void 0,this._conversationsManager=null,this.ma=!1,this.ya=null,this._instance=e}initialize(){this.loadIfEnabled()}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var t=e.conversations;ei(t)||(en(t)?this.ga=t:(this.ga=t.enabled,this.ya=t),this.loadIfEnabled())}}reset(){var e;null==(e=this._conversationsManager)||e.reset(),this._conversationsManager=null,this.ga=void 0,this.ya=null}loadIfEnabled(){if(!(this._conversationsManager||this.ma||this._instance.config.disable_conversations||rt(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=null==v?void 0:v.__PosthogExtensions__;if(e&&!Q(this.ga)&&this.ga){if(this.ya&&this.ya.token){this.ma=!0;try{var t=e.initConversations;if(t)return this.ba(t),void(this.ma=!1);var i=e.loadExternalDependency;if(!i)return void this._a(iU);i(this._instance,"conversations",t=>{t||!e.initConversations?this._a("Could not load conversations script",t):this.ba(e.initConversations),this.ma=!1})}catch(e){this._a("Error initializing conversations",e),this.ma=!1}}else az.error("Conversations enabled but missing token in remote config.")}}}ba(e){if(this.ya)try{this._conversationsManager=e(this.ya,this._instance),az.info("Conversations loaded successfully")}catch(e){this._a("Error completing conversations initialization",e)}else az.error("Cannot complete initialization: remote config is null")}_a(e,t){az.error(e,t),this._conversationsManager=null,this.ma=!1}show(){this._conversationsManager?this._conversationsManager.show():az.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return!0===this.ga&&!et(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 b(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,t,i):(az.warn(aq),null)})()}getMessages(e,t){var i=this;return b(function*(){return i._conversationsManager?i._conversationsManager.getMessages(e,t):(az.warn(aq),null)})()}markAsRead(e){var t=this;return b(function*(){return t._conversationsManager?t._conversationsManager.markAsRead(e):(az.warn(aq),null)})()}getTickets(e){var t=this;return b(function*(){return t._conversationsManager?t._conversationsManager.getTickets(e):(az.warn(aq),null)})()}requestRestoreLink(e){var t=this;return b(function*(){return t._conversationsManager?t._conversationsManager.requestRestoreLink(e):(az.warn(aq),null)})()}restoreFromToken(e){var t=this;return b(function*(){return t._conversationsManager?t._conversationsManager.restoreFromToken(e):(az.warn(aq),null)})()}restoreFromUrlToken(){var e=this;return b(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(az.warn(aq),null)})()}getCurrentTicketId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getCurrentTicketId())&&void 0!==e?e:null}getWidgetSessionId(){var e,t;return null!==(e=null==(t=this._conversationsManager)?void 0:t.getWidgetSessionId())&&void 0!==e?e:null}en(){var e;null==(e=this._conversationsManager)||e.setIdentity()}tn(){var e;null==(e=this._conversationsManager)||e.clearIdentity()}}},{logs:class{constructor(e){var t;this.wa=!1,this.xa=!1,this.Ae=tX("[logs]"),this._r=[],this.ka=[],this.ss=0,this.Sa=()=>{var e,t;this.ss=0,null==(e=this.Ca)||e.onReconnect(),null==(t=this.Ia)||t.onReconnect()},this._instance=e,this._instance&&null!=(t=this._instance.config.logs)&&t.captureConsoleLogs&&(this.wa=!0),s&&re(s,"online",this.Sa)}Ta(e,t,i,r){var s,n,a,o,l,u,c,h,d,p,v,g,_,f,m=(d=null!==(n=null==(s=null==(f=this._instance)||null==(f=f.config)?void 0:f.logs)?void 0:s.flushIntervalMs)&&void 0!==n?n:3e3,p=null!==(a=null==s?void 0:s.maxBufferSize)&&void 0!==a?a:100,g=Q(v=null!=i&&i.consoleCapture?void 0:null!==(o=null==s?void 0:s.maxLogsPerInterval)&&void 0!==o?o:1e3)?Math.max(p,2048):Math.max(p,v),{serviceName:null!==(l=null!==(u=null==(_=null==s?void 0:s.resourceAttributes)?void 0:_["service.name"])&&void 0!==u?u:null==s?void 0:s.serviceName)&&void 0!==l?l:null==i?void 0:i.serviceNameDefault,serviceVersion:null!==(c=null==_?void 0:_["service.version"])&&void 0!==c?c:null==s?void 0:s.serviceVersion,environment:null!==(h=null==_?void 0:_["deployment.environment"])&&void 0!==h?h:null==s?void 0:s.environment,resourceAttributes:_,beforeSend:null==s?void 0:s.beforeSend,flushIntervalMs:d,maxBufferSize:p,maxQueueSize:g,maxBatchRecordsPerPost:100,rateCapWindowMs:d,maxLogsPerInterval:v,backgroundFlushBudgetMs:0,terminationFlushBudgetMs:0});return[new ty(this.Ea(e,t),m,this.Ae,()=>this.Ma(),e=>e(),void 0,r),m]}Pa(){var e,t,i=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.Ca&&this.Ra===i||(null==(t=this.Ca)||t.reset(),this.Ra=i,[this.Ca,this.Oa]=this.Ta(()=>this._r,e=>{this._r=e})),this.Ca}La(){var e,t,i=null==(e=this._instance)||null==(e=e.config)?void 0:e.logs;return this.Ia&&this.Fa===i||(null==(t=this.Ia)||t.reset(),this.Fa=i,[this.Ia,this.Aa]=this.Ta(()=>this.ka,e=>{this.ka=e},{serviceNameDefault:"posthog-browser-logs",consoleCapture:!0},aB)),this.Ia}initialize(){this.loadIfEnabled()}onRemoteConfig(e){var t,i=null==(t=e.logs)?void 0:t.captureConsoleLogs;!ei(i)&&i&&(this.wa=!0,this.loadIfEnabled())}reset(){var e,t;this._r=[],null==(e=this.Ca)||e.reset(),this.ka=[],null==(t=this.Ia)||t.reset(),this.ss=0}captureLog(e){this.Pa().captureLog(e)}le(e){this.La().captureLog(e)}get logger(){return this.$a||(this.$a={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.$a}flushLogs(e){e?this.Da(e):(this.Ca&&this.Ca.flush().catch(e=>this.Ae.error("PostHog logs flush failed:",e)),this.Ia&&this.Ia.flush().catch(e=>this.Ae.error("PostHog logs flush failed:",e)))}loadIfEnabled(){if(this.wa&&!this.xa){var e=null==v?void 0:v.__PosthogExtensions__;if(e){var t=e.loadExternalDependency;t?t(this._instance,"logs",t=>{var i;t||null==(i=e.logs)||!i.initializeLogs?this.Ae.error("Could not load logs script",t):(e.logs.initializeLogs(this._instance),this.xa=!0)}):this.Ae.error(iU)}else this.Ae.error("PostHog Extensions not found.")}}Ea(e,t){var i=this._instance;return{get isDisabled(){return!1},get optedOut(){return!i.is_capturing()},getPersistedProperty:t=>t===C.LogsQueue?e():void 0,setPersistedProperty(e,i){e===C.LogsQueue&&t(null!=i?i:[])},ht:e=>this.ht(e),getLibraryId:()=>f.LIB_NAME,getLibraryVersion:()=>f.LIB_VERSION}}ht(e){return new Promise(t=>{if(sh(this.ss,3))t({kind:"fatal",error:Error("logs endpoint is unreachable, dropping batch")});else{var i=!1,r=e=>{i||(i=!0,clearTimeout(s),t(e))},s=setTimeout(()=>r({kind:"retry-later",error:Error("logs request timed out")}),9e4);this._instance._send_request({method:"POST",url:this.Na(),data:e,compression:"best-available",batchKey:"logs",fireCallbackOnDrop:!0,callback:e=>{var t,i=e.statusCode;(this.qa(i),i>=200&&300>i)?r({kind:"ok"}):413===i?r({kind:"too-large"}):0!==i&&429!==i&&500>i?r({kind:"fatal",error:Error("logs request failed with status "+i)}):r({kind:"retry-later",error:null!==(t=e.error)&&void 0!==t?t:Error("logs request failed with status "+i)})}})}})}qa(e){(0!==e||this._instance.__loaded)&&(this.ss=sd(e,this.ss,3,()=>
1this.Ae.warn("Log requests are failing before receiving an HTTP response; this can happen due to network issues, CORS, browser blocking, or ad blockers. Stopped sending logs; will try again when connectivity changes.")))}Da(e){this._r.length>0&&this.Ba(e,this._r,this.Oa,f.LIB_NAME,e=>{this._r=e}),this.ka.length>0&&this.Ba(e,this.ka,this.Aa,aB,e=>{this.ka=e})}Ba(e,t,i,r,s){if(0!==t.length){var n=t.map(e=>e.record);s([]);var a=tb(n,tm(i,f.LIB_NAME,f.LIB_VERSION),r,f.LIB_VERSION);this._instance._send_request({method:"POST",url:this.Na(),data:a,compression:"best-available",batchKey:"logs",transport:e})}}Na(){return this._instance.requestRouter.endpointFor("api","/i/v1/logs")+"?token="+encodeURIComponent(this._instance.config.token)}Ma(){var e,t={};if(t.distinctId=this._instance.get_distinct_id(),this._instance.sessionManager){var{sessionId:i,windowId:r,sessionStartTimestamp:s,lastActivityTimestamp:n}=this._instance.sessionManager.checkAndGetSessionAndWindowId(!0);t.sessionId=i,t.windowId=r,ei(s)||(t.sessionStartTimestamp=s),ei(n)||(t.lastActivityTimestamp=n)}if(null!=v&&null!=(e=v.location)&&e.href&&(t.currentUrl=this._instance.config.disable_capture_url_hashes?td(v.location.href):v.location.href),this._instance.featureFlags){var a=this._instance.featureFlags.getFlags();a&&a.length>0&&(t.activeFeatureFlags=a)}return t}}});at.__defaultExtensionClasses=y({},aG);var aK=(f.SDK_DIST_CHANNEL="npm",r=nQ[n6]=new at,function(){function e(){e.done||(e.done=!0,n4=!1,i3(nQ,function(e){e._dom_loaded()}))}null!=o&&o.addEventListener?"complete"===o.readyState?e():re(o,"DOMContentLoaded",e,{capture:!1}):s&&tY.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),r)}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[774,179],function(){return t(1045),t(7856)}),_N_E=e.O()}]);
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.