(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4708],{5749:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,n(8030).Z)("BadgePlus",[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["line",{x1:"12",x2:"12",y1:"8",y2:"16",key:"10p56q"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]])},4174:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,n(8030).Z)("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]])},7668:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,n(8030).Z)("Gem",[["path",{d:"M6 3h12l4 6-10 13L2 9Z",key:"1pcd5k"}],["path",{d:"M11 3 8 9l4 13 4-13-3-6",key:"1fcu3u"}],["path",{d:"M2 9h20",key:"16fsjt"}]])},6043:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,n(8030).Z)("HandHeart",[["path",{d:"M11 14h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 16",key:"1ifwr1"}],["path",{d:"m7 20 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9",key:"17abbs"}],["path",{d:"m2 15 6 6",key:"10dquu"}],["path",{d:"M19.5 8.5c.7-.7 1.5-1.6 1.5-2.7A2.73 2.73 0 0 0 16 4a2.78 2.78 0 0 0-5 1.8c0 1.2.8 2 1.5 2.8L16 12Z",key:"1h3036"}]])},1005:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,n(8030).Z)("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]])},7289:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,n(8030).Z)("ListCollapse",[["path",{d:"m3 10 2.5-2.5L3 5",key:"i6eama"}],["path",{d:"m3 19 2.5-2.5L3 14",key:"w2gmor"}],["path",{d:"M10 6h11",key:"c7qv1k"}],["path",{d:"M10 12h11",key:"6m4ad9"}],["path",{d:"M10 18h11",key:"11hvi2"}]])},3952:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,n(8030).Z)("MessageCircleHeart",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M15.8 9.2a2.5 2.5 0 0 0-3.5 0l-.3.4-.35-.3a2.42 2.42 0 1 0-3.2 3.6l3.6 3.5 3.6-3.5c1.2-1.2 1.1-2.7.2-3.7",key:"43lnbm"}]])},7583:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,n(8030).Z)("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]])},6864:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,n(8030).Z)("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]])},994:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,n(8030).Z)("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]])},8916:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});/**
 * @license lucide-react v0.378.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */let r=(0,n(8030).Z)("UserRoundSearch",[["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M2 21a8 8 0 0 1 10.434-7.62",key:"1yezr2"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["path",{d:"m22 22-1.9-1.9",key:"1e5ubv"}]])},905:function(e,t){"use strict";let n;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DOMAttributeNames:function(){return r},default:function(){return s},isEqualNode:function(){return o}});let r={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv",noModule:"noModule"};function i(e){let{type:t,props:n}=e,i=document.createElement(t);for(let e in n){if(!n.hasOwnProperty(e)||"children"===e||"dangerouslySetInnerHTML"===e||void 0===n[e])continue;let o=r[e]||e.toLowerCase();"script"===t&&("async"===o||"defer"===o||"noModule"===o)?i[o]=!!n[e]:i.setAttribute(o,n[e])}let{children:o,dangerouslySetInnerHTML:s}=n;return s?i.innerHTML=s.__html||"":o&&(i.textContent="string"==typeof o?o:Array.isArray(o)?o.join(""):""),i}function o(e,t){if(e instanceof HTMLElement&&t instanceof HTMLElement){let n=t.getAttribute("nonce");if(n&&!e.getAttribute("nonce")){let r=t.cloneNode(!0);return r.setAttribute("nonce",""),r.nonce=n,n===e.nonce&&e.isEqualNode(r)}}return e.isEqualNode(t)}function s(){return{mountedInstances:new Set,updateHead:e=>{let t={};e.forEach(e=>{if("link"===e.type&&e.props["data-optimized-fonts"]){if(document.querySelector('style[data-href="'+e.props["data-href"]+'"]'))return;e.props.href=e.props["data-href"],e.props["data-href"]=void 0}let n=t[e.type]||[];n.push(e),t[e.type]=n});let r=t.title?t.title[0]:null,i="";if(r){let{children:e}=r.props;i="string"==typeof e?e:Array.isArray(e)?e.join(""):""}i!==document.title&&(document.title=i),["meta","base","link","style","script"].forEach(e=>{n(e,t[e]||[])})}}}n=(e,t)=>{let n=document.getElementsByTagName("head")[0],r=n.querySelector("meta[name=next-head-count]"),s=Number(r.content),a=[];for(let t=0,n=r.previousElementSibling;t<s;t++,n=(null==n?void 0:n.previousElementSibling)||null){var l;(null==n?void 0:null==(l=n.tagName)?void 0:l.toLowerCase())===e&&a.push(n)}let u=t.map(i).filter(e=>{for(let t=0,n=a.length;t<n;t++)if(o(a[t],e))return a.splice(t,1),!1;return!0});a.forEach(e=>{var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),u.forEach(e=>n.insertBefore(e,r)),r.content=(s-a.length+u.length).toString()},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},4080:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return y},handleClientScriptLoad:function(){return _},initScriptLoader:function(){return g}});let r=n(9920),i=n(1452),o=n(7437),s=r._(n(4887)),a=i._(n(2265)),l=n(6590),u=n(905),c=n(9189),d=new Map,f=new Set,h=["onLoad","onReady","dangerouslySetInnerHTML","children","onError","strategy","stylesheets"],p=e=>{if(s.default.preinit){e.forEach(e=>{s.default.preinit(e,{as:"style"})});return}if("undefined"!=typeof window){let t=document.head;e.forEach(e=>{let n=document.createElement("link");n.type="text/css",n.rel="stylesheet",n.href=e,t.appendChild(n)})}},v=e=>{let{src:t,id:n,onLoad:r=()=>{},onReady:i=null,dangerouslySetInnerHTML:o,children:s="",strategy:a="afterInteractive",onError:l,stylesheets:c}=e,v=n||t;if(v&&f.has(v))return;if(d.has(t)){f.add(v),d.get(t).then(r,l);return}let _=()=>{i&&i(),f.add(v)},g=document.createElement("script"),m=new Promise((e,t)=>{g.addEventListener("load",function(t){e(),r&&r.call(this,t),_()}),g.addEventListener("error",function(e){t(e)})}).catch(function(e){l&&l(e)});for(let[n,r]of(o?(g.innerHTML=o.__html||"",_()):s?(g.textContent="string"==typeof s?s:Array.isArray(s)?s.join(""):"",_()):t&&(g.src=t,d.set(t,m)),Object.entries(e))){if(void 0===r||h.includes(n))continue;let e=u.DOMAttributeNames[n]||n.toLowerCase();g.setAttribute(e,r)}"worker"===a&&g.setAttribute("type","text/partytown"),g.setAttribute("data-nscript",a),c&&p(c),document.body.appendChild(g)};function _(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{(0,c.requestIdleCallback)(()=>v(e))}):v(e)}function g(e){e.forEach(_),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(e=>{let t=e.id||e.getAttribute("src");f.add(t)})}function m(e){let{id:t,src:n="",onLoad:r=()=>{},onReady:i=null,strategy:u="afterInteractive",onError:d,stylesheets:h,...p}=e,{updateScripts:_,scripts:g,getIsSsr:m,appDir:y,nonce:b}=(0,a.useContext)(l.HeadManagerContext),k=(0,a.useRef)(!1);(0,a.useEffect)(()=>{let e=t||n;k.current||(i&&e&&f.has(e)&&i(),k.current=!0)},[i,t,n]);let w=(0,a.useRef)(!1);if((0,a.useEffect)(()=>{!w.current&&("afterInteractive"===u?v(e):"lazyOnload"===u&&("complete"===document.readyState?(0,c.requestIdleCallback)(()=>v(e)):window.addEventListener("load",()=>{(0,c.requestIdleCallback)(()=>v(e))})),w.current=!0)},[e,u]),("beforeInteractive"===u||"worker"===u)&&(_?(g[u]=(g[u]||[]).concat([{id:t,src:n,onLoad:r,onReady:i,onError:d,...p}]),_(g)):m&&m()?f.add(t||n):m&&!m()&&v(e)),y){if(h&&h.forEach(e=>{s.default.preinit(e,{as:"style"})}),"beforeInteractive"===u)return n?(s.default.preload(n,p.integrity?{as:"script",integrity:p.integrity,nonce:b}:{as:"script",nonce:b}),(0,o.jsx)("script",{nonce:b,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([n,{...p,id:t}])+")"}})):(p.dangerouslySetInnerHTML&&(p.children=p.dangerouslySetInnerHTML.__html,delete p.dangerouslySetInnerHTML),(0,o.jsx)("script",{nonce:b,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([0,{...p,id:t}])+")"}}));"afterInteractive"===u&&n&&s.default.preload(n,p.integrity?{as:"script",integrity:p.integrity,nonce:b}:{as:"script",nonce:b})}return null}Object.defineProperty(m,"__nextScript",{value:!0});let y=m;("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2477:function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){u(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function s(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function l(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,i,o=[],s=!0,a=!1;try{for(n=n.call(e);!(s=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);s=!0);}catch(e){a=!0,i=e}finally{try{s||null==n.return||n.return()}finally{if(a)throw i}}return o}}(e,t)||f(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=f(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}n.d(t,{ZP:function(){return iD}});var v={DEBUG:!1,LIB_VERSION:"1.144.1"},_=Array.isArray,g=Object.prototype,m=g.hasOwnProperty,y=g.toString,b=_||function(e){return"[object Array]"===y.call(e)},k=function(e){return"function"==typeof e},w=function(e){return e===Object(e)&&!b(e)},S=function(e){if(w(e)){for(var t in e)if(m.call(e,t))return!1;return!0}return!1},E=function(e){return void 0===e},x=function(e){return"[object String]"==y.call(e)},R=function(e){return x(e)&&0===e.trim().length},C=function(e){return null===e},P=function(e){return E(e)||C(e)},I=function(e){return"[object Number]"==y.call(e)},F=function(e){return"[object Boolean]"===y.call(e)},T="undefined"!=typeof window?window:void 0,O="undefined"!=typeof globalThis?globalThis:T,M=Array.prototype,N=M.forEach,A=M.indexOf,L=null==O?void 0:O.navigator,D=null==O?void 0:O.document,$=null==O?void 0:O.location,q=null==O?void 0:O.fetch,j=null!=O&&O.XMLHttpRequest&&"withCredentials"in new O.XMLHttpRequest?O.XMLHttpRequest:void 0,H=null==O?void 0:O.AbortController,B=null==L?void 0:L.userAgent,U=null!=T?T:{},W="[PostHog.js]",z={_log:function(e){if(T&&(v.DEBUG||U.POSTHOG_DEBUG)&&!E(T.console)&&T.console){for(var t=("__rrweb_original__"in T.console[e])?T.console[e].__rrweb_original__:T.console[e],n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];t.apply(void 0,[W].concat(r))}},info:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];z._log.apply(z,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];z._log.apply(z,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];z._log.apply(z,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];(e=console).error.apply(e,[W].concat(n))},uninitializedWarning:function(e){z.error("You must initialize PostHog before calling ".concat(e))}},V={},G=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function Z(e,t,n){if(b(e)){if(N&&e.forEach===N)e.forEach(t,n);else if("length"in e&&e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r)===V)return}}}function Y(e,t,n){if(!P(e)){if(b(e))return Z(e,t,n);if(e instanceof FormData){var r,i=p(e.entries());try{for(i.s();!(r=i.n()).done;){var o=r.value;if(t.call(n,o[1],o[0])===V)return}}catch(e){i.e(e)}finally{i.f()}}else for(var s in e)if(m.call(e,s)&&t.call(n,e[s],s)===V)return}}var J=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return Z(n,function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e};function Q(e,t){return -1!==e.indexOf(t)}function X(e){for(var t=Object.keys(e),n=t.length,r=Array(n);n--;)r[n]=[t[n],e[t[n]]];return r}var K,ee=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},et=function(e){try{return e()}catch(e){return}},en=function(e){return function(){try{for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return e.apply(this,n)}catch(e){z.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),z.critical(e)}}},er=function(e){var t={};return Y(e,function(e,n){x(e)&&e.length>0&&(t[n]=e)}),t},ei=function(e){return e.replace(/^\$/,"")},eo=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var s=e.charCodeAt(i),a=null;s<128?n++:a=s>127&&s<2048?String.fromCharCode(s>>6|192,63&s|128):String.fromCharCode(s>>12|224,s>>6&63|128,63&s|128),C(a)||(n>t&&(o+=e.substring(t,n)),o+=a,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o},es=function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation),t}return e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0},function(t,n,r,i,o){if(t){if(t.addEventListener&&!i)t.addEventListener(n,r,!!o);else{var s="on"+n,a=t[s];t[s]=function(n){if(n=n||e(null==T?void 0:T.event)){var i,o=!0;k(a)&&(i=a(n));var s=r.call(t,n);return!1!==i&&!1!==s||(o=!1),o}}}}else z.error("No valid element provided to register_event")}}();function ea(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return e[n]}(eZ=K||(K={})).GZipJS="gzip-js",eZ.Base64="base64";var el="$people_distinct_id",eu="__alias",ec="__timers",ed="$autocapture_disabled_server_side",ef="$heatmaps_enabled_server_side",eh="$exception_capture_enabled_server_side",ep="$web_vitals_enabled_server_side",ev="$session_recording_enabled_server_side",e_="$console_log_recording_enabled_server_side",eg="$session_recording_network_payload_capture",em="$session_recording_canvas_recording",ey="$replay_sample_rate",eb="$replay_minimum_duration",ek="$sesid",ew="$session_is_sampled",eS="$enabled_feature_flags",eE="$early_access_features",ex="$stored_person_properties",eR="$stored_group_properties",eC="$surveys",eP="$surveys_activated",eI="$flag_call_reported",eF="$user_state",eT="$client_session_props",eO="$capture_rate_limit",eM="$initial_campaign_params",eN="$initial_referrer_info",eA="$initial_person_info",eL="$epp",eD="__POSTHOG_TOOLBAR__",e$=[el,eu,"__cmpns",ec,ev,ef,ek,eS,eF,eE,eR,ex,eC,eI,eT,eO,eM,eN,eL],eq="$active_feature_flags",ej="$override_feature_flags",eH="$feature_flag_payloads",eB=function(e){var t,n={},r=p(X(e||{}));try{for(r.s();!(t=r.n()).done;){var i=c(t.value,2),o=i[0],s=i[1];s&&(n[o]=s)}}catch(e){r.e(e)}finally{r.f()}return n},eU=function(){function e(t){s(this,e),this.instance=t,this._override_warning=!1,this.featureFlagEventHandlers=[],this.reloadFeatureFlagsQueued=!1,this.reloadFeatureFlagsInAction=!1}return l(e,[{key:"getFlags",value:function(){return Object.keys(this.getFlagVariants())}},{key:"getFlagVariants",value:function(){var e=this.instance.get_property(eS),t=this.instance.get_property(ej);if(!t)return e||{};for(var n=J({},e),r=Object.keys(t),i=0;i<r.length;i++)n[r[i]]=t[r[i]];return this._override_warning||(z.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:n}),this._override_warning=!0),n}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(eH)||{}}},{key:"reloadFeatureFlags",value:function(){this.reloadFeatureFlagsQueued||(this.reloadFeatureFlagsQueued=!0,this._startReloadTimer())}},{key:"setAnonymousDistinctId",value:function(e){this.$anon_distinct_id=e}},{key:"setReloadingPaused",value:function(e){this.reloadFeatureFlagsInAction=e}},{key:"resetRequestQueue",value:function(){this.reloadFeatureFlagsQueued=!1}},{key:"_startReloadTimer",value:function(){var e=this;this.reloadFeatureFlagsQueued&&!this.reloadFeatureFlagsInAction&&setTimeout(function(){!e.reloadFeatureFlagsInAction&&e.reloadFeatureFlagsQueued&&(e.reloadFeatureFlagsQueued=!1,e._reloadFeatureFlagsRequest())},5)}},{key:"_reloadFeatureFlagsRequest",value:function(){var e=this;if(!this.instance.config.advanced_disable_feature_flags){this.setReloadingPaused(!0);var t=this.instance.config.token,n=this.instance.get_property(ex),r=this.instance.get_property(eR),i={token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:n,group_properties:r,disable_flags:this.instance.config.advanced_disable_feature_flags||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:i,compression:this.instance.config.disable_compression?void 0:K.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){e.setReloadingPaused(!1);var n,r=!0;200===t.statusCode&&(e.$anon_distinct_id=void 0,r=!1),e.receivedFeatureFlags(null!==(n=t.json)&&void 0!==n?n:{},r),e._startReloadTimer()}})}}},{key:"getFeatureFlag",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0){var n,r=this.getFlagVariants()[e],i="".concat(r),o=this.instance.get_property(eI)||{};return!t.send_event&&"send_event"in t||e in o&&o[e].includes(i)||(b(o[e])?o[e].push(i):o[e]=[i],null===(n=this.instance.persistence)||void 0===n||n.register(u({},eI,o)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:r})),r}z.warn('getFeatureFlag for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"getFeatureFlagPayload",value:function(e){return this.getFlagPayloads()[e]}},{key:"isFeatureEnabled",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.instance.decideEndpointWasHit||this.getFlags()&&this.getFlags().length>0)return!!this.getFeatureFlag(e,t);z.warn('isFeatureEnabled for key "'+e+"\" failed. Feature flags didn't load in time.")}},{key:"addFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers.push(e)}},{key:"removeFeatureFlagsHandler",value:function(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(function(t){return t!==e})}},{key:"receivedFeatureFlags",value:function(e,t){if(this.instance.persistence){this.instance.decideEndpointWasHit=!0;var n=this.getFlagVariants(),r=this.getFlagPayloads();(function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=e.featureFlags,a=e.featureFlagPayloads;if(s){if(b(s)){var l,c={};if(s)for(var d=0;d<s.length;d++)c[s[d]]=!0;t&&t.register((u(l={},eq,s),u(l,eS,c),l))}else{var f=s,h=a;e.errorsWhileComputingFlags&&(f=i(i({},r),f),h=i(i({},o),h)),t&&t.register((u(n={},eq,Object.keys(eB(f))),u(n,eS,f||{}),u(n,eH,h||{}),n))}}})(e,this.instance.persistence,n,r),this._fireFeatureFlagsCallbacks(t)}}},{key:"override",value:function(e){if(!this.instance.__loaded||!this.instance.persistence)return z.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=!1,!1===e)this.instance.persistence.unregister(ej);else if(b(e)){for(var t={},n=0;n<e.length;n++)t[e[n]]=!0;this.instance.persistence.register(u({},ej,t))}else this.instance.persistence.register(u({},ej,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var n=this._prepareFeatureFlagsForCallbacks();e(n.flags,n.flagVariants)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){var n,r,o=u({},"$feature_enrollment/".concat(e),t);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:o}),this.setPersonPropertiesForFlags(o,!1);var s=i(i({},this.getFlagVariants()),{},u({},e,t));null===(n=this.instance.persistence)||void 0===n||n.register((u(r={},eq,Object.keys(eB(s))),u(r,eS,s),r)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.instance.get_property(eE);if(r&&!n)return e(r);this.instance._send_request({transport:"XHR",url:this.instance.requestRouter.endpointFor("api","/api/early_access_features/?token=".concat(this.instance.config.token)),method:"GET",callback:function(n){var r;if(n.json){var i=n.json.earlyAccessFeatures;return null===(r=t.instance.persistence)||void 0===r||r.register(u({},eE,i)),e(i)}}})}},{key:"_prepareFeatureFlagsForCallbacks",value:function(){var e=this.getFlags(),t=this.getFlagVariants();return{flags:e.filter(function(e){return t[e]}),flagVariants:Object.keys(t).filter(function(e){return t[e]}).reduce(function(e,n){return e[n]=t[n],e},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),n=t.flags,r=t.flagVariants;this.featureFlagEventHandlers.forEach(function(t){return t(n,r,{errorsLoading:e})})}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(ex)||{};this.instance.register(u({},ex,i(i({},n),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(ex)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.instance.get_property(eR)||{};0!==Object.keys(n).length&&Object.keys(n).forEach(function(t){n[t]=i(i({},n[t]),e[t]),delete e[t]}),this.instance.register(u({},eR,i(i({},n),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property(eR)||{};this.instance.register(u({},eR,i(i({},t),{},u({},e,{}))))}else this.instance.unregister(eR)}}]),e}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return I(e)&&isFinite(e)&&Math.floor(e)===e});var eW="0123456789abcdef",ez=function(){function e(t){if(s(this,e),this.bytes=t,16!==t.length)throw TypeError("not 128-bit length")}return l(e,[{key:"toString",value:function(){for(var e="",t=0;t<this.bytes.length;t++)e=e+eW.charAt(this.bytes[t]>>>4)+eW.charAt(15&this.bytes[t]),3!==t&&5!==t&&7!==t&&9!==t||(e+="-");if(36!==e.length)throw Error("Invalid UUIDv7 was generated");return e}},{key:"clone",value:function(){return new e(this.bytes.slice(0))}},{key:"equals",value:function(e){return 0===this.compareTo(e)}},{key:"compareTo",value:function(e){for(var t=0;t<16;t++){var n=this.bytes[t]-e.bytes[t];if(0!==n)return Math.sign(n)}return 0}}],[{key:"fromFieldsV7",value:function(t,n,r,i){if(!Number.isInteger(t)||!Number.isInteger(n)||!Number.isInteger(r)||!Number.isInteger(i)||t<0||n<0||r<0||i<0||t>0xffffffffffff||n>4095||r>1073741823||i>4294967295)throw RangeError("invalid field value");var o=new Uint8Array(16);return o[0]=t/1099511627776,o[1]=t/4294967296,o[2]=t/16777216,o[3]=t/65536,o[4]=t/256,o[5]=t,o[6]=112|n>>>8,o[7]=n,o[8]=128|r>>>24,o[9]=r>>>16,o[10]=r>>>8,o[11]=r,o[12]=i>>>24,o[13]=i>>>16,o[14]=i>>>8,o[15]=i,new e(o)}}]),e}(),eV=function(){function e(){s(this,e),u(this,"timestamp",0),u(this,"counter",0),u(this,"random",new eQ)}return l(e,[{key:"generate",value:function(){var e=this.generateOrAbort();if(E(e)){this.timestamp=0;var t=this.generateOrAbort();if(E(t))throw Error("Could not generate UUID after timestamp reset");return t}return e}},{key:"generateOrAbort",value:function(){var e=Date.now();if(e>this.timestamp)this.timestamp=e,this.resetCounter();else{if(!(e+1e4>this.timestamp))return;this.counter++,this.counter>4398046511103&&(this.timestamp++,this.resetCounter())}return ez.fromFieldsV7(this.timestamp,Math.trunc(this.counter/1073741824),1073741823&this.counter,this.random.nextUint32())}},{key:"resetCounter",value:function(){this.counter=1024*this.random.nextUint32()+(1023&this.random.nextUint32())}}]),e}(),eG=function(e){if("undefined"!=typeof UUIDV7_DENY_WEAK_RNG&&UUIDV7_DENY_WEAK_RNG)throw Error("no cryptographically strong RNG available");for(var t=0;t<e.length;t++)e[t]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return e};T&&!E(T.crypto)&&crypto.getRandomValues&&(eG=function(e){return crypto.getRandomValues(e)});var eZ,eY,eJ,eQ=function(){function e(){s(this,e),u(this,"buffer",new Uint32Array(8)),u(this,"cursor",1/0)}return l(e,[{key:"nextUint32",value:function(){return this.cursor>=this.buffer.length&&(eG(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),eX=function(){return eK().toString()},eK=function(){return(eY||(eY=new eV)).generate()},e0="",e1=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,e2={is_supported:function(){return!!D},error:function(e){z.error("cookieStore error: "+e)},get:function(e){if(D){try{for(var t=e+"=",n=D.cookie.split(";").filter(function(e){return e.length}),r=0;r<n.length;r++){for(var i=n[r];" "==i.charAt(0);)i=i.substring(1,i.length);if(0===i.indexOf(t))return decodeURIComponent(i.substring(t.length,i.length))}}catch(e){}return null}},parse:function(e){var t;try{t=JSON.parse(e2.get(e))||{}}catch(e){}return t},set:function(e,t,n,r,i){if(D)try{var o="",s="",a=function(e,t){if(t){var n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:D;if(e0)return e0;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var n=e.split("."),r=Math.min(n.length,8),i="dmn_chk_"+eX(),o=RegExp("(^|;)\\s*"+i+"=1");!e0&&r--;){var s=n.slice(r).join("."),a=i+"=1;domain=."+s;t.cookie=a,o.test(t.cookie)&&(t.cookie=a+";expires=Thu, 01 Jan 1970 00:00:00 GMT",e0=s)}return e0}(e);if(!n){var r,i=(r=e.match(e1))?r[0]:"";i!==n&&z.info("Warning: cookie subdomain discovery mismatch",i,n),n=i}return n?"; domain=."+n:""}return""}(D.location.hostname,r);if(n){var l=new Date;l.setTime(l.getTime()+24*n*36e5),o="; expires="+l.toUTCString()}i&&(s="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+o+"; SameSite=Lax; path=/"+a+s;return u.length>3686.4&&z.warn("cookieStore warning: large cookie, len="+u.length),D.cookie=u,u}catch(e){return}},remove:function(e,t){try{e2.set(e,"",-1,t)}catch(e){return}}},e3=null,e6={is_supported:function(){if(!C(e3))return e3;var e=!0;if(E(T))e=!1;else try{var t="__mplssupport__";e6.set(t,"xyz"),'"xyz"'!==e6.get(t)&&(e=!1),e6.remove(t)}catch(t){e=!1}return e||z.error("localStorage unsupported; falling back to cookie store"),e3=e,e},error:function(e){z.error("localStorage error: "+e)},get:function(e){try{return null==T?void 0:T.localStorage.getItem(e)}catch(e){e6.error(e)}return null},parse:function(e){try{return JSON.parse(e6.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==T||T.localStorage.setItem(e,JSON.stringify(t))}catch(e){e6.error(e)}},remove:function(e){try{null==T||T.localStorage.removeItem(e)}catch(e){e6.error(e)}}},e5=["distinct_id",ek,ew,eL],e4=i(i({},e6),{},{parse:function(e){try{var t={};try{t=e2.parse(e)||{}}catch(e){}var n=J(t,JSON.parse(e6.get(e)||"{}"));return e6.set(e,n),n}catch(e){}return null},set:function(e,t,n,r,i){try{e6.set(e,t);var o={};e5.forEach(function(e){t[e]&&(o[e]=t[e])}),Object.keys(o).length&&e2.set(e,o,n,r,i)}catch(e){e6.error(e)}},remove:function(e,t){try{null==T||T.localStorage.removeItem(e),e2.remove(e,t)}catch(e){e6.error(e)}}}),e8={},e7={is_supported:function(){return!0},error:function(e){z.error("memoryStorage error: "+e)},get:function(e){return e8[e]||null},parse:function(e){return e8[e]||null},set:function(e,t){e8[e]=t},remove:function(e){delete e8[e]}},e9=null,te={is_supported:function(){if(!C(e9))return e9;if(e9=!0,E(T))e9=!1;else try{var e="__support__";te.set(e,"xyz"),'"xyz"'!==te.get(e)&&(e9=!1),te.remove(e)}catch(e){e9=!1}return e9},error:function(e){z.error("sessionStorage error: ",e)},get:function(e){try{return null==T?void 0:T.sessionStorage.getItem(e)}catch(e){te.error(e)}return null},parse:function(e){try{return JSON.parse(te.get(e))||null}catch(e){}return null},set:function(e,t){try{null==T||T.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){te.error(e)}},remove:function(e){try{null==T||T.sessionStorage.removeItem(e)}catch(e){te.error(e)}}},tt=["localhost","127.0.0.1"],tn=function(e){var t=null==D?void 0:D.createElement("a");return E(t)?null:(t.href=e,t)},tr=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},ti=function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",i=[];return Y(e,function(e,r){E(e)||E(r)||"undefined"===r||(t=encodeURIComponent(e instanceof File?e.name:e.toString()),n=encodeURIComponent(r),i[i.length]=n+"="+t)}),i.join(r)},to=function(e,t){for(var n,r=((e.split("#")[0]||"").split("?")[1]||"").split("&"),i=0;i<r.length;i++){var o=r[i].split("=");if(o[0]===t){n=o;break}}if(!b(n)||n.length<2)return"";var s=n[1];try{s=decodeURIComponent(s)}catch(e){z.error("Skipping decoding for malformed query param: "+s)}return s.replace(/\+/g," ")},ts=function(e,t){var n=e.match(RegExp(t+"=([^&]*)"));return n?n[1]:null},ta="Mobile",tl="Android",tu="Tablet",tc=tl+" "+tu,td="iPad",tf="Apple",th=tf+" Watch",tp="Safari",tv="BlackBerry",t_="Samsung",tg=t_+"Browser",tm=t_+" Internet",ty="Chrome",tb=ty+" OS",tk=ty+" iOS",tw="Internet Explorer",tS=tw+" "+ta,tE="Opera",tx=tE+" Mini",tR="Edge",tC="Microsoft "+tR,tP="Firefox",tI=tP+" iOS",tF="Nintendo",tT="PlayStation",tO="Xbox",tM=tl+" "+ta,tN=ta+" "+tp,tA="Windows",tL=tA+" Phone",tD="Nokia",t$="Ouya",tq="Generic",tj=tq+" "+ta.toLowerCase(),tH=tq+" "+tu.toLowerCase(),tB="Konqueror",tU="(\\d+(\\.\\d+)?)",tW=RegExp("Version/"+tU),tz=RegExp(tO,"i"),tV=RegExp(tT+" \\w+","i"),tG=RegExp(tF+" \\w+","i"),tZ=RegExp(tv+"|PlayBook|BB10","i"),tY={"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"},tJ=function(e,t){var n,r;return t=t||"",Q(e," OPR/")&&Q(e,"Mini")?tx:Q(e," OPR/")?tE:tZ.test(e)?tv:Q(e,"IE"+ta)||Q(e,"WPDesktop")?tS:Q(e,tg)?tm:Q(e,tR)||Q(e,"Edg/")?tC:Q(e,"FBIOS")?"Facebook "+ta:Q(e,"UCWEB")||Q(e,"UCBrowser")?"UC Browser":Q(e,"CriOS")?tk:Q(e,"CrMo")?ty:Q(e,tl)&&Q(e,tp)?tM:Q(e,ty)?ty:Q(e,"FxiOS")?tI:Q(e.toLowerCase(),tB.toLowerCase())?tB:(n=e,(r=t)&&Q(r,tf)||Q(n,tp)&&!Q(n,ty)&&!Q(n,tl))?Q(e,ta)?tN:tp:Q(e,tP)?tP:Q(e,"MSIE")||Q(e,"Trident/")?tw:Q(e,"Gecko")?tP:""},tQ=(u(eJ={},tS,[RegExp("rv:"+tU)]),u(eJ,tC,[RegExp(tR+"?\\/"+tU)]),u(eJ,ty,[RegExp("("+ty+"|CrMo)\\/"+tU)]),u(eJ,tk,[RegExp("CriOS\\/"+tU)]),u(eJ,"UC Browser",[RegExp("(UCBrowser|UCWEB)\\/"+tU)]),u(eJ,tp,[tW]),u(eJ,tN,[tW]),u(eJ,tE,[RegExp("(Opera|OPR)\\/"+tU)]),u(eJ,tP,[RegExp(tP+"\\/"+tU)]),u(eJ,tI,[RegExp("FxiOS\\/"+tU)]),u(eJ,tB,[RegExp("Konqueror[:/]?"+tU,"i")]),u(eJ,tv,[RegExp(tv+" "+tU),tW]),u(eJ,tM,[RegExp("android\\s"+tU,"i")]),u(eJ,tm,[RegExp(tg+"\\/"+tU)]),u(eJ,tw,[RegExp("(rv:|MSIE )"+tU)]),u(eJ,"Mozilla",[RegExp("rv:"+tU)]),eJ),tX=[[RegExp(tO+"; "+tO+" (.*?)[);]","i"),function(e){return[tO,e&&e[1]||""]}],[RegExp(tF,"i"),[tF,""]],[RegExp(tT,"i"),[tT,""]],[tZ,[tv,""]],[RegExp(tA,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[tL,""];if(new RegExp(ta).test(t)&&!/IEMobile\b/.test(t))return[tA+" "+ta,""];var n=/Windows NT ([0-9.]+)/i.exec(t);if(n&&n[1]){var r=tY[n[1]]||"";return/arm/i.test(t)&&(r="RT"),[tA,r]}return[tA,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,function(e){return e&&e[3]?["iOS",[e[3],e[4],e[5]||"0"].join(".")]:["iOS",""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,function(e){var t="";return e&&e.length>=3&&(t=E(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+tl+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+tl+")","i"),function(e){return e&&e[2]?[tl,[e[2],e[3],e[4]||"0"].join(".")]:[tl,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];if(e&&e[1]){var n=[e[1],e[2],e[3]||"0"];t[1]=n.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[tb,""]],[/Linux|debian/i,["Linux",""]]],tK=function(e){return tG.test(e)?tF:tV.test(e)?tT:tz.test(e)?tO:RegExp(t$,"i").test(e)?t$:RegExp("("+tL+"|WPDesktop)","i").test(e)?tL:/iPad/.test(e)?td:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?th:tZ.test(e)?tv:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(tD,"i").test(e)?tD:/(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(ta).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)?tl:tc:tl:RegExp("(pda|"+ta+")","i").test(e)?tj:RegExp(tu,"i").test(e)&&!RegExp(tu+" pc","i").test(e)?tH:""},t0="https?://(.*)",t1=["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gclid","gad_source","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","mc_cid","igshid","ttclid"],t2={campaignParams:function(e){return D?this._campaignParamsFromUrl(D.URL,e):{}},_campaignParamsFromUrl:function(e,t){var n=t1.concat(t||[]),r={};return Y(n,function(t){var n=to(e,t);n&&(r[t]=n)}),r},_searchEngine:function(e){return e?0===e.search(t0+"google.([^/?]*)")?"google":0===e.search(t0+"bing.com")?"bing":0===e.search(t0+"yahoo.com")?"yahoo":0===e.search(t0+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=t2._searchEngine(e),n={};if(!C(t)){n.$search_engine=t;var r=D?to(D.referrer,"yahoo"!=t?"q":"p"):"";r.length&&(n.ph_keyword=r)}return n},searchInfo:function(){var e=null==D?void 0:D.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:tJ,browserVersion:function(e,t){var n=tQ[tJ(e,t)];if(E(n))return null;for(var r=0;r<n.length;r++){var i=n[r],o=e.match(i);if(o)return parseFloat(o[o.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(var t=0;t<tX.length;t++){var n=c(tX[t],2),r=n[0],i=n[1],o=r.exec(e),s=o&&(k(i)?i(o,e):i);if(s)return s}return["",""]},device:tK,deviceType:function(e){var t=tK(e);return t===td||t===tc||"Kobo"===t||"Kindle Fire"===t||t===tH?tu:t===tF||t===tO||t===tT||t===t$?"Console":t===th?"Wearable":t?ta:"Desktop"},referrer:function(){return(null==D?void 0:D.referrer)||"$direct"},referringDomain:function(){var e;return null!=D&&D.referrer&&(null===(e=tn(D.referrer))||void 0===e?void 0:e.host)||"$direct"},referrerInfo:function(){return{$referrer:this.referrer(),$referring_domain:this.referringDomain()}},initialPersonInfo:function(){return{r:this.referrer(),u:null==$?void 0:$.href}},initialPersonPropsFromInfo:function(e){var t,n=e.r,r=e.u,i={$initial_referrer:n,$initial_referring_domain:null==n?void 0:"$direct"==n?"$direct":null===(t=tn(n))||void 0===t?void 0:t.host};if(r){i.$initial_current_url=r;var o=tn(r);i.$initial_host=null==o?void 0:o.host,i.$initial_pathname=null==o?void 0:o.pathname,Y(this._campaignParamsFromUrl(r),function(e,t){i["$initial_"+ei(t)]=e})}return n&&Y(this._searchInfoFromReferrer(n),function(e,t){i["$initial_"+ei(t)]=e}),i},properties:function(){if(!B)return{};var e=c(t2.os(B),2);return J(er({$os:e[0],$os_version:e[1],$browser:t2.browser(B,navigator.vendor),$device:t2.device(B),$device_type:t2.deviceType(B)}),{$current_url:null==$?void 0:$.href,$host:null==$?void 0:$.host,$pathname:null==$?void 0:$.pathname,$raw_user_agent:B.length>1e3?B.substring(0,997)+"...":B,$browser_version:t2.browserVersion(B,navigator.vendor),$browser_language:t2.browserLanguage(),$screen_height:null==T?void 0:T.screen.height,$screen_width:null==T?void 0:T.screen.width,$viewport_height:null==T?void 0:T.innerHeight,$viewport_width:null==T?void 0:T.innerWidth,$lib:"web",$lib_version:v.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:ee()/1e3})},people_properties:function(){if(!B)return{};var e=c(t2.os(B),2);return J(er({$os:e[0],$os_version:e[1],$browser:t2.browser(B,navigator.vendor)}),{$browser_version:t2.browserVersion(B,navigator.vendor)})}},t3=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],t6=function(){function e(t){var n;s(this,e),this.config=t,this.props={},this.campaign_params_saved=!1,this.name=(n="",t.token&&(n=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+n+"_posthog"),this.storage=this.buildStorage(t),this.load(),this.update_config(t,t),this.save()}return l(e,[{key:"buildStorage",value:function(e){-1===t3.indexOf(e.persistence.toLowerCase())&&(z.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var t=e.persistence.toLowerCase();return"localstorage"===t&&e6.is_supported()?e6:"localstorage+cookie"===t&&e4.is_supported()?e4:"sessionstorage"===t&&te.is_supported()?te:"memory"===t?e7:"cookie"===t?e2:e4.is_supported()?e4:e2}},{key:"properties",value:function(){var e={};return Y(this.props,function(t,n){if(n===eS&&w(t))for(var r,i=Object.keys(t),o=0;o<i.length;o++)e["$feature/".concat(i[o])]=t[i[o]];else r=!1,(C(e$)?r:A&&e$.indexOf===A?-1!=e$.indexOf(n):(Y(e$,function(e){if(r||(r=e===n))return V}),r))||(e[n]=t)}),e}},{key:"load",value:function(){if(!this.disabled){var e=this.storage.parse(this.name);e&&(this.props=J({},e))}}},{key:"save",value:function(){this.disabled||this.storage.set(this.name,this.props,this.expire_days,this.cross_subdomain,this.secure)}},{key:"remove",value:function(){this.storage.remove(this.name,!1),this.storage.remove(this.name,!0)}},{key:"clear",value:function(){this.remove(),this.props={}}},{key:"register_once",value:function(e,t,n){var r=this;if(w(e)){E(t)&&(t="None"),this.expire_days=E(n)?this.default_expiry:n;var i=!1;if(Y(e,function(e,n){r.props.hasOwnProperty(n)&&r.props[n]!==t||(r.props[n]=e,i=!0)}),i)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var n=this;if(w(e)){this.expire_days=E(t)?this.default_expiry:t;var r=!1;if(Y(e,function(t,i){e.hasOwnProperty(i)&&n.props[i]!==t&&(n.props[i]=t,r=!0)}),r)return this.save(),!0}return!1}},{key:"unregister",value:function(e){e in this.props&&(delete this.props[e],this.save())}},{key:"update_campaign_params",value:function(){this.campaign_params_saved||(this.register(t2.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(t2.searchInfo())}},{key:"update_referrer_info",value:function(){this.register(t2.referrerInfo())}},{key:"set_initial_person_info",value:function(){this.props[eM]||this.props[eN]||this.register_once(u({},eA,t2.initialPersonInfo()),void 0)}},{key:"get_referrer_info",value:function(){return er({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,t={};Y([eN,eM],function(n){var r=e.props[n];r&&Y(r,function(e,n){t["$initial_"+ei(n)]=e})});var n=this.props[eA];return n&&J(t,t2.initialPersonPropsFromInfo(n)),t}},{key:"safe_merge",value:function(e){return Y(this.props,function(t,n){n in e||(e[n]=t)}),e}},{key:"update_config",value:function(e,t){if(this.default_expiry=this.expire_days=e.cookie_expiration,this.set_disabled(e.disable_persistence),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==t.persistence){var n=this.buildStorage(e),r=this.props;this.clear(),this.storage=n,this.props=r,this.save()}}},{key:"set_disabled",value:function(e){this.disabled=e,this.disabled?this.remove():this.save()}},{key:"set_cross_subdomain",value:function(e){e!==this.cross_subdomain&&(this.cross_subdomain=e,this.remove(),this.save())}},{key:"get_cross_subdomain",value:function(){return!!this.cross_subdomain}},{key:"set_secure",value:function(e){e!==this.secure&&(this.secure=e,this.remove(),this.save())}},{key:"set_event_timer",value:function(e,t){var n=this.props[ec]||{};n[e]=t,this.props[ec]=n,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[ec]||{})[e];return E(t)||(delete this.props[ec][e],this.save()),t}},{key:"get_property",value:function(e){return this.props[e]}},{key:"set_property",value:function(e,t){this.props[e]=t,this.save()}}]),e}(),t5=((nR=t5||{})[nR.DomContentLoaded=0]="DomContentLoaded",nR[nR.Load=1]="Load",nR[nR.FullSnapshot=2]="FullSnapshot",nR[nR.IncrementalSnapshot=3]="IncrementalSnapshot",nR[nR.Meta=4]="Meta",nR[nR.Custom=5]="Custom",nR[nR.Plugin=6]="Plugin",nR),t4=((nC=t4||{})[nC.Mutation=0]="Mutation",nC[nC.MouseMove=1]="MouseMove",nC[nC.MouseInteraction=2]="MouseInteraction",nC[nC.Scroll=3]="Scroll",nC[nC.ViewportResize=4]="ViewportResize",nC[nC.Input=5]="Input",nC[nC.TouchMove=6]="TouchMove",nC[nC.MediaInteraction=7]="MediaInteraction",nC[nC.StyleSheetRule=8]="StyleSheetRule",nC[nC.CanvasMutation=9]="CanvasMutation",nC[nC.Font=10]="Font",nC[nC.Log=11]="Log",nC[nC.Drag=12]="Drag",nC[nC.StyleDeclaration=13]="StyleDeclaration",nC[nC.Selection=14]="Selection",nC[nC.AdoptedStyleSheet=15]="AdoptedStyleSheet",nC[nC.CustomElement=16]="CustomElement",nC);function t8(e){return e?G(e).split(/\s+/):[]}function t7(e){var t="";switch(o(e.className)){case"string":t=e.className;break;case"object":t=("baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return t8(t)}function t9(e){return P(e)?null:G(e).split(/(\s+)/).filter(function(e){return nv(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function ne(e){var t="";return na(e)&&!nl(e)&&e.childNodes&&e.childNodes.length&&Y(e.childNodes,function(e){var n;nr(e)&&e.textContent&&(t+=null!==(n=t9(e.textContent))&&void 0!==n?n:"")}),G(t)}function nt(e){return!!e&&1===e.nodeType}function nn(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function nr(e){return!!e&&3===e.nodeType}function ni(e){return!!e&&11===e.nodeType}var no=["a","button","form","input","select","textarea","label"];function ns(e){var t=e.parentNode;return!(!t||!nt(t))&&t}function na(e){for(var t=e;t.parentNode&&!nn(t,"body");t=t.parentNode){var n=t7(t);if(Q(n,"ph-sensitive")||Q(n,"ph-no-capture"))return!1}if(Q(t7(e),"ph-include"))return!0;var r=e.type||"";if(x(r))switch(r.toLowerCase()){case"hidden":case"password":return!1}var i=e.name||e.id||"";return!(x(i)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(i.replace(/[^a-zA-Z0-9]/g,"")))}function nl(e){return!!(nn(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||nn(e,"select")||nn(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var nu="(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})",nc=new RegExp("^(?:".concat(nu,")$")),nd=new RegExp(nu),nf="\\d{3}-?\\d{2}-?\\d{4}",nh=new RegExp("^(".concat(nf,")$")),np=new RegExp("(".concat(nf,")"));function nv(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!(P(e)||x(e)&&(e=G(e),(t?nc:nd).test((e||"").replace(/[- ]/g,""))||(t?nh:np).test(e)))}function n_(e){var t=ne(e);return nv(t="".concat(t," ").concat(function e(t){var n="";return t&&t.childNodes&&t.childNodes.length&&Y(t.childNodes,function(t){var r;if(t&&"span"===(null===(r=t.tagName)||void 0===r?void 0:r.toLowerCase()))try{var i=ne(t);n="".concat(n," ").concat(i).trim(),t.childNodes&&t.childNodes.length&&(n="".concat(n," ").concat(e(t)).trim())}catch(e){z.error(e)}}),n}(e)).trim())?t:""}function ng(e){return e.replace(/"|\\"/g,'\\"')}var nm="[SessionRecording]",ny="redacted",nb={initiatorTypes:["audio","beacon","body","css","early-hint","embed","fetch","frame","iframe","icon","image","img","input","link","navigation","object","ping","script","track","video","xmlhttprequest"],maskRequestFn:function(e){return e},recordHeaders:!1,recordBody:!1,recordInitialRequests:!1,recordPerformance:!1,performanceEntryTypeToObserve:["first-input","navigation","paint","resource"],payloadSizeLimitBytes:1e6,payloadHostDenyList:[".lr-ingest.io",".ingest.sentry.io"]},nk=["authorization","x-forwarded-for","authorization","cookie","set-cookie","x-api-key","x-real-ip","remote-addr","forwarded","proxy-authorization","x-csrf-token","x-csrftoken","x-xsrf-token"],nw=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],nS=["/s/","/e/","/i/"];function nE(e,t,n,r){if(P(e))return e;var i=(null==t?void 0:t["content-length"])||new Blob([e]).size;return x(i)&&(i=parseInt(i)),i>n?nm+" ".concat(r," body too large to record (").concat(i," bytes)"):e}function nx(e,t){if(P(e))return e;var n=e;return nv(n,!1)||(n=nm+" "+t+" body "+ny),Y(nw,function(e){var r,i;null!==(r=n)&&void 0!==r&&r.length&&-1!==(null===(i=n)||void 0===i?void 0:i.indexOf(e))&&(n=nm+" "+t+" body "+ny+" as might contain: "+e)}),n}var nR,nC,nP,nI=function(e,t){var n,r,o={payloadSizeLimitBytes:nb.payloadSizeLimitBytes,performanceEntryTypeToObserve:d(nb.performanceEntryTypeToObserve),payloadHostDenyList:[].concat(d(t.payloadHostDenyList||[]),d(nb.payloadHostDenyList))},s=!1!==e.session_recording.recordHeaders&&t.recordHeaders,a=!1!==e.session_recording.recordBody&&t.recordBody,l=!1!==e.capture_performance&&t.recordPerformance,u=(r=Math.min(1e6,null!==(n=o.payloadSizeLimitBytes)&&void 0!==n?n:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=nE(e.requestBody,e.requestHeaders,r,"Request")),null!=e&&e.responseBody&&(e.responseBody=nE(e.responseBody,e.responseHeaders,r,"Response")),e}),c=function(e){var t;return u(function(e){var t=tn(e.name);if(!(t&&t.pathname&&nS.some(function(e){return 0===t.pathname.indexOf(e)})))return e}((P(t=e.requestHeaders)||Y(Object.keys(null!=t?t:{}),function(e){nk.includes(e.toLowerCase())&&(t[e]=ny)}),e)))},f=k(e.session_recording.maskNetworkRequestFn);return f&&k(e.session_recording.maskCapturedNetworkRequestFn)&&z.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),f&&(e.session_recording.maskCapturedNetworkRequestFn=function(t){var n=e.session_recording.maskNetworkRequestFn({url:t.name});return i(i({},t),{},{name:null==n?void 0:n.url})}),o.maskRequestFn=k(e.session_recording.maskCapturedNetworkRequestFn)?function(t){var n,r,i,o=c(t);return o&&null!==(n=null===(r=(i=e.session_recording).maskCapturedNetworkRequestFn)||void 0===r?void 0:r.call(i,o))&&void 0!==n?n:void 0}:function(e){return function(e){if(!E(e))return e.requestBody=nx(e.requestBody,"Request"),e.responseBody=nx(e.responseBody,"Response"),e}(c(e))},i(i(i({},nb),o),{},{recordHeaders:s,recordBody:a,recordPerformance:l,recordInitialRequests:l})},nF=l(function e(t){var n,r,i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),u(this,"bucketSize",100),u(this,"refillRate",10),u(this,"mutationBuckets",{}),u(this,"loggedTracker",{}),u(this,"refillBuckets",function(){Object.keys(i.mutationBuckets).forEach(function(e){i.mutationBuckets[e]=i.mutationBuckets[e]+i.refillRate,i.mutationBuckets[e]>=i.bucketSize&&delete i.mutationBuckets[e]})}),u(this,"getNodeOrRelevantParent",function(e){var t=i.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var n=t.closest("svg");if(n)return[i.rrweb.mirror.getId(n),n]}return[e,t]}),u(this,"numberOfChanges",function(e){var t,n,r,i,o,s,a,l;return(null!==(t=null===(n=e.removes)||void 0===n?void 0:n.length)&&void 0!==t?t:0)+(null!==(r=null===(i=e.attributes)||void 0===i?void 0:i.length)&&void 0!==r?r:0)+(null!==(o=null===(s=e.texts)||void 0===s?void 0:s.length)&&void 0!==o?o:0)+(null!==(a=null===(l=e.adds)||void 0===l?void 0:l.length)&&void 0!==a?a:0)}),u(this,"throttleMutations",function(e){if(3!==e.type||0!==e.data.source)return e;var t=e.data,n=i.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter(function(e){var t,n,r,o=c(i.getNodeOrRelevantParent(e.id),2),s=o[0],a=o[1];return 0!==i.mutationBuckets[s]&&(i.mutationBuckets[s]=null!==(t=i.mutationBuckets[s])&&void 0!==t?t:i.bucketSize,i.mutationBuckets[s]=Math.max(i.mutationBuckets[s]-1,0),0===i.mutationBuckets[s]&&(i.loggedTracker[s]||(i.loggedTracker[s]=!0,null===(n=(r=i.options).onBlockedNode)||void 0===n||n.call(r,s,a))),e)}));var r=i.numberOfChanges(t);return 0!==r||n===r?e:void 0}),this.rrweb=t,this.options=o,this.refillRate=null!==(n=this.options.refillRate)&&void 0!==n?n:this.refillRate,this.bucketSize=null!==(r=this.options.bucketSize)&&void 0!==r?r:this.bucketSize,setInterval(function(){i.refillBuckets()},1e3)}),nT=[t4.MouseMove,t4.MouseInteraction,t4.Scroll,t4.ViewportResize,t4.Input,t4.TouchMove,t4.MediaInteraction,t4.Drag],nO=function(e){return{rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}},nM="[SessionRecording]",nN=function(){function e(t){var n=this;if(s(this,e),u(this,"queuedRRWebEvents",[]),u(this,"isIdle",!1),u(this,"_linkedFlagSeen",!1),u(this,"_lastActivityTimestamp",Date.now()),u(this,"_linkedFlag",null),u(this,"_forceAllowLocalhostNetworkCapture",!1),u(this,"_samplingSessionListener",null),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,null==T||T.addEventListener("beforeunload",function(){n._flushBuffer()}),null==T||T.addEventListener("offline",function(){n._tryAddCustomEvent("browser offline",{})}),null==T||T.addEventListener("online",function(){n._tryAddCustomEvent("browser online",{})}),null==T||T.addEventListener("visibilitychange",function(){if(null!=D&&D.visibilityState){var e="window "+D.visibilityState;n._tryAddCustomEvent(e,{})}}),!this.instance.sessionManager)throw z.error(nM+" started without valid sessionManager"),Error(nM+" started without valid sessionManager. This is a bug.");var r=this.sessionManager.checkAndGetSessionAndWindowId(),i=r.sessionId,o=r.windowId;this.sessionId=i,this.windowId=o,this.buffer=this.clearBuffer(),this._setupSampling()}return l(e,[{key:"rrwebRecord",get:function(){var e;return null==U||null===(e=U.rrweb)||void 0===e?void 0:e.record}},{key:"started",get:function(){return this._captureStarted}},{key:"sessionManager",get:function(){if(!this.instance.sessionManager)throw Error(nM+" must be started with a valid sessionManager.");return this.instance.sessionManager}},{key:"fullSnapshotIntervalMillis",get:function(){var e;return(null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.full_snapshot_interval_millis)||3e5}},{key:"isSampled",get:function(){var e=this.instance.get_property(ew);return F(e)?e:null}},{key:"sessionDuration",get:function(){var e,t,n=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],r=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return n?n.timestamp-r:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(ev),t=!this.instance.config.disable_session_recording;return T&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(e_),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(em);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var e,t,n=this.instance.get_property(eg),r={recordHeaders:null===(e=this.instance.config.session_recording)||void 0===e?void 0:e.recordHeaders,recordBody:null===(t=this.instance.config.session_recording)||void 0===t?void 0:t.recordBody},i=(null==r?void 0:r.recordHeaders)||(null==n?void 0:n.recordHeaders),o=(null==r?void 0:r.recordBody)||(null==n?void 0:n.recordBody),s=w(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(F(s)?s:null==n?void 0:n.capturePerformance);return i||o||a?{recordHeaders:i,recordBody:o,recordPerformance:a}:void 0}},{key:"sampleRate",get:function(){var e=this.instance.get_property(ey);return I(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(eb);return I(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?P(this._linkedFlag)||this._linkedFlagSeen?F(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startIfEnabledOrStop",value:function(){this.isRecordingEnabled?(this._startCapture(),z.info(nM+" started")):(this.stopRecording(),this.clearBuffer())}},{key:"stopRecording",value:function(){this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,z.info(nM+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,n,r=this.sessionId!==e,i=this.sampleRate;if(I(i)){var o,s=this.isSampled,a=r||!F(s);(o=a?Math.random()<i:s)||!a||z.warn(nM+" Sample rate (".concat(i,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:i}),null===(n=this.instance.persistence)||void 0===n||n.register(u({},ew,o))}else null===(t=this.instance.persistence)||void 0===t||t.register(u({},ew,null))}},{key:"afterDecideResponse",value:function(e){var t,n,r,i=this;if(this._persistDecideResponse(e),this._linkedFlag=(null===(t=e.sessionRecording)||void 0===t?void 0:t.linkedFlag)||null,null!==(n=e.sessionRecording)&&void 0!==n&&n.endpoint&&(this._endpoint=null===(r=e.sessionRecording)||void 0===r?void 0:r.endpoint),this._setupSampling(),!P(this._linkedFlag)){var o=x(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,s=x(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(function(e,t){var n=w(t)&&o in t,r=s?t[o]===s:n;if(r){var a={linkedFlag:o,linkedVariant:s},l="linked flag matched";z.info(nM+" "+l,a),i._tryAddCustomEvent(l,a)}i._linkedFlagSeen=r})}this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;I(this.sampleRate)&&C(this._samplingSessionListener)&&(this._samplingSessionListener=this.sessionManager.onSessionId(function(t){e.makeSamplingDecision(t)}))}},{key:"_persistDecideResponse",value:function(e){if(this.instance.persistence){var t=this.instance.persistence,n=function(){var n,r,o,s,a,l,c,d,f=null===(n=e.sessionRecording)||void 0===n?void 0:n.sampleRate,h=P(f)?null:parseFloat(f),p=null===(r=e.sessionRecording)||void 0===r?void 0:r.minimumDurationMilliseconds;t.register((u(d={},ev,!!e.sessionRecording),u(d,e_,null===(o=e.sessionRecording)||void 0===o?void 0:o.consoleLogRecordingEnabled),u(d,eg,i({capturePerformance:e.capturePerformance},null===(s=e.sessionRecording)||void 0===s?void 0:s.networkPayloadCapture)),u(d,em,{enabled:null===(a=e.sessionRecording)||void 0===a?void 0:a.recordCanvas,fps:null===(l=e.sessionRecording)||void 0===l?void 0:l.canvasFps,quality:null===(c=e.sessionRecording)||void 0===c?void 0:c.canvasQuality}),u(d,ey,h),u(d,eb,E(p)?null:p),d))};n(),this.sessionManager.onSessionId(n)}}},{key:"log",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"log";null===(t=this.instance.sessionRecording)||void 0===t||t.onRRwebEmit({type:6,data:{plugin:"rrweb/console@1",payload:{level:n,trace:[],payload:[JSON.stringify(e)]}},timestamp:ee()})}},{key:"_startCapture",value:function(){var e=this;E(Object.assign)||this._captureStarted||this.instance.config.disable_session_recording||this.instance.consent.isOptedOut()||(this._captureStarted=!0,this.sessionManager.checkAndGetSessionAndWindowId(),this.rrwebRecord?this._onScriptLoaded():this.instance.requestRouter.loadScript("/static/recorder.js?v=".concat(v.LIB_VERSION),function(t){if(t)return z.error(nM+" could not load recorder.js",t);e._onScriptLoaded()}))}},{key:"isInteractiveEvent",value:function(e){var t;return 3===e.type&&-1!==nT.indexOf(null===(t=e.data)||void 0===t?void 0:t.source)}},{key:"_updateWindowAndSessionIds",value:function(e){var t=this.isInteractiveEvent(e);t||this.isIdle||e.timestamp-this._lastActivityTimestamp>3e5&&(this.isIdle=!0,clearTimeout(this._fullSnapshotTimer),this._flushBuffer());var n=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),n=!0)),!this.isIdle){var r=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),i=r.windowId,o=r.sessionId,s=this.sessionId!==o,a=this.windowId!==i;this.windowId=i,this.sessionId=o,(n||-1===[2,4].indexOf(e.type)&&(a||s||E(this._fullSnapshotTimer)))&&this._tryTakeFullSnapshot()}}},{key:"_tryRRWebMethod",value:function(e){try{return e.rrwebMethod(),!0}catch(t){return this.queuedRRWebEvents.length<10?this.queuedRRWebEvents.push({enqueuedAt:e.enqueuedAt||Date.now(),attempt:e.attempt++,rrwebMethod:e.rrwebMethod}):z.warn(nM+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var n=this;return this._tryRRWebMethod(nO(function(){return n.rrwebRecord.addCustomEvent(e,t)}))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(nO(function(){return e.rrwebRecord.takeFullSnapshot()}))}},{key:"_onScriptLoaded",value:function(){for(var e,t=this,n={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},r=this.instance.config.session_recording,o=0,s=Object.entries(r||{});o<s.length;o++){var a=c(s[o],2),l=a[0],u=a[1];l in n&&(n[l]=u)}if(this.canvasRecording&&this.canvasRecording.enabled&&(n.recordCanvas=!0,n.sampling={canvas:this.canvasRecording.fps},n.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new nF(this.rrwebRecord,{onBlockedNode:function(e,n){var r="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");z.info(r,{node:n}),t.log(nM+" "+r,"warn")}});var d=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(i({emit:function(e){t.onRRwebEmit(e)},plugins:d},n)),this.instance._addCaptureHook(function(e){try{if("$pageview"===e){var n=T?t._maskUrl(T.location.href):"";if(!n)return;t._tryAddCustomEvent("$pageview",{href:n})}}catch(e){z.error("Could not add $pageview to rrweb session",e)}}),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:n,activePlugins:d.map(function(e){return null==e?void 0:e.name})}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else z.error(nM+"onScriptLoaded was called but rrwebRecord is not available. This indicates something has gone wrong.")}},{key:"_scheduleFullSnapshot",value:function(){var e=this;if(this._fullSnapshotTimer&&clearInterval(this._fullSnapshotTimer),!this.isIdle){var t=this.fullSnapshotIntervalMillis;t&&(this._fullSnapshotTimer=setInterval(function(){e._tryTakeFullSnapshot()},t))}}},{key:"_gatherRRWebPlugins",value:function(){var e=[];return U.rrwebConsoleRecord&&this.isConsoleLogCaptureEnabled&&e.push(U.rrwebConsoleRecord.getRecordConsolePlugin()),this.networkPayloadCapture&&k(U.getRecordNetworkPlugin)&&(!tt.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(U.getRecordNetworkPlugin(nI(this.instance.config,this.networkPayloadCapture))):z.info(nM+" NetworkCapture not started because we are on localhost.")),e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&w(e)){if(e.type===t5.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===t5.FullSnapshot&&this._scheduleFullSnapshot();var n=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(n){var r,i=function(e){if(e&&w(e)&&6===e.type&&w(e.data)&&"rrweb/console@1"===e.data.plugin){e.data.payload.payload.length>10&&(e.data.payload.payload=e.data.payload.payload.slice(0,10),e.data.payload.payload.push("...[truncated]"));for(var t=[],n=0;n<e.data.payload.payload.length;n++)e.data.payload.payload[n]&&e.data.payload.payload[n].length>2e3?t.push(e.data.payload.payload[n].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[n]);return e.data.payload.payload=t,e}return e}(n),o=JSON.stringify(i,(r=[],function(e,t){if(w(t)){for(;r.length>0&&r.at(-1)!==this;)r.pop();return r.includes(t)?"[Circular]":(r.push(t),t)}return t})).length;if(this._updateWindowAndSessionIds(i),!this.isIdle||i.type===t5.Custom){var s={$snapshot_bytes:o,$snapshot_data:i,$session_id:this.sessionId,$window_id:this.windowId};"disabled"!==this.status?this._captureSnapshotBuffered(s):this.clearBuffer()}}}}},{key:"_pageViewFallBack",value:function(){if(!this.instance.config.capture_pageview&&T){var e=this._maskUrl(T.location.href);this._lastHref!==e&&(this._tryAddCustomEvent("$url_changed",{href:e}),this._lastHref=e)}}},{key:"_processQueuedEvents",value:function(){var e=this;if(this.queuedRRWebEvents.length){var t=d(this.queuedRRWebEvents);this.queuedRRWebEvents=[],t.forEach(function(t){Date.now()-t.enqueuedAt<=2e3&&e._tryRRWebMethod(t)})}}},{key:"_maskUrl",value:function(e){var t=this.instance.config.session_recording;if(t.maskNetworkRequestFn){var n,r={url:e};return null===(n=r=t.maskNetworkRequestFn(r))||void 0===n?void 0:n.url}return e}},{key:"clearBuffer",value:function(){return this.buffer={size:0,data:[],sessionId:this.sessionId,windowId:this.windowId},this.buffer}},{key:"_flushBuffer",value:function(){var e=this;this.flushBufferTimer&&(clearTimeout(this.flushBufferTimer),this.flushBufferTimer=void 0);var t=this.minimumDuration,n=this.sessionDuration,r=I(n)&&n>=0,i=I(t)&&r&&n<t;return"buffering"===this.status||i?(this.flushBufferTimer=setTimeout(function(){e._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&this._captureSnapshot({$snapshot_bytes:this.buffer.size,$snapshot_data:this.buffer.data,$session_id:this.buffer.sessionId,$window_id:this.buffer.windowId}),this.clearBuffer())}},{key:"_captureSnapshotBuffered",value:function(e){var t,n=this,r=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);(this.buffer.size+e.$snapshot_bytes+r>943718.4||this.buffer.sessionId!==this.sessionId)&&(this.buffer=this._flushBuffer()),this.buffer.size+=e.$snapshot_bytes,this.buffer.data.push(e.$snapshot_data),this.flushBufferTimer||(this.flushBufferTimer=setTimeout(function(){n._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",_noHeatmaps:!0})}}]),e}(),nA=function(){function e(t){s(this,e),this.instance=t,this.instance.decideEndpointWasHit=this.instance._hasBootstrappedFeatureFlags()}return l(e,[{key:"call",value:function(){var e=this,t={token:this.instance.config.token,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),person_properties:this.instance.get_property(ex),group_properties:this.instance.get_property(eR),disable_flags:this.instance.config.advanced_disable_feature_flags||this.instance.config.advanced_disable_feature_flags_on_first_load||void 0};this.instance._send_request({method:"POST",url:this.instance.requestRouter.endpointFor("api","/decide/?v=3"),data:t,compression:this.instance.config.disable_compression?void 0:K.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){return e.parseDecideResponse(t.json)}})}},{key:"parseDecideResponse",value:function(e){var t=this;this.instance.featureFlags.setReloadingPaused(!1),this.instance.featureFlags._startReloadTimer();var n=!e;if(this.instance.config.advanced_disable_feature_flags_on_first_load||this.instance.config.advanced_disable_feature_flags||this.instance.featureFlags.receivedFeatureFlags(null!=e?e:{},n),n)z.error("Failed to fetch feature flags from PostHog.");else{if(!D||!D.body)return z.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(function(){t.parseDecideResponse(e)},500);if(this.instance._afterDecideResponse(e),e.siteApps){if(this.instance.config.opt_in_site_apps){var r,i=p(e.siteApps);try{for(i.s();!(r=i.n()).done;)(function(){var e=r.value,n=e.id,i=e.url,o=t.instance.requestRouter.endpointFor("api",i);U["__$$ph_site_app_".concat(n)]=t.instance,t.instance.requestRouter.loadScript(o,function(e){e&&z.error("Error while initializing PostHog app with config id ".concat(n),e)})})()}catch(e){i.e(e)}finally{i.f()}}else e.siteApps.length>0&&z.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}}]),e}(),nL=null!=T&&T.location?ts(T.location.hash,"__posthog")||ts(location.hash,"state"):null,nD="_postHogToolbarParams";(rp=nP||(nP={}))[rp.UNINITIALIZED=0]="UNINITIALIZED",rp[rp.LOADING=1]="LOADING",rp[rp.LOADED=2]="LOADED";var n$=function(){function e(t){s(this,e),this.instance=t}return l(e,[{key:"setToolbarState",value:function(e){U.ph_toolbar_state=e}},{key:"getToolbarState",value:function(){var e;return null!==(e=U.ph_toolbar_state)&&void 0!==e?e:nP.UNINITIALIZED}},{key:"maybeLoadToolbar",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!T||!D)return!1;n=null!==(e=n)&&void 0!==e?e:T.location,i=null!==(t=i)&&void 0!==t?t:T.history;try{if(!r){try{T.localStorage.setItem("test","test"),T.localStorage.removeItem("test")}catch(e){return!1}r=null==T?void 0:T.localStorage}var o,s=nL||ts(n.hash,"__posthog")||ts(n.hash,"state"),a=s?et(function(){return JSON.parse(atob(decodeURIComponent(s)))})||et(function(){return JSON.parse(decodeURIComponent(s))}):null;return a&&"ph_authorize"===a.action?((o=a).source="url",o&&Object.keys(o).length>0&&(a.desiredHash?n.hash=a.desiredHash:i?i.replaceState(i.state,"",n.pathname+n.search):n.hash="")):((o=JSON.parse(r.getItem(nD)||"{}")).source="localstorage",delete o.userIntent),!(!o.token||this.instance.config.token!==o.token)&&(this.loadToolbar(o),!0)}catch(e){return!1}}},{key:"_callLoadToolbar",value:function(e){(U.ph_load_toolbar||U.ph_load_editor)(e,this.instance)}},{key:"loadToolbar",value:function(e){var t=this,n=!(null==D||!D.getElementById(eD));if(!T||n)return!1;var r="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,o=i(i({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},r?{instrument:!1}:{});if(T.localStorage.setItem(nD,JSON.stringify(i(i({},o),{},{source:void 0}))),this.getToolbarState()===nP.LOADED)this._callLoadToolbar(o);else if(this.getToolbarState()===nP.UNINITIALIZED){this.setToolbarState(nP.LOADING);var s=3e5*Math.floor(Date.now()/3e5);this.instance.requestRouter.loadScript("/static/toolbar.js?t=".concat(s),function(e){if(e)return z.error("Failed to load toolbar",e),void t.setToolbarState(nP.UNINITIALIZED);t.setToolbarState(nP.LOADED),t._callLoadToolbar(o)}),es(T,"turbolinks:load",function(){t.setToolbarState(nP.UNINITIALIZED),t.loadToolbar(o)})}return!0}},{key:"_loadEditor",value:function(e){return this.loadToolbar(e)}},{key:"maybeLoadEditor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,n)}}]),e}(),nq=function(){function e(t){s(this,e),u(this,"isPaused",!0),u(this,"queue",[]),u(this,"flushTimeoutMs",3e3),this.sendRequest=t}return l(e,[{key:"enqueue",value:function(e){this.queue.push(e),this.flushTimeout||this.setFlushTimeout()}},{key:"unload",value:function(){var e=this;this.clearFlushTimeout();var t=Object.values(this.queue.length>0?this.formatQueue():{});[].concat(d(t.filter(function(e){return 0===e.url.indexOf("/e")})),d(t.filter(function(e){return 0!==e.url.indexOf("/e")}))).map(function(t){e.sendRequest(i(i({},t),{},{transport:"sendBeacon"}))})}},{key:"enable",value:function(){this.isPaused=!1,this.setFlushTimeout()}},{key:"setFlushTimeout",value:function(){var e=this;this.isPaused||(this.flushTimeout=setTimeout(function(){if(e.clearFlushTimeout(),e.queue.length>0){var t=e.formatQueue();for(var n in t)(function(n){var r=t[n],i=(new Date).getTime();r.data&&b(r.data)&&Y(r.data,function(e){e.offset=Math.abs(e.timestamp-i),delete e.timestamp}),e.sendRequest(r)})(n)}},this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return Y(this.queue,function(t){var n,r=(t?t.batchKey:null)||t.url;E(e[r])&&(e[r]=i(i({},t),{},{data:[]})),null===(n=e[r].data)||void 0===n||n.push(t.data)}),this.queue=[],e}}]),e}(),nj=Uint8Array,nH=Uint16Array,nB=Uint32Array,nU=new nj([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]),nW=new nj([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]),nz=new nj([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),nV=function(e,t){for(var n=new nH(31),r=0;r<31;++r)n[r]=t+=1<<e[r-1];var i=new nB(n[30]);for(r=1;r<30;++r)for(var o=n[r];o<n[r+1];++o)i[o]=o-n[r]<<5|r;return[n,i]},nG=nV(nU,2),nZ=nG[0],nY=nG[1];nZ[28]=258,nY[258]=28;for(var nJ=nV(nW,0)[1],nQ=new nH(32768),nX=0;nX<32768;++nX){var nK=(43690&nX)>>>1|(21845&nX)<<1;nK=(61680&(nK=(52428&nK)>>>2|(13107&nK)<<2))>>>4|(3855&nK)<<4,nQ[nX]=((65280&nK)>>>8|(255&nK)<<8)>>>1}var n0=function(e,t,n){for(var r=e.length,i=0,o=new nH(t);i<r;++i)++o[e[i]-1];var s,a=new nH(t);for(i=0;i<t;++i)a[i]=a[i-1]+o[i-1]<<1;if(n){s=new nH(1<<t);var l=15-t;for(i=0;i<r;++i)if(e[i])for(var u=i<<4|e[i],c=t-e[i],d=a[e[i]-1]++<<c,f=d|(1<<c)-1;d<=f;++d)s[nQ[d]>>>l]=u}else for(s=new nH(r),i=0;i<r;++i)s[i]=nQ[a[e[i]-1]++]>>>15-e[i];return s},n1=new nj(288);for(nX=0;nX<144;++nX)n1[nX]=8;for(nX=144;nX<256;++nX)n1[nX]=9;for(nX=256;nX<280;++nX)n1[nX]=7;for(nX=280;nX<288;++nX)n1[nX]=8;var n2=new nj(32);for(nX=0;nX<32;++nX)n2[nX]=5;var n3=n0(n1,9,0),n6=n0(n2,5,0),n5=function(e){return(e/8>>0)+(7&e&&1)},n4=function(e,t,n){(null==t||t<0)&&(t=0),(null==n||n>e.length)&&(n=e.length);var r=new(e instanceof nH?nH:e instanceof nB?nB:nj)(n-t);return r.set(e.subarray(t,n)),r},n8=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8},n7=function(e,t,n){n<<=7&t;var r=t/8>>0;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},n9=function(e,t){for(var n=[],r=0;r<e.length;++r)e[r]&&n.push({s:r,f:e[r]});var i=n.length,o=n.slice();if(!i)return[new nj(0),0];if(1==i){var s=new nj(n[0].s+1);return s[n[0].s]=1,[s,1]}n.sort(function(e,t){return e.f-t.f}),n.push({s:-1,f:25001});var a=n[0],l=n[1],u=0,c=1,d=2;for(n[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=i-1;)a=n[n[u].f<n[d].f?u++:d++],l=n[u!=c&&n[u].f<n[d].f?u++:d++],n[c++]={s:-1,f:a.f+l.f,l:a,r:l};var f=o[0].s;for(r=1;r<i;++r)o[r].s>f&&(f=o[r].s);var h=new nH(f+1),p=re(n[c-1],h,0);if(p>t){r=0;var v=0,_=p-t,g=1<<_;for(o.sort(function(e,t){return h[t.s]-h[e.s]||e.f-t.f});r<i;++r){var m=o[r].s;if(!(h[m]>t))break;v+=g-(1<<p-h[m]),h[m]=t}for(v>>>=_;v>0;){var y=o[r].s;h[y]<t?v-=1<<t-h[y]++-1:++r}for(;r>=0&&v;--r){var b=o[r].s;h[b]==t&&(--h[b],++v)}p=t}return[new nj(h),p]},re=function e(t,n,r){return -1==t.s?Math.max(e(t.l,n,r+1),e(t.r,n,r+1)):n[t.s]=r},rt=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new nH(++t),r=0,i=e[0],o=1,s=function(e){n[r++]=e},a=1;a<=t;++a)if(e[a]==i&&a!=t)++o;else{if(!i&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(i),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(i);o=1,i=e[a]}return[n.subarray(0,r),t]},rn=function(e,t){for(var n=0,r=0;r<t.length;++r)n+=e[r]*t[r];return n},rr=function(e,t,n){var r=n.length,i=n5(t+2);e[i]=255&r,e[i+1]=r>>>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var o=0;o<r;++o)e[i+o+4]=n[o];return 8*(i+4+r)},ri=function(e,t,n,r,i,o,s,a,l,u,c){n8(t,c++,n),++i[256];for(var d=n9(i,15),f=d[0],h=d[1],p=n9(o,15),v=p[0],_=p[1],g=rt(f),m=g[0],y=g[1],b=rt(v),k=b[0],w=b[1],S=new nH(19),E=0;E<m.length;++E)S[31&m[E]]++;for(E=0;E<k.length;++E)S[31&k[E]]++;for(var x=n9(S,7),R=x[0],C=x[1],P=19;P>4&&!R[nz[P-1]];--P);var I,F,T,O,M=u+5<<3,N=rn(i,n1)+rn(o,n2)+s,A=rn(i,f)+rn(o,v)+s+14+3*P+rn(S,R)+(2*S[16]+3*S[17]+7*S[18]);if(M<=N&&M<=A)return rr(t,c,e.subarray(l,l+u));if(n8(t,c,1+(A<N)),c+=2,A<N){I=n0(f,h,0),F=f,T=n0(v,_,0),O=v;var L=n0(R,C,0);for(n8(t,c,y-257),n8(t,c+5,w-1),n8(t,c+10,P-4),c+=14,E=0;E<P;++E)n8(t,c+3*E,R[nz[E]]);c+=3*P;for(var D=[m,k],$=0;$<2;++$){var q=D[$];for(E=0;E<q.length;++E){var j=31&q[E];n8(t,c,L[j]),c+=R[j],j>15&&(n8(t,c,q[E]>>>5&127),c+=q[E]>>>12)}}}else I=n3,F=n1,T=n6,O=n2;for(E=0;E<a;++E)if(r[E]>255){n7(t,c,I[(j=r[E]>>>18&31)+257]),c+=F[j+257],j>7&&(n8(t,c,r[E]>>>23&31),c+=nU[j]);var H=31&r[E];n7(t,c,T[H]),c+=O[H],H>3&&(n7(t,c,r[E]>>>5&8191),c+=nW[H])}else n7(t,c,I[r[E]]),c+=F[r[E]];return n7(t,c,I[256]),c+F[256]},ro=new nB([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),rs=new nj(0),ra=function(){for(var e=new nB(256),t=0;t<256;++t){for(var n=t,r=9;--r;)n=(1&n&&3988292384)^n>>>1;e[t]=n}return e}(),rl=function(e,t,n){for(;n;++t)e[t]=n,n>>>=8},ru=!!j||!!q,rc="text/plain",rd=function(e,t){var n=c(e.split("?"),2),r=n[0],o=n[1],s=i({},t);null==o||o.split("&").forEach(function(e){var t=c(e.split("="),1)[0];delete s[t]});var a=ti(s);return a=a?(o?o+"&":"")+a:o,"".concat(r,"?").concat(a)},rf=function(e){var t,n,r,i,o,s,a,l,u,c=e.data,d=e.compression;if(c)return d===K.GZipJS?{contentType:rc,body:new Blob([(t=function(e,t){var n=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var r=new nj(e.length+(e.length>>>1)),i=0,o=function(e){r[i++]=e},s=0;s<n;++s){if(i+5>r.length){var a=new nj(i+8+(n-s<<1));a.set(r),r=a}var l=e.charCodeAt(s);l<128?o(l):(l<2048?o(192|l>>>6):(l>55295&&l<57344?(o(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++s))>>>18),o(128|l>>>12&63)):o(224|l>>>12),o(128|l>>>6&63)),o(128|63&l))}return n4(r,0,i)}(JSON.stringify(c)),n={mtime:0},r=4294967295,i={p:function(e){for(var t=r,n=0;n<e.length;++n)t=ra[255&t^e[n]]^t>>>8;r=t},d:function(){return 4294967295^r}},o=t.length,i.p(t),l=(s=10+(n.filename&&n.filename.length+1||0),a=function(e,t,n,r,i,o){var s=e.length,a=new nj(r+s+5*(1+Math.floor(s/7e3))+8),l=a.subarray(r,a.length-8),u=0;if(!t||s<8)for(var c=0;c<=s;c+=65535){var d=c+65535;d<s?u=rr(l,u,e.subarray(c,d)):(l[c]=o,u=rr(l,u,e.subarray(c,s)))}else{for(var f=ro[t-1],h=f>>>13,p=8191&f,v=(1<<n)-1,_=new nH(32768),g=new nH(v+1),m=Math.ceil(n/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&v},k=new nB(25e3),w=new nH(288),S=new nH(32),E=0,x=0,R=(c=0,0),C=0,P=0;c<s;++c){var I=b(c),F=32767&c,T=g[I];if(_[F]=T,g[I]=F,C<=c){var O=s-c;if((E>7e3||R>24576)&&O>423){u=ri(e,l,0,k,w,S,x,R,P,c-P,u),R=E=x=0,P=c;for(var M=0;M<286;++M)w[M]=0;for(M=0;M<30;++M)S[M]=0}var N=2,A=0,L=p,D=F-T&32767;if(O>2&&I==b(c-D))for(var $=Math.min(h,O)-1,q=Math.min(32767,c),j=Math.min(258,O);D<=q&&--L&&F!=T;){if(e[c+N]==e[c+N-D]){for(var H=0;H<j&&e[c+H]==e[c+H-D];++H);if(H>N){if(N=H,A=D,H>$)break;var B=Math.min(D,H-2),U=0;for(M=0;M<B;++M){var W=c-D+M+32768&32767,z=W-_[W]+32768&32767;z>U&&(U=z,T=W)}}}D+=(F=T)-(T=_[F])+32768&32767}if(A){k[R++]=268435456|nY[N]<<18|nJ[A];var V=31&nY[N],G=31&nJ[A];x+=nU[V]+nW[G],++w[257+V],++S[G],C=c+N,++E}else k[R++]=e[c],++w[e[c]]}}u=ri(e,l,o,k,w,S,x,R,P,c-P,u),o||(u=rr(l,u,rs))}return n4(a,0,r+n5(u)+i)}(t,null==n.level?6:n.level,null==n.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+n.mem,s,8,!0)).length,function(e,t){var n=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&rl(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),n){e[3]=8;for(var r=0;r<=n.length;++r)e[r+10]=n.charCodeAt(r)}}(a,n),rl(a,l-8,i.d()),rl(a,l-4,o),a)],{type:rc})}:d===K.Base64?{contentType:"application/x-www-form-urlencoded",body:"data="+encodeURIComponent("string"==typeof(u=function(e){var t,n,r,i,o,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,u="",c=[];if(!e)return e;e=eo(e);do t=(o=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,c[l++]=s.charAt(t)+s.charAt(n)+s.charAt(r)+s.charAt(i);while(a<e.length);switch(u=c.join(""),e.length%3){case 1:u=u.slice(0,-2)+"==";break;case 2:u=u.slice(0,-1)+"="}return u}(JSON.stringify(c)))?u:JSON.stringify(u))}:{contentType:"application/json",body:JSON.stringify(c)}},rh=[];j&&rh.push({transport:"XHR",method:function(e){var t,n=new j;n.open(e.method||"GET",e.url,!0);var r=null!==(t=rf(e))&&void 0!==t?t:{},i=r.contentType,o=r.body;Y(e.headers,function(e,t){n.setRequestHeader(t,e)}),i&&n.setRequestHeader("Content-Type",i),e.timeout&&(n.timeout=e.timeout),n.withCredentials=!0,n.onreadystatechange=function(){if(4===n.readyState){var t,r={statusCode:n.status,text:n.responseText};if(200===n.status)try{r.json=JSON.parse(n.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,r)}},n.send(o)}}),q&&rh.push({transport:"fetch",method:function(e){var t,n,r=null!==(t=rf(e))&&void 0!==t?t:{},i=r.contentType,o=r.body,s=new Headers;Y(s,function(e,t){s.append(t,e)}),i&&s.append("Content-Type",i);var a=e.url,l=null;if(H){var u=new H;l={signal:u.signal,timeout:setTimeout(function(){return u.abort()},e.timeout)}}q(a,{method:(null==e?void 0:e.method)||"GET",headers:s,keepalive:"POST"===e.method,body:o,signal:null===(n=l)||void 0===n?void 0:n.signal}).then(function(t){return t.text().then(function(n){var r,i={statusCode:t.status,text:n};if(200===t.status)try{i.json=JSON.parse(n)}catch(e){z.error(e)}null===(r=e.callback)||void 0===r||r.call(e,i)})}).catch(function(t){var n;z.error(t),null===(n=e.callback)||void 0===n||n.call(e,{statusCode:0,text:t})}).finally(function(){return l?clearTimeout(l.timeout):null})}}),null!=L&&L.sendBeacon&&rh.push({transport:"sendBeacon",method:function(e){var t=rd(e.url,{beacon:"1"});try{var n,r=null!==(n=rf(e))&&void 0!==n?n:{},i=r.contentType,o=r.body,s="string"==typeof o?new Blob([o],{type:i}):o;L.sendBeacon(t,s)}catch(e){}}});var rp,rv,r_=["retriesPerformedSoFar"],rg=function(){function e(t){var n=this;s(this,e),u(this,"isPolling",!1),u(this,"pollIntervalMs",3e3),u(this,"queue",[]),this.instance=t,this.queue=[],this.areWeOnline=!0,!E(T)&&"onLine"in T.navigator&&(this.areWeOnline=T.navigator.onLine,T.addEventListener("online",function(){n.areWeOnline=!0,n.flush()}),T.addEventListener("offline",function(){n.areWeOnline=!1}))}return l(e,[{key:"retriableRequest",value:function(e){var t=this,n=e.retriesPerformedSoFar,r=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,r_);I(n)&&n>0&&(r.url=rd(r.url,{retry_count:n})),this.instance._send_request(i(i({},r),{},{callback:function(e){var o;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=n?n:0)<10?t.enqueue(i({retriesPerformedSoFar:n},r)):null===(o=r.callback)||void 0===o||o.call(r,e)}}))}},{key:"enqueue",value:function(e){var t,n,r,i=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=i+1;var o=(r=(Math.random()-.5)*((n=Math.min(18e5,t=3e3*Math.pow(2,i)))-t/2),Math.ceil(n+r)),s=Date.now()+o;this.queue.push({retryAt:s,requestOptions:e});var a="Enqueued failed request for retry in ".concat(o);navigator.onLine||(a+=" (Browser is offline)"),z.warn(a),this.isPolling||(this.isPolling=!0,this.poll())}},{key:"poll",value:function(){var e=this;this.poller&&clearTimeout(this.poller),this.poller=setTimeout(function(){e.areWeOnline&&e.queue.length>0&&e.flush(),e.poll()},this.pollIntervalMs)}},{key:"flush",value:function(){var e=Date.now(),t=[],n=this.queue.filter(function(n){return n.retryAt<e||(t.push(n),!1)});if(this.queue=t,n.length>0){var r,i=p(n);try{for(i.s();!(r=i.n()).done;){var o=r.value.requestOptions;this.retriableRequest(o)}}catch(e){i.e(e)}finally{i.f()}}}},{key:"unload",value:function(){this.poller&&(clearTimeout(this.poller),this.poller=void 0);var e,t=p(this.queue);try{for(t.s();!(e=t.n()).done;){var n=e.value.requestOptions;try{this.instance._send_request(i(i({},n),{},{transport:"sendBeacon"}))}catch(e){z.error(e)}}}catch(e){t.e(e)}finally{t.f()}this.queue=[]}}]),e}(),rm=function(){function e(t,n,r,i){s(this,e),u(this,"_sessionIdChangedHandlers",[]),this.config=t,this.persistence=n,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=r||eX,this._windowIdGenerator=i||eX;var o,a=t.persistence_name||t.token,l=t.session_idle_timeout_seconds||1800;if(I(l)?l>1800?z.warn("session_idle_timeout_seconds cannot be  greater than 30 minutes. Using 30 minutes instead."):l<60&&z.warn("session_idle_timeout_seconds cannot be less than 60 seconds. Using 60 seconds instead."):(z.warn("session_idle_timeout_seconds must be a number. Defaulting to 30 minutes."),l=1800),this._sessionTimeoutMs=1e3*Math.min(Math.max(l,60),1800),this._window_id_storage_key="ph_"+a+"_window_id",this._primary_window_exists_storage_key="ph_"+a+"_primary_window_exists",this._canUseSessionStorage()){var c=te.parse(this._window_id_storage_key),d=te.parse(this._primary_window_exists_storage_key);c&&!d?this._windowId=c:te.remove(this._window_id_storage_key),te.set(this._primary_window_exists_storage_key,!0)}if(null!==(o=this.config.bootstrap)&&void 0!==o&&o.sessionID)try{var f=function(e){var t=e.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.config.bootstrap.sessionID);this._setSessionId(this.config.bootstrap.sessionID,(new Date).getTime(),f)}catch(e){z.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}return l(e,[{key:"onSessionId",value:function(e){var t=this;return E(this._sessionIdChangedHandlers)&&(this._sessionIdChangedHandlers=[]),this._sessionIdChangedHandlers.push(e),this._sessionId&&e(this._sessionId,this._windowId),function(){t._sessionIdChangedHandlers=t._sessionIdChangedHandlers.filter(function(t){return t!==e})}}},{key:"_canUseSessionStorage",value:function(){return"memory"!==this.config.persistence&&!this.persistence.disabled&&te.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&te.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?te.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,n){e===this._sessionId&&t===this._sessionActivityTimestamp&&n===this._sessionStartTimestamp||(this._sessionStartTimestamp=n,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(u({},ek,[t,e,n])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[ek];return b(e)&&2===e.length&&e.push(e[0]),e||[0,null,0]}},{key:"resetSessionId",value:function(){this._setSessionId(null,null,null)}},{key:"_listenToReloadWindow",value:function(){var e=this;null==T||T.addEventListener("beforeunload",function(){e._canUseSessionStorage()&&te.remove(e._primary_window_exists_storage_key)})}},{key:"checkAndGetSessionAndWindowId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:null)||(new Date).getTime(),n=c(this._getSessionId(),3),r=n[0],i=n[1],o=n[2],s=this._getWindowId(),a=o&&o>0&&Math.abs(t-o)>864e5,l=!1,u=!i,d=!e&&Math.abs(t-r)>this._sessionTimeoutMs;u||d||a?(i=this._sessionIdGenerator(),s=this._windowIdGenerator(),z.info("[SessionId] new session ID generated",{sessionId:i,windowId:s,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:a}}),o=t,l=!0):s||(s=this._windowIdGenerator(),l=!0);var f=0===r||!e||a?t:r,h=0===o?(new Date).getTime():o;return this._setWindowId(s),this._setSessionId(i,f,h),l&&this._sessionIdChangedHandlers.forEach(function(e){return e(i,s)}),{sessionId:i,windowId:s,sessionStartTimestamp:h}}}]),e}();(rS=rv||(rv={})).US="us",rS.EU="eu",rS.CUSTOM="custom";var ry="i.posthog.com",rb=function(){function e(t){s(this,e),u(this,"_regionCache",{}),this.instance=t}return l(e,[{key:"apiHost",get:function(){return this.instance.config.api_host.trim().replace(/\/$/,"")}},{key:"uiHost",get:function(){var e,t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return"https://app.posthog.com"===t?"https://us.posthog.com":t}},{key:"region",get:function(){return this._regionCache[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=rv.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=rv.EU:this._regionCache[this.apiHost]=rv.CUSTOM),this._regionCache[this.apiHost]}},{key:"endpointFor",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t&&(t="/"===t[0]?t:"/".concat(t)),"ui"===e)return(this.uiHost||this.apiHost.replace(".".concat(ry),".posthog.com"))+t;if(this.region===rv.CUSTOM)return this.apiHost+t;var n=ry+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(n);case"api":return"https://".concat(this.region,".").concat(n)}}},{key:"loadScript",value:function(e,t){if(this.instance.config.disable_external_dependency_loading)return z.warn("".concat(e," was requested but loading of external scripts is disabled.")),t("Loading of external scripts is disabled");var n="/"===e[0]?this.endpointFor("assets",e):e,r=function(){if(!D)return t("document not found");var e=D.createElement("script");e.type="text/javascript",e.src=n,e.onload=function(e){return t(void 0,e)},e.onerror=function(e){return t(e)};var r,i=D.querySelectorAll("body > script");i.length>0?null===(r=i[0].parentNode)||void 0===r||r.insertBefore(e,i[0]):D.body.appendChild(e)};null!=D&&D.body?r():null==D||D.addEventListener("DOMContentLoaded",r)}}]),e}(),rk="posthog-js";function rw(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.organization,r=t.projectId,i=t.prefix,o=t.severityAllowList,s=void 0===o?["error"]:o;return function(t){if(!("*"===s||s.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var o,a,l,u,c,d=e.requestRouter.endpointFor("ui","/project/".concat(e.config.token,"/person/").concat(e.get_distinct_id()));t.tags["PostHog Person URL"]=d,e.sessionRecordingStarted()&&(t.tags["PostHog Recording URL"]=e.get_session_replay_url({withTimestamp:!0}));var f=(null===(o=t.exception)||void 0===o?void 0:o.values)||[],h={$exception_message:(null===(a=f[0])||void 0===a?void 0:a.value)||t.message,$exception_type:null===(l=f[0])||void 0===l?void 0:l.type,$exception_personURL:d,$exception_level:t.level,$sentry_event_id:t.event_id,$sentry_exception:t.exception,$sentry_exception_message:(null===(u=f[0])||void 0===u?void 0:u.value)||t.message,$sentry_exception_type:null===(c=f[0])||void 0===c?void 0:c.type,$sentry_tags:t.tags,$level:t.level};return n&&r&&(h.$sentry_url=(i||"https://sentry.io/organizations/")+n+"/issues/?project="+r+"&query="+t.event_id),e.capture("$exception",h),t}}var rS,rE,rx,rR,rC=l(function e(t,n,r,i,o){s(this,e),this.name=rk,this.setupOnce=function(e){e(rw(t,{organization:n,projectId:r,prefix:i,severityAllowList:o}))}}),rP=function(){function e(t){s(this,e),this._instance=t}return l(e,[{key:"doPageView",value:function(){var e,t=this._previousScrollProperties();return this._currentPath=null!==(e=null==T?void 0:T.location.pathname)&&void 0!==e?e:"",this._instance.scrollManager.resetContext(),t}},{key:"doPageLeave",value:function(){return this._previousScrollProperties()}},{key:"_previousScrollProperties",value:function(){var e=this._currentPath,t=this._instance.scrollManager.getContext();if(!e||!t)return{};var n=t.maxScrollHeight,r=t.lastScrollY,i=t.maxScrollY,o=t.maxContentHeight,s=t.lastContentY,a=t.maxContentY;return E(n)||E(r)||E(i)||E(o)||E(s)||E(a)?{}:(n=Math.ceil(n),r=Math.ceil(r),i=Math.ceil(i),o=Math.ceil(o),s=Math.ceil(s),a=Math.ceil(a),{$prev_pageview_pathname:e,$prev_pageview_last_scroll:r,$prev_pageview_last_scroll_percentage:n<=1?1:rI(r/n,0,1),$prev_pageview_max_scroll:i,$prev_pageview_max_scroll_percentage:n<=1?1:rI(i/n,0,1),$prev_pageview_last_content:s,$prev_pageview_last_content_percentage:o<=1?1:rI(s/o,0,1),$prev_pageview_max_content:a,$prev_pageview_max_content_percentage:o<=1?1:rI(a/o,0,1)})}}]),e}();function rI(e,t,n){return Math.max(t,Math.min(e,n))}(rT=rE||(rE={})).Popover="popover",rT.API="api",rT.Widget="widget",(rO=rx||(rx={})).Open="open",rO.MultipleChoice="multiple_choice",rO.SingleChoice="single_choice",rO.Rating="rating",rO.Link="link",(rM=rR||(rR={})).NextQuestion="next_question",rM.End="end",rM.ResponseBased="response_based",rM.SpecificQuestion="specific_question";var rF=function(){function e(t){s(this,e),this.persistence=t,this.eventRegistry=new Map}return l(e,[{key:"register",value:function(e){var t=this;e.forEach(function(e){var n,r,i,o,s;null!==(n=e.conditions)&&void 0!==n&&n.events&&null!==(r=e.conditions)&&void 0!==r&&null!==(i=r.events)&&void 0!==i&&i.values&&(null===(o=e.conditions)||void 0===o?void 0:o.events.values.length)>0&&t.eventRegistry.set(e.id,null===(s=e.conditions)||void 0===s?void 0:s.events.values.map(function(e){return e.name}))})}},{key:"on",value:function(t,n){var r,i=[],o=(null===(r=this.persistence)||void 0===r?void 0:r.props[eP])||[];if(e.SURVEY_SHOWN_EVENT_NAME==t&&n&&o.length>0){var s,a=null==n||null===(s=n.properties)||void 0===s?void 0:s.$survey_id;if(a){var l=o.indexOf(a);l>=0&&o.splice(l,1)}}else this.eventRegistry.forEach(function(e,n){e.includes(t)&&i.push(n)});var u=o.concat(i);this._saveSurveysToStorage(u)}},{key:"getSurveys",value:function(){var e;return(null===(e=this.persistence)||void 0===e?void 0:e.props[eP])||[]}},{key:"getEventRegistry",value:function(){return this.eventRegistry}},{key:"_saveSurveysToStorage",value:function(e){var t;null===(t=this.persistence)||void 0===t||t.register(u({},eP,d(new Set(e))))}}]),e}();u(rF,"SURVEY_SHOWN_EVENT_NAME","survey shown");var rT,rO,rM,rN,rA,rL,rD,r$,rq,rj,rH,rB={},rU=[],rW=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,rz=Array.isArray;function rV(e,t){for(var n in t)e[n]=t[n];return e}function rG(e){var t=e.parentNode;t&&t.removeChild(e)}function rZ(e,t,n,r,i){var o={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==i?++rL:i,__i:-1,__u:0};return null==i&&null!=rA.vnode&&rA.vnode(o),o}function rY(e){return e.children}function rJ(e,t){this.props=e,this.context=t}function rQ(e,t){if(null==t)return e.__?rQ(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?rQ(e):null}function rX(e){(!e.__d&&(e.__d=!0)&&rD.push(e)&&!rK.__r++||r$!==rA.debounceRendering)&&((r$=rA.debounceRendering)||rq)(rK)}function rK(){var e,t,n,r,i,o,s,a,l;for(rD.sort(rj);e=rD.shift();)e.__d&&(t=rD.length,r=void 0,o=(i=(n=e).__v).__e,a=[],l=[],(s=n.__P)&&((r=rV({},i)).__v=i.__v+1,rA.vnode&&rA.vnode(r),r5(s,r,i,n.__n,void 0!==s.ownerSVGElement,32&i.__u?[o]:null,a,null==o?rQ(i):o,!!(32&i.__u),l),r.__.__k[r.__i]=r,function(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)r4(n[r],n[++r],n[++r]);rA.__c&&rA.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){rA.__e(e,t.__v)}})}(a,r,l),r.__e!=o&&function e(t){var n,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,n=0;n<t.__k.length;n++)if(null!=(r=t.__k[n])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return e(t)}}(r)),rD.length>t&&rD.sort(rj));rK.__r=0}function r0(e,t,n,r,i,o,s,a,l,u,c){var d,f,h,p,v,_=r&&r.__k||rU,g=t.length;for(n.__d=l,function(e,t,n){var r,i,o,s,a,l=t.length,u=n.length,c=u,d=0;for(e.__k=[],r=0;r<l;r++)null!=(i=e.__k[r]=null==(i=t[r])||"boolean"==typeof i||"function"==typeof i?null:"string"==typeof i||"number"==typeof i||"bigint"==typeof i||i.constructor==String?rZ(null,i,null,null,i):rz(i)?rZ(rY,{children:i},null,null,null):void 0===i.constructor&&i.__b>0?rZ(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,a=function(e,t,n,r){var i=e.key,o=e.type,s=n-1,a=n+1,l=t[n];if(null===l||l&&i==l.key&&o===l.type)return n;if(r>(null!=l&&0==(131072&l.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((l=t[s])&&0==(131072&l.__u)&&i==l.key&&o===l.type)return s;s--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&i==l.key&&o===l.type)return a;a++}}return -1}(i,n,s=r+d,c),i.__i=a,o=null,-1!==a&&(c--,(o=n[a])&&(o.__u|=131072)),null==o||null===o.__v?(-1==a&&d--,"function"!=typeof i.type&&(i.__u|=65536)):a!==s&&(a===s+1?d++:a>s?c>l-s?d+=a-s:d--:d=a<s&&a==s-1?a-s:0,a!==r+d&&(i.__u|=65536))):(o=n[r])&&null==o.key&&o.__e&&(o.__e==e.__d&&(e.__d=rQ(o)),r8(o,o,!1),n[r]=null,c--);if(c)for(r=0;r<u;r++)null!=(o=n[r])&&0==(131072&o.__u)&&(o.__e==e.__d&&(e.__d=rQ(o)),r8(o,o))}(n,t,_),l=n.__d,d=0;d<g;d++)null!=(h=n.__k[d])&&"boolean"!=typeof h&&"function"!=typeof h&&(f=-1===h.__i?rB:_[h.__i]||rB,h.__i=d,r5(e,h,f,i,o,s,a,l,u,c),p=h.__e,h.ref&&f.ref!=h.ref&&(f.ref&&r4(f.ref,null,h),c.push(h.ref,h.__c||p,h)),null==v&&null!=p&&(v=p),65536&h.__u||f.__k===h.__k?l=function e(t,n,r){var i,o;if("function"==typeof t.type){for(i=t.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=t,n=e(i[o],n,r));return n}return t.__e!=n&&(r.insertBefore(t.__e,n||null),n=t.__e),n&&n.nextSibling}(h,l,e):"function"==typeof h.type&&void 0!==h.__d?l=h.__d:p&&(l=p.nextSibling),h.__d=void 0,h.__u&=-196609);n.__d=l,n.__e=v}function r1(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||rW.test(t)?n:n+"px"}function r2(e,t,n,r,i){var o;e:if("style"===t){if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||r1(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||r1(e.style,t,n[t])}}else if("o"===t[0]&&"n"===t[1])o=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase() in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,o?r6:r3,o)):e.removeEventListener(t,o?r6:r3,o);else{if(i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function r3(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(rA.event?rA.event(e):e)}function r6(e){return this.l[e.type+!0](rA.event?rA.event(e):e)}function r5(e,t,n,r,i,o,s,a,l,u){var c,d,f,h,p,v,_,g,m,y,b,k,w,S,E,x=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),o=[a=t.__e=n.__e]),(c=rA.__b)&&c(t);e:if("function"==typeof x)try{if(g=t.props,m=(c=x.contextType)&&r[c.__c],y=c?m?m.props.value:c.__:r,n.__c?_=(d=t.__c=n.__c).__=d.__E:("prototype"in x&&x.prototype.render?t.__c=d=new x(g,y):(t.__c=d=new rJ(g,y),d.constructor=x,d.render=r7),m&&m.sub(d),d.props=g,d.state||(d.state={}),d.context=y,d.__n=r,f=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=x.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=rV({},d.__s)),rV(d.__s,x.getDerivedStateFromProps(g,d.__s))),h=d.props,p=d.state,d.__v=t,f)null==x.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==x.getDerivedStateFromProps&&g!==h&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(g,y),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(g,d.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=g,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(e){e&&(e.__=t)}),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(g,d.__s,y),null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(h,p,v)})}if(d.context=y,d.props=g,d.__P=e,d.__e=!1,k=rA.__r,w=0,"prototype"in x&&x.prototype.render){for(d.state=d.__s,d.__d=!1,k&&k(t),c=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do d.__d=!1,k&&k(t),c=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++w<25);d.state=d.__s,null!=d.getChildContext&&(r=rV(rV({},r),d.getChildContext())),f||null==d.getSnapshotBeforeUpdate||(v=d.getSnapshotBeforeUpdate(h,p)),r0(e,rz(E=null!=c&&c.type===rY&&null==c.key?c.props.children:c)?E:[E],t,n,r,i,o,s,a,l,u),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),_&&(d.__E=d.__=null)}catch(e){t.__v=null,l||null!=o?(t.__e=a,t.__u|=l?160:32,o[o.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),rA.__e(e,t,n)}else null==o&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,i,o,s,a,l){var u,c,d,f,h,p,v,_=n.props,g=t.props,m=t.type;if("svg"===m&&(i=!0),null!=o){for(u=0;u<o.length;u++)if((h=o[u])&&"setAttribute"in h==!!m&&(m?h.localName===m:3===h.nodeType)){e=h,o[u]=null;break}}if(null==e){if(null===m)return document.createTextNode(g);e=i?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,g.is&&g),o=null,a=!1}if(null===m)_===g||a&&e.data===g||(e.data=g);else{if(o=o&&rN.call(e.childNodes),_=n.props||rB,!a&&null!=o)for(_={},u=0;u<e.attributes.length;u++)_[(h=e.attributes[u]).name]=h.value;for(u in _)h=_[u],"children"==u||("dangerouslySetInnerHTML"==u?d=h:"key"===u||u in g||r2(e,u,null,h,i));for(u in g)h=g[u],"children"==u?f=h:"dangerouslySetInnerHTML"==u?c=h:"value"==u?p=h:"checked"==u?v=h:"key"===u||a&&"function"!=typeof h||_[u]===h||r2(e,u,h,_[u],i);if(c)a||d&&(c.__html===d.__html||c.__html===e.innerHTML)||(e.innerHTML=c.__html),t.__k=[];else if(d&&(e.innerHTML=""),r0(e,rz(f)?f:[f],t,n,r,i&&"foreignObject"!==m,o,s,o?o[0]:n.__k&&rQ(n,0),a,l),null!=o)for(u=o.length;u--;)null!=o[u]&&rG(o[u]);a||(u="value",void 0===p||p===e[u]&&("progress"!==m||p)&&("option"!==m||p===_[u])||r2(e,u,p,_[u],!1),u="checked",void 0!==v&&v!==e[u]&&r2(e,u,v,_[u],!1))}return e}(n.__e,t,n,r,i,o,s,l,u);(c=rA.diffed)&&c(t)}function r4(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){rA.__e(e,n)}}function r8(e,t,n){var r,i;if(rA.unmount&&rA.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||r4(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){rA.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&r8(r[i],t,n||"function"!=typeof e.type);n||null==e.__e||rG(e.__e),e.__=e.__e=e.__d=void 0}function r7(e,t,n){return this.constructor(e,n)}rN=rU.slice,rA={__e:function(e,t,n,r){for(var i,o,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,r||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},rL=0,rJ.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=rV({},this.state),"function"==typeof e&&(e=e(rV({},n),this.props)),e&&rV(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),rX(this))},rJ.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),rX(this))},rJ.prototype.render=rY,rD=[],rq="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,rj=function(e,t){return e.__v.__b-t.__v.__b},rK.__r=0,rH=0;var r9=function(e){var t,n,r,i,o,s;return null!=(null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(r=n.values)||void 0===r?void 0:r.length)&&(null===(i=e.conditions)||void 0===i||null===(o=i.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0};i_={isPreviewMode:!1,previewPageIndex:0,handleCloseSurveyPopup:function(){}},(im={__c:ig="__cC"+rH++,__:i_,Consumer:function(e,t){return e.children(t)},Provider:function(e){var t,n;return this.getChildContext||(t=[],(n={})[ig]=this,this.getChildContext=function(){return n},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&t.some(function(e){e.__e=!0,rX(e)})},this.sub=function(e){t.push(e);var n=e.componentWillUnmount;e.componentWillUnmount=function(){t.splice(t.indexOf(e),1),n&&n.call(e)}}),e.children}}).Provider.__=im.Consumer.contextType=im;var ie={icontains:function(e){return!!T&&T.location.href.toLowerCase().indexOf(e.toLowerCase())>-1},not_icontains:function(e){return!!T&&-1===T.location.href.toLowerCase().indexOf(e.toLowerCase())},regex:function(e){return!!T&&tr(T.location.href,e)},not_regex:function(e){return!!T&&!tr(T.location.href,e)},exact:function(e){return(null==T?void 0:T.location.href)===e},is_not:function(e){return(null==T?void 0:T.location.href)!==e}},it=function(){function e(t){s(this,e),this.instance=t,this._surveyEventReceiver=null}return l(e,[{key:"afterDecideResponse",value:function(e){this._decideServerResponse=!!e.surveys,this.loadIfEnabled()}},{key:"loadIfEnabled",value:function(){var e=this,t=null==U?void 0:U.extendPostHogWithSurveys;this.instance.config.disable_surveys||!this._decideServerResponse||t||(null==this._surveyEventReceiver&&(this._surveyEventReceiver=new rF(this.instance.persistence)),this.instance.requestRouter.loadScript("/static/surveys.js",function(t){if(t)return z.error("Could not load surveys script",t);U.extendPostHogWithSurveys(e.instance)}))}},{key:"getSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return e([]);null==this._surveyEventReceiver&&(this._surveyEventReceiver=new rF(this.instance.persistence));var r=this.instance.get_property(eC);if(r&&!n)return e(r);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:function(n){if(200!==n.statusCode||!n.json)return e([]);var r,i,o=n.json.surveys||[],s=o.filter(function(e){var t,n,r,i,o,s;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(n=e.conditions)||void 0===n||null===(r=n.events)||void 0===r?void 0:r.values)&&(null===(i=e.conditions)||void 0===i||null===(o=i.events)||void 0===o||null===(s=o.values)||void 0===s?void 0:s.length)>0});return s.length>0&&!E(t.instance._addCaptureHook)&&(null===(i=t._surveyEventReceiver)||void 0===i||i.register(s),t.instance._addCaptureHook(function(e,n){var r;null===(r=t._surveyEventReceiver)||void 0===r||r.on(e,n)})),null===(r=t.instance.persistence)||void 0===r||r.register(u({},eC,o)),e(o)}})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys(function(n){var r,i=n.filter(function(e){return!(!e.start_date||e.end_date)}).filter(function(e){if(!e.conditions)return!0;var t,n,r,i,o=null===(t=e.conditions)||void 0===t||!t.url||ie[null!==(n=null===(r=e.conditions)||void 0===r?void 0:r.urlMatchType)&&void 0!==n?n:"icontains"](e.conditions.url),s=null===(i=e.conditions)||void 0===i||!i.selector||(null==D?void 0:D.querySelector(e.conditions.selector));return o&&s}),o=null===(r=t._surveyEventReceiver)||void 0===r?void 0:r.getSurveys();return e(i.filter(function(e){if(!e.linked_flag_key&&!e.targeting_flag_key&&!e.internal_targeting_flag_key)return!0;var n,r,i=!e.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),s=!e.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key),a=!r9(e)||(null==o?void 0:o.includes(e.id)),l=!(null===(n=e.conditions)||void 0===n||null===(r=n.events)||void 0===r||!r.repeatedActivation||!r9(e)),u=!(e.internal_targeting_flag_key&&!l)||t.instance.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key);return i&&s&&u&&a}))},n)}},{key:"getNextSurveyStep",value:function(e,t,n){var r,i=e.questions[t],o=t+1;if(null===(r=i.branching)||void 0===r||!r.type)return t===e.questions.length-1?rR.End:o;if(i.branching.type===rR.End)return rR.End;if(i.branching.type===rR.SpecificQuestion){if(Number.isInteger(i.branching.index))return i.branching.index}else if(i.branching.type===rR.ResponseBased){if(i.type===rx.SingleChoice){var s,a,l=i.choices.indexOf("".concat(n));if(null!==(s=i.branching)&&void 0!==s&&null!==(a=s.responseValues)&&void 0!==a&&a.hasOwnProperty(l)){var u=i.branching.responseValues[l];return Number.isInteger(u)?u:u===rR.End?rR.End:o}}else if(i.type===rx.Rating){if("number"!=typeof n||!Number.isInteger(n))throw Error("The response type must be an integer");var c,d,f=function(e,t){if(3===t){if(e<1||e>3)throw Error("The response must be in range 1-3");return 1===e?"negative":2===e?"neutral":"positive"}if(5===t){if(e<1||e>5)throw Error("The response must be in range 1-5");return e<=2?"negative":3===e?"neutral":"positive"}if(10===t){if(e<0||e>10)throw Error("The response must be in range 0-10");return e<=6?"detractors":e<=8?"passives":"promoters"}throw Error("The scale must be one of: 3, 5, 10")}(n,i.scale);if(null!==(c=i.branching)&&void 0!==c&&null!==(d=c.responseValues)&&void 0!==d&&d.hasOwnProperty(f)){var h=i.branching.responseValues[f];return Number.isInteger(h)?h:h===rR.End?rR.End:o}}return o}return console.warn("Falling back to next question index due to unexpected branching type"),o}}]),e}(),ir=function(){function e(t){var n,r,i=this;s(this,e),u(this,"serverLimits",{}),u(this,"lastEventRateLimited",!1),u(this,"checkForLimiting",function(e){var t=e.text;if(t&&t.length)try{(JSON.parse(t).quota_limited||[]).forEach(function(e){z.info("[RateLimiter] ".concat(e||"events"," is quota limited.")),i.serverLimits[e]=(new Date).getTime()+6e4})}catch(e){return void z.warn('[RateLimiter] could not rate limit - continuing. Error: "'.concat(null==e?void 0:e.message,'"'),{text:t})}}),this.instance=t,this.captureEventsPerSecond=(null===(n=t.config.rate_limiting)||void 0===n?void 0:n.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(r=t.config.rate_limiting)||void 0===r?void 0:r.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}return l(e,[{key:"clientRateLimitContext",value:function(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=(new Date).getTime(),o=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(eO))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:i};o.tokens+=(i-o.last)/1e3*this.captureEventsPerSecond,o.last=i,o.tokens>this.captureEventsBurstLimit&&(o.tokens=this.captureEventsBurstLimit);var s=o.tokens<1;return s||r||(o.tokens=Math.max(0,o.tokens-1)),!s||this.lastEventRateLimited||r||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to ".concat(this.captureEventsPerSecond," events per second and ").concat(this.captureEventsBurstLimit," events burst limit.")},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=s,null===(n=this.instance.persistence)||void 0===n||n.set_property(eO,o),{isRateLimited:s,remainingTokens:o.tokens}}},{key:"isServerRateLimited",value:function(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}]),e}(),ii=function(){return i({initialPathName:(null==$?void 0:$.pathname)||"",referringDomain:t2.referringDomain()},t2.campaignParams())},io=function(){function e(t,n,r){var i=this;s(this,e),u(this,"_onSessionIdCallback",function(e){var t=i._getStoredProps();if(!t||t.sessionId!==e){var n={sessionId:e,props:i._sessionSourceParamGenerator()};i._persistence.register(u({},eT,n))}}),this._sessionIdManager=t,this._persistence=n,this._sessionSourceParamGenerator=r||ii,this._sessionIdManager.onSessionId(this._onSessionIdCallback)}return l(e,[{key:"_getStoredProps",value:function(){return this._persistence.props[eT]}},{key:"getSessionProps",value:function(){var e,t=null===(e=this._getStoredProps())||void 0===e?void 0:e.props;return t?{$client_session_initial_referring_host:t.referringDomain,$client_session_initial_pathname:t.initialPathName,$client_session_initial_utm_source:t.utm_source,$client_session_initial_utm_campaign:t.utm_campaign,$client_session_initial_utm_medium:t.utm_medium,$client_session_initial_utm_content:t.utm_content,$client_session_initial_utm_term:t.utm_term}:{}}}]),e}(),is=["ahrefsbot","ahrefssiteaudit","applebot","baiduspider","bingbot","bingpreview","bot.htm","bot.php","crawler","deepscan","duckduckbot","facebookexternal","facebookcatalog","gptbot","http://yandex.com/bots","hubspot","ia_archiver","linkedinbot","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","semrushbot","sitebulb","slurp","turnitin","twitterbot","vercelbot","yahoo! slurp","yandexbot","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],ia=function(e,t){if(!e)return!1;var n=e.toLowerCase();return is.concat(t||[]).some(function(e){var t=e.toLowerCase();return -1!==n.indexOf(t)})},il=function(){function e(){s(this,e),this.clicks=[]}return l(e,[{key:"isRageClick",value:function(e,t,n){var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(t-r.y)<30&&n-r.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:n}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:n}];return!1}}]),e}();function iu(e){var t;return e.id===eD||!(null===(t=e.closest)||void 0===t||!t.call(e,"#"+eD))}var ic=function(){function e(t){var n;s(this,e),u(this,"rageclicks",new il),u(this,"_enabledServerSide",!1),u(this,"_initialized",!1),this.instance=t,this._enabledServerSide=!(null===(n=this.instance.persistence)||void 0===n||!n.props[ef])}return l(e,[{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(z.info("[heatmaps] Heatmaps enabled, starting..."),this._setupListeners())}},{key:"isEnabled",get:function(){return E(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps}},{key:"afterDecideResponse",value:function(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(u({},ef,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"getAndClearBuffer",value:function(){var e=this.buffer;return this.buffer=void 0,e}},{key:"_setupListeners",value:function(){var e=this;T&&D&&(es(D,"click",function(t){return e._onClick(t||(null==T?void 0:T.event))},!1,!0),es(D,"mousemove",function(t){return e._onMouseMove(t||(null==T?void 0:T.event))},!1,!0),this._initialized=!0)}},{key:"_getProperties",value:function(e,t){var n=this.instance.scrollManager.scrollY(),r=this.instance.scrollManager.scrollX(),i=this.instance.scrollManager.scrollElement(),o=function(e,t,n){for(var r=e;r&&!nn(r,"body")&&r!==n;){if(Q(t,null==T?void 0:T.getComputedStyle(r).position))return!0;r=ns(r)}return!1}(e.target,["fixed","sticky"],i);return{x:e.clientX+(o?0:r),y:e.clientY+(o?0:n),target_fixed:o,type:t}}},{key:"_onClick",value:function(e){var t;if(!iu(e.target)){var n=this._getProperties(e,"click");null!==(t=this.rageclicks)&&void 0!==t&&t.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(i(i({},n),{},{type:"rageclick"})),this._capture(n)}}},{key:"_onMouseMove",value:function(e){var t=this;iu(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){t._capture(t._getProperties(e,"mousemove"))},500))}},{key:"_capture",value:function(e){if(T){var t=T.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}}]),e}(),id=function(){function e(t){var n=this;s(this,e),u(this,"_updateScrollData",function(){n.context||(n.context={});var e,t,r,i,o=n.scrollElement(),s=n.scrollY(),a=o?Math.max(0,o.scrollHeight-o.clientHeight):0,l=s+((null==o?void 0:o.clientHeight)||0),u=(null==o?void 0:o.scrollHeight)||0;n.context.lastScrollY=Math.ceil(s),n.context.maxScrollY=Math.max(s,null!==(e=n.context.maxScrollY)&&void 0!==e?e:0),n.context.maxScrollHeight=Math.max(a,null!==(t=n.context.maxScrollHeight)&&void 0!==t?t:0),n.context.lastContentY=l,n.context.maxContentY=Math.max(l,null!==(r=n.context.maxContentY)&&void 0!==r?r:0),n.context.maxContentHeight=Math.max(u,null!==(i=n.context.maxContentHeight)&&void 0!==i?i:0)}),this.instance=t}return l(e,[{key:"getContext",value:function(){return this.context}},{key:"resetContext",value:function(){var e=this.context;return setTimeout(this._updateScrollData,0),e}},{key:"startMeasuringScrollPosition",value:function(){null==T||T.addEventListener("scroll",this._updateScrollData,!0),null==T||T.addEventListener("scrollend",this._updateScrollData,!0),null==T||T.addEventListener("resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return null==T?void 0:T.document.documentElement;var e,t=p(b(this.instance.config.scroll_root_selector)?this.instance.config.scroll_root_selector:[this.instance.config.scroll_root_selector]);try{for(t.s();!(e=t.n()).done;){var n=e.value,r=null==T?void 0:T.document.querySelector(n);if(r)return r}}catch(e){t.e(e)}finally{t.f()}}},{key:"scrollY",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return T&&(T.scrollY||T.pageYOffset||T.document.documentElement.scrollTop)||0}},{key:"scrollX",value:function(){if(this.instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return T&&(T.scrollX||T.pageXOffset||T.document.documentElement.scrollLeft)||0}}]),e}(),ih=function(){function e(){s(this,e),u(this,"events",{}),this.events={}}return l(e,[{key:"on",value:function(e,t){var n=this;return this.events[e]||(this.events[e]=[]),this.events[e].push(t),function(){n.events[e]=n.events[e].filter(function(e){return e!==t})}}},{key:"emit",value:function(e,t){var n,r=p(this.events[e]||[]);try{for(r.s();!(n=r.n()).done;)(0,n.value)(t)}catch(e){r.e(e)}finally{r.f()}var i,o=p(this.events["*"]||[]);try{for(o.s();!(i=o.n()).done;)(0,i.value)(e,t)}catch(e){o.e(e)}finally{o.f()}}}]),e}(),ip="$copy_autocapture";function iv(e,t){return t.length>e?t.slice(0,e)+"...":t}var i_,ig,im,iy,ib=function(){function e(t){s(this,e),u(this,"_initialized",!1),u(this,"_isDisabledServerSide",null),u(this,"rageclicks",new il),u(this,"_elementsChainAsString",!1),this.instance=t}return l(e,[{key:"config",get:function(){var e,t=w(this.instance.config.autocapture)?this.instance.config.autocapture:{};return t.url_allowlist=null===(e=t.url_allowlist)||void 0===e?void 0:e.map(function(e){return new RegExp(e)}),t}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(T&&D){var t=function(t){t=t||(null==T?void 0:T.event);try{e._captureEvent(t)}catch(e){z.error("Failed to capture event",e)}},n=function(t){t=t||(null==T?void 0:T.event),e._captureEvent(t,ip)};es(D,"submit",t,!1,!0),es(D,"change",t,!1,!0),es(D,"click",t,!1,!0),this.config.capture_copied_text&&(es(D,"copy",n,!1,!0),es(D,"cut",n,!1,!0))}}else z.info("Disabling Automatic Event Collection because this browser is not supported")}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(this._addDomEventHandlers(),this._initialized=!0)}},{key:"afterDecideResponse",value:function(e){e.elementsChainAsString&&(this._elementsChainAsString=e.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register(u({},ed,!!e.autocapture_opt_out)),this._isDisabledServerSide=!!e.autocapture_opt_out,this.startIfEnabled()}},{key:"isEnabled",get:function(){var e,t,n=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[ed];if(C(this._isDisabledServerSide)&&!F(n)&&!this.instance.config.advanced_disable_decide)return!1;var r=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!n;return!!this.instance.config.autocapture&&!r}},{key:"_previousElementSibling",value:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!nt(t));return t}},{key:"_getAugmentPropertiesFromElement",value:function(e){if(!na(e))return{};var t={};return Y(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var n=e.name.replace("data-ph-capture-attribute-",""),r=e.value;n&&r&&nv(r)&&(t[n]=r)}}),t}},{key:"_getPropertiesFromElement",value:function(e,t,n){var r,i=e.tagName.toLowerCase(),o={tag_name:i};no.indexOf(i)>-1&&!n&&("a"===i.toLowerCase()||"button"===i.toLowerCase()?o.$el_text=iv(1024,n_(e)):o.$el_text=iv(1024,ne(e)));var s=t7(e);s.length>0&&(o.classes=s.filter(function(e){return""!==e}));var a=null===(r=this.config)||void 0===r?void 0:r.element_attribute_ignorelist;Y(e.attributes,function(n){var r;if((!nl(e)||-1!==["name","id","class","aria-label"].indexOf(n.name))&&(null==a||!a.includes(n.name))&&!t&&nv(n.value)&&(!x(r=n.name)||"_ngcontent"!==r.substring(0,10)&&"_nghost"!==r.substring(0,7))){var i=n.value;"class"===n.name&&(i=t8(i).join(" ")),o["attr__"+n.name]=iv(1024,i)}});for(var l=1,u=1,c=e;c=this._previousElementSibling(c);)l++,c.tagName===e.tagName&&u++;return o.nth_child=l,o.nth_of_type=u,o}},{key:"_getDefaultProperties",value:function(e){return{$event_type:e,$ce_version:1}}},{key:"_getEventTarget",value:function(e){var t;return E(e.target)?e.srcElement||null:null!==(t=e.target)&&void 0!==t&&t.shadowRoot?e.composedPath()[0]||null:e.target||null}},{key:"_captureEvent",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(this.isEnabled){var r,s=this._getEventTarget(e);nr(s)&&(s=s.parentNode||null),"$autocapture"===n&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!==(r=this.rageclicks)&&void 0!==r&&r.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");var a=n===ip;if(s&&function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;if(!T||!e||nn(e,"html")||!nt(e))return!1;if(null!=n&&n.url_allowlist){var s=T.location.href,a=n.url_allowlist;if(a&&!a.some(function(e){return s.match(e)}))return!1}if(null!=n&&n.dom_event_allowlist){var l=n.dom_event_allowlist;if(l&&!l.some(function(e){return t.type===e}))return!1}for(var u=!1,c=[e],d=!0,f=e;f.parentNode&&!nn(f,"body");)if(ni(f.parentNode))c.push(f.parentNode.host),f=f.parentNode.host;else{if(!(d=ns(f)))break;if(r||no.indexOf(d.tagName.toLowerCase())>-1)u=!0;else{var h=T.getComputedStyle(d);h&&"pointer"===h.getPropertyValue("cursor")&&(u=!0)}c.push(d),f=d}if(!function(e,t){var n=null==t?void 0:t.element_allowlist;if(E(n))return!0;var r,i=p(e);try{for(i.s();!(r=i.n()).done;){var s=function(){var e=r.value;if(n.some(function(t){return e.tagName.toLowerCase()===t}))return{v:!0}}();if("object"===o(s))return s.v}}catch(e){i.e(e)}finally{i.f()}return!1}(c,n)||!function(e,t){var n=null==t?void 0:t.css_selector_allowlist;if(E(n))return!0;var r,i=p(e);try{for(i.s();!(r=i.n()).done;){var s=function(){var e=r.value;if(n.some(function(t){return e.matches(t)}))return{v:!0}}();if("object"===o(s))return s.v}}catch(e){i.e(e)}finally{i.f()}return!1}(c,n))return!1;var v=T.getComputedStyle(e);if(v&&"pointer"===v.getPropertyValue("cursor")&&"click"===t.type)return!0;var _=e.tagName.toLowerCase();switch(_){case"html":return!1;case"form":return(i||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(i||["change","click"]).indexOf(t.type)>=0;default:return u?(i||["click"]).indexOf(t.type)>=0:(i||["click"]).indexOf(t.type)>=0&&(no.indexOf(_)>-1||"true"===e.getAttribute("contenteditable"))}}(s,e,this.config,a,a?["copy","cut"]:void 0)){for(var l,u,d=[s],f=s;f.parentNode&&!nn(f,"body");)ni(f.parentNode)?(d.push(f.parentNode.host),f=f.parentNode.host):(d.push(f.parentNode),f=f.parentNode);var h,v,_=[],g={},m=!1;if(Y(d,function(e){var n=na(e);"a"===e.tagName.toLowerCase()&&(h=e.getAttribute("href"),h=n&&nv(h)&&h),Q(t7(e),"ph-no-capture")&&(m=!0),_.push(t._getPropertiesFromElement(e,t.instance.config.mask_all_element_attributes,t.instance.config.mask_all_text)),J(g,t._getAugmentPropertiesFromElement(e))}),this.instance.config.mask_all_text||("a"===s.tagName.toLowerCase()||"button"===s.tagName.toLowerCase()?_[0].$el_text=n_(s):_[0].$el_text=ne(s)),h){_[0].attr__href=h;var y,k,w=null===(y=tn(h))||void 0===y?void 0:y.host,S=null==T||null===(k=T.location)||void 0===k?void 0:k.host;w&&S&&w!==S&&(v=h)}if(m)return!1;var x=J(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:_.map(function(e){var t,n,r,i={text:null===(n=e.$el_text)||void 0===n?void 0:n.slice(0,400),tag_name:e.tag_name,href:null===(r=e.attr__href)||void 0===r?void 0:r.slice(0,2048),attr_class:(t=e.attr__class)?b(t)?t:t8(t):void 0,attr_id:e.attr__id,nth_child:e.nth_child,nth_of_type:e.nth_of_type,attributes:{}};return X(e).filter(function(e){return 0===c(e,1)[0].indexOf("attr__")}).forEach(function(e){var t=c(e,2),n=t[0],r=t[1];return i.attributes[n]=r}),i}).map(function(e){var t,n,r="";if(e.tag_name&&(r+=e.tag_name),e.attr_class){e.attr_class.sort();var o,s=p(e.attr_class);try{for(s.s();!(o=s.n()).done;){var a=o.value;r+=".".concat(a.replace(/"/g,""))}}catch(e){s.e(e)}finally{s.f()}}var l=i(i(i(i({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(n=e.nth_of_type)&&void 0!==n?n:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),u={};return X(l).sort(function(e,t){var n=c(e,1)[0],r=c(t,1)[0];return n.localeCompare(r)}).forEach(function(e){var t=c(e,2),n=t[0],r=t[1];return u[ng(n.toString())]=ng(r.toString())}),r+=":"+X(l).map(function(e){var t=c(e,2),n=t[0],r=t[1];return"".concat(n,'="').concat(r,'"')}).join("")}).join(";")}:{$elements:_},null!==(l=_[0])&&void 0!==l&&l.$el_text?{$el_text:null===(u=_[0])||void 0===u?void 0:u.$el_text}:{},v&&"click"===e.type?{$external_click_url:v}:{},g);if(n===ip){var R,C=t9(null==T||null===(R=T.getSelection())||void 0===R?void 0:R.toString()),P=e.type||"clipboard";if(!C)return!1;x.$selected_content=C,x.$copy_type=P}return this.instance.capture(n,x),!0}}}},{key:"isBrowserSupported",value:function(){return k(null==D?void 0:D.querySelectorAll)}}]),e}(),ik=function(){function e(t){var n=this;s(this,e),u(this,"_restoreXHRPatch",void 0),u(this,"_restoreFetchPatch",void 0),u(this,"_startCapturing",function(){E(n._restoreXHRPatch)&&U.postHogTracingHeadersPatchFns._patchXHR(n.instance.sessionManager),E(n._restoreFetchPatch)&&U.postHogTracingHeadersPatchFns._patchFetch(n.instance.sessionManager)}),this.instance=t}return l(e,[{key:"_loadScript",value:function(e){U.postHogTracingHeadersPatchFns&&e(),this.instance.requestRouter.loadScript("/static/tracing-headers.js?v=".concat(v.LIB_VERSION),function(t){t&&z.error("[TRACING-HEADERS] failed to load script",t),e()})}},{key:"startIfEnabledOrStop",value:function(){var e,t;this.instance.config.__add_tracing_headers?this._loadScript(this._startCapturing):(null===(e=this._restoreXHRPatch)||void 0===e||e.call(this),null===(t=this._restoreFetchPatch)||void 0===t||t.call(this),this._restoreXHRPatch=void 0,this._restoreFetchPatch=void 0)}}]),e}();(iA=iy||(iy={}))[iA.PENDING=-1]="PENDING",iA[iA.DENIED=0]="DENIED",iA[iA.GRANTED=1]="GRANTED";var iw=function(){function e(t){s(this,e),this.instance=t}return l(e,[{key:"config",get:function(){return this.instance.config}},{key:"consent",get:function(){return this.getDnt()?iy.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===iy.DENIED||this.consent===iy.PENDING&&this.config.opt_out_capturing_by_default}},{key:"isOptedIn",value:function(){return!this.isOptedOut()}},{key:"optInOut",value:function(e){this.storage.set(this.storageKey,e?1:0,this.config.cookie_expiration,this.config.cross_subdomain_cookie,this.config.secure_cookie)}},{key:"reset",value:function(){this.storage.remove(this.storageKey,this.config.cross_subdomain_cookie)}},{key:"storageKey",get:function(){var e=this.instance.config,t=e.token;return(e.opt_out_capturing_cookie_prefix||"__ph_opt_in_out_")+t}},{key:"storedConsent",get:function(){var e=this.storage.get(this.storageKey);return"1"===e?iy.GRANTED:"0"===e?iy.DENIED:iy.PENDING}},{key:"storage",get:function(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?e6:e2;var t="localStorage"===e?e2:e6;t.get(this.storageKey)&&(this._storage.get(this.storageKey)||this.optInOut("1"===t.get(this.storageKey)),t.remove(this.storageKey,this.config.cross_subdomain_cookie))}return this._storage}},{key:"getDnt",value:function(){return!!this.config.respect_dnt&&!!ea([null==L?void 0:L.doNotTrack,null==L?void 0:L.msDoNotTrack,U.doNotTrack],function(e){return Q([!0,1,"1","yes"],e)})}}]),e}(),iS="[Exception Capture]",iE=function(){function e(t){var n,r=this;s(this,e),u(this,"_endpoint","/e/"),u(this,"originalOnUnhandledRejectionHandler",void 0),u(this,"startCapturing",function(){var e;if(T&&r.isEnabled&&!r.hasHandlers&&(null===(e=T.onerror)||void 0===e||!e.__POSTHOG_INSTRUMENTED__)){var t=T.posthogErrorWrappingFunctions.wrapOnError,n=T.posthogErrorWrappingFunctions.wrapUnhandledRejection;if(t&&n)try{r.unwrapOnError=t(r.captureException.bind(r)),r.unwrapUnhandledRejection=n(r.captureException.bind(r))}catch(e){z.error(iS+" failed to start",e),r.stopCapturing()}else z.error(iS+" failed to load error wrapping functions - cannot start")}}),this.instance=t,this.remoteEnabled=!(null===(n=this.instance.persistence)||void 0===n||!n.props[eh]),this.startIfEnabled()}return l(e,[{key:"isEnabled",get:function(){var e;return null!==(e=this.remoteEnabled)&&void 0!==e&&e}},{key:"isCapturing",get:function(){var e;return!(null==T||null===(e=T.onerror)||void 0===e||!e.__POSTHOG_INSTRUMENTED__)}},{key:"hasHandlers",get:function(){return this.originalOnUnhandledRejectionHandler||this.unwrapOnError}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this.isCapturing&&(z.info(iS+" enabled, starting..."),this.loadScript(this.startCapturing))}},{key:"loadScript",value:function(e){this.hasHandlers&&e(),this.instance.requestRouter.loadScript(this.instance.requestRouter.endpointFor("assets","/static/exception-autocapture.js?v=".concat(v.LIB_VERSION)),function(t){t&&z.error(iS+" failed to load script",t),e()})}},{key:"stopCapturing",value:function(){var e,t;null===(e=this.unwrapOnError)||void 0===e||e.call(this),null===(t=this.unwrapUnhandledRejection)||void 0===t||t.call(this)}},{key:"afterDecideResponse",value:function(e){var t=e.autocaptureExceptions;this.remoteEnabled=!!t,this._endpoint=w(t)&&t.endpoint||"/e/",this.instance.persistence&&(this.instance.persistence.register(u({},eh,this.remoteEnabled)),this.instance.persistence.register(u({},"$exception_capture_endpoint",this._endpoint))),this.startIfEnabled()}},{key:"captureException",value:function(e){var t=this.instance.requestRouter.endpointFor("ui");e.$exception_personURL="".concat(t,"/project/").concat(this.instance.config.token,"/person/").concat(this.instance.get_distinct_id()),this.sendExceptionEvent(e)}},{key:"sendExceptionEvent",value:function(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_noHeatmaps:!0,_url:this._endpoint})}}]),e}(),ix="[Web Vitals]",iR=function(){function e(t){var n,r=this;s(this,e),u(this,"_enabledServerSide",!1),u(this,"_initialized",!1),u(this,"buffer",{url:void 0,metrics:[],firstMetricTimestamp:void 0}),u(this,"_flushToCapture",function(){clearTimeout(r._delayedFlushTimer),0!==r.buffer.metrics.length&&(r.instance.capture("$web_vitals",r.buffer.metrics.reduce(function(e,t){var n;return i(i({},e),{},(u(n={},"$web_vitals_".concat(t.name,"_event"),i({},t)),u(n,"$web_vitals_".concat(t.name,"_value"),t.value),n))},{})),r.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),u(this,"_addToBuffer",function(e){var t,n=null===(t=r.instance.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0);if(E(n))z.error(ix+"Could not read session ID. Dropping metrics!");else{r.buffer=r.buffer||{};var o=r._currentURL();E(o)||(P(null==e?void 0:e.name)||P(null==e?void 0:e.value)?z.error(ix+"Invalid metric received",e):(r.buffer.url!==o&&(r._flushToCapture(),r._delayedFlushTimer=setTimeout(r._flushToCapture,8e3)),E(r.buffer.url)&&(r.buffer.url=o),r.buffer.firstMetricTimestamp=E(r.buffer.firstMetricTimestamp)?Date.now():r.buffer.firstMetricTimestamp,r.buffer.metrics.push(i(i({},e),{},{$current_url:o,$session_id:n.sessionId,$window_id:n.windowId,timestamp:Date.now()})),4===r.buffer.metrics.length&&r._flushToCapture()))}}),u(this,"_startCapturing",function(){var e=U.postHogWebVitalsCallbacks,t=e.onLCP,n=e.onCLS,i=e.onFCP,o=e.onINP;t(r._addToBuffer),n(r._addToBuffer),i(r._addToBuffer),o(r._addToBuffer),r._initialized=!0}),this.instance=t,this._enabledServerSide=!(null===(n=this.instance.persistence)||void 0===n||!n.props[ep]),this.startIfEnabled()}return l(e,[{key:"isEnabled",get:function(){var e=w(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return F(e)?e:this._enabledServerSide}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(z.info(ix+" enabled, starting..."),this.loadScript(this._startCapturing))}},{key:"afterDecideResponse",value:function(e){var t=w(e.capturePerformance)&&!!e.capturePerformance.web_vitals;this.instance.persistence&&this.instance.persistence.register(u({},ep,t)),this._enabledServerSide=t,this.startIfEnabled()}},{key:"loadScript",value:function(e){T.postHogWebVitalsCallbacks&&e(),this.instance.requestRouter.loadScript(this.instance.requestRouter.endpointFor("assets","/static/web-vitals.js?v=".concat(v.LIB_VERSION)),function(t){t&&z.error(ix+" failed to load script",t),e()})}},{key:"_currentURL",value:function(){var e=T?T.location.href:void 0;return e||z.error(ix+"Could not determine current URL"),e}}]),e}(),iC={},iP=function(){},iI="posthog",iF=!ru&&-1===(null==B?void 0:B.indexOf("MSIE"))&&-1===(null==B?void 0:B.indexOf("Mozilla")),iT=function(){var e,t,n;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:!!x(n=null==(t=null==D?void 0:D.location)?void 0:t.hostname)&&"herokuapp.com"!==n.split(".").slice(-2).join("."),persistence:"localStorage+cookie",persistence_name:"",loaded:iP,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:$&&x(null==$?void 0:$.search)&&-1!==$.search.indexOf("__posthog_debug=true")||!1,verbose:!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_surveys:!1,enable_recording_console_log:void 0,secure_cookie:"https:"===(null==T||null===(e=T.location)||void 0===e?void 0:e.protocol),ip:!0,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},inapp_protocol:"//",inapp_link_new_window:!1,request_batching:!0,properties_string_max_length:65535,session_recording:{},mask_all_element_attributes:!1,mask_all_text:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,on_request_error:function(e){var t="Bad HTTP status: "+e.statusCode+" "+e.text;z.error(t)},get_device_id:function(e){return e},_onCapture:iP,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"always",__add_tracing_headers:!1}},iO=function(e){var t={};E(e.process_person)||(t.person_profiles=e.process_person),E(e.xhr_headers)||(t.request_headers=e.xhr_headers),E(e.cookie_name)||(t.persistence_name=e.cookie_name),E(e.disable_cookie)||(t.disable_persistence=e.disable_cookie);var n=J({},t,e);return b(e.property_blacklist)&&(E(e.property_denylist)?n.property_denylist=e.property_blacklist:b(e.property_denylist)?n.property_denylist=[].concat(d(e.property_blacklist),d(e.property_denylist)):z.error("Invalid value for property_denylist config: "+e.property_denylist)),n},iM=function(){function e(){s(this,e),u(this,"__forceAllowLocalhost",!1)}return l(e,[{key:"_forceAllowLocalhost",get:function(){return this.__forceAllowLocalhost},set:function(e){z.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}]),e}(),iN=function(){function e(){var t=this;s(this,e),u(this,"webPerformance",new iM),u(this,"_internalEventEmitter",new ih),this.config=iT(),this.decideEndpointWasHit=!1,this.SentryIntegration=rC,this.sentryIntegration=function(e){var n;return n=rw(t,e),{name:rk,processEvent:function(e){return n(e)}}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.featureFlags=new eU(this),this.toolbar=new n$(this),this.scrollManager=new id(this),this.pageViewManager=new rP(this),this.surveys=new it(this),this.rateLimiter=new ir(this),this.requestRouter=new rb(this),this.consent=new iw(this),this.people={set:function(e,n,r){var i=x(e)?u({},e,n):e;t.setPersonProperties(i),null==r||r({})},set_once:function(e,n,r){var i=x(e)?u({},e,n):e;t.setPersonProperties(void 0,i),null==r||r({})}},this.on("eventCaptured",function(e){return z.info("send",e)})}return l(e,[{key:"init",value:function(t,n,r){if(r&&r!==iI){var i,o=null!==(i=iC[r])&&void 0!==i?i:new e;return o._init(t,n,r),iC[r]=o,iC[iI][r]=o,o}return this._init(t,n,r)}},{key:"_init",value:function(e){var t,n,r=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2?arguments[2]:void 0;if(E(e)||R(e))return z.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 z.warn("You have already initialized PostHog! Re-initializing is a no-op"),this;if(this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(J({},iT(),iO(o),{name:s,token:e})),this.compression=o.disable_compression?void 0:K.Base64,this.persistence=new t6(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new t6(i(i({},this.config),{},{persistence:"sessionStorage"})),this._requestQueue=new nq(function(e){return r._send_retriable_request(e)}),this._retryQueue=new rg(this),this.__request_queue=[],this.sessionManager=new rm(this.config,this.persistence),this.sessionPropsManager=new io(this.sessionManager,this.persistence),new ik(this).startIfEnabledOrStop(),this.sessionRecording=new nN(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new ib(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new ic(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new iR(this),this.exceptionObserver=new iE(this),this.exceptionObserver.startIfEnabled(),v.DEBUG=v.DEBUG||this.config.debug,this._sync_opt_out_with_persistence(),void 0!==(null===(t=o.bootstrap)||void 0===t?void 0:t.distinctID)){var a,l,u=this.config.get_device_id(eX()),c=null!==(a=o.bootstrap)&&void 0!==a&&a.isIdentifiedID?u:o.bootstrap.distinctID;this.persistence.set_property(eF,null!==(l=o.bootstrap)&&void 0!==l&&l.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:o.bootstrap.distinctID,$device_id:c})}if(this._hasBootstrappedFeatureFlags()){var d,f,h=Object.keys((null===(d=o.bootstrap)||void 0===d?void 0:d.featureFlags)||{}).filter(function(e){var t,n;return!(null===(t=o.bootstrap)||void 0===t||null===(n=t.featureFlags)||void 0===n||!n[e])}).reduce(function(e,t){var n,r;return e[t]=(null===(n=o.bootstrap)||void 0===n||null===(r=n.featureFlags)||void 0===r?void 0:r[t])||!1,e},{}),p=Object.keys((null===(f=o.bootstrap)||void 0===f?void 0:f.featureFlagPayloads)||{}).filter(function(e){return h[e]}).reduce(function(e,t){var n,r,i,s;return null!==(n=o.bootstrap)&&void 0!==n&&null!==(r=n.featureFlagPayloads)&&void 0!==r&&r[t]&&(e[t]=null===(i=o.bootstrap)||void 0===i||null===(s=i.featureFlagPayloads)||void 0===s?void 0:s[t]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:h,featureFlagPayloads:p})}if(!this.get_distinct_id()){var _=this.config.get_device_id(eX());this.register_once({distinct_id:_,$device_id:_},""),this.persistence.set_property(eF,"anonymous")}return null==T||null===(n=T.addEventListener)||void 0===n||n.call(T,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),o.segment?function(e,t){var n=e.config.segment;if(!n)return t();!function(e,t){var n=e.config.segment;if(!n)return t();var r=function(n){var r=function(){return n.anonymousId()||eX()};e.config.get_device_id=r,n.id()&&(e.register({distinct_id:n.id(),$device_id:r()}),e.persistence.set_property(eF,"identified")),t()},i=n.user();"then"in i&&k(i.then)?i.then(function(e){return r(e)}):r(i)}(e,function(){var r;n.register((Promise&&Promise.resolve||z.warn("This browser does not have Promise support, and can not use the segment integration"),r=function(t,n){if(!n)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||e.reset(),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(e.register({distinct_id:t.event.userId}),e.reloadFeatureFlags());var r,i=e._calculate_event_properties(n,null!==(r=t.event.properties)&&void 0!==r?r:{});return t.event.properties=Object.assign({},i,t.event.properties),t},{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:function(){return!0},load:function(){return Promise.resolve()},track:function(e){return r(e,e.event.event)},page:function(e){return r(e,"$pageview")},identify:function(e){return r(e,"$identify")},screen:function(e){return r(e,"$screen")}})).then(function(){t()})})}(this,function(){return r._loaded()}):this._loaded(),k(this.config._onCapture)&&this.on("eventCaptured",function(e){return r.config._onCapture(e.event,e)}),this}},{key:"_afterDecideResponse",value:function(e){var t,n,r,i,o,s,a;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Q(e.supportedCompression,K.GZipJS)?K.GZipJS:Q(e.supportedCompression,K.Base64)?K.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),null===(n=this.sessionRecording)||void 0===n||n.afterDecideResponse(e),null===(r=this.autocapture)||void 0===r||r.afterDecideResponse(e),null===(i=this.heatmaps)||void 0===i||i.afterDecideResponse(e),null===(o=this.surveys)||void 0===o||o.afterDecideResponse(e),null===(s=this.webVitalsAutocapture)||void 0===s||s.afterDecideResponse(e),null===(a=this.exceptionObserver)||void 0===a||a.afterDecideResponse(e)}},{key:"_loaded",value:function(){var e=this,t=this.config.advanced_disable_decide;t||this.featureFlags.setReloadingPaused(!0);try{this.config.loaded(this)}catch(e){z.critical("`loaded` function failed",e)}this._start_queue_if_opted_in(),this.config.capture_pageview&&setTimeout(function(){D&&e.capture("$pageview",{title:D.title},{send_instantly:!0})},1),t||(new nA(this).call(),this.featureFlags.resetRequestQueue())}},{key:"_start_queue_if_opted_in",value:function(){var e;this.has_opted_out_capturing()||this.config.request_batching&&(null===(e=this._requestQueue)||void 0===e||e.enable())}},{key:"_dom_loaded",value:function(){var e=this;this.has_opted_out_capturing()||Z(this.__request_queue,function(t){return e._send_retriable_request(t)}),this.__request_queue=[],this._start_queue_if_opted_in()}},{key:"_handle_unload",value:function(){var e,t;this.config.request_batching?(this._shouldCapturePageleave()&&this.capture("$pageleave"),null===(e=this._requestQueue)||void 0===e||e.unload(),null===(t=this._retryQueue)||void 0===t||t.unload()):this._shouldCapturePageleave()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}},{key:"_send_request",value:function(e){var t=this;this.__loaded&&(iF?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=rd(e.url,{ip:this.config.ip?1:0}),e.headers=this.config.request_headers,e.compression="best-available"===e.compression?this.compression:e.compression,function(e){var t,n,r,o=i({},e);o.timeout=o.timeout||6e4,o.url=rd(o.url,{_:(new Date).getTime().toString(),ver:v.LIB_VERSION,compression:o.compression});var s=null!==(t=o.transport)&&void 0!==t?t:"XHR",a=null!==(n=null===(r=ea(rh,function(e){return e.transport===s}))||void 0===r?void 0:r.method)&&void 0!==n?n:rh[0].method;if(!a)throw Error("No available transport method");a(o)}(i(i({},e),{},{callback:function(n){var r,i,o;t.rateLimiter.checkForLimiting(n),n.statusCode>=400&&(null===(i=(o=t.config).on_request_error)||void 0===i||i.call(o,n)),null===(r=e.callback)||void 0===r||r.call(e,n)}}))))}},{key:"_send_retriable_request",value:function(e){this._retryQueue?this._retryQueue.retriableRequest(e):this._send_request(e)}},{key:"_execute_array",value:function(e){var t,n=this,r=[],i=[],o=[];Z(e,function(e){e&&(b(t=e[0])?o.push(e):k(e)?e.call(n):b(e)&&"alias"===t?r.push(e):b(e)&&-1!==t.indexOf("capture")&&k(n[t])?o.push(e):i.push(e))});var s=function(e,t){Z(e,function(e){if(b(e[0])){var n=t;Y(e,function(e){n=n[e[0]].apply(n,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};s(r,this),s(i,this),s(o,this)}},{key:"_hasBootstrappedFeatureFlags",value:function(){var e,t;return(null===(e=this.config.bootstrap)||void 0===e?void 0:e.featureFlags)&&Object.keys(null===(t=this.config.bootstrap)||void 0===t?void 0:t.featureFlags).length>0||!1}},{key:"push",value:function(e){this._execute_array([e])}},{key:"capture",value:function(e,t,n){var r;if(!(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue))return z.uninitializedWarning("posthog.capture");if(!this.consent.isOptedOut()){if(!E(e)&&x(e)){if(!B||this.config.opt_out_useragent_filter||!ia(B,this.config.custom_blocked_useragents)){var o=null!=n&&n.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==o||!o.isRateLimited){this.sessionPersistence.update_search_keyword(),this.config.store_google&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.store_google||this.config.save_referrer)&&this.persistence.set_initial_person_info();var s,a,l,u,c={uuid:eX(),event:e,properties:this._calculate_event_properties(e,t||{},n)};o&&(c.properties.$lib_rate_limit_remaining_tokens=o.remainingTokens),(null==n?void 0:n.$set)&&(c.$set=null==n?void 0:n.$set);var d=this._calculate_set_once_properties(null==n?void 0:n.$set_once);d&&(c.$set_once=d),(s=c,a=null!=n&&n._noTruncate?null:this.config.properties_string_max_length,l=function(e){return x(e)&&!C(a)?e.slice(0,a):e},u=new Set,c=function e(t,n){var r;return t!==Object(t)?l?l(t,n):t:u.has(t)?void 0:(u.add(t),b(t)?(r=[],Z(t,function(t){r.push(e(t))})):(r={},Y(t,function(t,n){u.has(t)||(r[n]=e(t,n))})),r)}(s)).timestamp=(null==n?void 0:n.timestamp)||new Date,E(null==n?void 0:n.timestamp)||(c.properties.$event_time_override_provided=!0,c.properties.$event_time_override_system_time=new Date);var f=i(i({},c.properties.$set),c.$set);S(f)||this.setPersonPropertiesForFlags(f),this._internalEventEmitter.emit("eventCaptured",c);var h={method:"POST",url:null!==(r=null==n?void 0:n._url)&&void 0!==r?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:c,compression:"best-available",batchKey:null==n?void 0:n._batchKey};return!this.config.request_batching||n&&(null==n||!n._batchKey)||null!=n&&n.send_instantly?this._send_retriable_request(h):this._requestQueue.enqueue(h),c}z.critical("This capture call is ignored due to client rate limiting.")}}else z.error("No event name provided to posthog.capture")}}},{key:"_addCaptureHook",value:function(e){this.on("eventCaptured",function(t){return e(t.event,t)})}},{key:"_calculate_event_properties",value:function(e,t,n){if(!this.persistence||!this.sessionPersistence)return t;var r=this.persistence.remove_event_timer(e),o=i({},t);if(o.token=this.config.token,"$snapshot"===e){var s=i(i({},this.persistence.properties()),this.sessionPersistence.properties());return o.distinct_id=s.distinct_id,(!x(o.distinct_id)&&!I(o.distinct_id)||R(o.distinct_id))&&z.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),o}var a=t2.properties();if(this.sessionManager){var l=this.sessionManager.checkAndGetSessionAndWindowId(),u=l.sessionId,c=l.windowId;o.$session_id=u,o.$window_id=c}if(this.requestRouter.region===rv.CUSTOM&&(o.$lib_custom_api_host=this.config.api_host),this.sessionPropsManager&&this.config.__preview_send_client_session_params&&("$pageview"===e||"$pageleave"===e||"$autocapture"===e)){var d=this.sessionPropsManager.getSessionProps();o=J(o,d)}if(!this.config.disable_scroll_properties){var f={};"$pageview"===e?f=this.pageViewManager.doPageView():"$pageleave"===e&&(f=this.pageViewManager.doPageLeave()),o=J(o,f)}if("$pageview"===e&&D&&(o.title=D.title),!E(r)){var h=(new Date).getTime()-r;o.$duration=parseFloat((h/1e3).toFixed(3))}if(B&&this.config.opt_out_useragent_filter&&(o.$browser_type=ia(B,this.config.custom_blocked_useragents)?"bot":"browser"),(o=J({},a,this.persistence.properties(),this.sessionPersistence.properties(),o)).$is_identified=this._isIdentified(),null==n||!n._noHeatmaps){var p,v=null===(p=this.heatmaps)||void 0===p?void 0:p.getAndClearBuffer();v&&(o.$heatmap_data=v)}b(this.config.property_denylist)?Y(this.config.property_denylist,function(e){delete o[e]}):z.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;return _&&(o=_(o,e)),o.$process_person_profile=this._hasPersonProcessing(),o}},{key:"_calculate_set_once_properties",value:function(e){if(!this.persistence||!this._hasPersonProcessing())return e;var t=J({},this.persistence.get_initial_props(),e||{});return S(t)?void 0:t}},{key:"register",value:function(e,t){var n;null===(n=this.persistence)||void 0===n||n.register(e,t)}},{key:"register_once",value:function(e,t,n){var r;null===(r=this.persistence)||void 0===r||r.register_once(e,t,n)}},{key:"register_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.register(e)}},{key:"unregister",value:function(e){var t;null===(t=this.persistence)||void 0===t||t.unregister(e)}},{key:"unregister_for_session",value:function(e){var t;null===(t=this.sessionPersistence)||void 0===t||t.unregister(e)}},{key:"_register_single",value:function(e,t){this.register(u({},e,t))}},{key:"getFeatureFlag",value:function(e,t){return this.featureFlags.getFeatureFlag(e,t)}},{key:"getFeatureFlagPayload",value:function(e){var t=this.featureFlags.getFeatureFlagPayload(e);try{return JSON.parse(t)}catch(e){return t}}},{key:"isFeatureEnabled",value:function(e,t){return this.featureFlags.isFeatureEnabled(e,t)}},{key:"reloadFeatureFlags",value:function(){this.featureFlags.reloadFeatureFlags()}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,t)}},{key:"getEarlyAccessFeatures",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.featureFlags.getEarlyAccessFeatures(e,t)}},{key:"on",value:function(e,t){return this._internalEventEmitter.on(e,t)}},{key:"onFeatureFlags",value:function(e){return this.featureFlags.onFeatureFlags(e)}},{key:"onSessionId",value:function(e){var t,n;return null!==(t=null===(n=this.sessionManager)||void 0===n?void 0:n.onSessionId(e))&&void 0!==t?t:function(){}}},{key:"getSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getSurveys(e,t)}},{key:"getActiveMatchingSurveys",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.surveys.getActiveMatchingSurveys(e,t)}},{key:"getNextSurveyStep",value:function(e,t,n){return this.surveys.getNextSurveyStep(e,t,n)}},{key:"identify",value:function(e,t,n){if(!this.__loaded||!this.persistence)return z.uninitializedWarning("posthog.identify");if(I(e)&&(e=e.toString(),z.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e){if(["distinct_id","distinctid"].includes(e.toLowerCase()))z.critical('The string "'.concat(e,'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.'));else if(this._requirePersonProcessing("posthog.identify")){var r=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:r},""),e!==r&&e!==this.get_property(eu)&&(this.unregister(eu),this.register({distinct_id:e}));var i="anonymous"===(this.persistence.get_property(eF)||"anonymous");e!==r&&i?(this.persistence.set_property(eF,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:t||{},$set_once:n||{}}),this.featureFlags.setAnonymousDistinctId(r)):(t||n)&&this.setPersonProperties(t,n),e!==r&&(this.reloadFeatureFlags(),this.unregister(eI))}}else z.error("Unique user id has not been set in posthog.identify")}},{key:"setPersonProperties",value:function(e,t){(e||t)&&this._requirePersonProcessing("posthog.setPersonProperties")&&(this.setPersonPropertiesForFlags(e||{}),this.capture("$set",{$set:e||{},$set_once:t||{}}))}},{key:"group",value:function(e,t,n){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var r=this.getGroups();r[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:i(i({},r),{},u({},e,t))}),n&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:n}),this.setGroupPropertiesForFlags(u({},e,n))),r[e]===t||n||this.reloadFeatureFlags()}}else z.error("posthog.group requires a group type and group key")}},{key:"resetGroups",value:function(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setPersonPropertiesForFlags")&&this.featureFlags.setPersonPropertiesForFlags(e,t)}},{key:"resetPersonPropertiesForFlags",value:function(){this.featureFlags.resetPersonPropertiesForFlags()}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this._requirePersonProcessing("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,t)}},{key:"resetGroupPropertiesForFlags",value:function(e){this.featureFlags.resetGroupPropertiesForFlags(e)}},{key:"reset",value:function(e){if(!this.__loaded)return z.uninitializedWarning("posthog.reset");var t,n,r,i,o=this.get_property("$device_id");this.consent.reset(),null===(t=this.persistence)||void 0===t||t.clear(),null===(n=this.sessionPersistence)||void 0===n||n.clear(),null===(r=this.persistence)||void 0===r||r.set_property(eF,"anonymous"),null===(i=this.sessionManager)||void 0===i||i.resetSessionId();var s=this.config.get_device_id(eX());this.register_once({distinct_id:s,$device_id:e?s:o},"")}},{key:"get_distinct_id",value:function(){return this.get_property("distinct_id")}},{key:"getGroups",value:function(){return this.get_property("$groups")||{}}},{key:"get_session_id",value:function(){var e,t;return null!==(e=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0).sessionId)&&void 0!==e?e:""}},{key:"get_session_replay_url",value:function(e){if(!this.sessionManager)return"";var t=this.sessionManager.checkAndGetSessionAndWindowId(!0),n=t.sessionId,r=t.sessionStartTimestamp,i=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(n));if(null!=e&&e.withTimestamp&&r){var o,s=null!==(o=e.timestampLookBack)&&void 0!==o?o:10;if(!r)return i;var a=Math.max(Math.floor(((new Date).getTime()-r)/1e3)-s,0);i+="?t=".concat(a)}return i}},{key:"alias",value:function(e,t){return e===this.get_property(el)?(z.critical("Attempting to create alias for existing People user - aborting."),-2):this._requirePersonProcessing("posthog.alias")?(E(t)&&(t=this.get_distinct_id()),e!==t?(this._register_single(eu,e),this.capture("$create_alias",{alias:e,distinct_id:t})):(z.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}},{key:"set_config",value:function(e){var t,n,r,o,s=i({},this.config);w(e)&&(J(this.config,iO(e)),null===(t=this.persistence)||void 0===t||t.update_config(this.config,s),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new t6(i(i({},this.config),{},{persistence:"sessionStorage"})),e6.is_supported()&&"true"===e6.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(v.DEBUG=!0),null===(n=this.sessionRecording)||void 0===n||n.startIfEnabledOrStop(),null===(r=this.autocapture)||void 0===r||r.startIfEnabled(),null===(o=this.heatmaps)||void 0===o||o.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}},{key:"startSessionRecording",value:function(e){if(null!=e&&e.sampling){var t,n,r=null===(t=this.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId();null===(n=this.persistence)||void 0===n||n.register(u({},ew,!0)),z.info("Session recording started with sampling override for session: ",null==r?void 0:r.sessionId)}this.set_config({disable_session_recording:!1})}},{key:"stopSessionRecording",value:function(){this.set_config({disable_session_recording:!0})}},{key:"sessionRecordingStarted",value:function(){var e;return!(null===(e=this.sessionRecording)||void 0===e||!e.started)}},{key:"loadToolbar",value:function(e){return this.toolbar.loadToolbar(e)}},{key:"get_property",value:function(e){var t;return null===(t=this.persistence)||void 0===t?void 0:t.props[e]}},{key:"getSessionProperty",value:function(e){var t;return null===(t=this.sessionPersistence)||void 0===t?void 0:t.props[e]}},{key:"toString",value:function(){var e,t=null!==(e=this.config.name)&&void 0!==e?e:iI;return t!==iI&&(t=iI+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(eF))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(eF))}},{key:"_hasPersonProcessing",value:function(){var e,t,n,r;return!("never"===this.config.person_profiles||"identified_only"===this.config.person_profiles&&!this._isIdentified()&&S(this.getGroups())&&(null===(e=this.persistence)||void 0===e||null===(t=e.props)||void 0===t||!t[eu])&&(null===(n=this.persistence)||void 0===n||null===(r=n.props)||void 0===r||!r[eL]))}},{key:"_shouldCapturePageleave",value:function(){return!0===this.config.capture_pageleave||"if_capture_pageview"===this.config.capture_pageleave&&this.config.capture_pageview}},{key:"createPersonProfile",value:function(){this._hasPersonProcessing()||this._requirePersonProcessing("posthog.createPersonProfile")&&this.setPersonProperties({},{})}},{key:"_requirePersonProcessing",value:function(e){return"never"===this.config.person_profiles?(z.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this._register_single(eL,!0),!0)}},{key:"_sync_opt_out_with_persistence",value:function(){var e,t,n,r,i=this.consent.isOptedOut(),o=this.config.opt_out_persistence_by_default,s=this.config.disable_persistence||i&&!!o;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==s&&(null===(n=this.persistence)||void 0===n||n.set_disabled(s)),(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==s&&(null===(r=this.sessionPersistence)||void 0===r||r.set_disabled(s))}},{key:"opt_in_capturing",value:function(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(E(null==e?void 0:e.captureEventName)||null!=e&&e.captureEventName)&&this.capture(null!==(t=null==e?void 0:e.captureEventName)&&void 0!==t?t:"$opt_in",null==e?void 0:e.captureProperties,{send_instantly:!0})}},{key:"opt_out_capturing",value:function(){this.consent.optInOut(!1),this._sync_opt_out_with_persistence()}},{key:"has_opted_in_capturing",value:function(){return this.consent.isOptedIn()}},{key:"has_opted_out_capturing",value:function(){return this.consent.isOptedOut()}},{key:"clear_opt_in_out_capturing",value:function(){this.consent.reset(),this._sync_opt_out_with_persistence()}},{key:"debug",value:function(e){!1===e?(null==T||T.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==T||T.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)`."),localStorage&&localStorage.setItem("ph_debug","true"),this.set_config({debug:!0}))}}]),e}();!function(e,t){for(var n=0;n<t.length;n++)e.prototype[t[n]]=en(e.prototype[t[n]])}(iN,["identify"]);var iA,iL,iD=(iL=iC[iI]=new iN,function(){function e(){e.done||(e.done=!0,iF=!1,Y(iC,function(e){e._dom_loaded()}))}null!=D&&D.addEventListener&&("complete"===D.readyState?e():D.addEventListener("DOMContentLoaded",e,!1)),T&&es(T,"load",e,!0)}(),iL)},3782:function(e,t,n){"use strict";n.d(t,{zf:function(){return s}});var r=n(2477),i=n(2265),o=(0,i.createContext)({client:r.ZP});function s(e){var t=e.children,n=e.client,s=e.apiKey,a=e.options,l=(0,i.useMemo)(function(){return(n&&s&&console.warn("[PostHog.js] You have provided both a client and an apiKey to PostHogProvider. The apiKey will be ignored in favour of the client."),n&&a&&console.warn("[PostHog.js] You have provided both a client and options to PostHogProvider. The options will be ignored in favour of the client."),n)?n:(s&&(r.ZP.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),r.ZP.init(s,a)),r.ZP)},[n,s]);return i.createElement(o.Provider,{value:{client:l}},t)}},7989:function(e){e.exports={style:{fontFamily:"'__Inter_36bd41', '__Inter_Fallback_36bd41'",fontStyle:"normal"},className:"__className_36bd41"}},9154:function(e){e.exports={style:{fontFamily:"'__Red_Hat_Display_ee1ced', '__Red_Hat_Display_Fallback_ee1ced'",fontStyle:"normal"},className:"__className_ee1ced",variable:"__variable_ee1ced"}},7048:function(e,t,n){"use strict";n.d(t,{aU:function(){return L},$j:function(){return D},VY:function(){return A},dk:function(){return q},aV:function(){return N},h_:function(){return M},fC:function(){return T},Dx:function(){return $},xz:function(){return O}});var r=n(2265),i=n(7437);function o(...e){return t=>e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}function s(...e){return r.useCallback(o(...e),e)}var a=n(2931);r.forwardRef((e,t)=>{let{children:n,...o}=e,s=r.Children.toArray(n),a=s.find(c);if(a){let e=a.props.children,n=s.map(t=>t!==a?t:r.Children.count(e)>1?r.Children.only(null):r.isValidElement(e)?e.props.children:null);return(0,i.jsx)(l,{...o,ref:t,children:r.isValidElement(e)?r.cloneElement(e,void 0,n):null})}return(0,i.jsx)(l,{...o,ref:t,children:n})}).displayName="Slot";var l=r.forwardRef((e,t)=>{let{children:n,...i}=e;if(r.isValidElement(n)){let e,s;let a=(e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?n.props.ref:n.props.ref||n.ref;return r.cloneElement(n,{...function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{o(...e),i(...e)}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(i,n.props),ref:t?o(t,a):a})}return r.Children.count(n)>1?r.Children.only(null):null});l.displayName="SlotClone";var u=({children:e})=>(0,i.jsx)(i.Fragment,{children:e});function c(e){return r.isValidElement(e)&&e.type===u}var d="AlertDialog",[f,h]=function(e,t=[]){let n=[],o=()=>{let t=n.map(e=>r.createContext(e));return function(n){let i=n?.[e]||t;return r.useMemo(()=>({[`__scope${e}`]:{...n,[e]:i}}),[n,i])}};return o.scopeName=e,[function(t,o){let s=r.createContext(o),a=n.length;function l(t){let{scope:n,children:o,...l}=t,u=n?.[e][a]||s,c=r.useMemo(()=>l,Object.values(l));return(0,i.jsx)(u.Provider,{value:c,children:o})}return n=[...n,o],l.displayName=t+"Provider",[l,function(n,i){let l=i?.[e][a]||s,u=r.useContext(l);if(u)return u;if(void 0!==o)return o;throw Error(`\`${n}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let i=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return r.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return n.scopeName=t.scopeName,n}(o,...t)]}(d,[a.p8]),p=(0,a.p8)(),v=e=>{let{__scopeAlertDialog:t,...n}=e,r=p(t);return(0,i.jsx)(a.fC,{...r,...n,modal:!0})};v.displayName=d;var _=r.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,o=p(n);return(0,i.jsx)(a.xz,{...o,...r,ref:t})});_.displayName="AlertDialogTrigger";var g=e=>{let{__scopeAlertDialog:t,...n}=e,r=p(t);return(0,i.jsx)(a.h_,{...r,...n})};g.displayName="AlertDialogPortal";var m=r.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,o=p(n);return(0,i.jsx)(a.aV,{...o,...r,ref:t})});m.displayName="AlertDialogOverlay";var y="AlertDialogContent",[b,k]=f(y),w=r.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:o,...l}=e,c=p(n),d=r.useRef(null),f=s(t,d),h=r.useRef(null);return(0,i.jsx)(a.jm,{contentName:y,titleName:S,docsSlug:"alert-dialog",children:(0,i.jsx)(b,{scope:n,cancelRef:h,children:(0,i.jsxs)(a.VY,{role:"alertdialog",...c,...l,ref:f,onOpenAutoFocus:function(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}(l.onOpenAutoFocus,e=>{var t;e.preventDefault(),null===(t=h.current)||void 0===t||t.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,i.jsx)(u,{children:o}),(0,i.jsx)(F,{contentRef:d})]})})})});w.displayName=y;var S="AlertDialogTitle",E=r.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,o=p(n);return(0,i.jsx)(a.Dx,{...o,...r,ref:t})});E.displayName=S;var x="AlertDialogDescription",R=r.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,o=p(n);return(0,i.jsx)(a.dk,{...o,...r,ref:t})});R.displayName=x;var C=r.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,o=p(n);return(0,i.jsx)(a.x8,{...o,...r,ref:t})});C.displayName="AlertDialogAction";var P="AlertDialogCancel",I=r.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=k(P,n),l=p(n),u=s(t,o);return(0,i.jsx)(a.x8,{...l,...r,ref:u})});I.displayName=P;var F=e=>{let{contentRef:t}=e,n="`".concat(y,"` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the `").concat(y,"` by passing a `").concat(x,"` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an `id` and passing the same value to the `aria-describedby` prop in `").concat(y,"`. If the description is confusing or duplicative for sighted users, you can use the `@radix-ui/react-visually-hidden` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog");return r.useEffect(()=>{var e;document.getElementById(null===(e=t.current)||void 0===e?void 0:e.getAttribute("aria-describedby"))||console.warn(n)},[n,t]),null},T=v,O=_,M=g,N=m,A=w,L=C,D=I,$=E,q=R},8484:function(e,t,n){"use strict";n.d(t,{f:function(){return c}});var r=n(2988),i=n(2265),o=n(5171);let s="horizontal",a=["horizontal","vertical"],l=(0,i.forwardRef)((e,t)=>{let{decorative:n,orientation:a=s,...l}=e,c=u(a)?a:s;return(0,i.createElement)(o.WV.div,(0,r.Z)({"data-orientation":c},n?{role:"none"}:{"aria-orientation":"vertical"===c?c:void 0,role:"separator"},l,{ref:t}))});function u(e){return a.includes(e)}l.propTypes={orientation(e,t,n){let r=e[t],i=String(r);return r&&!u(r)?Error(`Invalid prop \`orientation\` of value \`${i}\` supplied to \`${n}\`, expected one of:
  - horizontal
  - vertical

Defaulting to \`${s}\`.`):null}};let c=l},2516:function(e,t,n){"use strict";n.d(t,{VY:function(){return ew},zt:function(){return ey},fC:function(){return eb},xz:function(){return ek}});var r,i=n(2265),o=n.t(i,2);function s(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function a(...e){return t=>e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}function l(...e){return i.useCallback(a(...e),e)}var u=n(7437);function c(e,t=[]){let n=[],r=()=>{let t=n.map(e=>i.createContext(e));return function(n){let r=n?.[e]||t;return i.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return r.scopeName=e,[function(t,r){let o=i.createContext(r),s=n.length;function a(t){let{scope:n,children:r,...a}=t,l=n?.[e][s]||o,c=i.useMemo(()=>a,Object.values(a));return(0,u.jsx)(l.Provider,{value:c,children:r})}return n=[...n,r],a.displayName=t+"Provider",[a,function(n,a){let l=a?.[e][s]||o,u=i.useContext(l);if(u)return u;if(void 0!==r)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return i.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}(r,...t)]}var d=n(4887),f=i.forwardRef((e,t)=>{let{children:n,...r}=e,o=i.Children.toArray(n),s=o.find(v);if(s){let e=s.props.children,n=o.map(t=>t!==s?t:i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null);return(0,u.jsx)(h,{...r,ref:t,children:i.isValidElement(e)?i.cloneElement(e,void 0,n):null})}return(0,u.jsx)(h,{...r,ref:t,children:n})});f.displayName="Slot";var h=i.forwardRef((e,t)=>{let{children:n,...r}=e;if(i.isValidElement(n)){let e,o;let s=(e=Object.getOwnPropertyDescriptor(n.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?n.ref:(e=Object.getOwnPropertyDescriptor(n,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?n.props.ref:n.props.ref||n.ref;return i.cloneElement(n,{...function(e,t){let n={...t};for(let r in t){let i=e[r],o=t[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...e)=>{o(...e),i(...e)}:i&&(n[r]=i):"style"===r?n[r]={...i,...o}:"className"===r&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props),ref:t?a(t,s):s})}return i.Children.count(n)>1?i.Children.only(null):null});h.displayName="SlotClone";var p=({children:e})=>(0,u.jsx)(u.Fragment,{children:e});function v(e){return i.isValidElement(e)&&e.type===p}var _=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{let n=i.forwardRef((e,n)=>{let{asChild:r,...i}=e,o=r?f:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,u.jsx)(o,{...i,ref:n})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function g(e){let t=i.useRef(e);return i.useEffect(()=>{t.current=e}),i.useMemo(()=>(...e)=>t.current?.(...e),[])}var m="dismissableLayer.update",y=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),b=i.forwardRef((e,t)=>{var n,o;let{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:c,onPointerDownOutside:d,onFocusOutside:f,onInteractOutside:h,onDismiss:p,...v}=e,b=i.useContext(y),[S,E]=i.useState(null),x=null!==(o=null==S?void 0:S.ownerDocument)&&void 0!==o?o:null===(n=globalThis)||void 0===n?void 0:n.document,[,R]=i.useState({}),C=l(t,e=>E(e)),P=Array.from(b.layers),[I]=[...b.layersWithOutsidePointerEventsDisabled].slice(-1),F=P.indexOf(I),T=S?P.indexOf(S):-1,O=b.layersWithOutsidePointerEventsDisabled.size>0,M=T>=F,N=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=globalThis)||void 0===t?void 0:t.document,r=g(e),o=i.useRef(!1),s=i.useRef(()=>{});return i.useEffect(()=>{let e=e=>{if(e.target&&!o.current){let t=function(){w("dismissableLayer.pointerDownOutside",r,i,{discrete:!0})},i={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",s.current),s.current=t,n.addEventListener("click",s.current,{once:!0})):t()}else n.removeEventListener("click",s.current);o.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",s.current)}},[n,r]),{onPointerDownCapture:()=>o.current=!0}}(e=>{let t=e.target,n=[...b.branches].some(e=>e.contains(t));!M||n||(null==d||d(e),null==h||h(e),e.defaultPrevented||null==p||p())},x),A=function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=globalThis)||void 0===t?void 0:t.document,r=g(e),o=i.useRef(!1);return i.useEffect(()=>{let e=e=>{e.target&&!o.current&&w("dismissableLayer.focusOutside",r,{originalEvent:e},{discrete:!1})};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{let t=e.target;[...b.branches].some(e=>e.contains(t))||(null==f||f(e),null==h||h(e),e.defaultPrevented||null==p||p())},x);return!function(e,t=globalThis?.document){let n=g(e);i.useEffect(()=>{let e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[n,t])}(e=>{T!==b.layers.size-1||(null==c||c(e),!e.defaultPrevented&&p&&(e.preventDefault(),p()))},x),i.useEffect(()=>{if(S)return a&&(0===b.layersWithOutsidePointerEventsDisabled.size&&(r=x.body.style.pointerEvents,x.body.style.pointerEvents="none"),b.layersWithOutsidePointerEventsDisabled.add(S)),b.layers.add(S),k(),()=>{a&&1===b.layersWithOutsidePointerEventsDisabled.size&&(x.body.style.pointerEvents=r)}},[S,x,a,b]),i.useEffect(()=>()=>{S&&(b.layers.delete(S),b.layersWithOutsidePointerEventsDisabled.delete(S),k())},[S,b]),i.useEffect(()=>{let e=()=>R({});return document.addEventListener(m,e),()=>document.removeEventListener(m,e)},[]),(0,u.jsx)(_.div,{...v,ref:C,style:{pointerEvents:O?M?"auto":"none":void 0,...e.style},onFocusCapture:s(e.onFocusCapture,A.onFocusCapture),onBlurCapture:s(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:s(e.onPointerDownCapture,N.onPointerDownCapture)})});function k(){let e=new CustomEvent(m);document.dispatchEvent(e)}function w(e,t,n,r){let{discrete:i}=r,o=n.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});(t&&o.addEventListener(e,t,{once:!0}),i)?o&&d.flushSync(()=>o.dispatchEvent(s)):o.dispatchEvent(s)}b.displayName="DismissableLayer",i.forwardRef((e,t)=>{let n=i.useContext(y),r=i.useRef(null),o=l(t,r);return i.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,u.jsx)(_.div,{...e,ref:o})}).displayName="DismissableLayerBranch";var S=globalThis?.document?i.useLayoutEffect:()=>{},E=o["useId".toString()]||(()=>void 0),x=0,R=n(4674),C=n(5621),P=i.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...o}=e;return(0,u.jsx)(_.svg,{...o,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,u.jsx)("polygon",{points:"0,0 30,0 15,10"})})});P.displayName="Arrow";var I="Popper",[F,T]=c(I),[O,M]=F(I),N=e=>{let{__scopePopper:t,children:n}=e,[r,o]=i.useState(null);return(0,u.jsx)(O,{scope:t,anchor:r,onAnchorChange:o,children:n})};N.displayName=I;var A="PopperAnchor",L=i.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...o}=e,s=M(A,n),a=i.useRef(null),c=l(t,a);return i.useEffect(()=>{s.onAnchorChange((null==r?void 0:r.current)||a.current)}),r?null:(0,u.jsx)(_.div,{...o,ref:c})});L.displayName=A;var D="PopperContent",[$,q]=F(D),j=i.forwardRef((e,t)=>{var n,r,o,s,a,c,d,f;let{__scopePopper:h,side:p="bottom",sideOffset:v=0,align:m="center",alignOffset:y=0,arrowPadding:b=0,avoidCollisions:k=!0,collisionBoundary:w=[],collisionPadding:E=0,sticky:x="partial",hideWhenDetached:P=!1,updatePositionStrategy:I="optimized",onPlaced:F,...T}=e,O=M(D,h),[N,A]=i.useState(null),L=l(t,e=>A(e)),[q,j]=i.useState(null),H=function(e){let[t,n]=i.useState(void 0);return S(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,i;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(q),B=null!==(d=null==H?void 0:H.width)&&void 0!==d?d:0,U=null!==(f=null==H?void 0:H.height)&&void 0!==f?f:0,G="number"==typeof E?E:{top:0,right:0,bottom:0,left:0,...E},Z=Array.isArray(w)?w:[w],Y=Z.length>0,J={padding:G,boundary:Z.filter(W),altBoundary:Y},{refs:Q,floatingStyles:X,placement:K,isPositioned:ee,middlewareData:et}=(0,R.YF)({strategy:"fixed",placement:p+("center"!==m?"-"+m:""),whileElementsMounted:function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,C.Me)(...t,{animationFrame:"always"===I})},elements:{reference:O.anchor},middleware:[(0,C.cv)({mainAxis:v+U,alignmentAxis:y}),k&&(0,C.uY)({mainAxis:!0,crossAxis:!1,limiter:"partial"===x?(0,C.dr)():void 0,...J}),k&&(0,C.RR)({...J}),(0,C.dp)({...J,apply:e=>{let{elements:t,rects:n,availableWidth:r,availableHeight:i}=e,{width:o,height:s}=n.reference,a=t.floating.style;a.setProperty("--radix-popper-available-width","".concat(r,"px")),a.setProperty("--radix-popper-available-height","".concat(i,"px")),a.setProperty("--radix-popper-anchor-width","".concat(o,"px")),a.setProperty("--radix-popper-anchor-height","".concat(s,"px"))}}),q&&(0,R.x7)({element:q,padding:b}),z({arrowWidth:B,arrowHeight:U}),P&&(0,C.Cp)({strategy:"referenceHidden",...J})]}),[en,er]=V(K),ei=g(F);S(()=>{ee&&(null==ei||ei())},[ee,ei]);let eo=null===(n=et.arrow)||void 0===n?void 0:n.x,es=null===(r=et.arrow)||void 0===r?void 0:r.y,ea=(null===(o=et.arrow)||void 0===o?void 0:o.centerOffset)!==0,[el,eu]=i.useState();return S(()=>{N&&eu(window.getComputedStyle(N).zIndex)},[N]),(0,u.jsx)("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...X,transform:ee?X.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:el,"--radix-popper-transform-origin":[null===(s=et.transformOrigin)||void 0===s?void 0:s.x,null===(a=et.transformOrigin)||void 0===a?void 0:a.y].join(" "),...(null===(c=et.hide)||void 0===c?void 0:c.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,u.jsx)($,{scope:h,placedSide:en,onArrowChange:j,arrowX:eo,arrowY:es,shouldHideArrow:ea,children:(0,u.jsx)(_.div,{"data-side":en,"data-align":er,...T,ref:L,style:{...T.style,animation:ee?void 0:"none"}})})})});j.displayName=D;var H="PopperArrow",B={top:"bottom",right:"left",bottom:"top",left:"right"},U=i.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=q(H,n),o=B[i.placedSide];return(0,u.jsx)("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:(0,u.jsx)(P,{...r,ref:t,style:{...r.style,display:"block"}})})});function W(e){return null!==e}U.displayName=H;var z=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,s;let{placement:a,rects:l,middlewareData:u}=t,c=(null===(n=u.arrow)||void 0===n?void 0:n.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,p]=V(a),v={start:"0%",center:"50%",end:"100%"}[p],_=(null!==(o=null===(r=u.arrow)||void 0===r?void 0:r.x)&&void 0!==o?o:0)+d/2,g=(null!==(s=null===(i=u.arrow)||void 0===i?void 0:i.y)&&void 0!==s?s:0)+f/2,m="",y="";return"bottom"===h?(m=c?v:"".concat(_,"px"),y="".concat(-f,"px")):"top"===h?(m=c?v:"".concat(_,"px"),y="".concat(l.floating.height+f,"px")):"right"===h?(m="".concat(-f,"px"),y=c?v:"".concat(g,"px")):"left"===h&&(m="".concat(l.floating.width+f,"px"),y=c?v:"".concat(g,"px")),{data:{x:m,y}}}});function V(e){let[t,n="center"]=e.split("-");return[t,n]}i.forwardRef((e,t)=>{var n,r;let{container:o,...s}=e,[a,l]=i.useState(!1);S(()=>l(!0),[]);let c=o||a&&(null===(r=globalThis)||void 0===r?void 0:null===(n=r.document)||void 0===n?void 0:n.body);return c?d.createPortal((0,u.jsx)(_.div,{...s,ref:t}),c):null}).displayName="Portal";var G=e=>{var t,n;let r,o;let{present:s,children:a}=e,u=function(e){var t,n;let[r,o]=i.useState(),s=i.useRef({}),a=i.useRef(e),l=i.useRef("none"),[u,c]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},i.useReducer((e,t)=>{let r=n[e][t];return null!=r?r:e},t));return i.useEffect(()=>{let e=Z(s.current);l.current="mounted"===u?e:"none"},[u]),S(()=>{let t=s.current,n=a.current;if(n!==e){let r=l.current,i=Z(t);e?c("MOUNT"):"none"===i||(null==t?void 0:t.display)==="none"?c("UNMOUNT"):n&&r!==i?c("ANIMATION_OUT"):c("UNMOUNT"),a.current=e}},[e,c]),S(()=>{if(r){let e=e=>{let t=Z(s.current).includes(e.animationName);e.target===r&&t&&d.flushSync(()=>c("ANIMATION_END"))},t=e=>{e.target===r&&(l.current=Z(s.current))};return r.addEventListener("animationstart",t),r.addEventListener("animationcancel",e),r.addEventListener("animationend",e),()=>{r.removeEventListener("animationstart",t),r.removeEventListener("animationcancel",e),r.removeEventListener("animationend",e)}}c("ANIMATION_END")},[r,c]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:i.useCallback(e=>{e&&(s.current=getComputedStyle(e)),o(e)},[])}}(s),c="function"==typeof a?a({present:u.isPresent}):i.Children.only(a),f=l(u.ref,(r=null===(t=Object.getOwnPropertyDescriptor(c.props,"ref"))||void 0===t?void 0:t.get)&&"isReactWarning"in r&&r.isReactWarning?c.ref:(r=null===(n=Object.getOwnPropertyDescriptor(c,"ref"))||void 0===n?void 0:n.get)&&"isReactWarning"in r&&r.isReactWarning?c.props.ref:c.props.ref||c.ref);return"function"==typeof a||u.isPresent?i.cloneElement(c,{ref:f}):null};function Z(e){return(null==e?void 0:e.animationName)||"none"}G.displayName="Presence";var Y=i.forwardRef((e,t)=>(0,u.jsx)(_.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));Y.displayName="VisuallyHidden";var[J,Q]=c("Tooltip",[T]),X=T(),K="TooltipProvider",ee="tooltip.open",[et,en]=J(K),er=e=>{let{__scopeTooltip:t,delayDuration:n=700,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:s}=e,[a,l]=i.useState(!0),c=i.useRef(!1),d=i.useRef(0);return i.useEffect(()=>{let e=d.current;return()=>window.clearTimeout(e)},[]),(0,u.jsx)(et,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:i.useCallback(()=>{window.clearTimeout(d.current),l(!1)},[]),onClose:i.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l(!0),r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:i.useCallback(e=>{c.current=e},[]),disableHoverableContent:o,children:s})};er.displayName=K;var ei="Tooltip",[eo,es]=J(ei),ea=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:s,disableHoverableContent:a,delayDuration:l}=e,c=en(ei,e.__scopeTooltip),d=X(t),[f,h]=i.useState(null),p=function(e){let[t,n]=i.useState(E());return S(()=>{n(e=>e??String(x++))},[void 0]),t?`radix-${t}`:""}(),v=i.useRef(0),_=null!=a?a:c.disableHoverableContent,m=null!=l?l:c.delayDuration,y=i.useRef(!1),[b=!1,k]=function({prop:e,defaultProp:t,onChange:n=()=>{}}){let[r,o]=function({defaultProp:e,onChange:t}){let n=i.useState(e),[r]=n,o=i.useRef(r),s=g(t);return i.useEffect(()=>{o.current!==r&&(s(r),o.current=r)},[r,o,s]),n}({defaultProp:t,onChange:n}),s=void 0!==e,a=s?e:r,l=g(n);return[a,i.useCallback(t=>{if(s){let n="function"==typeof t?t(e):t;n!==e&&l(n)}else o(t)},[s,e,o,l])]}({prop:r,defaultProp:o,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(ee))):c.onClose(),null==s||s(e)}}),w=i.useMemo(()=>b?y.current?"delayed-open":"instant-open":"closed",[b]),R=i.useCallback(()=>{window.clearTimeout(v.current),y.current=!1,k(!0)},[k]),C=i.useCallback(()=>{window.clearTimeout(v.current),k(!1)},[k]),P=i.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{y.current=!0,k(!0)},m)},[m,k]);return i.useEffect(()=>()=>window.clearTimeout(v.current),[]),(0,u.jsx)(N,{...d,children:(0,u.jsx)(eo,{scope:t,contentId:p,open:b,stateAttribute:w,trigger:f,onTriggerChange:h,onTriggerEnter:i.useCallback(()=>{c.isOpenDelayed?P():R()},[c.isOpenDelayed,P,R]),onTriggerLeave:i.useCallback(()=>{_?C():window.clearTimeout(v.current)},[C,_]),onOpen:R,onClose:C,disableHoverableContent:_,children:n})})};ea.displayName=ei;var el="TooltipTrigger",eu=i.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,o=es(el,n),a=en(el,n),c=X(n),d=l(t,i.useRef(null),o.onTriggerChange),f=i.useRef(!1),h=i.useRef(!1),p=i.useCallback(()=>f.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),(0,u.jsx)(L,{asChild:!0,...c,children:(0,u.jsx)(_.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:d,onPointerMove:s(e.onPointerMove,e=>{"touch"===e.pointerType||h.current||a.isPointerInTransitRef.current||(o.onTriggerEnter(),h.current=!0)}),onPointerLeave:s(e.onPointerLeave,()=>{o.onTriggerLeave(),h.current=!1}),onPointerDown:s(e.onPointerDown,()=>{f.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:s(e.onFocus,()=>{f.current||o.onOpen()}),onBlur:s(e.onBlur,o.onClose),onClick:s(e.onClick,o.onClose)})})});eu.displayName=el;var[ec,ed]=J("TooltipPortal",{forceMount:void 0}),ef="TooltipContent",eh=i.forwardRef((e,t)=>{let n=ed(ef,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,s=es(ef,e.__scopeTooltip);return(0,u.jsx)(G,{present:r||s.open,children:s.disableHoverableContent?(0,u.jsx)(eg,{side:i,...o,ref:t}):(0,u.jsx)(ep,{side:i,...o,ref:t})})}),ep=i.forwardRef((e,t)=>{let n=es(ef,e.__scopeTooltip),r=en(ef,e.__scopeTooltip),o=i.useRef(null),s=l(t,o),[a,c]=i.useState(null),{trigger:d,onClose:f}=n,h=o.current,{onPointerInTransitChange:p}=r,v=i.useCallback(()=>{c(null),p(!1)},[p]),_=i.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=function(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:throw Error("unreachable")}}(r,n.getBoundingClientRect());c(function(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return(n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y)?t:t.concat(n)}(t)}([...function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}(r,i),...function(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}(t.getBoundingClientRect())])),p(!0)},[p]);return i.useEffect(()=>()=>v(),[v]),i.useEffect(()=>{if(d&&h){let e=e=>_(e,h),t=e=>_(e,d);return d.addEventListener("pointerleave",e),h.addEventListener("pointerleave",t),()=>{d.removeEventListener("pointerleave",e),h.removeEventListener("pointerleave",t)}}},[d,h,_,v]),i.useEffect(()=>{if(a){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=(null==d?void 0:d.contains(t))||(null==h?void 0:h.contains(t)),i=!function(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,o=t.length-1;e<t.length;o=e++){let s=t[e].x,a=t[e].y,l=t[o].x,u=t[o].y;a>r!=u>r&&n<(l-s)*(r-a)/(u-a)+s&&(i=!i)}return i}(n,a);r?v():i&&(v(),f())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[d,h,a,f,v]),(0,u.jsx)(eg,{...e,ref:s})}),[ev,e_]=J(ei,{isInside:!1}),eg=i.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:s,onPointerDownOutside:a,...l}=e,c=es(ef,n),d=X(n),{onClose:f}=c;return i.useEffect(()=>(document.addEventListener(ee,f),()=>document.removeEventListener(ee,f)),[f]),i.useEffect(()=>{if(c.trigger){let e=e=>{let t=e.target;(null==t?void 0:t.contains(c.trigger))&&f()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[c.trigger,f]),(0,u.jsx)(b,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:(0,u.jsxs)(j,{"data-state":c.stateAttribute,...d,...l,ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[(0,u.jsx)(p,{children:r}),(0,u.jsx)(ev,{scope:n,isInside:!0,children:(0,u.jsx)(Y,{id:c.contentId,role:"tooltip",children:o||r})})]})})});eh.displayName=ef;var em="TooltipArrow";i.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=X(n);return e_(em,n).isInside?null:(0,u.jsx)(U,{...i,...r,ref:t})}).displayName=em;var ey=er,eb=ea,ek=eu,ew=eh},2649:function(e,t,n){"use strict";/*! js-cookie v3.0.5 | MIT */function r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}n.d(t,{Z:function(){return i}});var i=function e(t,n){function i(e,i,o){if("undefined"!=typeof document){"number"==typeof(o=r({},n,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var s="";for(var a in o)o[a]&&(s+="; "+a,!0!==o[a]&&(s+="="+o[a].split(";")[0]));return document.cookie=e+"="+t.write(i,e)+s}}return Object.create({set:i,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],r={},i=0;i<n.length;i++){var o=n[i].split("="),s=o.slice(1).join("=");try{var a=decodeURIComponent(o[0]);if(r[a]=t.read(s,a),e===a)break}catch(e){}}return e?r[e]:r}},remove:function(e,t){i(e,"",r({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,r({},this.attributes,t))},withConverter:function(t){return e(r({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})},9512:function(e,t,n){"use strict";n.d(t,{f:function(){return l}});var r=n(2265),i=["light","dark"],o="(prefers-color-scheme: dark)",s="undefined"==typeof window,a=r.createContext(void 0),l=e=>r.useContext(a)?e.children:r.createElement(c,{...e}),u=["light","dark"],c=e=>{let{forcedTheme:t,disableTransitionOnChange:n=!1,enableSystem:s=!0,enableColorScheme:l=!0,storageKey:c="theme",themes:v=u,defaultTheme:_=s?"system":"light",attribute:g="data-theme",value:m,children:y,nonce:b}=e,[k,w]=r.useState(()=>f(c,_)),[S,E]=r.useState(()=>f(c)),x=m?Object.values(m):v,R=r.useCallback(e=>{let t=e;if(!t)return;"system"===e&&s&&(t=p());let r=m?m[t]:t,o=n?h():null,a=document.documentElement;if("class"===g?(a.classList.remove(...x),r&&a.classList.add(r)):r?a.setAttribute(g,r):a.removeAttribute(g),l){let e=i.includes(_)?_:null,n=i.includes(t)?t:e;a.style.colorScheme=n}null==o||o()},[]),C=r.useCallback(e=>{let t="function"==typeof e?e(e):e;w(t);try{localStorage.setItem(c,t)}catch(e){}},[t]),P=r.useCallback(e=>{E(p(e)),"system"===k&&s&&!t&&R("system")},[k,t]);r.useEffect(()=>{let e=window.matchMedia(o);return e.addListener(P),P(e),()=>e.removeListener(P)},[P]),r.useEffect(()=>{let e=e=>{e.key===c&&C(e.newValue||_)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[C]),r.useEffect(()=>{R(null!=t?t:k)},[t,k]);let I=r.useMemo(()=>({theme:k,setTheme:C,forcedTheme:t,resolvedTheme:"system"===k?S:k,themes:s?[...v,"system"]:v,systemTheme:s?S:void 0}),[k,C,t,S,s,v]);return r.createElement(a.Provider,{value:I},r.createElement(d,{forcedTheme:t,disableTransitionOnChange:n,enableSystem:s,enableColorScheme:l,storageKey:c,themes:v,defaultTheme:_,attribute:g,value:m,children:y,attrs:x,nonce:b}),y)},d=r.memo(e=>{let{forcedTheme:t,storageKey:n,attribute:s,enableSystem:a,enableColorScheme:l,defaultTheme:u,value:c,attrs:d,nonce:f}=e,h="system"===u,p="class"===s?"var d=document.documentElement,c=d.classList;".concat("c.remove(".concat(d.map(e=>"'".concat(e,"'")).join(","),")"),";"):"var d=document.documentElement,n='".concat(s,"',s='setAttribute';"),v=l?(i.includes(u)?u:null)?"if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'".concat(u,"'"):"if(e==='light'||e==='dark')d.style.colorScheme=e":"",_=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=c?c[e]:e,o=t?e+"|| ''":"'".concat(r,"'"),a="";return l&&n&&!t&&i.includes(e)&&(a+="d.style.colorScheme = '".concat(e,"';")),"class"===s?t||r?a+="c.add(".concat(o,")"):a+="null":r&&(a+="d[s](n,".concat(o,")")),a},g=t?"!function(){".concat(p).concat(_(t),"}()"):a?"!function(){try{".concat(p,"var e=localStorage.getItem('").concat(n,"');if('system'===e||(!e&&").concat(h,")){var t='").concat(o,"',m=window.matchMedia(t);if(m.media!==t||m.matches){").concat(_("dark"),"}else{").concat(_("light"),"}}else if(e){").concat(c?"var x=".concat(JSON.stringify(c),";"):"").concat(_(c?"x[e]":"e",!0),"}").concat(h?"":"else{"+_(u,!1,!1)+"}").concat(v,"}catch(e){}}()"):"!function(){try{".concat(p,"var e=localStorage.getItem('").concat(n,"');if(e){").concat(c?"var x=".concat(JSON.stringify(c),";"):"").concat(_(c?"x[e]":"e",!0),"}else{").concat(_(u,!1,!1),";}").concat(v,"}catch(t){}}();");return r.createElement("script",{nonce:f,dangerouslySetInnerHTML:{__html:g}})}),f=(e,t)=>{let n;if(!s){try{n=localStorage.getItem(e)||void 0}catch(e){}return n||t}},h=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},p=e=>(e||(e=window.matchMedia(o)),e.matches?"dark":"light")}}]);