(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7412,9242,2508,3600,3822],{90239:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=i(57437),r=i(2265);t.default=function(e){let{html:t,height:i=null,width:s=null,children:o,dataNtpc:a=""}=e;return(0,r.useEffect)(()=>{a&&performance.mark("mark_feature_usage",{detail:{feature:"next-third-parties-".concat(a)}})},[a]),(0,n.jsxs)(n.Fragment,{children:[o,t?(0,n.jsx)("div",{style:{height:null!=i?"".concat(i,"px"):"auto",width:null!=s?"".concat(s,"px"):"auto"},"data-ntpc":a,dangerouslySetInnerHTML:{__html:t}}):null]})}},64404:function(e,t,i){"use strict";var n;let r;Object.defineProperty(t,"__esModule",{value:!0}),t.sendGAEvent=t.GoogleAnalytics=void 0;let s=i(57437),o=i(2265),a=(n=i(31877))&&n.__esModule?n:{default:n};t.GoogleAnalytics=function(e){let{gaId:t,dataLayerName:i="dataLayer"}=e;return void 0===r&&(r=i),(0,o.useEffect)(()=>{performance.mark("mark_feature_usage",{detail:{feature:"next-third-parties-ga"}})},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.default,{id:"_next-ga-init",dangerouslySetInnerHTML:{__html:"\n          window['".concat(i,"'] = window['").concat(i,"'] || [];\n          function gtag(){window['").concat(i,"'].push(arguments);}\n          gtag('js', new Date());\n\n          gtag('config', '").concat(t,"');")}}),(0,s.jsx)(a.default,{id:"_next-ga",src:"https://www.googletagmanager.com/gtag/js?id=".concat(t)})]})},t.sendGAEvent=function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];if(void 0===r){console.warn("@next/third-parties: GA has not been initialized");return}window[r]?window[r].push(arguments):console.warn("@next/third-parties: GA dataLayer ".concat(r," does not exist"))}},27640:function(e,t,i){"use strict";var n;let r;Object.defineProperty(t,"__esModule",{value:!0}),t.sendGTMEvent=t.GoogleTagManager=void 0;let s=i(57437),o=i(2265),a=(n=i(31877))&&n.__esModule?n:{default:n};t.GoogleTagManager=function(e){let{gtmId:t,dataLayerName:i="dataLayer",auth:n,preview:l,dataLayer:u}=e;void 0===r&&(r=i);let c="dataLayer"!==i?"&l=".concat(i):"";return(0,o.useEffect)(()=>{performance.mark("mark_feature_usage",{detail:{feature:"next-third-parties-gtm"}})},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a.default,{id:"_next-gtm-init",dangerouslySetInnerHTML:{__html:"\n      (function(w,l){\n        w[l]=w[l]||[];\n        w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});\n        ".concat(u?"w[l].push(".concat(JSON.stringify(u),")"):"","\n      })(window,'").concat(i,"');")}}),(0,s.jsx)(a.default,{id:"_next-gtm","data-ntpc":"GTM",src:"https://www.googletagmanager.com/gtm.js?id=".concat(t).concat(c).concat(n?"&gtm_auth=".concat(n):"").concat(l?"&gtm_preview=".concat(l,"&gtm_cookies_win=x"):"")})]})},t.sendGTMEvent=e=>{if(void 0===r){console.warn("@next/third-parties: GTM has not been initialized");return}window[r]?window[r].push(e):console.warn("@next/third-parties: GTM dataLayer ".concat(r," does not exist"))}},92699:function(e,t,i){"use strict";i.d(t,{Z:function(){return n}});let n=(0,i(78030).Z)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])},38296:function(e,t,i){"use strict";i.d(t,{Z:function(){return n}});let n=(0,i(78030).Z)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},87138:function(e,t,i){"use strict";i.d(t,{default:function(){return r.a}});var n=i(231),r=i.n(n)},16463:function(e,t,i){"use strict";var n=i(71169);i.o(n,"useParams")&&i.d(t,{useParams:function(){return n.useParams}}),i.o(n,"usePathname")&&i.d(t,{usePathname:function(){return n.usePathname}}),i.o(n,"useRouter")&&i.d(t,{useRouter:function(){return n.useRouter}}),i.o(n,"useSearchParams")&&i.d(t,{useSearchParams:function(){return n.useSearchParams}})},31877:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return r.a}});var n=i(84080),r=i.n(n),s={};for(var o in n)"default"!==o&&(s[o]=(function(e){return n[e]}).bind(0,o));i.d(t,s)},40905:function(e,t){"use strict";let i;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var i in t)Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}(t,{DOMAttributeNames:function(){return n},default:function(){return o},isEqualNode:function(){return s}});let n={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv",noModule:"noModule"};function r(e){let{type:t,props:i}=e,r=document.createElement(t);for(let e in i){if(!i.hasOwnProperty(e)||"children"===e||"dangerouslySetInnerHTML"===e||void 0===i[e])continue;let s=n[e]||e.toLowerCase();"script"===t&&("async"===s||"defer"===s||"noModule"===s)?r[s]=!!i[e]:r.setAttribute(s,i[e])}let{children:s,dangerouslySetInnerHTML:o}=i;return o?r.innerHTML=o.__html||"":s&&(r.textContent="string"==typeof s?s:Array.isArray(s)?s.join(""):""),r}function s(e,t){if(e instanceof HTMLElement&&t instanceof HTMLElement){let i=t.getAttribute("nonce");if(i&&!e.getAttribute("nonce")){let n=t.cloneNode(!0);return n.setAttribute("nonce",""),n.nonce=i,i===e.nonce&&e.isEqualNode(n)}}return e.isEqualNode(t)}function o(){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 i=t[e.type]||[];i.push(e),t[e.type]=i});let n=t.title?t.title[0]:null,r="";if(n){let{children:e}=n.props;r="string"==typeof e?e:Array.isArray(e)?e.join(""):""}r!==document.title&&(document.title=r),["meta","base","link","style","script"].forEach(e=>{i(e,t[e]||[])})}}}i=(e,t)=>{let i=document.getElementsByTagName("head")[0],n=i.querySelector("meta[name=next-head-count]"),o=Number(n.content),a=[];for(let t=0,i=n.previousElementSibling;t<o;t++,i=(null==i?void 0:i.previousElementSibling)||null){var l;(null==i?void 0:null==(l=i.tagName)?void 0:l.toLowerCase())===e&&a.push(i)}let u=t.map(r).filter(e=>{for(let t=0,i=a.length;t<i;t++)if(s(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=>i.insertBefore(e,n)),n.content=(o-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)},84080:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var i in t)Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}(t,{default:function(){return y},handleClientScriptLoad:function(){return v},initScriptLoader:function(){return _}});let n=i(99920),r=i(41452),s=i(57437),o=n._(i(54887)),a=r._(i(2265)),l=i(36590),u=i(40905),c=i(49189),d=new Map,h=new Set,f=["onLoad","onReady","dangerouslySetInnerHTML","children","onError","strategy","stylesheets"],p=e=>{if(o.default.preinit){e.forEach(e=>{o.default.preinit(e,{as:"style"})});return}if("undefined"!=typeof window){let t=document.head;e.forEach(e=>{let i=document.createElement("link");i.type="text/css",i.rel="stylesheet",i.href=e,t.appendChild(i)})}},g=e=>{let{src:t,id:i,onLoad:n=()=>{},onReady:r=null,dangerouslySetInnerHTML:s,children:o="",strategy:a="afterInteractive",onError:l,stylesheets:c}=e,g=i||t;if(g&&h.has(g))return;if(d.has(t)){h.add(g),d.get(t).then(n,l);return}let v=()=>{r&&r(),h.add(g)},_=document.createElement("script"),m=new Promise((e,t)=>{_.addEventListener("load",function(t){e(),n&&n.call(this,t),v()}),_.addEventListener("error",function(e){t(e)})}).catch(function(e){l&&l(e)});for(let[i,n]of(s?(_.innerHTML=s.__html||"",v()):o?(_.textContent="string"==typeof o?o:Array.isArray(o)?o.join(""):"",v()):t&&(_.src=t,d.set(t,m)),Object.entries(e))){if(void 0===n||f.includes(i))continue;let e=u.DOMAttributeNames[i]||i.toLowerCase();_.setAttribute(e,n)}"worker"===a&&_.setAttribute("type","text/partytown"),_.setAttribute("data-nscript",a),c&&p(c),document.body.appendChild(_)};function v(e){let{strategy:t="afterInteractive"}=e;"lazyOnload"===t?window.addEventListener("load",()=>{(0,c.requestIdleCallback)(()=>g(e))}):g(e)}function _(e){e.forEach(v),[...document.querySelectorAll('[data-nscript="beforeInteractive"]'),...document.querySelectorAll('[data-nscript="beforePageRender"]')].forEach(e=>{let t=e.id||e.getAttribute("src");h.add(t)})}function m(e){let{id:t,src:i="",onLoad:n=()=>{},onReady:r=null,strategy:u="afterInteractive",onError:d,stylesheets:f,...p}=e,{updateScripts:v,scripts:_,getIsSsr:m,appDir:y,nonce:b}=(0,a.useContext)(l.HeadManagerContext),k=(0,a.useRef)(!1);(0,a.useEffect)(()=>{let e=t||i;k.current||(r&&e&&h.has(e)&&r(),k.current=!0)},[r,t,i]);let w=(0,a.useRef)(!1);if((0,a.useEffect)(()=>{!w.current&&("afterInteractive"===u?g(e):"lazyOnload"===u&&("complete"===document.readyState?(0,c.requestIdleCallback)(()=>g(e)):window.addEventListener("load",()=>{(0,c.requestIdleCallback)(()=>g(e))})),w.current=!0)},[e,u]),("beforeInteractive"===u||"worker"===u)&&(v?(_[u]=(_[u]||[]).concat([{id:t,src:i,onLoad:n,onReady:r,onError:d,...p}]),v(_)):m&&m()?h.add(t||i):m&&!m()&&g(e)),y){if(f&&f.forEach(e=>{o.default.preinit(e,{as:"style"})}),"beforeInteractive"===u)return i?(o.default.preload(i,p.integrity?{as:"script",integrity:p.integrity,nonce:b,crossOrigin:p.crossOrigin}:{as:"script",nonce:b,crossOrigin:p.crossOrigin}),(0,s.jsx)("script",{nonce:b,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([i,{...p,id:t}])+")"}})):(p.dangerouslySetInnerHTML&&(p.children=p.dangerouslySetInnerHTML.__html,delete p.dangerouslySetInnerHTML),(0,s.jsx)("script",{nonce:b,dangerouslySetInnerHTML:{__html:"(self.__next_s=self.__next_s||[]).push("+JSON.stringify([0,{...p,id:t}])+")"}}));"afterInteractive"===u&&i&&o.default.preload(i,p.integrity?{as:"script",integrity:p.integrity,nonce:b,crossOrigin:p.crossOrigin}:{as:"script",nonce:b,crossOrigin:p.crossOrigin})}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)},42477:function(e,t,i){"use strict";function n(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),i.push.apply(i,n)}return i}function r(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?n(Object(i),!0).forEach(function(t){u(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}function s(e){return(s="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 o(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function a(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e,t,i){return t&&a(e.prototype,t),i&&a(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function c(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,s=[],o=!0,a=!1;try{for(i=i.call(e);!(o=(n=i.next()).done)&&(s.push(n.value),!t||s.length!==t);o=!0);}catch(e){a=!0,r=e}finally{try{o||null==i.return||i.return()}finally{if(a)throw r}}return s}}(e,t)||h(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 f(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||h(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 h(e,t){if(e){if("string"==typeof e)return f(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function p(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=h(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return o=e.done,e},e:function(e){a=!0,s=e},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw s}}}}i.d(t,{ZP:function(){return rd}});var g={DEBUG:!1,LIB_VERSION:"1.161.3"},v=Array.isArray,_=Object.prototype,m=_.hasOwnProperty,y=_.toString,b=v||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},x=function(e){return void 0===e},E=function(e){return"[object String]"==y.call(e)},R=function(e){return E(e)&&0===e.trim().length},P=function(e){return null===e},O=function(e){return x(e)||P(e)},C=function(e){return"[object Number]"==y.call(e)},I=function(e){return"[object Boolean]"===y.call(e)},F="undefined"!=typeof window?window:void 0,L="undefined"!=typeof globalThis?globalThis:F,T=Array.prototype,$=T.forEach,A=T.indexOf,M=null==L?void 0:L.navigator,N=null==L?void 0:L.document,D=null==L?void 0:L.location,q=null==L?void 0:L.fetch,j=null!=L&&L.XMLHttpRequest&&"withCredentials"in new L.XMLHttpRequest?L.XMLHttpRequest:void 0,H=null==L?void 0:L.AbortController,B=null==M?void 0:M.userAgent,U=null!=F?F:{},V="[PostHog.js]",z={_log:function(e){if(F&&(g.DEBUG||U.POSTHOG_DEBUG)&&!x(F.console)&&F.console){for(var t=("__rrweb_original__"in F.console[e])?F.console[e].__rrweb_original__:F.console[e],i=arguments.length,n=Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];t.apply(void 0,[V].concat(n))}},info:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];z._log.apply(z,["log"].concat(t))},warn:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];z._log.apply(z,["warn"].concat(t))},error:function(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];z._log.apply(z,["error"].concat(t))},critical:function(){for(var e,t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];(e=console).error.apply(e,[V].concat(i))},uninitializedWarning:function(e){z.error("You must initialize PostHog before calling ".concat(e))}},W={},G=function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")};function K(e,t,i){if(b(e)){if($&&e.forEach===$)e.forEach(t,i);else if("length"in e&&e.length===+e.length){for(var n=0,r=e.length;n<r;n++)if(n in e&&t.call(i,e[n],n)===W)return}}}function Q(e,t,i){if(!O(e)){if(b(e))return K(e,t,i);if(e instanceof FormData){var n,r=p(e.entries());try{for(r.s();!(n=r.n()).done;){var s=n.value;if(t.call(i,s[1],s[0])===W)return}}catch(e){r.e(e)}finally{r.f()}}else for(var o in e)if(m.call(e,o)&&t.call(i,e[o],o)===W)return}}var J=function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return K(i,function(t){for(var i in t)void 0!==t[i]&&(e[i]=t[i])}),e};function Y(e,t){return -1!==e.indexOf(t)}function X(e){for(var t=Object.keys(e),i=t.length,n=Array(i);i--;)n[i]=[t[i],e[t[i]]];return n}var Z,ee=function(){return Date.now=Date.now||function(){return+new Date},Date.now()},et=function(e){try{return e()}catch(e){return}},ei=function(e){return function(){try{for(var t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];return e.apply(this,i)}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)}}},en=function(e){var t={};return Q(e,function(e,i){E(e)&&e.length>0&&(t[i]=e)}),t},er=function(e){return e.replace(/^\$/,"")},es=function(e){var t,i,n,r,s="";for(t=i=0,n=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,r=0;r<n;r++){var o=e.charCodeAt(r),a=null;o<128?i++:a=o>127&&o<2048?String.fromCharCode(o>>6|192,63&o|128):String.fromCharCode(o>>12|224,o>>6&63|128,63&o|128),P(a)||(i>t&&(s+=e.substring(t,i)),s+=a,t=i=r+1)}return i>t&&(s+=e.substring(t,e.length)),s},eo=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,i,n,r,s){if(t){if(t.addEventListener&&!r)t.addEventListener(i,n,!!s);else{var o="on"+i,a=t[o];t[o]=function(i){if(i=i||e(null==F?void 0:F.event)){var r,s=!0;k(a)&&(r=a(i));var o=n.call(t,i);return!1!==r&&!1!==o||(s=!1),s}}}}else z.error("No valid element provided to register_event")}}();function ea(e,t){for(var i=0;i<e.length;i++)if(t(e[i]))return e[i]}(eJ=Z||(Z={})).GZipJS="gzip-js",eJ.Base64="base64";var el="$people_distinct_id",eu="__alias",ec="__timers",ed="$autocapture_disabled_server_side",eh="$heatmaps_enabled_server_side",ef="$exception_capture_enabled_server_side",ep="$exception_capture_endpoint_suffix",eg="$web_vitals_enabled_server_side",ev="$web_vitals_allowed_metrics",e_="$session_recording_enabled_server_side",em="$console_log_recording_enabled_server_side",ey="$session_recording_network_payload_capture",eb="$session_recording_canvas_recording",ek="$replay_sample_rate",ew="$replay_minimum_duration",eS="$sesid",ex="$session_is_sampled",eE="$enabled_feature_flags",eR="$early_access_features",eP="$stored_person_properties",eO="$stored_group_properties",eC="$surveys",eI="$surveys_activated",eF="$flag_call_reported",eL="$user_state",eT="$client_session_props",e$="$capture_rate_limit",eA="$initial_campaign_params",eM="$initial_referrer_info",eN="$initial_person_info",eD="$epp",eq="__POSTHOG_TOOLBAR__",ej=[el,eu,"__cmpns",ec,e_,eh,eS,eE,eL,eR,eO,eP,eC,eF,eT,e$,eA,eM,eD],eH="$active_feature_flags",eB="$override_feature_flags",eU="$feature_flag_payloads",eV=function(e){var t,i={},n=p(X(e||{}));try{for(n.s();!(t=n.n()).done;){var r=c(t.value,2),s=r[0],o=r[1];o&&(i[s]=o)}}catch(e){n.e(e)}finally{n.f()}return i},ez=function(){function e(t){o(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(eE),t=this.instance.get_property(eB);if(!t)return e||{};for(var i=J({},e),n=Object.keys(t),r=0;r<n.length;r++)i[n[r]]=t[n[r]];return this._override_warning||(z.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:t,finalFlags:i}),this._override_warning=!0),i}},{key:"getFlagPayloads",value:function(){return this.instance.get_property(eU)||{}}},{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,i=this.instance.get_property(eP),n=this.instance.get_property(eO),r={token:t,distinct_id:this.instance.get_distinct_id(),groups:this.instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:i,group_properties:n,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:r,compression:this.instance.config.disable_compression?void 0:Z.Base64,timeout:this.instance.config.feature_flag_request_timeout_ms,callback:function(t){e.setReloadingPaused(!1);var i,n=!0;200===t.statusCode&&(e.$anon_distinct_id=void 0,n=!1),e.receivedFeatureFlags(null!==(i=t.json)&&void 0!==i?i:{},n),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 i,n=this.getFlagVariants()[e],r="".concat(n),s=this.instance.get_property(eF)||{};return!t.send_event&&"send_event"in t||e in s&&s[e].includes(r)||(b(s[e])?s[e].push(r):s[e]=[r],null===(i=this.instance.persistence)||void 0===i||i.register(u({},eF,s)),this.instance.capture("$feature_flag_called",{$feature_flag:e,$feature_flag_response:n})),n}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 i=this.getFlagVariants(),n=this.getFlagPayloads();(function(e,t){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=e.featureFlags,a=e.featureFlagPayloads;if(o){if(b(o)){var l,c={};if(o)for(var d=0;d<o.length;d++)c[o[d]]=!0;t&&t.register((u(l={},eH,o),u(l,eE,c),l))}else{var h=o,f=a;e.errorsWhileComputingFlags&&(h=r(r({},n),h),f=r(r({},s),f)),t&&t.register((u(i={},eH,Object.keys(eV(h))),u(i,eE,h||{}),u(i,eU,f||{}),i))}}})(e,this.instance.persistence,i,n),this._fireFeatureFlagsCallbacks(t)}}},{key:"override",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.instance.__loaded||!this.instance.persistence)return z.uninitializedWarning("posthog.feature_flags.override");if(this._override_warning=t,!1===e)this.instance.persistence.unregister(eB);else if(b(e)){for(var i={},n=0;n<e.length;n++)i[e[n]]=!0;this.instance.persistence.register(u({},eB,i))}else this.instance.persistence.register(u({},eB,e))}},{key:"onFeatureFlags",value:function(e){var t=this;if(this.addFeatureFlagsHandler(e),this.instance.decideEndpointWasHit){var i=this._prepareFeatureFlagsForCallbacks();e(i.flags,i.flagVariants)}return function(){return t.removeFeatureFlagsHandler(e)}}},{key:"updateEarlyAccessFeatureEnrollment",value:function(e,t){var i,n,s=u({},"$feature_enrollment/".concat(e),t);this.instance.capture("$feature_enrollment_update",{$feature_flag:e,$feature_enrollment:t,$set:s}),this.setPersonPropertiesForFlags(s,!1);var o=r(r({},this.getFlagVariants()),{},u({},e,t));null===(i=this.instance.persistence)||void 0===i||i.register((u(n={},eH,Object.keys(eV(o))),u(n,eE,o),n)),this._fireFeatureFlagsCallbacks()}},{key:"getEarlyAccessFeatures",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.instance.get_property(eR);if(n&&!i)return e(n);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(i){var n;if(i.json){var r=i.json.earlyAccessFeatures;return null===(n=t.instance.persistence)||void 0===n||n.register(u({},eR,r)),e(r)}}})}},{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,i){return e[i]=t[i],e},{})}}},{key:"_fireFeatureFlagsCallbacks",value:function(e){var t=this._prepareFeatureFlagsForCallbacks(),i=t.flags,n=t.flagVariants;this.featureFlagEventHandlers.forEach(function(t){return t(i,n,{errorsLoading:e})})}},{key:"setPersonPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.instance.get_property(eP)||{};this.instance.register(u({},eP,r(r({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetPersonPropertiesForFlags",value:function(){this.instance.unregister(eP)}},{key:"setGroupPropertiesForFlags",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=this.instance.get_property(eO)||{};0!==Object.keys(i).length&&Object.keys(i).forEach(function(t){i[t]=r(r({},i[t]),e[t]),delete e[t]}),this.instance.register(u({},eO,r(r({},i),e))),t&&this.instance.reloadFeatureFlags()}},{key:"resetGroupPropertiesForFlags",value:function(e){if(e){var t=this.instance.get_property(eO)||{};this.instance.register(u({},eO,r(r({},t),{},u({},e,{}))))}else this.instance.unregister(eO)}}]),e}();Math.trunc||(Math.trunc=function(e){return e<0?Math.ceil(e):Math.floor(e)}),Number.isInteger||(Number.isInteger=function(e){return C(e)&&isFinite(e)&&Math.floor(e)===e});var eW="0123456789abcdef",eG=function(){function e(t){if(o(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 i=this.bytes[t]-e.bytes[t];if(0!==i)return Math.sign(i)}return 0}}],[{key:"fromFieldsV7",value:function(t,i,n,r){if(!Number.isInteger(t)||!Number.isInteger(i)||!Number.isInteger(n)||!Number.isInteger(r)||t<0||i<0||n<0||r<0||t>0xffffffffffff||i>4095||n>1073741823||r>4294967295)throw RangeError("invalid field value");var s=new Uint8Array(16);return s[0]=t/1099511627776,s[1]=t/4294967296,s[2]=t/16777216,s[3]=t/65536,s[4]=t/256,s[5]=t,s[6]=112|i>>>8,s[7]=i,s[8]=128|n>>>24,s[9]=n>>>16,s[10]=n>>>8,s[11]=n,s[12]=r>>>24,s[13]=r>>>16,s[14]=r>>>8,s[15]=r,new e(s)}}]),e}(),eK=function(){function e(){o(this,e),u(this,"timestamp",0),u(this,"counter",0),u(this,"random",new eZ)}return l(e,[{key:"generate",value:function(){var e=this.generateOrAbort();if(x(e)){this.timestamp=0;var t=this.generateOrAbort();if(x(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 eG.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}(),eQ=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};F&&!x(F.crypto)&&crypto.getRandomValues&&(eQ=function(e){return crypto.getRandomValues(e)});var eJ,eY,eX,eZ=function(){function e(){o(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&&(eQ(this.buffer),this.cursor=0),this.buffer[this.cursor++]}}]),e}(),e0=function(){return e1().toString()},e1=function(){return(eY||(eY=new eK)).generate()},e2="",e3=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i,e5={is_supported:function(){return!!N},error:function(e){z.error("cookieStore error: "+e)},get:function(e){if(N){try{for(var t=e+"=",i=N.cookie.split(";").filter(function(e){return e.length}),n=0;n<i.length;n++){for(var r=i[n];" "==r.charAt(0);)r=r.substring(1,r.length);if(0===r.indexOf(t))return decodeURIComponent(r.substring(t.length,r.length))}}catch(e){}return null}},parse:function(e){var t;try{t=JSON.parse(e5.get(e))||{}}catch(e){}return t},set:function(e,t,i,n,r){if(N)try{var s="",o="",a=function(e,t){if(t){var i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:N;if(e2)return e2;if(!t||["localhost","127.0.0.1"].includes(e))return"";for(var i=e.split("."),n=Math.min(i.length,8),r="dmn_chk_"+e0(),s=RegExp("(^|;)\\s*"+r+"=1");!e2&&n--;){var o=i.slice(n).join("."),a=r+"=1;domain=."+o;t.cookie=a,s.test(t.cookie)&&(t.cookie=a+";expires=Thu, 01 Jan 1970 00:00:00 GMT",e2=o)}return e2}(e);if(!i){var n,r=(n=e.match(e3))?n[0]:"";r!==i&&z.info("Warning: cookie subdomain discovery mismatch",r,i),i=r}return i?"; domain=."+i:""}return""}(N.location.hostname,n);if(i){var l=new Date;l.setTime(l.getTime()+24*i*36e5),s="; expires="+l.toUTCString()}r&&(o="; secure");var u=e+"="+encodeURIComponent(JSON.stringify(t))+s+"; SameSite=Lax; path=/"+a+o;return u.length>3686.4&&z.warn("cookieStore warning: large cookie, len="+u.length),N.cookie=u,u}catch(e){return}},remove:function(e,t){try{e5.set(e,"",-1,t)}catch(e){return}}},e8=null,e4={is_supported:function(){if(!P(e8))return e8;var e=!0;if(x(F))e=!1;else try{var t="__mplssupport__";e4.set(t,"xyz"),'"xyz"'!==e4.get(t)&&(e=!1),e4.remove(t)}catch(t){e=!1}return e||z.error("localStorage unsupported; falling back to cookie store"),e8=e,e},error:function(e){z.error("localStorage error: "+e)},get:function(e){try{return null==F?void 0:F.localStorage.getItem(e)}catch(e){e4.error(e)}return null},parse:function(e){try{return JSON.parse(e4.get(e))||{}}catch(e){}return null},set:function(e,t){try{null==F||F.localStorage.setItem(e,JSON.stringify(t))}catch(e){e4.error(e)}},remove:function(e){try{null==F||F.localStorage.removeItem(e)}catch(e){e4.error(e)}}},e6=["distinct_id",eS,ex,eD],e7=r(r({},e4),{},{parse:function(e){try{var t={};try{t=e5.parse(e)||{}}catch(e){}var i=J(t,JSON.parse(e4.get(e)||"{}"));return e4.set(e,i),i}catch(e){}return null},set:function(e,t,i,n,r,s){try{e4.set(e,t,void 0,void 0,s);var o={};e6.forEach(function(e){t[e]&&(o[e]=t[e])}),Object.keys(o).length&&e5.set(e,o,i,n,r,s)}catch(e){e4.error(e)}},remove:function(e,t){try{null==F||F.localStorage.removeItem(e),e5.remove(e,t)}catch(e){e4.error(e)}}}),e9={},te={is_supported:function(){return!0},error:function(e){z.error("memoryStorage error: "+e)},get:function(e){return e9[e]||null},parse:function(e){return e9[e]||null},set:function(e,t){e9[e]=t},remove:function(e){delete e9[e]}},tt=null,ti={is_supported:function(){if(!P(tt))return tt;if(tt=!0,x(F))tt=!1;else try{var e="__support__";ti.set(e,"xyz"),'"xyz"'!==ti.get(e)&&(tt=!1),ti.remove(e)}catch(e){tt=!1}return tt},error:function(e){z.error("sessionStorage error: ",e)},get:function(e){try{return null==F?void 0:F.sessionStorage.getItem(e)}catch(e){ti.error(e)}return null},parse:function(e){try{return JSON.parse(ti.get(e))||null}catch(e){}return null},set:function(e,t){try{null==F||F.sessionStorage.setItem(e,JSON.stringify(t))}catch(e){ti.error(e)}},remove:function(e){try{null==F||F.sessionStorage.removeItem(e)}catch(e){ti.error(e)}}},tn=["localhost","127.0.0.1"],tr=function(e){var t=null==N?void 0:N.createElement("a");return x(t)?null:(t.href=e,t)},ts=function(e,t){return!!function(e){try{new RegExp(e)}catch(e){return!1}return!0}(t)&&new RegExp(t).test(e)},to=function(e){var t,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",r=[];return Q(e,function(e,n){x(e)||x(n)||"undefined"===n||(t=encodeURIComponent(e instanceof File?e.name:e.toString()),i=encodeURIComponent(n),r[r.length]=i+"="+t)}),r.join(n)},ta=function(e,t){for(var i,n=((e.split("#")[0]||"").split("?")[1]||"").split("&"),r=0;r<n.length;r++){var s=n[r].split("=");if(s[0]===t){i=s;break}}if(!b(i)||i.length<2)return"";var o=i[1];try{o=decodeURIComponent(o)}catch(e){z.error("Skipping decoding for malformed query param: "+o)}return o.replace(/\+/g," ")},tl=function(e,t){var i=e.match(RegExp(t+"=([^&]*)"));return i?i[1]:null},tu="Mobile",tc="Android",td="Tablet",th=tc+" "+td,tf="iPad",tp="Apple",tg=tp+" Watch",tv="Safari",t_="BlackBerry",tm="Samsung",ty=tm+"Browser",tb=tm+" Internet",tk="Chrome",tw=tk+" OS",tS=tk+" iOS",tx="Internet Explorer",tE=tx+" "+tu,tR="Opera",tP=tR+" Mini",tO="Edge",tC="Microsoft "+tO,tI="Firefox",tF=tI+" iOS",tL="Nintendo",tT="PlayStation",t$="Xbox",tA=tc+" "+tu,tM=tu+" "+tv,tN="Windows",tD=tN+" Phone",tq="Nokia",tj="Ouya",tH="Generic",tB=tH+" "+tu.toLowerCase(),tU=tH+" "+td.toLowerCase(),tV="Konqueror",tz="(\\d+(\\.\\d+)?)",tW=RegExp("Version/"+tz),tG=RegExp(t$,"i"),tK=RegExp(tT+" \\w+","i"),tQ=RegExp(tL+" \\w+","i"),tJ=RegExp(t_+"|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"},tX=function(e,t){var i,n;return t=t||"",Y(e," OPR/")&&Y(e,"Mini")?tP:Y(e," OPR/")?tR:tJ.test(e)?t_:Y(e,"IE"+tu)||Y(e,"WPDesktop")?tE:Y(e,ty)?tb:Y(e,tO)||Y(e,"Edg/")?tC:Y(e,"FBIOS")?"Facebook "+tu:Y(e,"UCWEB")||Y(e,"UCBrowser")?"UC Browser":Y(e,"CriOS")?tS:Y(e,"CrMo")?tk:Y(e,tc)&&Y(e,tv)?tA:Y(e,tk)?tk:Y(e,"FxiOS")?tF:Y(e.toLowerCase(),tV.toLowerCase())?tV:(i=e,(n=t)&&Y(n,tp)||Y(i,tv)&&!Y(i,tk)&&!Y(i,tc))?Y(e,tu)?tM:tv:Y(e,tI)?tI:Y(e,"MSIE")||Y(e,"Trident/")?tx:Y(e,"Gecko")?tI:""},tZ=(u(eX={},tE,[RegExp("rv:"+tz)]),u(eX,tC,[RegExp(tO+"?\\/"+tz)]),u(eX,tk,[RegExp("("+tk+"|CrMo)\\/"+tz)]),u(eX,tS,[RegExp("CriOS\\/"+tz)]),u(eX,"UC Browser",[RegExp("(UCBrowser|UCWEB)\\/"+tz)]),u(eX,tv,[tW]),u(eX,tM,[tW]),u(eX,tR,[RegExp("(Opera|OPR)\\/"+tz)]),u(eX,tI,[RegExp(tI+"\\/"+tz)]),u(eX,tF,[RegExp("FxiOS\\/"+tz)]),u(eX,tV,[RegExp("Konqueror[:/]?"+tz,"i")]),u(eX,t_,[RegExp(t_+" "+tz),tW]),u(eX,tA,[RegExp("android\\s"+tz,"i")]),u(eX,tb,[RegExp(ty+"\\/"+tz)]),u(eX,tx,[RegExp("(rv:|MSIE )"+tz)]),u(eX,"Mozilla",[RegExp("rv:"+tz)]),eX),t0=[[RegExp(t$+"; "+t$+" (.*?)[);]","i"),function(e){return[t$,e&&e[1]||""]}],[RegExp(tL,"i"),[tL,""]],[RegExp(tT,"i"),[tT,""]],[tJ,[t_,""]],[RegExp(tN,"i"),function(e,t){if(/Phone/.test(t)||/WPDesktop/.test(t))return[tD,""];if(new RegExp(tu).test(t)&&!/IEMobile\b/.test(t))return[tN+" "+tu,""];var i=/Windows NT ([0-9.]+)/i.exec(t);if(i&&i[1]){var n=tY[i[1]]||"";return/arm/i.test(t)&&(n="RT"),[tN,n]}return[tN,""]}],[/((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=x(e[2])?e[3]:e[2]),["watchOS",t]}],[RegExp("("+tc+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+tc+")","i"),function(e){return e&&e[2]?[tc,[e[2],e[3],e[4]||"0"].join(".")]:[tc,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,function(e){var t=["Mac OS X",""];if(e&&e[1]){var i=[e[1],e[2],e[3]||"0"];t[1]=i.join(".")}return t}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[tw,""]],[/Linux|debian/i,["Linux",""]]],t1=function(e){return tQ.test(e)?tL:tK.test(e)?tT:tG.test(e)?t$:RegExp(tj,"i").test(e)?tj:RegExp("("+tD+"|WPDesktop)","i").test(e)?tD:/iPad/.test(e)?tf:/iPod/.test(e)?"iPod Touch":/iPhone/.test(e)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(e)?tg:tJ.test(e)?t_:/(kobo)\s(ereader|touch)/i.test(e)?"Kobo":RegExp(tq,"i").test(e)?tq:/(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(tu).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)?tc:th:tc:RegExp("(pda|"+tu+")","i").test(e)?tB:RegExp(td,"i").test(e)&&!RegExp(td+" pc","i").test(e)?tU:""},t2="https?://(.*)",t3=["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","rdt_cid"],t5={campaignParams:function(e){return N?this._campaignParamsFromUrl(N.URL,e):{}},_campaignParamsFromUrl:function(e,t){var i=t3.concat(t||[]),n={};return Q(i,function(t){var i=ta(e,t);i&&(n[t]=i)}),n},_searchEngine:function(e){return e?0===e.search(t2+"google.([^/?]*)")?"google":0===e.search(t2+"bing.com")?"bing":0===e.search(t2+"yahoo.com")?"yahoo":0===e.search(t2+"duckduckgo.com")?"duckduckgo":null:null},_searchInfoFromReferrer:function(e){var t=t5._searchEngine(e),i={};if(!P(t)){i.$search_engine=t;var n=N?ta(N.referrer,"yahoo"!=t?"q":"p"):"";n.length&&(i.ph_keyword=n)}return i},searchInfo:function(){var e=null==N?void 0:N.referrer;return e?this._searchInfoFromReferrer(e):{}},browser:tX,browserVersion:function(e,t){var i=tZ[tX(e,t)];if(x(i))return null;for(var n=0;n<i.length;n++){var r=i[n],s=e.match(r);if(s)return parseFloat(s[s.length-2])}return null},browserLanguage:function(){return navigator.language||navigator.userLanguage},os:function(e){for(var t=0;t<t0.length;t++){var i=c(t0[t],2),n=i[0],r=i[1],s=n.exec(e),o=s&&(k(r)?r(s,e):r);if(o)return o}return["",""]},device:t1,deviceType:function(e){var t=t1(e);return t===tf||t===th||"Kobo"===t||"Kindle Fire"===t||t===tU?td:t===tL||t===t$||t===tT||t===tj?"Console":t===tg?"Wearable":t?tu:"Desktop"},referrer:function(){return(null==N?void 0:N.referrer)||"$direct"},referringDomain:function(){var e;return null!=N&&N.referrer&&(null===(e=tr(N.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==D?void 0:D.href}},initialPersonPropsFromInfo:function(e){var t,i=e.r,n=e.u,r={$initial_referrer:i,$initial_referring_domain:null==i?void 0:"$direct"==i?"$direct":null===(t=tr(i))||void 0===t?void 0:t.host};if(n){r.$initial_current_url=n;var s=tr(n);r.$initial_host=null==s?void 0:s.host,r.$initial_pathname=null==s?void 0:s.pathname,Q(this._campaignParamsFromUrl(n),function(e,t){r["$initial_"+er(t)]=e})}return i&&Q(this._searchInfoFromReferrer(i),function(e,t){r["$initial_"+er(t)]=e}),r},properties:function(){if(!B)return{};var e=c(t5.os(B),2);return J(en({$os:e[0],$os_version:e[1],$browser:t5.browser(B,navigator.vendor),$device:t5.device(B),$device_type:t5.deviceType(B)}),{$current_url:null==D?void 0:D.href,$host:null==D?void 0:D.host,$pathname:null==D?void 0:D.pathname,$raw_user_agent:B.length>1e3?B.substring(0,997)+"...":B,$browser_version:t5.browserVersion(B,navigator.vendor),$browser_language:t5.browserLanguage(),$screen_height:null==F?void 0:F.screen.height,$screen_width:null==F?void 0:F.screen.width,$viewport_height:null==F?void 0:F.innerHeight,$viewport_width:null==F?void 0:F.innerWidth,$lib:"web",$lib_version:g.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(t5.os(B),2);return J(en({$os:e[0],$os_version:e[1],$browser:t5.browser(B,navigator.vendor)}),{$browser_version:t5.browserVersion(B,navigator.vendor)})}},t8=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"],t4=function(){function e(t){var i;o(this,e),this.config=t,this.props={},this.campaign_params_saved=!1,this.name=(i="",t.token&&(i=t.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),t.persistence_name?"ph_"+t.persistence_name:"ph_"+i+"_posthog"),this.storage=this.buildStorage(t),this.load(),t.debug&&z.info("Persistence loaded",t.persistence,r({},this.props)),this.update_config(t,t),this.save()}return l(e,[{key:"buildStorage",value:function(e){-1===t8.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&&e4.is_supported()?e4:"localstorage+cookie"===t&&e7.is_supported()?e7:"sessionstorage"===t&&ti.is_supported()?ti:"memory"===t?te:"cookie"===t?e5:e7.is_supported()?e7:e5}},{key:"properties",value:function(){var e={};return Q(this.props,function(t,i){if(i===eE&&w(t))for(var n,r=Object.keys(t),s=0;s<r.length;s++)e["$feature/".concat(r[s])]=t[r[s]];else n=!1,(P(ej)?n:A&&ej.indexOf===A?-1!=ej.indexOf(i):(Q(ej,function(e){if(n||(n=e===i))return W}),n))||(e[i]=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,this.config.debug)}},{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,i){var n=this;if(w(e)){x(t)&&(t="None"),this.expire_days=x(i)?this.default_expiry:i;var r=!1;if(Q(e,function(e,i){n.props.hasOwnProperty(i)&&n.props[i]!==t||(n.props[i]=e,r=!0)}),r)return this.save(),!0}return!1}},{key:"register",value:function(e,t){var i=this;if(w(e)){this.expire_days=x(t)?this.default_expiry:t;var n=!1;if(Q(e,function(t,r){e.hasOwnProperty(r)&&i.props[r]!==t&&(i.props[r]=t,n=!0)}),n)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(t5.campaignParams(this.config.custom_campaign_params)),this.campaign_params_saved=!0)}},{key:"update_search_keyword",value:function(){this.register(t5.searchInfo())}},{key:"update_referrer_info",value:function(){this.register_once(t5.referrerInfo(),void 0)}},{key:"set_initial_person_info",value:function(){this.props[eA]||this.props[eM]||this.register_once(u({},eN,t5.initialPersonInfo()),void 0)}},{key:"get_referrer_info",value:function(){return en({$referrer:this.props.$referrer,$referring_domain:this.props.$referring_domain})}},{key:"get_initial_props",value:function(){var e=this,t={};Q([eM,eA],function(i){var n=e.props[i];n&&Q(n,function(e,i){t["$initial_"+er(i)]=e})});var i=this.props[eN];return i&&J(t,t5.initialPersonPropsFromInfo(i)),t}},{key:"safe_merge",value:function(e){return Q(this.props,function(t,i){i in e||(e[i]=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 i=this.buildStorage(e),n=this.props;this.clear(),this.storage=i,this.props=n,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 i=this.props[ec]||{};i[e]=t,this.props[ec]=i,this.save()}},{key:"remove_event_timer",value:function(e){var t=(this.props[ec]||{})[e];return x(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}();function t6(e){var t;return JSON.stringify(e,(t=[],function(e,i){if(w(i)){for(;t.length>0&&t.at(-1)!==this;)t.pop();return t.includes(i)?"[Circular]":(t.push(i),i)}return i})).length}var t7=((iL=t7||{})[iL.DomContentLoaded=0]="DomContentLoaded",iL[iL.Load=1]="Load",iL[iL.FullSnapshot=2]="FullSnapshot",iL[iL.IncrementalSnapshot=3]="IncrementalSnapshot",iL[iL.Meta=4]="Meta",iL[iL.Custom=5]="Custom",iL[iL.Plugin=6]="Plugin",iL),t9=((iT=t9||{})[iT.Mutation=0]="Mutation",iT[iT.MouseMove=1]="MouseMove",iT[iT.MouseInteraction=2]="MouseInteraction",iT[iT.Scroll=3]="Scroll",iT[iT.ViewportResize=4]="ViewportResize",iT[iT.Input=5]="Input",iT[iT.TouchMove=6]="TouchMove",iT[iT.MediaInteraction=7]="MediaInteraction",iT[iT.StyleSheetRule=8]="StyleSheetRule",iT[iT.CanvasMutation=9]="CanvasMutation",iT[iT.Font=10]="Font",iT[iT.Log=11]="Log",iT[iT.Drag=12]="Drag",iT[iT.StyleDeclaration=13]="StyleDeclaration",iT[iT.Selection=14]="Selection",iT[iT.AdoptedStyleSheet=15]="AdoptedStyleSheet",iT[iT.CustomElement=16]="CustomElement",iT);function ie(e){return e?G(e).split(/\s+/):[]}function it(e){var t=null==F?void 0:F.location.href;return!!(t&&e&&e.some(function(e){return t.match(e)}))}function ii(e){var t="";switch(s(e.className)){case"string":t=e.className;break;case"object":t=(e.className&&"baseVal"in e.className?e.className.baseVal:null)||e.getAttribute("class")||"";break;default:t=""}return ie(t)}function ir(e){return O(e)?null:G(e).split(/(\s+)/).filter(function(e){return ik(e)}).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function is(e){var t="";return ih(e)&&!ip(e)&&e.childNodes&&e.childNodes.length&&Q(e.childNodes,function(e){var i;il(e)&&e.textContent&&(t+=null!==(i=ir(e.textContent))&&void 0!==i?i:"")}),G(t)}function io(e){return!!e&&1===e.nodeType}function ia(e,t){return!!e&&!!e.tagName&&e.tagName.toLowerCase()===t.toLowerCase()}function il(e){return!!e&&3===e.nodeType}function iu(e){return!!e&&11===e.nodeType}var ic=["a","button","form","input","select","textarea","label"];function id(e){var t=e.parentNode;return!(!t||!io(t))&&t}function ih(e){for(var t=e;t.parentNode&&!ia(t,"body");t=t.parentNode){var i=ii(t);if(Y(i,"ph-sensitive")||Y(i,"ph-no-capture"))return!1}if(Y(ii(e),"ph-include"))return!0;var n=e.type||"";if(E(n))switch(n.toLowerCase()){case"hidden":case"password":return!1}var r=e.name||e.id||"";return!(E(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function ip(e){return!!(ia(e,"input")&&!["button","checkbox","submit","reset"].includes(e.type)||ia(e,"select")||ia(e,"textarea")||"true"===e.getAttribute("contenteditable"))}var ig="(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})",iv=new RegExp("^(?:".concat(ig,")$")),i_=new RegExp(ig),im="\\d{3}-?\\d{2}-?\\d{4}",iy=new RegExp("^(".concat(im,")$")),ib=new RegExp("(".concat(im,")"));function ik(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!(O(e)||E(e)&&(e=G(e),(t?iv:i_).test((e||"").replace(/[- ]/g,""))||(t?iy:ib).test(e)))}function iw(e){var t=is(e);return ik(t="".concat(t," ").concat(function e(t){var i="";return t&&t.childNodes&&t.childNodes.length&&Q(t.childNodes,function(t){var n;if(t&&"span"===(null===(n=t.tagName)||void 0===n?void 0:n.toLowerCase()))try{var r=is(t);i="".concat(i," ").concat(r).trim(),t.childNodes&&t.childNodes.length&&(i="".concat(i," ").concat(e(t)).trim())}catch(e){z.error(e)}}),i}(e)).trim())?t:""}function iS(e){return e.replace(/"|\\"/g,'\\"')}var ix="[SessionRecording]",iE="redacted",iR={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"]},iP=["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"],iO=["password","secret","passwd","api_key","apikey","auth","credentials","mysql_pwd","privatekey","private_key","token"],iC=["/s/","/e/","/i/"];function iI(e,t,i,n){if(O(e))return e;var r=(null==t?void 0:t["content-length"])||new Blob([e]).size;return E(r)&&(r=parseInt(r)),r>i?ix+" ".concat(n," body too large to record (").concat(r," bytes)"):e}function iF(e,t){if(O(e))return e;var i=e;return ik(i,!1)||(i=ix+" "+t+" body "+iE),Q(iO,function(e){var n,r;null!==(n=i)&&void 0!==n&&n.length&&-1!==(null===(r=i)||void 0===r?void 0:r.indexOf(e))&&(i=ix+" "+t+" body "+iE+" as might contain: "+e)}),i}var iL,iT,i$,iA=function(e,t){var i,n,s={payloadSizeLimitBytes:iR.payloadSizeLimitBytes,performanceEntryTypeToObserve:d(iR.performanceEntryTypeToObserve),payloadHostDenyList:[].concat(d(t.payloadHostDenyList||[]),d(iR.payloadHostDenyList))},o=!1!==e.session_recording.recordHeaders&&t.recordHeaders,a=!1!==e.session_recording.recordBody&&t.recordBody,l=!1!==e.capture_performance&&t.recordPerformance,u=(n=Math.min(1e6,null!==(i=s.payloadSizeLimitBytes)&&void 0!==i?i:1e6),function(e){return null!=e&&e.requestBody&&(e.requestBody=iI(e.requestBody,e.requestHeaders,n,"Request")),null!=e&&e.responseBody&&(e.responseBody=iI(e.responseBody,e.responseHeaders,n,"Response")),e}),c=function(e){var t;return u(function(e){var t=tr(e.name);if(!(t&&t.pathname&&iC.some(function(e){return 0===t.pathname.indexOf(e)})))return e}((O(t=e.requestHeaders)||Q(Object.keys(null!=t?t:{}),function(e){iP.includes(e.toLowerCase())&&(t[e]=iE)}),e)))},h=k(e.session_recording.maskNetworkRequestFn);return h&&k(e.session_recording.maskCapturedNetworkRequestFn)&&z.warn("Both `maskNetworkRequestFn` and `maskCapturedNetworkRequestFn` are defined. `maskNetworkRequestFn` will be ignored."),h&&(e.session_recording.maskCapturedNetworkRequestFn=function(t){var i=e.session_recording.maskNetworkRequestFn({url:t.name});return r(r({},t),{},{name:null==i?void 0:i.url})}),s.maskRequestFn=k(e.session_recording.maskCapturedNetworkRequestFn)?function(t){var i,n,r,s=c(t);return s&&null!==(i=null===(n=(r=e.session_recording).maskCapturedNetworkRequestFn)||void 0===n?void 0:n.call(r,s))&&void 0!==i?i:void 0}:function(e){return function(e){if(!x(e))return e.requestBody=iF(e.requestBody,"Request"),e.responseBody=iF(e.responseBody,"Response"),e}(c(e))},r(r(r({},iR),s),{},{recordHeaders:o,recordBody:a,recordPerformance:l,recordInitialRequests:l})},iM=l(function e(t){var i,n,r=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};o(this,e),u(this,"bucketSize",100),u(this,"refillRate",10),u(this,"mutationBuckets",{}),u(this,"loggedTracker",{}),u(this,"refillBuckets",function(){Object.keys(r.mutationBuckets).forEach(function(e){r.mutationBuckets[e]=r.mutationBuckets[e]+r.refillRate,r.mutationBuckets[e]>=r.bucketSize&&delete r.mutationBuckets[e]})}),u(this,"getNodeOrRelevantParent",function(e){var t=r.rrweb.mirror.getNode(e);if("svg"!==(null==t?void 0:t.nodeName)&&t instanceof Element){var i=t.closest("svg");if(i)return[r.rrweb.mirror.getId(i),i]}return[e,t]}),u(this,"numberOfChanges",function(e){var t,i,n,r,s,o,a,l;return(null!==(t=null===(i=e.removes)||void 0===i?void 0:i.length)&&void 0!==t?t:0)+(null!==(n=null===(r=e.attributes)||void 0===r?void 0:r.length)&&void 0!==n?n:0)+(null!==(s=null===(o=e.texts)||void 0===o?void 0:o.length)&&void 0!==s?s: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,i=r.numberOfChanges(t);t.attributes&&(t.attributes=t.attributes.filter(function(e){var t,i,n,s=c(r.getNodeOrRelevantParent(e.id),2),o=s[0],a=s[1];return 0!==r.mutationBuckets[o]&&(r.mutationBuckets[o]=null!==(t=r.mutationBuckets[o])&&void 0!==t?t:r.bucketSize,r.mutationBuckets[o]=Math.max(r.mutationBuckets[o]-1,0),0===r.mutationBuckets[o]&&(r.loggedTracker[o]||(r.loggedTracker[o]=!0,null===(i=(n=r.options).onBlockedNode)||void 0===i||i.call(n,o,a))),e)}));var n=r.numberOfChanges(t);return 0!==n||i===n?e:void 0}),this.rrweb=t,this.options=s,this.refillRate=null!==(i=this.options.refillRate)&&void 0!==i?i:this.refillRate,this.bucketSize=null!==(n=this.options.bucketSize)&&void 0!==n?n:this.bucketSize,setInterval(function(){r.refillBuckets()},1e3)}),iN=[t9.MouseMove,t9.MouseInteraction,t9.Scroll,t9.ViewportResize,t9.Input,t9.TouchMove,t9.MediaInteraction,t9.Drag],iD=function(e){return{rrwebMethod:e,enqueuedAt:Date.now(),attempt:1}},iq="[SessionRecording]",ij=function(){function e(t){var i=this;if(o(this,e),u(this,"queuedRRWebEvents",[]),u(this,"isIdle",!1),u(this,"_linkedFlagSeen",!1),u(this,"_lastActivityTimestamp",Date.now()),u(this,"_linkedFlag",null),u(this,"_removePageViewCaptureHook",void 0),u(this,"_forceAllowLocalhostNetworkCapture",!1),u(this,"_onBeforeUnload",function(){i._flushBuffer()}),u(this,"_onOffline",function(){i._tryAddCustomEvent("browser offline",{})}),u(this,"_onOnline",function(){i._tryAddCustomEvent("browser online",{})}),u(this,"_onVisibilityChange",function(){if(null!=N&&N.visibilityState){var e="window "+N.visibilityState;i._tryAddCustomEvent(e,{})}}),u(this,"_samplingSessionListener",null),this.instance=t,this._captureStarted=!1,this._endpoint="/s/",this.stopRrweb=void 0,this.receivedDecide=!1,!this.instance.sessionManager)throw z.error(iq+" started without valid sessionManager"),Error(iq+" started without valid sessionManager. This is a bug.");var n=this.sessionManager.checkAndGetSessionAndWindowId(),r=n.sessionId,s=n.windowId;this.sessionId=r,this.windowId=s,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(iq+" 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(ex);return I(e)?e:null}},{key:"sessionDuration",get:function(){var e,t,i=null===(e=this.buffer)||void 0===e?void 0:e.data[(null===(t=this.buffer)||void 0===t?void 0:t.data.length)-1],n=this.sessionManager.checkAndGetSessionAndWindowId(!0).sessionStartTimestamp;return i?i.timestamp-n:null}},{key:"isRecordingEnabled",get:function(){var e=!!this.instance.get_property(e_),t=!this.instance.config.disable_session_recording;return F&&e&&t}},{key:"isConsoleLogCaptureEnabled",get:function(){var e=!!this.instance.get_property(em),t=this.instance.config.enable_recording_console_log;return null!=t?t:e}},{key:"canvasRecording",get:function(){var e=this.instance.get_property(eb);return e&&e.fps&&e.quality?{enabled:e.enabled,fps:e.fps,quality:e.quality}:void 0}},{key:"networkPayloadCapture",get:function(){var e,t,i=this.instance.get_property(ey),n={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},r=(null==n?void 0:n.recordHeaders)||(null==i?void 0:i.recordHeaders),s=(null==n?void 0:n.recordBody)||(null==i?void 0:i.recordBody),o=w(this.instance.config.capture_performance)?this.instance.config.capture_performance.network_timing:this.instance.config.capture_performance,a=!!(I(o)?o:null==i?void 0:i.capturePerformance);return r||s||a?{recordHeaders:r,recordBody:s,recordPerformance:a}:void 0}},{key:"sampleRate",get:function(){var e=this.instance.get_property(ek);return C(e)?e:null}},{key:"minimumDuration",get:function(){var e=this.instance.get_property(ew);return C(e)?e:null}},{key:"status",get:function(){return this.receivedDecide?this.isRecordingEnabled?O(this._linkedFlag)||this._linkedFlagSeen?I(this.isSampled)?this.isSampled?"sampled":"disabled":"active":"buffering":"disabled":"buffering"}},{key:"startIfEnabledOrStop",value:function(){var e=this;this.isRecordingEnabled?(this._startCapture(),null==F||F.addEventListener("beforeunload",this._onBeforeUnload),null==F||F.addEventListener("offline",this._onOffline),null==F||F.addEventListener("online",this._onOnline),null==F||F.addEventListener("visibilitychange",this._onVisibilityChange),O(this._removePageViewCaptureHook)&&(this._removePageViewCaptureHook=this.instance._addCaptureHook(function(t){try{if("$pageview"===t){var i=F?e._maskUrl(F.location.href):"";if(!i)return;e._tryAddCustomEvent("$pageview",{href:i})}}catch(e){z.error("Could not add $pageview to rrweb session",e)}})),z.info(iq+" started")):this.stopRecording()}},{key:"stopRecording",value:function(){var e;this._captureStarted&&this.stopRrweb&&(this.stopRrweb(),this.stopRrweb=void 0,this._captureStarted=!1,null==F||F.removeEventListener("beforeunload",this._onBeforeUnload),null==F||F.removeEventListener("offline",this._onOffline),null==F||F.removeEventListener("online",this._onOnline),null==F||F.removeEventListener("visibilitychange",this._onVisibilityChange),this.clearBuffer(),clearInterval(this._fullSnapshotTimer),null===(e=this._removePageViewCaptureHook)||void 0===e||e.call(this),this._removePageViewCaptureHook=void 0,z.info(iq+" stopped"))}},{key:"makeSamplingDecision",value:function(e){var t,i,n=this.sessionId!==e,r=this.sampleRate;if(C(r)){var s,o=this.isSampled,a=n||!I(o);(s=a?Math.random()<r:o)||!a||z.warn(iq+" Sample rate (".concat(r,") has determined that this sessionId (").concat(e,") will not be sent to the server.")),this._tryAddCustomEvent("samplingDecisionMade",{sampleRate:r}),null===(i=this.instance.persistence)||void 0===i||i.register(u({},ex,s))}else null===(t=this.instance.persistence)||void 0===t||t.register(u({},ex,null))}},{key:"afterDecideResponse",value:function(e){var t,i,n,r=this;if(this._persistDecideResponse(e),this._linkedFlag=(null===(t=e.sessionRecording)||void 0===t?void 0:t.linkedFlag)||null,null!==(i=e.sessionRecording)&&void 0!==i&&i.endpoint&&(this._endpoint=null===(n=e.sessionRecording)||void 0===n?void 0:n.endpoint),this._setupSampling(),!O(this._linkedFlag)&&!this._linkedFlagSeen){var s=E(this._linkedFlag)?this._linkedFlag:this._linkedFlag.flag,o=E(this._linkedFlag)?null:this._linkedFlag.variant;this.instance.onFeatureFlags(function(e,t){var i=w(t)&&s in t,n=o?t[s]===o:i;if(n){var a={linkedFlag:s,linkedVariant:o},l="linked flag matched";z.info(iq+" "+l,a),r._tryAddCustomEvent(l,a)}r._linkedFlagSeen=n})}this.receivedDecide=!0,this.startIfEnabledOrStop()}},{key:"_setupSampling",value:function(){var e=this;C(this.sampleRate)&&P(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,i=function(){var i,n,s,o,a,l,c,d,h=null===(i=e.sessionRecording)||void 0===i?void 0:i.sampleRate,f=O(h)?null:parseFloat(h),p=null===(n=e.sessionRecording)||void 0===n?void 0:n.minimumDurationMilliseconds;t.register((u(d={},e_,!!e.sessionRecording),u(d,em,null===(s=e.sessionRecording)||void 0===s?void 0:s.consoleLogRecordingEnabled),u(d,ey,r({capturePerformance:e.capturePerformance},null===(o=e.sessionRecording)||void 0===o?void 0:o.networkPayloadCapture)),u(d,eb,{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,ek,f),u(d,ew,x(p)?null:p),d))};i(),this.sessionManager.onSessionId(i)}}},{key:"log",value:function(e){var t,i=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:i,trace:[],payload:[JSON.stringify(e)]}},timestamp:ee()})}},{key:"_startCapture",value:function(){var e=this;x(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(g.LIB_VERSION),function(t){if(t)return z.error(iq+" could not load recorder.js",t);e._onScriptLoaded()}))}},{key:"isInteractiveEvent",value:function(e){var t;return 3===e.type&&-1!==iN.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,clearInterval(this._fullSnapshotTimer),this._flushBuffer());var i=!1;if(t&&(this._lastActivityTimestamp=e.timestamp,this.isIdle&&(this.isIdle=!1,this._tryAddCustomEvent("sessionNoLongerIdle",{reason:"user activity",type:e.type}),i=!0)),!this.isIdle){var n=this.sessionManager.checkAndGetSessionAndWindowId(!t,e.timestamp),r=n.windowId,s=n.sessionId,o=this.sessionId!==s,a=this.windowId!==r;this.windowId=r,this.sessionId=s,(i||-1===[2,4].indexOf(e.type)&&(a||o||x(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(iq+" could not emit queued rrweb event.",t,e),!1}}},{key:"_tryAddCustomEvent",value:function(e,t){var i=this;return this._tryRRWebMethod(iD(function(){return i.rrwebRecord.addCustomEvent(e,t)}))}},{key:"_tryTakeFullSnapshot",value:function(){var e=this;return this._tryRRWebMethod(iD(function(){return e.rrwebRecord.takeFullSnapshot()}))}},{key:"_onScriptLoaded",value:function(){for(var e,t=this,i={blockClass:"ph-no-capture",blockSelector:void 0,ignoreClass:"ph-ignore-input",maskTextClass:"ph-mask",maskTextSelector:void 0,maskTextFn:void 0,maskAllInputs:!0,maskInputOptions:{password:!0},maskInputFn:void 0,slimDOMOptions:{},collectFonts:!1,inlineStylesheet:!0,recordCrossOriginIframes:!1},n=this.instance.config.session_recording,s=0,o=Object.entries(n||{});s<o.length;s++){var a=c(o[s],2),l=a[0],u=a[1];l in i&&("maskInputOptions"===l?i.maskInputOptions=r({password:!0},u):i[l]=u)}if(this.canvasRecording&&this.canvasRecording.enabled&&(i.recordCanvas=!0,i.sampling={canvas:this.canvasRecording.fps},i.dataURLOptions={type:"image/webp",quality:this.canvasRecording.quality}),this.rrwebRecord){this.mutationRateLimiter=null!==(e=this.mutationRateLimiter)&&void 0!==e?e:new iM(this.rrwebRecord,{onBlockedNode:function(e,i){var n="Too many mutations on node '".concat(e,"'. Rate limiting. This could be due to SVG animations or something similar");z.info(n,{node:i}),t.log(iq+" "+n,"warn")}});var d=this._gatherRRWebPlugins();this.stopRrweb=this.rrwebRecord(r({emit:function(e){t.onRRwebEmit(e)},plugins:d},i)),this._lastActivityTimestamp=Date.now(),this.isIdle=!1,this._tryAddCustomEvent("$session_options",{sessionRecordingOptions:i,activePlugins:d.map(function(e){return null==e?void 0:e.name})}),this._tryAddCustomEvent("$posthog_config",{config:this.instance.config})}else z.error(iq+"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)&&(!tn.includes(location.hostname)||this._forceAllowLocalhostNetworkCapture?e.push(U.getRecordNetworkPlugin(iA(this.instance.config,this.networkPayloadCapture))):z.info(iq+" NetworkCapture not started because we are on localhost.")),e}},{key:"onRRwebEmit",value:function(e){if(this._processQueuedEvents(),e&&w(e)){if(e.type===t7.Meta){var t=this._maskUrl(e.data.href);if(this._lastHref=t,!t)return;e.data.href=t}else this._pageViewFallBack();e.type===t7.FullSnapshot&&this._scheduleFullSnapshot();var i=this.mutationRateLimiter?this.mutationRateLimiter.throttleMutations(e):e;if(i){var n=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=[],i=0;i<e.data.payload.payload.length;i++)e.data.payload.payload[i]&&e.data.payload.payload[i].length>2e3?t.push(e.data.payload.payload[i].slice(0,2e3)+"...[truncated]"):t.push(e.data.payload.payload[i]);return e.data.payload.payload=t,e}return e}(i),r=t6(n);if(this._updateWindowAndSessionIds(n),!this.isIdle||n.type===t7.Custom){var s={$snapshot_bytes:r,$snapshot_data:n,$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&&F){var e=this._maskUrl(F.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 i,n={url:e};return null===(i=n=t.maskNetworkRequestFn(n))||void 0===i?void 0:i.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,i=this.sessionDuration,n=C(i)&&i>=0,r=C(t)&&n&&i<t;return"buffering"===this.status||r?(this.flushBufferTimer=setTimeout(function(){e._flushBuffer()},2e3),this.buffer):(this.buffer.data.length>0&&(function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6606028.8;if(t.size>=i&&t.data.length>1){var n=Math.floor(t.data.length/2),r=t.data.slice(0,n),s=t.data.slice(n);return[e({size:t6(r),data:r,sessionId:t.sessionId,windowId:t.windowId}),e({size:t6(s),data:s,sessionId:t.sessionId,windowId:t.windowId})].flatMap(function(e){return e})}return[t]})(this.buffer).forEach(function(t){e._captureSnapshot({$snapshot_bytes:t.size,$snapshot_data:t.data,$session_id:t.sessionId,$window_id:t.windowId})}),this.clearBuffer())}},{key:"_captureSnapshotBuffered",value:function(e){var t,i=this,n=2+((null===(t=this.buffer)||void 0===t?void 0:t.data.length)||0);!this.isIdle&&(this.buffer.size+e.$snapshot_bytes+n>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.isIdle||(this.flushBufferTimer=setTimeout(function(){i._flushBuffer()},2e3))}},{key:"_captureSnapshot",value:function(e){this.instance.capture("$snapshot",e,{_url:this.instance.requestRouter.endpointFor("api",this._endpoint),_noTruncate:!0,_batchKey:"recordings",skip_client_rate_limiting:!0})}},{key:"overrideLinkedFlag",value:function(){this._linkedFlagSeen=!0}}]),e}(),iH=function(){function e(t){o(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(eP),group_properties:this.instance.get_property(eO),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:Z.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 i=!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:{},i),i)z.error("Failed to fetch feature flags from PostHog.");else{if(!N||!N.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 n,r=p(e.siteApps);try{for(r.s();!(n=r.n()).done;)(function(){var e=n.value,i=e.id,r=e.url,s=t.instance.requestRouter.endpointFor("api",r);U["__$$ph_site_app_".concat(i)]=t.instance,t.instance.requestRouter.loadScript(s,function(e){if(e)return z.error("Error while initializing PostHog app with config id ".concat(i),e)})})()}catch(e){r.e(e)}finally{r.f()}}else e.siteApps.length>0&&z.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}}}]),e}(),iB=null!=F&&F.location?tl(F.location.hash,"__posthog")||tl(location.hash,"state"):null,iU="_postHogToolbarParams";(nb=i$||(i$={}))[nb.UNINITIALIZED=0]="UNINITIALIZED",nb[nb.LOADING=1]="LOADING",nb[nb.LOADED=2]="LOADED";var iV=function(){function e(t){o(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:i$.UNINITIALIZED}},{key:"maybeLoadToolbar",value:function(){var e,t,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(!F||!N)return!1;i=null!==(e=i)&&void 0!==e?e:F.location,r=null!==(t=r)&&void 0!==t?t:F.history;try{if(!n){try{F.localStorage.setItem("test","test"),F.localStorage.removeItem("test")}catch(e){return!1}n=null==F?void 0:F.localStorage}var s,o=iB||tl(i.hash,"__posthog")||tl(i.hash,"state"),a=o?et(function(){return JSON.parse(atob(decodeURIComponent(o)))})||et(function(){return JSON.parse(decodeURIComponent(o))}):null;return a&&"ph_authorize"===a.action?((s=a).source="url",s&&Object.keys(s).length>0&&(a.desiredHash?i.hash=a.desiredHash:r?r.replaceState(r.state,"",i.pathname+i.search):i.hash="")):((s=JSON.parse(n.getItem(iU)||"{}")).source="localstorage",delete s.userIntent),!(!s.token||this.instance.config.token!==s.token)&&(this.loadToolbar(s),!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,i=!(null==N||!N.getElementById(eq));if(!F||i)return!1;var n="custom"===this.instance.requestRouter.region&&this.instance.config.advanced_disable_toolbar_metrics,s=r(r({token:this.instance.config.token},e),{},{apiURL:this.instance.requestRouter.endpointFor("ui")},n?{instrument:!1}:{});if(F.localStorage.setItem(iU,JSON.stringify(r(r({},s),{},{source:void 0}))),this.getToolbarState()===i$.LOADED)this._callLoadToolbar(s);else if(this.getToolbarState()===i$.UNINITIALIZED){this.setToolbarState(i$.LOADING);var o=3e5*Math.floor(Date.now()/3e5);this.instance.requestRouter.loadScript("/static/toolbar.js?t=".concat(o),function(e){if(e)return z.error("Failed to load toolbar",e),void t.setToolbarState(i$.UNINITIALIZED);t.setToolbarState(i$.LOADED),t._callLoadToolbar(s)}),eo(F,"turbolinks:load",function(){t.setToolbarState(i$.UNINITIALIZED),t.loadToolbar(s)})}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,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return this.maybeLoadToolbar(e,t,i)}}]),e}(),iz=function(){function e(t){o(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(r(r({},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 i in t)(function(i){var n=t[i],r=(new Date).getTime();n.data&&b(n.data)&&Q(n.data,function(e){e.offset=Math.abs(e.timestamp-r),delete e.timestamp}),e.sendRequest(n)})(i)}},this.flushTimeoutMs))}},{key:"clearFlushTimeout",value:function(){clearTimeout(this.flushTimeout),this.flushTimeout=void 0}},{key:"formatQueue",value:function(){var e={};return Q(this.queue,function(t){var i,n=(t?t.batchKey:null)||t.url;x(e[n])&&(e[n]=r(r({},t),{},{data:[]})),null===(i=e[n].data)||void 0===i||i.push(t.data)}),this.queue=[],e}}]),e}(),iW=Uint8Array,iG=Uint16Array,iK=Uint32Array,iQ=new iW([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]),iJ=new iW([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]),iY=new iW([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),iX=function(e,t){for(var i=new iG(31),n=0;n<31;++n)i[n]=t+=1<<e[n-1];var r=new iK(i[30]);for(n=1;n<30;++n)for(var s=i[n];s<i[n+1];++s)r[s]=s-i[n]<<5|n;return[i,r]},iZ=iX(iQ,2),i0=iZ[0],i1=iZ[1];i0[28]=258,i1[258]=28;for(var i2=iX(iJ,0)[1],i3=new iG(32768),i5=0;i5<32768;++i5){var i8=(43690&i5)>>>1|(21845&i5)<<1;i8=(61680&(i8=(52428&i8)>>>2|(13107&i8)<<2))>>>4|(3855&i8)<<4,i3[i5]=((65280&i8)>>>8|(255&i8)<<8)>>>1}var i4=function(e,t,i){for(var n=e.length,r=0,s=new iG(t);r<n;++r)++s[e[r]-1];var o,a=new iG(t);for(r=0;r<t;++r)a[r]=a[r-1]+s[r-1]<<1;if(i){o=new iG(1<<t);var l=15-t;for(r=0;r<n;++r)if(e[r])for(var u=r<<4|e[r],c=t-e[r],d=a[e[r]-1]++<<c,h=d|(1<<c)-1;d<=h;++d)o[i3[d]>>>l]=u}else for(o=new iG(n),r=0;r<n;++r)o[r]=i3[a[e[r]-1]++]>>>15-e[r];return o},i6=new iW(288);for(i5=0;i5<144;++i5)i6[i5]=8;for(i5=144;i5<256;++i5)i6[i5]=9;for(i5=256;i5<280;++i5)i6[i5]=7;for(i5=280;i5<288;++i5)i6[i5]=8;var i7=new iW(32);for(i5=0;i5<32;++i5)i7[i5]=5;var i9=i4(i6,9,0),ne=i4(i7,5,0),nt=function(e){return(e/8>>0)+(7&e&&1)},ni=function(e,t,i){(null==t||t<0)&&(t=0),(null==i||i>e.length)&&(i=e.length);var n=new(e instanceof iG?iG:e instanceof iK?iK:iW)(i-t);return n.set(e.subarray(t,i)),n},nn=function(e,t,i){i<<=7&t;var n=t/8>>0;e[n]|=i,e[n+1]|=i>>>8},nr=function(e,t,i){i<<=7&t;var n=t/8>>0;e[n]|=i,e[n+1]|=i>>>8,e[n+2]|=i>>>16},ns=function(e,t){for(var i=[],n=0;n<e.length;++n)e[n]&&i.push({s:n,f:e[n]});var r=i.length,s=i.slice();if(!r)return[new iW(0),0];if(1==r){var o=new iW(i[0].s+1);return o[i[0].s]=1,[o,1]}i.sort(function(e,t){return e.f-t.f}),i.push({s:-1,f:25001});var a=i[0],l=i[1],u=0,c=1,d=2;for(i[0]={s:-1,f:a.f+l.f,l:a,r:l};c!=r-1;)a=i[i[u].f<i[d].f?u++:d++],l=i[u!=c&&i[u].f<i[d].f?u++:d++],i[c++]={s:-1,f:a.f+l.f,l:a,r:l};var h=s[0].s;for(n=1;n<r;++n)s[n].s>h&&(h=s[n].s);var f=new iG(h+1),p=no(i[c-1],f,0);if(p>t){n=0;var g=0,v=p-t,_=1<<v;for(s.sort(function(e,t){return f[t.s]-f[e.s]||e.f-t.f});n<r;++n){var m=s[n].s;if(!(f[m]>t))break;g+=_-(1<<p-f[m]),f[m]=t}for(g>>>=v;g>0;){var y=s[n].s;f[y]<t?g-=1<<t-f[y]++-1:++n}for(;n>=0&&g;--n){var b=s[n].s;f[b]==t&&(--f[b],++g)}p=t}return[new iW(f),p]},no=function e(t,i,n){return -1==t.s?Math.max(e(t.l,i,n+1),e(t.r,i,n+1)):i[t.s]=n},na=function(e){for(var t=e.length;t&&!e[--t];);for(var i=new iG(++t),n=0,r=e[0],s=1,o=function(e){i[n++]=e},a=1;a<=t;++a)if(e[a]==r&&a!=t)++s;else{if(!r&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(r),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(r);s=1,r=e[a]}return[i.subarray(0,n),t]},nl=function(e,t){for(var i=0,n=0;n<t.length;++n)i+=e[n]*t[n];return i},nu=function(e,t,i){var n=i.length,r=nt(t+2);e[r]=255&n,e[r+1]=n>>>8,e[r+2]=255^e[r],e[r+3]=255^e[r+1];for(var s=0;s<n;++s)e[r+s+4]=i[s];return 8*(r+4+n)},nc=function(e,t,i,n,r,s,o,a,l,u,c){nn(t,c++,i),++r[256];for(var d=ns(r,15),h=d[0],f=d[1],p=ns(s,15),g=p[0],v=p[1],_=na(h),m=_[0],y=_[1],b=na(g),k=b[0],w=b[1],S=new iG(19),x=0;x<m.length;++x)S[31&m[x]]++;for(x=0;x<k.length;++x)S[31&k[x]]++;for(var E=ns(S,7),R=E[0],P=E[1],O=19;O>4&&!R[iY[O-1]];--O);var C,I,F,L,T=u+5<<3,$=nl(r,i6)+nl(s,i7)+o,A=nl(r,h)+nl(s,g)+o+14+3*O+nl(S,R)+(2*S[16]+3*S[17]+7*S[18]);if(T<=$&&T<=A)return nu(t,c,e.subarray(l,l+u));if(nn(t,c,1+(A<$)),c+=2,A<$){C=i4(h,f,0),I=h,F=i4(g,v,0),L=g;var M=i4(R,P,0);for(nn(t,c,y-257),nn(t,c+5,w-1),nn(t,c+10,O-4),c+=14,x=0;x<O;++x)nn(t,c+3*x,R[iY[x]]);c+=3*O;for(var N=[m,k],D=0;D<2;++D){var q=N[D];for(x=0;x<q.length;++x){var j=31&q[x];nn(t,c,M[j]),c+=R[j],j>15&&(nn(t,c,q[x]>>>5&127),c+=q[x]>>>12)}}}else C=i9,I=i6,F=ne,L=i7;for(x=0;x<a;++x)if(n[x]>255){nr(t,c,C[(j=n[x]>>>18&31)+257]),c+=I[j+257],j>7&&(nn(t,c,n[x]>>>23&31),c+=iQ[j]);var H=31&n[x];nr(t,c,F[H]),c+=L[H],H>3&&(nr(t,c,n[x]>>>5&8191),c+=iJ[H])}else nr(t,c,C[n[x]]),c+=I[n[x]];return nr(t,c,C[256]),c+I[256]},nd=new iK([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),nh=new iW(0),nf=function(){for(var e=new iK(256),t=0;t<256;++t){for(var i=t,n=9;--n;)i=(1&i&&3988292384)^i>>>1;e[t]=i}return e}(),np=function(e,t,i){for(;i;++t)e[t]=i,i>>>=8},ng=!!j||!!q,nv="text/plain",n_=function(e,t){var i=c(e.split("?"),2),n=i[0],s=i[1],o=r({},t);null==s||s.split("&").forEach(function(e){var t=c(e.split("="),1)[0];delete o[t]});var a=to(o);return a=a?(s?s+"&":"")+a:s,"".concat(n,"?").concat(a)},nm=function(e){var t,i,n,r,s,o,a,l,u,c=e.data,d=e.compression;if(c)return d===Z.GZipJS?{contentType:nv,body:new Blob([(t=function(e,t){var i=e.length;if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var n=new iW(e.length+(e.length>>>1)),r=0,s=function(e){n[r++]=e},o=0;o<i;++o){if(r+5>n.length){var a=new iW(r+8+(i-o<<1));a.set(n),n=a}var l=e.charCodeAt(o);l<128?s(l):(l<2048?s(192|l>>>6):(l>55295&&l<57344?(s(240|(l=65536+(1047552&l)|1023&e.charCodeAt(++o))>>>18),s(128|l>>>12&63)):s(224|l>>>12),s(128|l>>>6&63)),s(128|63&l))}return ni(n,0,r)}(JSON.stringify(c)),i={mtime:0},n=4294967295,r={p:function(e){for(var t=n,i=0;i<e.length;++i)t=nf[255&t^e[i]]^t>>>8;n=t},d:function(){return 4294967295^n}},s=t.length,r.p(t),l=(o=10+(i.filename&&i.filename.length+1||0),a=function(e,t,i,n,r,s){var o=e.length,a=new iW(n+o+5*(1+Math.floor(o/7e3))+8),l=a.subarray(n,a.length-8),u=0;if(!t||o<8)for(var c=0;c<=o;c+=65535){var d=c+65535;d<o?u=nu(l,u,e.subarray(c,d)):(l[c]=s,u=nu(l,u,e.subarray(c,o)))}else{for(var h=nd[t-1],f=h>>>13,p=8191&h,g=(1<<i)-1,v=new iG(32768),_=new iG(g+1),m=Math.ceil(i/3),y=2*m,b=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&g},k=new iK(25e3),w=new iG(288),S=new iG(32),x=0,E=0,R=(c=0,0),P=0,O=0;c<o;++c){var C=b(c),I=32767&c,F=_[C];if(v[I]=F,_[C]=I,P<=c){var L=o-c;if((x>7e3||R>24576)&&L>423){u=nc(e,l,0,k,w,S,E,R,O,c-O,u),R=x=E=0,O=c;for(var T=0;T<286;++T)w[T]=0;for(T=0;T<30;++T)S[T]=0}var $=2,A=0,M=p,N=I-F&32767;if(L>2&&C==b(c-N))for(var D=Math.min(f,L)-1,q=Math.min(32767,c),j=Math.min(258,L);N<=q&&--M&&I!=F;){if(e[c+$]==e[c+$-N]){for(var H=0;H<j&&e[c+H]==e[c+H-N];++H);if(H>$){if($=H,A=N,H>D)break;var B=Math.min(N,H-2),U=0;for(T=0;T<B;++T){var V=c-N+T+32768&32767,z=V-v[V]+32768&32767;z>U&&(U=z,F=V)}}}N+=(I=F)-(F=v[I])+32768&32767}if(A){k[R++]=268435456|i1[$]<<18|i2[A];var W=31&i1[$],G=31&i2[A];E+=iQ[W]+iJ[G],++w[257+W],++S[G],P=c+$,++x}else k[R++]=e[c],++w[e[c]]}}u=nc(e,l,s,k,w,S,E,R,O,c-O,u),s||(u=nu(l,u,nh))}return ni(a,0,n+nt(u)+r)}(t,null==i.level?6:i.level,null==i.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+i.mem,o,8,!0)).length,function(e,t){var i=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&&np(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),i){e[3]=8;for(var n=0;n<=i.length;++n)e[n+10]=i.charCodeAt(n)}}(a,i),np(a,l-8,r.d()),np(a,l-4,s),a)],{type:nv})}:d===Z.Base64?{contentType:"application/x-www-form-urlencoded",body:"data="+encodeURIComponent("string"==typeof(u=function(e){var t,i,n,r,s,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=0,l=0,u="",c=[];if(!e)return e;e=es(e);do t=(s=e.charCodeAt(a++)<<16|e.charCodeAt(a++)<<8|e.charCodeAt(a++))>>18&63,i=s>>12&63,n=s>>6&63,r=63&s,c[l++]=o.charAt(t)+o.charAt(i)+o.charAt(n)+o.charAt(r);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)}},ny=[];j&&ny.push({transport:"XHR",method:function(e){var t,i=new j;i.open(e.method||"GET",e.url,!0);var n=null!==(t=nm(e))&&void 0!==t?t:{},r=n.contentType,s=n.body;Q(e.headers,function(e,t){i.setRequestHeader(t,e)}),r&&i.setRequestHeader("Content-Type",r),e.timeout&&(i.timeout=e.timeout),i.withCredentials=!0,i.onreadystatechange=function(){if(4===i.readyState){var t,n={statusCode:i.status,text:i.responseText};if(200===i.status)try{n.json=JSON.parse(i.responseText)}catch(e){}null===(t=e.callback)||void 0===t||t.call(e,n)}},i.send(s)}}),q&&ny.push({transport:"fetch",method:function(e){var t,i,n=null!==(t=nm(e))&&void 0!==t?t:{},r=n.contentType,s=n.body,o=new Headers;Q(e.headers,function(e,t){o.append(t,e)}),r&&o.append("Content-Type",r);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:o,keepalive:"POST"===e.method,body:s,signal:null===(i=l)||void 0===i?void 0:i.signal}).then(function(t){return t.text().then(function(i){var n,r={statusCode:t.status,text:i};if(200===t.status)try{r.json=JSON.parse(i)}catch(e){z.error(e)}null===(n=e.callback)||void 0===n||n.call(e,r)})}).catch(function(t){var i;z.error(t),null===(i=e.callback)||void 0===i||i.call(e,{statusCode:0,text:t})}).finally(function(){return l?clearTimeout(l.timeout):null})}}),null!=M&&M.sendBeacon&&ny.push({transport:"sendBeacon",method:function(e){var t=n_(e.url,{beacon:"1"});try{var i,n=null!==(i=nm(e))&&void 0!==i?i:{},r=n.contentType,s=n.body,o="string"==typeof s?new Blob([s],{type:r}):s;M.sendBeacon(t,o)}catch(e){}}});var nb,nk,nw=["retriesPerformedSoFar"],nS=function(){function e(t){var i=this;o(this,e),u(this,"isPolling",!1),u(this,"pollIntervalMs",3e3),u(this,"queue",[]),this.instance=t,this.queue=[],this.areWeOnline=!0,!x(F)&&"onLine"in F.navigator&&(this.areWeOnline=F.navigator.onLine,F.addEventListener("online",function(){i.areWeOnline=!0,i.flush()}),F.addEventListener("offline",function(){i.areWeOnline=!1}))}return l(e,[{key:"retriableRequest",value:function(e){var t=this,i=e.retriesPerformedSoFar,n=function(e,t){if(null==e)return{};var i,n,r=function(e,t){if(null==e)return{};var i,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||(r[i]=e[i]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)i=s[n],t.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}(e,nw);C(i)&&i>0&&(n.url=n_(n.url,{retry_count:i})),this.instance._send_request(r(r({},n),{},{callback:function(e){var s;200!==e.statusCode&&(e.statusCode<400||e.statusCode>=500)&&(null!=i?i:0)<10?t.enqueue(r({retriesPerformedSoFar:i},n)):null===(s=n.callback)||void 0===s||s.call(n,e)}}))}},{key:"enqueue",value:function(e){var t,i,n,r=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=r+1;var s=(n=(Math.random()-.5)*((i=Math.min(18e5,t=3e3*Math.pow(2,r)))-t/2),Math.ceil(i+n)),o=Date.now()+s;this.queue.push({retryAt:o,requestOptions:e});var a="Enqueued failed request for retry in ".concat(s);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=[],i=this.queue.filter(function(i){return i.retryAt<e||(t.push(i),!1)});if(this.queue=t,i.length>0){var n,r=p(i);try{for(r.s();!(n=r.n()).done;){var s=n.value.requestOptions;this.retriableRequest(s)}}catch(e){r.e(e)}finally{r.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 i=e.value.requestOptions;try{this.instance._send_request(r(r({},i),{},{transport:"sendBeacon"}))}catch(e){z.error(e)}}}catch(e){t.e(e)}finally{t.f()}this.queue=[]}}]),e}(),nx=function(){function e(t,i,n,r){o(this,e),u(this,"_sessionIdChangedHandlers",[]),this.config=t,this.persistence=i,this._windowId=void 0,this._sessionId=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this._sessionIdGenerator=n||e0,this._windowIdGenerator=r||e0;var s,a=t.persistence_name||t.token,l=t.session_idle_timeout_seconds||1800;if(C(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=ti.parse(this._window_id_storage_key),d=ti.parse(this._primary_window_exists_storage_key);c&&!d?this._windowId=c:ti.remove(this._window_id_storage_key),ti.set(this._primary_window_exists_storage_key,!0)}if(null!==(s=this.config.bootstrap)&&void 0!==s&&s.sessionID)try{var h=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(),h)}catch(e){z.error("Invalid sessionID in bootstrap",e)}this._listenToReloadWindow()}return l(e,[{key:"onSessionId",value:function(e){var t=this;return x(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&&ti.is_supported()}},{key:"_setWindowId",value:function(e){e!==this._windowId&&(this._windowId=e,this._canUseSessionStorage()&&ti.set(this._window_id_storage_key,e))}},{key:"_getWindowId",value:function(){return this._windowId?this._windowId:this._canUseSessionStorage()?ti.parse(this._window_id_storage_key):null}},{key:"_setSessionId",value:function(e,t,i){e===this._sessionId&&t===this._sessionActivityTimestamp&&i===this._sessionStartTimestamp||(this._sessionStartTimestamp=i,this._sessionActivityTimestamp=t,this._sessionId=e,this.persistence.register(u({},eS,[t,e,i])))}},{key:"_getSessionId",value:function(){if(this._sessionId&&this._sessionActivityTimestamp&&this._sessionStartTimestamp)return[this._sessionActivityTimestamp,this._sessionId,this._sessionStartTimestamp];var e=this.persistence.props[eS];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==F||F.addEventListener("beforeunload",function(){e._canUseSessionStorage()&&ti.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(),i=c(this._getSessionId(),3),n=i[0],r=i[1],s=i[2],o=this._getWindowId(),a=s&&s>0&&Math.abs(t-s)>864e5,l=!1,u=!r,d=!e&&Math.abs(t-n)>this._sessionTimeoutMs;u||d||a?(r=this._sessionIdGenerator(),o=this._windowIdGenerator(),z.info("[SessionId] new session ID generated",{sessionId:r,windowId:o,changeReason:{noSessionId:u,activityTimeout:d,sessionPastMaximumLength:a}}),s=t,l=!0):o||(o=this._windowIdGenerator(),l=!0);var h=0===n||!e||a?t:n,f=0===s?(new Date).getTime():s;return this._setWindowId(o),this._setSessionId(r,h,f),l&&this._sessionIdChangedHandlers.forEach(function(e){return e(r,o)}),{sessionId:r,windowId:o,sessionStartTimestamp:f}}}]),e}();(nC=nk||(nk={})).US="us",nC.EU="eu",nC.CUSTOM="custom";var nE="i.posthog.com",nR=function(){function e(t){o(this,e),u(this,"_regionCache",{}),this.instance=t}return l(e,[{key:"apiHost",get:function(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return"https://app.posthog.com"===e?"https://us.i.posthog.com":e}},{key:"uiHost",get:function(){var e,t=null===(e=this.instance.config.ui_host)||void 0===e?void 0:e.replace(/\/$/,"");return t||(t=this.apiHost.replace(".".concat(nE),".posthog.com")),"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]=nk.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this._regionCache[this.apiHost]=nk.EU:this._regionCache[this.apiHost]=nk.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+t;if(this.region===nk.CUSTOM)return this.apiHost+t;var i=nE+t;switch(e){case"assets":return"https://".concat(this.region,"-assets.").concat(i);case"api":return"https://".concat(this.region,".").concat(i)}}},{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 i="/"===e[0]?this.endpointFor("assets",e):e,n=function(){if(!N)return t("document not found");var e=N.createElement("script");e.type="text/javascript",e.src=i,e.onload=function(e){return t(void 0,e)},e.onerror=function(e){return t(e)};var n,r=N.querySelectorAll("body > script");r.length>0?null===(n=r[0].parentNode)||void 0===n||n.insertBefore(e,r[0]):N.body.appendChild(e)};null!=N&&N.body?n():null==N||N.addEventListener("DOMContentLoaded",n)}}]),e}(),nP="posthog-js";function nO(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.organization,n=t.projectId,r=t.prefix,s=t.severityAllowList,o=void 0===s?["error"]:s;return function(t){if(!("*"===o||o.includes(t.level))||!e.__loaded)return t;t.tags||(t.tags={});var s,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 h=(null===(s=t.exception)||void 0===s?void 0:s.values)||[],f={$exception_message:(null===(a=h[0])||void 0===a?void 0:a.value)||t.message,$exception_type:null===(l=h[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=h[0])||void 0===u?void 0:u.value)||t.message,$sentry_exception_type:null===(c=h[0])||void 0===c?void 0:c.type,$sentry_tags:t.tags,$level:t.level};return i&&n&&(f.$sentry_url=(r||"https://sentry.io/organizations/")+i+"/issues/?project="+n+"&query="+t.event_id),e.exceptions.sendExceptionEvent(f),t}}var nC,nI,nF,nL,nT=l(function e(t,i,n,r,s){o(this,e),this.name=nP,this.setupOnce=function(e){e(nO(t,{organization:i,projectId:n,prefix:r,severityAllowList:s}))}}),n$=function(){function e(t){o(this,e),this._instance=t}return l(e,[{key:"doPageView",value:function(e){var t,i=this._previousPageViewProperties(e);return this._currentPath=null!==(t=null==F?void 0:F.location.pathname)&&void 0!==t?t:"",this._instance.scrollManager.resetContext(),this._prevPageviewTimestamp=e,i}},{key:"doPageLeave",value:function(e){return this._previousPageViewProperties(e)}},{key:"_previousPageViewProperties",value:function(e){var t=this._currentPath,i=this._prevPageviewTimestamp,n=this._instance.scrollManager.getContext();if(!i)return{};var r={};if(n){var s=n.maxScrollHeight,o=n.lastScrollY,a=n.maxScrollY,l=n.maxContentHeight,u=n.lastContentY,c=n.maxContentY;x(s)||x(o)||x(a)||x(l)||x(u)||x(c)||(s=Math.ceil(s),o=Math.ceil(o),a=Math.ceil(a),l=Math.ceil(l),u=Math.ceil(u),c=Math.ceil(c),r={$prev_pageview_last_scroll:o,$prev_pageview_last_scroll_percentage:s<=1?1:nA(o/s,0,1),$prev_pageview_max_scroll:a,$prev_pageview_max_scroll_percentage:s<=1?1:nA(a/s,0,1),$prev_pageview_last_content:u,$prev_pageview_last_content_percentage:l<=1?1:nA(u/l,0,1),$prev_pageview_max_content:c,$prev_pageview_max_content_percentage:l<=1?1:nA(c/l,0,1)})}return t&&(r.$prev_pageview_pathname=t),i&&(r.$prev_pageview_duration=(e.getTime()-i.getTime())/1e3),r}}]),e}();function nA(e,t,i){return Math.max(t,Math.min(e,i))}(nZ=nI||(nI={})).Popover="popover",nZ.API="api",nZ.Widget="widget",(n0=nF||(nF={})).Open="open",n0.MultipleChoice="multiple_choice",n0.SingleChoice="single_choice",n0.Rating="rating",n0.Link="link",(n1=nL||(nL={})).NextQuestion="next_question",n1.End="end",n1.ResponseBased="response_based",n1.SpecificQuestion="specific_question";var nM=function(){function e(){o(this,e),u(this,"events",{}),this.events={}}return l(e,[{key:"on",value:function(e,t){var i=this;return this.events[e]||(this.events[e]=[]),this.events[e].push(t),function(){i.events[e]=i.events[e].filter(function(e){return e!==t})}}},{key:"emit",value:function(e,t){var i,n=p(this.events[e]||[]);try{for(n.s();!(i=n.n()).done;)(0,i.value)(t)}catch(e){n.e(e)}finally{n.f()}var r,s=p(this.events["*"]||[]);try{for(s.s();!(r=s.n()).done;)(0,r.value)(e,t)}catch(e){s.e(e)}finally{s.f()}}}]),e}(),nN=function(){function e(t){var i=this;o(this,e),u(this,"_debugEventEmitter",new nM),u(this,"checkStep",function(e,t){return i.checkStepEvent(e,t)&&i.checkStepUrl(e,t)&&i.checkStepElement(e,t)}),u(this,"checkStepEvent",function(e,t){return null==t||!t.event||(null==e?void 0:e.event)===(null==t?void 0:t.event)}),this.instance=t,this.actionEvents=new Set,this.actionRegistry=new Set}return l(e,[{key:"init",value:function(){var e,t,i=this;x(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)||null===(e=this.instance)||void 0===e||e._addCaptureHook(function(e,t){i.on(e,t)})}},{key:"register",value:function(e){var t,i,n=this;if(!x(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)&&(e.forEach(function(e){var t,i;null===(t=n.actionRegistry)||void 0===t||t.add(e),null===(i=e.steps)||void 0===i||i.forEach(function(e){var t;null===(t=n.actionEvents)||void 0===t||t.add((null==e?void 0:e.event)||"")})}),null!==(i=this.instance)&&void 0!==i&&i.autocapture)){var r,s=new Set;e.forEach(function(e){var t;null===(t=e.steps)||void 0===t||t.forEach(function(e){null!=e&&e.selector&&s.add(null==e?void 0:e.selector)})}),null===(r=this.instance)||void 0===r||r.autocapture.setElementSelectors(s)}}},{key:"on",value:function(e,t){var i,n=this;null!=t&&0!=e.length&&(this.actionEvents.has(e)||this.actionEvents.has(null==t?void 0:t.event))&&this.actionRegistry&&(null===(i=this.actionRegistry)||void 0===i?void 0:i.size)>0&&this.actionRegistry.forEach(function(e){n.checkAction(t,e)&&n._debugEventEmitter.emit("actionCaptured",e.name)})}},{key:"_addActionHook",value:function(e){this.onAction("actionCaptured",function(t){return e(t)})}},{key:"checkAction",value:function(e,t){if(null==(null==t?void 0:t.steps))return!1;var i,n=p(t.steps);try{for(n.s();!(i=n.n()).done;){var r=i.value;if(this.checkStep(e,r))return!0}}catch(e){n.e(e)}finally{n.f()}return!1}},{key:"onAction",value:function(e,t){return this._debugEventEmitter.on(e,t)}},{key:"checkStepUrl",value:function(t,i){if(null!=i&&i.url){var n,r=null==t||null===(n=t.properties)||void 0===n?void 0:n.$current_url;if(!r||"string"!=typeof r||!e.matchString(r,null==i?void 0:i.url,(null==i?void 0:i.url_matching)||"contains"))return!1}return!0}},{key:"checkStepElement",value:function(t,i){if((null!=i&&i.href||null!=i&&i.tag_name||null!=i&&i.text)&&!this.getElementsList(t).some(function(t){return!(null!=i&&i.href&&!e.matchString(t.href||"",null==i?void 0:i.href,(null==i?void 0:i.href_matching)||"exact"))&&(null==i||!i.tag_name||t.tag_name===(null==i?void 0:i.tag_name))&&!(null!=i&&i.text&&!e.matchString(t.text||"",null==i?void 0:i.text,(null==i?void 0:i.text_matching)||"exact")&&!e.matchString(t.$el_text||"",null==i?void 0:i.text,(null==i?void 0:i.text_matching)||"exact"))}))return!1;if(null!=i&&i.selector){var n,r=null==t||null===(n=t.properties)||void 0===n?void 0:n.$element_selectors;if(!r||!r.includes(null==i?void 0:i.selector))return!1}return!0}},{key:"getElementsList",value:function(e){return null==(null==e?void 0:e.properties.$elements)?[]:null==e?void 0:e.properties.$elements}}],[{key:"matchString",value:function(t,i,n){switch(n){case"regex":return!!F&&ts(t,i);case"exact":return i===t;case"contains":return ts(t,e.escapeStringRegexp(i).replace(/_/g,".").replace(/%/g,".*"));default:return!1}}},{key:"escapeStringRegexp",value:function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}}]),e}(),nD=function(){function e(t){o(this,e),this.instance=t,this.eventToSurveys=new Map,this.actionToSurveys=new Map}return l(e,[{key:"register",value:function(e){var t;x(null===(t=this.instance)||void 0===t?void 0:t._addCaptureHook)||(this.setupEventBasedSurveys(e),this.setupActionBasedSurveys(e))}},{key:"setupActionBasedSurveys",value:function(e){var t=this,i=e.filter(function(e){var t,i,n,r;return(null===(t=e.conditions)||void 0===t?void 0:t.actions)&&(null===(i=e.conditions)||void 0===i||null===(n=i.actions)||void 0===n||null===(r=n.values)||void 0===r?void 0:r.length)>0});0!==i.length&&(null==this.actionMatcher&&(this.actionMatcher=new nN(this.instance),this.actionMatcher.init(),this.actionMatcher._addActionHook(function(e){t.onAction(e)})),i.forEach(function(e){var i,n,r,s,o,a,l,u,c,d;e.conditions&&null!==(i=e.conditions)&&void 0!==i&&i.actions&&null!==(n=e.conditions)&&void 0!==n&&null!==(r=n.actions)&&void 0!==r&&r.values&&(null===(s=e.conditions)||void 0===s||null===(o=s.actions)||void 0===o||null===(a=o.values)||void 0===a?void 0:a.length)>0&&(null===(l=t.actionMatcher)||void 0===l||l.register(e.conditions.actions.values),null===(u=e.conditions)||void 0===u||null===(c=u.actions)||void 0===c||null===(d=c.values)||void 0===d||d.forEach(function(i){if(i&&i.name){var n=t.actionToSurveys.get(i.name);n&&n.push(e.id),t.actionToSurveys.set(i.name,n||[e.id])}}))}))}},{key:"setupEventBasedSurveys",value:function(e){var t,i=this;0!==e.filter(function(e){var t,i,n,r;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(i=e.conditions)||void 0===i||null===(n=i.events)||void 0===n||null===(r=n.values)||void 0===r?void 0:r.length)>0}).length&&(null===(t=this.instance)||void 0===t||t._addCaptureHook(function(e,t){i.onEvent(e,t)}),e.forEach(function(e){var t,n,r;null===(t=e.conditions)||void 0===t||null===(n=t.events)||void 0===n||null===(r=n.values)||void 0===r||r.forEach(function(t){if(t&&t.name){var n=i.eventToSurveys.get(t.name);n&&n.push(e.id),i.eventToSurveys.set(t.name,n||[e.id])}})}))}},{key:"onEvent",value:function(t,i){var n,r,s=(null===(n=this.instance)||void 0===n||null===(r=n.persistence)||void 0===r?void 0:r.props[eI])||[];if(e.SURVEY_SHOWN_EVENT_NAME==t&&i&&s.length>0){var o,a=null==i||null===(o=i.properties)||void 0===o?void 0:o.$survey_id;if(a){var l=s.indexOf(a);l>=0&&(s.splice(l,1),this._updateActivatedSurveys(s))}}else this.eventToSurveys.has(t)&&this._updateActivatedSurveys(s.concat(this.eventToSurveys.get(t)||[]))}},{key:"onAction",value:function(e){var t,i,n=(null===(t=this.instance)||void 0===t||null===(i=t.persistence)||void 0===i?void 0:i.props[eI])||[];this.actionToSurveys.has(e)&&this._updateActivatedSurveys(n.concat(this.actionToSurveys.get(e)||[]))}},{key:"_updateActivatedSurveys",value:function(e){var t,i;null===(t=this.instance)||void 0===t||null===(i=t.persistence)||void 0===i||i.register(u({},eI,d(new Set(e))))}},{key:"getSurveys",value:function(){var e,t;return(null===(e=this.instance)||void 0===e||null===(t=e.persistence)||void 0===t?void 0:t.props[eI])||[]}},{key:"getEventToSurveys",value:function(){return this.eventToSurveys}},{key:"_getActionMatcher",value:function(){return this.actionMatcher}}]),e}();u(nD,"SURVEY_SHOWN_EVENT_NAME","survey shown");var nq="[Surveys]",nj={icontains:function(e){return!!F&&F.location.href.toLowerCase().indexOf(e.toLowerCase())>-1},not_icontains:function(e){return!!F&&-1===F.location.href.toLowerCase().indexOf(e.toLowerCase())},regex:function(e){return!!F&&ts(F.location.href,e)},not_regex:function(e){return!!F&&!ts(F.location.href,e)},exact:function(e){return(null==F?void 0:F.location.href)===e},is_not:function(e){return(null==F?void 0:F.location.href)!==e}},nH=function(){function e(t){o(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 nD(this.instance)),this.instance.requestRouter.loadScript("/static/surveys.js",function(t){if(t)return z.error(nq,"Could not load surveys script",t);e._surveyManager=U.extendPostHogWithSurveys(e.instance)}))}},{key:"getSurveys",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.instance.config.disable_surveys)return e([]);null==this._surveyEventReceiver&&(this._surveyEventReceiver=new nD(this.instance));var n=this.instance.get_property(eC);if(n&&!i)return e(n);this.instance._send_request({url:this.instance.requestRouter.endpointFor("api","/api/surveys/?token=".concat(this.instance.config.token)),method:"GET",transport:"XHR",callback:function(i){if(200!==i.statusCode||!i.json)return e([]);var n,r,s=i.json.surveys||[],o=s.filter(function(e){var t,i,n,r,s,o,a,l,u,c,d,h;return(null===(t=e.conditions)||void 0===t?void 0:t.events)&&(null===(i=e.conditions)||void 0===i||null===(n=i.events)||void 0===n?void 0:n.values)&&(null===(r=e.conditions)||void 0===r||null===(s=r.events)||void 0===s||null===(o=s.values)||void 0===o?void 0:o.length)>0||(null===(a=e.conditions)||void 0===a?void 0:a.actions)&&(null===(l=e.conditions)||void 0===l||null===(u=l.actions)||void 0===u?void 0:u.values)&&(null===(c=e.conditions)||void 0===c||null===(d=c.actions)||void 0===d||null===(h=d.values)||void 0===h?void 0:h.length)>0});return o.length>0&&(null===(r=t._surveyEventReceiver)||void 0===r||r.register(o)),null===(n=t.instance.persistence)||void 0===n||n.register(u({},eC,s)),e(s)}})}},{key:"getActiveMatchingSurveys",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.getSurveys(function(i){var n,r=i.filter(function(e){return!(!e.start_date||e.end_date)}).filter(function(e){if(!e.conditions)return!0;var t,i,n,r,s=null===(t=e.conditions)||void 0===t||!t.url||nj[null!==(i=null===(n=e.conditions)||void 0===n?void 0:n.urlMatchType)&&void 0!==i?i:"icontains"](e.conditions.url),o=null===(r=e.conditions)||void 0===r||!r.selector||(null==N?void 0:N.querySelector(e.conditions.selector));return s&&o}),s=null===(n=t._surveyEventReceiver)||void 0===n?void 0:n.getSurveys();return e(r.filter(function(e){if(!e.linked_flag_key&&!e.targeting_flag_key&&!e.internal_targeting_flag_key)return!0;var i,n,r,o,a,l,u,c,d,h,f=!e.linked_flag_key||t.instance.featureFlags.isFeatureEnabled(e.linked_flag_key),p=!e.targeting_flag_key||t.instance.featureFlags.isFeatureEnabled(e.targeting_flag_key),g=(null===(i=e.conditions)||void 0===i?void 0:i.events)&&(null===(n=e.conditions)||void 0===n||null===(r=n.events)||void 0===r?void 0:r.values)&&(null===(o=e.conditions)||void 0===o||null===(a=o.events)||void 0===a?void 0:a.values.length)>0,v=(null===(l=e.conditions)||void 0===l?void 0:l.actions)&&(null===(u=e.conditions)||void 0===u||null===(c=u.actions)||void 0===c?void 0:c.values)&&(null===(d=e.conditions)||void 0===d||null===(h=d.actions)||void 0===h?void 0:h.values.length)>0,_=!g&&!v||(null==s?void 0:s.includes(e.id)),m=t._canActivateRepeatedly(e),y=!(e.internal_targeting_flag_key&&!m)||t.instance.featureFlags.isFeatureEnabled(e.internal_targeting_flag_key);return f&&p&&y&&_}))},i)}},{key:"getNextSurveyStep",value:function(e,t,i){var n,r=e.questions[t],s=t+1;if(null===(n=r.branching)||void 0===n||!n.type)return t===e.questions.length-1?nL.End:s;if(r.branching.type===nL.End)return nL.End;if(r.branching.type===nL.SpecificQuestion){if(Number.isInteger(r.branching.index))return r.branching.index}else if(r.branching.type===nL.ResponseBased){if(r.type===nF.SingleChoice){var o,a,l=r.choices.indexOf("".concat(i));if(null!==(o=r.branching)&&void 0!==o&&null!==(a=o.responseValues)&&void 0!==a&&a.hasOwnProperty(l)){var u=r.branching.responseValues[l];return Number.isInteger(u)?u:u===nL.End?nL.End:s}}else if(r.type===nF.Rating){if("number"!=typeof i||!Number.isInteger(i))throw Error("The response type must be an integer");var c,d,h=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")}(i,r.scale);if(null!==(c=r.branching)&&void 0!==c&&null!==(d=c.responseValues)&&void 0!==d&&d.hasOwnProperty(h)){var f=r.branching.responseValues[h];return Number.isInteger(f)?f:f===nL.End?nL.End:s}}return s}return z.warn(nq,"Falling back to next question index due to unexpected branching type"),s}},{key:"_canActivateRepeatedly",value:function(e){var t;return O(null===(t=U.__PosthogExtensions__)||void 0===t?void 0:t.canActivateRepeatedly)?(z.warn(nq,"canActivateRepeatedly is not defined, must init before calling"),!1):U.__PosthogExtensions__.canActivateRepeatedly(e)}},{key:"canRenderSurvey",value:function(e){var t=this;O(this._surveyManager)?z.warn(nq,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys(function(i){var n=i.filter(function(t){return t.id===e})[0];t._surveyManager.canRenderSurvey(n)})}},{key:"renderSurvey",value:function(e,t){var i=this;O(this._surveyManager)?z.warn(nq,"canActivateRepeatedly is not defined, must init before calling"):this.getSurveys(function(n){var r=n.filter(function(t){return t.id===e})[0];i._surveyManager.renderSurvey(r,null==N?void 0:N.querySelector(t))})}}]),e}(),nB=function(){function e(t){var i,n,r=this;o(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.")),r.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===(i=t.config.rate_limiting)||void 0===i?void 0:i.events_per_second)||10,this.captureEventsBurstLimit=Math.max((null===(n=t.config.rate_limiting)||void 0===n?void 0:n.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond),this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}return l(e,[{key:"clientRateLimitContext",value:function(){var e,t,i,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=(new Date).getTime(),s=null!==(e=null===(t=this.instance.persistence)||void 0===t?void 0:t.get_property(e$))&&void 0!==e?e:{tokens:this.captureEventsBurstLimit,last:r};s.tokens+=(r-s.last)/1e3*this.captureEventsPerSecond,s.last=r,s.tokens>this.captureEventsBurstLimit&&(s.tokens=this.captureEventsBurstLimit);var o=s.tokens<1;return o||n||(s.tokens=Math.max(0,s.tokens-1)),!o||this.lastEventRateLimited||n||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=o,null===(i=this.instance.persistence)||void 0===i||i.set_property(e$,s),{isRateLimited:o,remainingTokens:s.tokens}}},{key:"isServerRateLimited",value:function(e){var t=this.serverLimits[e||"events"]||!1;return!1!==t&&(new Date).getTime()<t}}]),e}(),nU=function(){return r({initialPathName:(null==D?void 0:D.pathname)||"",referringDomain:t5.referringDomain()},t5.campaignParams())},nV=function(){function e(t,i,n){var r=this;o(this,e),u(this,"_onSessionIdCallback",function(e){var t=r._getStoredProps();if(!t||t.sessionId!==e){var i={sessionId:e,props:r._sessionSourceParamGenerator()};r._persistence.register(u({},eT,i))}}),this._sessionIdManager=t,this._persistence=i,this._sessionSourceParamGenerator=n||nU,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}(),nz=["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","headlesschrome","cypress","Google-HotelAdsVerifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleweblight","mediapartners-google","storebot-google","Bytespider;"],nW=function(e,t){if(!e)return!1;var i=e.toLowerCase();return nz.concat(t||[]).some(function(e){var t=e.toLowerCase();return -1!==i.indexOf(t)})},nG=function(){function e(){o(this,e),this.clicks=[]}return l(e,[{key:"isRageClick",value:function(e,t,i){var n=this.clicks[this.clicks.length-1];if(n&&Math.abs(e-n.x)+Math.abs(t-n.y)<30&&i-n.timestamp<1e3){if(this.clicks.push({x:e,y:t,timestamp:i}),3===this.clicks.length)return!0}else this.clicks=[{x:e,y:t,timestamp:i}];return!1}}]),e}();function nK(e){var t;return e.id===eq||!(null===(t=e.closest)||void 0===t||!t.call(e,"#"+eq))}var nQ=function(){function e(t){var i,n=this;o(this,e),u(this,"rageclicks",new nG),u(this,"_enabledServerSide",!1),u(this,"_initialized",!1),u(this,"_flushInterval",null),this.instance=t,this._enabledServerSide=!(null===(i=this.instance.persistence)||void 0===i||!i.props[eh]),null==F||F.addEventListener("beforeunload",function(){n.flush()})}return l(e,[{key:"flushIntervalMilliseconds",get:function(){var e=5e3;return w(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(e=this.instance.config.capture_heatmaps.flush_interval_milliseconds),e}},{key:"isEnabled",get:function(){return x(this.instance.config.capture_heatmaps)?x(this.instance.config.enable_heatmaps)?this._enabledServerSide:this.instance.config.enable_heatmaps:!1!==this.instance.config.capture_heatmaps}},{key:"startIfEnabled",value:function(){if(this.isEnabled)this._initialized||(z.info("[heatmaps] starting..."),this._setupListeners(),this._flushInterval=setInterval(this.flush.bind(this),this.flushIntervalMilliseconds));else{var e;clearInterval(null!==(e=this._flushInterval)&&void 0!==e?e:void 0),this.getAndClearBuffer()}}},{key:"afterDecideResponse",value:function(e){var t=!!e.heatmaps;this.instance.persistence&&this.instance.persistence.register(u({},eh,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;F&&N&&(eo(N,"click",function(t){return e._onClick(t||(null==F?void 0:F.event))},!1,!0),eo(N,"mousemove",function(t){return e._onMouseMove(t||(null==F?void 0:F.event))},!1,!0),this._initialized=!0)}},{key:"_getProperties",value:function(e,t){var i=this.instance.scrollManager.scrollY(),n=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),s=function(e,t,i){for(var n=e;n&&!ia(n,"body")&&n!==i;){if(Y(t,null==F?void 0:F.getComputedStyle(n).position))return!0;n=id(n)}return!1}(e.target,["fixed","sticky"],r);return{x:e.clientX+(s?0:n),y:e.clientY+(s?0:i),target_fixed:s,type:t}}},{key:"_onClick",value:function(e){var t;if(!nK(e.target)){var i=this._getProperties(e,"click");null!==(t=this.rageclicks)&&void 0!==t&&t.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._capture(r(r({},i),{},{type:"rageclick"})),this._capture(i)}}},{key:"_onMouseMove",value:function(e){var t=this;nK(e.target)||(clearTimeout(this._mouseMoveTimeout),this._mouseMoveTimeout=setTimeout(function(){t._capture(t._getProperties(e,"mousemove"))},500))}},{key:"_capture",value:function(e){if(F){var t=F.location.href;this.buffer=this.buffer||{},this.buffer[t]||(this.buffer[t]=[]),this.buffer[t].push(e)}}},{key:"flush",value:function(){this.buffer&&!S(this.buffer)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}}]),e}(),nJ=function(){function e(t){var i=this;o(this,e),u(this,"_updateScrollData",function(){i.context||(i.context={});var e,t,n,r,s=i.scrollElement(),o=i.scrollY(),a=s?Math.max(0,s.scrollHeight-s.clientHeight):0,l=o+((null==s?void 0:s.clientHeight)||0),u=(null==s?void 0:s.scrollHeight)||0;i.context.lastScrollY=Math.ceil(o),i.context.maxScrollY=Math.max(o,null!==(e=i.context.maxScrollY)&&void 0!==e?e:0),i.context.maxScrollHeight=Math.max(a,null!==(t=i.context.maxScrollHeight)&&void 0!==t?t:0),i.context.lastContentY=l,i.context.maxContentY=Math.max(l,null!==(n=i.context.maxContentY)&&void 0!==n?n:0),i.context.maxContentHeight=Math.max(u,null!==(r=i.context.maxContentHeight)&&void 0!==r?r: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==F||F.addEventListener("scroll",this._updateScrollData,!0),null==F||F.addEventListener("scrollend",this._updateScrollData,!0),null==F||F.addEventListener("resize",this._updateScrollData)}},{key:"scrollElement",value:function(){if(!this.instance.config.scroll_root_selector)return null==F?void 0:F.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 i=e.value,n=null==F?void 0:F.document.querySelector(i);if(n)return n}}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 F&&(F.scrollY||F.pageYOffset||F.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 F&&(F.scrollX||F.pageXOffset||F.document.documentElement.scrollLeft)||0}}]),e}(),nY="$copy_autocapture";function nX(e,t){return t.length>e?t.slice(0,e)+"...":t}var nZ,n0,n1,n2,n3=function(){function e(t){o(this,e),u(this,"_initialized",!1),u(this,"_isDisabledServerSide",null),u(this,"rageclicks",new nG),u(this,"_elementsChainAsString",!1),this.instance=t,this._elementSelectors=null}return l(e,[{key:"config",get:function(){var e,t,i=w(this.instance.config.autocapture)?this.instance.config.autocapture:{};return i.url_allowlist=null===(e=i.url_allowlist)||void 0===e?void 0:e.map(function(e){return new RegExp(e)}),i.url_ignorelist=null===(t=i.url_ignorelist)||void 0===t?void 0:t.map(function(e){return new RegExp(e)}),i}},{key:"_addDomEventHandlers",value:function(){var e=this;if(this.isBrowserSupported()){if(F&&N){var t=function(t){t=t||(null==F?void 0:F.event);try{e._captureEvent(t)}catch(e){z.error("Failed to capture event",e)}},i=function(t){t=t||(null==F?void 0:F.event),e._captureEvent(t,nY)};eo(N,"submit",t,!1,!0),eo(N,"change",t,!1,!0),eo(N,"click",t,!1,!0),this.config.capture_copied_text&&(eo(N,"copy",i,!1,!0),eo(N,"cut",i,!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:"setElementSelectors",value:function(e){this._elementSelectors=e}},{key:"getElementSelectors",value:function(e){var t,i=[];return null===(t=this._elementSelectors)||void 0===t||t.forEach(function(t){var n=null==N?void 0:N.querySelectorAll(t);null==n||n.forEach(function(n){e===n&&i.push(t)})}),i}},{key:"isEnabled",get:function(){var e,t,i=null===(e=this.instance.persistence)||void 0===e?void 0:e.props[ed];if(P(this._isDisabledServerSide)&&!I(i)&&!this.instance.config.advanced_disable_decide)return!1;var n=null!==(t=this._isDisabledServerSide)&&void 0!==t?t:!!i;return!!this.instance.config.autocapture&&!n}},{key:"_previousElementSibling",value:function(e){if(e.previousElementSibling)return e.previousElementSibling;var t=e;do t=t.previousSibling;while(t&&!io(t));return t}},{key:"_getAugmentPropertiesFromElement",value:function(e){if(!ih(e))return{};var t={};return Q(e.attributes,function(e){if(e.name&&0===e.name.indexOf("data-ph-capture-attribute")){var i=e.name.replace("data-ph-capture-attribute-",""),n=e.value;i&&n&&ik(n)&&(t[i]=n)}}),t}},{key:"_getPropertiesFromElement",value:function(e,t,i){var n,r=e.tagName.toLowerCase(),s={tag_name:r};ic.indexOf(r)>-1&&!i&&("a"===r.toLowerCase()||"button"===r.toLowerCase()?s.$el_text=nX(1024,iw(e)):s.$el_text=nX(1024,is(e)));var o=ii(e);o.length>0&&(s.classes=o.filter(function(e){return""!==e}));var a=null===(n=this.config)||void 0===n?void 0:n.element_attribute_ignorelist;Q(e.attributes,function(i){var n;if((!ip(e)||-1!==["name","id","class","aria-label"].indexOf(i.name))&&(null==a||!a.includes(i.name))&&!t&&ik(i.value)&&(!E(n=i.name)||"_ngcontent"!==n.substring(0,10)&&"_nghost"!==n.substring(0,7))){var r=i.value;"class"===i.name&&(r=ie(r).join(" ")),s["attr__"+i.name]=nX(1024,r)}});for(var l=1,u=1,c=e;c=this._previousElementSibling(c);)l++,c.tagName===e.tagName&&u++;return s.nth_child=l,s.nth_of_type=u,s}},{key:"_getDefaultProperties",value:function(e){return{$event_type:e,$ce_version:1}}},{key:"_getEventTarget",value:function(e){var t;return x(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,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"$autocapture";if(this.isEnabled){var n,o=this._getEventTarget(e);il(o)&&(o=o.parentNode||null),"$autocapture"===i&&"click"===e.type&&e instanceof MouseEvent&&this.instance.config.rageclick&&null!==(n=this.rageclicks)&&void 0!==n&&n.isRageClick(e.clientX,e.clientY,(new Date).getTime())&&this._captureEvent(e,"$rageclick");var a=i===nY;if(o&&function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;if(!F||!e||ia(e,"html")||!io(e)||null!=i&&i.url_allowlist&&!it(i.url_allowlist)||null!=i&&i.url_ignorelist&&it(i.url_ignorelist))return!1;if(null!=i&&i.dom_event_allowlist){var o=i.dom_event_allowlist;if(o&&!o.some(function(e){return t.type===e}))return!1}for(var a=!1,l=[e],u=!0,c=e;c.parentNode&&!ia(c,"body");)if(iu(c.parentNode))l.push(c.parentNode.host),c=c.parentNode.host;else{if(!(u=id(c)))break;if(n||ic.indexOf(u.tagName.toLowerCase())>-1)a=!0;else{var d=F.getComputedStyle(u);d&&"pointer"===d.getPropertyValue("cursor")&&(a=!0)}l.push(u),c=u}if(!function(e,t){var i=null==t?void 0:t.element_allowlist;if(x(i))return!0;var n,r=p(e);try{for(r.s();!(n=r.n()).done;){var o=function(){var e=n.value;if(i.some(function(t){return e.tagName.toLowerCase()===t}))return{v:!0}}();if("object"===s(o))return o.v}}catch(e){r.e(e)}finally{r.f()}return!1}(l,i)||!function(e,t){var i=null==t?void 0:t.css_selector_allowlist;if(x(i))return!0;var n,r=p(e);try{for(r.s();!(n=r.n()).done;){var o=function(){var e=n.value;if(i.some(function(t){return e.matches(t)}))return{v:!0}}();if("object"===s(o))return o.v}}catch(e){r.e(e)}finally{r.f()}return!1}(l,i))return!1;var h=F.getComputedStyle(e);if(h&&"pointer"===h.getPropertyValue("cursor")&&"click"===t.type)return!0;var f=e.tagName.toLowerCase();switch(f){case"html":return!1;case"form":return(r||["submit"]).indexOf(t.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(t.type)>=0;default:return a?(r||["click"]).indexOf(t.type)>=0:(r||["click"]).indexOf(t.type)>=0&&(ic.indexOf(f)>-1||"true"===e.getAttribute("contenteditable"))}}(o,e,this.config,a,a?["copy","cut"]:void 0)){for(var l,u,d=[o],h=o;h.parentNode&&!ia(h,"body");)iu(h.parentNode)?(d.push(h.parentNode.host),h=h.parentNode.host):(d.push(h.parentNode),h=h.parentNode);var f,g,v=[],_={},m=!1;if(Q(d,function(e){var i=ih(e);"a"===e.tagName.toLowerCase()&&(f=e.getAttribute("href"),f=i&&ik(f)&&f),Y(ii(e),"ph-no-capture")&&(m=!0),v.push(t._getPropertiesFromElement(e,t.instance.config.mask_all_element_attributes,t.instance.config.mask_all_text)),J(_,t._getAugmentPropertiesFromElement(e))}),this.instance.config.mask_all_text||("a"===o.tagName.toLowerCase()||"button"===o.tagName.toLowerCase()?v[0].$el_text=iw(o):v[0].$el_text=is(o)),f){v[0].attr__href=f;var y,k,w=null===(y=tr(f))||void 0===y?void 0:y.host,S=null==F||null===(k=F.location)||void 0===k?void 0:k.host;w&&S&&w!==S&&(g=f)}if(m)return!1;var E=J(this._getDefaultProperties(e.type),this._elementsChainAsString?{$elements_chain:v.map(function(e){var t,i,n,r={text:null===(i=e.$el_text)||void 0===i?void 0:i.slice(0,400),tag_name:e.tag_name,href:null===(n=e.attr__href)||void 0===n?void 0:n.slice(0,2048),attr_class:(t=e.attr__class)?b(t)?t:ie(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),i=t[0],n=t[1];return r.attributes[i]=n}),r}).map(function(e){var t,i,n="";if(e.tag_name&&(n+=e.tag_name),e.attr_class){e.attr_class.sort();var s,o=p(e.attr_class);try{for(o.s();!(s=o.n()).done;){var a=s.value;n+=".".concat(a.replace(/"/g,""))}}catch(e){o.e(e)}finally{o.f()}}var l=r(r(r(r({},e.text?{text:e.text}:{}),{},{"nth-child":null!==(t=e.nth_child)&&void 0!==t?t:0,"nth-of-type":null!==(i=e.nth_of_type)&&void 0!==i?i:0},e.href?{href:e.href}:{}),e.attr_id?{attr_id:e.attr_id}:{}),e.attributes),u={};return X(l).sort(function(e,t){var i=c(e,1)[0],n=c(t,1)[0];return i.localeCompare(n)}).forEach(function(e){var t=c(e,2),i=t[0],n=t[1];return u[iS(i.toString())]=iS(n.toString())}),n+=":"+X(l).map(function(e){var t=c(e,2),i=t[0],n=t[1];return"".concat(i,'="').concat(n,'"')}).join("")}).join(";")}:{$elements:v},null!==(l=v[0])&&void 0!==l&&l.$el_text?{$el_text:null===(u=v[0])||void 0===u?void 0:u.$el_text}:{},g&&"click"===e.type?{$external_click_url:g}:{},_),R=this.getElementSelectors(o);if(R&&R.length>0&&(E.$element_selectors=R),i===nY){var P,O=ir(null==F||null===(P=F.getSelection())||void 0===P?void 0:P.toString()),C=e.type||"clipboard";if(!O)return!1;E.$selected_content=O,E.$copy_type=C}return this.instance.capture(i,E),!0}}}},{key:"isBrowserSupported",value:function(){return k(null==N?void 0:N.querySelectorAll)}}]),e}(),n5=function(){function e(t){var i=this;o(this,e),u(this,"_restoreXHRPatch",void 0),u(this,"_restoreFetchPatch",void 0),u(this,"_startCapturing",function(){x(i._restoreXHRPatch)&&U.postHogTracingHeadersPatchFns._patchXHR(i.instance.sessionManager),x(i._restoreFetchPatch)&&U.postHogTracingHeadersPatchFns._patchFetch(i.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(g.LIB_VERSION),function(t){if(t)return 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}();(ru=n2||(n2={}))[ru.PENDING=-1]="PENDING",ru[ru.DENIED=0]="DENIED",ru[ru.GRANTED=1]="GRANTED";var n8=function(){function e(t){o(this,e),this.instance=t}return l(e,[{key:"config",get:function(){return this.instance.config}},{key:"consent",get:function(){return this.getDnt()?n2.DENIED:this.storedConsent}},{key:"isOptedOut",value:function(){return this.consent===n2.DENIED||this.consent===n2.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?n2.GRANTED:"0"===e?n2.DENIED:n2.PENDING}},{key:"storage",get:function(){if(!this._storage){var e=this.config.opt_out_capturing_persistence_type;this._storage="localStorage"===e?e4:e5;var t="localStorage"===e?e5:e4;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==M?void 0:M.doNotTrack,null==M?void 0:M.msDoNotTrack,U.doNotTrack],function(e){return Y([!0,1,"1","yes"],e)})}}]),e}(),n4="[Exception Autocapture]",n6=function(){function e(t){var i,n=this;o(this,e),u(this,"originalOnUnhandledRejectionHandler",void 0),u(this,"startCapturing",function(){if(F&&n.isEnabled&&!n.hasHandlers&&!n.isCapturing){var e=F.posthogErrorWrappingFunctions.wrapOnError,t=F.posthogErrorWrappingFunctions.wrapUnhandledRejection;if(e&&t)try{n.unwrapOnError=e(n.captureException.bind(n)),n.unwrapUnhandledRejection=t(n.captureException.bind(n))}catch(e){z.error(n4+" failed to start",e),n.stopCapturing()}else z.error(n4+" failed to load error wrapping functions - cannot start")}}),this.instance=t,this.remoteEnabled=!(null===(i=this.instance.persistence)||void 0===i||!i.props[ef]),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==F||null===(e=F.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(n4+" enabled, starting..."),this.loadScript(this.startCapturing))}},{key:"loadScript",value:function(e){this.hasHandlers&&e(),this.instance.requestRouter.loadScript("/static/exception-autocapture.js?v=".concat(g.LIB_VERSION),function(t){if(t)return z.error(n4+" 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.instance.persistence&&this.instance.persistence.register(u({},ef,this.remoteEnabled)),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.instance.exceptions.sendExceptionEvent(e)}}]),e}(),n7="[Web Vitals]",n9=function(){function e(t){var i,n=this;o(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(n._delayedFlushTimer),0!==n.buffer.metrics.length&&(n.instance.capture("$web_vitals",n.buffer.metrics.reduce(function(e,t){var i;return r(r({},e),{},(u(i={},"$web_vitals_".concat(t.name,"_event"),r({},t)),u(i,"$web_vitals_".concat(t.name,"_value"),t.value),i))},{})),n.buffer={url:void 0,metrics:[],firstMetricTimestamp:void 0})}),u(this,"_addToBuffer",function(e){var t,i=null===(t=n.instance.sessionManager)||void 0===t?void 0:t.checkAndGetSessionAndWindowId(!0);if(x(i))z.error(n7+"Could not read session ID. Dropping metrics!");else{n.buffer=n.buffer||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var s=n._currentURL();x(s)||(O(null==e?void 0:e.name)||O(null==e?void 0:e.value)?z.error(n7+"Invalid metric received",e):n._maxAllowedValue&&e.value>=n._maxAllowedValue?z.error(n7+"Ignoring metric with value >= "+n._maxAllowedValue,e):(n.buffer.url!==s&&(n._flushToCapture(),n._delayedFlushTimer=setTimeout(n._flushToCapture,8e3)),x(n.buffer.url)&&(n.buffer.url=s),n.buffer.firstMetricTimestamp=x(n.buffer.firstMetricTimestamp)?Date.now():n.buffer.firstMetricTimestamp,n.buffer.metrics.push(r(r({},e),{},{$current_url:s,$session_id:i.sessionId,$window_id:i.windowId,timestamp:Date.now()})),n.buffer.metrics.length===n.allowedMetrics.length&&n._flushToCapture()))}}),u(this,"_startCapturing",function(){var e,t,i,r,s=U.__PosthogExtensions__;if(!x(s)){var o=s.postHogWebVitalsCallbacks;e=o.onLCP,t=o.onCLS,i=o.onFCP,r=o.onINP}e&&t&&i&&r?(n.allowedMetrics.indexOf("LCP")>-1&&e(n._addToBuffer.bind(n)),n.allowedMetrics.indexOf("CLS")>-1&&t(n._addToBuffer.bind(n)),n.allowedMetrics.indexOf("FCP")>-1&&i(n._addToBuffer.bind(n)),n.allowedMetrics.indexOf("INP")>-1&&r(n._addToBuffer.bind(n)),n._initialized=!0):z.error(n7+"web vitals callbacks not loaded - not starting")}),this.instance=t,this._enabledServerSide=!(null===(i=this.instance.persistence)||void 0===i||!i.props[eg]),this.startIfEnabled()}return l(e,[{key:"allowedMetrics",get:function(){var e,t,i=w(this.instance.config.capture_performance)?null===(e=this.instance.config.capture_performance)||void 0===e?void 0:e.web_vitals_allowed_metrics:void 0;return x(i)?(null===(t=this.instance.persistence)||void 0===t?void 0:t.props[ev])||["CLS","FCP","INP","LCP"]:i}},{key:"_maxAllowedValue",get:function(){var e=w(this.instance.config.capture_performance)&&C(this.instance.config.capture_performance.__web_vitals_max_value)?this.instance.config.capture_performance.__web_vitals_max_value:9e5;return 0<e&&e<=6e4?9e5:e}},{key:"isEnabled",get:function(){var e=w(this.instance.config.capture_performance)?this.instance.config.capture_performance.web_vitals:void 0;return I(e)?e:this._enabledServerSide}},{key:"startIfEnabled",value:function(){this.isEnabled&&!this._initialized&&(z.info(n7+" enabled, starting..."),this.loadScript(this._startCapturing))}},{key:"afterDecideResponse",value:function(e){var t=w(e.capturePerformance)&&!!e.capturePerformance.web_vitals,i=w(e.capturePerformance)?e.capturePerformance.web_vitals_allowed_metrics:void 0;this.instance.persistence&&(this.instance.persistence.register(u({},eg,t)),this.instance.persistence.register(u({},ev,i))),this._enabledServerSide=t,this.startIfEnabled()}},{key:"loadScript",value:function(e){var t;null!==(t=U.__PosthogExtensions__)&&void 0!==t&&t.postHogWebVitalsCallbacks&&e(),this.instance.requestRouter.loadScript("/static/web-vitals.js?v=".concat(g.LIB_VERSION),function(t){t?z.error(n7+" failed to load script",t):e()})}},{key:"_currentURL",value:function(){var e=F?F.location.href:void 0;return e||z.error(n7+"Could not determine current URL"),e}}]),e}(),re=function(){function e(t){var i;o(this,e),this.instance=t,this._endpointSuffix=(null===(i=this.instance.persistence)||void 0===i?void 0:i.props[ep])||"/e/"}return l(e,[{key:"endpoint",get:function(){return this.instance.requestRouter.endpointFor("api",this._endpointSuffix)}},{key:"afterDecideResponse",value:function(e){var t=e.autocaptureExceptions;this._endpointSuffix=w(t)&&t.endpoint||"/e/",this.instance.persistence&&this.instance.persistence.register(u({},ep,this._endpointSuffix))}},{key:"sendExceptionEvent",value:function(e){this.instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",_url:this.endpoint})}}]),e}(),rt={},ri=function(){},rn="posthog",rr=!ng&&-1===(null==B?void 0:B.indexOf("MSIE"))&&-1===(null==B?void 0:B.indexOf("Mozilla")),rs=function(){var e,t,i;return{api_host:"https://us.i.posthog.com",ui_host:null,token:"",autocapture:!0,rageclick:!0,cross_subdomain_cookie:!!E(i=null==(t=null==N?void 0:N.location)?void 0:t.hostname)&&"herokuapp.com"!==i.split(".").slice(-2).join("."),persistence:"localStorage+cookie",persistence_name:"",loaded:ri,store_google:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageview:!0,capture_pageleave:"if_capture_pageview",debug:D&&E(null==D?void 0:D.search)&&-1!==D.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==F||null===(e=F.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:ri,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"always",__add_tracing_headers:!1}},ro=function(e){var t={};x(e.process_person)||(t.person_profiles=e.process_person),x(e.xhr_headers)||(t.request_headers=e.xhr_headers),x(e.cookie_name)||(t.persistence_name=e.cookie_name),x(e.disable_cookie)||(t.disable_persistence=e.disable_cookie);var i=J({},t,e);return b(e.property_blacklist)&&(x(e.property_denylist)?i.property_denylist=e.property_blacklist:b(e.property_denylist)?i.property_denylist=[].concat(d(e.property_blacklist),d(e.property_denylist)):z.error("Invalid value for property_denylist config: "+e.property_denylist)),i},ra=function(){function e(){o(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}(),rl=function(){function e(){var t=this;o(this,e),u(this,"webPerformance",new ra),u(this,"version",g.LIB_VERSION),u(this,"_internalEventEmitter",new nM),this.config=rs(),this.decideEndpointWasHit=!1,this.SentryIntegration=nT,this.sentryIntegration=function(e){var i;return i=nO(t,e),{name:nP,processEvent:function(e){return i(e)}}},this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this._initialPageviewCaptured=!1,this.featureFlags=new ez(this),this.toolbar=new iV(this),this.scrollManager=new nJ(this),this.pageViewManager=new n$(this),this.surveys=new nH(this),this.exceptions=new re(this),this.rateLimiter=new nB(this),this.requestRouter=new nR(this),this.consent=new n8(this),this.people={set:function(e,i,n){var r=E(e)?u({},e,i):e;t.setPersonProperties(r),null==n||n({})},set_once:function(e,i,n){var r=E(e)?u({},e,i):e;t.setPersonProperties(void 0,r),null==n||n({})}},this.on("eventCaptured",function(e){return z.info("send",e)})}return l(e,[{key:"init",value:function(t,i,n){if(n&&n!==rn){var r,s=null!==(r=rt[n])&&void 0!==r?r:new e;return s._init(t,i,n),rt[n]=s,rt[rn][n]=s,s}return this._init(t,i,n)}},{key:"_init",value:function(e){var t,i,n=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(x(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;this.__loaded=!0,this.config={},this._triggered_notifs=[],this.set_config(J({},rs(),ro(s),{name:o,token:e})),this.config.on_xhr_error&&z.error("[posthog] on_xhr_error is deprecated. Use on_request_error instead"),this.compression=s.disable_compression?void 0:Z.GZipJS,this.persistence=new t4(this.config),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new t4(r(r({},this.config),{},{persistence:"sessionStorage"}));var a=r({},this.persistence.props),l=r({},this.sessionPersistence.props);if(this._requestQueue=new iz(function(e){return n._send_retriable_request(e)}),this._retryQueue=new nS(this),this.__request_queue=[],this.sessionManager=new nx(this.config,this.persistence),this.sessionPropsManager=new nV(this.sessionManager,this.persistence),new n5(this).startIfEnabledOrStop(),this.sessionRecording=new ij(this),this.sessionRecording.startIfEnabledOrStop(),this.config.disable_scroll_properties||this.scrollManager.startMeasuringScrollPosition(),this.autocapture=new n3(this),this.autocapture.startIfEnabled(),this.surveys.loadIfEnabled(),this.heatmaps=new nQ(this),this.heatmaps.startIfEnabled(),this.webVitalsAutocapture=new n9(this),this.exceptionObserver=new n6(this),this.exceptionObserver.startIfEnabled(),g.DEBUG=g.DEBUG||this.config.debug,g.DEBUG&&z.info("Starting in debug mode",{this:this,config:s,thisC:r({},this.config),p:a,s:l}),this._sync_opt_out_with_persistence(),void 0!==(null===(t=s.bootstrap)||void 0===t?void 0:t.distinctID)){var u,c,d=this.config.get_device_id(e0()),h=null!==(u=s.bootstrap)&&void 0!==u&&u.isIdentifiedID?d:s.bootstrap.distinctID;this.persistence.set_property(eL,null!==(c=s.bootstrap)&&void 0!==c&&c.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:s.bootstrap.distinctID,$device_id:h})}if(this._hasBootstrappedFeatureFlags()){var f,p,v=Object.keys((null===(f=s.bootstrap)||void 0===f?void 0:f.featureFlags)||{}).filter(function(e){var t,i;return!(null===(t=s.bootstrap)||void 0===t||null===(i=t.featureFlags)||void 0===i||!i[e])}).reduce(function(e,t){var i,n;return e[t]=(null===(i=s.bootstrap)||void 0===i||null===(n=i.featureFlags)||void 0===n?void 0:n[t])||!1,e},{}),_=Object.keys((null===(p=s.bootstrap)||void 0===p?void 0:p.featureFlagPayloads)||{}).filter(function(e){return v[e]}).reduce(function(e,t){var i,n,r,o;return null!==(i=s.bootstrap)&&void 0!==i&&null!==(n=i.featureFlagPayloads)&&void 0!==n&&n[t]&&(e[t]=null===(r=s.bootstrap)||void 0===r||null===(o=r.featureFlagPayloads)||void 0===o?void 0:o[t]),e},{});this.featureFlags.receivedFeatureFlags({featureFlags:v,featureFlagPayloads:_})}if(!this.get_distinct_id()){var m=this.config.get_device_id(e0());this.register_once({distinct_id:m,$device_id:m},""),this.persistence.set_property(eL,"anonymous")}return null==F||null===(i=F.addEventListener)||void 0===i||i.call(F,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this)),this.toolbar.maybeLoadToolbar(),s.segment?function(e,t){var i=e.config.segment;if(!i)return t();!function(e,t){var i=e.config.segment;if(!i)return t();var n=function(i){var n=function(){return i.anonymousId()||e0()};e.config.get_device_id=n,i.id()&&(e.register({distinct_id:i.id(),$device_id:n()}),e.persistence.set_property(eL,"identified")),t()},r=i.user();"then"in r&&k(r.then)?r.then(function(e){return n(e)}):n(r)}(e,function(){var n;i.register((Promise&&Promise.resolve||z.warn("This browser does not have Promise support, and can not use the segment integration"),n=function(t,i){if(!i)return t;t.event.userId||t.event.anonymousId===e.get_distinct_id()||(z.info("Segment integration does not have a userId set, resetting PostHog"),e.reset()),t.event.userId&&t.event.userId!==e.get_distinct_id()&&(z.info("Segment integration has a userId set, identifying with PostHog"),e.identify(t.event.userId));var n,r=e._calculate_event_properties(i,null!==(n=t.event.properties)&&void 0!==n?n:{},new Date);return t.event.properties=Object.assign({},r,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 n(e,e.event.event)},page:function(e){return n(e,"$pageview")},identify:function(e){return n(e,"$identify")},screen:function(e){return n(e,"$screen")}})).then(function(){t()})})}(this,function(){return n._loaded()}):this._loaded(),k(this.config._onCapture)&&this.on("eventCaptured",function(e){return n.config._onCapture(e.event,e)}),this}},{key:"_afterDecideResponse",value:function(e){var t,i,n,r,s,o,a,l;this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=Y(e.supportedCompression,Z.GZipJS)?Z.GZipJS:Y(e.supportedCompression,Z.Base64)?Z.Base64:void 0),null!==(t=e.analytics)&&void 0!==t&&t.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),null===(i=this.sessionRecording)||void 0===i||i.afterDecideResponse(e),null===(n=this.autocapture)||void 0===n||n.afterDecideResponse(e),null===(r=this.heatmaps)||void 0===r||r.afterDecideResponse(e),null===(s=this.surveys)||void 0===s||s.afterDecideResponse(e),null===(o=this.webVitalsAutocapture)||void 0===o||o.afterDecideResponse(e),null===(a=this.exceptions)||void 0===a||a.afterDecideResponse(e),null===(l=this.exceptionObserver)||void 0===l||l.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(){e.consent.isOptedIn()&&e._captureInitialPageview()},1),t||(new iH(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()||K(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&&(rr?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=n_(e.url,{ip:this.config.ip?1:0}),e.headers=r({},this.config.request_headers),e.compression="best-available"===e.compression?this.compression:e.compression,function(e){var t,i,n,s=r({},e);s.timeout=s.timeout||6e4,s.url=n_(s.url,{_:(new Date).getTime().toString(),ver:g.LIB_VERSION,compression:s.compression});var o=null!==(t=s.transport)&&void 0!==t?t:"XHR",a=null!==(i=null===(n=ea(ny,function(e){return e.transport===o}))||void 0===n?void 0:n.method)&&void 0!==i?i:ny[0].method;if(!a)throw Error("No available transport method");a(s)}(r(r({},e),{},{callback:function(i){var n,r,s;t.rateLimiter.checkForLimiting(i),i.statusCode>=400&&(null===(r=(s=t.config).on_request_error)||void 0===r||r.call(s,i)),null===(n=e.callback)||void 0===n||n.call(e,i)}}))))}},{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,i=this,n=[],r=[],s=[];K(e,function(e){e&&(b(t=e[0])?s.push(e):k(e)?e.call(i):b(e)&&"alias"===t?n.push(e):b(e)&&-1!==t.indexOf("capture")&&k(i[t])?s.push(e):r.push(e))});var o=function(e,t){K(e,function(e){if(b(e[0])){var i=t;Q(e,function(e){i=i[e[0]].apply(i,e.slice(1))})}else this[e[0]].apply(this,e.slice(1))},t)};o(n,this),o(r,this),o(s,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,i){var n;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this._requestQueue){if(!this.consent.isOptedOut()){if(!x(e)&&E(e)){if(this.config.opt_out_useragent_filter||!this._is_bot()){var s=null!=i&&i.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(null==s||!s.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 o,a,l,u,c=new Date,d=(null==i?void 0:i.timestamp)||c,h={uuid:e0(),event:e,properties:this._calculate_event_properties(e,t||{},d)};s&&(h.properties.$lib_rate_limit_remaining_tokens=s.remainingTokens),(null==i?void 0:i.$set)&&(h.$set=null==i?void 0:i.$set);var f=this._calculate_set_once_properties(null==i?void 0:i.$set_once);f&&(h.$set_once=f),(o=h,a=null!=i&&i._noTruncate?null:this.config.properties_string_max_length,l=function(e){return E(e)&&!P(a)?e.slice(0,a):e},u=new Set,h=function e(t,i){var n;return t!==Object(t)?l?l(t,i):t:u.has(t)?void 0:(u.add(t),b(t)?(n=[],K(t,function(t){n.push(e(t))})):(n={},Q(t,function(t,i){u.has(t)||(n[i]=e(t,i))})),n)}(o)).timestamp=d,x(null==i?void 0:i.timestamp)||(h.properties.$event_time_override_provided=!0,h.properties.$event_time_override_system_time=c);var p=r(r({},h.properties.$set),h.$set);S(p)||this.setPersonPropertiesForFlags(p),this._internalEventEmitter.emit("eventCaptured",h);var g={method:"POST",url:null!==(n=null==i?void 0:i._url)&&void 0!==n?n:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:h,compression:"best-available",batchKey:null==i?void 0:i._batchKey};return!this.config.request_batching||i&&(null==i||!i._batchKey)||null!=i&&i.send_instantly?this._send_retriable_request(g):this._requestQueue.enqueue(g),h}z.critical("This capture call is ignored due to client rate limiting.")}}else z.error("No event name provided to posthog.capture")}}else z.uninitializedWarning("posthog.capture")}},{key:"_addCaptureHook",value:function(e){return this.on("eventCaptured",function(t){return e(t.event,t)})}},{key:"_calculate_event_properties",value:function(e,t,i){if(i=i||new Date,!this.persistence||!this.sessionPersistence)return t;var n=this.persistence.remove_event_timer(e),s=r({},t);if(s.token=this.config.token,"$snapshot"===e){var o=r(r({},this.persistence.properties()),this.sessionPersistence.properties());return s.distinct_id=o.distinct_id,(!E(s.distinct_id)&&!C(s.distinct_id)||R(s.distinct_id))&&z.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),s}var a=t5.properties();if(this.sessionManager){var l=this.sessionManager.checkAndGetSessionAndWindowId(),u=l.sessionId,c=l.windowId;s.$session_id=u,s.$window_id=c}if(this.requestRouter.region===nk.CUSTOM&&(s.$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();s=J(s,d)}if(!this.config.disable_scroll_properties){var h={};"$pageview"===e?h=this.pageViewManager.doPageView(i):"$pageleave"===e&&(h=this.pageViewManager.doPageLeave(i)),s=J(s,h)}if("$pageview"===e&&N&&(s.title=N.title),!x(n)){var f=i.getTime()-n;s.$duration=parseFloat((f/1e3).toFixed(3))}B&&this.config.opt_out_useragent_filter&&(s.$browser_type=this._is_bot()?"bot":"browser"),(s=J({},a,this.persistence.properties(),this.sessionPersistence.properties(),s)).$is_identified=this._isIdentified(),b(this.config.property_denylist)?Q(this.config.property_denylist,function(e){delete s[e]}):z.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var p=this.config.sanitize_properties;return p&&(s=p(s,e)),s.$process_person_profile=this._hasPersonProcessing(),s}},{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 i;null===(i=this.persistence)||void 0===i||i.register(e,t)}},{key:"register_once",value:function(e,t,i){var n;null===(n=this.persistence)||void 0===n||n.register_once(e,t,i)}},{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,i;return null!==(t=null===(i=this.sessionManager)||void 0===i?void 0:i.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:"renderSurvey",value:function(e,t){this.surveys.renderSurvey(e,t)}},{key:"canRenderSurvey",value:function(e){this.surveys.canRenderSurvey(e)}},{key:"getNextSurveyStep",value:function(e,t,i){return this.surveys.getNextSurveyStep(e,t,i)}},{key:"identify",value:function(e,t,i){if(!this.__loaded||!this.persistence)return z.uninitializedWarning("posthog.identify");if(C(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 n=this.get_distinct_id();this.register({$user_id:e}),this.get_property("$device_id")||this.register_once({$had_persisted_distinct_id:!0,$device_id:n},""),e!==n&&e!==this.get_property(eu)&&(this.unregister(eu),this.register({distinct_id:e}));var r="anonymous"===(this.persistence.get_property(eL)||"anonymous");e!==n&&r?(this.persistence.set_property(eL,"identified"),this.setPersonPropertiesForFlags(t||{},!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:n},{$set:t||{},$set_once:i||{}}),this.featureFlags.setAnonymousDistinctId(n)):(t||i)&&this.setPersonProperties(t,i),e!==n&&(this.reloadFeatureFlags(),this.unregister(eF))}}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,i){if(e&&t){if(this._requirePersonProcessing("posthog.group")){var n=this.getGroups();n[e]!==t&&this.resetGroupPropertiesForFlags(e),this.register({$groups:r(r({},n),{},u({},e,t))}),i&&(this.capture("$groupidentify",{$group_type:e,$group_key:t,$group_set:i}),this.setGroupPropertiesForFlags(u({},e,i))),n[e]===t||i||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(z.info("reset"),!this.__loaded)return z.uninitializedWarning("posthog.reset");var t,i,n,r,s=this.get_property("$device_id");this.consent.reset(),null===(t=this.persistence)||void 0===t||t.clear(),null===(i=this.sessionPersistence)||void 0===i||i.clear(),null===(n=this.persistence)||void 0===n||n.set_property(eL,"anonymous"),null===(r=this.sessionManager)||void 0===r||r.resetSessionId();var o=this.config.get_device_id(e0());this.register_once({distinct_id:o,$device_id:e?o:s},"")}},{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),i=t.sessionId,n=t.sessionStartTimestamp,r=this.requestRouter.endpointFor("ui","/project/".concat(this.config.token,"/replay/").concat(i));if(null!=e&&e.withTimestamp&&n){var s,o=null!==(s=e.timestampLookBack)&&void 0!==s?s:10;if(!n)return r;var a=Math.max(Math.floor(((new Date).getTime()-n)/1e3)-o,0);r+="?t=".concat(a)}return r}},{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")?(x(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,i,n,s,o=r({},this.config);w(e)&&(J(this.config,ro(e)),null===(t=this.persistence)||void 0===t||t.update_config(this.config,o),this.sessionPersistence="sessionStorage"===this.config.persistence?this.persistence:new t4(r(r({},this.config),{},{persistence:"sessionStorage"})),e4.is_supported()&&"true"===e4.get("ph_debug")&&(this.config.debug=!0),this.config.debug&&(g.DEBUG=!0,z.info("set_config",{config:e,oldConfig:o,newConfig:r({},this.config)})),null===(i=this.sessionRecording)||void 0===i||i.startIfEnabledOrStop(),null===(n=this.autocapture)||void 0===n||n.startIfEnabled(),null===(s=this.heatmaps)||void 0===s||s.startIfEnabled(),this.surveys.loadIfEnabled(),this._sync_opt_out_with_persistence())}},{key:"startSessionRecording",value:function(e){var t,i=I(e)&&e;if(i||null!=e&&e.sampling){var n,r,s=null===(n=this.sessionManager)||void 0===n?void 0:n.checkAndGetSessionAndWindowId();null===(r=this.persistence)||void 0===r||r.register(u({},ex,!0)),z.info("Session recording started with sampling override for session: ",null==s?void 0:s.sessionId)}(i||null!=e&&e.linked_flag)&&(null===(t=this.sessionRecording)||void 0===t||t.overrideLinkedFlag(),z.info("Session recording started with linked_flags override")),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:"captureException",value:function(e,t){var i=k(U.parseErrorAsProperties)?U.parseErrorAsProperties([e.message,void 0,void 0,void 0,e]):r({$exception_type:e.name,$exception_message:e.message,$exception_level:"error"},t);this.exceptions.sendExceptionEvent(i)}},{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:rn;return t!==rn&&(t=rn+"."+t),t}},{key:"_isIdentified",value:function(){var e,t;return"identified"===(null===(e=this.persistence)||void 0===e?void 0:e.get_property(eL))||"identified"===(null===(t=this.sessionPersistence)||void 0===t?void 0:t.get_property(eL))}},{key:"_hasPersonProcessing",value:function(){var e,t,i,n;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===(i=this.persistence)||void 0===i||null===(n=i.props)||void 0===n||!n[eD]))}},{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(eD,!0),!0)}},{key:"_sync_opt_out_with_persistence",value:function(){var e,t,i,n,r=this.consent.isOptedOut(),s=this.config.opt_out_persistence_by_default,o=this.config.disable_persistence||r&&!!s;(null===(e=this.persistence)||void 0===e?void 0:e.disabled)!==o&&(null===(i=this.persistence)||void 0===i||i.set_disabled(o)),(null===(t=this.sessionPersistence)||void 0===t?void 0:t.disabled)!==o&&(null===(n=this.sessionPersistence)||void 0===n||n.set_disabled(o))}},{key:"opt_in_capturing",value:function(e){var t;this.consent.optInOut(!0),this._sync_opt_out_with_persistence(),(x(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}),this.config.capture_pageview&&this._captureInitialPageview()}},{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:"_is_bot",value:function(){return M?function(e,t){if(!e)return!1;var i=e.userAgent;if(i&&nW(i,t))return!0;try{var n=null==e?void 0:e.userAgentData;if(null!=n&&n.brands&&n.brands.some(function(e){return nW(null==e?void 0:e.brand,t)}))return!0}catch(e){}return!!e.webdriver}(M,this.config.custom_blocked_useragents):void 0}},{key:"_captureInitialPageview",value:function(){N&&!this._initialPageviewCaptured&&(this._initialPageviewCaptured=!0,this.capture("$pageview",{title:N.title},{send_instantly:!0}))}},{key:"debug",value:function(e){!1===e?(null==F||F.console.log("You've disabled debug mode."),localStorage&&localStorage.removeItem("ph_debug"),this.set_config({debug:!1})):(null==F||F.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 i=0;i<t.length;i++)e.prototype[t[i]]=ei(e.prototype[t[i]])}(rl,["identify"]);var ru,rc,rd=(rc=rt[rn]=new rl,function(){function e(){e.done||(e.done=!0,rr=!1,Q(rt,function(e){e._dom_loaded()}))}null!=N&&N.addEventListener&&("complete"===N.readyState?e():N.addEventListener("DOMContentLoaded",e,!1)),F&&eo(F,"load",e,!0)}(),rc)},53782:function(e,t,i){"use strict";i.d(t,{U0:function(){return a},zf:function(){return o}});var n=i(42477),r=i(2265),s=(0,r.createContext)({client:n.ZP});function o(e){var t=e.children,i=e.client,o=e.apiKey,a=e.options,l=(0,r.useMemo)(function(){return(i&&o&&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."),i&&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."),i)?i:(o&&(n.ZP.__loaded&&console.warn("[PostHog.js] was already loaded elsewhere. This may cause issues."),n.ZP.init(o,a)),n.ZP)},[i,o]);return r.createElement(s.Provider,{value:{client:l}},t)}var a=function(){return(0,r.useContext)(s).client}},70605:function(){},20356:function(e){e.exports={style:{fontFamily:"'__JetBrains_Mono_3c557b', '__JetBrains_Mono_Fallback_3c557b'",fontStyle:"normal"},className:"__className_3c557b",variable:"__variable_3c557b"}},23902:function(e,t,i){"use strict";i.d(t,{L:function(){return r}});var n=i(74075);function r(e,t,i={}){let r=new Map,a=e.getLoadedThemes();for(let i of a){let n=function(e){let t="rules"in e?e.rules:void 0;if(!t)for(let{scope:i,settings:n}of(t=[],e.settings||e.tokenColors))for(let e of Array.isArray(i)?i:[i])n.foreground&&e&&t.push({token:e,foreground:o(n.foreground)});let i=Object.fromEntries(Object.entries(e.colors||{}).map(([e,t])=>[e,`#${o(t)}`]));return{base:"light"===e.type?"vs":"vs-dark",inherit:!1,colors:i,rules:t}}(e.getTheme(i));r.set(i,n),t.editor.defineTheme(i,n)}let l=[],u=new Map,c=t.editor.setTheme.bind(t.editor);t.editor.setTheme=t=>{let i=e.setTheme(t),n=r.get(t);l.length=i.colorMap.length,i.colorMap.forEach((e,t)=>{l[t]=e}),u.clear(),n?.rules.forEach(e=>{let t=o(e.foreground);t&&!u.has(t)&&u.set(t,e.token)}),c(t)},t.editor.setTheme(a[0]);let{tokenizeMaxLineLength:d=2e4,tokenizeTimeLimit:h=500}=i,f=new Set(t.languages.getLanguages().map(e=>e.id));for(let i of e.getLoadedLanguages())f.has(i)&&t.languages.setTokensProvider(i,{getInitialState:()=>new s(n._X),tokenize(t,r){if(t.length>=d)return{endState:r,tokens:[{startIndex:0,scopes:""}]};let a=e.getLanguage(i).tokenizeLine2(t,r.ruleStack,h);a.stoppedEarly&&console.warn(`Time limit reached when tokenizing line: ${t.substring(0,100)}`);let c=a.tokens.length/2,f=[];for(let e=0;e<c;e++){var p;let t=a.tokens[2*e],i=a.tokens[2*e+1],r=(p=o(l[n.E9.getForeground(i)]||""),u.get(p)||"");f.push({startIndex:t,scopes:r})}return{endState:new s(a.ruleStack),tokens:f}}})}class s{constructor(e){this._ruleStack=e}get ruleStack(){return this._ruleStack}clone(){return new s(this._ruleStack)}equals(e){return!!e&&e instanceof s&&e===this&&e._ruleStack===this._ruleStack}}function o(e){return e&&(3===(e=(35===e.charCodeAt(0)?e.slice(1):e).toLowerCase()).length||4===e.length)&&(e=e.split("").map(e=>e+e).join("")),e}},8699:function(e,t,i){"use strict";i.d(t,{S:function(){return _}});var n=i(56298),r=i(2459),s=i(69948),o=i(49010),a=class extends o.l{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,i){let s=t.queryKey,o=t.queryHash??(0,n.Rm)(s,t),a=this.get(o);return a||(a=new r.A({cache:this,queryKey:s,queryHash:o,options:e.defaultQueryOptions(t),state:i,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){s.V.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n._x)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,n._x)(e,t)):t}notify(e){s.V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){s.V.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){s.V.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},l=i(43494),u=i(30924),c=class extends l.F{#t;#i;#n;constructor(e){super(),this.mutationId=e.mutationId,this.#i=e.mutationCache,this.#t=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#i.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||("pending"===this.state.status?this.scheduleGc():this.#i.remove(this))}continue(){return this.#n?.continue()??this.execute(this.state.variables)}async execute(e){this.#n=(0,u.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#r({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#r({type:"pause"})},onContinue:()=>{this.#r({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#i.canRun(this)});let t="pending"===this.state.status,i=!this.#n.canStart();try{if(!t){this.#r({type:"pending",variables:e,isPaused:i}),await this.#i.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#r({type:"pending",context:t,variables:e,isPaused:i})}let n=await this.#n.start();return await this.#i.config.onSuccess?.(n,e,this.state.context,this),await this.options.onSuccess?.(n,e,this.state.context),await this.#i.config.onSettled?.(n,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(n,null,e,this.state.context),this.#r({type:"success",data:n}),n}catch(t){try{throw await this.#i.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#i.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#r({type:"error",error:t})}}finally{this.#i.runNext(this)}}#r(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),s.V.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#i.notify({mutation:this,type:"updated",action:e})})}},d=class extends o.l{constructor(e={}){super(),this.config=e,this.#s=new Map,this.#o=Date.now()}#s;#o;build(e,t,i){let n=new c({mutationCache:this,mutationId:++this.#o,options:e.defaultMutationOptions(t),state:i});return this.add(n),n}add(e){let t=h(e),i=this.#s.get(t)??[];i.push(e),this.#s.set(t,i),this.notify({type:"added",mutation:e})}remove(e){let t=h(e);if(this.#s.has(t)){let i=this.#s.get(t)?.filter(t=>t!==e);i&&(0===i.length?this.#s.delete(t):this.#s.set(t,i))}this.notify({type:"removed",mutation:e})}canRun(e){let t=this.#s.get(h(e))?.find(e=>"pending"===e.state.status);return!t||t===e}runNext(e){let t=this.#s.get(h(e))?.find(t=>t!==e&&t.state.isPaused);return t?.continue()??Promise.resolve()}clear(){s.V.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...this.#s.values()].flat()}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,n.X7)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,n.X7)(e,t))}notify(e){s.V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return s.V.batch(()=>Promise.all(e.map(e=>e.continue().catch(n.ZT))))}};function h(e){return e.options.scope?.id??String(e.mutationId)}var f=i(34939),p=i(49937);function g(e){return{onFetch:(t,i)=>{let r=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[],l={pages:[],pageParams:[]},u=0,c=async()=>{let i=!1,c=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?i=!0:t.signal.addEventListener("abort",()=>{i=!0}),t.signal)})},d=(0,n.cG)(t.options,t.fetchOptions),h=async(e,r,s)=>{if(i)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);let o={queryKey:t.queryKey,pageParam:r,direction:s?"backward":"forward",meta:t.options.meta};c(o);let a=await d(o),{maxPages:l}=t.options,u=s?n.Ht:n.VX;return{pages:u(e.pages,a,l),pageParams:u(e.pageParams,r,l)}};if(s&&o.length){let e="backward"===s,t={pages:o,pageParams:a},i=(e?function(e,{pages:t,pageParams:i}){return t.length>0?e.getPreviousPageParam?.(t[0],t,i[0],i):void 0}:v)(r,t);l=await h(t,i,e)}else{let t=e??o.length;do{let e=0===u?a[0]??r.initialPageParam:v(r,l);if(u>0&&null==e)break;l=await h(l,e),u++}while(u<t)}return l};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},i):t.fetchFn=c}}}function v(e,{pages:t,pageParams:i}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,i[n],i):void 0}var _=class{#a;#i;#l;#u;#c;#d;#h;#f;constructor(e={}){this.#a=e.queryCache||new a,this.#i=e.mutationCache||new d,this.#l=e.defaultOptions||{},this.#u=new Map,this.#c=new Map,this.#d=0}mount(){this.#d++,1===this.#d&&(this.#h=f.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#a.onFocus())}),this.#f=p.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#a.onOnline())}))}unmount(){this.#d--,0===this.#d&&(this.#h?.(),this.#h=void 0,this.#f?.(),this.#f=void 0)}isFetching(e){return this.#a.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#i.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#a.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.getQueryData(e.queryKey);if(void 0===t)return this.fetchQuery(e);{let i=this.defaultQueryOptions(e),r=this.#a.build(this,i);return e.revalidateIfStale&&r.isStaleByTime((0,n.KC)(i.staleTime,r))&&this.prefetchQuery(i),Promise.resolve(t)}}getQueriesData(e){return this.#a.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,i){let r=this.defaultQueryOptions({queryKey:e}),s=this.#a.get(r.queryHash),o=s?.state.data,a=(0,n.SE)(t,o);if(void 0!==a)return this.#a.build(this,r).setData(a,{...i,manual:!0})}setQueriesData(e,t,i){return s.V.batch(()=>this.#a.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,i)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#a.get(t.queryHash)?.state}removeQueries(e){let t=this.#a;s.V.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let i=this.#a,n={type:"active",...e};return s.V.batch(()=>(i.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries(n,t)))}cancelQueries(e={},t={}){let i={revert:!0,...t};return Promise.all(s.V.batch(()=>this.#a.findAll(e).map(e=>e.cancel(i)))).then(n.ZT).catch(n.ZT)}invalidateQueries(e={},t={}){return s.V.batch(()=>{if(this.#a.findAll(e).forEach(e=>{e.invalidate()}),"none"===e.refetchType)return Promise.resolve();let i={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(i,t)})}refetchQueries(e={},t){let i={...t,cancelRefetch:t?.cancelRefetch??!0};return Promise.all(s.V.batch(()=>this.#a.findAll(e).filter(e=>!e.isDisabled()).map(e=>{let t=e.fetch(void 0,i);return i.throwOnError||(t=t.catch(n.ZT)),"paused"===e.state.fetchStatus?Promise.resolve():t}))).then(n.ZT)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let i=this.#a.build(this,t);return i.isStaleByTime((0,n.KC)(t.staleTime,i))?i.fetch(t):Promise.resolve(i.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.ZT).catch(n.ZT)}fetchInfiniteQuery(e){return e.behavior=g(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.ZT).catch(n.ZT)}ensureInfiniteQueryData(e){return e.behavior=g(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return p.N.isOnline()?this.#i.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#a}getMutationCache(){return this.#i}getDefaultOptions(){return this.#l}setDefaultOptions(e){this.#l=e}setQueryDefaults(e,t){this.#u.set((0,n.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#u.values()],i={};return t.forEach(t=>{(0,n.to)(e,t.queryKey)&&(i={...i,...t.defaultOptions})}),i}setMutationDefaults(e,t){this.#c.set((0,n.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#c.values()],i={};return t.forEach(t=>{(0,n.to)(e,t.mutationKey)&&(i={...i,...t.defaultOptions})}),i}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#l.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.Rm)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),!0!==t.enabled&&t.queryFn===n.CN&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#l.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#a.clear(),this.#i.clear()}}},33203:function(e,t,i){"use strict";function n(e){let t,i,n,s,o,a,l;return u(),{feed:function(u){var c;i=i?i+u:u,t&&(c=i,r.every((e,t)=>c.charCodeAt(t)===e))&&(i=i.slice(r.length)),t=!1;let d=i.length,h=0,f=!1;for(;h<d;){let t;f&&("\n"===i[h]&&++h,f=!1);let r=-1,u=s;for(let e=n;r<0&&e<d;++e)":"===(t=i[e])&&u<0?u=e-h:"\r"===t?(f=!0,r=e-h):"\n"===t&&(r=e-h);if(r<0){n=d-h,s=u;break}n=0,s=-1,function(t,i,n,r){if(0===r){l.length>0&&(e({type:"event",id:o,event:a||void 0,data:l.slice(0,-1)}),l="",o=void 0),a=void 0;return}let s=n<0,u=t.slice(i,i+(s?r:n)),c=0;c=s?r:" "===t[i+n+1]?n+2:n+1;let d=i+c,h=r-c,f=t.slice(d,d+h).toString();if("data"===u)l+=f?"".concat(f,"\n"):"\n";else if("event"===u)a=f;else if("id"!==u||f.includes("\0")){if("retry"===u){let t=parseInt(f,10);Number.isNaN(t)||e({type:"reconnect-interval",value:t})}}else o=f}(i,h,u,r),h+=r+1}h===d?i="":h>0&&(i=i.slice(h))},reset:u};function u(){t=!0,i="",n=0,s=-1,o=void 0,a=void 0,l=""}}i.d(t,{j:function(){return n}});let r=[239,187,191]},56179:function(e,t,i){"use strict";i.d(t,{W:function(){return r}});var n=i(2265);function r(e,t,i){(0,n.useInsertionEffect)(()=>e.on(t,i),[e,t,i])}},49754:function(e,t,i){"use strict";let n,r;i.d(t,{v:function(){return $}});var s=i(20804),o=i(30458),a=i(2265),l=i(19047);let u=new WeakMap;function c({target:e,contentRect:t,borderBoxSize:i}){var n;null===(n=u.get(e))||void 0===n||n.forEach(n=>{n({target:e,contentSize:t,get size(){return function(e,t){if(t){let{inlineSize:e,blockSize:i}=t[0];return{width:e,height:i}}return e instanceof SVGElement&&"getBBox"in e?e.getBBox():{width:e.offsetWidth,height:e.offsetHeight}}(e,i)}})})}function d(e){e.forEach(c)}let h=new Set;var f=i(33217),p=i(83476);let g=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),v=()=>({time:0,x:g(),y:g()}),_={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function m(e,t,i,n){let r=i[t],{length:s,position:o}=_[t],a=r.current,l=i.time;r.current=e[`scroll${o}`],r.scrollLength=e[`scroll${s}`]-e[`client${s}`],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=(0,f.Y)(0,r.scrollLength,r.current);let u=n-l;r.velocity=u>50?0:(0,p.R)(r.current-a,u)}let y=[[0,0],[1,1]],b={start:0,center:.5,end:1};function k(e,t,i=0){let n=0;if(e in b&&(e=b[e]),"string"==typeof e){let t=parseFloat(e);e.endsWith("px")?n=t:e.endsWith("%")?e=t/100:e.endsWith("vw")?n=t/100*document.documentElement.clientWidth:e.endsWith("vh")?n=t/100*document.documentElement.clientHeight:e=t}return"number"==typeof e&&(n=t*e),i+n}let w=[0,0];var S=i(42548),x=i(40839);let E={x:0,y:0};var R=i(86219);let P=new WeakMap,O=new WeakMap,C=new WeakMap,I=e=>e===document.documentElement?window:e;var F=i(9033);function L(e,t){(0,l.K)(!!(!t||t.current),`You have defined a ${e} options but the provided ref is not yet hydrated, probably because it's defined higher up the tree. Try calling useScroll() in the same component as the ref, or setting its \`layoutEffect: false\` option.`)}let T=()=>({scrollX:(0,s.BX)(0),scrollY:(0,s.BX)(0),scrollXProgress:(0,s.BX)(0),scrollYProgress:(0,s.BX)(0)});function $({container:e,target:t,layoutEffect:i=!0,...s}={}){let l=(0,o.h)(T);return(i?F.L:a.useEffect)(()=>(L("target",t),L("container",e),function(e,{container:t=document.documentElement,...i}={}){let s=C.get(t);s||(s=new Set,C.set(t,s));let o=function(e,t,i,n={}){return{measure:()=>(function(e,t=e,i){if(i.x.targetOffset=0,i.y.targetOffset=0,t!==e){let n=t;for(;n&&n!==e;)i.x.targetOffset+=n.offsetLeft,i.y.targetOffset+=n.offsetTop,n=n.offsetParent}i.x.targetLength=t===e?t.scrollWidth:t.clientWidth,i.y.targetLength=t===e?t.scrollHeight:t.clientHeight,i.x.containerLength=e.clientWidth,i.y.containerLength=e.clientHeight})(e,n.target,i),update:t=>{m(e,"x",i,t),m(e,"y",i,t),i.time=t,(n.offset||n.target)&&function(e,t,i){let{offset:n=y}=i,{target:r=e,axis:s="y"}=i,o="y"===s?"height":"width",a=r!==e?function(e,t){let i={x:0,y:0},n=e;for(;n&&n!==t;)if(n instanceof HTMLElement)i.x+=n.offsetLeft,i.y+=n.offsetTop,n=n.offsetParent;else if("svg"===n.tagName){let e=n.getBoundingClientRect(),t=(n=n.parentElement).getBoundingClientRect();i.x+=e.left-t.left,i.y+=e.top-t.top}else if(n instanceof SVGGraphicsElement){let{x:e,y:t}=n.getBBox();i.x+=e,i.y+=t;let r=null,s=n.parentNode;for(;!r;)"svg"===s.tagName&&(r=s),s=n.parentNode;n=r}else break;return i}(r,e):E,l=r===e?{width:e.scrollWidth,height:e.scrollHeight}:"getBBox"in r&&"svg"!==r.tagName?r.getBBox():{width:r.clientWidth,height:r.clientHeight},u={width:e.clientWidth,height:e.clientHeight};t[s].offset.length=0;let c=!t[s].interpolate,d=n.length;for(let e=0;e<d;e++){let i=function(e,t,i,n){let r=Array.isArray(e)?e:w,s=0;return"number"==typeof e?r=[e,e]:"string"==typeof e&&(r=(e=e.trim()).includes(" ")?e.split(" "):[e,b[e]?e:"0"]),k(r[0],i,n)-k(r[1],t)}(n[e],u[o],l[o],a[s]);c||i===t[s].interpolatorOffsets[e]||(c=!0),t[s].offset[e]=i}c&&(t[s].interpolate=(0,S.s)(t[s].offset,(0,x.Y)(n)),t[s].interpolatorOffsets=[...t[s].offset]),t[s].progress=t[s].interpolate(t[s].current)}(e,i,n)},notify:()=>t(i)}}(t,e,v(),i);if(s.add(o),!P.has(t)){let e=()=>{for(let e of s)e.measure()},i=()=>{for(let e of s)e.update(R.frameData.timestamp)},o=()=>{for(let e of s)e.notify()},a=()=>{R.Wi.read(e,!1,!0),R.Wi.read(i,!1,!0),R.Wi.update(o,!1,!0)};P.set(t,a);let l=I(t);window.addEventListener("resize",a,{passive:!0}),t!==document.documentElement&&O.set(t,"function"==typeof t?(h.add(t),r||(r=()=>{let e={width:window.innerWidth,height:window.innerHeight},t={target:window,size:e,contentSize:e};h.forEach(e=>e(t))},window.addEventListener("resize",r)),()=>{h.delete(t),!h.size&&r&&(r=void 0)}):function(e,t){var i;n||"undefined"==typeof ResizeObserver||(n=new ResizeObserver(d));let r=("string"==typeof(i=e)?i=document.querySelectorAll(i):i instanceof Element&&(i=[i]),Array.from(i||[]));return r.forEach(e=>{let i=u.get(e);i||(i=new Set,u.set(e,i)),i.add(t),null==n||n.observe(e)}),()=>{r.forEach(e=>{let i=u.get(e);null==i||i.delete(t),(null==i?void 0:i.size)||null==n||n.unobserve(e)})}}(t,a)),l.addEventListener("scroll",a,{passive:!0})}let a=P.get(t);return R.Wi.read(a,!1,!0),()=>{var e;(0,R.Pn)(a);let i=C.get(t);if(!i||(i.delete(o),i.size))return;let n=P.get(t);P.delete(t),n&&(I(t).removeEventListener("scroll",n),null===(e=O.get(t))||void 0===e||e(),window.removeEventListener("resize",n))}}(({x:e,y:t})=>{l.scrollX.set(e.current),l.scrollXProgress.set(e.progress),l.scrollY.set(t.current),l.scrollYProgress.set(t.progress)},{...s,container:(null==e?void 0:e.current)||void 0,target:(null==t?void 0:t.current)||void 0})),[e,t,JSON.stringify(s.offset)]),l}},46027:function(e,t,i){"use strict";i.d(t,{ZP:function(){return ee}});let n={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class r{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||n,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"log","",!0)}warn(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"warn","",!0)}error(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"error","")}deprecate(){for(var e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(e,t,i,n){return n&&!this.debug?null:("string"==typeof e[0]&&(e[0]=`${i}${this.prefix} ${e[0]}`),this.logger[t](e))}create(e){return new r(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return(e=e||this.options).prefix=e.prefix||this.prefix,new r(this.logger,e)}}var s=new r;class o{constructor(){this.observers={}}on(e,t){return e.split(" ").forEach(e=>{this.observers[e]||(this.observers[e]=new Map);let i=this.observers[e].get(t)||0;this.observers[e].set(t,i+1)}),this}off(e,t){if(this.observers[e]){if(!t){delete this.observers[e];return}this.observers[e].delete(t)}}emit(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(e=>{let[t,n]=e;for(let e=0;e<n;e++)t(...i)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(t=>{let[n,r]=t;for(let t=0;t<r;t++)n.apply(n,[e,...i])})}}let a=()=>{let e,t;let i=new Promise((i,n)=>{e=i,t=n});return i.resolve=e,i.reject=t,i},l=e=>null==e?"":""+e,u=(e,t,i)=>{e.forEach(e=>{t[e]&&(i[e]=t[e])})},c=/###/g,d=e=>e&&e.indexOf("###")>-1?e.replace(c,"."):e,h=e=>!e||"string"==typeof e,f=(e,t,i)=>{let n="string"!=typeof t?t:t.split("."),r=0;for(;r<n.length-1;){if(h(e))return{};let t=d(n[r]);!e[t]&&i&&(e[t]=new i),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{},++r}return h(e)?{}:{obj:e,k:d(n[r])}},p=(e,t,i)=>{let{obj:n,k:r}=f(e,t,Object);if(void 0!==n||1===t.length){n[r]=i;return}let s=t[t.length-1],o=t.slice(0,t.length-1),a=f(e,o,Object);for(;void 0===a.obj&&o.length;)s=`${o[o.length-1]}.${s}`,(a=f(e,o=o.slice(0,o.length-1),Object))&&a.obj&&void 0!==a.obj[`${a.k}.${s}`]&&(a.obj=void 0);a.obj[`${a.k}.${s}`]=i},g=(e,t,i,n)=>{let{obj:r,k:s}=f(e,t,Object);r[s]=r[s]||[],r[s].push(i)},v=(e,t)=>{let{obj:i,k:n}=f(e,t);if(i)return i[n]},_=(e,t,i)=>{let n=v(e,i);return void 0!==n?n:v(t,i)},m=(e,t,i)=>{for(let n in t)"__proto__"!==n&&"constructor"!==n&&(n in e?"string"==typeof e[n]||e[n]instanceof String||"string"==typeof t[n]||t[n]instanceof String?i&&(e[n]=t[n]):m(e[n],t[n],i):e[n]=t[n]);return e},y=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var b={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};let k=e=>"string"==typeof e?e.replace(/[&<>"'\/]/g,e=>b[e]):e;class w{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){let t=this.regExpMap.get(e);if(void 0!==t)return t;let i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}}let S=[" ",",","?","!",";"],x=new w(20),E=(e,t,i)=>{t=t||"",i=i||"";let n=S.filter(e=>0>t.indexOf(e)&&0>i.indexOf(e));if(0===n.length)return!0;let r=x.getRegExp(`(${n.map(e=>"?"===e?"\\?":e).join("|")})`),s=!r.test(e);if(!s){let t=e.indexOf(i);t>0&&!r.test(e.substring(0,t))&&(s=!0)}return s},R=function(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];let n=t.split(i),r=e;for(let e=0;e<n.length;){let t;if(!r||"object"!=typeof r)return;let s="";for(let o=e;o<n.length;++o)if(o!==e&&(s+=i),s+=n[o],void 0!==(t=r[s])){if(["string","number","boolean"].indexOf(typeof t)>-1&&o<n.length-1)continue;e+=o-e+1;break}r=t}return r},P=e=>e&&e.indexOf("_")>0?e.replace("_","-"):e;class O extends o{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}removeNamespaces(e){let t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,i){let n,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},s=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;e.indexOf(".")>-1?n=e.split("."):(n=[e,t],i&&(Array.isArray(i)?n.push(...i):"string"==typeof i&&s?n.push(...i.split(s)):n.push(i)));let a=v(this.data,n);return(!a&&!t&&!i&&e.indexOf(".")>-1&&(e=n[0],t=n[1],i=n.slice(2).join(".")),a||!o||"string"!=typeof i)?a:R(this.data&&this.data[e]&&this.data[e][t],i,s)}addResource(e,t,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},s=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=[e,t];i&&(o=o.concat(s?i.split(s):i)),e.indexOf(".")>-1&&(o=e.split("."),n=t,t=o[1]),this.addNamespaces(t),p(this.data,o,n),r.silent||this.emit("added",e,t,i,n)}addResources(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(let n in i)("string"==typeof i[n]||Array.isArray(i[n]))&&this.addResource(e,t,n,i[n],{silent:!0});n.silent||this.emit("added",e,t,i)}addResourceBundle(e,t,i,n,r){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1,skipCopy:!1},o=[e,t];e.indexOf(".")>-1&&(o=e.split("."),n=i,i=t,t=o[1]),this.addNamespaces(t);let a=v(this.data,o)||{};s.skipCopy||(i=JSON.parse(JSON.stringify(i))),n?m(a,i,r):a={...a,...i},p(this.data,o,a),s.silent||this.emit("added",e,t,i)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return(t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){let t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find(e=>t[e]&&Object.keys(t[e]).length>0)}toJSON(){return this.data}}var C={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,i,n,r){return e.forEach(e=>{this.processors[e]&&(t=this.processors[e].process(t,i,n,r))}),t}};let I={};class F extends o{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),u(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=s.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;let i=this.resolve(e,t);return i&&void 0!==i.res}extractFromKey(e,t){let i=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===i&&(i=":");let n=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,r=t.ns||this.options.defaultNS||[],s=i&&e.indexOf(i)>-1,o=!this.options.userDefinedKeySeparator&&!t.keySeparator&&!this.options.userDefinedNsSeparator&&!t.nsSeparator&&!E(e,i,n);if(s&&!o){let t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:r};let s=e.split(i);(i!==n||i===n&&this.options.ns.indexOf(s[0])>-1)&&(r=s.shift()),e=s.join(n)}return"string"==typeof r&&(r=[r]),{key:e,namespaces:r}}translate(e,t,i){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);let n=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:s,namespaces:o}=this.extractFromKey(e[e.length-1],t),a=o[o.length-1],l=t.lng||this.language,u=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&"cimode"===l.toLowerCase()){if(u){let e=t.nsSeparator||this.options.nsSeparator;return n?{res:`${a}${e}${s}`,usedKey:s,exactUsedKey:s,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:`${a}${e}${s}`}return n?{res:s,usedKey:s,exactUsedKey:s,usedLng:l,usedNS:a,usedParams:this.getUsedParamsDetails(t)}:s}let c=this.resolve(e,t),d=c&&c.res,h=c&&c.usedKey||s,f=c&&c.exactUsedKey||s,p=Object.prototype.toString.apply(d),g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject,_="string"!=typeof d&&"boolean"!=typeof d&&"number"!=typeof d;if(v&&d&&_&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(p)&&!("string"==typeof g&&Array.isArray(d))){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");let e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(h,d,{...t,ns:o}):`key '${s} (${this.language})' returned an object instead of string.`;return n?(c.res=e,c.usedParams=this.getUsedParamsDetails(t),c):e}if(r){let e=Array.isArray(d),i=e?[]:{},n=e?f:h;for(let e in d)if(Object.prototype.hasOwnProperty.call(d,e)){let s=`${n}${r}${e}`;i[e]=this.translate(s,{...t,joinArrays:!1,ns:o}),i[e]===s&&(i[e]=d[e])}d=i}}else if(v&&"string"==typeof g&&Array.isArray(d))(d=d.join(g))&&(d=this.extendTranslation(d,e,t,i));else{let n=!1,o=!1,u=void 0!==t.count&&"string"!=typeof t.count,h=F.hasDefaultValue(t),f=u?this.pluralResolver.getSuffix(l,t.count,t):"",p=t.ordinal&&u?this.pluralResolver.getSuffix(l,t.count,{ordinal:!1}):"",g=u&&!t.ordinal&&0===t.count&&this.pluralResolver.shouldUseIntlApi(),v=g&&t[`defaultValue${this.options.pluralSeparator}zero`]||t[`defaultValue${f}`]||t[`defaultValue${p}`]||t.defaultValue;!this.isValidLookup(d)&&h&&(n=!0,d=v),this.isValidLookup(d)||(o=!0,d=s);let _=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&o?void 0:d,m=h&&v!==d&&this.options.updateMissing;if(o||n||m){if(this.logger.log(m?"updateKey":"missingKey",l,a,s,m?v:d),r){let e=this.resolve(s,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[],i=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&i&&i[0])for(let t=0;t<i.length;t++)e.push(i[t]);else"all"===this.options.saveMissingTo?e=this.languageUtils.toResolveHierarchy(t.lng||this.language):e.push(t.lng||this.language);let n=(e,i,n)=>{let r=h&&n!==d?n:_;this.options.missingKeyHandler?this.options.missingKeyHandler(e,a,i,r,m,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,a,i,r,m,t),this.emit("missingKey",e,a,i,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&u?e.forEach(e=>{let i=this.pluralResolver.getSuffixes(e,t);g&&t[`defaultValue${this.options.pluralSeparator}zero`]&&0>i.indexOf(`${this.options.pluralSeparator}zero`)&&i.push(`${this.options.pluralSeparator}zero`),i.forEach(i=>{n([e],s+i,t[`defaultValue${i}`]||v)})}):n(e,s,v))}d=this.extendTranslation(d,e,t,c,i),o&&d===s&&this.options.appendNamespaceToMissingKey&&(d=`${a}:${s}`),(o||n)&&this.options.parseMissingKeyHandler&&(d="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${a}:${s}`:s,n?d:void 0):this.options.parseMissingKeyHandler(d))}return n?(c.res=d,c.usedParams=this.getUsedParamsDetails(t),c):d}extendTranslation(e,t,i,n,r){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!i.skipInterpolation){let o;i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});let a="string"==typeof e&&(i&&i.interpolation&&void 0!==i.interpolation.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(a){let t=e.match(this.interpolator.nestingRegexp);o=t&&t.length}let l=i.replace&&"string"!=typeof i.replace?i.replace:i;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,i.lng||this.language||n.usedLng,i),a){let t=e.match(this.interpolator.nestingRegexp);o<(t&&t.length)&&(i.nest=!1)}!i.lng&&"v1"!==this.options.compatibilityAPI&&n&&n.res&&(i.lng=this.language||n.usedLng),!1!==i.nest&&(e=this.interpolator.nest(e,function(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];return r&&r[0]===n[0]&&!i.context?(s.logger.warn(`It seems you are nesting recursively key: ${n[0]} in key: ${t[0]}`),null):s.translate(...n,t)},i)),i.interpolation&&this.interpolator.reset()}let o=i.postProcess||this.options.postProcess,a="string"==typeof o?[o]:o;return null!=e&&a&&a.length&&!1!==i.applyPostProcessor&&(e=C.handle(a,e,t,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),e}resolve(e){let t,i,n,r,s,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach(e=>{if(this.isValidLookup(t))return;let a=this.extractFromKey(e,o),l=a.key;i=l;let u=a.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));let c=void 0!==o.count&&"string"!=typeof o.count,d=c&&!o.ordinal&&0===o.count&&this.pluralResolver.shouldUseIntlApi(),h=void 0!==o.context&&("string"==typeof o.context||"number"==typeof o.context)&&""!==o.context,f=o.lngs?o.lngs:this.languageUtils.toResolveHierarchy(o.lng||this.language,o.fallbackLng);u.forEach(e=>{this.isValidLookup(t)||(s=e,!I[`${f[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(I[`${f[0]}-${e}`]=!0,this.logger.warn(`key "${i}" for languages "${f.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach(i=>{let s;if(this.isValidLookup(t))return;r=i;let a=[l];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,i,e,o);else{let e;c&&(e=this.pluralResolver.getSuffix(i,o.count,o));let t=`${this.options.pluralSeparator}zero`,n=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(a.push(l+e),o.ordinal&&0===e.indexOf(n)&&a.push(l+e.replace(n,this.options.pluralSeparator)),d&&a.push(l+t)),h){let i=`${l}${this.options.contextSeparator}${o.context}`;a.push(i),c&&(a.push(i+e),o.ordinal&&0===e.indexOf(n)&&a.push(i+e.replace(n,this.options.pluralSeparator)),d&&a.push(i+t))}}for(;s=a.pop();)this.isValidLookup(t)||(n=s,t=this.getResource(i,e,s,o))}))})}),{res:t,usedKey:i,exactUsedKey:n,usedLng:r,usedNS:s}}isValidLookup(e){return void 0!==e&&!(!this.options.returnNull&&null===e)&&!(!this.options.returnEmptyString&&""===e)}getResource(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,i,n):this.resourceStore.getResource(e,t,i,n)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.replace&&"string"!=typeof e.replace,i=t?e.replace:e;if(t&&void 0!==e.count&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!t)for(let e of(i={...i},["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"]))delete i[e];return i}static hasDefaultValue(e){let t="defaultValue";for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&t===i.substring(0,t.length)&&void 0!==e[i])return!0;return!1}}let L=e=>e.charAt(0).toUpperCase()+e.slice(1);class T{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=s.create("languageUtils")}getScriptPartFromCode(e){if(!(e=P(e))||0>e.indexOf("-"))return null;let t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase())?null:this.formatLanguageCode(t.join("-"))}getLanguagePartFromCode(e){if(!(e=P(e))||0>e.indexOf("-"))return e;let t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if("string"==typeof e&&e.indexOf("-")>-1){let t=["hans","hant","latn","cyrl","cans","mong","arab"],i=e.split("-");return this.options.lowerCaseLng?i=i.map(e=>e.toLowerCase()):2===i.length?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=L(i[1].toLowerCase()))):3===i.length&&(i[0]=i[0].toLowerCase(),2===i[1].length&&(i[1]=i[1].toUpperCase()),"sgn"!==i[0]&&2===i[2].length&&(i[2]=i[2].toUpperCase()),t.indexOf(i[1].toLowerCase())>-1&&(i[1]=L(i[1].toLowerCase())),t.indexOf(i[2].toLowerCase())>-1&&(i[2]=L(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){let t;return e?(e.forEach(e=>{if(t)return;let i=this.formatLanguageCode(e);(!this.options.supportedLngs||this.isSupportedCode(i))&&(t=i)}),!t&&this.options.supportedLngs&&e.forEach(e=>{if(t)return;let i=this.getLanguagePartFromCode(e);if(this.isSupportedCode(i))return t=i;t=this.options.supportedLngs.find(e=>{if(e===i||!(0>e.indexOf("-")&&0>i.indexOf("-"))&&(e.indexOf("-")>0&&0>i.indexOf("-")&&e.substring(0,e.indexOf("-"))===i||0===e.indexOf(i)&&i.length>1))return e})}),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),Array.isArray(e))return e;if(!t)return e.default||[];let i=e[t];return i||(i=e[this.getScriptPartFromCode(t)]),i||(i=e[this.formatLanguageCode(t)]),i||(i=e[this.getLanguagePartFromCode(t)]),i||(i=e.default),i||[]}toResolveHierarchy(e,t){let i=this.getFallbackCodes(t||this.options.fallbackLng||[],e),n=[],r=e=>{e&&(this.isSupportedCode(e)?n.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return"string"==typeof e&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&r(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&r(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&r(this.getLanguagePartFromCode(e))):"string"==typeof e&&r(this.formatLanguageCode(e)),i.forEach(e=>{0>n.indexOf(e)&&r(this.formatLanguageCode(e))}),n}}let $=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],A={1:e=>Number(e>1),2:e=>Number(1!=e),3:e=>0,4:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),5:e=>Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5),6:e=>Number(1==e?0:e>=2&&e<=4?1:2),7:e=>Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2),8:e=>Number(1==e?0:2==e?1:8!=e&&11!=e?2:3),9:e=>Number(e>=2),10:e=>Number(1==e?0:2==e?1:e<7?2:e<11?3:4),11:e=>Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3),12:e=>Number(e%10!=1||e%100==11),13:e=>Number(0!==e),14:e=>Number(1==e?0:2==e?1:3==e?2:3),15:e=>Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2),16:e=>Number(e%10==1&&e%100!=11?0:0!==e?1:2),17:e=>Number(1==e||e%10==1&&e%100!=11?0:1),18:e=>Number(0==e?0:1==e?1:2),19:e=>Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3),20:e=>Number(1==e?0:0==e||e%100>0&&e%100<20?1:2),21:e=>Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0),22:e=>Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)},M=["v1","v2","v3"],N=["v4"],D={zero:0,one:1,two:2,few:3,many:4,other:5},q=()=>{let e={};return $.forEach(t=>{t.lngs.forEach(i=>{e[i]={numbers:t.nr,plurals:A[t.fc]}})}),e};class j{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=s.create("pluralResolver"),(!this.options.compatibilityJSON||N.includes(this.options.compatibilityJSON))&&("undefined"==typeof Intl||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=q(),this.pluralRulesCache={}}addRule(e,t){this.rules[e]=t}clearCache(){this.pluralRulesCache={}}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{let i=P("dev"===e?"en":e),n=t.ordinal?"ordinal":"cardinal",r=JSON.stringify({cleanedCode:i,type:n});if(r in this.pluralRulesCache)return this.pluralRulesCache[r];let s=new Intl.PluralRules(i,{type:n});return this.pluralRulesCache[r]=s,s}catch(e){return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.getRule(e,t);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}getPluralFormsOfKey(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,i).map(e=>`${t}${e}`)}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.getRule(e,t);return i?this.shouldUseIntlApi()?i.resolvedOptions().pluralCategories.sort((e,t)=>D[e]-D[t]).map(e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`):i.numbers.map(i=>this.getSuffix(e,i,t)):[]}getSuffix(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this.getRule(e,i);return n?this.shouldUseIntlApi()?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${n.select(t)}`:this.getSuffixRetroCompatible(n,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){let i=e.noAbs?e.plurals(t):e.plurals(Math.abs(t)),n=e.numbers[i];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===n?n="plural":1===n&&(n=""));let r=()=>this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString();return"v1"===this.options.compatibilityJSON?1===n?"":"number"==typeof n?`_plural_${n.toString()}`:r():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?r():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}shouldUseIntlApi(){return!M.includes(this.options.compatibilityJSON)}}let H=function(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",r=!(arguments.length>4)||void 0===arguments[4]||arguments[4],s=_(e,t,i);return!s&&r&&"string"==typeof i&&void 0===(s=R(e,i,n))&&(s=R(t,i,n)),s},B=e=>e.replace(/\$/g,"$$$$");class U{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=s.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});let{escape:t,escapeValue:i,useRawValueToEscape:n,prefix:r,prefixEscaped:s,suffix:o,suffixEscaped:a,formatSeparator:l,unescapeSuffix:u,unescapePrefix:c,nestingPrefix:d,nestingPrefixEscaped:h,nestingSuffix:f,nestingSuffixEscaped:p,nestingOptionsSeparator:g,maxReplaces:v,alwaysFormat:_}=e.interpolation;this.escape=void 0!==t?t:k,this.escapeValue=void 0===i||i,this.useRawValueToEscape=void 0!==n&&n,this.prefix=r?y(r):s||"{{",this.suffix=o?y(o):a||"}}",this.formatSeparator=l||",",this.unescapePrefix=u?"":c||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=d?y(d):h||y("$t("),this.nestingSuffix=f?y(f):p||y(")"),this.nestingOptionsSeparator=g||",",this.maxReplaces=v||1e3,this.alwaysFormat=void 0!==_&&_,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){let e=(e,t)=>e&&e.source===t?(e.lastIndex=0,e):RegExp(t,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,t,i,n){let r,s,o;let a=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=e=>{if(0>e.indexOf(this.formatSeparator)){let r=H(t,a,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(r,void 0,i,{...n,...t,interpolationkey:e}):r}let r=e.split(this.formatSeparator),s=r.shift().trim(),o=r.join(this.formatSeparator).trim();return this.format(H(t,a,s,this.options.keySeparator,this.options.ignoreJSONStructure),o,i,{...n,...t,interpolationkey:s})};this.resetRegExp();let c=n&&n.missingInterpolationHandler||this.options.missingInterpolationHandler,d=n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>B(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?B(this.escape(e)):B(e)}].forEach(t=>{for(o=0;r=t.regex.exec(e);){let i=r[1].trim();if(void 0===(s=u(i))){if("function"==typeof c){let t=c(e,r,n);s="string"==typeof t?t:""}else if(n&&Object.prototype.hasOwnProperty.call(n,i))s="";else if(d){s=r[0];continue}else this.logger.warn(`missed to pass in variable ${i} for interpolating ${e}`),s=""}else"string"==typeof s||this.useRawValueToEscape||(s=l(s));let a=t.safeValue(s);if(e=e.replace(r[0],a),d?(t.regex.lastIndex+=s.length,t.regex.lastIndex-=r[0].length):t.regex.lastIndex=0,++o>=this.maxReplaces)break}}),e}nest(e,t){let i,n,r,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=(e,t)=>{let i=this.nestingOptionsSeparator;if(0>e.indexOf(i))return e;let n=e.split(RegExp(`${i}[ ]*{`)),s=`{${n[1]}`;e=n[0];let o=(s=this.interpolate(s,r)).match(/'/g),a=s.match(/"/g);(o&&o.length%2==0&&!a||a.length%2!=0)&&(s=s.replace(/'/g,'"'));try{r=JSON.parse(s),t&&(r={...t,...r})}catch(t){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,t),`${e}${i}${s}`}return r.defaultValue&&r.defaultValue.indexOf(this.prefix)>-1&&delete r.defaultValue,e};for(;i=this.nestingRegexp.exec(e);){let a=[];(r=(r={...s}).replace&&"string"!=typeof r.replace?r.replace:r).applyPostProcessor=!1,delete r.defaultValue;let u=!1;if(-1!==i[0].indexOf(this.formatSeparator)&&!/{.*}/.test(i[1])){let e=i[1].split(this.formatSeparator).map(e=>e.trim());i[1]=e.shift(),a=e,u=!0}if((n=t(o.call(this,i[1].trim(),r),r))&&i[0]===e&&"string"!=typeof n)return n;"string"!=typeof n&&(n=l(n)),n||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),n=""),u&&(n=a.reduce((e,t)=>this.format(e,t,s.lng,{...s,interpolationkey:i[1].trim()}),n.trim())),e=e.replace(i[0],n),this.regexp.lastIndex=0}return e}}let V=e=>{let t=e.toLowerCase().trim(),i={};if(e.indexOf("(")>-1){let n=e.split("(");t=n[0].toLowerCase().trim();let r=n[1].substring(0,n[1].length-1);"currency"===t&&0>r.indexOf(":")?i.currency||(i.currency=r.trim()):"relativetime"===t&&0>r.indexOf(":")?i.range||(i.range=r.trim()):r.split(";").forEach(e=>{if(e){let[t,...n]=e.split(":"),r=n.join(":").trim().replace(/^'+|'+$/g,""),s=t.trim();i[s]||(i[s]=r),"false"===r&&(i[s]=!1),"true"===r&&(i[s]=!0),isNaN(r)||(i[s]=parseInt(r,10))}})}return{formatName:t,formatOptions:i}},z=e=>{let t={};return(i,n,r)=>{let s=r;r&&r.interpolationkey&&r.formatParams&&r.formatParams[r.interpolationkey]&&r[r.interpolationkey]&&(s={...s,[r.interpolationkey]:void 0});let o=n+JSON.stringify(s),a=t[o];return a||(a=e(P(n),r),t[o]=a),a(i)}};class W{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=s.create("formatter"),this.options=e,this.formats={number:z((e,t)=>{let i=new Intl.NumberFormat(e,{...t});return e=>i.format(e)}),currency:z((e,t)=>{let i=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>i.format(e)}),datetime:z((e,t)=>{let i=new Intl.DateTimeFormat(e,{...t});return e=>i.format(e)}),relativetime:z((e,t)=>{let i=new Intl.RelativeTimeFormat(e,{...t});return e=>i.format(e,t.range||"day")}),list:z((e,t)=>{let i=new Intl.ListFormat(e,{...t});return e=>i.format(e)})},this.init(e)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},i=t.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=z(t)}format(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=t.split(this.formatSeparator);if(r.length>1&&r[0].indexOf("(")>1&&0>r[0].indexOf(")")&&r.find(e=>e.indexOf(")")>-1)){let e=r.findIndex(e=>e.indexOf(")")>-1);r[0]=[r[0],...r.splice(1,e)].join(this.formatSeparator)}return r.reduce((e,t)=>{let{formatName:r,formatOptions:s}=V(t);if(this.formats[r]){let t=e;try{let o=n&&n.formatParams&&n.formatParams[n.interpolationkey]||{},a=o.locale||o.lng||n.locale||n.lng||i;t=this.formats[r](e,a,{...s,...n,...o})}catch(e){this.logger.warn(e)}return t}return this.logger.warn(`there was no format function for ${r}`),e},e)}}let G=(e,t)=>{void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)};class K extends o{constructor(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=i,this.languageUtils=i.languageUtils,this.options=n,this.logger=s.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(i,n.backend,n)}queueLoad(e,t,i,n){let r={},s={},o={},a={};return e.forEach(e=>{let n=!0;t.forEach(t=>{let o=`${e}|${t}`;!i.reload&&this.store.hasResourceBundle(e,t)?this.state[o]=2:this.state[o]<0||(1===this.state[o]?void 0===s[o]&&(s[o]=!0):(this.state[o]=1,n=!1,void 0===s[o]&&(s[o]=!0),void 0===r[o]&&(r[o]=!0),void 0===a[t]&&(a[t]=!0)))}),n||(o[e]=!0)}),(Object.keys(r).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(r),pending:Object.keys(s),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(a)}}loaded(e,t,i){let n=e.split("|"),r=n[0],s=n[1];t&&this.emit("failedLoading",r,s,t),!t&&i&&this.store.addResourceBundle(r,s,i,void 0,void 0,{skipCopy:!0}),this.state[e]=t?-1:2,t&&i&&(this.state[e]=0);let o={};this.queue.forEach(i=>{g(i.loaded,[r],s),G(i,e),t&&i.errors.push(t),0!==i.pendingCount||i.done||(Object.keys(i.loaded).forEach(e=>{o[e]||(o[e]={});let t=i.loaded[e];t.length&&t.forEach(t=>{void 0===o[e][t]&&(o[e][t]=!0)})}),i.done=!0,i.errors.length?i.callback(i.errors):i.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(e=>!e.done)}read(e,t,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;if(!e.length)return s(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:t,fcName:i,tried:n,wait:r,callback:s});return}this.readingCalls++;let o=(o,a)=>{if(this.readingCalls--,this.waitingReads.length>0){let e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}if(o&&a&&n<this.maxRetries){setTimeout(()=>{this.read.call(this,e,t,i,n+1,2*r,s)},r);return}s(o,a)},a=this.backend[i].bind(this.backend);if(2===a.length){try{let i=a(e,t);i&&"function"==typeof i.then?i.then(e=>o(null,e)).catch(o):o(null,i)}catch(e){o(e)}return}return a(e,t,o)}prepareLoading(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);let r=this.queueLoad(e,t,i,n);if(!r.toLoad.length)return r.pending.length||n(),null;r.toLoad.forEach(e=>{this.loadOne(e)})}load(e,t,i){this.prepareLoading(e,t,{},i)}reload(e,t,i){this.prepareLoading(e,t,{reload:!0},i)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=e.split("|"),n=i[0],r=i[1];this.read(n,r,"read",void 0,void 0,(i,s)=>{i&&this.logger.warn(`${t}loading namespace ${r} for language ${n} failed`,i),!i&&s&&this.logger.log(`${t}loaded namespace ${r} for language ${n}`,s),this.loaded(e,i,s)})}saveMissing(e,t,i,n,r){let s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)){this.logger.warn(`did not save key "${i}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(null!=i&&""!==i){if(this.backend&&this.backend.create){let a={...s,isUpdate:r},l=this.backend.create.bind(this.backend);if(l.length<6)try{let r;(r=5===l.length?l(e,t,i,n,a):l(e,t,i,n))&&"function"==typeof r.then?r.then(e=>o(null,e)).catch(o):o(null,r)}catch(e){o(e)}else l(e,t,i,n,o,a)}e&&e[0]&&this.store.addResource(e[0],t,i,n)}}}let Q=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if("object"==typeof e[1]&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){let i=e[3]||e[2];Object.keys(i).forEach(e=>{t[e]=i[e]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),J=e=>("string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&0>e.supportedLngs.indexOf("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),Y=()=>{},X=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(t=>{"function"==typeof e[t]&&(e[t]=e[t].bind(e))})};class Z extends o{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(super(),this.options=J(e),this.services={},this.logger=s,this.modules={external:[]},X(this),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout(()=>{this.init(e,t)},0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,"function"==typeof t&&(i=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:0>t.ns.indexOf("translation")&&(t.defaultNS=t.ns[0]));let n=Q();this.options={...n,...this.options,...J(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...n.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator);let r=e=>e?"function"==typeof e?new e:e:null;if(!this.options.isClone){let t;this.modules.logger?s.init(r(this.modules.logger),this.options):s.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=W);let i=new T(this.options);this.store=new O(this.options.resources,this.options);let o=this.services;o.logger=s,o.resourceStore=this.store,o.languageUtils=i,o.pluralResolver=new j(i,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),t&&(!this.options.interpolation.format||this.options.interpolation.format===n.interpolation.format)&&(o.formatter=r(t),o.formatter.init(o,this.options),this.options.interpolation.format=o.formatter.format.bind(o.formatter)),o.interpolator=new U(this.options),o.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},o.backendConnector=new K(r(this.modules.backend),o.resourceStore,o,this.options),o.backendConnector.on("*",function(t){for(var i=arguments.length,n=Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];e.emit(t,...n)}),this.modules.languageDetector&&(o.languageDetector=r(this.modules.languageDetector),o.languageDetector.init&&o.languageDetector.init(o,this.options.detection,this.options)),this.modules.i18nFormat&&(o.i18nFormat=r(this.modules.i18nFormat),o.i18nFormat.init&&o.i18nFormat.init(this)),this.translator=new F(this.services,this.options),this.translator.on("*",function(t){for(var i=arguments.length,n=Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];e.emit(t,...n)}),this.modules.external.forEach(e=>{e.init&&e.init(this)})}if(this.format=this.options.interpolation.format,i||(i=Y),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){let e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(t=>{this[t]=function(){return e.store[t](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(t=>{this[t]=function(){return e.store[t](...arguments),e}});let o=a(),l=()=>{let e=(e,t)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(t),i(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),o}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Y,i=t,n="string"==typeof e?e:this.language;if("function"==typeof e&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return i();let e=[],t=t=>{t&&"cimode"!==t&&this.services.languageUtils.toResolveHierarchy(t).forEach(t=>{"cimode"!==t&&0>e.indexOf(t)&&e.push(t)})};n?t(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(e=>t(e)),this.options.preload&&this.options.preload.forEach(e=>t(e)),this.services.backendConnector.load(e,this.options.ns,e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),i(e)})}else i(null)}reloadResources(e,t,i){let n=a();return"function"==typeof e&&(i=e,e=void 0),"function"==typeof t&&(i=t,t=void 0),e||(e=this.languages),t||(t=this.options.ns),i||(i=Y),this.services.backendConnector.reload(e,t,e=>{n.resolve(),i(e)}),n}use(e){if(!e)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&C.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let e=0;e<this.languages.length;e++){let t=this.languages[e];if(!(["cimode","dev"].indexOf(t)>-1)&&this.store.hasLanguageSomeTranslations(t)){this.resolvedLanguage=t;break}}}changeLanguage(e,t){var i=this;this.isLanguageChangingTo=e;let n=a();this.emit("languageChanging",e);let r=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},s=(e,s)=>{s?(r(s),this.translator.changeLanguage(s),this.isLanguageChangingTo=void 0,this.emit("languageChanged",s),this.logger.log("languageChanged",s)):this.isLanguageChangingTo=void 0,n.resolve(function(){return i.t(...arguments)}),t&&t(e,function(){return i.t(...arguments)})},o=t=>{e||t||!this.services.languageDetector||(t=[]);let i="string"==typeof t?t:this.services.languageUtils.getBestMatchFromCodes(t);i&&(this.language||r(i),this.translator.language||this.translator.changeLanguage(i),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(i)),this.loadResources(i,e=>{s(e,i)})};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e):o(this.services.languageDetector.detect()),n}getFixedT(e,t,i){var n=this;let r=function(e,t){let s,o;if("object"!=typeof t){for(var a=arguments.length,l=Array(a>2?a-2:0),u=2;u<a;u++)l[u-2]=arguments[u];s=n.options.overloadTranslationOptionHandler([e,t].concat(l))}else s={...t};s.lng=s.lng||r.lng,s.lngs=s.lngs||r.lngs,s.ns=s.ns||r.ns,""!==s.keyPrefix&&(s.keyPrefix=s.keyPrefix||i||r.keyPrefix);let c=n.options.keySeparator||".";return o=s.keyPrefix&&Array.isArray(e)?e.map(e=>`${s.keyPrefix}${c}${e}`):s.keyPrefix?`${s.keyPrefix}${c}${e}`:e,n.t(o,s)};return"string"==typeof e?r.lng=e:r.lngs=e,r.ns=t,r.keyPrefix=i,r}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;let i=t.lng||this.resolvedLanguage||this.languages[0],n=!!this.options&&this.options.fallbackLng,r=this.languages[this.languages.length-1];if("cimode"===i.toLowerCase())return!0;let s=(e,t)=>{let i=this.services.backendConnector.state[`${e}|${t}`];return -1===i||0===i||2===i};if(t.precheck){let e=t.precheck(this,s);if(void 0!==e)return e}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(i,e)&&(!n||s(r,e)))}loadNamespaces(e,t){let i=a();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach(e=>{0>this.options.ns.indexOf(e)&&this.options.ns.push(e)}),this.loadResources(e=>{i.resolve(),t&&t(e)}),i):(t&&t(),Promise.resolve())}loadLanguages(e,t){let i=a();"string"==typeof e&&(e=[e]);let n=this.options.preload||[],r=e.filter(e=>0>n.indexOf(e)&&this.services.languageUtils.isSupportedCode(e));return r.length?(this.options.preload=n.concat(r),this.loadResources(e=>{i.resolve(),t&&t(e)}),i):(t&&t(),Promise.resolve())}dir(e){return(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),e)?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf((this.services&&this.services.languageUtils||new T(Q())).getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}static createInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return new Z(e,t)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Y,i=e.forkResourceStore;i&&delete e.forkResourceStore;let n={...this.options,...e,isClone:!0},r=new Z(n);return(void 0!==e.debug||void 0!==e.prefix)&&(r.logger=r.logger.clone(e)),["store","services","language"].forEach(e=>{r[e]=this[e]}),r.services={...this.services},r.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},i&&(r.store=new O(this.store.data,n),r.services.resourceStore=r.store),r.translator=new F(r.services,n),r.translator.on("*",function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];r.emit(e,...i)}),r.init(n,t),r.translator.options=n,r.translator.backendConnector.services.utils={hasLoadedNamespace:r.hasLoadedNamespace.bind(r)},r}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}let ee=Z.createInstance();ee.createInstance=Z.createInstance,ee.createInstance,ee.dir,ee.init,ee.loadResources,ee.reloadResources,ee.use,ee.changeLanguage,ee.getFixedT,ee.t,ee.exists,ee.setDefaultNamespace,ee.hasLoadedNamespace,ee.loadNamespaces,ee.loadLanguages},80494:function(e,t,i){"use strict";i.d(t,{ZP:function(){return s}});let n=/\{[^{}]+\}/g;class r extends Request{constructor(e,t){for(let i in super(e,t),t)i in this||(this[i]=t[i])}}function s(e){let{baseUrl:t="",fetch:i=globalThis.fetch,querySerializer:s,bodySerializer:h,headers:f,...p}={...e};t=d(t);let g=[];async function v(e,v){var _;let m,y,b,k;let{baseUrl:w,fetch:S=i,headers:x,params:E={},parseAs:R="json",querySerializer:P,bodySerializer:O=h??c,body:C,...I}=v||{};w&&(t=d(w));let F="function"==typeof s?s:u(s);P&&(F="function"==typeof P?P:u({..."object"==typeof s?s:{},...P}));let L=void 0===C?void 0:O(C),T=void 0===L||L instanceof FormData?{}:{"Content-Type":"application/json"},$={redirect:"follow",...p,...I,body:L,headers:function(...e){let t=new Headers;for(let i of e)if(i&&"object"==typeof i)for(let[e,n]of i instanceof Headers?i.entries():Object.entries(i))if(null===n)t.delete(e);else if(Array.isArray(n))for(let i of n)t.append(e,i);else void 0!==n&&t.set(e,n);return t}(T,f,x,E.header)},A=new r((_={baseUrl:t,params:E,querySerializer:F},b=`${_.baseUrl}${e}`,_.params?.path&&(b=function(e,t){let i=e;for(let r of e.match(n)??[]){let e=r.substring(1,r.length-1),n=!1,s="simple";if(e.endsWith("*")&&(n=!0,e=e.substring(0,e.length-1)),e.startsWith(".")?(s="label",e=e.substring(1)):e.startsWith(";")&&(s="matrix",e=e.substring(1)),!t||void 0===t[e]||null===t[e])continue;let u=t[e];if(Array.isArray(u)){i=i.replace(r,l(e,u,{style:s,explode:n}));continue}if("object"==typeof u){i=i.replace(r,a(e,u,{style:s,explode:n}));continue}if("matrix"===s){i=i.replace(r,`;${o(e,u)}`);continue}i=i.replace(r,"label"===s?`.${encodeURIComponent(u)}`:encodeURIComponent(u))}return i}(b,_.params.path)),(k=_.querySerializer(_.params.query??{})).startsWith("?")&&(k=k.substring(1)),k&&(b+=`?${k}`),b),$);if(g.length){for(let i of(m=Math.random().toString(36).slice(2,11),y=Object.freeze({baseUrl:t,fetch:S,parseAs:R,querySerializer:F,bodySerializer:O}),g))if(i&&"object"==typeof i&&"function"==typeof i.onRequest){let t=await i.onRequest({request:A,schemaPath:e,params:E,options:y,id:m});if(t){if(!(t instanceof Request))throw Error("onRequest: must return new Request() when modifying the request");A=t}}}let M=await S(A);if(g.length)for(let t=g.length-1;t>=0;t--){let i=g[t];if(i&&"object"==typeof i&&"function"==typeof i.onResponse){let t=await i.onResponse({request:A,response:M,schemaPath:e,params:E,options:y,id:m});if(t){if(!(t instanceof Response))throw Error("onResponse: must return new Response() when modifying the response");M=t}}}if(204===M.status||"0"===M.headers.get("Content-Length"))return M.ok?{data:{},response:M}:{error:{},response:M};if(M.ok)return"stream"===R?{data:M.body,response:M}:{data:await M[R](),response:M};let N=await M.text();try{N=JSON.parse(N)}catch{}return{error:N,response:M}}return{GET:(e,t)=>v(e,{...t,method:"GET"}),PUT:(e,t)=>v(e,{...t,method:"PUT"}),POST:(e,t)=>v(e,{...t,method:"POST"}),DELETE:(e,t)=>v(e,{...t,method:"DELETE"}),OPTIONS:(e,t)=>v(e,{...t,method:"OPTIONS"}),HEAD:(e,t)=>v(e,{...t,method:"HEAD"}),PATCH:(e,t)=>v(e,{...t,method:"PATCH"}),TRACE:(e,t)=>v(e,{...t,method:"TRACE"}),use(...e){for(let t of e)if(t){if("object"!=typeof t||!("onRequest"in t||"onResponse"in t))throw Error("Middleware must be an object with one of `onRequest()` or `onResponse()`");g.push(t)}},eject(...e){for(let t of e){let e=g.indexOf(t);-1!==e&&g.splice(e,1)}}}}function o(e,t,i){if(null==t)return"";if("object"==typeof t)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${i?.allowReserved===!0?t:encodeURIComponent(t)}`}function a(e,t,i){if(!t||"object"!=typeof t)return"";let n=[],r={simple:",",label:".",matrix:";"}[i.style]||"&";if("deepObject"!==i.style&&!1===i.explode){for(let e in t)n.push(e,!0===i.allowReserved?t[e]:encodeURIComponent(t[e]));let r=n.join(",");switch(i.style){case"form":return`${e}=${r}`;case"label":return`.${r}`;case"matrix":return`;${e}=${r}`;default:return r}}for(let r in t){let s="deepObject"===i.style?`${e}[${r}]`:r;n.push(o(s,t[r],i))}let s=n.join(r);return"label"===i.style||"matrix"===i.style?`${r}${s}`:s}function l(e,t,i){if(!Array.isArray(t))return"";if(!1===i.explode){let n={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[i.style]||",",r=(!0===i.allowReserved?t:t.map(e=>encodeURIComponent(e))).join(n);switch(i.style){case"simple":return r;case"label":return`.${r}`;case"matrix":return`;${e}=${r}`;default:return`${e}=${r}`}}let n={simple:",",label:".",matrix:";"}[i.style]||"&",r=[];for(let n of t)"simple"===i.style||"label"===i.style?r.push(!0===i.allowReserved?n:encodeURIComponent(n)):r.push(o(e,n,i));return"label"===i.style||"matrix"===i.style?`${n}${r.join(n)}`:r.join(n)}function u(e){return function(t){let i=[];if(t&&"object"==typeof t)for(let n in t){let r=t[n];if(null!=r){if(Array.isArray(r)){i.push(l(n,r,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if("object"==typeof r){i.push(a(n,r,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}i.push(o(n,r,e))}}return i.join("&")}}function c(e){return e instanceof FormData?e:JSON.stringify(e)}function d(e){return e.endsWith("/")?e.substring(0,e.length-1):e}}}]);