PageSourceSearch

https://www.withfaye.com/_astro/misc.BsptW5zG.js

js withfaye.com collected 2026-10-01 12:02:18 UTC 372,421 bytes, 1 lines download raw bytes

1globalThis.process??={},globalThis.process.env??={};import{r as e,t}from"./rolldown-runtime.DIol1n-R.js";var n=function(){let e=typeof document<"u"&&document.createElement("link").relList;return e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"}(),r=function(e){return"/"+e},i={},a=function(e,t,o){let a=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),l=s?.nonce||s?.getAttribute("nonce");a=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))}(t.map(t=>{if(t=function(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,new URL("../../../src/node/plugins/importAnalysisBuild.ts",import.meta.url)).href}(t=r(t,o)),t in i)return;i[t]=!0;let a=t.endsWith(".css");for(let r=e.length-1;r>=0;r--){let n=e[r];if(n.href===t&&(!a||"stylesheet"===n.rel))return}let s=document.createElement("link");return s.rel=a?"stylesheet":n,a||(s.as="script"),s.crossOrigin="",s.href=t,l&&s.setAttribute("nonce",l),document.head.appendChild(s),a?new Promise((e,r)=>{s.addEventListener("load",e),s.addEventListener("error",()=>r(Error(`Unable to preload CSS for ${t}`)))}):void 0}))}function s(e){let t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return a.then(t=>{for(let e of t||[])"rejected"===e.status&&s(e.reason);return e().catch(s)})};function o(e){for(var t,r=0,n=0,i=e.length;i>=4;++n,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}var s=1095,c={logoVersion:!1,openChat:null,chatNotificationCount:0,utm:null,funnelState:null,recentQuoteHash:null,mixpanelProperties:null},l=[],u=["utm","recentQuoteHash"],d={recentQuoteHash:30},f={openChat:["faye:webStorage:chat","faye:chat","faye:pw:webStorage:chat"],utm:["faye:webStorage:utm","faye:pw:webStorage:utm","faye:utm"],mixpanelProperties:["faye:webStorage:mixpanelProperties"],logoVersion:["faye:webStorage:logoVersion"],funnelState:[]};function p(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)"__proto__"!==n&&(e[n]=r[n])}return e}var m={read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function h(e,t){function r(r,n,i){if(!(typeof document>"u")){"number"==typeof(i=p({},t,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&=i.expires.toUTCString(),r=encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var o="";for(var a in i)i[a]&&(o+="; "+a,!0!==i[a]&&(o+="="+i[a].split(";")[0]));return document.cookie=r+"="+e.write(n,r)+o}}return Object.create({set:r,get:function(t){if(!(typeof document>"u"||arguments.length&&!t)){for(var r=document.cookie?document.cookie.split("; "):[],n={},i=0;i<r.length;i++){var o=r[i].split("="),a=o.slice(1).join("=");try{var s=decodeURIComponent(o[0]);if(s in n||(n[s]=e.read(a,s)),t===s)break}catch{}}return t?n[t]:n}},remove:function(e,t){r(e,"",p({},t,{expires:-1}))},withAttributes:function(e){return h(this.converter,p({},this.attributes,e))},withConverter:function(e){return h(p({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var g=h(m,{path:"/"});function _(e){try{return g.get(e)}catch{return}}function v(){if(!(typeof window<"u"&&"localhost"===window.location.hostname))return"withfaye.com"}function y(e,t,r=365){let n=v();g.set(e,t,{...n&&{domain:n},path:"/",sameSite:"Lax",expires:r})}function b(e){let t=v();g.remove(e,{path:"/",...t&&{domain:t}})}function ee(e){return`faye_webStorage_${e}`}function x(e){let t="sessionStorage";l.includes(e)&&(t="localStorage"),u.includes(e)&&(t="cookie");let r=ee(e),n=window.__fayeWebStorageMigratedKeys??=new Set;if(!n.has(e)){n.add(e);let i=f[e];if(i?.length)for(let e of i){let n=_(e)??window.localStorage.getItem(e)??window.sessionStorage.getItem(e);n&&(b(e),window.localStorage.removeItem(e),window.sessionStorage.removeItem(e),"cookie"===t?y(r,n,365):window[t].setItem(r,n))}if("cookie"===t){let e=window.localStorage.getItem(r),t=window.sessionStorage.getItem(r);e?(y(r,e,365),window.localStorage.removeItem(r)):t&&(y(r,t,365),window.sessionStorage.removeItem(r))}else if("localStorage"===t){let e=_(r),t=window.sessionStorage.getItem(r);e?(window.localStorage.setItem(r,e),b(r)):t&&(window.localStorage.setItem(r,t),window.sessionStorage.removeItem(r))}else if("sessionStorage"===t){let e=_(r),t=window.localStorage.getItem(r);e?(window.sessionStorage.setItem(r,e),b(r)):t&&(window.sessionStorage.setItem(r,t),window.localStorage.removeItem(r))}}if("cookie"===t){let t=d[e]??365;return{get(){let t=_(r);return void 0===t?c[e]:JSON.parse(t)},remove(){b(r)},set(e){y(r,JSON.stringify(e),t)}}}let i=window[t];return{get(){let t=i.getItem(r);return null===t?c[e]:JSON.parse(t)},remove(){i.removeItem(r)},set(e){i.setItem(r,JSON.stringify(e))}}}var te,ne,re,ie,ae,oe=-1,se=function(e){addEventListener("pageshow",function(t){t.persisted&&(oe=t.timeStamp,e(t))},!0)},ce=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},le=function(){var e=ce();return e&&e.activationStart||0},ue=function(e,t){var r=ce(),n="navigate";return oe>=0?n="back-forward-cache":r&&(document.prerendering||le()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:`v4-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},de=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(e){Promise.resolve().then(function(){t(e.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch{}},fe=function(e,t,r,n){var i,o;return function(a){t.value>=0&&(a||n)&&((o=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=o,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,r),e(t))}}
1,pe=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},me=function(e){document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&e()})},he=function(e){var t=!1;return function(){t||=(e(),!0)}},ge=-1,_e=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},ve=function(e){"hidden"===document.visibilityState&&ge>-1&&(ge="visibilitychange"===e.type?e.timeStamp:0,be())},ye=function(){addEventListener("visibilitychange",ve,!0),addEventListener("prerenderingchange",ve,!0)},be=function(){removeEventListener("visibilitychange",ve,!0),removeEventListener("prerenderingchange",ve,!0)},xe=function(){return ge<0&&(ge=_e(),ye(),se(function(){setTimeout(function(){ge=_e(),ye()},0)})),{get firstHiddenTime(){return ge}}},Se=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},Ce=[1800,3e3],we=function(e,t){t||={},Se(function(){var r,n=xe(),i=ue("FCP"),o=de("paint",function(e){e.forEach(function(e){"first-contentful-paint"===e.name&&(o.disconnect(),e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-le(),0),i.entries.push(e),r(!0)))})});o&&(r=fe(e,i,Ce,t.reportAllChanges),se(function(n){i=ue("FCP"),r=fe(e,i,Ce,t.reportAllChanges),pe(function(){i.value=performance.now()-n.timeStamp,r(!0)})}))})},Te=[.1,.25],Ee=function(e,t){t||={},we(he(function(){var r,n=ue("CLS",0),i=0,o=[],a=function(e){e.forEach(function(e){if(!e.hadRecentInput){var t=o[0],r=o[o.length-1];i&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,o.push(e)):(i=e.value,o=[e])}}),i>n.value&&(n.value=i,n.entries=o,r())},s=de("layout-shift",a);s&&(r=fe(e,n,Te,t.reportAllChanges),me(function(){a(s.takeRecords()),r(!0)}),se(function(){i=0,n=ue("CLS",0),r=fe(e,n,Te,t.reportAllChanges),pe(function(){return r()})}),setTimeout(r,0))}))},De=0,Oe=1/0,ke=0,Ae=function(e){e.forEach(function(e){e.interactionId&&(Oe=Math.min(Oe,e.interactionId),ke=Math.max(ke,e.interactionId),De=ke?(ke-Oe)/7+1:0)})},je=function(){return te?De:performance.interactionCount||0},Me=function(){"interactionCount"in performance||te||(te=de("event",Ae,{type:"event",buffered:!0,durationThreshold:0}))},Ne=[],Pe=new Map,Fe=0,Ie=function(){return Ne[Math.min(Ne.length-1,Math.floor((je()-Fe)/50))]},Le=[],Re=function(e){if(Le.forEach(function(t){return t(e)}),e.interactionId||"first-input"===e.entryType){var t=Ne[Ne.length-1],r=Pe.get(e.interactionId);if(r||Ne.length<10||e.duration>t.latency){if(r)e.duration>r.latency?(r.entries=[e],r.latency=e.duration):e.duration===r.latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e);else{var n={id:e.interactionId,latency:e.duration,entries:[e]};Pe.set(n.id,n),Ne.push(n)}Ne.sort(function(e,t){return t.latency-e.latency}),Ne.length>10&&Ne.splice(10).forEach(function(e){return Pe.delete(e.id)})}}},ze=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=he(e),"hidden"===document.visibilityState?e():(r=t(e),me(e)),r},Be=[200,500],Ve=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t||={},Se(function(){Me();var r,n=ue("INP"),i=function(e){ze(function(){e.forEach(Re);var t=Ie();t&&t.latency!==n.value&&(n.value=t.latency,n.entries=t.entries,r())})},o=de("event",i,{durationThreshold:t.durationThreshold??40});r=fe(e,n,Be,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),me(function(){i(o.takeRecords()),r(!0)}),se(function(){Fe=je(),Ne.length=0,Pe.clear(),n=ue("INP"),r=fe(e,n,Be,t.reportAllChanges)}))}))},He=[2500,4e3],Ue={},We=function(e,t){t||={},Se(function(){var r,n=xe(),i=ue("LCP"),o=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach(function(e){e.startTime<n.firstHiddenTime&&(i.value=Math.max(e.startTime-le(),0),i.entries=[e],r())})},a=de("largest-contentful-paint",o);if(a){r=fe(e,i,He,t.reportAllChanges);var s=he(function(){Ue[i.id]||(o(a.takeRecords()),a.disconnect(),Ue[i.id]=!0,r(!0))});["keydown","click"].forEach(function(e){addEventListener(e,function(){return ze(s)},{once:!0,capture:!0})}),me(s),se(function(n){i=ue("LCP"),r=fe(e,i,He,t.reportAllChanges),pe(function(){i.value=performance.now()-n.timeStamp,Ue[i.id]=!0,r(!0)})})}})},Ge={passive:!0,capture:!0},Ke=new Date,qe=function(e,t){ne||(ne=t,re=e,ie=new Date,Xe(removeEventListener),Je())},Je=function(){if(re>
1=0&&re<ie-Ke){var e={entryType:"first-input",name:ne.type,target:ne.target,cancelable:ne.cancelable,startTime:ne.timeStamp,processingStart:ne.timeStamp+re};ae.forEach(function(t){t(e)}),ae=[]}},Ye=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var r=function(){qe(e,t),i()},n=function(){i()},i=function(){removeEventListener("pointerup",r,Ge),removeEventListener("pointercancel",n,Ge)};addEventListener("pointerup",r,Ge),addEventListener("pointercancel",n,Ge)}(t,e):qe(t,e)}},Xe=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach(function(t){return e(t,Ye,Ge)})};function Ze(e,t){return e.map(e=>"number"==typeof e&&0!==e?t(e):e)}function Qe(e,...t){let r=" ";if("object"==typeof e){if("number"===e.mode)return typeof window>"u"||typeof document>"u"?Ze(t.slice(0,1),e=>e/4*16)[0]:Ze(t.slice(0,1),e=>e/4*parseFloat(window.getComputedStyle(document.documentElement).fontSize))[0];"comma"===e.mode&&(r=", ")}else t.unshift(e);return Ze(t,e=>e/4+"rem").join(r)}var $e={},et=e=>{var{fileScope:t,css:r}=e,n=t.packageName?[t.packageName,t.filePath].join("/"):t.filePath,i=$e[n];if(!i){var o=document.createElement("style");t.packageName&&o.setAttribute("data-package",t.packageName),o.setAttribute("data-file",t.filePath),o.setAttribute("type","text/css"),i=$e[n]=o,document.head.appendChild(o)}i.innerHTML=r};function tt(e){var t=e.match(/^var\((.*)\)$/);return t?t[1]:e}function nt(e,t){var r=e;for(var n of t){if(!(n in r))throw Error(`Path ${t.join(" -> ")} does not exist in object`);r=r[n]}return r}function rt(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n={};for(var i in e){var o=e[i],a=[...r,i];"string"==typeof o||"number"==typeof o||null==o?n[i]=t(o,a):"object"!=typeof o||Array.isArray(o)?console.warn(`Skipping invalid key "${a.join(".")}". Should be a string, number, null or object. Received: "${Array.isArray(o)?"Array":typeof o}"`):n[i]=rt(o,t,a)}return n}var S,ft,it=class{constructor(e){let{failure:t,gotoFn:r,output:n}=this._buildTables(e);this.gotoFn=r,this.output=n,this.failure=t}_buildTables(e){let t={0:{}},r={},n=0;for(let i of e){let e=0;for(let o of i)t[e]&&o in t[e]?e=t[e][o]:(n++,t[e][o]=n,t[n]={},e=n,r[n]=[]);r[e].push(i)}let i={},o=[];for(let e in t[0]){let r=t[0][e];i[r]=0,o.push(r)}for(;o.length>0;){let e=o.shift();if(void 0!==e)for(let n in t[e]){let a=t[e][n];o.push(a);let s=i[e];for(;s>0&&!(n in t[s]);)s=i[s];if(n in t[s]){let e=t[s][n];i[a]=e,r[a]=[...r[a],...r[e]]}else i[a]=0}}return{gotoFn:t,output:r,failure:i}}search(e){let t=0,r=[];for(let n=0;n<e.length;n++){let i=e[n];for(;t>0&&!(i in this.gotoFn[t]);)t=this.failure[t];if(i in this.gotoFn[t]&&(t=this.gotoFn[t][i],this.output[t].length>0)){let e=this.output[t];r.push([n,e])}}return r}match(e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];for(;t>0&&!(n in this.gotoFn[t]);)t=this.failure[t];if(n in this.gotoFn[t]&&(t=this.gotoFn[t][n],this.output[t].length>0))return!0}return!1}},at=[{appendCss:()=>{},registerClassName:()=>{},onEndFileScope:()=>{},registerComposition:()=>{},markCompositionUsed:()=>{},getIdentOption:()=>"short"}],ot=()=>{if(at.length<1)throw Error("No adapter configured");return at[at.length-1]},st=!1,ct=e=>{st||lt(e)},lt=e=>{if(!e)throw Error('No adapter provided when calling "setAdapter"');st=!0,at.push(e)},ut=function(){return ot().markCompositionUsed(...arguments)};function dt(e,t){return t||=e.slice(0),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}!function(e){e.Attribute="attribute",e.Pseudo="pseudo",e.PseudoElement="pseudo-element",e.Tag="tag",e.Universal="universal",e.Adjacent="adjacent",e.Child="child",e.Descendant="descendant",e.Parent="parent",e.Sibling="sibling",e.ColumnCombinator="column-combinator"}(S||={}),function(e){e.Any="any",e.Element="element",e.End="end",e.Equals="equals",e.Exists="exists",e.Hyphen="hyphen",e.Not="not",e.Start="start"}(ft||={});var pt=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,mt=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,ht=new Map([[126,ft.Element],[94,ft.Start],[36,ft.End],[42,ft.Any],[33,ft.Not],[124,ft.Hyphen]]),gt=new Set(["has","not","matches","is","where","host","host-context"]);function _t(e){switch(e.type){case S.Adjacent:case S.Child:case S.Descendant:case S.Parent:case S.Sibling:case S.ColumnCombinator:return!0;default:return!1}}var vt=new Set(["contains","icontains"]);function yt(e,t,r){let n=parseInt(t,16)-65536;return n!=n||r?t:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)}function bt(e){return e.replace(mt,yt)}function xt(e){return 39===e||34===e}function St(e){return 32===e||9===e||10===e||12===e||13===e}function Ct(e){let t=[],r=wt(t,`${e}`,0);if(r<e.length)throw Error(`Unmatched selector: ${e.slice(r)}`);return t}function wt(e,t,r){let n=[];function i(e){let n=t.slice(r+e).match(pt);if(!n)throw Error(`Expected name, found ${t.slice(r)}`);let[i]=n;return r+=e+i.length,bt(i)}function o(e){for(r+=e;r<t.length&&St(t.charCodeAt(r));)r++}function a(){let e=r+=1,n=1;for(;n>0&&r<t.length;r++)40!==t.charCodeAt(r)||s(r)?41===t.charCodeAt(r)&&!s(r)&&n--:n++;
1if(n)throw Error("Parenthesis not matched");return bt(t.slice(e,r-1))}function s(e){let r=0;for(;92===t.charCodeAt(--e);)r++;return!(1&~r)}function l(){if(n.length>0&&_t(n[n.length-1]))throw Error("Did not expect successive traversals.")}function u(e){n.length>0&&n[n.length-1].type===S.Descendant?n[n.length-1].type=e:(l(),n.push({type:e}))}function c(e,t){n.push({type:S.Attribute,name:e,action:t,value:i(1),namespace:null,ignoreCase:"quirks"})}function d(){if(n.length&&n[n.length-1].type===S.Descendant&&n.pop(),0===n.length)throw Error("Empty sub-selector");e.push(n)}if(o(0),t.length===r)return r;e:for(;r<t.length;){let e=t.charCodeAt(r);switch(e){case 32:case 9:case 10:case 12:case 13:(0===n.length||n[0].type!==S.Descendant)&&(l(),n.push({type:S.Descendant})),o(1);break;case 62:u(S.Child),o(1);break;case 60:u(S.Parent),o(1);break;case 126:u(S.Sibling),o(1);break;case 43:u(S.Adjacent),o(1);break;case 46:c("class",ft.Element);break;case 35:c("id",ft.Equals);break;case 91:{o(1);let e,a=null;124===t.charCodeAt(r)?e=i(1):t.startsWith("*|",r)?(a="*",e=i(2)):(e=i(0),124===t.charCodeAt(r)&&61!==t.charCodeAt(r+1)&&(a=e,e=i(1))),o(0);let l=ft.Exists,u=ht.get(t.charCodeAt(r));if(u){if(l=u,61!==t.charCodeAt(r+1))throw Error("Expected `=`");o(2)}else 61===t.charCodeAt(r)&&(l=ft.Equals,o(1));let c="",d=null;if("exists"!==l){if(xt(t.charCodeAt(r))){let e=t.charCodeAt(r),n=r+1;for(;n<t.length&&(t.charCodeAt(n)!==e||s(n));)n+=1;if(t.charCodeAt(n)!==e)throw Error("Attribute value didn't end");c=bt(t.slice(r+1,n)),r=n+1}else{let e=r;for(;r<t.length&&(!St(t.charCodeAt(r))&&93!==t.charCodeAt(r)||s(r));)r+=1;c=bt(t.slice(e,r))}o(0);let e=32|t.charCodeAt(r);115===e?(d=!1,o(1)):105===e&&(d=!0,o(1))}if(93!==t.charCodeAt(r))throw Error("Attribute selector didn't terminate");r+=1;let f={type:S.Attribute,name:e,action:l,value:c,namespace:a,ignoreCase:d};n.push(f);break}case 58:{if(58===t.charCodeAt(r+1)){n.push({type:S.PseudoElement,name:i(2).toLowerCase(),data:40===t.charCodeAt(r)?a():null});continue}let e=i(1).toLowerCase(),o=null;if(40===t.charCodeAt(r))if(gt.has(e)){if(xt(t.charCodeAt(r+1)))throw Error(`Pseudo-selector ${e} cannot be quoted`);if(o=[],r=wt(o,t,r+1),41!==t.charCodeAt(r))throw Error(`Missing closing parenthesis in :${e} (${t})`);r+=1}else{if(o=a(),vt.has(e)){let e=o.charCodeAt(0);e===o.charCodeAt(o.length-1)&&xt(e)&&(o=o.slice(1,-1))}o=bt(o)}n.push({type:S.Pseudo,name:e,data:o});break}case 44:d(),n=[],o(1);break;default:{if(t.startsWith("/*",r)){let e=t.indexOf("*/",r+2);if(e<0)throw Error("Comment was not terminated");r=e+2,0===n.length&&o(0);break}let a,s=null;if(42===e)r+=1,a="*";else if(124===e){if(a="",124===t.charCodeAt(r+1)){u(S.ColumnCombinator),o(2);break}}else{if(!pt.test(t.slice(r)))break e;a=i(0)}124===t.charCodeAt(r)&&124!==t.charCodeAt(r+1)&&(s=a,42===t.charCodeAt(r+1)?(a="*",r+=2):a=i(1)),n.push("*"===a?{type:S.Universal,namespace:s}:{type:S.Tag,name:a,namespace:s})}}}return d(),r}function Tt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Et(e){for(var t=1;t<arguments.length;t++){var r=null==arguments[t]?{}:arguments[t];t%2?Tt(Object(r),!0).forEach(function(t){Dt(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Tt(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Dt(e,t,r){return(t=Ot(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ot(e){var t=kt(e,"string");return"symbol"==typeof t?t:String(t)}function kt(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var At=jt({});function jt(e){return t.withOptions=t=>jt(Et(Et({},e),t)),t;function t(t,...r){let n="string"==typeof t?[t]:t.raw,{alignValues:i=!1,escapeSpecialCharacters:o=Array.isArray(t),trimWhitespace:a=!0}=e,s="";for(let e=0;e<n.length;e++){let t=n[e];if(o&&(t=t.replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`").replace(/\\\$/g,"$").replace(/\\\{/g,"{")),s+=t,e<r.length){s+=i?Mt(r[e],s):r[e]}}let l=s.split("\n"),u=null;for(let e of l){let t=e.match(/^(\s+)\S+/);if(t){let e=t[1].length;u=u?Math.min(u,e):e}}if(null!==u){let e=u;s=l.map(t=>
1" "===t[0]||"\t"===t[0]?t.slice(e):t).join("\n")}return a&&(s=s.trim()),o&&(s=s.replace(/\\n/g,"\n").replace(/\\t/g,"\t").replace(/\\r/g,"\r").replace(/\\v/g,"\v").replace(/\\b/g,"\b").replace(/\\f/g,"\f").replace(/\\0/g,"\0").replace(/\\x([\da-fA-F]{2})/g,(e,t)=>String.fromCharCode(parseInt(t,16))).replace(/\\u\{([\da-fA-F]{1,6})\}/g,(e,t)=>String.fromCodePoint(parseInt(t,16))).replace(/\\u([\da-fA-F]{4})/g,(e,t)=>String.fromCharCode(parseInt(t,16)))),typeof Bun<"u"&&(s=s.replace(/\\u(?:\{([\da-fA-F]{1,6})\}|([\da-fA-F]{4}))/g,(e,t,r)=>{let n=t??r??"";return String.fromCodePoint(parseInt(n,16))})),s}}function Mt(e,t){if("string"!=typeof e||!e.includes("\n"))return e;let r=t.slice(t.lastIndexOf("\n")+1).match(/^(\s+)/);if(r){let t=r[1];return e.replace(/\n/g,`\n${t}`)}return e}var Nt=function(){return Nt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Nt.apply(this,arguments)};function Pt(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function Ft(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function C(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}var It=/(\u000D|\u000C|\u000D\u000A)/g,Lt=/[\u0000\uD800-\uDFFF]/g,Rt=/(\/\*)[\s\S]*?(\*\/)/g,zt=function(e,t){void 0===t&&(t=0),e=(e=e.replace(It,"\n").replace(Lt,"�")).replace(Rt,"");for(var r=[];t<e.length;t+=1){var n=e.charCodeAt(t);if(9===n||32===n||10===n){for(var i=e.charCodeAt(++t);9===i||32===i||10===i;)i=e.charCodeAt(++t);--t,r.push({type:"<whitespace-token>"})}
1else if(34===n){if(null===(x=Bt(e,t)))return null;var o=C(x,2),a=o[0],s=o[1];r.push({type:"<string-token>",value:s}),t=a}else if(35===n){if(t+1<e.length)if(95===(p=e.charCodeAt(t+1))||p>=65&&p<=90||p>=97&&p<=122||p>=128||p>=48&&p<=57||92===p&&t+2<e.length&&10!==e.charCodeAt(t+2)){var l=Vt(e,t+1)?"id":"unrestricted";if(null!==(x=Gt(e,t+1))){var u=C(x,2);a=u[0],s=u[1];r.push({type:"<hash-token>",value:s.toLowerCase(),flag:l}),t=a;continue}}r.push({type:"<delim-token>",value:n})}else if(39===n){if(null===(x=Bt(e,t)))return null;var c=C(x,2);a=c[0],s=c[1];r.push({type:"<string-token>",value:s}),t=a}else if(40===n)r.push({type:"<(-token>"});else if(41===n)r.push({type:"<)-token>"});else if(43===n){var d=Ut(e,t);if(null===d)r.push({type:"<delim-token>",value:n});else{var f=C(d,2);a=f[0];"<dimension-token>"===(E=f[1])[0]?r.push({type:"<dimension-token>",value:E[1],unit:E[2].toLowerCase(),flag:"number"}):"<number-token>"===E[0]?r.push({type:E[0],value:E[1],flag:E[2]}):r.push({type:E[0],value:E[1],flag:"number"}),t=a}}else if(44===n)r.push({type:"<comma-token>"});else if(45===n){if(null!==(y=Ut(e,t))){var h=C(y,2);a=h[0];"<dimension-token>
1"===(E=h[1])[0]?r.push({type:"<dimension-token>",value:E[1],unit:E[2].toLowerCase(),flag:"number"}):"<number-token>"===E[0]?r.push({type:E[0],value:E[1],flag:E[2]}):r.push({type:E[0],value:E[1],flag:"number"}),t=a;continue}if(t+2<e.length){var p=e.charCodeAt(t+1),g=e.charCodeAt(t+2);if(45===p&&62===g){r.push({type:"<CDC-token>"}),t+=2;continue}}if(null!==(x=Jt(e,t))){var m=C(x,3),_=(a=m[0],s=m[1],m[2]);r.push({type:_,value:s}),t=a;continue}r.push({type:"<delim-token>",value:n})}else if(46===n){var y;if(null!==(y=Ut(e,t))){var v=C(y,2);a=v[0];"<dimension-token>"===(E=v[1])[0]?r.push({type:"<dimension-token>",value:E[1],unit:E[2].toLowerCase(),flag:"number"}):"<number-token>"===E[0]?r.push({type:E[0],value:E[1],flag:E[2]}):r.push({type:E[0],value:E[1],flag:"number"}),t=a;continue}r.push({type:"<delim-token>",value:n})}else if(58===n)r.push({type:"<colon-token>"});else if(59===n)r.push({type:"<semicolon-token>"});else if(60===n){if(t+3<e.length){p=e.charCodeAt(t+1),g=e.charCodeAt(t+2);var b=e.charCodeAt(t+3);if(33===p&&45===g&&45===b){r.push({type:"<CDO-token>"}),t+=3;continue}}r.push({type:"<delim-token>",value:n})}else if(64===n){if(null!==(x=Kt(e,t+1))){var S=C(x,2);a=S[0],s=S[1];r.push({type:"<at-keyword-token>",value:s.toLowerCase()}),t=a;continue}r.push({type:"<delim-token>",value:n})}else if(91===n)r.push({type:"<[-token>"});else if(92===n){if(null===(x=Ht(e,t)))return null;var w=C(x,2);a=w[0],s=w[1];e=e.slice(0,t)+s+e.slice(a+1),--t}else if(93===n)r.push({type:"<]-token>"});else if(123===n)r.push({type:"<{-token>"});else if(125===n)r.push({type:"<}-token>"});else if(n>=48&&n<=57){var E,k=C(x=Ut(e,t),2);a=k[0];"<dimension-token>
1"===(E=k[1])[0]?r.push({type:"<dimension-token>",value:E[1],unit:E[2].toLowerCase(),flag:"number"}):"<number-token>"===E[0]?r.push({type:E[0],value:E[1],flag:E[2]}):r.push({type:E[0],value:E[1],flag:"number"}),t=a}else if(95===n||n>=65&&n<=90||n>=97&&n<=122||n>=128){var x;if(null===(x=Jt(e,t)))return null;var A=C(x,3);a=A[0],s=A[1],_=A[2];r.push({type:_,value:s}),t=a}else r.push({type:"<delim-token>",value:n})}return r.push({type:"<EOF-token>"}),r},Bt=function(e,t){if(e.length<=t+1)return null;for(var r=e.charCodeAt(t),n=[],i=t+1;i<e.length;i+=1){var o=e.charCodeAt(i);if(o===r)return[i,String.fromCharCode.apply(null,n)];if(92===o){var a=Ht(e,i);if(null===a)return null;var s=C(a,2),l=s[0],u=s[1];n.push(u),i=l}else{if(10===o)return null;n.push(o)}}return null},Vt=function(e,t){if(e.length<=t)return!1;var r,n=e.charCodeAt(t);return 45===n?!(e.length<=t+1)&&(45===(r=e.charCodeAt(t+1))||95===r||r>=65&&r<=90||r>=97&&r<=122||r>=128||92===r&&(!(e.length<=t+2)&&10!==e.charCodeAt(t+2))):95===n||n>=65&&n<=90||n>=97&&n<=122||n>=128||92===n&&(!(e.length<=t+1)&&10!==(r=e.charCodeAt(t+1)))},Ht=function(e,t){if(e.length<=t+1||92!==e.charCodeAt(t))return null;var r=e.charCodeAt(t+1);if(10===r)return null;if(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102){for(var n=[r],i=Math.min(t+7,e.length),o=t+2;o<i;o+=1){var a=e.charCodeAt(o);if(!(a>=48&&a<=57||a>=65&&a<=70||a>=97&&a<=102))break;n.push(a)}if(o<e.length){var s=e.charCodeAt(o);(9===s||32===s||10===s)&&(o+=1)}return[o-1,parseInt(String.fromCharCode.apply(null,n),16)]}return[t+1,r]},Ut=function(e,t){var r=Wt(e,t);if(null===r)return null;var n=C(r,3),i=n[0],o=n[1],a=n[2],s=Kt(e,i+1);if(null!==s){var l=C(s,2);return[l[0],["<dimension-token>",o,l[1]]]}return i+1<e.length&&37===e.charCodeAt(i+1)?[i+1,["<percentage-token>",o]]:[i,["<number-token>",o,a]]},Wt=function(e,t){if(e.length<=t)return null;var r="integer",n=[],i=e.charCodeAt(t);for((43===i||45===i)&&(t+=1,45===i&&n.push(45));t<e.length;){if(!((u=e.charCodeAt(t))>=48&&u<=57))break;n.push(u),t+=1}if(t+1<e.length){var o=e.charCodeAt(t),a=e.charCodeAt(t+1);if(46===o&&a>=48&&a<=57)for(n.push(o,a),r="number",t+=2;t<e.length;){if(!((u=e.charCodeAt(t))>=48&&u<=57))break;n.push(u),t+=1}}if(t+1<e.length){o=e.charCodeAt(t),a=e.charCodeAt(t+1);var s=e.charCodeAt(t+2);if(69===o||101===o){var l=a>=48&&a<=57;if(l||(43===a||45===a)&&s>=48&&s<=57)for(r="number",l?(n.push(69,a),t+=2):45===a?(n.push(69,45,s),t+=3):(n.push(69,s),t+=3);t<e.length;){var u;if(!((u=e.charCodeAt(t))>=48&&u<=57))break;n.push(u),t+=1}}}var c=String.fromCharCode.apply(null,n),d="number"===r?parseFloat(c):parseInt(c);return-0===d&&(d=0),Number.isNaN(d)?null:[t-1,d,r]},Gt=function(e,t){if(e.length<=t)return null;for(var r=[],n=e.charCodeAt(t);t<e.length;n=e.charCodeAt(++t))if(45===n||95===n||n>=65&&n<=90||n>=97&&n<=122||n>=128||n>=48&&n<=57)r.push(n);else{var i=Ht(e,t);if(null===i)break;var o=C(i,2),a=o[0],s=o[1];r.push(s),t=a}return 0===t?null:[t-1,String.fromCharCode.apply(null,r)]},Kt=function(e,t){if(e.length<=t||!Vt(e,t))return null;for(var r=[],n=e.charCodeAt(t);t<e.length;n=e.charCodeAt(++t))if(45===n||95===n||n>=65&&n<=90||n>=97&&n<=122||n>=128||n>=48&&n<=57)r.push(n);else{var i=Ht(e,t);if(null===i)break;var o=C(i,2),a=o[0],s=o[1];r.push(s),t=a}return[t-1,String.fromCharCode.apply(null,r)]},qt=function(e,t){for(var r=e.charCodeAt(t);9===r||32===r||10===r;)r=e.charCodeAt(++t);for(var n=[],i=!1;t<e.length;){if(41===r)return[t,String.fromCharCode.apply(null,n)];if(34===r||39===r||40===r)return null;if(9===r||32===r||10===r)!i&&0!==n.length&&(i=!0);else if(92===r){var o=Ht(e,t);if(null===o||i)return null;var a=C(o,2),s=a[0],l=a[1];n.push(l),t=s}else{if(i)return null;n.push(r)}r=e.charCodeAt(++t)}return null},Jt=function(e,t){var r=Kt(e,t);if(null===r)return null;var n=C(r,2),i=n[0],o=n[1];if("url"===o.toLowerCase()){if(e.length>i+1&&40===e.charCodeAt(i+1)){for(var a=2;i+a<e.length;a+=1){var s=e.charCodeAt(i+a);if(34===s||39===s)return[i+1,o.toLowerCase(),"<function-token>"];if(9!==s&&32!==s&&10!==s){var l=qt(e,i+a);if(null===l)return null;var u=C(l,2);return[u[0],u[1],"<url-token>"]}}return[i+1,o.toLowerCase(),"<function-token>"]}}else if(e.length>i+1){if(40===e.charCodeAt(i+1))return[i+1,o.toLowerCase(),"<function-token>"]}return[i,o.toLowerCase(),"<ident-token>"]},Yt=function(e){for(var t=e.length-1;t>=0;t--)e[t]=Xt(e[t]);return e},Xt=function(e){if(null===e.mediaCondition)return e;var t=Zt(e.mediaCondition);return null===t.operator&&1===t.children.length&&"children"in t.children[0]&&(t=t.children[0]),{mediaPrefix:e.mediaPrefix,mediaType:e.mediaType,mediaCondition:t}},Zt=function e(t){for(var r=t.children.length-1;r>=0;r--){var n=t.children[r];if(!("context"in n)){var i=e(n);if(null===i.operator&&1===i.children.length)t.children[r]=i.children[0];else if(i.operator===t.operator&&("and"===i.operator||"or"===i.operator)){for(var o=[r,1],a=0;a<i.children.length;a++)o.push(i.children[a]);t.children.splice.apply(t.children,o)}}}return t},w=function(e,t){return t instanceof Error?Error(`${t.message.trim()}\n${e.trim()}`):Error(e.trim())},Qt=function(e){return Yt($t(e))},$t=function(e){var t=zt(e.trim());if(null===t)throw w("Failed tokenizing");var r=0,n=t.length-1;if("<at-keyword-token>"===t[0].type&&"media"===t[0].value){if("<whitespace-token>"!==t[1].type)throw w("Expected whitespace after media");r=2;for(var i=2;i<t.length-1;i++){var o=t[i];if("<{-token>"===o.type){n=i;break}if("<semicolon-token>"===o.type)throw w("Expected '{' in media query but found ';'")}}return t=t.slice(r,n),tn(t)},en=function(e){for(var t=[],r=!1,n=0;n<e.length;n++)"<whitespace-token>"===e[n].type?(r=!0,t.length>0&&(t[t.length-1].wsAfter=!0)):(t.push(Nt(Nt({},e[n]),{wsBefore:r,wsAfter:!1})),r=!1);return t},tn=function(e){for(var t,r,n=[[]],i=0;i<e.length;i++){var o=e[i];"<comma-token>"===o.type?n.push([]):n[n.length-1].push(o)}var a=n.map(en);if(1===a.length&&0===a[0].length)return[{mediaCondition:null,mediaPrefix:null,mediaType:"all"}];var s=a.map(function(e){return 0===e.length?null:nn(e)}),l=[];try{for(var u=Ft(s),c=u.next();!c.done;c=u.next()){var d=c.value;null!==d&&l.push(d)}}catch(e){t={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}if(0===l.length)throw w("No valid media queries");return l},nn=function(e){var t=e[0];if("<(-token>"===t.type)try{return{mediaPrefix:null,mediaType:"all",mediaCondition:rn(e,!0)}}catch(e){throw w("Expected media condition after '('",e)}else{if("<ident-token>"!==t.type)throw w("Expected media condition or media prefix");var r=null,n=void 0,i=t.value;("only"===i||"not"===i)&&(r=i);var o=null===r?0:1;if(e.length<=o)throw w("Expected extra token in media query");var a=e[o];if("<ident-token>"===a.type){var s=a.value;if("all"===s)n="all";else if("print"===s||"screen"===s)n=s;else{if("tty"!==s&&"tv"!==s&&"projection"!==s&&"handheld"!==s&&"braille"!==s&&"embossed"!==s&&"aural"!==s&&"speech"!==s)throw w(`Unknown ident '${s}' in media query`);r="not"===r?null:"not",n="all"}}else{if("not"!==r||"<(-token>"!==a.type)throw w("Invalid media query");var l=[{type:"<(-token>",wsBefore:!1,wsAfter:!1}];l.push.apply(l,e),l.push({type:"<)-token>",wsBefore:!1,wsAfter:!1});try{return{mediaPrefix:null,mediaType:"all",mediaCondition:rn(l,!0)}}catch(e){throw w("Expected media condition after '('",e)}}if(o+1===e.length)return{mediaPrefix:r,mediaType:n,mediaCondition:null};if(!(o+4<e.length))throw w("Expected media condition after media prefix");var u=e[o+1];if("<ident-token>"!==u.type||"and"!==u.value)throw w("Expected 'and' after media prefix");try{return{mediaPrefix:r,mediaType:n,mediaCondition:rn(e.slice(o+2),!1)}}catch(e){throw w("Expected media condition after 'and'",e)}}},rn=function e(t,r,n){if(void 0===n&&(n=null),t.length<3||"<(-token>"!==t[0].type||"<)-token>"!==t[t.length-1].type)throw Error("Invalid media condition");for(var i=t.length-1,o=0,a=0,s=0;s<t.length;s++){var l=t[s];if("<(-token>"===l.type?(a+=1,o=Math.max(o,a)):"<)-token>"===l.type&&--a,0===a){i=s;break}}
1if(0!==a)throw Error("Mismatched parens\nInvalid media condition");var u,c=t.slice(0,i+1);if(u=1===o?an(c):"<ident-token>"===c[1].type&&"not"===c[1].value?e(c.slice(2,-1),!0,"not"):e(c.slice(1,-1),!0),i===t.length-1)return{operator:n,children:[u]};var d=t[i+1];if("<ident-token>"!==d.type)throw Error("Invalid operator\nInvalid media condition");if(null!==n&&n!==d.value)throw Error(`'${d.value}' and '${n}' must not be at same level\nInvalid media condition`);if("or"===d.value&&!r)throw Error("Cannot use 'or' at top level of a media query\nInvalid media condition");if("and"!==d.value&&"or"!==d.value)throw Error(`Invalid operator: '${d.value}'\nInvalid media condition`);var f=e(t.slice(i+2),r,d.value);return{operator:d.value,children:[u].concat(f.children)}},an=function(e){if(e.length<3||"<(-token>"!==e[0].type||"<)-token>"!==e[e.length-1].type)throw Error("Invalid media feature");for(var t=[e[0]],r=1;r<e.length;r++){if(r<e.length-2){var n=e[r],i=e[r+1],o=e[r+2];if("<number-token>"===n.type&&n.value>0&&"<delim-token>"===i.type&&47===i.value&&"<number-token>"===o.type&&o.value>0){t.push({type:"<ratio-token>",numerator:n.value,denominator:o.value,wsBefore:n.wsBefore,wsAfter:o.wsAfter}),r+=2;continue}}t.push(e[r])}var a=t[1];if("<ident-token>"===a.type&&3===t.length)return{context:"boolean",feature:a.value};if(5===t.length&&"<ident-token>"===t[1].type&&"<colon-token>"===t[2].type){var s=t[3];if("<number-token>"===s.type||"<dimension-token>"===s.type||"<ratio-token>"===s.type||"<ident-token>"===s.type){var l=t[1].value,u=null,c=l.slice(0,4);return"min-"===c?(u="min",l=l.slice(4)):"max-"===c&&(u="max",l=l.slice(4)),s.wsBefore,s.wsAfter,{context:"value",prefix:u,feature:l,value:Pt(s,["wsBefore","wsAfter"])}}}else if(t.length>=5)try{var d=on(t);return{context:"range",feature:d.featureName,range:d}}catch(e){throw w("Invalid media feature",e)}throw Error("Invalid media feature")},on=function(e){if(e.length<5||"<(-token>"!==e[0].type||"<)-token>"!==e[e.length-1].type)throw Error("Invalid range");var t={leftToken:null,leftOp:null,featureName:"",rightOp:null,rightToken:null},r="<number-token>"===e[1].type||"<dimension-token>"===e[1].type||"<ratio-token>"===e[1].type||"<ident-token>"===e[1].type&&"infinite"===e[1].value;if("<delim-token>"===e[2].type){if(60===e[2].value)"<delim-token>"!==e[3].type||61!==e[3].value||e[3].wsBefore?t[r?"leftOp":"rightOp"]="<":t[r?"leftOp":"rightOp"]="<=";else if(62===e[2].value)"<delim-token>"!==e[3].type||61!==e[3].value||e[3].wsBefore?t[r?"leftOp":"rightOp"]=">":t[r?"leftOp":"rightOp"]=">=";else{if(61!==e[2].value)throw Error("Invalid range");t[r?"leftOp":"rightOp"]="="}if(r)t.leftToken=e[1];else{if("<ident-token>"!==e[1].type)throw Error("Invalid range");t.featureName=e[1].value}var n=2+(t[r?"leftOp":"rightOp"]?.length??0),i=e[n];if(r){if("<ident-token>"!==i.type)throw Error("Invalid range");if(t.featureName=i.value,e.length>=7){var o=e[n+1],a=e[n+2];if("<delim-token>"!==o.type)throw Error("Invalid range");var s=o.value;if(60===s)"<delim-token>"!==a.type||61!==a.value||a.wsBefore?t.rightOp="<":t.rightOp="<=";else{if(62!==s)throw Error("Invalid range");"<delim-token>"!==a.type||61!==a.value||a.wsBefore?t.rightOp=">":t.rightOp=">="}t.rightToken=e[n+1+(t.rightOp?.length??0)]}else if(n+2!==e.length)throw Error("Invalid range")}else t.rightToken=i;var l=null,u=t.leftToken,c=t.leftOp,d=t.featureName,f=t.rightOp,h=t.rightToken,p=null;if(null!==u)if("<ident-token>"===u.type){var g=u.type;"infinite"===(_=u.value)&&(p={type:g,value:_})}else("<number-token>"===u.type||"<dimension-token>"===u.type||"<ratio-token>"===u.type)&&(u.wsBefore,u.wsAfter,p=Pt(u,["wsBefore","wsAfter"]));var m=null;if(null!==h)if("<ident-token>"===h.type){var _;g=h.type;"infinite"===(_=h.value)&&(m={type:g,value:_})}else("<number-token>"===h.type||"<dimension-token>"===h.type||"<ratio-token>"===h.type)&&(h.wsBefore,h.wsAfter,m=Pt(h,["wsBefore","wsAfter"]));if(null!==p&&null!==m)if("<"!==c&&"<="!==c||"<"!==f&&"<="!==f){if(">"!==c&&">="!==c||">"!==f&&">="!==f)throw Error("Invalid range");l={leftToken:p,leftOp:c,featureName:d,rightOp:f,rightToken:m}}else l={leftToken:p,leftOp:c,featureName:d,rightOp:f,rightToken:m};else(null===p&&null===c&&null!==f&&null!==m||null!==p&&null!==c&&null===f&&null===m)&&(l={leftToken:p,leftOp:c,featureName:d,rightOp:f,rightToken:m});return l}throw Error("Invalid range")};function sn(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function cn(e){var t=sn(e,"string");return"symbol"==typeof t?t:String(t)}function ln(e,t,r){return(t=cn(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function un(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function dn(e){for(var t=1;t<arguments.length;t++){var r=null==arguments[t]?{}:arguments[t];
1t%2?un(Object(r),!0).forEach(function(t){ln(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):un(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function fn(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&(i[r]=e[r]);return i}function pn(e,t){if(null==e)return{};var r,n,i=fn(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var mn=/(?<=^(?:[^"']|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*')*)&/g;function hn(e,t){for(var r in e)t(e[r],r)}function gn(e,t){var r={};for(var n in e)-1===t.indexOf(n)&&(r[n]=e[n]);return r}function _n(e,t){var r={};for(var n in e)r[t(e[n],n)]=e[n];return r}function vn(e){return e.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var wn,yn=/[ -,\.\/:-@\[-\^`\{-~]/,bn=/[ -,\.\/:-@\[\]\^`\{-~]/,xn=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,Sn={escapeEverything:!1,isIdentifier:!1,quotes:"single",wrap:!1};function Cn(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="double"===(t=dn(dn({},Sn),t)).quotes?'"':"'",{isIdentifier:n}=t,i=e.charAt(0),o="",a=0,s=e.length;a<s;){var l=e.charAt(a++),u=l.charCodeAt(0),c=void 0;if(u<32||u>126){if(u>=55296&&u<=56319&&a<s){var d=e.charCodeAt(a++);56320==(64512&d)?u=((1023&u)<<10)+(1023&d)+65536:a--}c="\\"+u.toString(16).toUpperCase()+" "}else c=t.escapeEverything?yn.test(l)?"\\"+l:"\\"+u.toString(16).toUpperCase()+" ":/[\t\n\f\r\x0B]/.test(l)?"\\"+u.toString(16).toUpperCase()+" ":"\\"===l||!n&&('"'===l&&r===l||"'"===l&&r===l)||n&&bn.test(l)?"\\"+l:l;o+=c}return n&&(/^-[-\d]/.test(o)?o="\\-"+o.slice(1):/\d/.test(i)&&(o="\\3"+i+" "+o.slice(1))),o=o.replace(xn,function(e,t,r){return t&&t.length%2?e:(t||"")+r}),!n&&t.wrap?r+o+r:o}function Tn(e,t){for(var r=e.length-1;r>=0;r--){var n=e[r];if("child"===n.type||"parent"===n.type||"sibling"===n.type||"adjacent"===n.type||"descendant"===n.type)return!1;if("attribute"===n.type&&"class"===n.name&&n.value===t||"pseudo"===n.type&&Array.isArray(n.data)&&("is"===n.name||"where"===n.name)&&n.data.every(e=>Tn(e,t)))return!0}return!1}var jn,En=(e,t)=>{var r,n=()=>{var r=RegExp(`.${vn(Cn(t,{isIdentifier:!0}))}`,"g");return e.replace(r,"&")};try{r=Ct(e)}catch(e){throw Error(`Invalid selector: ${n()}`,{cause:e})}r.forEach(e=>{if(!Tn(e,t))throw Error(At(wn||=dt(["\n        Invalid selector: ","\n\n        Style selectors must target the '&' character (along with any modifiers), e.g. "," or ",".\n\n        This is to ensure that each style block only affects the styling of a single class.\n\n        If your selector is targeting another class, you should move it to the style definition for that class, e.g. given we have styles for 'parent' and 'child' elements, instead of adding a selector of ",") to 'parent', you should add "," to 'child').\n\n        If your selector is targeting something global, use the 'globalStyle' function instead, e.g. if you wanted to write ",", you should instead write 'globalStyle(",", { ... })'\n      "]),n(),"`${parent} &`","`${parent} &:hover`","`& ${child}`","`${parent} &`","`& h1`","`${parent} h1`"))})},Dn=class e{constructor(){this.ruleset=new Map,this.precedenceLookup=new Map}findOrCreateCondition(t){var r=this.ruleset.get(t);return r||(r={query:t,rules:[],children:new e},this.ruleset.set(t,r)),r}getConditionalRulesetByPath(e){var t=this;for(var r of e)t=t.findOrCreateCondition(r).children;return t}addRule(e,t,r){var n=this.getConditionalRulesetByPath(r).findOrCreateCondition(t);if(!n)throw Error("Failed to add conditional rule");n.rules.push(e)}addConditionPrecedence(e,t){for(var r=this.getConditionalRulesetByPath(e),n=0;n<t.length;n++){var i=t[n],o=r.precedenceLookup.get(i)??new Set;for(var a of t.slice(n+1))o.add(a);r.precedenceLookup.set(i,o)}}isCompatible(e){for(var[t,r]of this.precedenceLookup.entries())for(var n of r){var i;if(null!=(i=e.precedenceLookup.get(n))&&i.has(t))return!1}for(var{query:o,children:a}of e.ruleset.values()){var s=this.ruleset.get(o);if(s&&!s.children.isCompatible(a))return!1}return!0}merge(e){for(var{query:t,rules:r,children:n}of e.ruleset.values()){var i=this.ruleset.get(t);i?(i.rules.push(...r),i.children.merge(n)):this.ruleset.set(t,{query:t,rules:r,children:n})}for(var[o,a]of e.precedenceLookup.entries()){var s=this.precedenceLookup.get(o)??new Set;this.precedenceLookup.set(o,new Set([...s,...a]))}}
1mergeIfCompatible(e){return!!this.isCompatible(e)&&(this.merge(e),!0)}getSortedRuleset(){var e=this,t=[],r=function(r){var i=e.ruleset.get(n);if(!i)throw Error(`Can't find condition for ${n}`);var o=t.findIndex(e=>r.has(e.query));o>-1?t.splice(o,0,i):t.push(i)};for(var[n,i]of this.precedenceLookup.entries())r(i);return t}renderToArray(){var e=[];for(var{query:t,rules:r,children:n}of this.getSortedRuleset()){var i={};for(var o of r)i[o.selector]=dn(dn({},i[o.selector]),o.rule);Object.assign(i,...n.renderToArray()),e.push({[t]:i})}return e}},On={":-moz-any-link":!0,":-moz-full-screen":!0,":-moz-placeholder":!0,":-moz-read-only":!0,":-moz-read-write":!0,":-ms-fullscreen":!0,":-ms-input-placeholder":!0,":-webkit-any-link":!0,":-webkit-full-screen":!0,"::-moz-color-swatch":!0,"::-moz-list-bullet":!0,"::-moz-list-number":!0,"::-moz-page-sequence":!0,"::-moz-page":!0,"::-moz-placeholder":!0,"::-moz-progress-bar":!0,"::-moz-range-progress":!0,"::-moz-range-thumb":!0,"::-moz-range-track":!0,"::-moz-scrolled-page-sequence":!0,"::-moz-selection":!0,"::-ms-backdrop":!0,"::-ms-browse":!0,"::-ms-check":!0,"::-ms-clear":!0,"::-ms-fill-lower":!0,"::-ms-fill-upper":!0,"::-ms-fill":!0,"::-ms-reveal":!0,"::-ms-thumb":!0,"::-ms-ticks-after":!0,"::-ms-ticks-before":!0,"::-ms-tooltip":!0,"::-ms-track":!0,"::-ms-value":!0,"::-webkit-backdrop":!0,"::-webkit-calendar-picker-indicator":!0,"::-webkit-inner-spin-button":!0,"::-webkit-input-placeholder":!0,"::-webkit-meter-bar":!0,"::-webkit-meter-even-less-good-value":!0,"::-webkit-meter-inner-element":!0,"::-webkit-meter-optimum-value":!0,"::-webkit-meter-suboptimum-value":!0,"::-webkit-outer-spin-button":!0,"::-webkit-progress-bar":!0,"::-webkit-progress-inner-element":!0,"::-webkit-progress-inner-value":!0,"::-webkit-progress-value":!0,"::-webkit-resizer":!0,"::-webkit-scrollbar-button":!0,"::-webkit-scrollbar-corner":!0,"::-webkit-scrollbar-thumb":!0,"::-webkit-scrollbar-track-piece":!0,"::-webkit-scrollbar-track":!0,"::-webkit-scrollbar":!0,"::-webkit-search-cancel-button":!0,"::-webkit-search-results-button":!0,"::-webkit-slider-runnable-track":!0,"::-webkit-slider-thumb":!0,"::after":!0,"::backdrop":!0,"::before":!0,"::cue":!0,"::file-selector-button":!0,"::first-letter":!0,"::first-line":!0,"::grammar-error":!0,"::marker":!0,"::placeholder":!0,"::selection":!0,"::spelling-error":!0,"::target-text":!0,"::view-transition-group":!0,"::view-transition-image-pair":!0,"::view-transition-new":!0,"::view-transition-old":!0,"::view-transition":!0,":active":!0,":after":!0,":any-link":!0,":before":!0,":blank":!0,":checked":!0,":default":!0,":defined":!0,":disabled":!0,":empty":!0,":enabled":!0,":first-child":!0,":first-letter":!0,":first-line":!0,":first-of-type":!0,":first":!0,":focus-visible":!0,":focus-within":!0,":focus":!0,":fullscreen":!0,":hover":!0,":in-range":!0,":indeterminate":!0,":invalid":!0,":last-child":!0,":last-of-type":!0,":left":!0,":link":!0,":only-child":!0,":only-of-type":!0,":optional":!0,":out-of-range":!0,":placeholder-shown":!0,":read-only":!0,":read-write":!0,":required":!0,":right":!0,":root":!0,":scope":!0,":target":!0,":valid":!0,":visited":!0},kn=Object.keys(On),An=On,Mn=(e,t)=>Error(At(jn||=dt(['\n    Invalid media query: "','"\n\n    ',"\n\n    Read more on MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries\n  "]),e,t)),Nn=e=>{if("@media "===e)throw Mn(e,"Query is empty");try{Qt(e)}catch(t){throw Mn(e,t.message)}},Pn=["vars"],Fn=["content"],In="__DECLARATION",Ln={animationIterationCount:!0,borderImage:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,initialLetter:!0,lineClamp:!0,lineHeight:!0,maxLines:!0,opacity:!0,order:!0,orphans:!0,scale:!0,tabSize:!0,WebkitLineClamp:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,maskBorder:!0,maskBorderOutset:!0,maskBorderSlice:!0,maskBorderWidth:!0,shapeImageThreshold:!0,stopOpacity:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function Rn(e){return e.replace(/([A-Z])/g,"-$1").replace(/^ms-/,"-ms-").toLowerCase()}function zn(e,t,r,n){return`${e.slice(0,t)}${n}${e.slice(r)}`}var Bn="  ",Vn=[...kn,"@layer","@scope","@media","@supports","@container","@starting-style","selectors"],Hn=class{constructor(e,t){this.rules=[],this.conditionalRulesets=[new Dn],this.fontFaceRules=[],this.keyframesRules=[],this.propertyRules=[],this.localClassNamesMap=new Map(e.map(e=>[e,e])),this.localClassNamesSearch=new it(e),this.layers=new Map,this.composedClassLists=t.map(e=>{var{identifier:t,classList:r}=e;return{identifier:t,regex:RegExp(`(${vn(r)})`,"g")}}).reverse()}processCssObj(e){if("fontFace"!==e.type)if("property"!==e.type){if("keyframes"===e.type)return e.rule=Object.fromEntries(Object.entries(e.rule).map(e=>{var[t,r]=e;return[t,this.transformVars(this.transformProperties(r))]})),void this.keyframesRules.push(e);if(this.currConditionalRuleset=new Dn,"layer"===e.type){var t=`@layer ${e.name}`;this.addLayer([t])}else{var r=gn(e.rule,Vn);this.addRule({selector:e.selector,rule:r}),this.transformLayer(e,e.rule["@layer"]),this.transformScope(e,e.rule["@scope"]),this.transformMedia(e,e.rule["@media"]),this.transformSupports(e,e.rule["@supp
1orts"]),this.transformContainer(e,e.rule["@container"]),this.transformStartingStyle(e,e.rule["@starting-style"]),this.transformSimplePseudos(e,e.rule),this.transformSelectors(e,e.rule)}this.conditionalRulesets[this.conditionalRulesets.length-1].mergeIfCompatible(this.currConditionalRuleset)||this.conditionalRulesets.push(this.currConditionalRuleset)}else this.propertyRules.push(e);else this.fontFaceRules.push(e.rule)}addConditionalRule(e,t){var r=this.transformVars(this.transformProperties(e.rule)),n=this.transformSelector(e.selector);if(!this.currConditionalRuleset)throw Error("Couldn't add conditional rule");var i=t[t.length-1],o=t.slice(0,t.length-1);this.currConditionalRuleset.addRule({selector:n,rule:r},i,o)}addRule(e){var t=this.transformVars(this.transformProperties(e.rule)),r=this.transformSelector(e.selector);this.rules.push({selector:r,rule:t})}addLayer(e){var t=e.join(" - ");this.layers.set(t,e)}transformProperties(e){return this.transformContent(this.pixelifyProperties(e))}pixelifyProperties(e){return hn(e,(t,r)=>{"number"==typeof t&&0!==t&&!Ln[r]&&(e[r]=`${t}px`)}),e}transformVars(e){var{vars:t}=e,r=pn(e,Pn);return t?dn(dn({},_n(t,(e,t)=>tt(t))),r):r}transformContent(e){var{content:t}=e,r=pn(e,Fn);return void 0===t?r:dn({content:(Array.isArray(t)?t:[t]).map(e=>e&&(e.includes('"')||e.includes("'")||/^([A-Za-z-]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)(\s|$)/.test(e))?e:`"${e}"`)},r)}transformClassname(e){return`.${Cn(e,{isIdentifier:!0})}`}transformSelector(e){var t=e,r=function(e){t=t.replace(i,()=>(ut(e),e))};for(var{identifier:n,regex:i}of this.composedClassLists)r(n);if(this.localClassNamesMap.has(t))return this.transformClassname(t);for(var o=this.localClassNamesSearch.search(t),a=t.length,s=o.length-1;s>=0;s--){var[l,[u]]=o[s],c=l-u.length+1;a<=l||(a=c,"."!==t[c-1]&&(t=zn(t,c,l+1,this.transformClassname(u))))}return t}transformSelectors(e,t,r){hn(t.selectors,(t,n)=>{if("local"!==e.type)throw Error("Selectors are not allowed within "+("global"===e.type?'"globalStyle"':'"selectors"'));var i=this.transformSelector(n.replace(RegExp("&","g"),e.selector));En(i,e.selector);var o={selector:i,rule:gn(t,Vn)};r?this.addConditionalRule(o,r):this.addRule(o);var a={type:"selector",selector:i,rule:t};this.transformLayer(a,t["@layer"],r),this.transformScope(a,t["@scope"],r),this.transformSupports(a,t["@supports"],r),this.transformMedia(a,t["@media"],r),this.transformContainer(a,t["@container"],r),this.transformStartingStyle(a,t["@starting-style"],r)})}transformMedia(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(t)for(var[i,o]of(null==(r=this.currConditionalRuleset)||r.addConditionPrecedence(n,Object.keys(t).map(e=>`@media ${e}`)),Object.entries(t))){var a=`@media ${i}`;Nn(a);var s=[...n,a];this.addConditionalRule({selector:e.selector,rule:gn(o,Vn)},s),"local"===e.type&&(this.transformSimplePseudos(e,o,s),this.transformSelectors(e,o,s)),this.transformLayer(e,o["@layer"],s),this.transformScope(e,o["@scope"],s),this.transformSupports(e,o["@supports"],s),this.transformContainer(e,o["@container"],s),this.transformStartingStyle(e,o["@starting-style"],s)}}transformContainer(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];t&&(null==(r=this.currConditionalRuleset)||r.addConditionPrecedence(n,Object.keys(t).map(e=>`@container ${e}`)),hn(t,(t,r)=>{var i=`@container ${r}`,o=[...n,i];this.addConditionalRule({selector:e.selector,rule:gn(t,Vn)},o),"local"===e.type&&(this.transformSimplePseudos(e,t,o),this.transformSelectors(e,t,o)),this.transformLayer(e,t["@layer"],o),this.transformScope(e,t["@scope"],o),this.transformSupports(e,t["@supports"],o),this.transformMedia(e,t["@media"],o),this.transformStartingStyle(e,t["@starting-style"],o)}))}transformLayer(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];t&&(null==(r=this.currConditionalRuleset)||r.addConditionPrecedence(n,Object.keys(t).map(e=>`@layer ${e}`)),hn(t,(t,r)=>{var i=[...n,`@layer ${r}`];this.addLayer(i),this.addConditionalRule({selector:e.selector,rule:gn(t,Vn)},i),"local"===e.type&&(this.transformSimplePseudos(e,t,i),this.transformSelectors(e,t,i)),this.transformScope(e,t["@scope"],i),this.transformMedia(e,t["@media"],i),this.transformSupports(e,t["@supports"],i),this.transformContainer(e,t["@container"],i),this.transformStartingStyle(e,t["@starting-style"],i)}))}transformScope(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(t){var n,i={};for(var[o,a]of(null==(n=this.currConditionalRuleset)||n.addConditionPrecedence(r,Object.keys(t).map(t=>(i[t]=`@scope ${this.transformSelector(t.replace(mn,e.selector))}`,i[t]))),Object.entries(t))){var s=[...r,i[o]];this.addConditionalRule({selector:e.selector,rule:gn(a,Vn)},s),"local"===e.type&&(this.transformSimplePseudos(e,a,s),this.transformSelectors(e,a,s)),this.transformLayer(e,a["@layer"],s),this.transformMedia(e,a["@media"],s),this.transformSupports(e,a["@supports"],s),this.transformContainer(e,a["@container"],s),this.transformStartingStyle(e,a["@starting-style"],s)}}}transformSupports(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];t&&(null==(r=this.currConditionalRuleset)||r.addConditionPrecedence(n,Object.keys(t).map(e=>`@supports ${e}`)),hn(t,(t,r)=>{var i=[...n,`@supports ${r}`];this.addConditionalRule({selector:e.selector,rule:gn(t,Vn)},i),"local"===e.type&&(this.transformSimplePseudos(e,t,i),this.transformSelectors(e,t,i)),this.transformLayer(e,t["@layer"],i),this.transformScope(e,t["@scope"],i),this.transformMedia(e,t["@media"],i),this.transformContainer(e,t["@container"],i),this.transformStartingStyle(e,t["@starting-style"],i)}))}transformSimplePseudos(e,t,r){for(var n of Object.keys(t))if(An[n]){if("local"!==e.type)throw Error("Simple pseudos are not valid in "+("global"===e.type?'"globalStyle"'
1:'"selectors"'));r?this.addConditionalRule({selector:`${e.selector}${n}`,rule:t[n]},r):this.addRule({conditions:r,selector:`${e.selector}${n}`,rule:t[n]})}}transformStartingStyle(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(t){var n,i=Object.keys(t).find(e=>e.startsWith("@"));if(i)throw Error(`Nested at-rules (e.g. "${i}") are not allowed inside @starting-style.`);null==(n=this.currConditionalRuleset)||n.addConditionPrecedence(r,["@starting-style"]);var o=[...r,"@starting-style"];this.addConditionalRule({selector:e.selector,rule:gn(t,Vn)},o),"local"===e.type&&(this.transformSimplePseudos(e,t,o),this.transformSelectors(e,t,o))}}toCss(){var e=[];for(var t of this.fontFaceRules)e.push(Un({"@font-face":t}));for(var r of this.propertyRules)e.push(Un({[`@property ${r.name}`]:r.rule}));for(var n of this.keyframesRules)e.push(Un({[`@keyframes ${n.name}`]:n.rule}));for(var i of this.layers.values()){var[o,...a]=i.reverse(),s={[o]:In};for(var l of a)s={[l]:s};e.push(Un(s))}for(var u of this.rules)e.push(Un({[u.selector]:u.rule}));for(var c of this.conditionalRulesets)for(var d of c.renderToArray())e.push(Un(d));return e.filter(Boolean)}};function Un(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=[],n=function(n){var i=e[n];i&&Array.isArray(i)?r.push(...i.map(e=>Un({[n]:e},t))):i&&"object"==typeof i?0!==Object.keys(i).length&&r.push(`${t}${n} {\n${Un(i,t+Bn)}\n${t}}`):i===In?r.push(`${t}${n};`):r.push(`${t}${n.startsWith("--")?n:Rn(n)}: ${i};`)};for(var i of Object.keys(e))n(i);return r.join("\n")}function Wn(e){var{localClassNames:t,cssObjs:r,composedClassLists:n}=e,i=new Hn(t,n);for(var o of r)i.processCssObj(o);return i.toCss()}var Gn="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,Kn=new Set,qn="object"==typeof process&&process?process:{},Jn=(e,t,r,n)=>{"function"==typeof qn.emitWarning?qn.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)},Yn=globalThis.AbortController,Xn=globalThis.AbortSignal;if(void 0===Yn){Xn=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},Yn=class{constructor(){t()}signal=new Xn;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==qn.env?.LRU_CACHE_IGNORE_AC_WARNING,t=()=>{e&&(e=!1,Jn("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var Zn=e=>!Kn.has(e),Qn=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),$n=e=>Qn(e)?e<=256?Uint8Array:e<=65536?Uint16Array:e<=2**32?Uint32Array:e<=2**53-1?er:null:null,er=class extends Array{constructor(e){super(e),this.fill(0)}},tr=class e{heap;length;static#e=!1;static create(t){let r=$n(t);if(!r)return[];e.#e=!0;let n=new e(t,r);return e.#e=!1,n}constructor(t,r){if(!e.#e)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},nr=class e{#e;#t;#r;#n;#i;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#s;#l;#u;#c;#d;#f;#h;#p;#g;#m;#_;#y;#v;#b;#S;#w;static unsafeExposeInternals(e){return{starts:e.#y,ttls:e.#v,sizes:e.#_,keyMap:e.#l,keyList:e.#u,valList:e.#c,next:e.#d,prev:e.#f,get head(){return e.#h},get tail(){return e.#p},free:e.#g,isBackgroundFetch:t=>e.#E(t),backgroundFetch:(t,r,n,i)=>e.#k(t,r,n,i),moveToTail:t=>e.#C(t),indexes:t=>e.#x(t),rindexes:t=>e.#A(t),isStale:t=>e.#T(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#s}get size(){return this.#a}get fetchMethod(){return this.#i}get memoMethod(){return this.#o}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(t){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:o,updateAgeOnGet:a,updateAgeOnHas:s,allowStale:l,dispose:u,disposeAfter:c,noDisposeOnSet:d,noUpdateTTL:f,maxSize:h=0,maxEntrySize:p=0,sizeCalculation:g,fetchMethod:m,memoMethod:_,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:v,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:S,ignoreFetchAbort:w}=t;if(0!==r&&!Qn(r))throw TypeError("max option must be a nonnegative integer");let E=r?$n(r):Array;if(!E)throw Error("invalid max value: "+r);if(this.#e=r,this.#t=h,this.maxEntrySize=p||this.#t,this.sizeCalculation=g,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw TypeError("sizeCalculation set to non-function")}if(void 0!==_&&"function"!=typeof _)throw TypeError("memoMethod must be a function if defined");if(this.#o=_,void 0!==m&&"function"!=typeof m)throw TypeError("fetchMethod must be a function if specified");
1if(this.#i=m,this.#S=!!m,this.#l=new Map,this.#u=Array(r).fill(void 0),this.#c=Array(r).fill(void 0),this.#d=new E(r),this.#f=new E(r),this.#h=0,this.#p=0,this.#g=tr.create(r),this.#a=0,this.#s=0,"function"==typeof u&&(this.#r=u),"function"==typeof c?(this.#n=c,this.#m=[]):(this.#n=void 0,this.#m=void 0),this.#b=!!this.#r,this.#w=!!this.#n,this.noDisposeOnSet=!!d,this.noUpdateTTL=!!f,this.noDeleteOnFetchRejection=!!y,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!S,this.ignoreFetchAbort=!!w,0!==this.maxEntrySize){if(0!==this.#t&&!Qn(this.#t))throw TypeError("maxSize must be a positive integer if specified");if(!Qn(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#O()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!v,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!s,this.ttlResolution=Qn(i)||0===i?i:1,this.ttlAutopurge=!!o,this.ttl=n||0,this.ttl){if(!Qn(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#I()}if(0===this.#e&&0===this.ttl&&0===this.#t)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t="LRU_CACHE_UNBOUNDED";Zn(t)&&(Kn.add(t),Jn("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,e))}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#I(){let e=new er(this.#e),t=new er(this.#e);this.#v=e,this.#y=t,this.#R=(r,n,i=Gn.now())=>{if(t[r]=0===n?0:i,e[r]=n,0!==n&&this.ttlAutopurge){let e=setTimeout(()=>{this.#T(r)&&this.#D(this.#u[r],"expire")},n+1);e.unref&&e.unref()}},this.#P=r=>{t[r]=0===e[r]?0:Gn.now()},this.#L=(i,o)=>{if(e[o]){let a=e[o],s=t[o];if(!a||!s)return;i.ttl=a,i.start=s,i.now=r||n(),i.remainingTTL=a-(i.now-s)}};let r=0,n=()=>{let e=Gn.now();if(this.ttlResolution>0){r=e;let t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=i=>{let o=this.#l.get(i);if(void 0===o)return 0;let a=e[o],s=t[o];return a&&s?a-((r||n())-s):1/0},this.#T=i=>{let o=t[i],a=e[i];return!!a&&!!o&&(r||n())-o>a}}#P=()=>{};#L=()=>{};#R=()=>{};#T=()=>!1;#O(){let e=new er(this.#e);this.#s=0,this.#_=e,this.#N=t=>{this.#s-=e[t],e[t]=0},this.#M=(e,t,r,n)=>{if(this.#E(t))return 0;if(!Qn(r)){if(!n)throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw TypeError("sizeCalculation must be a function");if(r=n(t,e),!Qn(r))throw TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#U=(t,r,n)=>{if(e[t]=r,this.#t){let r=this.#t-e[t];for(;this.#s>r;)this.#F(!0)}this.#s+=e[t],n&&(n.entrySize=r,n.totalCalculatedSize=this.#s)}}#N=e=>{};#U=(e,t,r)=>{};#M=(e,t,r,n)=>{if(r||n)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#x({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#p;this.#j(t)&&((e||!this.#T(t))&&(yield t),t!==this.#h);)t=this.#f[t]}*#A({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#h;this.#j(t)&&((e||!this.#T(t))&&(yield t),t!==this.#p);)t=this.#d[t]}#j(e){return void 0!==e&&this.#l.get(this.#u[e])===e}*entries(){for(let e of this.#x())void 0!==this.#c[e]&&void 0!==this.#u[e]&&!this.#E(this.#c[e])&&(yield[this.#u[e],this.#c[e]])}*rentries(){for(let e of this.#A())void 0!==this.#c[e]&&void 0!==this.#u[e]&&!this.#E(this.#c[e])&&(yield[this.#u[e],this.#c[e]])}*keys(){for(let e of this.#x()){let t=this.#u[e];void 0!==t&&!this.#E(this.#c[e])&&(yield t)}}*rkeys(){for(let e of this.#A()){let t=this.#u[e];void 0!==t&&!this.#E(this.#c[e])&&(yield t)}}*values(){for(let e of this.#x())void 0!==this.#c[e]&&!this.#E(this.#c[e])&&(yield this.#c[e])}*rvalues(){for(let e of this.#A())void 0!==this.#c[e]&&!this.#E(this.#c[e])&&(yield this.#c[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#x()){let n=this.#c[r],i=this.#E(n)?n.__staleWhileFetching:n;if(void 0!==i&&e(i,this.#u[r],this))return this.get(this.#u[r],t)}}forEach(e,t=this){for(let r of this.#x()){let n=this.#c[r],i=this.#E(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#u[r],this)}}
1rforEach(e,t=this){for(let r of this.#A()){let n=this.#c[r],i=this.#E(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#u[r],this)}}purgeStale(){let e=!1;for(let t of this.#A({allowStale:!0}))this.#T(t)&&(this.#D(this.#u[t],"expire"),e=!0);return e}info(e){let t=this.#l.get(e);if(void 0===t)return;let r=this.#c[t],n=this.#E(r)?r.__staleWhileFetching:r;if(void 0===n)return;let i={value:n};if(this.#v&&this.#y){let e=this.#v[t],r=this.#y[t];e&&r&&(i.ttl=e-(Gn.now()-r),i.start=Date.now())}return this.#_&&(i.size=this.#_[t]),i}dump(){let e=[];for(let t of this.#x({allowStale:!0})){let r=this.#u[t],n=this.#c[t],i=this.#E(n)?n.__staleWhileFetching:n;if(void 0===i||void 0===r)continue;let o={value:i};if(this.#v&&this.#y){o.ttl=this.#v[t];let e=Gn.now()-this.#y[t];o.start=Math.floor(Date.now()-e)}this.#_&&(o.size=this.#_[t]),e.unshift([r,o])}return e}load(e){this.clear();for(let[t,r]of e){if(r.start){let e=Date.now()-r.start;r.start=Gn.now()-e}this.set(t,r.value,r)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;let{ttl:n=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:s}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,u=this.#M(e,t,r.size||0,a);if(this.maxEntrySize&&u>this.maxEntrySize)return s&&(s.set="miss",s.maxEntrySizeExceeded=!0),this.#D(e,"set"),this;let c=0===this.#a?void 0:this.#l.get(e);if(void 0===c)c=0===this.#a?this.#p:0===this.#g.length?this.#a===this.#e?this.#F(!1):this.#a:this.#g.pop(),this.#u[c]=e,this.#c[c]=t,this.#l.set(e,c),this.#d[this.#p]=c,this.#f[c]=this.#p,this.#p=c,this.#a++,this.#U(c,u,s),s&&(s.set="add"),l=!1;else{this.#C(c);let r=this.#c[c];if(t!==r){if(this.#S&&this.#E(r)){r.__abortController.abort(Error("replaced"));let{__staleWhileFetching:t}=r;void 0!==t&&!o&&(this.#b&&this.#r?.(t,e,"set"),this.#w&&this.#m?.push([t,e,"set"]))}else o||(this.#b&&this.#r?.(r,e,"set"),this.#w&&this.#m?.push([r,e,"set"]));if(this.#N(c),this.#U(c,u,s),this.#c[c]=t,s){s.set="replace";let e=r&&this.#E(r)?r.__staleWhileFetching:r;void 0!==e&&(s.oldValue=e)}}else s&&(s.set="update")}if(0!==n&&!this.#v&&this.#I(),this.#v&&(l||this.#R(c,n,i),s&&this.#L(s,c)),!o&&this.#w&&this.#m){let e,t=this.#m;for(;e=t?.shift();)this.#n?.(...e)}return this}pop(){try{for(;this.#a;){let e=this.#c[this.#h];if(this.#F(!0),this.#E(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#w&&this.#m){let e,t=this.#m;for(;e=t?.shift();)this.#n?.(...e)}}}#F(e){let t=this.#h,r=this.#u[t],n=this.#c[t];return this.#S&&this.#E(n)?n.__abortController.abort(Error("evicted")):(this.#b||this.#w)&&(this.#b&&this.#r?.(n,r,"evict"),this.#w&&this.#m?.push([n,r,"evict"])),this.#N(t),e&&(this.#u[t]=void 0,this.#c[t]=void 0,this.#g.push(t)),1===this.#a?(this.#h=this.#p=0,this.#g.length=0):this.#h=this.#d[t],this.#l.delete(r),this.#a--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,i=this.#l.get(e);if(void 0!==i){let e=this.#c[i];if(this.#E(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#T(i))return r&&this.#P(i),n&&(n.has="hit",this.#L(n,i)),!0;n&&(n.has="stale",this.#L(n,i))}else n&&(n.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,n=this.#l.get(e);if(void 0===n||!r&&this.#T(n))return;let i=this.#c[n];return this.#E(i)?i.__staleWhileFetching:i}#k(e,t,r,n){let i=void 0===t?void 0:this.#c[t];if(this.#E(i))return i;let o=new Yn,{signal:a}=r;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let s={signal:o.signal,options:r,context:n},l=(n,i=!1)=>{let{aborted:a}=o.signal,l=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(a&&!i?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,l&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),a&&!l&&!i)return u(o.signal.reason);let d=c;return this.#c[t]===c&&(void 0===n?d.__staleWhileFetching?this.#c[t]=d.__staleWhileFetching:this.#D(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,n,s.options))),n},u=n=>{let{aborted:i}=o.signal,a=i&&r.allowStaleOnFetchAbort,s=a||r.allowStaleOnFetchRejection,l=s||r.noDeleteOnFetchRejection,u=c;if(this.#c[t]===c&&(l&&void 0!==u.__staleWhileFetching?a||(this.#c[t]=u.__staleWhileFetching):this.#D(e,"fetch")),s)return r.status&&void 0!==u.__staleWhileFetching&&(r.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw n};
1r.status&&(r.status.fetchDispatched=!0);let c=new Promise((t,n)=>{let a=this.#i?.(e,i,s);a&&a instanceof Promise&&a.then(e=>t(void 0===e?void 0:e),n),o.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>l(e,!0)))})}).then(l,e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),u(e))),d=Object.assign(c,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return void 0===t?(this.set(e,d,{...s.options,status:void 0}),t=this.#l.get(e)):this.#c[t]=d,d}#E(e){if(!this.#S)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Yn}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:s=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:d=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:h=this.allowStaleOnFetchAbort,context:p,forceRefresh:g=!1,status:m,signal:_}=t;if(!this.#S)return m&&(m.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:m});let y={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:a,size:s,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:d,allowStaleOnFetchAbort:h,ignoreFetchAbort:f,status:m,signal:_},v=this.#l.get(e);if(void 0===v){m&&(m.fetch="miss");let t=this.#k(e,v,y,p);return t.__returned=t}{let t=this.#c[v];if(this.#E(t)){let e=r&&void 0!==t.__staleWhileFetching;return m&&(m.fetch="inflight",e&&(m.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#T(v);if(!g&&!i)return m&&(m.fetch="hit"),this.#C(v),n&&this.#P(v),m&&this.#L(m,v),t;let o=this.#k(e,v,y,p),a=void 0!==o.__staleWhileFetching&&r;return m&&(m.fetch=i?"stale":"refresh",a&&i&&(m.returnedStale=!0)),a?o.__staleWhileFetching:o.__returned=o}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(void 0===r)throw Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#o;if(!r)throw Error("no memoMethod provided to constructor");let{context:n,forceRefresh:i,...o}=t,a=this.get(e,o);if(!i&&void 0!==a)return a;let s=r(e,a,{options:o,context:n});return this.set(e,s,o),s}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=t,a=this.#l.get(e);if(void 0!==a){let t=this.#c[a],s=this.#E(t);return o&&this.#L(o,a),this.#T(a)?(o&&(o.get="stale"),s?(o&&r&&void 0!==t.__staleWhileFetching&&(o.returnedStale=!0),r?t.__staleWhileFetching:void 0):(i||this.#D(e,"expire"),o&&r&&(o.returnedStale=!0),r?t:void 0)):(o&&(o.get="hit"),s?t.__staleWhileFetching:(this.#C(a),n&&this.#P(a),t))}o&&(o.get="miss")}#$(e,t){this.#f[t]=e,this.#d[e]=t}#C(e){e!==this.#p&&(e===this.#h?this.#h=this.#d[e]:this.#$(this.#f[e],this.#d[e]),this.#$(this.#p,e),this.#p=e)}delete(e){return this.#D(e,"delete")}#D(e,t){let r=!1;if(0!==this.#a){let n=this.#l.get(e);if(void 0!==n)if(r=!0,1===this.#a)this.#B(t);else{this.#N(n);let r=this.#c[n];if(this.#E(r)?r.__abortController.abort(Error("deleted")):(this.#b||this.#w)&&(this.#b&&this.#r?.(r,e,t),this.#w&&this.#m?.push([r,e,t])),this.#l.delete(e),this.#u[n]=void 0,this.#c[n]=void 0,n===this.#p)this.#p=this.#f[n];else if(n===this.#h)this.#h=this.#d[n];else{let e=this.#f[n];this.#d[e]=this.#d[n];let t=this.#d[n];this.#f[t]=this.#f[n]}this.#a--,this.#g.push(n)}}if(this.#w&&this.#m?.length){let e,t=this.#m;for(;e=t?.shift();)this.#n?.(...e)}return r}clear(){return this.#B("delete")}#B(e){for(let t of this.#A({allowStale:!0})){let r=this.#c[t];if(this.#E(r))r.__abortController.abort(Error("deleted"));else{let n=this.#u[t];this.#b&&this.#r?.(r,n,e),this.#w&&this.#m?.push([r,n,e])}}if(this.#l.clear(),this.#c.fill(void 0),this.#u.fill(void 0),this.#v&&this.#y&&(this.#v.fill(0),this.#y.fill(0)),this.#_&&this.#_.fill(0),this.#h=0,this.#p=0,this.#g.length=0,this.#s=0,this.#a=0,this.#w&&this.#m){let e,t=this.#m;for(;e=t?.shift();)this.#n?.(...e)}}};t((e,t)=>
1{var r=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===n}(e)}(e)};var n="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(e,t){return!1!==t.clone&&t.isMergeableObject(e)?u(function(e){return Array.isArray(e)?[]:{}}(e),e,t):e}function o(e,t,r){return e.concat(t).map(function(e){return i(e,r)})}function a(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}(e))}function s(e,t){try{return t in e}catch{return!1}}function l(e,t,r){var n={};return r.isMergeableObject(e)&&a(e).forEach(function(t){n[t]=i(e[t],r)}),a(t).forEach(function(o){(function(e,t){return s(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,o)||(s(e,o)&&r.isMergeableObject(t[o])?n[o]=function(e,t){if(!t.customMerge)return u;var r=t.customMerge(e);return"function"==typeof r?r:u}(o,r)(e[o],t[o],r):n[o]=i(t[o],r))}),n}function u(e,t,n){n||={},n.arrayMerge=n.arrayMerge||o,n.isMergeableObject=n.isMergeableObject||r,n.cloneUnlessOtherwiseSpecified=i;var a=Array.isArray(t);return a===Array.isArray(e)?a?n.arrayMerge(e,t,n):l(e,t,n):i(t,n)}u.all=function(e,t){if(!Array.isArray(e))throw Error("first argument should be an array");return e.reduce(function(e,r){return u(e,r,t)},{})},t.exports=u})();var rr=new Set,ir=[],ar=[];ct({appendCss:e=>{ar.push(e)},registerClassName:e=>{rr.add(e)},registerComposition:e=>{ir.push(e)},markCompositionUsed:()=>{},onEndFileScope:e=>{et({fileScope:e,css:Wn({localClassNames:Array.from(rr),composedClassLists:ir,cssObjs:ar}).join("\n")}),ar=[]},getIdentOption:()=>"short"});var or=(e,t)=>{for(var r=t-1;r>=0;){if("/"===e[r])return r;r--}return-1},sr=e=>{var t,r=e.lastIndexOf(".css");if(-1===r)return"";var n=or(e,r);if(t=e.slice(n+1,r),-1===n)return t;var i=or(e,n-1),o=e.slice(i+1,n);return"index"===t?o:t};(()=>{var e=new nr({max:500})})();var cr={xxs:"all and (min-width: 360px)",xs:"all and (min-width: 480px)",sm:"all and (min-width: 720px)",md:"all and (min-width: 960px)",lg:"all and (min-width: 1200px)",xl:"all and (min-width: 1440px)",base:{xxs:"(min-width: 360px)",xs:"(min-width: 480px)",sm:"(min-width: 720px)",md:"(min-width: 960px)",lg:"(min-width: 1200px)",xl:"(min-width: 1440px)"},values:{xxs:"360px",xs:"480px",sm:"720px",md:"960px",lg:"1200px",xl:"1440px"}};function lr(e){return window.matchMedia(cr[e]).matches}function ur(){return window.dataLayer||(window.dataLayer=[]),window.dataLayer}function dr(e,t={}){let r=window.location.pathname,n={event:e,device:lr("md")?"desktop":"mobile",page_path:r,...t};ur().push(n)}function fr(){let e=e=>ur().push({event:"core_web_vitals",webVitalsMeasurement:{id:e.id,name:e.name,value:Math.round("CLS"===e.name?1e3*e.value:e.value)}});Ee(e),Ve(e),We(e)}function pr(){try{return x("mixpanelProperties").get()??{}}catch{return{}}}function mr(e,t){try{let r=pr();x("mixpanelProperties").set({base:r.base??{},experiments:r.experiments??{},[e]:{...r[e],...t}})}catch{}}function hr(){if(typeof window>"u")return{};try{let e=pr(),t=x("utm").get(),r="bd-traveladvisors"===t?.utm_medium&&t?.utm_campaign?t.utm_campaign:null;return{...e?.base??{},...e?.experiments??{},...t??{},...r?{advisor_id:r}:{},...r&&t?.utm_source?{agency_id:t.utm_source}:{}}}catch{return{}}}function gr(e){let t=hr();return Object.keys(t).length?{...t,...e}:e}var _r={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},vr=console,yr={};Object.keys(_r).forEach(e=>{yr[e]=vr[e]});var br="Datadog Browser SDK:",T={debug:yr.debug.bind(vr,br),log:yr.log.bind(vr,br),info:yr.info.bind(vr,br),warn:yr.warn.bind(vr,br),error:yr.error.bind(vr,br)},xr="https://docs.datadoghq.com",Sr=`${xr}/real_user_monitoring/browser/troubleshooting`,Cr="More details:";function wr(e,t){return(...r)=>{try{return e(...r)}catch(e){T.error(t,e)}}}function Tr(e){return 0!==e&&100*Math.random()<=e}function Er(e,t){return+e.toFixed(t)}function Dr(e){return Or(e)&&e>=0&&e<=100}function Or(e){return"number"==typeof e}function kr(e){try{return JSON.parse(e)}catch{}}function Ar(e){return{...e}}function jr(e,t){return Object.keys(e).some(r=>e[r]===t)}function Mr(e){return 0===Object.keys(e).length}function Nr(e,t){let r={};for(let n of Object.keys(e))r[n]=t(e[n]);return r}
1function E(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get(){return this},configurable:!0});let e=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof e&&(e="object"==typeof self?self:"object"==typeof window?window:{}),e}var Pr=E(),Fr="WorkerGlobalScope"in Pr;function Ir(e,t){let r,n=E();return n.Zone&&"function"==typeof n.Zone.__symbol__&&(r=e[n.Zone.__symbol__(t)]),r||=e[t],r}var Lr,Rr=!1;function zr(e){Lr=e}function Br(e){Rr=e}function D(e){return function(...t){return Vr(e,this,t)}}function Vr(e,t,r){try{return e.apply(t,r)}catch(e){Hr(e)}}function Hr(e){if(Ur(e),Lr)try{Lr(e)}catch(e){Ur(e)}}function Ur(...e){Rr&&T.error("[MONITOR]",...e)}function O(e,t){return Ir(E(),"setTimeout")(D(e),t)}function k(e){Ir(E(),"clearTimeout")(e)}function Wr(e,t){return Ir(E(),"setInterval")(D(e),t)}function Gr(e){Ir(E(),"clearInterval")(e)}function Kr(e){let t=Pr.queueMicrotask;"function"==typeof t?t(D(e)):Promise.resolve().then(D(e))}var A=class{constructor(e){this.onFirstSubscribe=e,this.observers=[]}subscribe(e){return this.addObserver(e),{unsubscribe:()=>this.removeObserver(e)}}notify(e){this.observers.forEach(t=>t(e))}addObserver(e){this.observers.push(e),1===this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0)}removeObserver(e){this.observers=this.observers.filter(t=>e!==t),!this.observers.length&&this.onLastUnsubscribe&&this.onLastUnsubscribe()}};function qr(...e){return new A(t=>{let r=e.map(e=>e.subscribe(e=>t.notify(e)));return()=>r.forEach(e=>e.unsubscribe())})}var ci,Jr=class extends A{constructor(e){super(),this.maxBufferSize=e,this.buffer=[]}notify(e){this.buffer.push(e),this.buffer.length>this.maxBufferSize&&this.buffer.shift(),super.notify(e)}subscribe(e){let t=!1;return Kr(()=>{for(let r of this.buffer){if(t)return;e(r)}t||this.addObserver(e)}),{unsubscribe:()=>{t=!0,this.removeObserver(e)}}}unbuffer(){Kr(()=>{this.maxBufferSize=this.buffer.length=0})}},j=1e3,M=60*j,Yr=60*M,Xr=24*Yr*365;function Zr(e){return{relative:e,timeStamp:$r(e)}}function Qr(e){return{relative:ai(e),timeStamp:e}}function $r(e){let t=ti()-performance.now();return t>li()?Math.round(ii(t,e)):oi(e)}function ei(){return Math.round(ti()-ii(li(),performance.now()))}function N(e){return Or(e)?Er(1e6*e,0):e}function ti(){return(new Date).getTime()}function P(){return ti()}function ni(){return performance.now()}function F(){return{relative:ni(),timeStamp:P()}}function ri(){return{relative:0,timeStamp:li()}}function I(e,t){return t-e}function ii(e,t){return e+t}function ai(e){return e-li()}function oi(e){return Math.round(ii(li(),e))}function si(e){return e<Xr}function li(){return void 0===ci&&(ci=performance.timing?.navigationStart??performance.timeOrigin),ci}function ui(e,t,r){let n,i,o=!r||void 0===r.leading||r.leading,a=!r||void 0===r.trailing||r.trailing,s=!1;return{throttled:(...r)=>{s?n=r:(o?e(...r):n=r,s=!0,i=O(()=>{a&&n&&e(...n),s=!1,n=void 0},t))},cancel:()=>{k(i),s=!1,n=void 0}}}function L(){}function R(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,R)}var vi,Ti,Ai,Pi,di=/(\S+?)\s*=\s*(.+?)(?:;|$)/g;function fi(e,t){for(di.lastIndex=0;;){let r=di.exec(e);if(!r)break;if(r[1]===t)return r[2]}}function pi(e){let t=new Map;for(di.lastIndex=0;;){let r=di.exec(e);if(!r)break;{let e=r[1],n=r[2];t.has(e)?t.get(e).push(n):t.set(e,[n])}}return t}function mi(e){let t=new Map;for(di.lastIndex=0;;){let r=di.exec(e);if(!r)break;t.set(r[1],r[2])}return t}function hi(e,t,r=""){let n=e.charCodeAt(t-1),i=n>=55296&&n<=56319?t+1:t;return e.length<=i?e:`${e.slice(0,i)}${r}`}function gi(){return 0===yi()}function _i(){return 1===yi()}function yi(){return vi??=bi()}function bi(e=window){let t=e.navigator.userAgent;return e.chrome||/HeadlessChrome/.test(t)?0:0===e.navigator.vendor?.indexOf("Apple")||/safari/i.test(t)&&!/chrome|android/i.test(t)?1:2}function xi(e){return wi(e,location.href).href}function Si(e){try{return!!wi(e)}catch{return!1}}function Ci(e){let t=wi(e).pathname;return"/"===t[0]?t:`/${t}`}function wi(e,t){let{URL:r}=Ei();try{return void 0===t?new r(e):new r(e,t)}catch(e){throw Error(`Failed to construct URL: ${String(e)}`)}}function Ei(){if(!Ti){let e,t;try{e=document.createElement("iframe"),e.style.display="none",document.body.appendChild(e),t=e.contentWindow??Pr}catch{t=Pr}Ti={URL:t.URL},e?.remove()}return Ti}function Di(e,t,r=0,n){let i=new Date;i.setTime(i.getTime()+r);let o=`expires=${i.toUTCString()}`,a=n&&n.crossSite?"none":"strict",s=n&&n.domain?`;domain=${n.domain}`:"",l=n&&n.secure?";secure":"",u=n&&n.partitioned?";partitioned":"";document.cookie=`${e}=${t};${o};path=/;samesite=${a}${s}${l}${u}`}function Oi(e){return fi(document.cookie,e)}function ki(e){return pi(document.cookie).get(e)||[]}function ji(e){return Ai||=mi(document.cookie),Ai.get(e)}function Mi(e,t){Di(e,"",0,t)}function Ni(e){if(void 0===document.cookie||null===document.cookie)return!1;try{let t=`dd_cookie_test_${R()}`,r="test";Di(t,r,M,e);let n=Oi(t)===r;return Mi(t,e),n}catch(e){return T.error(e),!1}}function Fi(e=location.hostname,t=document.referrer){if(void 0===Pi){let r=Ii(e,t);if(r){let e=`dd_site_test_${R()}`,t=r.split("."),n=t.pop();for(;t.length&&!Oi(e);)n=`${t.pop()}.${n}`,Di(e,"test",j,{domain:n});Mi(e,{domain:n}),Pi=n}}return Pi}function Ii(e,t){try{return e||wi(t).hostname}catch{}}var Li="_dd_s";function Ri(e,t){for(let r=e.length-1;r>=0;--r){let n=e[r];if(t(n,r,e))return n}}function zi(e){return Object.values(e)}function Bi(e){return Object.entries(e)}var Vi=4*Yr,Hi=15*M,Ui=Xr,Wi={COOKIE:"cookie",MEMORY:"memory",LOCAL_STORAGE:"local-storage"},Gi=/^([a-zA-Z]+)=([a-z0-9-]+)$/;function Ki(e){return!!e&&(-1!==e.indexOf("&")||Gi.test(e))}function qi(e,t){let r={isExpired:"1"};
1return t.trackAnonymousUser&&e?.anonymousId&&(r.anonymousId=e?.anonymousId),r}function Ji(e){return Mr(e)}function Yi(e){return!Ji(e)}function Xi(e){return void 0!==e.isExpired||!Zi(e)}function Zi(e){return(void 0===e.created||ti()-Number(e.created)<Vi)&&(void 0===e.expire||ti()<Number(e.expire))}function Qi(e){e.expire=String(ti()+Hi)}function $i(e){return Bi(e).map(([e,t])=>"anonymousId"===e?`aid=${t}`:`${e}=${t}`).join("&")}function ea(e){let t={};return Ki(e)&&e.split("&").forEach(e=>{let r=Gi.exec(e);if(null!==r){let[,e,n]=r;"aid"===e?t.anonymousId=n:t[e]=n}}),t}var ta="_dd_r",na="_dd_l",ra="logs";function ia(e){if(!ji("_dd_s")){let t=ji("_dd"),r=ji(ta),n=ji(na),i={};t&&(i.id=t),n&&/^[01]$/.test(n)&&(i[ra]=n),r&&/^[012]$/.test(r)&&(i.rum=r),Yi(i)&&(Qi(i),e.persistSession(i))}}var aa=0;function oa(e){let t=ua(e);return t&&Ni(t)?{type:Wi.COOKIE,cookieOptions:t}:void 0}function sa(e,t){let r={isLockEnabled:gi(),persistSession:r=>ca(t,e,r,Hi),retrieveSession:()=>la(t,e),expireSession:r=>ca(t,e,qi(r,e),Vi)};return ia(r),r}function ca(e,t,r,n){let i=$i(r);t.betaEncodeCookieOptions&&(i=$i({...r,...Mr(r)?{}:{c:da(e)}})),Di(Li,i,t.trackAnonymousUser?Ui:n,e)}function la(e,t){return t.betaEncodeCookieOptions?fa(e):ea(Oi(Li))}function ua(e){let t={};if(t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains){let e=Fi();if(!e)return;t.domain=e}return t}function da(e){let t=e.domain?e.domain.split(".").length-1:0,r=0;return r|=aa<<5,r|=t<<1,r|=+!!e.crossSite,r.toString(16)}function fa(e){let t,r=ki(Li),n=da(e);for(let e of r.reverse())if(t=ea(e),t.c===n)break;return null==t||delete t.c,t??{}}var pa="_dd_test_";function ma(){try{let e=R(),t=`${pa}${e}`;localStorage.setItem(t,e);let r=localStorage.getItem(t);return localStorage.removeItem(t),e===r?{type:Wi.LOCAL_STORAGE}:void 0}catch{return}}function ha(e){return{isLockEnabled:!1,persistSession:ga,retrieveSession:_a,expireSession:t=>va(t,e)}}function ga(e){localStorage.setItem(Li,$i(e))}function _a(){return ea(localStorage.getItem(Li))}function va(e,t){ga(qi(e,t))}var Sa,ya=j,ba="--",xa=[];function Ca(e,t,r=0){var n;let{isLockEnabled:i,persistSession:o,expireSession:a}=t,s=e=>o({...e,lock:u}),l=()=>{let{lock:e,...r}=t.retrieveSession();return{session:r,lock:e&&!Da(e)?e:void 0}};if(Sa||=e,e!==Sa)return void xa.push(e);if(i&&r>=100)return void Ta(t);let u,c=l();if(i){if(c.lock)return void wa(e,t,r);if(u=Ea(),s(c.session),c=l(),c.lock!==u)return void wa(e,t,r)}let d=e.process(c.session);if(i&&(c=l(),c.lock!==u))wa(e,t,r);else{if(d&&(Xi(d)?a(d):(Qi(d),i?s(d):o(d))),i&&(!d||!Xi(d))){if(c=l(),c.lock!==u)return void wa(e,t,r);o(c.session),d=c.session}null==(n=e.after)||n.call(e,d||c.session),Ta(t)}}function wa(e,t,r){O(()=>{Ca(e,t,r+1)},10)}function Ta(e){Sa=void 0;let t=xa.shift();t&&Ca(t,e)}function Ea(){return R()+ba+P()}function Da(e){let[,t]=e.split(ba);return!t||I(Number(t),P())>ya}var Oa="_DD_SESSION";function ka(){return{type:Wi.MEMORY}}function Aa(e){return{expireSession:t=>Na(t,e),isLockEnabled:!1,persistSession:Ma,retrieveSession:ja}}function ja(){let e=E();return e._DD_SESSION||(e[Oa]={}),Ar(e[Oa])}function Ma(e){E()[Oa]=Ar(e)}function Na(e,t){Ma(qi(e,t))}var Pa=j;function Fa(e){let{sessionPersistence:t}=e,r=Ia(t,e);for(let t of r){let r=La(t,e);if(void 0!==r)return r}}function Ia(e,t){return Array.isArray(e)?e:void 0===e?t.allowFallbackToLocalStorage?[Wi.COOKIE,Wi.LOCAL_STORAGE]:[Wi.COOKIE]:[e]}function La(e,t){switch(e){case Wi.COOKIE:return oa(t);case Wi.LOCAL_STORAGE:return ma();case Wi.MEMORY:return ka();default:return void T.error(`Invalid session persistence '${String(e)}'`)}}function Ra(e,t){return e.type===Wi.COOKIE?sa(t,e.cookieOptions):e.type===Wi.LOCAL_STORAGE?ha(t):Aa(t)}function za(e,t,r,n,i=Ra(e,t)){let o,a=new A,s=new A,l=new A,u=Wr(function(){let e=i.retrieveSession();Xi(e)?Ca({process:e=>Xi(e)?qi(e,t):void 0,after:f},i):f(e)},Pa);h();let{throttled:c,cancel:d}=ui(()=>{Ca({process:e=>{if(Ji(e))return;let t=f(e);return p(t),t},after:e=>{Yi(e)&&!g()&&function(e){o=e,a.notify()}(e),o=e}},i)},Pa);function f(e){return Xi(e)&&(e=qi(e,t)),g()&&(function(e){return o.id!==e.id||o[r]!==e[r]}(e)?(o=qi(o,t),s.notify()):(l.notify({previousState:o,newState:e}),o=e)),e}function h(){Ca({process:e=>{if(Ji(e))return e.anonymousId=R(),qi(e,t)},after:e=>{o=e}},i)}function p(e){if(Ji(e))return!1;let i=n(e[r]);e[r]=i,delete e.isExpired,"0"!==i&&!e.id&&(e.id=R(),e.created=String(ti())),t.trackA
1nonymousUser&&!e.anonymousId&&(e.anonymousId=R())}function g(){return void 0!==o?.[r]}return{expandOrRenewSession:c,expandSession:function(){Ca({process:e=>g()?f(e):void 0},i)},getSession:()=>o,renewObservable:a,expireObservable:s,sessionStateUpdateObservable:l,restartSession:h,expire:e=>{d(),!1===e&&o&&delete o.anonymousId,i.expireSession(o),f(qi(o,t))},stop:()=>{Gr(u)},updateSessionState:function(e){Ca({process:t=>({...t,...e}),after:f},i)}}}var Ba={GRANTED:"granted",NOT_GRANTED:"not-granted"};function Va(e){let t=new A;return{tryToInit(t){e||=t},update(r){e=r,t.notify()},isGranted:()=>e===Ba.GRANTED,observable:t}}function Ha(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function Ua(e){return"object"===Ha(e)}function Wa(e){let t=Ha(e);return"string"===t||"function"===t||e instanceof RegExp}function Ga(e,t,r=!1){return e.some(e=>{try{if("function"==typeof e)return e(t);if(e instanceof RegExp)return e.lastIndex=0,e.test(t);if("string"==typeof e)return r?t.startsWith(e):e===t}catch(e){T.error(e)}return!1})}function z(e){return e}var Ka=["chrome-extension://","moz-extension://"];function qa(e){return Ka.some(t=>e.includes(t))}function Ja(e,t=""){return!qa(e)&&qa(t.split("\n").filter(e=>{let t=e.trim();return t.length&&/^at\s+|@/.test(t)})[1]||"")}var Ya="Running the Browser SDK in a Web extension content script is forbidden unless the `allowedTrackingOrigins` option is provided.",Xa="SDK initialized on a non-allowed domain.";function Za(e,t){let r=z(E().location),n=r?r.origin:"",i=e.allowedTrackingOrigins;if(!i)return!Ja(n,t)||(T.error(Ya),!1);let o=Ga(i,n);return o||T.error(Xa),o}var Qa="datad0g.com",$a="datadoghq.com",eo="datadoghq.eu",to="ddog-gov.com",no="us2.ddog-gov.com",ro="pci.browser-intake-datadoghq.com",io=["ddsource","dd-api-key","dd-request-id"];function ao(e,t,r){let n=oo(e,t);return{build(i,o){let a=co(e,t,i,o,r);return n(a)},trackType:t}}function oo(e,t){let r=`/api/v2/${t}`,n=e.proxy;if("string"==typeof n){let e=xi(n);return t=>`${e}?ddforward=${encodeURIComponent(`${r}?${t}`)}`}if("function"==typeof n)return e=>n({path:r,parameters:e});let i=so(t,e);return e=>`https://${i}${r}?${e}`}function so(e,t){let{site:r=$a,internalAnalyticsSubdomain:n}=t;if("logs"===e&&t.usePciIntake&&"datadoghq.com"===r)return ro;if(n&&"datadoghq.com"===r)return`${n}.${$a}`;if("dd0g-gov.com"===r)return`http-intake.logs.${r}`;let i=r.split("."),o=i.pop();return`browser-intake-${i.join("-")}.${o}`}function co({clientToken:e,internalAnalyticsSubdomain:t,source:r="browser"},n,i,{retry:o,encoding:a},s=[]){let l=[`ddsource=${r}`,`dd-api-key=${e}`,"dd-evp-origin-version=6.33.0","dd-evp-origin=browser",`dd-request-id=${R()}`].concat(s);return a&&l.push(`dd-evp-encoding=${a}`),"rum"===n&&(l.push(`batch_time=${P()}`,`_dd.api=${i}`),o&&l.push(`_dd.retry_count=${o.count}`,`_dd.retry_after=${o.lastFailureStatus}`)),t&&l.reverse(),l.join("&")}function lo(e){let t=e.site||"datadoghq.com",r=uo(e.source),n=fo({...e,site:t,source:r});return{replica:po({...e,site:t,source:r}),site:t,source:r,...n}}function uo(e){return"flutter"===e||"unity"===e?e:"browser"}function fo(e){return{logsEndpointBuilder:ao(e,"logs"),rumEndpointBuilder:ao(e,"rum"),profilingEndpointBuilder:ao(e,"profile"),sessionReplayEndpointBuilder:ao(e,"replay"),exposuresEndpointBuilder:ao(e,"exposures"),flagEvaluationEndpointBuilder:ao(e,"flagevaluation")}}function po(e){if(!e.replica)return;let t={...e,site:$a,clientToken:e.replica.clientToken};return{logsEndpointBuilder:ao(t,"logs"),rumEndpointBuilder:ao(t,"rum",[`application.id=${e.replica.applicationId}`])}}function mo(e){return io.every(t=>e.includes(t))}var So,ho={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input",MASK_UNLESS_ALLOWLISTED:"mask-unless-allowlisted"},go={ALL:"all",SAMPLED:"sampled"};function _o(e,t){return null==e||"string"==typeof e||(T.error(`${t} must be defined as a string`),!1)}function vo(e){return!(e&&"string"==typeof e&&!/(datadog|ddog|datad0g|dd0g)/.test(e))||(T.error(`Site should be a valid Datadog site. ${Cr} ${xr}/getting_started/site/.`),!1)}function yo(e,t){return!(void 0!==e&&!Dr(e))||(T.error(`${t} Sample Rate should be a number between 0 and 100`),!1)}function bo(e,t){if(e&&e.clientToken){if(void 0===e.allowedTrackingOrigins||Array.isArray(e.allowedTrackingOrigins))return vo(e.site)&&yo(e.sessionSampleRate,"Session")&&yo(e.telemetrySampleRate,"Telemetry")&&yo(e.telemetryConfigurationSampleRate,"Telemetry Configuration")&&yo(e.telemetryUsageSampleRate,"Telemetry Usage")&&_o(e.version,"Version")&&_o(e.env,"Env")&&_o(e.service,"Service")&&Za(e,t??"")?void 0===e.trackingConsent||jr(Ba,e.trackingConsent)?{beforeSend:e.beforeSend&&wr(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Fr?void 0:Fa(e),sessionSampleRate:e.sessionSampleRate??100,telemetrySampleRate:e.telemetrySampleRate??20,telemetryConfigurationSampleRate:e.telemetryConfigurationSampleRate??5,telemetryUsageSampleRate:e.telemetryUsageSampleRate??5,service:e.service??void 0,env:e.env??void 0,version:e.version??void 0,datacenter:e.datacenter??void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:e.trackingConsent??Ba.GRANTED,trackAnonymousUser:e.trackA
1nonymousUser??!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,betaEncodeCookieOptions:!!e.betaEncodeCookieOptions,variant:e.variant,sdkVersion:e.sdkVersion,...lo(e)}:void T.error('Tracking Consent should be either "granted" or "not-granted"'):void 0;T.error("Allowed Tracking Origins must be an array")}else T.error("Client Token is not configured, we will not send any data.")}function xo(e){return{session_sample_rate:e.sessionSampleRate,telemetry_sample_rate:e.telemetrySampleRate,telemetry_configuration_sample_rate:e.telemetryConfigurationSampleRate,telemetry_usage_sample_rate:e.telemetryUsageSampleRate,use_before_send:!!e.beforeSend,use_partitioned_cross_site_session_cookie:e.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:e.useSecureSessionCookie,use_proxy:!!e.proxy,silent_multiple_init:e.silentMultipleInit,track_session_across_subdomains:e.trackSessionAcrossSubdomains,track_anonymous_user:e.trackAnonymousUser,session_persistence:Array.isArray(e.sessionPersistence)?e.sessionPersistence[0]:e.sessionPersistence,allow_fallback_to_local_storage:!!e.allowFallbackToLocalStorage,store_contexts_across_pages:!!e.storeContextsAcrossPages,allow_untrusted_events:!!e.allowUntrustedEvents,tracking_consent:e.trackingConsent,use_allowed_tracking_origins:Array.isArray(e.allowedTrackingOrigins),beta_encode_cookie_options:e.betaEncodeCookieOptions,source:e.source,sdk_version:e.sdkVersion,variant:e.variant}}!function(e){e.TRACK_INTAKE_REQUESTS="track_intake_requests",e.USE_TREE_WALKER_FOR_ACTION_NAME="use_tree_walker_for_action_name",e.FEATURE_OPERATION_VITAL="feature_operation_vital",e.START_STOP_ACTION="start_stop_action",e.START_STOP_RESOURCE="start_stop_resource",e.USE_CHANGE_RECORDS="use_change_records",e.USE_INCREMENTAL_CHANGE_RECORDS="use_incremental_change_records",e.TOO_MANY_REQUESTS_INVESTIGATION="too_many_requests_investigation",e.TRACK_RESOURCE_HEADERS="track_resource_headers"}(So||={});var Co=new Set;function wo(e){Array.isArray(e)&&To(e.filter(e=>jr(So,e)))}function To(e){e.forEach(e=>{Co.add(e)})}function Eo(e){return Co.has(e)}function Do(){return Co}var Oo="?";function ko(e){let t=[],r=Ho(e,"stack"),n=String(e);if(r&&r.startsWith(n)&&(r=r.slice(n.length)),r&&r.split("\n").forEach(e=>{let r=Po(e)||Io(e)||Ro(e)||Vo(e);r&&(!r.func&&r.line&&(r.func=Oo),t.push(r))}),t.length>0&&Jo()&&e instanceof Error){let r=[],n=e;for(;(n=Object.getPrototypeOf(n))&&Ko(n);){let e=n.constructor?.name||Oo;r.push(e)}for(let e=r.length-1;e>=0&&t[0]?.func===r[e];e--)t.shift()}return{message:Ho(e,"message"),name:Ho(e,"name"),stack:t}}var Ao="((?:file|https?|blob|chrome-extension|electron|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",jo="(?::(\\d+))",Mo=RegExp(`^\\s*at (.*?) ?\\(${Ao}${jo}?${jo}?\\)?\\s*$`,"i"),No=RegExp(`\\((\\S*)${jo}${jo}\\)`);function Po(e){let t=Mo.exec(e);if(!t)return;let r=t[2]&&0===t[2].indexOf("native"),n=t[2]&&0===t[2].indexOf("eval"),i=No.exec(t[2]);return n&&i&&(t[2]=i[1],t[3]=i[2],t[4]=i[3]),{args:r?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||Oo,line:t[3]?+t[3]:void 0,url:r?void 0:t[2]}}var Fo=RegExp(`^\\s*at\\s*(?:(.*)?(?: @))?\\s*${Ao}${jo}?${jo}??\\s*$`,"i");function Io(e){let t=Fo.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||Oo,line:t[3]?+t[3]:void 0,url:t[2]}}var Lo=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;function Ro(e){let t=Lo.exec(e);if(t)return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||Oo,line:+t[3],url:t[2]}}var zo=/^\s*(.*?)(?:\((.*?)\))?(?:(?:(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle|\[wasm code\])(?::(\d+))?(?::(\d+))?)|@)\s*$/i,Bo=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Vo(e){let t=zo.exec(e);if(!t)return;let r=t[3]&&t[3].indexOf(" > eval")>-1,n=Bo.exec(t[3]);return r&&n&&(t[3]=n[1],t[4]=n[2],t[5]=void 0),{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||Oo,line:t[4]?+t[4]:void 0,url:t[3]}}function Ho(e,t){return Ua(e)&&"string"==typeof e[t]?e[t]:void 0}function Uo(e,t,r,n){if(void 0===t)return;let{name:i,message:o}=Go(e);return{name:i,message:o,stack:[{url:t,column:n,line:r}]}}var qo,Wo=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function Go(e){let t,r;return"[object String]"==={}.toString.call(e)&&([,t,r]=Wo.exec(e)),{name:t,message:r}}function Ko(e){return String(e.constructor).startsWith("class ")}function Jo(){if(void 0!==qo)return qo;
1class e extends Error{constructor(){super(),this.name="Error"}}let[t,r]=[e,Error].map(e=>new e);return qo=Ko(Object.getPrototypeOf(t))&&r.stack!==t.stack}function Yo(e){let t,r=Error(e);return r.name="HandlingStack",Vr(()=>{let e=ko(r);e.stack=e.stack.slice(2),t=Xo(e)}),t}function Xo(e){let t=Zo(e);return e.stack.forEach(e=>{let r="?"===e.func?"<anonymous>":e.func,n=e.args&&e.args.length>0?`(${e.args.join(", ")})`:"",i=e.line?`:${e.line}`:"",o=e.line&&e.column?`:${e.column}`:"";t+=`\n  at ${r}${n} @ ${e.url}${i}${o}`}),t}function Zo(e){return`${e.name||"Error"}: ${e.message}`}function Qo(e,t,r,{computeHandlingStack:n}={}){let i=e[t];if("function"!=typeof i){if(!(t in e)||"string"!=typeof t||!t.startsWith("on"))return{stop:L};i=L}let o=!1,a=function(){if(o)return i.apply(this,arguments);let e,t=Array.from(arguments);Vr(r,null,[{target:this,parameters:t,onPostCall:t=>{e=t},handlingStack:n?Yo("instrumented method"):void 0}]);let a=i.apply(this,t);return e&&Vr(e,null,[a]),a};return e[t]=a,{stop:()=>{o=!0,e[t]===a&&(e[t]=i)}}}function $o(e,t,r){let n=Object.getOwnPropertyDescriptor(e,t);if(!n||!n.set||!n.configurable)return{stop:L};let i=L,o=(e,t)=>{O(()=>{o!==i&&r(e,t)},0)},a=function(e){n.set.call(this,e),o(this,e)};return Object.defineProperty(e,t,{set:a}),{stop:()=>{Object.getOwnPropertyDescriptor(e,t)?.set===a&&Object.defineProperty(e,t,n),o=i}}}var es=1024,ts=1024*es,ns=/[^\u0000-\u007F]/;function rs(e){return ns.test(e)?void 0===window.TextEncoder?new Blob([e]).size:(new TextEncoder).encode(e).length:e.length}function is(e){if(1===e.length)return e[0];let t=e.reduce((e,t)=>e+t.length,0),r=new Uint8Array(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return r}function as(e,t,r){if("object"!=typeof e||!e)return JSON.stringify(e);let n=os(Object.prototype),i=os(Array.prototype),o=os(Object.getPrototypeOf(e)),a=os(e);try{return JSON.stringify(e,t,r)}catch{return"<error: unable to serialize object>"}finally{n(),i(),o(),a()}}function os(e){let t=e,r=t.toJSON;return r?(delete t.toJSON,()=>{t.toJSON=r}):L}var ss=220*es,cs="$",ls=3;function B(e,t=ss){let r=os(Object.prototype),n=os(Array.prototype),i=[],o=new WeakMap,a=us(e,cs,void 0,i,o),s=JSON.stringify(a),l=s?s.length:0;if(!(l>t)){for(;i.length>0&&l<t;){let r=i.shift(),n=0;if(Array.isArray(r.source))for(let a=0;a<r.source.length;a++){let s=us(r.source[a],r.path,a,i,o);if(l+=void 0===s?4:JSON.stringify(s).length,l+=n,n=1,l>t){hs(t,"truncated",e);break}r.target[a]=s}else for(let a in r.source)if(Object.prototype.hasOwnProperty.call(r.source,a)){let s=us(r.source[a],r.path,a,i,o);if(void 0!==s&&(l+=JSON.stringify(s).length+n+a.length+ls,n=1),l>t){hs(t,"truncated",e);break}r.target[a]=s}}return r(),n(),a}hs(t,"discarded",e)}function us(e,t,r,n,i){let o=ms(e);if(!o||"object"!=typeof o)return ds(o);let a=fs(o);if("[Object]"!==a&&"[Array]"!==a&&"[Error]"!==a)return a;let s=e;if(i.has(s))return`[Reference seen at ${i.get(s)}]`;let l=void 0===r?t:`${t}.${r}`,u=Array.isArray(o)?[]:{};return i.set(s,l),n.push({source:o,target:u,path:l}),u}function ds(e){return"bigint"==typeof e?`[BigInt] ${e.toString()}`:"function"==typeof e?`[Function] ${e.name||"unknown"}`:"symbol"==typeof e?`[Symbol] ${e.description||e.toString()}`:e}function fs(e){try{if(e instanceof Event)return ps(e);if(e instanceof RegExp)return`[RegExp] ${e.toString()}`;let t=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(t&&t[1])return`[${t[1]}]`}catch{}return"[Unserializable]"}function ps(e){return{type:e.type,isTrusted:e.isTrusted,currentTarget:e.currentTarget?fs(e.currentTarget):null,target:e.target?fs(e.target):null}}function ms(e){let t=e;if(t&&"function"==typeof t.toJSON)try{return t.toJSON()}catch{}return e}function hs(e,t,r){T.warn(`The data provided has been ${t} as it is over the limit of ${e} characters:`,r)}var gs="No stack, consider using an instance of Error";function _s({originalError:e,stackTrace:t,source:r,useFallbackStack:n=!0,nonErrorPrefix:i}){let o=Ss(e);return!t&&o&&(t=ko(e)),{source:r,type:t?t.name:void 0,message:ys(t,o,i,e),stack:t?Xo(t):n?gs:void 0}}function vs({stackTrace:e,originalError:t,handlingStack:r,componentStack:n,startClocks:i,nonErrorPrefix:o,useFallbackStack:a=!0,source:s,handling:l}){return{startClocks:i,handling:l,handlingStack:r,componentStack:n,originalError:t,..._s({originalError:t,stackTrace:e,source:s,useFallbackStack:a,nonErrorPrefix:o}),causes:Ss(t)?Cs(t,s):void 0,fingerprint:bs(t),context:xs(t)}}function ys(e,t,r,n){return e?.message&&e?.name?e.message:t?"Empty message":r?`${r} ${as(B(n))}`:as(B(n))}function bs(e){return Ss(e)&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function xs(e){if(Ua(e))return e.dd_context}function Ss(e){return e instanceof Error||"[object Error]"===Object.prototype.toString.call(e)}function Cs(e,t){let r=[],n=e.cause;for(;null!=n&&r.length<10;){let e=_s({originalError:n,source:t,useFallbackStack:!1});r.push(e),n=Ss(n)?n.cause:void 0}return r.length?r:void 0}var ws={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"};function Ts(){return new A(e=>{let t=(t,r)=>{let n=vs({stackTrace:r,originalError:t,startClocks:F(),nonErrorPrefix:"Uncaught",source:ws.SOURCE,handling:"unhandled"});e.notify(n)},{stop:r}=Es(t),{stop:n}=Ds(t);return()=>{r(),n()}})}function Es(e){return Qo(E(),"onerror",({parameters:[t,r,n,i,o]})=>{let a;Ss(o)||(a=Uo(t,r,n,i)),e(o??t,a)})}function Ds(e){return Qo(E(),"onunhandledrejection",({parameters:[t]})=>{e(t.reason||"Empty reason")})}function Os(e){let t={version:"6.33.0",onReady(e){e()},...e};return Object.defineProperty(t,"_setDebug",{get:()=>Br,enumerable:!1}),t}function ks(e,t,r){let n=e[t];n&&!n.q&&n.version&&T.warn("SDK is loaded more than once. This is unsupported and might have unex
1pected behavior."),e[t]=r,n&&n.q&&n.q.forEach(e=>wr(e,"onReady callback threw an error:")())}function As(e,t){t.silentMultipleInit||T.error(`${e} is already initialized.`)}function V(e,t,r,n,i){return js(e,t,[r],n,i)}function js(e,t,r,n,{once:i,capture:o,passive:a}={}){let s=D(t=>{!t.isTrusted&&!t.__ddIsTrusted&&!e.allowUntrustedEvents||(i&&d(),n(t))}),l=a?{capture:o,passive:a}:o,u=window.EventTarget&&t instanceof EventTarget?window.EventTarget.prototype:t,c=Ir(u,"addEventListener");function d(){let e=Ir(u,"removeEventListener");r.forEach(r=>e.call(t,r,s,l))}return r.forEach(e=>c.call(t,e,s,l)),{stop:d}}var Ms={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function Ns(e,t){let r=[];t.includes(Ms.cspViolation)&&r.push(Fs(e));let n=t.filter(e=>e!==Ms.cspViolation);return n.length&&r.push(Ps(n)),qr(...r)}function Ps(e){return new A(t=>{if(!window.ReportingObserver)return;let r=D((e,r)=>e.forEach(e=>t.notify(Is(e)))),n=new window.ReportingObserver(r,{types:e,buffered:!0});return n.observe(),()=>{n.disconnect()}})}function Fs(e){return new A(t=>{let{stop:r}=V(e,document,"securitypolicyviolation",e=>{t.notify(Ls(e))});return r})}function Is(e){let{type:t,body:r}=e;return Rs({type:r.id,message:`${t}: ${r.message}`,originalError:e,stack:zs(r.id,r.message,r.sourceFile,r.lineNumber,r.columnNumber)})}function Ls(e){let t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return Rs({type:e.effectiveDirective,message:`${Ms.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:zs(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${hi(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function Rs(e){return{startClocks:F(),source:ws.REPORT,handling:"unhandled",...e}}function zs(e,t,r,n,i){return r?Xo({name:e,message:t,stack:[{func:"?",url:r,line:n??void 0,column:i??void 0}]}):void 0}function Bs(e){let{env:t,service:r,version:n,datacenter:i,sdkVersion:o,variant:a}=e,s=[Vs("sdk_version",o??"6.33.0")];return t&&s.push(Vs("env",t)),r&&s.push(Vs("service",r)),n&&s.push(Vs("version",n)),i&&s.push(Vs("datacenter",i)),a&&s.push(Vs("variant",a)),s}function Vs(e,t){let r=t?`${e}:${t}`:e;return(r.length>200||Us(r))&&T.warn(`Tag ${r} doesn't meet tag requirements and will be sanitized. ${Cr} ${xr}/getting_started/tagging/#defining-tags`),Hs(r)}function Hs(e){return e.replace(/,/g,"_")}function Us(e){return!!Ws()&&RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e)}function Ws(){try{return!0}catch{return!1}}function Gs(e,t){let r=Pr.__ddBrowserSdkExtensionCallback;r&&r({type:e,payload:t})}function Ks(e,t,r=Ys()){if(void 0===t)return e;if("object"!=typeof t||!t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){let e=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,e)}if(r.hasAlreadyBeenSeen(t))return;if(Array.isArray(t)){let n=Array.isArray(e)?e:[];for(let e=0;e<t.length;++e)n[e]=Ks(n[e],t[e],r);return n}let n="object"===Ha(e)?e:{};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=Ks(n[e],t[e],r));return n}function qs(e){return Ks(void 0,e)}function Js(...e){let t;for(let r of e)null!=r&&(t=Ks(t,r));return t}function Ys(){if(typeof WeakSet<"u"){let e=new WeakSet;return{hasAlreadyBeenSeen(t){let r=e.has(t);return r||e.add(t),r}}}let e=[];return{hasAlreadyBeenSeen(t){let r=e.indexOf(t)>=0;return r||e.push(t),r}}}function Xs(){let e=Pr.navigator;return{status:e.onLine?"connected":"not_connected",interfaces:e.connection&&e.connection.type?[e.connection.type]:void 0,effective_type:e.connection?.effectiveType}}function Zs(e,t){return Ir(E(),"fetch")(e,t)}function Qs(e){return e>=500}function $s(e){try{return e.clone()}catch{return}}var ec=80*es,tc=20*ts,nc=M,rc=j;function ic(e,t,r,n,i,o){0===t.transportStatus&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?oc(e,t,r,o,{onSuccess:()=>sc(0,t,r,n,i,o),onFailure:()=>{t.queuedPayloads.enqueue(e)||o.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e}),ac(t,r,n,i,o)}}):t.queuedPayloads.enqueue(e)||o.notify({type:"queue-full",bandwidth:t.bandwidthMonitor.stats(),payload:e})}function ac(e,t,r,n,i){2===e.transportStatus&&O(()=>{oc(e.queuedPayloads.first(),e,t,i,{onSuccess:()=>{e.queuedPayloads.dequeue(),e.currentBackoffTime=rc,sc(1,e,t,r,n,i)},onFailure:()=>{e.currentBackoffTime=Math.min(nc,2*e.currentBackoffTime),ac(e,t,r,n,i)}})},e.currentBackoffTime)}function oc(e,t,r,n,{onSuccess:i,onFailure:o}){t.bandwidthMonitor.add(e),r(e,r=>{t.bandwidthMonitor.remove(e),cc(r)?(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:r.status},n.notify({type:"failure",bandwidth:t.bandwidthMonitor.stats(),payload:e}),o()):(t.transportStatus=0,n.notify({type:"success",bandwidth:t.bandwidthMonitor.stats(),payload:e}),i())})}function sc(e,t,r,n,i,o){0===e&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(i({message:`Reached max ${n} events size queued for upload: ${tc/ts}MiB`,source:ws.AGENT,startClocks:F()}),t.queueFullReported=!0);let a=t.queuedPayloads;for(t.queuedPayloads=uc();a.size()>0;)ic(a.dequeue(),t,r,n,i,o)}function cc(e){return"opaque"!==e.type&&(0===e.status&&!navigator.onLine||408===e.status||429===e.status||Qs(e.status))}function lc(){return{transportStatus:0,currentBackoffTime:rc,bandwidthMonitor:dc(),queuedPayloads:uc(),queueFullReported:!1}}function uc(){let e=[];return{bytesCount:0,enqueue(t){return!this.isFull()&&(e.push(t),this.bytesCount+=t.bytesCount,!0)},first:()=>e[0],dequeue(){let t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size:()=>e.length,isFull(){return this.bytesCount>=tc}}}function dc(){return{ongoingRequestCount:0,ongoingByteCount:0,canHandle(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=ec&&this.ongoingRequestCount<32},add(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove(e){--this.ongoingRequestCount,this.ongoingByteCount-=e.bytesCount},stats(){return{ongoingByteCount:this.ongoingByteCount,ongoingRequestCount:this.ongoingRequestCount}}}}var fc=16*es;function pc(e,t,r=fc){let n=new A,i=lc();return{observable:n,send:r=>{for(let o of e)ic(r,i,(e,t)=>{_c(o,e,t)},o.trackType,t,n)},sendOnExit:t=>{for(let n of e)mc(n,r,t)}}}function mc(e,t,r){if(navigator.sendBeacon&&r.bytesCount<t)try{let t=e.build("beacon",r);if(navigator.sendBeacon(t,r.data))return}catch(e){gc(e)}_c(e,r)}var hc=!1;function gc(e){hc||(hc=!0,Hr(e))}function _c(e,t,r){Zs(e.build("fetch",t),{method:"POST",body:t.data,mode:"cors"}).then(D(e=>r?.({status:e.status,type:e.type}))).catch(D(()=>r?.({status:0})))}function vc(){let e=xc();if(e)return{getCapabilities:()=>JSON.parse(e.getCapabilities?.call(e)||"[]"),getPrivacyLevel:()=>e.getPrivacyLevel?.call(e),getAllowedWebViewHosts:()=>JSON.parse(e.getAllowedWebViewHosts()),send(t,r,n){let i=n?{id:n}:void 0;e.send(JSON.stringify({eventType:t,event:r,view:i}))}}}function yc(e){let t=vc();return!!t&&t.getCapabilities().includes(e)}function bc(e){void 0===e&&(e=E().location?.hostname);let t=vc();return!!t&&t.getAllowedWebViewHosts().some(t=>e===t||e.endsWith(`.${t}`))}function xc(){return E().DatadogEventBridge}var Sc={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};function Cc(e){return new A(t=>{if(Fr)return;let{stop:r}=js(e,window,["visibilitychange","freeze"],e=>{"visibilitychange"===e.type&&"hidden"===document.visibilityState?t.notify({reason:Sc.HI
1DDEN}):"freeze"===e.type&&t.notify({reason:Sc.FROZEN})},{capture:!0}),n=V(e,window,"beforeunload",()=>{t.notify({reason:Sc.UNLOADING})}).stop;return()=>{r(),n()}})}function wc(e){return zi(Sc).includes(e)}var Tc=256*es;function Ec({encoder:e,request:t,flushController:r}){let n={},i=r.flushObservable.subscribe(e=>u(e));function o(t,i,o){r.notifyBeforeAddMessage(i),void 0===o?e.write(e.isEmpty?t:`\n${t}`,e=>{r.notifyAfterAddMessage(e-i)}):(n[o]=t,r.notifyAfterAddMessage())}function a(e){return void 0!==e&&void 0!==n[e]}function s(t){let i=n[t];delete n[t];let o=e.estimateEncodedBytesCount(i);r.notifyAfterRemoveMessage(o)}function l(t,r){let n=as(t),i=e.estimateEncodedBytesCount(n);i>=Tc?T.warn(`Discarded a message whose size was bigger than the maximum allowed size ${Tc/es}KiB. ${Cr} ${Sr}/#technical-limitations`):(a(r)&&s(r),o(n,i,r))}function u(r){let i=zi(n).join("\n");n={};let o=wc(r.reason),a=o?t.sendOnExit:t.send;if(o&&e.isAsync){let t=e.finishSync();t.outputBytesCount&&a(Dc(t));let r=[t.pendingData,i].filter(Boolean).join("\n");r&&a({data:r,bytesCount:rs(r)})}else i&&e.write(e.isEmpty?i:`\n${i}`),e.finish(e=>{a(Dc(e))})}return{flushController:r,add:l,upsert:l,stop:i.unsubscribe}}function Dc(e){let t;return t="string"==typeof e.output?e.output:new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}var Oc=30*j,kc=Fr?1:50;function Ac({pageMayExitObservable:e,sessionExpireObservable:t}){let r,n,i=new A,o=e.subscribe(e=>{r=e.reason;try{i.notify(e.reason)}finally{r=void 0}c(e.reason)}),a=t.subscribe(()=>c("session_expire")),s=new A(()=>()=>{o.unsubscribe(),a.unsubscribe()}),l=0,u=0;function c(e){if(0===u)return;let t=u,r=l;u=0,l=0,d(),s.notify({reason:e,messagesCount:t,bytesCount:r})}function d(){k(n),n=void 0}return{flushObservable:s,preparePageExitFlushObservable:i,get messagesCount(){return u},notifyBeforeAddMessage(e){l+e>=fc&&c(r??"bytes_limit"),u+=1,l+=e,void 0===n&&(n=O(()=>{c("duration_limit")},Oc))},notifyAfterAddMessage(e=0){l+=e,u>=kc?c(r??"messages_limit"):l>=fc&&c(r??"bytes_limit")},notifyAfterRemoveMessage(e){l-=e,--u,0===u&&d()}}}function jc(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(r,n){let i=rs(r);t+=i,e+=r,n&&n(i)},finish(e){e(this.finishSync())},finishSync(){let r={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,r},estimateEncodedBytesCount:e=>e.length}}var Mc="DISCARDED",H="SKIPPED";function Nc(){let e={};return{register:(t,r)=>(e[t]||(e[t]=[]),e[t].push(r),{unregister:()=>{e[t]=e[t].filter(e=>e!==r)}}),triggerHook(t,r){let n=e[t]||[],i=[];for(let e of n){let t=e(r);if("DISCARDED"===t)return Mc;"SKIPPED"!==t&&i.push(t)}return Js(...i)}}}var zc,Pc={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},Fc=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],Ic=1,Lc=[to,no],Rc=15;function Bc(){return zc||=new Jr(100),zc}function Vc(e,t,r){let n=new A,{enabled:i,metricsEnabled:o}=Hc(e,t,r,n),{stop:a}=Uc(t,n);return{stop:a,enabled:i,metricsEnabled:o}}function Hc(e,t,r,n,i=Ic,o=Rc){let a={},s=!Lc.includes(t.site)&&Tr(t.telemetrySampleRate),l={[Pc.LOG]:s,[Pc.CONFIGURATION]:s&&Tr(t.telemetryConfigurationSampleRate),[Pc.USAGE]:s&&Tr(t.telemetryUsageSampleRate),metric:s&&Tr(i)},u=Wc(),c=Bc();return c.subscribe(({rawEvent:t,metricName:i})=>{if(i&&!l.metric||!l[t.type])return;let s=i||t.status||t.type,c=a[s];if(c||=a[s]=new Set,c.size>=o)return;let f=as(t);if(c.has(f))return;let h=r.triggerHook(1,{startTime:F().relative});if("DISCARDED"===h)return;let p=d(h,e,t,u);n.notify(p),Gs("telemetry",p),c.add(f)}),c.unbuffer(),zr(qc),{enabled:s,metricsEnabled:l.metric};function d(e,r,n,i){return Js({type:"telemetry",date:F().timeStamp,service:r,version:"6.33.0",source:"browser",_dd:{format_version:2},telemetry:Js(n,{runtime_env:i,connectivity:Xs(),sdk_setup:"npm"}),ddtags:Bs(t).join(","),experimental_features:Array.from(Do())},e)}}function Uc(e,t){let r=[];if(bc()){let e=vc(),n=t.subscribe(t=>e.send("internal_telemetry",t));r.push(n.unsubscribe)}else{let n=[e.rumEndpointBuilder];e.replica&&Gc(e)&&n.push(e.replica.rumEndpointBuilder);let i=Ec({encoder:jc(),request:pc(n,L),flushController:Ac({pageMayExitObservable:Cc(e),sessionExpireOb
1servable:new A})});r.push(i.stop);let o=t.subscribe(i.add);r.push(o.unsubscribe)}return{stop:()=>r.forEach(e=>e())}}function Wc(){return{is_local_file:"file:"===Pr.location?.protocol,is_worker:Fr}}function Gc(e){return e.site===Qa}function Kc(e,t){Ur(_r.debug,e,t),Bc().notify({rawEvent:{type:Pc.LOG,message:e,status:"debug",...t}})}function qc(e,t){Bc().notify({rawEvent:{type:Pc.LOG,status:"error",...Xc(e),...t}})}function Jc(e){Bc().notify({rawEvent:{type:Pc.CONFIGURATION,configuration:e}})}function Yc(e,t){Bc().notify({rawEvent:{type:Pc.LOG,message:e,status:"debug",...t},metricName:e})}function U(e){Bc().notify({rawEvent:{type:Pc.USAGE,usage:e}})}function Xc(e){if(Ss(e)){let t=ko(e);return{error:{kind:t.name,stack:Xo(Zc(t))},message:t.message}}return{error:{stack:gs},message:`Uncaught ${as(e)}`}}function Zc(e){return e.stack=e.stack.filter(e=>!e.url||Fc.some(t=>e.url.startsWith(t))),e}function Qc(e,t){let r=e.indexOf(t);r>=0&&e.splice(r,1)}function $c(e){return Array.isArray(e)&&e.length>0}var nl,el=1/0,tl=M,rl=new Set;function il(){rl.forEach(e=>e())}function al({expireDelay:e,maxEntries:t}){let r=[];nl||=Wr(()=>il(),tl);let n=()=>{let t=ni()-e;for(;r.length>0&&r[r.length-1].endTime<t;)r.pop()};return rl.add(n),{add:function(e,n){let i={value:e,startTime:n,endTime:el,remove:()=>{Qc(r,i)},close:e=>{i.endTime=e}};return t&&r.length>=t&&r.pop(),r.unshift(i),i},find:function(e=el,t={returnInactive:!1}){for(let n of r)if(n.startTime<=e){if(t.returnInactive||e<=n.endTime)return n.value;break}},closeActive:function(e){let t=r[0];t&&t.endTime===el&&t.close(e)},findAll:function(e=el,t=0){let n=ii(e,t);return r.filter(t=>t.startTime<=n&&e<=t.endTime).map(e=>e.value)},getEntries:function(e){return r.filter(t=>t.startTime===e)},reset:function(){r=[]},stop:function(){rl.delete(n),0===rl.size&&nl&&(Gr(nl),nl=void 0)}}}var ol="datadog-synthetics-",sl=`${ol}public-id`,cl=`${ol}result-id`,ll=`${ol}injects-rum`,ul=`${ol}rum-context`;function dl(){return!Fr&&!(!Pr._DATADOG_SYNTHETICS_INJECTS_RUM&&!ji(ll))}function fl(){let e=ml();return hl(e)?e:void 0}function pl(){return!!fl()}function ml(){let e=Pr._DATADOG_SYNTHETICS_RUM_CONTEXT;if(e)return e;let t=ji(ul);return t?kr(decodeURIComponent(t)):{test_id:window._DATADOG_SYNTHETICS_PUBLIC_ID||ji(sl),result_id:window._DATADOG_SYNTHETICS_RESULT_ID||ji(cl)}}function hl(e){return"object"==typeof e&&!!e&&"string"==typeof e.test_id&&"string"==typeof e.result_id}var gl=M,_l=Vi,vl=[];function yl(e,t,r,n){let i=new A,o=new A,a=za(e.sessionStoreStrategyType,e,t,r);vl.push(()=>a.stop());let s=al({expireDelay:_l});function l(){let r=a.getSession();return r?{id:r.id,trackingType:r[t],isReplayForced:!!r.forcedReplay,anonymousId:r.anonymousId}:(Cl(e).catch(()=>{}),{id:"invalid",trackingType:"0",isReplayForced:!1,anonymousId:void 0})}return vl.push(()=>s.stop()),a.renewObservable.subscribe(()=>{s.add(l(),ni()),i.notify()}),a.expireObservable.subscribe(()=>{o.notify(),s.closeActive(ni())}),a.expandOrRenewSession(),s.add(l(),ri().relative),n.observable.subscribe(()=>{n.isGranted()?a.expandOrRenewSession():a.expire(!1)}),bl(e,()=>{n.isGranted()&&a.expandOrRenewSession()}),xl(e,()=>a.expandSession()),Sl(e,()=>a.restartSession()),{findSession:(e,t)=>s.find(e,t),renewObservable:i,expireObservable:o,sessionStateUpdateObservable:a.sessionStateUpdateObservable,expire:a.expire,updateSessionState:a.updateSessionState}}function bl(e,t){let{stop:r}=js(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0});vl.push(r)}function xl(e,t){let r=()=>{"visible"===document.visibilityState&&t()},{stop:n}=V(e,document,"visibilitychange",r);vl.push(n);let i=Wr(r,gl);vl.push(()=>{Gr(i)})}function Sl(e,t){let{stop:r}=V(e,window,"resume",t,{capture:!0});vl.push(r)}async function Cl(e){let t,r,n=e.sessionStoreStrategyType;n&&(n.type===Wi.COOKIE?(t=la(n.cookieOptions,e),r={cookie:await wl(),currentDomain:`${window.location.protocol}//${window.location.hostname}`}):t=_a(),Kc("Unexpected session state",{sessionStoreStrategyType:n.type,session:t,isSyntheticsTest:pl(),createdTimestamp:t?.created,expireTimestamp:t?.expire,...r}))}async function wl(){let e;return e="cookieStore"in window?await window.cookieStore.getAll(Li):document.cookie.split(/\s*;\s*/).filter(e=>e.startsWith(Li)),{count:e.length,domain:Fi()||"undefined",...e}}var Tl=class{constructor(){this.callbacks={}}notify(e,t){let r=this.callbacks[e];
1r&&r.forEach(e=>e(t))}subscribe(e,t){return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),{unsubscribe:()=>{this.callbacks[e]=this.callbacks[e].filter(e=>t!==e)}}}},El=3e3;function Dl(e,t,r=El){let n=0,i=!1;return{isLimitReached(){if(0===n&&O(()=>{n=0},M),n+=1,n<=r||i)return i=!1,!1;if(n===r+1){i=!0;try{t({message:`Reached max number of ${e}s by minute: ${r}`,source:ws.AGENT,startClocks:F()})}finally{i=!1}}return!0}}}function Ol(e,t,r){return document.readyState===t||"complete"===document.readyState?(r(),{stop:L}):V(e,window,"complete"===t?"load":"DOMContentLoaded",r,{once:!0})}function kl(e,t){return new Promise(r=>{Ol(e,t,r)})}var Al,jl=new WeakMap;function Ml(e){return Al||=Nl(e),Al}function Nl(e){return new A(t=>{let{stop:r}=Qo(XMLHttpRequest.prototype,"open",Pl),{stop:n}=Qo(XMLHttpRequest.prototype,"send",r=>{Fl(r,e,t)},{computeHandlingStack:!0}),{stop:i}=Qo(XMLHttpRequest.prototype,"abort",Il);return()=>{r(),n(),i()}})}function Pl({target:e,parameters:[t,r]}){jl.set(e,{state:"open",method:String(t).toUpperCase(),url:xi(String(r))})}function Fl({target:e,parameters:[t],handlingStack:r},n,i){let o=jl.get(e);if(!o)return;let a=o;a.state="start",a.startClocks=F(),a.isAborted=!1,a.xhr=e,a.handlingStack=r,a.requestBody=t;let s=!1,{stop:l}=Qo(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&u()}),u=()=>{if(c(),l(),s)return;s=!0;let t=o;t.state="complete",t.duration=I(a.startClocks.timeStamp,P()),t.status=e.status,"string"==typeof e.response&&(t.responseBody=e.response),i.notify(Ar(t))},{stop:c}=V(n,e,"loadend",u);i.notify(a)}function Il({target:e}){let t=jl.get(e);t&&(t.isAborted=!0)}async function Ll(e,t){let r=e.getReader(),n=[];for(;;){let e=await r.read();if(e.done)break;t.collectStreamBody&&n.push(e.value)}return r.cancel().catch(L),t.collectStreamBody?is(n):void 0}var Rl,zl=[];function Bl({responseBodyAction:e}={}){return e&&zl.push(e),Rl||=Vl(),Rl}function Vl(){return new A(e=>{if(!Pr.fetch)return;let{stop:t}=Qo(Pr,"fetch",t=>Hl(t,e),{computeHandlingStack:!0});return t})}function Hl({parameters:e,onPostCall:t,handlingStack:r},n){let[i,o]=e,a=o&&o.method;void 0===a&&i instanceof Request&&(a=i.method);let s=void 0===a?"GET":String(a).toUpperCase(),l=i instanceof Request?i.url:xi(String(i)),u={state:"start",init:o,input:i,method:s,startClocks:F(),url:l,handlingStack:r,isAbortedOnStart:i instanceof Request&&i.signal?.aborted||o?.signal?.aborted||!1};n.notify(u),e[0]=u.input,e[1]=u.init,t(e=>{Ul(n,e,u).catch(Hr)})}async function Ul(e,t,r){let n,i=r;i.state="resolve";try{n=await t}catch(t){return i.status=0,i.isAborted=i.init?.signal?.aborted||t instanceof DOMException&&t.code===DOMException.ABORT_ERR,i.error=t,void e.notify(i)}i.response=n,i.status=n.status,i.responseType=n.type,i.isAborted=!1;let o=zl.reduce((e,t)=>Math.max(e,t(i)),0);if(0!==o){let e=$s(n);if(e&&e.body)try{let t=await Ll(e.body,{collectStreamBody:2===o});i.responseBody=t&&(new TextDecoder).decode(t)}catch{}}e.notify(i)}function Wl(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){let r=window.requestIdleCallback(D(e),t);return()=>window.cancelIdleCallback(r)}return Gl(e)}function Gl(e){let t=ti(),r=O(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(ti()-t))})},0);return()=>k(r)}var Kl=j;function ql(){let e=[];function t(t){let n;if(!t||t.didTimeout){let e=performance.now();n=()=>30-(performance.now()-e)}else n=t.timeRemaining.bind(t);for(;n()>0&&e.length;)e.shift()();e.length&&r()}function r(){Wl(t,{timeout:Kl})}return{push(t){1===e.push(t)&&r()},stop(){e.length=0}}}var Jl={};function Yl(e){return qr(...e.map(e=>(Jl[e]||(Jl[e]=Xl(e)),Jl[e])))}function Xl(e){return new A(t=>{let r=vr[e];return vr[e]=(...n)=>{r.apply(console,n);let i=Yo("console error");Vr(()=>{t.notify(Zl(n,e,i))})},()=>{vr[e]=r}})}function Zl(e,t,r){let n=e.map(e=>Ql(e)).join(" ");if(t===_r.error){let i=vs({originalError:e.find(Ss),handlingStack:r,startClocks:F(),source:ws.CONSOLE,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return i.message=n,{api:t,message:n,handlingStack:r,error:i}}return{api:t,message:n,error:void 0,handlingStack:r}}function Ql(e){return"string"==typeof e?B(e):Ss(e)?Zo(ko(e)):as(B(e),void 0,2)}var $l=500;function eu(){let e=[];return{add:t=>{e.push(t)>$l&&e.splice(0,1)},remove:t=>{Qc(e,t)},drain:t=>
1{e.forEach(e=>e(t)),e.length=0}}}function tu(e){let t="object"===Ha(e);return t||T.error("Unsupported context:",e),t}function nu(e,t,r){let n={...e};for(let[e,{required:i,type:o}]of Object.entries(t))"string"===o&&!ru(n[e])&&(n[e]=String(n[e])),i&&ru(n[e])&&T.warn(`The property ${e} of ${r} is required; context will not be sent to the intake.`);return n}function ru(e){return null==e||""===e}function iu(e="",{propertiesConfig:t={}}={}){let r={},n=new A,i={getContext:()=>qs(r),setContext:o=>{tu(o)?r=B(nu(o,t,e)):i.clearContext(),n.notify()},setContextProperty:(i,o)=>{r=B(nu({...r,[i]:o},t,e)),n.notify()},removeContextProperty:i=>{delete r[i],nu(r,t,e),n.notify()},clearContext:()=>{r={},n.notify()},changeObservable:n};return i}function W(e,t,r,n){return D((...i)=>(n&&U({feature:n}),e()[t][r](...i)))}var au="_dd_c",ou=[];function su(e,t,r,n){let i=cu(r,n);ou.push(V(e,window,"storage",({key:e})=>{i===e&&t.setContext(a())})),t.changeObservable.subscribe(function(){localStorage.setItem(i,JSON.stringify(t.getContext()))});let o=Js(a(),t.getContext());function a(){let e=localStorage.getItem(i);return e?JSON.parse(e):{}}Mr(o)||t.setContext(o)}function cu(e,t){return`${au}_${e}_${t}`}function lu(e,t,r){let n=uu();return t.storeContextsAcrossPages&&su(t,n,r,4),e.register(0,()=>{let e=n.getContext();return Mr(e)||!e.id?H:{account:e}}),n}function uu(){return iu("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}var fu,du="_dd_tab_id";function pu(e){let t=mu();e.register(0,()=>({tab:{id:t}}))}function mu(){return fu||=hu()??R(),fu}function hu(){try{let e=sessionStorage.getItem(du);if(e)return e;let t=R();return sessionStorage.setItem(du,t),t}catch{return}}function gu(e,t,r,n){let i=_u();return t.storeContextsAcrossPages&&su(t,i,r,2),e.register(0,()=>{let e=i.getContext();return n?{context:e}:e}),i}function _u(){return iu("global context")}function vu(e,t,r,n){let i=yu();return t.storeContextsAcrossPages&&su(t,i,n,1),e.register(0,({eventType:e,startTime:n})=>{let o=i.getContext(),a=r.findTrackedSession(n);return a&&a.anonymousId&&!o.anonymous_id&&t.trackAnonymousUser&&(o.anonymous_id=a.anonymousId),Mr(o)?H:{type:e,usr:o}}),e.register(1,({startTime:e})=>({anonymous_id:r.findTrackedSession(e)?.anonymousId})),i}function yu(){return iu("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}var G={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},K={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"},q={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},bu={FETCH:q.FETCH,XHR:q.XHR},xu=500;function Su(){let e=new Jr(xu),t=z(Ts)().subscribe(t=>{e.notify({type:0,error:t})});return{observable:e,stop:()=>{t.unsubscribe()}}}function Cu(){try{return(new Intl.DateTimeFormat).resolvedOptions().timeZone}catch{return}}var J={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},wu={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},Tu={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},Eu={CLICK:"click",CUSTOM:"custom",TAP:"tap",SCROLL:"scroll",SWIPE:"swipe",APPLICATION_START:"application_start",BACK:"back"},Du={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"},Ou={DURATION:"duration",OPERATION_STEP:"operation_step"};function ku(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function Au(e,t,r){function n(e){return!t.wasInPageStateDuringPeriod("frozen",e.startClocks.relative,e.duration)}function i(t){n(t)&&e.notify(12,Pu(t))}return{addOperationStepVital:function(t,r,n,i){if(!Eo(So.FEATURE_OPERATION_VITAL))return;let{operationKey:o,context:a,description:s,handlingStack:l}=n||{},u={name:t,type:Ou.OPERATION_STEP,operationKey:o,failureReason:i,stepType:r,startClocks:F(),context:B(a),description:s,handlingStack:l};e.notify(12,Pu(u))},addDurationVital:i,startDurationVital:(t,n={})=>{let i=ju(r,t,n),o=r.vitalsByReference.get(i);return o&&e.notify(16,o),i},stopDurationVital:(e,t={})=>{Mu(i,r,e,t)}}}function ju({vitalsByName:e,vitalsByReference:t},r,n={}){let i={id:R(),name:r,startClocks:F(),...n},o={__dd_vital_reference:!0};return e.set(r,i),t.set(o,i),o}function Mu(e,{vitalsByName:t,vitalsByReference:r},n,i={}){let o="string"==typeof n?t.get(n):r.get(n);o&&(e(Nu(o,o.startClocks,i,F())),"string"==typeof n?t.delete(n):r.delete(n))}function Nu(e,t,r,n){return{id:e.id,name:e.name,type:Ou.DURATION,startClocks:t,duration:I(t.timeStamp,n.timeStamp),context:Js(e.context,r.context),description:r.description??e.description,handlingStack:e.handlingStack}}function Pu(e){let{startClocks:t,type:r,name:n,description:i,context:o,handlingStack:a}=e,s={id:(e.type===Ou.DURATION?e.id:void 0)??R(),type:r,name:n,description:i,...r===Ou.DURATION?{duration:N(e.duration)}:{step_type:e.stepType,operation_key:e.operationKey,failure_reason:e.failureReason}};return{rawRumEvent:{date:t.timeStamp,vital:s,type:J.VITAL,context:o},startClocks:t,duration:r===Ou.DURATION?e.duration:void 0,domainContext:a?{handlingStack:a}:{}}}function Fu(e,t,r){if(e)for(let n of e){let e=n[t];e&&e(r)}}var Iu=Nc,Lu=["tracecontext","datadog"],Ru=["cache-control","etag","age","expires","content-type","content-encoding","vary","content-length","server-timing","x-cache"];function zu(e,t){if(void 0!==e.trackFeatureFlagsForEvents&&!Array.isArray(e.trackFeatureFlagsForEvents)&&T.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId)return void T.error("Application ID is not configured, no RUM data will be collected.");
1if(!yo(e.sessionReplaySampleRate,"Session Replay")||!yo(e.traceSampleRate,"Trace"))return;if(void 0!==e.excludedActivityUrls&&!Array.isArray(e.excludedActivityUrls))return void T.error("Excluded Activity Urls should be an array");let r=Bu(e);if(!r)return;let n=bo(e,t),i=Uu(e);if(!n)return;let o=e.sessionReplaySampleRate??0;return{applicationId:e.applicationId,actionNameAttribute:e.actionNameAttribute,betaTrackActionsInShadowDom:!!e.betaTrackActionsInShadowDom,sessionReplaySampleRate:o,startSessionReplayRecordingManually:void 0===e.startSessionReplayRecordingManually?0===o:!!e.startSessionReplayRecordingManually,traceSampleRate:e.traceSampleRate??100,rulePsr:Or(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:r,excludedActivityUrls:e.excludedActivityUrls??[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(e.trackUserInteractions??1),trackViewsManually:!!e.trackViewsManually,trackResources:!!(e.trackResources??1),trackResourceHeaders:Gu(e),trackLongTasks:!!(e.trackLongTasks??1),trackBfcacheViews:!!e.trackBfcacheViews,trackEarlyRequests:!!e.trackEarlyRequests,subdomain:e.subdomain,defaultPrivacyLevel:jr(ho,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:ho.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,traceContextInjection:jr(go,e.traceContextInjection)?e.traceContextInjection:go.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:e.profilingSampleRate??0,propagateTraceBaggage:!!e.propagateTraceBaggage,allowedGraphQlUrls:i,...n}}function Bu(e){if(void 0===e.allowedTracingUrls)return[];if(!Array.isArray(e.allowedTracingUrls))return void T.error("Allowed Tracing URLs should be an array");if(0!==e.allowedTracingUrls.length&&void 0===e.service)return void T.error("Service needs to be configured when tracing is enabled");let t=[];return e.allowedTracingUrls.forEach(e=>{let r=Hu(e);r?t.push(r):T.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",e)}),t}function Vu(e){let t=new Set;return $c(e.allowedTracingUrls)&&e.allowedTracingUrls.forEach(e=>{var r;null==(r=Hu(e))||r.propagatorTypes.forEach(e=>t.add(e))}),Array.from(t)}function Hu(e){return Wa(e)?{match:e,propagatorTypes:Lu}:Ua(e)&&Wa(e.match)&&(null===e.propagatorTypes||void 0===e.propagatorTypes||Array.isArray(e.propagatorTypes))?{match:e.match,propagatorTypes:e.propagatorTypes||Lu}:void 0}function Uu(e){if(!e.allowedGraphQlUrls)return[];if(!Array.isArray(e.allowedGraphQlUrls))return T.warn("allowedGraphQlUrls should be an array"),[];let t=[];
1return e.allowedGraphQlUrls.forEach(e=>{Wa(e)?t.push({match:e,trackPayload:!1,trackResponseErrors:!1}):Ua(e)&&Wa(e.match)&&t.push({match:e.match,trackPayload:!!e.trackPayload,trackResponseErrors:!!e.trackResponseErrors})}),t}var Wu=["request","response","any"];function Gu(e){let t=e.trackResourceHeaders;if(void 0===t||!1===t)return[];if(!0===t)return Ru.map(e=>({name:e}));if(!Array.isArray(t))return T.warn("trackResourceHeaders should be true or an array of MatchHeader"),[];if(0===t.length)return T.warn("trackResourceHeaders is an empty array, no headers will be captured"),[];let r=[];return t.forEach((e,t)=>{Ua(e)&&Wa(e.name)?void 0===e.url||Wa(e.url)?void 0===e.extractor||e.extractor instanceof RegExp?void 0===e.location||Wu.includes(e.location)?r.push({...e,name:"string"==typeof e.name?e.name.toLowerCase():e.name}):T.warn(`trackResourceHeaders[${t}].location should be 'request', 'response', or 'any'`):T.warn(`trackResourceHeaders[${t}].extractor should be a RegExp`):T.warn(`trackResourceHeaders[${t}].url should be a MatchOption`):T.warn(`trackResourceHeaders[${t}] should be a MatchHeader object with a 'name' property`)}),r}function Ku(e){return $c(e)&&e.some(e=>Ua(e)&&e.trackPayload)}function qu(e){return $c(e)&&e.some(e=>Ua(e)&&e.trackResponseErrors)}function Ju(e){return!0===e?"default_headers":Array.isArray(e)?"custom":void 0}function Yu(e){let t=xo(e);return{session_replay_sample_rate:e.sessionReplaySampleRate,start_session_replay_recording_manually:e.startSessionReplayRecordingManually,trace_sample_rate:e.traceSampleRate,trace_context_injection:e.traceContextInjection,propagate_trace_baggage:e.propagateTraceBaggage,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:$c(e.allowedTracingUrls),use_allowed_graph_ql_urls:$c(e.allowedGraphQlUrls),use_track_graph_ql_payload:Ku(e.allowedGraphQlUrls),use_track_graph_ql_response_errors:qu(e.allowedGraphQlUrls),selected_tracing_propagators:Vu(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:$c(e.excludedActivityUrls),use_worker_url:!!e.workerUrl,compress_intake_requests:e.compressIntakeRequests,track_views_manually:e.trackViewsManually,track_user_interactions:e.trackUserInteractions,track_resources:e.trackResources,track_long_task:e.trackLongTasks,track_bfcache_views:e.trackBfcacheViews,track_early_requests:e.trackEarlyRequests,plugins:e.plugins?.map(e=>({name:e.name,...e.getConfigurationTelemetry?.call(e)})),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,remote_configuration_id:e.remoteConfigurationId,profiling_sample_rate:e.profilingSampleRate,use_remote_configuration_proxy:!!e.remoteConfigurationProxy,track_resource_headers:Ju(e.trackResourceHeaders),...t}}function Xu(e,t){t.lastIndex=0;let r=t.exec(e);if(!r)return;let[n,i]=r;return i||n}function Zu(e){let t,r=[],n=0,i={quote:void 0,escapeSequence:void 0},o="";for(let a of e){if(t=id[n].find(e=>rd[e](a,i)),!t)return[];if(void 0!==i.escapeSequence&&12!==t){if(!sd(i.escapeSequence))return[];o+=ld(i.escapeSequence),i.escapeSequence=void 0}ad.includes(t)?o+=a:od.includes(t)&&""!==o?(r.push(o),o=""):12===t?i.escapeSequence=i.escapeSequence?`${i.escapeSequence}${a}`:a:8===t?i.quote=a:9===t&&(i.quote=void 0),n=t}return id[n].includes(1)?(""!==o&&r.push(o),r):[]}var Qu=/[a-zA-Z_$]/,$u=/[a-zA-Z0-9_$]/,ed=/[0-9]/,td=/[a-fA-F0-9]/,nd="'\"",rd={0:()=>!1,1:()=>!1,2:e=>Qu.test(e),3:e=>$u.test(e),4:e=>"."===e,5:e=>"["===e,6:e=>"]"===e,7:e=>ed.test(e),8:e=>nd.includes(e),9:(e,t)=>e===t.quote,10:()=>!0,11:e=>"\\"===e,12:(e,t)=>void 0===t.escapeSequence?`${t.quote}/\\bfnrtu`.includes(e):!!(t.escapeSequence.startsWith("u")&&t.escapeSequence.length<5)&&td.test(e)},id={0:[2,5],1:[],2:[3,4,5,1],3:[3,4,5,1],4:[2],5:[8,7],6:[4,5,1],7:[7,6],8:[11,9,10],9:[6],10:[11,9,10],11:[12],12:[12,11,9,10]},ad=[2,3,7,10],od=[4,5,6];function sd(e){return"\"'/\\bfnrt".includes(e)||e.startsWith("u")&&5===e.length}var cd={'"':'"',"'":"'","/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function ld(e){return e.startsWith("u")?String.fromCharCode(parseInt(e.slice(1),16)):cd[e]}var ud="v1",dd=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyF
1orActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function fd(e,t){let r,n=md(),i=await vd(e);return i.ok?(n.increment("fetch","success"),r=pd(e,i.value,t,n)):(n.increment("fetch","failure"),T.error(i.error)),Yc("remote configuration metrics",{metrics:n.get()}),r}function pd(e,t,r,n){let i={...e};return dd.forEach(e=>{e in t&&(i[e]=o(t[e]))}),Object.keys(r).forEach(e=>{void 0!==t[e]&&function(e,t){t.forEach(({key:t,value:r})=>{e.setContextProperty(t,o(r))})}(r[e],t[e])}),i;function o(e){if(Array.isArray(e))return e.map(o);if(Ua(e)){if(hd(e)){let t=e.rcSerializedType;switch(t){case"string":return e.value;case"regex":return gd(e.value);case"dynamic":return function(e){let t,r=e.strategy;switch(r){case"cookie":t=a(e);break;case"dom":t=l(e);break;case"js":t=u(e);break;case"localStorage":t=s(e);break;default:return void T.error(`Unsupported remote configuration: "strategy": "${r}"`)}let n=e.extractor;return void 0!==n&&"string"==typeof t?_d(n,t):t}(e);default:return void T.error(`Unsupported remote configuration: "rcSerializedType": "${t}"`)}}return Nr(e,o)}return e}function a({name:e}){let t=Oi(e);return n.increment("cookie",void 0===t?"missing":"success"),t}function s({key:e}){let t;try{t=localStorage.getItem(e)}catch{return void n.increment("localStorage","failure")}return n.increment("localStorage",null===t?"missing":"success"),t??void 0}function l({selector:e,attribute:t}){let r;try{r=document.querySelector(e)}catch{return T.error(`Invalid selector in the remote configuration: '${e}'`),void n.increment("dom","failure")}if(!r)return void n.increment("dom","missing");if(function(e,t){return"password"===e.getAttribute("type")&&"value"===t}(r,t))return T.error(`Forbidden element selected by the remote configuration: '${e}'`),void n.increment("dom","failure");let i=void 0===t?r.textContent:r.getAttribute(t);if(null!==i)return n.increment("dom","success"),i;n.increment("dom","missing")}function u({path:e}){let t=window,r=Zu(e);if(0===r.length)return T.error(`Invalid JSON path in the remote configuration: '${e}'`),void n.increment("js","failure");for(let i of r){if(!(i in t))return void n.increment("js","missing");try{t=t[i]}catch(t){return T.error(`Error accessing: '${e}'`,t),void n.increment("js","failure")}}return n.increment("js","success"),t}}function md(){let e={fetch:{}};return{get:()=>e,increment:(t,r)=>{e[t]||(e[t]={}),e[t][r]||(e[t][r]=0),e[t][r]=e[t][r]+1}}}function hd(e){return"rcSerializedType"in e}function gd(e){try{return new RegExp(e)}catch{T.error(`Invalid regex in the remote configuration: '${e}'`)}}function _d(e,t){let r=gd(e.value);if(void 0!==r)return Xu(t,r)}async function vd(e){let t;try{t=await Zs(yd(e))}catch{t=void 0}if(!t||!t.ok)return{ok:!1,error:Error("Error fetching the remote configuration.")};let r=await t.json();return r.rum?{ok:!0,value:r.rum}:{ok:!1,error:Error("No remote configuration for RUM.")}}function yd(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${so("rum",e)}/${ud}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function bd({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},r,n,i){let o=eu(),a=_u();Sd(a,G.globalContext,o);let s=yu();Sd(s,G.userContext,o);let l=uu();Sd(l,G.accountContext,o);let u,c,d,f,h,p=Iu(),g=r.observable.subscribe(_),m={};function _(){if(!d||!f||!r.isGranted())return;let e;if(h||=z(Vc)("browser-rum-sdk",f,p),g.unsubscribe(),f.trackViewsManually){if(!u)return;o.remove(u.callback),e=u.options}let t=i(f,c,e,h,p);o.drain(t)}function y(e,n){let i=bc();if(i&&(e=xd(e)),d=e,Jc(Yu(e)),f)return void As("DD_RUM",e);let o=zu(e,n);if(o){if(!i&&!o.sessionStoreStrategyType)return void T.warn("No storage available for session. We will not send any data.");o.compressIntakeRequests&&!i&&t&&(c=t(o,"Datadog RUM",L),!c)||(f=o,Bl().subscribe(L),r.tryToInit(o.trackingConsent),_())}}let v=e=>{o.add(t=>t.addDurationVital(e))};return{init(t,r,n){t?(wo(t.enableExperimentalFeatures),d=t,(!e||!dl())&&(Fu(t.plugins,"onInit",{initConfiguration:t,publicApi:r}),t.remoteConfigurationId?fd(t,{user:s,context:a}).then(e=>{e&&y(e,n)}).catch(Hr):y(t,n))):T.error("Missing configuration")},get initConfiguration(){return d},getInternalContext:L,stopSession:L,addTiming(e,t=P()){o.add(r=>r.addTiming(e,t))}
1,setLoadingTime:e=>{o.add(t=>t.setLoadingTime(e))},startView(e,t=F()){let r=r=>{r.startView(e,t)};o.add(r),u||(u={options:e,callback:r},_())},setViewName(e){o.add(t=>t.setViewName(e))},setViewContext(e){o.add(t=>t.setViewContext(e))},setViewContextProperty(e,t){o.add(r=>r.setViewContextProperty(e,t))},getViewContext:()=>m,globalContext:a,userContext:s,accountContext:l,addAction(e){o.add(t=>t.addAction(e))},startAction(e,t){let r=F();o.add(n=>n.startAction(e,t,r))},stopAction(e,t){let r=F();o.add(n=>n.stopAction(e,t,r))},startResource(e,t){let r=F();o.add(n=>n.startResource(e,t,r))},stopResource(e,t){let r=F();o.add(n=>n.stopResource(e,t,r))},addError(e){o.add(t=>t.addError(e))},addFeatureFlagEvaluation(e,t){o.add(r=>r.addFeatureFlagEvaluation(e,t))},startDurationVital:(e,t)=>ju(n,e,t),stopDurationVital(e,t){Mu(v,n,e,t)},addDurationVital:v,addOperationStepVital:(e,t,r,n)=>{o.add(i=>i.addOperationStepVital(B(e),t,B(r),B(n)))}}}function xd(e){return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:e.defaultPrivacyLevel??vc()?.getPrivacyLevel()}}function Sd(e,t,r){e.changeObservable.subscribe(()=>{let n=e.getContext();r.add(e=>e[t].setContext(n))})}function Cd(){let e=wd();return new A(t=>{if(!e)return;let r=new e(D(e=>t.notify(e)));return r.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>r.disconnect()})}function wd(){let e,t=window;if(t.Zone&&(e=Ir(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){let r=Ir(new t.MutationObserver(L),"originalInstance");e=r&&r.constructor}return e||=t.MutationObserver,e}function Td(){let e=new A,{stop:t}=Qo(window,"open",()=>e.notify());return{observable:e,stop:t}}function Ed(e,t,r,n,i){return{get:o=>{let a=r.findView(o),s=i.findUrl(o),l=t.findTrackedSession(o);if(l&&a&&s){let t=n.findActionId(o);return{application_id:e,session_id:l.id,user_action:t?{id:t}:void 0,view:{id:a.id,name:a.name,referrer:s.referrer,url:s.url}}}}}}var Dd=Tl,Od=Vi;function kd(e){let t=al({expireDelay:Od});return e.subscribe(1,e=>{t.add(function(e){return{service:e.service,version:e.version,context:e.context,id:e.id,name:e.name,startClocks:e.startClocks}}(e),e.startClocks.relative)}),e.subscribe(6,({endClocks:e})=>{t.closeActive(e.relative)}),e.subscribe(3,e=>{let r=t.find(e.startClocks.relative);r&&(e.name&&(r.name=e.name),e.context&&(r.context=e.context),r.sessionIsActive=e.sessionIsActive)}),e.subscribe(10,()=>{t.reset()}),{findView:e=>t.find(e),stop:()=>{t.stop()}}}var Ad="initial_document",jd=[[q.DOCUMENT,e=>Ad===e],[q.XHR,e=>"xmlhttprequest"===e],[q.FETCH,e=>"fetch"===e],[q.BEACON,e=>"beacon"===e],[q.CSS,(e,t)=>/\.css$/i.test(t)],[q.JS,(e,t)=>/\.js$/i.test(t)],[q.IMAGE,(e,t)=>["image","img","icon"].includes(e)||null!==/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)],[q.FONT,(e,t)=>null!==/\.(woff|eot|woff2|ttf)$/i.exec(t)],[q.MEDIA,(e,t)=>["audio","video"].includes(e)||null!==/\.(mp3|mp4)$/i.exec(t)]];function Md(e){let t=e.name;if(!Si(t))return q.OTHER;let r=Ci(t);for(let[t,n]of jd)if(n(e.initiatorType,r))return t;return q.OTHER}function Nd(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function Pd(e){return"xmlhttprequest"===e.initiatorType||"fetch"===e.initiatorType}function Fd(e){let{duration:t,startTime:r,responseEnd:n}=e;return 0===t&&r<n?I(r,n):t}function Id(e){if(!Rd(e))return;let{startTime:t,fetchStart:r,workerStart:n,redirectStart:i,redirectEnd:o,domainLookupStart:a,domainLookupEnd:s,connectStart:l,secureConnectionStart:u,connectEnd:c,requestStart:d,responseStart:f,responseEnd:h}=e,p={download:Bd(t,f,h),first_byte:Bd(t,d,f)};return 0<n&&n<r&&(p.worker=Bd(t,n,r)),r<c&&(p.connect=Bd(t,l,c),l<=u&&u<=c&&(p.ssl=Bd(t,u,c))),r<s&&(p.dns=Bd(t,a,s)),t<o&&(p.redirect=Bd(t,i,o)),p}function Ld(e){return e.duration>=0}function Rd(e){let t=Nd(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),r=!zd(e)||Nd(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart);return t&&r}function zd(e){return e.redirectEnd>e.startTime}function Bd(e,t,r){if(e<=t&&t<=r)return{duration:N(I(t,r)),start:N(I(e,t))}}function Vd(e){return""===e.nextHopProtocol?void 0:e.nextHopProtocol}function Hd(e){return""===e.deliveryType?"other":e.deliveryType}function Ud(e){if(e.startTime<e.responseStart){let{encodedBodySize:t,decodedBodySize:r,transferSize:n}=e;return{size:r,encoded_body_size:t,decoded_body_size:r,transfer_size:n}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function Wd(e){return e&&(!mo(e)||Eo(So.TRACK_INTAKE_REQUESTS))}var Gd=/data:(.+)?(;base64)?,/g,Kd=24e3;
1function qd(e,t=Kd){if(e.length<=t||!e.startsWith("data:"))return e;let r=e.substring(0,100).match(Gd);return r?`${r[0]}[...]`:e}var Jd=new Map;function Yd(e,t){if(100===t)return!0;if(0===t)return!1;let r,n=Jd.get(t);return n&&e===n.sessionId?n.decision:(r=window.BigInt?Xd(BigInt(`0x${e.split("-")[4]}`),t):Tr(t),Jd.set(t,{sessionId:e,decision:r}),r)}function Xd(e,t){let r=BigInt("1111111111111111111"),n=BigInt("0x10000000000000000");return Number(e*r%n)<=t/100*Number(n)}function Zd(){return $d(64)}function Qd(){return $d(63)}function $d(e){let t=crypto.getRandomValues(new Uint32Array(2));return 63===e&&(t[t.length-1]>>>=1),{toString(e=10){let r=t[1],n=t[0],i="";do{let t=r%e*4294967296+n;r=Math.floor(r/e),n=Math.floor(t/e),i=(t%e).toString(e)+i}while(r||n);return i}}}function ef(e){return e.toString(16).padStart(16,"0")}function tf(e){0===e.status&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function nf(e,t,r,n){return{clearTracingIfNeeded:tf,traceFetch:i=>rf(e,i,t,r,n,e=>{if(i.input instanceof Request&&!i.init?.headers)i.input=new Request(i.input),Object.keys(e).forEach(t=>{i.input.headers.append(t,e[t])});else{i.init=Ar(i.init);let t=[];i.init.headers instanceof Headers?i.init.headers.forEach((e,r)=>{t.push([r,e])}):Array.isArray(i.init.headers)?i.init.headers.forEach(e=>{t.push(e)}):i.init.headers&&Object.keys(i.init.headers).forEach(e=>{t.push([e,i.init.headers[e]])}),i.init.headers=t.concat(Bi(e))}}),traceXhr:(i,o)=>rf(e,i,t,r,n,e=>{Object.keys(e).forEach(t=>{o.setRequestHeader(t,e[t])})})}}function rf(e,t,r,n,i,o){let a=r.findTrackedSession();if(!a)return;let s=e.allowedTracingUrls.find(e=>Ga([e.match],t.url,!0));if(!s)return;let l=Yd(a.id,e.traceSampleRate);(l||e.traceContextInjection===go.ALL)&&(t.traceSampled=l,t.traceId=Zd(),t.spanId=Qd(),o(af(t.traceId,t.spanId,t.traceSampled,a.id,s.propagatorTypes,n,i,e)))}function af(e,t,r,n,i,o,a,s){let l={};if(i.forEach(n=>{switch(n){case"datadog":Object.assign(l,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":r?"1":"0","x-datadog-trace-id":e.toString()});break;case"tracecontext":Object.assign(l,{traceparent:`00-0000000000000000${ef(e)}-${ef(t)}-0${r?"1":"0"}`,tracestate:`dd=s:${r?"1":"0"};o:rum`});break;case"b3":Object.assign(l,{b3:`${ef(e)}-${ef(t)}-${r?"1":"0"}`});break;case"b3multi":Object.assign(l,{"X-B3-TraceId":ef(e),"X-B3-SpanId":ef(t),"X-B3-Sampled":r?"1":"0"})}}),s.propagateTraceBaggage){let e={"session.id":n},t=o.getContext().id;"string"==typeof t&&(e["user.id"]=t);let r=a.getContext().id;"string"==typeof r&&(e["account.id"]=r);let i=Object.entries(e).map(([e,t])=>`${e}=${encodeURIComponent(t)}`).join(",");i&&(l.baggage=i)}return l}var of=32*es;function sf(e,t){let r=uf(e,t.trackPayload);if(r){if(t.trackResponseErrors&&e.responseBody){let t=cf(e.responseBody);t&&(r.error_count=t.length,r.errors=t)}return r}}function cf(e){let t=kr(e);if(!t||"object"!=typeof t)return;let r=t;return $c(r.errors)?r.errors.map(e=>({message:e.message,path:e.path,locations:e.locations,code:e.extensions?.code})):void 0}function lf(e,t){return t.allowedGraphQlUrls.find(t=>Ga([t.match],e))}function uf(e,t=!1){let r;if("POST"===e.method?r=df(e.requestBody):"GET"===e.method&&(r=ff(e.url)),r)return pf(r,t)}function df(e){if(!e||"string"!=typeof e)return;let t=kr(e);return t?{query:t.query,operationName:t.operationName,variables:t.variables?JSON.stringify(t.variables):void 0}:void 0}function ff(e){let t=wi(e).searchParams,r=t.get("variables"),n=r&&void 0!==kr(r)?r:void 0;return{query:t.get("query")||void 0,operationName:t.get("operationName")||void 0,variables:n}}function pf(e,t){let r,n,i;if(e.query){let i=e.query.trim();r=mf(i),t&&(n=hi(i,of,"..."))}return e.variables&&(i=e.variables),{operationType:r,operationName:e.operationName,variables:i,payload:n}}function mf(e){return e.match(/^\s*(query|mutation|subscription)\b/i)?.[1]}var Y,Mf,hf=1;function gf(e,t,r,n,i){let o=nf(t,r,n,i);_f(e,t,o),vf(e,t,o)}function _f(e,t,r){let n=Ml(t).subscribe(t=>{let n=t;if(Wd(n.url))switch(n.state){case"start":r.traceXhr(n,n.xhr),n.requestIndex=yf(),e.notify(7,{requestIndex:n.requestIndex,url:n.url});break;case"complete":r.clearTracingIfNeeded(n),e.notify(8,{...n,type:bu.XHR,isAbortedOnStart:!1})}});return{stop:()=>n.unsubscribe()}}function vf(e,t,r){let n=Bl({responseBodyAction:e=>lf(e.url,t)?.trackResponseErrors?2:1}).subscribe(t=>{let n=t;if(Wd(n.url))switch(n.state){case"start":r.traceFetch(n),n.requestIndex=yf(),e.notify(7,{requestIndex:n.requestIndex,url:n.url});break;case"resolve":r.clearTracingIfNeeded(n),e.notify(8,{...n,duration:I(n.startClocks.timeStamp,P()),type:bu.FETCH,requestBody:n.init?.body})}});return{stop:()=>n.unsubscribe()}}function yf(){let e=hf;return hf+=1,e}function bf(e){return Or(e)&&e<0?void 0:e}
1function xf(e){return e.nodeType===Node.TEXT_NODE}function Sf(e){return e.nodeType===Node.COMMENT_NODE}function Cf(e){return e.nodeType===Node.ELEMENT_NODE}function wf(e){return Cf(e)&&!!e.shadowRoot}function Tf(e){let t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&Cf(t.host)}function Ef(e){return e.childNodes.length>0||wf(e)}function Df(e,t){let r=e.firstChild;for(;r;)t(r),r=r.nextSibling;wf(e)&&t(e.shadowRoot)}function Of(e){return Tf(e)?e.host:e.parentNode}function kf(e){if(e.parentElement)return e.parentElement;let t=e.parentNode;return t&&Tf(t)?t.host:null}function Af(e,t){let r=ti(),n=!1,{stop:i}=js(e,window,["click","mousedown","keydown","touchstart","pointerdown"],t=>{if(!t.cancelable)return;let r={entryType:"first-input",processingStart:ni(),processingEnd:ni(),startTime:t.timeStamp,duration:0,name:"",cancelable:!1,target:null,interactionId:0,toJSON:()=>({})};"pointerdown"===t.type?function(e,t){js(e,window,["pointerup","pointercancel"],e=>{"pointerup"===e.type&&o(t)},{once:!0})}(e,r):o(r)},{passive:!0,capture:!0});return{stop:i};function o(e){if(!n){n=!0,i();let o=e.processingStart-e.startTime;o>=0&&o<ti()-r&&t(e)}}}function jf(e,t){return new A(r=>{if(!window.PerformanceObserver)return;let n,i,o=e=>{let t=If(e);t.length>0&&r.notify(t)},a=!0,s=new PerformanceObserver(D(e=>{a?n=O(()=>o(e.getEntries())):o(e.getEntries())}));try{s.observe(t)}catch{if([Y.RESOURCE,Y.NAVIGATION,Y.LONG_TASK,Y.PAINT].includes(t.type)){t.buffered&&(n=O(()=>o(performance.getEntriesByType(t.type))));try{s.observe({entryTypes:[t.type]})}catch{return}}}return a=!1,Nf(e),!Ff(Y.FIRST_INPUT)&&t.type===Y.FIRST_INPUT&&({stop:i}=Af(e,e=>{o([e])})),()=>{s.disconnect(),i&&i(),k(n)}})}function Nf(e){!Mf&&Pf()&&"addEventListener"in performance&&(Mf=V(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()}))}function Pf(){return void 0!==window.performance&&"getEntries"in performance}function Ff(e){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes(e)}function If(e){return e.filter(e=>!Lf(e))}function Lf(e){return!(e.entryType!==Y.RESOURCE||Wd(e.name)&&Ld(e))}function Rf(e,t,r,n,i,o){let a,s=z(zf)(e,t,r,n),l=!1,u=O(D(()=>h({hadActivity:!1})),100),c=void 0===o?void 0:O(D(()=>h({hadActivity:!0,end:P()})),o),d=s.subscribe(({isBusy:e})=>{k(u),k(a);let t=P();e||(a=O(D(()=>h({hadActivity:!0,end:t})),100))}),f=()=>{l=!0,k(u),k(a),k(c),d.unsubscribe()};function h(e){l||(f(),i(e))}return{stop:f}}function zf(e,t,r,n){return new A(i=>{let o,a=[],s=0;return a.push(t.subscribe(e=>{e.every(Vf)||l()}),r.subscribe(l),jf(n,{type:Y.RESOURCE}).subscribe(e=>{e.some(e=>!Bf(n,e.name))&&l()}),e.subscribe(7,e=>{Bf(n,e.url)||(void 0===o&&(o=e.requestIndex),s+=1,l())}),e.subscribe(8,e=>{Bf(n,e.url)||void 0===o||e.requestIndex<o||(--s,l())})),()=>{a.forEach(e=>e.unsubscribe())};function l(){i.notify({isBusy:s>0})}})}function Bf(e,t){return Ga(e.excludedActivityUrls,t)}function Vf(e){let t="characterData"===e.type?e.target.parentElement:e.target;return!!(t&&Cf(t)&&t.matches("[data-dd-excluded-activity-mutations], [data-dd-excluded-activity-mutations] *"))}!function(e){e.EVENT="event",e.FIRST_INPUT="first-input",e.LARGEST_CONTENTFUL_PAINT="largest-contentful-paint",e.LAYOUT_SHIFT="layout-shift",e.LONG_TASK="longtask",e.LONG_ANIMATION_FRAME="long-animation-frame",e.NAVIGATION="navigation",e.PAINT="paint",e.RESOURCE="resource",e.VISIBILITY_STATE="visibility-state"}(Y||={});var Hf="data-dd-action-name",Uf="Masked Element",Wf="::shadow ",Gf=[Hf,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],Kf=[tp,Qf],qf=[tp,$f,ep];function Jf(e,t){if(!e.isConnected)return;let r=Yf(e),n=[];for(let{rootNode:e,target:i}of r){let r=Xf(i,e,t);if(!r)return;n.push(r)}return n.join(Wf)}function Yf(e){let t=[],r=e;for(;r;){let e=r.getRootNode();if(t.push({rootNode:e,target:r}),!Tf(e))break;r=e.host}return t.reverse()}function Xf(e,t,r){let n,i=e;for(;i&&"HTML"!==i.nodeName;){let e=ap(i,t,Kf,op,r,n);
1if(e)return cp(e,n);n=cp(ap(i,t,qf,sp,r,n)||rp(i),n),i=i.parentElement}return n}function Zf(e){return/[0-9]/.test(e)}function Qf(e){if(e.id&&!Zf(e.id))return`#${CSS.escape(e.id)}`}function $f(e){if("BODY"===e.tagName)return;let t=e.classList;for(let r=0;r<t.length;r+=1){let n=t[r];if(!Zf(n))return`${CSS.escape(e.tagName)}.${CSS.escape(n)}`}}function ep(e){return CSS.escape(e.tagName)}function tp(e,t){if(t){let e=r(t);if(e)return e}for(let e of Gf){let t=r(e);if(t)return t}function r(t){if(e.hasAttribute(t))return`${CSS.escape(e.tagName)}${np(t,e.getAttribute(t))}`}}function np(e,t){return`[${e}="${CSS.escape(t)}"]`}function rp(e){let t=ip(e);return`${CSS.escape(e.tagName)}:nth-of-type(${t})`}function ip(e){let t=e.parentNode.firstElementChild,r=1;for(;t&&t!==e;)t.tagName===e.tagName&&(r+=1),t=t.nextElementSibling;return r}function ap(e,t,r,n,i,o){for(let a of r){let r=a(e,i);if(r&&n(e,t,r,o))return r}}function op(e,t,r,n){return 1===t.querySelectorAll(cp(r,n)).length}function sp(e,t,r,n){let i;if(void 0===n)i=e=>e.matches(r);else{let e=cp(`${r}:scope`,n);i=t=>null!==t.querySelector(e)}let o=e.previousElementSibling;for(;o;){if(i(o))return!1;o=o.previousElementSibling}for(o=e.nextElementSibling;o;){if(i(o))return!1;o=o.nextElementSibling}return!0}function cp(e,t){return t?`${e}>${t}`:e}var X={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:ho.ALLOW,MASK:ho.MASK,MASK_USER_INPUT:ho.MASK_USER_INPUT,MASK_UNLESS_ALLOWLISTED:ho.MASK_UNLESS_ALLOWLISTED},lp="data-dd-privacy",up="hidden",dp="dd-privacy-",fp="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",pp={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0};function mp(e){return`[${lp}="${e}"], .${dp}${e}`}function hp(e,t,r){if(r&&r.has(e))return r.get(e);let n=Of(e),i=n?hp(n,t,r):t,o=gp(_p(e),i);return r&&r.set(e,o),o}function gp(e,t){switch(t){case X.HIDDEN:case X.IGNORE:return t}switch(e){case X.ALLOW:case X.MASK:case X.MASK_USER_INPUT:case X.MASK_UNLESS_ALLOWLISTED:case X.HIDDEN:case X.IGNORE:return e;default:return t}}function _p(e){if(Cf(e)){if("BASE"===e.tagName)return X.ALLOW;if("INPUT"===e.tagName){let t=e;if("password"===t.type||"email"===t.type||"tel"===t.type||"hidden"===t.type)return X.MASK;let r=t.getAttribute("autocomplete");if(r&&(r.startsWith("cc-")||r.endsWith("-password")))return X.MASK}if(e.matches(mp(X.HIDDEN)))return X.HIDDEN;if(e.matches(mp(X.MASK)))return X.MASK;if(e.matches(mp(X.MASK_UNLESS_ALLOWLISTED)))return X.MASK_UNLESS_ALLOWLISTED;if(e.matches(mp(X.MASK_USER_INPUT)))return X.MASK_USER_INPUT;if(e.matches(mp(X.ALLOW)))return X.ALLOW;if(Cp(e))return X.IGNORE}}function vp(e,t){switch(t){case X.MASK:case X.HIDDEN:case X.IGNORE:return!0;case X.MASK_UNLESS_ALLOWLISTED:return xf(e)?!!bp(e.parentNode)||!wp(e.textContent||""):bp(e);case X.MASK_USER_INPUT:return xf(e)?bp(e.parentNode):bp(e);default:return!1}}function yp(e,t,r,n,i){if(n!==X.MASK&&n!==X.MASK_UNLESS_ALLOWLISTED||"data-dd-privacy"===t||Gf.includes(t)||t===i.actionNameAttribute)return!1;switch(t){case"title":case"alt":case"placeholder":case"aria-label":case"name":return!0}return!(!("A"===e&&"href"===t||"IFRAME"===e&&"srcdoc"===t||r&&t.startsWith("data-"))&&("IMG"!==e&&"SOURCE"!==e||"src"!==t&&"srcset"!==t))}function bp(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;let t=e;if("INPUT"===t.tagName)switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!pp[t.tagName]}function xp(e){return e.replace(/\S/g,"x")}function Sp(e,t){let r=e.parentElement?.tagName,n=e.textContent||"";if("HEAD"===r&&!n.trim())return;let i=t;if("SCRIPT"===r)n="***";else if(i===X.HIDDEN)n="***";else if(vp(e,i))if("DATALIST"===r||"SELECT"===r||"OPTGROUP"===r){if(!n.trim())return}else n="OPTION"===r?"***":xp(n);return n}function Cp(e){if("SCRIPT"===e.nodeName)return!0;if("LINK"===e.nodeName){let e=t("rel");return/preload|prefetch/i.test(e)&&"script"===t("as")||"shortcut icon"===e||"icon"===e}if("META"===e.nodeName){let r=t("name"),n=t("rel"),i=t("property");return/^msapplication-tile(image|color)$/.test(r)||"application-name"===r||"icon"===n||"apple-touch-icon"===n||"shortcut icon"===n||"keywords"===r||"description"===r||/^(og|twitter|fb):/.test(i)||/^(og|twitter):/.test(r)||"pinterest"===r||"robots"===r||"googlebot"===r||"b
1ingbot"===r||e.hasAttribute("http-equiv")||"author"===r||"generator"===r||"framework"===r||"publisher"===r||"progid"===r||/^article:/.test(i)||/^product:/.test(i)||"google-site-verification"===r||"yandex-verification"===r||"csrf-token"===r||"p:domain_verify"===r||"verify-v1"===r||"verification"===r||"shopify-checkout-api-token"===r}function t(t){return(e.getAttribute(t)||"").toLowerCase()}return!1}function wp(e){return!e||!e.trim()||(window.$DD_ALLOW?.has(e.toLocaleLowerCase())||!1)}function Tp(e,t){return wp(e)?e:t||xp(e)}function Ep({lifeCycle:e,isChildEvent:t,onChange:r=L}){let n={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},i=e.subscribe(13,e=>{if("view"!==e.type&&"vital"!==e.type&&t(e))switch(e.type){case J.ERROR:n.errorCount+=1,r();break;case J.ACTION:n.actionCount+=1,e.action.frustration&&(n.frustrationCount+=e.action.frustration.type.length),r();break;case J.LONG_TASK:n.longTaskCount+=1,r();break;case J.RESOURCE:e._dd?.discarded||(n.resourceCount+=1,r())}});return{stop:()=>{i.unsubscribe()},eventCounts:n}}var Dp=5*M;function Op(e){let t=al({expireDelay:Dp}),r=new Map;function n(e){var t;r.delete(e.key),null==(t=e.eventCounts)||t.stop()}function i(){r.forEach(e=>{n(e)}),t.reset()}let o=e.subscribe(10,i);return{start:function(i,o,a,s){let l=R(),u=t.add(l,o.relative),c=r.get(i);c&&n(c);let d={id:l,key:i,startClocks:o,data:a,historyEntry:u,eventCounts:s?.isChildEvent?Ep({lifeCycle:e,isChildEvent:s.isChildEvent(l)}):void 0};return r.set(i,d),d},stop:function(e,t,i){let o=r.get(e);if(!o)return;let a=i?Js(o.data,i):o.data;o.historyEntry.close(t.relative);let s=I(o.startClocks.timeStamp,t.timeStamp),l=o.eventCounts?.eventCounts;return n(o),{...a,id:o.id,startClocks:o.startClocks,duration:s,counts:l}},discard:function(e){let t=r.get(e);if(!t)return;let i=t.eventCounts?.eventCounts;return n(t),t.historyEntry.remove(),{...t.data,id:t.id,startClocks:t.startClocks,counts:i}},getCounts:function(e){return r.get(e)?.eventCounts?.eventCounts},findId:function(e){return t.findAll(e)},stopAll:function(){o.unsubscribe(),i(),t.stop()}}}var kp=["HTML","BODY"],Ap=2*es,jp=Gf.concat(["role","type","disabled","readonly","tabindex","draggable","target","rel","download","method","action","enctype","autocomplete"]);function Mp(e,t){let r=e.filter(e=>e instanceof Element&&!kp.includes(e.tagName));if(0===r.length)return"";let n=t?[t].concat(jp):jp,i="";for(let e of r){if(i+=Np(e,n),i.length>=Ap)return hi(i,Ap)}return i}function Np(e,t){let r=ep(e),n=Qf(e),i=Pp(e);return`${r}${n||""}${Ip(e,t)}${i}${Fp(e)};`}function Pp(e){return Array.from(e.classList).filter(e=>!Zf(e)).sort().map(e=>`.${CSS.escape(e)}`).join("")}function Fp(e){let t=Array.from(e.parentNode.children);if(t.length<=1)return"";let r=t.filter(t=>t.tagName===e.tagName),n=t.indexOf(e),i=ip(e);return`:nth-child(${n+1})${r.length>1?`:nth-of-type(${i})`:""}`}function Ip(e,t){let r=[],n=Array.from(e.attributes);for(let e of n)t.includes(e.name)&&r.push(np(e.name,e.value));return r.sort().join("")}var Lp=j;function Rp(e,t){let r,n=[],i=0;function o(e){e.stopObservable.subscribe(a),n.push(e),k(r),r=O(s,Lp)}function a(){1===i&&n.every(e=>e.isStopped())&&(i=2,t(n))}function s(){k(r),0===i&&(i=1,a())}return o(e),{tryAppend:e=>0===i&&(n.length>0&&!zp(n[n.length-1].event,e.event)?(s(),!1):(o(e),!0)),stop:()=>{s()}}}function zp(e,t){return e.target===t.target&&Bp(e,t)<=100&&e.timeStamp-t.timeStamp<=Lp}function Bp(e,t){return Math.sqrt((e.clientX-t.clientX)**2+(e.clientY-t.clientY)**2)}function Vp(e,t,r=X.ALLOW){let n=new Map,{actionNameAttribute:i}=t,o=Hp(e,"data-dd-action-name")||i&&Hp(e,i);return o?{name:o,nameSource:"custom_attribute"}:r===X.MASK?{name:Uf,nameSource:"mask_placeholder"}:qp(e,Wp,t,n)||qp(e,Gp,t,n)||{name:"",nameSource:"blank"}}function Hp(e,t){let r=Up(e,`[${t}]`);if(r)return Yp(Jp(r.getAttribute(t).trim()))}function Up(e,t){let r=e;for(;r;){if(r.matches(t))return r;r=kf(r)}return null}var Wp=[(e,t,r)=>{if("labels"in e&&e.labels&&e.labels.length>0)return Qp(e.labels[0],t,r)},e=>{if("INPUT"===e.nodeName){let t=e,r=t.getAttribute("type");if("button"===r||"submit"===r||"reset"===r)return{name:t.value,nameSource:"text_content"}}},(e,t,r)=>
1{if("BUTTON"===e.nodeName||"LABEL"===e.nodeName||"button"===e.getAttribute("role"))return Qp(e,t,r)},(e,t,r)=>Zp(e,"aria-label",t,r),(e,t,r)=>{let n=e.getAttribute("aria-labelledby");if(n)return{name:n.split(/\s+/).map(t=>Xp(e,t)).filter(e=>!!e).map(e=>$p(e,t,r)).join(" "),nameSource:"text_content"}},(e,t,r)=>Zp(e,"alt",t,r),(e,t,r)=>Zp(e,"name",t,r),(e,t,r)=>Zp(e,"title",t,r),(e,t,r)=>Zp(e,"placeholder",t,r),(e,t,r)=>{if("options"in e&&e.options.length>0)return Qp(e.options[0],t,r)}],Gp=[(e,t,r)=>Qp(e,t,r)],Kp=10;function qp(e,t,r,n){let i=e,o=0;for(;o<=Kp&&i&&"BODY"!==i.nodeName&&"HTML"!==i.nodeName&&"HEAD"!==i.nodeName;){for(let e of t){let t=e(i,r,n);if(t){let{name:e,nameSource:r}=t,n=e&&e.trim();if(n)return{name:Yp(Jp(n)),nameSource:r}}}if("FORM"===i.nodeName)break;i=kf(i),o+=1}}function Jp(e){return e.replace(/\s+/g," ")}function Yp(e){return e.length>100?`${hi(e,100)} [...]`:e}function Xp(e,t){let r=e.getRootNode();if(r instanceof ShadowRoot){let e=r.getElementById(t);if(e)return e}return e.ownerDocument?e.ownerDocument.getElementById(t):null}function Zp(e,t,r,n){let{enablePrivacyForActionName:i,defaultPrivacyLevel:o}=r,a=e.getAttribute(t);if(a&&i){let i=hp(e,o,n);yp(e.tagName,t,a,i,r)&&(a=Tp(a,Uf))}else a||="";return{name:a,nameSource:"standard_attribute"}}function Qp(e,t,r){return{name:$p(e,t,r)||"",nameSource:"text_content"}}function $p(e,t,r){if(e.isContentEditable)return;let{enablePrivacyForActionName:n,actionNameAttribute:i,defaultPrivacyLevel:o}=t;if(Eo(So.USE_TREE_WALKER_FOR_ACTION_NAME))return em(e,i,n,o,r);if("innerText"in e){let t=e.innerText,r=r=>{let n=e.querySelectorAll(r);for(let e=0;e<n.length;e+=1){let r=n[e];if("innerText"in r){let e=r.innerText;e&&e.trim().length>0&&(t=t.replace(e,""))}}};return r(`[${Hf}]`),i&&r(`[${i}]`),n&&r(`${mp(X.HIDDEN)}, ${mp(X.MASK)}`),t}return e.textContent}function em(e,t,r,n,i){let o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,function(e){let o=hp(e,n,i);if(r&&o&&vp(e,o))return NodeFilter.FILTER_REJECT;if(Cf(e)){if(e.hasAttribute("data-dd-action-name")||t&&e.hasAttribute(t))return NodeFilter.FILTER_REJECT;let r=getComputedStyle(e);if("visible"!==r.visibility||"none"===r.display||r.contentVisibility&&"visible"!==r.contentVisibility)return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}),a="";for(;o.nextNode();){let e=o.currentNode;Cf(e)?("BR"===e.nodeName||"P"===e.nodeName||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(e).display))&&(a+=" "):a+=e.textContent||""}return a.replace(/\s+/g," ").trim()}function tm(e,{onPointerDown:t,onPointerUp:r}){let n,i,o={selection:!1,input:!1,scroll:!1},a=[V(e,window,"pointerdown",e=>{rm(e)&&(n=nm(),o={selection:!1,input:!1,scroll:!1},i=t(e))},{capture:!0}),V(e,window,"selectionchange",()=>{(!n||!nm())&&(o.selection=!0)},{capture:!0}),V(e,window,"scroll",()=>{o.scroll=!0},{capture:!0,passive:!0}),V(e,window,"pointerup",e=>{if(rm(e)&&i){let t=o;r(i,e,()=>t),i=void 0}},{capture:!0}),V(e,window,"input",()=>{o.input=!0},{capture:!0})];return{stop:()=>{a.forEach(e=>e.stop())}}}function nm(){let e=window.getSelection();return!e||e.isCollapsed}function rm(e){return e.target instanceof Element&&!1!==e.isPrimary}var im=3;function am(e,t){if(om(e))return t.addFrustration(Du.RAGE_CLICK),e.some(cm)&&t.addFrustration(Du.DEAD_CLICK),t.hasError&&t.addFrustration(Du.ERROR_CLICK),{isRage:!0};let r=e.some(e=>e.getUserActivity().selection);return e.forEach(e=>{e.hasError&&e.addFrustration(Du.ERROR_CLICK),cm(e)&&!r&&e.addFrustration(Du.DEAD_CLICK)}),{isRage:!1}}function om(e){if(e.some(e=>e.getUserActivity().selection||e.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(im-1);t+=1)if(e[t+im-1].event.timeStamp-e[t].event.timeStamp<=1e3)return!0;return!1}var sm='input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="range"]),textarea,select,[contenteditable],[contenteditable] *,canvas,a[href],a[href] *';function cm(e){if(e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll)return!1;let t=e.event.target;return"LABEL"===t.tagName&&t.hasAttribute("for")&&(t=document.getElementById(t.getAttribute("for"))),!t||!t.matches(sm)}var lm=10*j,um=new Map;function dm(e){let t=um.get(e);return um.delete(e),t}function fm(e,t){um.set(e,t),um.forEach((e,t)=>{I(t,ni())>lm&&um.delete(t)})}function pm(e){return t=>void 0!==t.action&&void 0!==t.action.id&&t.action.id.includes(e)}function mm(e,t,r,n){let i,o=Op(e),a=new A;e.subscribe(5,u),e.subscribe(11,u);let{stop:s}=tm(n,{onPointerDown:i=>hm(n,e,t,i,r),onPointerUp:({clickActionBase:i,hadActivityOnPointerDown:s},u,c)=>{gm(n,e,t,r,o,a,l,i,u,c,s)}});return{stop:()=>{u(),a.notify(),s(),o.stopAll()},findActionId:o.findId};function l(e){if(!i||!i.tryAppend(e)){let t=e.clone();i=Rp(e,e=>{bm(e,t),i=void 0})}}function u(){i&&i.stop()}}function hm(e,t,r,n,i){let o,a=e.betaTrackActionsInShadowDom?vm(n):n.target;
1if(o=e.enablePrivacyForActionName?hp(a,e.defaultPrivacyLevel):X.ALLOW,o===X.HIDDEN)return;let s=_m(n,o,e),l=!1;return Rf(t,r,i,e,e=>{l=e.hadActivity},100),{clickActionBase:s,hadActivityOnPointerDown:()=>l}}function gm(e,t,r,n,i,o,a,s,l,u,c){let d=ym(t,i,u,s,l);a(d);let f=s?.target?.selector;f&&fm(l.timeStamp,f);let{stop:h}=Rf(t,r,n,e,e=>{e.hadActivity&&e.end<d.startClocks.timeStamp?d.discard():e.hadActivity?d.stop(e.end):c()?d.stop(d.startClocks.timeStamp):d.stop()},lm),p=t.subscribe(5,({endClocks:e})=>{d.stop(e.timeStamp)}),g=t.subscribe(11,()=>{d.stop(P())}),m=o.subscribe(()=>{d.stop()});d.stopObservable.subscribe(()=>{g.unsubscribe(),p.unsubscribe(),h(),m.unsubscribe()})}function _m(e,t,r){let n=r.betaTrackActionsInShadowDom?vm(e):e.target,i=n.getBoundingClientRect(),o=Jf(n,r.actionNameAttribute),a=Mp(e.composedPath(),r.actionNameAttribute);o&&fm(e.timeStamp,o);let{name:s,nameSource:l}=Vp(n,r,t);return{type:Eu.CLICK,target:{width:Math.round(i.width),height:Math.round(i.height),selector:o,composedPathSelector:a||void 0},position:{x:Math.round(e.clientX-i.left),y:Math.round(e.clientY-i.top)},name:s,nameSource:l}}function vm(e){if(e.composed&&wf(e.target)&&"function"==typeof e.composedPath){let t=e.composedPath();if(t.length>0&&t[0]instanceof Element)return t[0]}return e.target}function ym(e,t,r,n,i){let o=R(),a=Zr(i.timeStamp),s=t.start(o,a,n,{isChildEvent:pm});e.notify(15,s);let l,u=0,c=[],d=new A;function f(e){0===u&&(u=1,l=e?t.stop(o,Qr(e)):t.discard(o),d.notify())}return{event:i,stop:f,stopObservable:d,get hasError(){let e=l?.counts??t.getCounts(o);return!!e&&e.errorCount>0},get hasPageActivity(){return l&&"duration"in l},getUserActivity:r,addFrustration:e=>{c.push(e)},get startClocks(){return a},isStopped:()=>1===u||2===u,clone:()=>ym(e,t,r,n,i),validate:t=>{if(f(),1!==u||!l)return;let r={frustrationTypes:c,events:t??[i],event:i,...l,counts:l.counts};e.notify(0,r),u=2},discard:()=>{f(),u=2}}}function bm(e,t){let{isRage:r}=am(e,t);r?(e.forEach(e=>e.discard()),t.stop(P()),t.validate(e.map(e=>e.event))):(t.discard(),e.forEach(e=>e.validate()))}function xm(e,t){let r=Op(e);return{addAction:function(e){t({id:R(),frustrationTypes:[],...e})},startAction:function(t,n={},i=F()){let o=n.actionKey??t,a=r.start(o,i,{name:t,...n},{isChildEvent:pm});e.notify(15,a)},stopAction:function(e,n={},i=F()){let o=n.actionKey??e,a=r.stop(o,i,n);if(!a)return;let s=[];a.counts&&a.counts.errorCount>0&&s.push(Du.ERROR_CLICK),t({...a,type:a.type||Eu.CUSTOM,frustrationTypes:s})},findActionId:r.findId,stop:r.stopAll}}function Sm(e,t,r,n,i){let o,{unsubscribe:a}=e.subscribe(0,t=>{e.notify(12,Cm(t))}),s=L;
1i.trackUserInteractions&&(o=mm(e,r,n,i));let l=xm(e,t=>{e.notify(12,Cm(t))}),u={findActionId:e=>{let t=l.findActionId(e),r=o?.findActionId(e)??[];return t.concat(r)}};return t.register(0,({startTime:e,eventType:t})=>{if(t!==J.ERROR&&t!==J.RESOURCE&&t!==J.LONG_TASK)return H;let r=t===J.LONG_TASK?ii(e,1):e,n=u.findActionId(r);return n.length?{type:t,action:{id:n}}:H}),t.register(1,({startTime:e})=>({action:{id:u.findActionId(e)}})),{addAction:l.addAction,startAction:l.startAction,stopAction:l.stopAction,actionContexts:u,stop:()=>{a(),s(),l.stop(),o?.stop()}}}function Cm(e){let t=wm(e),r=bf(N(e.duration));return{rawRumEvent:{type:J.ACTION,date:e.startClocks.timeStamp,action:{id:e.id,target:{name:e.name},type:e.type,...void 0!==r&&{loading_time:r},...e.counts&&{error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},frustration:{type:e.frustrationTypes}},...t?{_dd:{action:{target:{selector:e.target?.selector||void 0,width:e.target?.width||void 0,height:e.target?.height||void 0,composed_path_selector:e.target?.composedPathSelector},position:e.position,name_source:e.nameSource}}}:{context:e.context}},duration:e.duration,startClocks:e.startClocks,domainContext:t?{events:e.events}:{handlingStack:e.handlingStack}}}function wm(e){return"events"in e}function Tm(e){let t=Yl([_r.error]).subscribe(t=>e.notify(t.error));return{stop:()=>{t.unsubscribe()}}}function Em(e,t){let r=Ns(e,[Ms.cspViolation,Ms.intervention]).subscribe(e=>t.notify(e));return{stop:()=>{r.unsubscribe()}}}function Dm(e,t,r){let n=new A;return r.subscribe(e=>{0===e.type&&n.notify(e.error)}),Tm(n),Em(t,n),n.subscribe(t=>e.notify(14,{error:t})),Om(e)}function Om(e){return e.subscribe(14,({error:t})=>{e.notify(12,km(t))}),{addError:({error:t,handlingStack:r,componentStack:n,startClocks:i,context:o})=>{let a=vs({originalError:t,handlingStack:r,componentStack:n,startClocks:i,nonErrorPrefix:"Provided",source:ws.CUSTOM,handling:"handled"});a.context=Js(a.context,o),e.notify(14,{error:a})}}}function km(e){let t={date:e.startClocks.timeStamp,error:{id:R(),message:e.message,source:e.source,stack:e.stack,handling_stack:e.handlingStack,component_stack:e.componentStack,type:e.type,handling:e.handling,causes:e.causes,source_type:"browser",fingerprint:e.fingerprint,csp:e.csp},type:J.ERROR,context:e.context},r={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startClocks:e.startClocks,domainContext:r}}var Am=new WeakSet;function jm(e){if(!performance||!("getEntriesByName"in performance))return;let t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;let r=t.filter(e=>!Am.has(e)).filter(e=>Ld(e)&&Rd(e)).filter(t=>Nm(t,e.startClocks.relative,Mm({startTime:e.startClocks.relative,duration:e.duration})));return 1===r.length?(Am.add(r[0]),r[0].toJSON()):void 0}function Mm(e){return ii(e.startTime,e.duration)}function Nm(e,t,r){return e.startTime>=t-1&&Mm(e)<=ii(r,1)}var Pm=2*M;function Fm(e){let t=Im(e)||Lm(e);if(t&&!(t.traceTime<=ti()-Pm))return t.traceId}function Im(e){let t=e.querySelector("meta[name=dd-trace-id]"),r=e.querySelector("meta[name=dd-trace-time]");return Rm(t&&t.content,r&&r.content)}function Lm(e){let t=zm(e);if(t)return Rm(fi(t,"trace-id"),fi(t,"trace-time"))}function Rm(e,t){let r=t&&Number(t);if(e&&r)return{traceId:e,traceTime:r}}function zm(e){for(let t=0;t<e.childNodes.length;t+=1){let r=Bm(e.childNodes[t]);if(r)return r}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;--t){let r=e.body.childNodes[t],n=Bm(r);if(n)return n;if(!xf(r))break}}function Bm(e){if(e&&Sf(e)){let t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function Vm(){if(Ff(Y.NAVIGATION)){let e=performance.getEntriesByType(Y.NAVIGATION)[0];if(e)return e}let e=Hm(),t={entryType:Y.NAVIGATION,initiatorType:"navigation",name:window.location.href,startTime:0,duration:e.loadEventEnd,decodedBodySize:0,encodedBodySize:0,transferSize:0,workerStart:0,toJSON:()=>({...t,toJSON:void 0}),...e};return t}function Hm(){let e={},t=performance.timing;for(let r in t)if(Or(t[r])){let n=r,i=t[n];e[n]=0===i?0:ai(i)}return e}function Um(e){return e.responseStart>=0&&e.responseStart<=ni()?e.responseStart:void 0}function Wm(){if(Ff(Y.RESOURCE))return performance.getEntriesByType(Y.RESOURCE)}function Gm(e,t){let r=Wm();if(r)return Ri(r,r=>r.name===e&&r.startTime<=t)}function Km(e,t){Ol(e,"interactive",()=>{let e=z(Vm)(),r=Object.assign(e.toJSON(),{entryType:Y.RESOURCE,initiatorType:Ad,duration:e.responseEnd,traceId:Fm(document),toJSON:()=>({...r,toJSON:void 0})});t(r)})}function qm(e){let t=new Set,r=!1,n=e.subscribe(8,e=>
1{if(t.add(e),t.size>1e3){let e=t.values().next().value;if(!r){let n;if(r=!0,Eo(So.TOO_MANY_REQUESTS_INVESTIGATION)){let r=0,i=0,o=0,a=0;for(let e of t)e.isAborted&&r++,e.isAbortedOnStart&&i++,e.type===bu.XHR&&o++,performance.getEntriesByName(e.url,"resource").some(t=>t.startTime>=e.startClocks.relative)||a++;let s=P()-e.startClocks.timeStamp;n={abortedCount:r,abortedOnStartCount:i,xhrCount:o,fetchCount:t.size-o,oldestRequestAge:s,oldestRequestEndAge:s-e.duration,withoutMatchingEntryCount:a}}Kc("Too many requests",n)}t.delete(e)}});return{getMatchingRequest(e){let r,n=1/0;for(let i of t){let t=e.startTime-i.startClocks.relative;0<=t&&t<n&&i.url===e.name&&(n=Math.abs(t),r=i)}return r&&t.delete(r),r},stop(){n.unsubscribe()}}}function Jm(e,t){return{startResource:function(e,r={},n=F()){let i=r.resourceKey??e;t.start(i,n,{url:e,...r})},stopResource:function(r,n={},i=F()){let o=n.resourceKey??r,a=t.stop(o,i,{context:n.context,type:n.type});if(!a)return;let s=I(a.startClocks.relative,i.relative),l={date:a.startClocks.timeStamp,type:J.RESOURCE,resource:{id:a.id,type:a.type||q.OTHER,url:qd(a.url),duration:N(s),method:a.method,status_code:n.statusCode,size:n.size},_dd:{},context:a.context};e.notify(12,{rawRumEvent:l,startClocks:a.startClocks,duration:s,domainContext:{isManual:!0}})}}}function Ym(e,t,r){let n,i=z(ql)(),o=t.trackEarlyRequests;o?n=qm(e):e.subscribe(8,e=>{s(()=>Xm(e,t,r))});let a=jf(t,{type:Y.RESOURCE,buffered:!0}).subscribe(e=>{for(let i of e)(o||!Pd(i))&&s(()=>Zm(i,t,r,n))});function s(t){i.push(()=>{let r=t();r&&e.notify(12,r)})}z(Km)(t,e=>{s(()=>Zm(e,t,r,n))});let l=Op(e),u=Jm(e,l);return{startResource:u.startResource,stopResource:u.stopResource,stop:()=>{i.stop(),a.unsubscribe(),l.stopAll()}}}function Xm(e,t,r){return Qm(jm(e),e,r,t)}function Zm(e,t,r,n){return Qm(e,Pd(e)&&n?n.getMatchingRequest(e):void 0,r,t)}function Qm(e,t,r,n){if(!e&&!t)return;let i=t?rh(t,n):ih(e,n);if(!n.trackResources&&!i)return;let o=e?Zr(e.startTime):t.startClocks,a=e?Fd(e):ah(r,o,t.duration),s=Eo(So.TRACK_RESOURCE_HEADERS)?sh(t,n):void 0,l=t&&$m(t,n),u=e&&eh(e);return{startClocks:o,duration:a,rawRumEvent:Js({date:o.timeStamp,resource:{id:R(),duration:N(a),type:t?t.type===bu.XHR?q.XHR:q.FETCH:Md(e),method:t?t.method:void 0,status_code:t?t.status:oh(e.responseStatus),url:t?qd(t.url):e.name,protocol:e&&Vd(e),delivery_type:e&&Hd(e),graphql:l},type:J.RESOURCE,_dd:{discarded:!n.trackResources}},i,e&&nh(e),u,s),domainContext:th(e,t)}}function $m(e,t){let r=lf(e.url,t);if(r)return sf(e,r)}function eh(e){let t=e.contentType;if(t)return{resource:{response:{headers:{"content-type":t}}}}}function th(e,t){if(t){let r={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===bu.XHR?{xhr:t.xhr,...r}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...r}}return{performanceEntry:e}}function nh(e){let{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...Ud(e),...Id(e)}}}function rh(e,t){if(e.traceSampled&&e.traceId&&e.spanId)return{_dd:{span_id:e.spanId.toString(),trace_id:e.traceId.toString(),rule_psr:t.rulePsr}}}function ih(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:Qd().toString(),rule_psr:t.rulePsr}}}function ah(e,t,r){return e.wasInPageStateDuringPeriod("frozen",t.relative,r)?void 0:r}function oh(e){return 0===e?void 0:e}function sh(e,t){let r=t.trackResourceHeaders;if(0===r.length||!e)return;let n=r.filter(t=>void 0===t.url||Ga([t.url],e.url,!0));if(0===n.length)return;let i=n.filter(e=>void 0===e.location||"any"===e.location||"response"===e.location),o=n.filter(e=>void 0===e.location||"any"===e.location||"request"===e.location),a=i.length>0?ch(e,i):void 0,s=o.length>0?lh(e,o):void 0;return a||s?{resource:{request:s?{headers:s}:void 0,response:a?{headers:a}:void 0}}:void 0}function ch(e,t){if(e.type===bu.FETCH&&e.response)return ph(e.response.headers,t);if(e.type===bu.XHR&&e.xhr){let r=e.xhr.getAllResponseHeaders();if(r)try{return ph(new Headers(mh(r)),t)}catch{}}}function lh(e,t){if(e.type!==bu.FETCH)return;let r;return e.init?.headers?r=new Headers(e.init.headers):e.input instanceof Request&&(r=e.input.headers),r?ph(r,t):void 0}var uh=/(token|cookie|secret|authorization|(api|secret|access|app).?key|(client|connecting|real).?ip|forwarded)/,dh=100,fh=128;function ph(e,t){let r={},n=0,i=0,o=!1;return e.forEach((e,a)=>{if(i++,n>=dh)return void(o||=(T.warn(`Maximum number of headers (${dh}) has been reached. Further headers are dropped.`),!0));let s=a.toLowerCase();if(uh.test(s))return;let l=t.find(e=>Ga([e.name],s));if(!l)return;let{extractor:u}=l,c=u?Xu(e,u):e;void 0!==c&&(c.length>fh&&(T.warn(`Header "${s}" value was truncated from ${c.length} to ${fh} characters.`),Kc("Resource header value was truncated",{header_name:s,original_length:c.length,limit:fh})),r[s]=hi(c,fh),n++)}),o&&Kc("Maximum number of resource headers reached",{collectedHeaderCount:n,totalHeaderCount:i}),n>0?r:void 0}function mh(e){let t=[],r=e.trim().split(/\r\n/);for(let e of r){let r=e.indexOf(":");r>0&&t.push([e.substring(0,r).trim(),e.substring(r+1).trim()])}return t}function hh(e,t,r){let{stop:n,eventCounts:i}=Ep({lifeCycle:e,isChildEvent:e=>e.view.id===t,onChange:r});return{stop:n,eventCounts:i}}var gh=10*M;function _h(e,t,r){return{stop:jf(e,{type:Y.PAINT,buffered:!0}).subscribe(e=>{let n=e.find(e=>"first-contentful-paint"===e.name&&e.startTime<t.timeStamp&&e.startTime<gh);n&&r(n.startTime)}).unsubscribe}}function vh(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(I(e,ni()))})})}function yh(e,t,r){let n=jf(e,{type:Y.FIRST_INPUT,buffered:!0}).subscribe(n=>{let i=n.find(e=>e.startTime<t.timeStamp);if(i){let t,n=I(i.startTime,i.processingStart);
1i.target&&Cf(i.target)&&(t=Jf(i.target,e.actionNameAttribute)),r({delay:n>=0?n:0,time:i.startTime,targetSelector:t})}});return{stop:()=>{n.unsubscribe()}}}function bh(e,t){return Ch(e,()=>{let e=z(Vm)();Sh(e)||t(xh(e))})}function xh(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:Um(e)}}function Sh(e){return e.loadEventEnd<=0}function Ch(e,t){let r,{stop:n}=Ol(e,"complete",()=>{r=O(()=>t())});return{stop:()=>{n(),k(r)}}}var wh=10*M;function Th(e,t,r,n){let i=1/0,{stop:o}=js(e,r,["pointerdown","keydown"],e=>{i=e.timeStamp},{capture:!0,once:!0}),a=0,s=jf(e,{type:Y.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(r=>{let o=Ri(r,e=>e.entryType===Y.LARGEST_CONTENTFUL_PAINT&&e.startTime<i&&e.startTime<t.timeStamp&&e.startTime<wh&&e.size>a);if(o){let t;o.element&&(t=Jf(o.element,e.actionNameAttribute));let r=Eh(o),i=o.startTime,s=Dh(r,i);n({value:i,targetSelector:t,resourceUrl:r,subParts:s}),a=o.size}});return{stop:()=>{o(),s.unsubscribe()}}}function Eh(e){return""===e.url?void 0:e.url}function Dh(e,t){let r=Um(Vm());if(void 0===r)return;let n=e?Gm(e,t):void 0,i=n?Math.max(r,n.requestStart||n.startTime):r,o=Math.min(t,Math.max(i,n?.responseEnd||0));return{loadDelay:i-r,loadTime:o-i,renderDelay:t-o}}function Oh(e,t,r=window){if("hidden"===document.visibilityState)return{timeStamp:0,stop:L};if(Ff(Y.VISIBILITY_STATE)){let e=performance.getEntriesByType(Y.VISIBILITY_STATE).filter(e=>"hidden"===e.name).find(e=>e.startTime>=t.relative);if(e)return{timeStamp:e.startTime,stop:L}}let n=1/0,{stop:i}=js(e,r,["pagehide","visibilitychange"],e=>{("pagehide"===e.type||"hidden"===document.visibilityState)&&(n=e.timeStamp,i())},{capture:!0});return{get timeStamp(){return n},stop:i}}function kh(e,t,r,n){let i={},{stop:o}=bh(e,e=>{r(e.loadEvent),i.navigationTimings=e,n()}),a=Oh(e,t),{stop:s}=_h(e,a,e=>{i.firstContentfulPaint=e,n()}),{stop:l}=Th(e,a,window,e=>{i.largestContentfulPaint=e,n()}),{stop:u}=yh(e,a,e=>{i.firstInput=e,n()});return{stop:function(){o(),s(),l(),u(),a.stop()},initialViewMetrics:i}}var Ah=(e,t)=>e*t,jh=(e,t)=>{let r=Math.max(e.left,t.left),n=Math.max(e.top,t.top),i=Math.min(e.right,t.right),o=Math.min(e.bottom,t.bottom);return r>=i||n>=o?0:Ah(i-r,o-n)},Mh=e=>Ah(e.previousRect.width,e.previousRect.height)+Ah(e.currentRect.width,e.currentRect.height)-jh(e.previousRect,e.currentRect);function Nh(e,t,r){if(!zh())return{stop:L};let n,i=0;r({value:0});let o=Rh(),a=jf(e,{type:Y.LAYOUT_SHIFT,buffered:!0}).subscribe(a=>{for(let s of a){if(s.hadRecentInput||s.startTime<t)continue;let{cumulatedValue:a,isMaxValue:l}=o.update(s);if(l){let e=Ph(s.sources);n={target:e?.node?new WeakRef(e.node):void 0,time:I(t,s.startTime),previousRect:e?.previousRect,currentRect:e?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(a>i){i=a;let t=(n?.target)?.deref();r({value:Er(i,4),targetSelector:t&&Jf(t,e.actionNameAttribute),time:n?.time,previousRect:n?.previousRect?Fh(n.previousRect):void 0,currentRect:n?.currentRect?Fh(n.currentRect):void 0,devicePixelRatio:n?.devicePixelRatio})}}});return{stop:()=>{a.unsubscribe()}}}function Ph(e){let t;for(let r of e)if(r.node&&Cf(r.node)){let e=Mh(r);(!t||Mh(t)<e)&&(t=r)}return t}function Fh({x:e,y:t,width:r,height:n}){return{x:e,y:t,width:r,height:n}}var Ih=5*j,Lh=j;function Rh(){let e,t,r=0,n=0;return{update:i=>{let o;return void 0===e||i.startTime-t>=Lh||i.startTime-e>=Ih?(e=t=i.startTime,n=r=i.value,o=!0):(r+=i.value,t=i.startTime,o=i.value>n,o&&(n=i.value)),{cumulatedValue:r,isMaxValue:o}}}}function zh(){return Ff(Y.LAYOUT_SHIFT)&&"WeakRef"in window}var Bh,Vh=0,Hh=1/0,Uh=0;function Wh(){"interactionCount"in performance||Bh||(Bh=new window.PerformanceObserver(D(e=>{e.getEntries().forEach(e=>{let t=e;t.interactionId&&(Hh=Math.min(Hh,t.interactionId),Uh=Math.max(Uh,t.interactionId),Vh=(Uh-Hh)/7+1)})})),Bh.observe({type:"event",buffered:!0,durationThreshold:0}))}var ig,Gh=()=>Bh?Vh:window.performance.interactionCount||0,Kh=10,qh=1*M,Jh=8;function Yh(e,t,r){if(!$h())return{getInteractionToNextPaint:()=>{},setViewEnd:L,stop:L};let n,i=1/0,{getViewInteractionCount:o,stopViewInteractionCount:a}=Zh(r),s=Xh(o),l=Qh(s),u=jf(e,{type:Y.FIRST_INPUT,buffered:!0}).subscribe(d),c=jf(e,{type:Y.EVENT,durationThreshold:40,buffered:!0}).subscribe(d);function d(e){for(let r of e)r.interactionId&&r.startTime>=t&&r.startTime<=i&&(s.process(r),l.process(r));l.pruneUntracked();let r=s.estimateP98Interaction();r&&f(r)}function f(r){let i=I(t,r.startTime);if(!n||r.duration!==n.duration||i!==n.startTime){let t=dm(r.startTime);
1!t&&r.target&&Cf(r.target)&&(t=Jf(r.target,e.actionNameAttribute)),n={duration:r.duration,startTime:i,targetSelector:t}}n.subParts=l.computeSubParts(r,eg(n.duration))}return{getInteractionToNextPaint:()=>n?{value:eg(n.duration),targetSelector:n.targetSelector,time:n.startTime,subParts:n.subParts}:o()?{value:0}:void 0,setViewEnd:e=>{i=e,a()},stop:()=>{c.unsubscribe(),u.unsubscribe(),l.stop()}}}function Xh(e){let t=[];function r(){t.sort((e,t)=>t.duration-e.duration).splice(Kh)}return{process(e){let n=t.findIndex(t=>e.interactionId===t.interactionId),i=t[t.length-1];-1===n?(t.length<Kh||e.duration>i.duration)&&(t.push(e),r()):e.duration>t[n].duration&&(t[n]=e,r())},estimateP98Interaction(){let r=Math.min(t.length-1,Math.floor(e()/50));return t[r]},isTracked:e=>t.some(t=>t.interactionId===e)}}function Zh(e){Wh();let t=e===Tu.INITIAL_LOAD?0:Gh(),r={stopped:!1};function n(){return Gh()-t}return{getViewInteractionCount:()=>r.stopped?r.interactionCount:n(),stopViewInteractionCount:()=>{r={stopped:!0,interactionCount:n()}}}}function Qh(e){let t=new Map;function r(e,t){e.startTime=Math.min(t.startTime,e.startTime),e.processingStart=Math.min(t.processingStart,e.processingStart),e.processingEnd=Math.max(t.processingEnd,e.processingEnd)}return{process(e){if(void 0===e.interactionId||!e.processingStart||!e.processingEnd)return;let n=e.startTime+e.duration,i=t.get(e.interactionId);if(i)r(i,e);else{for(let[,i]of t.entries())if(Math.abs(n-i.referenceRenderTime)<=Jh)return r(i,e),void t.set(e.interactionId,i);t.set(e.interactionId,{startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,referenceRenderTime:n})}},pruneUntracked(){for(let[r]of t)e.isTracked(r)||t.delete(r)},computeSubParts(e,r){if(!e.processingStart||!e.processingEnd||void 0===e.interactionId)return;let n=t.get(e.interactionId);if(!n)return;let i=Math.max(n.startTime+r,n.processingStart),o=Math.min(n.processingEnd,i);return{inputDelay:I(n.startTime,n.processingStart),processingDuration:I(n.processingStart,o),presentationDelay:I(o,i)}},stop(){t.clear()}}}function $h(){return Ff(Y.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function eg(e){return Math.min(e,qh)}function tg(e,t,r,n,i,o,a){let s=i===Tu.INITIAL_LOAD,l=!0,u=[],c=Oh(n,o);function d(){if(!l&&!s&&u.length>0){let e=Math.max(...u);e<c.timeStamp-o.relative&&a(e)}}let{stop:f}=Rf(e,t,r,n,e=>{l&&(l=!1,e.hadActivity&&u.push(I(o.timeStamp,e.end)),d())});return{stop:()=>{f(),c.stop()},setLoadEvent:e=>{s&&(s=!1,u.push(e),d())}}}function ng(){let e,t=window.visualViewport;return e=t?t.pageLeft-t.offsetLeft:void 0===window.scrollX?window.pageXOffset||0:window.scrollX,Math.round(e)}function rg(){let e,t=window.visualViewport;return e=t?t.pageTop-t.offsetTop:void 0===window.scrollY?window.pageYOffset||0:window.scrollY,Math.round(e)}function ag(e){return ig||=og(e),ig}function og(e){return new A(t=>{let{throttled:r}=ui(()=>{t.notify(sg())},200);return V(e,window,"resize",r,{capture:!0,passive:!0}).stop})}function sg(){let e=window.visualViewport;return e?{width:Number(e.width*e.scale),height:Number(e.height*e.scale)}:{width:Number(window.innerWidth||0),height:Number(window.innerHeight||0)}}var cg=j;function lg(e,t,r,n=dg(e)){let i=0,o=0,a=0,s=n.subscribe(({scrollDepth:e,scrollTop:n,scrollHeight:s})=>{let l=!1;if(e>i&&(i=e,l=!0),s>o){o=s;let e=ni();a=I(t.relative,e),l=!0}l&&r({maxDepth:Math.min(i,o),maxDepthScrollTop:n,maxScrollHeight:o,maxScrollHeightTime:a})});return{stop:()=>s.unsubscribe()}}function ug(){let e=rg(),{height:t}=sg();return{scrollHeight:Math.round((document.scrollingElement||document.documentElement).scrollHeight),scrollDepth:Math.round(t+e),scrollTop:e}}function dg(e,t=cg){return new A(r=>{function n(){r.notify(ug())}if(window.ResizeObserver){let r=ui(n,t,{leading:!1,trailing:!0}),i=document.scrollingElement||document.documentElement,o=new ResizeObserver(D(r.throttled));i&&o.observe(i);let a=V(e,window,"scroll",r.throttled,{passive:!0});return()=>{r.cancel(),o.disconnect(),a.stop()}}})}function fg(e,t,r,n,i,o,a){let s={},l=!1,u=!1,{stop:c,setLoadEvent:d}=tg(e,t,r,n,o,a,e=>{l||(s.loadingTime=e,i())}),{stop:f}=lg(n,a,e=>{s.scroll=e}),{stop:h}=Nh(n,a.relative,e=>{s.cumulativeLayoutShift=e,i()}),{stop:p,getInteractionToNextPaint:g,setViewEnd:m}=Yh(n,a.relative,o);return{stop:()=>{c(),h(),f()}
1,stopINPTracking:p,setLoadEvent:d,setViewEnd:e=>{u=!0,m(e)},getCommonViewMetrics:()=>(s.interactionToNextPaint=g(),s),setLoadingTime:e=>{if(u)return;let t=I(a.timeStamp,e??P());l||c(),l=!0,s.loadingTime=t,i()}}}function pg(e,t){let{stop:r}=V(e,window,"pageshow",e=>{e.persisted&&t(e)},{capture:!0});return r}function mg(e,t,r){vh(e.relative,e=>{t.firstContentfulPaint=e,t.largestContentfulPaint={value:e},r()})}var hg=3e3,gg=5*M,_g=5*M;function vg(e,t,r,n,i,o,a){let s,l,u=new Set,c=d(Tu.INITIAL_LOAD,ri(),a);function d(i,o,a){let s=yg(e,t,r,n,i,o,a);return u.add(s),s.stopObservable.subscribe(()=>{u.delete(s)}),s}return e.subscribe(10,()=>{c=d(Tu.ROUTE_CHANGE,void 0,{name:c.name,service:c.service,version:c.version,context:c.contextManager.getContext()})}),e.subscribe(9,()=>{c.end({sessionIsActive:!1})}),o&&(l=function(e){return e.subscribe(({oldLocation:e,newLocation:t})=>{xg(e,t)&&(c.end(),c=d(Tu.ROUTE_CHANGE))})}(i),n.trackBfcacheViews&&(s=pg(n,e=>{c.end();let t=Zr(e.timeStamp);c=d(Tu.BF_CACHE,t,void 0)}))),{addTiming:(e,t=P())=>{c.addTiming(e,t)},setLoadingTime:e=>c.setLoadingTime(e),startView:(e,t)=>{c.end({endClocks:t}),c=d(Tu.ROUTE_CHANGE,t,e)},setViewContext:e=>{c.contextManager.setContext(e)},setViewContextProperty:(e,t)=>{c.contextManager.setContextProperty(e,t)},setViewName:e=>{c.setViewName(e)},getViewContext:()=>c.contextManager.getContext(),stop:()=>{l&&l.unsubscribe(),s&&s(),c.end(),u.forEach(e=>e.stop())}}}function yg(e,t,r,n,i,o=F(),a){let s,l=R(),u=new A,c={},d=0,f=Ar(z(window.location)),h=iu(),p=!0,g=a?.name,m=a?.service||n.service,_=a?.version||n.version,y=a?.context,v=a?.handlingStack;y&&h.setContext(y);let b={id:l,name:g,startClocks:o,service:m,version:_,context:y,url:a?.url};e.notify(1,b),e.notify(2,b);let{throttled:S,cancel:w}=ui(q,hg,{leading:!1}),{setLoadEvent:E,setViewEnd:k,stop:C,stopINPTracking:x,getCommonViewMetrics:T,setLoadingTime:D}=fg(e,t,r,n,V,i,o),{stop:N,initialViewMetrics:M}=i===Tu.INITIAL_LOAD?kh(n,o,E,V):{stop:L,initialViewMetrics:{}};i===Tu.BF_CACHE&&mg(o,M,V);let{stop:U,eventCounts:j}=hh(e,l,V),$=Wr(q,gg),B=e.subscribe(11,e=>{e.reason===Sc.UNLOADING&&q()});function K(){e.notify(3,{id:l,name:g,context:h.getContext(),startClocks:o,sessionIsActive:p})}function V(){K(),S()}function q(){w(),K(),d+=1;let t=void 0===s?P():s.timeStamp;e.notify(4,{customTimings:c,documentVersion:d,id:l,name:g,service:m,version:_,context:h.getContext(),loadingType:i,location:f,handlingStack:v,startClocks:o,commonViewMetrics:T(),initialViewMetrics:M,duration:I(o.timeStamp,t),isActive:void 0===s,sessionIsActive:p,eventCounts:j})}return q(),h.changeObservable.subscribe(V),{get name(){return g},service:m,version:_,contextManager:h,stopObservable:u,end(t={}){s||(s=t.endClocks??F(),p=t.sessionIsActive??!0,e.notify(5,{endClocks:s}),e.notify(6,{endClocks:s}),Gr($),k(s.relative),C(),B.unsubscribe(),q(),O(()=>{this.stop()},_g))},stop(){N(),U(),x(),u.notify()},addTiming(e,t){if(s)return;let r=si(t)?t:I(o.timeStamp,t);c[bg(e)]=r,V()},setLoadingTime:D,setViewName(e){g=e,q()}}}function bg(e){let t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&T.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function xg(e,t){return e.pathname!==t.pathname||!Sg(t.hash)&&Cg(t.hash)!==Cg(e.hash)}function Sg(e){let t=e.substring(1);return""!==t&&!!document.getElementById(t)}function Cg(e){let t=e.indexOf("?");return t<0?e:e.slice(0,t)}function wg(e,t,r,n,i,o,a,s,l){return e.subscribe(4,t=>e.notify(12,Tg(t,r,a))),t.register(0,({startTime:e,eventType:t})=>{let r=s.findView(e);return r?{type:t,service:r.service,version:r.version,context:r.context,view:{id:r.id,name:r.name}}:Mc}),t.register(1,({startTime:e})=>({view:{id:s.findView(e)?.id}})),vg(e,n,i,r,o,!r.trackViewsManually,l)}function Tg(e,t,r){let n=r.getReplayStats(e.id),i=e.commonViewMetrics?.cumulativeLayoutShift?.devicePixelRatio,o={_dd:{document_version:e.documentVersion,replay_stats:n,cls:i?{device_pixel_ratio:i}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:J.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:e.commonViewMetrics.cumulativeLayoutShift?.value,cumulative_layout_shift_time:N(e.commonViewMetrics.cumulativeLayoutShift?.time),cumulative_layout_shift_target_selector:e.commonViewMetrics.cumulativeLayoutShift?.targetSelector,first_byte:N(e.initialViewMetrics.navigationTimings?.firstByte),dom_complete:N(e.initialViewMetrics.navigationTimings?.domComplete),dom_content_loaded:N(e.initialViewMetrics.navigationTimings?.domContentLoaded),dom_interactive:N(e.initialViewMetrics.navigationTimings?.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:N(e.initialViewMetrics.firstContentfulPaint),first_input_delay:N(e.initialViewMetrics.firstInput?.delay),first_input_time:N(e.initialViewMetrics.firstInput?.time),first_input_target_selector:e.initialViewMetrics.firstInput?.targetSelector,interaction_to_next_paint:N(e.commonViewMetrics.interactionToNextPaint?.value),interaction_to_next_paint_time:N(e.commonViewMetrics.interactionToNextPaint?.time),interaction_to_next_paint_target_selector:e.commonViewMetrics.interactionToNextPaint?.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:N(e.initialViewMetrics.largestContentfulPaint?.value),largest_contentful_paint_target_selector:e.initialViewMetrics.largestContentfulPaint?.targetSelector,load_event:N(e.initialViewMetrics.navigationTimings?.loadEvent),loading_time:bf(N(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:Eg(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:N(e.duration)},display:e.commonViewMetrics.scroll?{scroll:{max_depth:e.commonViewMetrics.scroll.maxDepth,max_depth_scroll_top:e.commonViewMetrics.scroll.maxDepthScrollTop,max_scroll_height:e.commonViewMetrics.scroll.maxScrollHeight,max_scroll_height_time:N(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:Cu()}};return Mr(e.customTimings)||(o.view.custom_timings=Nr(e.customTimings,N)),{rawRumEvent:o,startClocks:e.startClocks,duration:e.duration,domainContext:{location:e.location,handlingStack:e.handlingStack}}}function Eg({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:r,firstInput:n,largestContentfulPaint:i}){return{cls:e&&{score:e.value,timestamp:N(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:r&&{timestamp:N(r)},fid:n&&{duration:N(n.delay),timestamp:N(n.time),target_selector:n.targetSelector}
1,inp:t&&{duration:N(t.value),timestamp:N(t.time),target_selector:t.targetSelector,sub_parts:t.subParts?{input_delay:N(t.subParts.inputDelay),processing_duration:N(t.subParts.processingDuration),presentation_delay:N(t.subParts.presentationDelay)}:void 0},lcp:i&&{timestamp:N(i.value),target_selector:i.targetSelector,resource_url:i.resourceUrl,sub_parts:i.subParts?{load_delay:N(i.subParts.loadDelay),load_time:N(i.subParts.loadTime),render_delay:N(i.subParts.renderDelay)}:void 0}}}function Dg(e,t,r){let n=yl(e,"rum",t=>kg(e,t),r);return n.expireObservable.subscribe(()=>{t.notify(9)}),n.renewObservable.subscribe(()=>{t.notify(10)}),n.sessionStateUpdateObservable.subscribe(({previousState:e,newState:t})=>{if(!e.forcedReplay&&t.forcedReplay){let e=n.findSession();e&&(e.isReplayForced=!0)}}),{findTrackedSession:e=>{let t=n.findSession(e);if(t&&"0"!==t.trackingType)return{id:t.id,sessionReplay:"1"===t.trackingType?1:t.isReplayForced?2:0,anonymousId:t.anonymousId}},expire:n.expire,expireObservable:n.expireObservable,setForcedReplay:()=>n.updateSessionState({forcedReplay:"1"})}}function Og(){let e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:+!!yc("records")};return{findTrackedSession:()=>e,expire:L,expireObservable:new A,setForcedReplay:L}}function kg(e,t){return Ag(t)?t:Tr(e.sessionSampleRate)?Tr(e.sessionReplaySampleRate)?"1":"2":"0"}function Ag(e){return"0"===e||"1"===e||"2"===e}function jg(e,t,r,n,i,o){let a=[e.rumEndpointBuilder];e.replica&&a.push(e.replica.rumEndpointBuilder);let s=Ec({encoder:o(2),request:pc(a,r),flushController:Ac({pageMayExitObservable:n,sessionExpireObservable:i})});return t.subscribe(13,e=>{e.type===J.VIEW?s.upsert(e,e.view.id):s.add(e)}),s}function Mg(e){let t=vc();e.subscribe(13,e=>{t.send("rum",e)})}var Ng=Vi;function Pg(e,t,r){let n,i=al({expireDelay:Ng});e.subscribe(1,({startClocks:e,url:t})=>{let r=z(location).href,o=void 0===t?r:wi(t,r).href;i.add(a({url:o,referrer:n||document.referrer}),e.relative),n=o}),e.subscribe(6,({endClocks:e})=>{i.closeActive(e.relative)});let o=r.subscribe(({newLocation:e})=>{let t=i.find();if(t){let r=ni();i.closeActive(r),i.add(a({url:e.href,referrer:t.referrer}),r)}});function a({url:e,referrer:t}){return{url:e,referrer:t}}return t.register(0,({startTime:e,eventType:t})=>{let r=i.find(e);return r?{type:t,view:{url:r.url,referrer:r.referrer}}:Mc}),{findUrl:e=>i.find(e),stop:()=>{o.unsubscribe(),i.stop()}}}function Fg(e){let t=Ar(location);return new A(r=>{let{stop:n}=Ig(e,o),{stop:i}=Lg(e,o);function o(){if(t.href===location.href)return;let e=Ar(location);r.notify({newLocation:e,oldLocation:t}),t=e}return()=>{n(),i()}})}function Ig(e,t){let{stop:r}=Qo(Rg("pushState"),"pushState",({onPostCall:e})=>{e(t)}),{stop:n}=Qo(Rg("replaceState"),"replaceState",({onPostCall:e})=>{e(t)}),{stop:i}=V(e,window,"popstate",t);return{stop:()=>{r(),n(),i()}}}function Lg(e,t){return V(e,window,"hashchange",t)}function Rg(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}var zg=Vi;function Bg(e,t,r){let n=al({expireDelay:zg});return e.subscribe(1,({startClocks:e})=>{n.add({},e.relative)}),e.subscribe(6,({endClocks:e})=>{n.closeActive(e.relative)}),t.register(0,({startTime:e,eventType:t})=>{if(!r.trackFeatureFlagsForEvents.concat([J.VIEW,J.ERROR]).includes(t))return H;let i=n.find(e);return!i||Mr(i)?H:{type:t,feature_flags:i}}),{addFeatureFlagEvaluation:(e,t)=>{let r=n.find();r&&(r[e]=t)}}}var Hg,Ug,Vg=10*j;function Wg(e,t,r){e.metricsEnabled&&(Jg(),Ug=!1,t.subscribe(13,()=>{Ug=!0}),r.subscribe(({bytesCount:e,messagesCount:t})=>{Ug&&(Ug=!1,Hg.batchCount+=1,qg(Hg.batchBytesCount,e),qg(Hg.batchMessagesCount,t))}),Wr(Gg,Vg))}function Gg(){0!==Hg.batchCount&&(Yc("Customer data measures",Hg),Jg())}function Kg(){return{min:1/0,max:0,sum:0}}function qg(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function Jg(){Hg={batchCount:0,batchBytesCount:Kg(),batchMessagesCount:Kg()}}var Yg=4e3,Xg=Vi;function Zg(e,t,r=500){let n,i=al({expireDelay:Xg,maxEntries:Yg});Ff(Y.VISIBILITY_STATE)&&performance.getEntriesByType(Y.VISIBILITY_STATE).forEach(e=>{a("hidden"===e.name?"hidden":"active",e.startTime)}),a(e_(),ni());let{stop:o}=js(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],e=>{a($g(e),e.timeStamp)},{capture:!0});function a(e,t=ni()){e!==n&&(n=e,i.closeActive(t),i.add({state:n,startTime:t},t))}function s(e,t,r){return i.findAll(t,r).some(t=>t.state===e)}return e.register(0,({startTime:e,duration:t=0,eventType:n})=>n===J.VIEW?{type:n,_dd:{page_states:Qg(i.findAll(e,t),e,r)}}:n===J.ACTION||n===J.ERROR?{type:n,view:{in_foreground:s("active",e,0)}}:H),{wasInPageStateDuringPeriod:s,addPageState:a,stop:()=>{o(),i.stop()}}}function Qg(e,t,r){if(0!==e.length)return e.slice(-r).reverse().map(({state:e,startTime:r})=>({state:e,start:N(I(t,r))}))}function $g(e){return"freeze"===e.type?"frozen":"pagehide"===e.type?e.persisted?"frozen":"terminated":e_()}function e_(){return"hidden"===document.visibilityState?"hidden":document.hasFocus()?"active":"passive"}function t_(e,t){let r,n=requestAnimationFrame(D(()=>{r=sg()})),i=ag(t).subscribe(e=>{r=e}).unsubscribe;return e.register(0,({eventType:e})=>({type:e,display:r?{viewport:r}:void 0})),{stop:()=>{i(),n&&cancelAnimationFrame(n)}}}function n_(e,t){let r=window.cookieStore?r_(e):a_;return new A(e=>r(t,t=>e.notify(t)))}function r_(e){return(t,r)=>V(e,window.cookieStore,"change",e=>{let n=e.changed.find(e=>e.name===t)||e.deleted.find(e=>e.name===t);n&&r(n.value)}).stop}var i_=j;function a_(e,t){let r=fi(document.cookie,e),n=Wr(()=>{let n=fi(document.cookie,e);n!==r&&(r=n,t(n))},i_);return()=>{Gr(n)}}var o_="datadog-ci-visibility-test-execution-id";function s_(e,t,r=n_(e,o_)){let n=ji("datadog-ci-visibility-test-execution-id")||window.Cypress?.env("traceId"),i=r.subscribe(e=>{n=e});return t.register(0,({eventType:e})=>"string"==typeof n?{type:e,session:{type:"ci_test"},ci_test:{test_execution_id:n}}:H),{stop:()=>{i.unsubscribe()}}}function c_(e,t){let r=jf(t,{type:Ff(Y.LONG_ANIMATION_FRAME)?Y.LONG_ANIMATION_FRAME:Y.LONG_TASK,buffered:!0}).subscribe(r=>{for(let n of r){if(!t.trackLongTasks)break;let r=Zr(n.startTime),i=l_(n,r);e.notify(12,{rawRumEvent:i,startClocks:r,duration:n.duration,domainContext:{performanceEntry:n}})}});return{stop:()=>r.unsubscribe()}}function l_(e,t){let r=R(),n=N(e.duration),i={date:t.timeStamp,type:J.LONG_TASK,_dd:{discarded:!1}};return e.entryType===Y.LONG_TASK?{...i,long_task:{id:r,entry_type:wu.LONG_TASK,duration:n}}:{...i,long_task:{id:r,entry_type:wu.LONG_ANIMATION_FRAME,duration:n,blocking_duration:N(e.blockingDuration),first_ui_event_timestamp:N(e.firstUIEventTimestamp),render_start:N(e.renderStart),style_and_layout_start:N(e.styleAndLayoutStart),start_time:N(e.startTime),scripts:e.scripts.map(e=>({duration:N(e.duration),pause_duration:N(e.pauseDuration),forced_style_and_layout_duration:N(e.forcedStyleAndLayoutDuration),start_time:N(e.startTime),execution_start:N(e.executionStart),source_url:e.sourceURL,source_function_name:e.sourceFunctionName,source_char_position:e.sourceCharPosition,invoker:e.invoker,invoker_type:e.invokerType,window_attribution:e.windowAttribution}))}}}function u_(e){e.register(0,({eventType:e})=>pl()?{type:e,session:{type:"synthetics"},synthetics:{...fl(),injected:dl()}}:H)}function d_(e,t,r){let n=qs(e),i=r(n);return Bi(t).forEach(([t,r])=>f_(e,n,t.split(/\.|(?=\[\])/),r)),i}function f_(e,t,r,n){let[i,...o]=r;if("[]"!==i){if(m_(e)&&m_(t)){if(o.length>0)return f_(e[i],t[i],o,n);p_(e,i,t[i],n)}}else Array.isArray(e)&&Array.isArray(t)&&e.forEach((e,r)=>f_(e,t[r],o,n))}function p_(e,t,r,n){if(e[t]===r)return;let i=Ha(r);i===n?e[t]=B(r):"object"===n&&("undefined"===i||"null"===i)&&(e[t]={})}function m_(e){return"object"===Ha(e)}var v_,h_={"view.name":"string","view.url":"string","view.referrer":"string"},g_={context:"object"},__={service:"string",version:"string"};function y_(e,t,r,n,i){v_={[J.VIEW]:{"view.performance.lcp.resource_url":"string",...g_,...h_,...__},[J.ERROR]:{"error.message":"string","error.stack":"string","error.handling_stack":"string","error.resource.url":"string","error.fingerprint":"string",...g_,...h_,...__},[J.RESOURCE]:{"resource.url":"string","resource.graphql.variables":"string","resource.request.headers":"object","resource.response.headers":"object",...g_,...h_,...__},[J.ACTION]:{"action.target.name":"string",...g_,...h_,...__},[J.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...g_,...h_,...__},[J.VITAL]:{...g_,...h_,...__}};let o={[J.ERROR]:Dl(J.ERROR,n,i),[J.ACTION]:Dl(J.ACTION,n,i),[J.VITAL]:Dl(J.VITAL,n,i)};t.subscribe(12,({startClocks:n,duration:i,rawRumEvent:a,domainContext:s})=>{let l=r.triggerHook(0,{eventType:a.type,rawRumEvent:a,domainContext:s,startTime:n.relative,duration:i});if("DISCARDED"===l)return;let u=Js(l,a,{ddtags:Bs(e).join(",")});b_(u,e.beforeSend,s,o)&&(Mr(u.context)&&delete u.context,t.notify(13,u))})}function b_(e,t,r,n){if(t){let n=d_(e,v_[e.type],e=>t(e,r));if(!1===n&&e.type!==J.VIEW)return!1;!1===n&&T.warn("Can't dismiss view events using beforeSend!")}return!n[e.type]?.isLimitReached()}function x_(e,t,r,n){e.register(0,({eventType:e,startTime:i})=>{let o,a,s,l=t.findTrackedSession(i),u=n.findView(i);return l&&u?(e===J.VIEW?(o=!!r.getReplayStats(u.id)||void 0,a=1===l.sessionReplay,s=!!u.sessionIsActive&&void 0):o=!!r.isRecording()||void 0,{type:e,session:{id:l.id,type:"user",has_replay:o,sampled_for_replay:a,is_active:s}}):Mc}),e.register(1,({startTime:e})=>{let r=t.findTrackedSession(e);return r?{session:{id:r.id}}:H})}function S_(e){e.register(0,({eventType:e})=>({type:e,connectivity:Xs()}))}function C_(e,t,r){e.register(0,({eventType:e})=>{let n=t.source;return{type:e,_dd:{format_version:2,drift:ei(),configuration:{session_sample_rate:Er(t.sessionSampleRate,3),session_replay_sample_rate:Er(t.sessionReplaySampleRate,3),profiling_sample_rate:Er(t.profilingSampleRate,3),trace_sample_rate:Er(t.traceSampleRate,3),beta_encode_cookie_options:t.betaEncodeCookieOptions},browser_sdk_version:bc()?"6.33.0":void 0,sdk_name:r},application:{id:t.applicationId},date:P(),source:n}}),e.register(1,()=>({application:{id:t.applicationId}}))}function w_(e,t){e.register(1,()=>t.isGranted()?H:Mc)}var B_,T_=[J.ACTION,J.ERROR,J.LONG_TASK,J.RESOURCE,J.VITAL];function E_(e){return{addEvent:(t,r,n,i)=>{T_.includes(r.type)&&e.notify(12,{startClocks:Zr(t),rawRumEvent:r,domainContext:n,duration:i})}}}function D_(e,t){if(!t.metricsEnabled)return{stop:L};let{unsubscribe:r}=e.subscribe(4,({initialViewMetrics:e})=>{!e.largestContentfulPaint||!e.navigationTimings||(Yc("Initial view metrics",{metrics:O_(e.largestContentfulPaint,e.navigationTimings)}),r())});return{stop:r}}function O_(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function k_(e){let t=window,r=new Map;function n(){t.DD_SOURCE_CODE_CONTEXT&&=(Bi(t.DD_SOURCE_CODE_CONTEXT).forEach(([e,t])=>{let n=ko({stack:e}).stack[0];
1n.url?r.has(n.url)||r.set(n.url,t):qc("Source code context: missing frame url",{stack:e})}),{})}n(),e.register(0,({domainContext:e,rawRumEvent:t})=>{if(n(),0===r.size)return H;let i=A_(e,t),o=i&&r.get(i);return o?{type:t.type,service:o.service,version:o.version}:H})}function A_(e,t){if("long_task"===t.type&&"long-animation-frame"===t.long_task.entry_type)return t.long_task.scripts[0]?.source_url;let r;return"handlingStack"in e&&(r=e.handlingStack),"error"===t.type&&t.error.stack&&(r=t.error.stack),ko({stack:r}).stack[0]?.url}function j_(e,t,r,n,i,o,a,s,l,u,c){let d=[],f=new Dd;f.subscribe(13,e=>Gs("rum",e));let h=e=>{f.notify(14,{error:e}),Kc("Error reported to customer",{"error.message":e.message})},p=Cc(e),g=bc()?Og():Dg(e,f,o);if(bc()){Mg(f);let e=p.subscribe(e=>{f.notify(11,e)});d.push(()=>e.unsubscribe())}else{let t=jg(e,f,h,p,g.expireObservable,i),r=t.flushController.preparePageExitFlushObservable.subscribe(e=>{f.notify(11,{reason:e})});d.push(()=>r.unsubscribe()),d.push(()=>t.stop()),Wg(l,f,t.flushController.flushObservable)}w_(u,o);let{stop:m}=D_(f,l);d.push(m);let{stop:_,...y}=M_(f,u,e,g,t,n,a,s,c,h);return d.push(_),s.unbuffer(),d.push(()=>r.stop()),{...y,lifeCycle:f,session:g,stopSession:()=>g.expire(),telemetry:l,stop:()=>{d.forEach(e=>e())},hooks:u}}function M_(e,t,r,n,i,o,a,s,l,u){let c=[],d=Cd(),f=Fg(r),{observable:h,stop:p}=Td();c.push(p),C_(t,r,l);let g=Zg(t,r);c.push(()=>g.stop());let m=kd(e);c.push(()=>m.stop());let _=Pg(e,t,f);c.push(()=>_.stop());let y=Bg(e,t,r);x_(t,n,i,m),S_(t),pu(t);let v=gu(t,r,"rum",!0),b=vu(t,r,n,"rum"),S=lu(t,r,"rum"),w=Sm(e,t,d,h,r);c.push(w.stop);let E=E_(e),k=t_(t,r);c.push(k.stop);let C=s_(r,t);c.push(C.stop),u_(t),y_(r,e,t,u);let{addTiming:x,setLoadingTime:A,startView:T,setViewName:O,setViewContext:I,setViewContextProperty:R,getViewContext:D,stop:P}=wg(e,t,r,d,h,f,i,m,o);k_(t),c.push(P);let L=Ym(e,r,g);c.push(L.stop);let{stop:N}=c_(e,r);c.push(N);let{addError:M}=Dm(e,r,s);gf(e,r,n,b,S);let U=Au(e,g,a),F=Ed(r.applicationId,n,m,w.actionContexts,_);return{addAction:w.addAction,startAction:w.startAction,stopAction:w.stopAction,startResource:L.startResource,stopResource:L.stopResource,addEvent:E.addEvent,addError:M,addTiming:x,setLoadingTime:A,addFeatureFlagEvaluation:y.addFeatureFlagEvaluation,startView:T,setViewContext:I,setViewContextProperty:R,getViewContext:D,setViewName:O,viewHistory:m,getInternalContext:F.get,startDurationVital:U.startDurationVital,stopDurationVital:U.stopDurationVital,addDurationVital:U.addDurationVital,addOperationStepVital:U.addOperationStepVital,globalContext:v,userContext:b,accountContext:S,stop:()=>c.forEach(e=>e())}}function N_(e,t,r={}){let n=Va(),i=ku(),o=Su().observable,a=bd(r,n,i,(s,l,u,c,d)=>{let f=l&&r.createDeflateEncoder?e=>r.createDeflateEncoder(s,l,e):jc,h=z(j_)(s,e,t,u,f,n,i,o,c,d,r.sdkName);return e.onRumStart(h.lifeCycle,s,h.session,h.viewHistory,l,h.telemetry),t.onRumStart(h.lifeCycle,h.hooks,s,h.session,h.viewHistory,f),a=P_(a,h),Fu(s.plugins,"onRumStart",{strategy:a,addEvent:h.addEvent,addError:h.addError}),h}),s=()=>a,l=Os({init:e=>{let t=Error().stack;Vr(()=>a.init(e,l,t))},setTrackingConsent:D(e=>{n.update(e),U({feature:"set-tracking-consent",tracking_consent:e})}),setViewName:D(e=>{a.setViewName(e),U({feature:"set-view-name"})}),setViewContext:D(e=>{a.setViewContext(e),U({feature:"set-view-context"})}),setViewContextProperty:D((e,t)=>{a.setViewContextProperty(e,t),U({feature:"set-view-context-property"})}),getViewContext:D(()=>(U({feature:"set-view-context-property"}),a.getViewContext())),getInternalContext:D(e=>a.getInternalContext(e)),getInitConfiguration:D(()=>qs(a.initConfiguration)),addAction:(e,t)=>{let r=Yo("action");Vr(()=>{a.addAction({name:B(e),context:B(t),startClocks:F(),type:Eu.CUSTOM,handlingStack:r}),U({feature:"add-action"})})},startAction:D((e,t)=>{a.initConfiguration&&!Eo(So.START_STOP_ACTION)||a.startAction(B(e),{type:B(t&&t.type),context:B(t&&t.context),actionKey:t&&t.actionKey})}),stopAction:D((e,t)=>{a.initConfiguration&&!Eo(So.START_STOP_ACTION)||a.stopAction(B(e),{type:B(t&&t.type),context:B(t&&t.context),actionKey:t&&t.actionKey})}),startResource:D((e,t)=>{a.initConfiguration&&!Eo(So.START_STOP_RESOURCE)||a.startResource(B(e),{type:B(t&&t.type),method:B(t&&t.method),context:B(t&&t.context),resourceKey:t&&t.resourceKey})}),stopResource:D((e,t)=>{a.initConfiguration&&!Eo(So.START_STOP_RESOURCE)||a.stopResource(B(e),{type:B(t&&t.type),statusCode:t&&t.statusCode,size:t&&t.size,context:B(t&&t.context),resourceKey:t&&t.resourceKey})}),addError:(e,t)=>
1{let r=Yo("error");Vr(()=>{a.addError({error:e,handlingStack:r,context:B(t),startClocks:F()}),U({feature:"add-error"})})},addTiming:D((e,t)=>{a.addTiming(B(e),t)}),setViewLoadingTime:D(()=>{let e=P();a.setLoadingTime(e),U({feature:"addViewLoadingTime"})}),setGlobalContext:W(s,G.globalContext,K.setContext,"set-global-context"),getGlobalContext:W(s,G.globalContext,K.getContext,"get-global-context"),setGlobalContextProperty:W(s,G.globalContext,K.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:W(s,G.globalContext,K.removeContextProperty,"remove-global-context-property"),clearGlobalContext:W(s,G.globalContext,K.clearContext,"clear-global-context"),setUser:W(s,G.userContext,K.setContext,"set-user"),getUser:W(s,G.userContext,K.getContext,"get-user"),setUserProperty:W(s,G.userContext,K.setContextProperty,"set-user-property"),removeUserProperty:W(s,G.userContext,K.removeContextProperty,"remove-user-property"),clearUser:W(s,G.userContext,K.clearContext,"clear-user"),setAccount:W(s,G.accountContext,K.setContext,"set-account"),getAccount:W(s,G.accountContext,K.getContext,"get-account"),setAccountProperty:W(s,G.accountContext,K.setContextProperty,"set-account-property"),removeAccountProperty:W(s,G.accountContext,K.removeContextProperty,"remove-account-property"),clearAccount:W(s,G.accountContext,K.clearContext,"clear-account"),startView:e=>{let t=Yo("view");Vr(()=>{let r="object"==typeof e?e:{name:e};a.startView({...r,handlingStack:t}),U({feature:"start-view"})})},stopSession:D(()=>{a.stopSession(),U({feature:"stop-session"})}),addFeatureFlagEvaluation:D((e,t)=>{a.addFeatureFlagEvaluation(B(e),B(t)),U({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:D(()=>e.getSessionReplayLink()),startSessionReplayRecording:D(t=>{e.start(t),U({feature:"start-session-replay-recording",force:t&&t.force})}),stopSessionReplayRecording:D(()=>e.stop()),addDurationVital:(e,t)=>{let r=Yo("vital");Vr(()=>{U({feature:"add-duration-vital"}),a.addDurationVital({id:R(),name:B(e),type:Ou.DURATION,startClocks:Qr(t.startTime),duration:t.duration,context:B(t&&t.context),description:B(t&&t.description),handlingStack:r})})},startDurationVital:(e,t)=>{let r=Yo("vital");return Vr(()=>(U({feature:"start-duration-vital"}),a.startDurationVital(B(e),{context:B(t&&t.context),description:B(t&&t.description),handlingStack:r})))},stopDurationVital:D((e,t)=>{U({feature:"stop-duration-vital"}),a.stopDurationVital("string"==typeof e?B(e):e,{context:B(t&&t.context),description:B(t&&t.description)})}),startFeatureOperation:(e,t)=>{let r=Yo("vital");Vr(()=>{U({feature:"add-operation-step-vital",action_type:"start"}),a.addOperationStepVital(e,"start",{...t,handlingStack:r})})},succeedFeatureOperation:D((e,t)=>{U({feature:"add-operation-step-vital",action_type:"succeed"}),a.addOperationStepVital(e,"end",t)}),failFeatureOperation:D((e,t,r)=>{U({feature:"add-operation-step-vital",action_type:"fail"}),a.addOperationStepVital(e,"end",r,t)})});return l}function P_(e,t){return{init:e=>{As("DD_RUM",e)},initConfiguration:e.initConfiguration,...t}}function F_(e,{session:t,viewContext:r,errorType:n}){let i=t?t.id:"no-session-id",o=[];return void 0!==n&&o.push(`error-type=${n}`),r&&(o.push(`seed=${r.id}`),o.push(`from=${r.startClocks.timeStamp}`)),`${I_(e)}/rum/replay/sessions/${i}?${o.join("&")}`}function I_(e){let t=e.site,r=e.subdomain||L_(e);return`https://${r?`${r}.`:""}${t}`}function L_(e){switch(e.site){case $a:case eo:return"app";case Qa:return"dd";default:return}}function R_(e,t,r,n){let i=pc([e.profilingEndpointBuilder],e=>{t.notify(14,{error:e}),Kc("Error reported to customer",{"error.message":e.message})}),o=r(n);return{async send({event:e,...t}){let r=new FormData,n=as(e);if(!n)throw Error("Failed to serialize event");r.append("event",new Blob([n],{type:"application/json"}),"event.json");let a=n.length;for(let[e,n]of Bi(t)){let t=as(n);if(!t)throw Error("Failed to serialize attachment");let i=await z_(o,t);a+=i.outputBytesCount,r.append(e,new Blob([i.output]),e)}i.send({data:r,bytesCount:a})}}}function z_(e,t){return new Promise(r=>{e.write(t),e.finish(e=>{r(e)})})}function V_(e){return K_(e).segments_count}function H_(e){K_(e).segments_count+=1}function U_(e){K_(e).records_count+=1}function W_(e,t){K_(e).segments_total_raw_size+=t}function G_(e){return B_?.get(e)}function K_(e){let t;return B_||=new Map,B_.has(e)?t=B_.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},B_.set(e,t),B_.size>1e3&&q_()),t}function q_(){if(!B_)return;let e=B_.keys().next().value;e&&B_.delete(e)}function J_(e,t,r){let n,i=0,o=[],a=!0,s=0,l=[],{stop:u}=V(e,t,"message",({data:e})=>
1{if("wrote"!==e.type||e.streamId!==r)return;let t=l[0];t&&(t.id===e.id?(l.shift(),i+=e.additionalBytesCount,o.push(e.result),n=e.trailer,t.writeCallback?t.writeCallback(e.result.byteLength):t.finishCallback&&t.finishCallback()):t.id<e.id&&u())});function c(){let e=0===o.length?new Uint8Array:is(o.concat(n)),t={rawBytesCount:i,output:e,outputBytesCount:e.byteLength,encoding:"deflate"};return i=0,o=[],t}function d(){a||=(t.postMessage({action:"reset",streamId:r}),!0)}return{isAsync:!0,get isEmpty(){return a},write(e,n){t.postMessage({action:"write",id:s,data:e,streamId:r}),l.push({id:s,writeCallback:n,data:e}),a=!1,s+=1},finish(e){d(),l.length?(l.forEach(e=>{delete e.writeCallback}),l[l.length-1].finishCallback=()=>e(c())):e(c())},finishSync(){d();let e=l.map(e=>e.data).join("");return l.length=0,{...c(),pendingData:e}},estimateEncodedBytesCount:e=>e.length/8,stop(){u()}}}function Y_({configuredUrl:e,error:t,source:r,scriptType:n}){if(T.error(`${r} failed to start: an error occurred while initializing the ${n}:`,t),t instanceof Event||t instanceof Error&&X_(t.message)){let t;t=e?`Please make sure the ${n} URL ${e} is correct and CSP is correctly configured.`:"Please make sure CSP is correctly configured.",T.error(`${t} See documentation at ${xr}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else"worker"===n&&qc(t)}function X_(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}var Z_=30*j;function Q_(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){if(1===t.length)return t[0];const e=t.reduce((t,e)=>t+e.length,0),a=new Uint8Array(e);let n=0;for(const e of t)a.set(e,n),n+=e.length;return a}function e(t){for(var e=t.length;--e>=0;)t[e]=0}var a=new Uint8Array([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]),n=new Uint8Array([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]),r=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),i=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=Array(576);e(s);var h=Array(60);e(h);var l=Array(512);e(l);var _=Array(256);e(_);var o=Array(29);e(o);var d,u,f,c=Array(30);function p(t,e,a,n,r){this.static_tree=t,this.extra_bits=e,this.extra_base=a,this.elems=n,this.max_length=r,this.has_stree=t&&t.length}function g(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(c);var v=function(t){return t<256?l[t]:l[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},m=function(t,e,a){t.bi_valid>16-a?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=a-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=a)},b=function(t,e,a){m(t,a[2*e],a[2*e+1])},y=function(t,e){var a=0;do{a|=1&t,t>>>=1,a<<=1}while(--e>0);return a>>>1},z=function(t,e,a){var n,r,i=Array(16),s=0;for(n=1;n<=15;n++)i[n]=s=s+a[n-1]<<1;for(r=0;r<=e;r++){var h=t[2*r+1];0!==h&&(t[2*r]=y(i[h]++,h))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0},x=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,a,n){var r=2*e,i=2*a;return t[r]<t[i]||t[r]===t[i]&&n[e]<=n[a]},U=function(t,e,a){for(var n=t.heap[a],r=a<<1;r<=t.heap_len&&(r<t.heap_len&&A(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!A(e,n,t.heap[r],t.depth));)t.heap[a]=t.heap[r],a=r,r<<=1;t.heap[a]=n},B=function(t,e,r){var i,s,h,l,d=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*d]<<8|t.pending_buf[t.d_buf+2*d+1],s=t.pending_buf[t.l_buf+d],d++,0===i?b(t,s,e):(h=_[s],b(t,h+256+1,e),0!==(l=a[h])&&(s-=o[h],m(t,s,l)),i--,h=v(i),b(t,h,r),0!==(l=n[h])&&(i-=c[h],m(t,i,l)))}while(d<t.last_lit);b(t,256,e)},I=function(t,e){var a,n,r,i=e.dyn_tree,s=e.stat_desc.static_tree,h=e.stat_desc.has_stree,l=e.stat_desc.elems,_=-1;for(t.heap_len=0,t.heap_max=573,a=0;a<l;a++)0!==i[2*a]?(t.heap[++t.heap_len]=_=a,t.depth[a]=0):i[2*a+1]=0;for(;t.heap_len<2;
vendor: 4,151 bytes, line 1
1)i[2*(r=t.heap[++t.heap_len]=_<2?++_:0)]=1,t.depth[r]=0,t.opt_len--,h&&(t.static_len-=s[2*r+1]);for(e.max_code=_,a=t.heap_len>>1;a>=1;a--)U(t,i,a);r=l;do{a=t.heap[1],t.heap[1]=t.heap[t.heap_len--],U(t,i,1),n=t.heap[1],t.heap[--t.heap_max]=a,t.heap[--t.heap_max]=n,i[2*r]=i[2*a]+i[2*n],t.depth[r]=(t.depth[a]>=t.depth[n]?t.depth[a]:t.depth[n])+1,i[2*a+1]=i[2*n+1]=r,t.heap[1]=r++,U(t,i,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var a,n,r,i,s,h,l=e.dyn_tree,_=e.max_code,o=e.stat_desc.static_tree,d=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,c=e.stat_desc.max_length,p=0;for(i=0;i<=15;i++)t.bl_count[i]=0;for(l[2*t.heap[t.heap_max]+1]=0,a=t.heap_max+1;a<573;a++)(i=l[2*l[2*(n=t.heap[a])+1]+1]+1)>c&&(i=c,p++),l[2*n+1]=i,n>_||(t.bl_count[i]++,s=0,n>=f&&(s=u[n-f]),h=l[2*n],t.opt_len+=h*(i+s),d&&(t.static_len+=h*(o[2*n+1]+s)));if(0!==p){do{for(i=c-1;0===t.bl_count[i];)i--;t.bl_count[i]--,t.bl_count[i+1]+=2,t.bl_count[c]--,p-=2}while(p>0);for(i=c;0!==i;i--)for(n=t.bl_count[i];0!==n;)(r=t.heap[--a])>_||(l[2*r+1]!==i&&(t.opt_len+=(i-l[2*r+1])*l[2*r],l[2*r+1]=i),n--)}}(t,e),z(i,_,t.bl_count)},E=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),e[2*(a+1)+1]=65535,n=0;n<=a;n++)r=s,s=e[2*(n+1)+1],++h<l&&r===s||(h<_?t.bl_tree[2*r]+=h:0!==r?(r!==i&&t.bl_tree[2*r]++,t.bl_tree[32]++):h<=10?t.bl_tree[34]++:t.bl_tree[36]++,h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4))},C=function(t,e,a){var n,r,i=-1,s=e[1],h=0,l=7,_=4;for(0===s&&(l=138,_=3),n=0;n<=a;n++)if(r=s,s=e[2*(n+1)+1],!(++h<l&&r===s)){if(h<_)do{b(t,r,t.bl_tree)}while(0!==--h);else 0!==r?(r!==i&&(b(t,r,t.bl_tree),h--),b(t,16,t.bl_tree),m(t,h-3,2)):h<=10?(b(t,17,t.bl_tree),m(t,h-3,3)):(b(t,18,t.bl_tree),m(t,h-11,7));h=0,i=r,0===s?(l=138,_=3):r===s?(l=6,_=3):(l=7,_=4)}},D=!1,M=function(t,e,a,n){m(t,0+(n?1:0),3),function(t,e,a){x(t),w(t,a),w(t,~a),t.pending_buf.set(t.window.subarray(e,e+a),t.pending),t.pending+=a}(t,e,a)},j=M,L=function(t,e,a,n){for(var r=65535&t,i=t>>>16&65535,s=0;0!==a;){a-=s=a>2e3?2e3:a;do{i=i+(r=r+e[n++]|0)|0}while(--s);r%=65521,i%=65521}return r|i<<16},S=new Uint32Array(function(){for(var t,e=[],a=0;a<256;a++){t=a;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[a]=t}return e}()),T=function(t,e,a,n){var r=S,i=n+a;t^=-1;for(var s=n;s<i;s++)t=t>>>8^r[255&(t^e[s])];return-1^t},O={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},q=j,F=function(t,e,a){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&a,t.last_lit++,0===e?t.dyn_ltree[2*a]++:(t.matches++,e--,t.dyn_ltree[2*(_[a]+256+1)]++,t.dyn_dtree[2*v(e)]++),t.last_lit===t.lit_bufsize-1},G=-2,H=258,J=262,K=103,N=113,P=666,Q=function(t,e){return t.msg=O[e],e},R=function(t){return(t<<1)-(t>4?9:0)},V=function(t){for(var e=t.length;--e>=0;)t[e]=0},W=function(t,e,a){return(e<<t.hash_shift^a)&t.hash_mask},X=function(t){var e=t.state,a=e.pending;a>t.avail_out&&(a=t.avail_out),0!==a&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+a),t.next_out),t.next_out+=a,e.pending_out+=a,t.total_out+=a,t.avail_out-=a,e.pending-=a,0===e.pending&&(e.pending_out=0))},Y=function(t,e){(function(t,e,a,n){var r,l,_=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,a=4093624447;for(e=0;e<=31;e++,a>>>=1)if(1&a&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),I(t,t.l_desc),I(t,t.d_desc),_=function(t){var e;for(E(t,t.dyn_ltree,t.l_desc.max_code),E(t,t.dyn_dtree,t.d_desc.max_code),I(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*i[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),r=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=r&&(r=l)):r=l=a+5,a+4<=r&&-1!==e?M(t,e,a,n):4===t.strategy||l===r?(m(t,2+(n?1:0),3),B(t,s,h)):(m(t,4+(n?1:0),3),function(t,e,a,n){var r;for(m(t,e-257,5),m(t,a-1,5),m(t,n-4,4),r=0;r<n;r++)m(t,t.bl_tree[2*i[r]+1],3);C(t,t.dyn_ltree,e-1),C(t,t.dyn_dtree,a-1)}
vendor: 14,434 bytes, line 1
1(t,t.l_desc.max_code+1,t.d_desc.max_code+1,_+1),B(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&x(t)})(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,X(t.strm)},Z=function(t,e){t.pending_buf[t.pending++]=e},$=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},tt=function(t,e,a,n){var r=t.avail_in;return r>n&&(r=n),0===r?0:(t.avail_in-=r,e.set(t.input.subarray(t.next_in,t.next_in+r),a),1===t.state.wrap?t.adler=L(t.adler,e,r,a):2===t.state.wrap&&(t.adler=T(t.adler,e,r,a)),t.next_in+=r,t.total_in+=r,r)},et=function(t,e){var a,n,r=t.max_chain_length,i=t.strstart,s=t.prev_length,h=t.nice_match,l=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,_=t.window,o=t.w_mask,d=t.prev,u=t.strstart+H,f=_[i+s-1],c=_[i+s];t.prev_length>=t.good_match&&(r>>=2),h>t.lookahead&&(h=t.lookahead);do{if(_[(a=e)+s]===c&&_[a+s-1]===f&&_[a]===_[i]&&_[++a]===_[i+1]){i+=2,a++;do{}while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<u);if(n=H-(u-i),i=u-H,n>s){if(t.match_start=e,s=n,n>=h)break;f=_[i+s-1],c=_[i+s]}}}while((e=d[e&o])>l&&0!==--r);return s<=t.lookahead?s:t.lookahead},at=function(t){var e,a,n,r,i,s=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=s+(s-J)){t.window.set(t.window.subarray(s,s+s),0),t.match_start-=s,t.strstart-=s,t.block_start-=s,e=a=t.hash_size;do{n=t.head[--e],t.head[e]=n>=s?n-s:0}while(--a);e=a=s;do{n=t.prev[--e],t.prev[e]=n>=s?n-s:0}while(--a);r+=s}if(0===t.strm.avail_in)break;if(a=tt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=a,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=W(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=W(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<J&&0!==t.strm.avail_in)},nt=function(t,e){for(var a,n;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==a&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a)),t.match_length>=3)if(n=F(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=W(t,t.ins_h,t.window[t.strstart+1]);else n=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2},rt=function(t,e){for(var a,n,r;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&0===e)return 1;if(0===t.lookahead)break}if(a=0,t.lookahead>=3&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==a&&t.prev_length<t.max_lazy_match&&t.strstart-a<=t.w_size-J&&(t.match_length=et(t,a),t.match_length<=5&&(1===t.strategy||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-3,n=F(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=W(t,t.ins_h,t.window[t.strstart+3-1]),a=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!==--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(Y(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=F(t,0,t.window[t.strstart-1]))&&Y(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=F(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2};function it(t,e,a,n,r){this.good_length=t,this.max_lazy=e,this.nice_length=a,this.max_chain=n,this.func=r}var st=[new it(0,0,0,0,function(t,e){var a=65535;for(a>t.pending_buf_size-5&&(a=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),0===t.lookahead&&0===e)return 1;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+a;if((0===t.strstart||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,Y(t,!1),0===t.strm.avail_out))return 1;if(t.strstart-t.block_start>=t.w_size-J&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):(t.strstart>t.block_start&&(Y(t,!1),t.strm.avail_out),1)}),new it(4,4,8,4,nt),new it(4,5,16,8,nt),new it(4,6,32,32,nt),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)];function ht(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),V(this.dyn_ltree),V(this.dyn_dtree),V(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),V(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),V(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}for(var lt=function(t){var e,i=function(t){if(!t||!t.state)return Q(t,G);t.total_in=t.total_out=0,t.data_type=2;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?42:N,t.adler=2===e.wrap?0:1,e.last_flush=0,function(t){D||(function(){var t,e,i,g,v,w=Array(16);for(i=0,g=0;g<28;g++)for(o[g]=i,t=0;t<1<<a[g];t++)_[i++]=g;for(_[i-1]=g,v=0,g=0;g<16;g++)for(c[g]=v,t=0;t<1<<n[g];t++)l[v++]=g;for(v>>=7;g<30;g++)for(c[g]=v<<7,t=0;t<1<<n[g]-7;t++)l[256+v++]=g;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(z(s,287,w),t=0;t<30;t++)h[2*t+1]=5,h[2*t]=y(t,5);d=new p(s,a,257,286,15),u=new p(h,n,0,30,15),f=new p([],r,0,19,7)}(),D=!0),t.l_desc=new g(t.dyn_ltree,d),t.d_desc=new g(t.dyn_dtree,u),t.bl_desc=new g(t.bl_tree,f),t.bi_buf=0,t.bi_valid=0,k(t)}(e),0}(t);return 0===i&&((e=t.state).window_size=2*e.w_size,V(e.head),e.max_lazy_match=st[e.level].max_lazy,e.good_match=st[e.level].good_length,e.nice_match=st[e.level].nice_length,e.max_chain_length=st[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),i},_t=function(t,e){var a,n;if(!t||!t.state||e>5||e<0)return t?Q(t,G):G;var r=t.state;if(!t.output||!t.input&&0!==t.avail_in||r.status===P&&4!==e)return Q(t,0===t.avail_out?-5:G);r.strm=t;var i=r.last_flush;if(r.last_flush=e,42===r.status)if(2===r.wrap)t.adler=0,Z(r,31),Z(r,139),Z(r,8),r.gzhead?(Z(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Z(r,255&r.gzhead.time),Z(r,r.gzhead.time>>8&255),Z(r,r.gzhead.time>>16&255),Z(r,r.gzhead.time>>24&255),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Z(r,255&r.gzhead.extra.length),Z(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=T(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,0),Z(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Z(r,3),r.status=N);else{var h=8+(r.w_bits-8<<4)<<8;h|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(h|=32),h+=31-h%31,r.status=N,$(r,h),0!==r.strstart&&($(r,t.adler>>>16),$(r,65535&t.adler)),t.adler=1}if(69===r.status)if(r.gzhead.extra){for(a=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending!==r.pending_buf_size));)Z(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){a=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),X(t),a=r.pending,r.pending===r.pending_buf_size)){n=1;break}n=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Z(r,n)}while(0!==n);r.gzhead.hcrc&&r.pending>a&&(t.adler=T(t.adler,r.pending_buf,r.pending-a,a)),0===n&&(r.status=K)}else r.status=K;if(r.status===K&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&X(t),r.pending+2<=r.pending_buf_size&&(Z(r,255&t.adler),Z(r,t.adler>>8&255),t.adler=0,r.status=N)):r.status=N),0!==r.pending){if(X(t),0===t.avail_out)return r.last_flush=-1,0}else if(0===t.avail_in&&R(e)<=R(i)&&4!==e)return Q(t,-5);if(r.status===P&&0!==t.avail_in)return Q(t,-5);if(0!==t.avail_in||0!==r.lookahead||0!==e&&r.status!==P){var l=2===r.strategy?function(t,e){for(var a;;){if(0===t.lookahead&&(at(t),0===t.lookahead)){if(0===e)return 1;break}if(t.match_length=0,a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):3===r.strategy?function(t,e){for(var a,n,r,i,s=t.window;;){if(t.lookahead<=H){if(at(t),t.lookahead<=H&&0===e)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(n=s[r=t.strstart-1])===s[++r]&&n===s[++r]&&n===s[++r]){i=t.strstart+H;do{}while(n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&n===s[++r]&&r<i);t.match_length=H-(i-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(a=F(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(a=F(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),a&&(Y(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,4===e?(Y(t,!0),0===t.strm.avail_out?3:4):t.last_lit&&(Y(t,!1),0===t.strm.avail_out)?1:2}(r,e):st[r.level].func(r,e);if(3!==l&&4!==l||(r.status=P),1===l||3===l)return 0===t.avail_out&&(r.last_flush=-1),0;if(2===l&&(1===e?function(t){m(t,2,3),b(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}(r):5!==e&&(q(r,0,0,!1),3===e&&(V(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),X(t),0===t.avail_out))return r.last_flush=-1,0}return 4!==e?0:r.wrap<=0?1:(2===r.wrap?(Z(r,255&t.adler),Z(r,t.adler>>8&255),Z(r,t.adler>>16&255),Z(r,t.adler>>24&255),Z(r,255&t.total_in),Z(r,t.total_in>>8&255),Z(r,t.total_in>>16&255),Z(r,t.total_in>>24&255)):($(r,t.adler>>>16),$(r,65535&t.adler)),X(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},ot=function(t){if(!t||!t.state)return G;var e=t.state.status;return 42!==e&&69!==e&&73!==e&&91!==e&&e!==K&&e!==N&&e!==P?Q(t,G):(t.state=null,e===N?Q(t,-3):0)},dt=new Uint8Array(256),ut=0;ut<256;ut++)dt[ut]=ut>=252?6:ut>=248?5:ut>=240?4:ut>=224?3:ut>=192?2:1;dt[254]=dt[254]=1;var ft=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},ct=Object.prototype.toString;function pt(){this.options={level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0};var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;var e,a,n=function(t,e,a,n,r,i){if(!t)return G;var s=1;if(-1===e&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),r<1||r>9||8!==a||n<8||n>15||e<0||e>9||i<0||i>4)return Q(t,G);8===n&&(n=9);var h=new ht;return t.state=h,h.strm=t,h.wrap=s,h.gzhead=null,h.w_bits=n,h.w_size=1<<h.w_bits,h.w_mask=h.w_size-1,h.hash_bits=r+7,h.hash_size=1<<h.hash_bits,h.hash_mask=h.hash_size-1,h.hash_shift=~~((h.hash_bits+3-1)/3),h.window=new Uint8Array(2*h.w_size),h.head=new Uint16Array(h.hash_size),h.prev=new Uint16Array(h.w_size),h.lit_bufsize=1<<r+6,h.pending_buf_size=4*h.lit_bufsize,h.pending_buf=new Uint8Array(h.pending_buf_size),h.d_buf=1*h.lit_bufsize,h.l_buf=3*h.lit_bufsize,h.level=e,h.strategy=i,h.method=a,lt(t)}(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw Error(O[n]);if(t.header&&(e=this.strm,a=t.header,e&&e.state&&(2!==e.state.wrap||(e.state.gzhead=a))),t.dictionary){var r;if(r="[object ArrayBuffer]"===ct.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=function(t,e){var a=e.length;if(!t||!t.state)return G;var n=t.state,r=n.wrap;if(2===r||1===r&&42!==n.status||n.lookahead)return G;if(1===r&&(t.adler=L(t.adler,e,a,0)),n.wrap=0,a>=n.w_size){0===r&&(V(n.head),n.strstart=0,n.block_start=0,n.insert=0);var i=new Uint8Array(n.w_size);
1i.set(e.subarray(a-n.w_size,a),0),e=i,a=n.w_size}var s=t.avail_in,h=t.next_in,l=t.input;for(t.avail_in=a,t.next_in=0,t.input=e,at(n);n.lookahead>=3;){var _=n.strstart,o=n.lookahead-2;do{n.ins_h=W(n,n.ins_h,n.window[_+3-1]),n.prev[_&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=_,_++}while(--o);n.strstart=_,n.lookahead=2,at(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,t.next_in=h,t.input=l,t.avail_in=s,n.wrap=r,0}(this.strm,r)))throw Error(O[n]);this._dict_set=!0}}function gt(t,e,a){try{t.postMessage({type:"errored",error:e,streamId:a})}catch(n){t.postMessage({type:"errored",error:e+"",streamId:a})}}function vt(t){const e=t.strm.adler;return new Uint8Array([3,0,e>>>24&255,e>>>16&255,e>>>8&255,255&e])}pt.prototype.push=function(t,e){var a,n,r=this.strm,i=this.options.chunkSize;if(this.ended)return!1;for(n=e===~~e?e:!0===e?4:0,"[object ArrayBuffer]"===ct.call(t)?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(i),r.next_out=0,r.avail_out=i),(2===n||3===n)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(1===(a=_t(r,n)))return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),a=ot(this.strm),this.onEnd(a),this.ended=!0,0===a;if(0!==r.avail_out){if(n>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},pt.prototype.onData=function(t){this.chunks.push(t)},pt.prototype.onEnd=function(t){0===t&&(this.result=function(t){for(var e=0,a=0,n=t.length;a<n;a++)e+=t[a].length;for(var r=new Uint8Array(e),i=0,s=0,h=t.length;i<h;i++){var l=t[i];r.set(l,s),s+=l.length}return r}(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},function(e=self){try{const a=new Map;e.addEventListener("message",n=>{try{const r=function(e,a){switch(a.action){case"init":return{type:"initialized",version:"6.33.0"};case"write":{let n=e.get(a.streamId);n||(n=new pt,e.set(a.streamId,n));const r=n.chunks.length,i=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,a,n,r,i,s=t.length,h=0;for(r=0;r<s;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),h+=a<128?1:a<2048?2:a<65536?3:4;for(e=new Uint8Array(h),i=0,r=0;i<h;r++)a=t.charCodeAt(r),55296==(64512&a)&&r+1<s&&(n=t.charCodeAt(r+1),56320==(64512&n)&&(a=65536+(a-55296<<10)+(n-56320),r++)),a<128?e[i++]=a:a<2048?(e[i++]=192|a>>>6,e[i++]=128|63&a):a<65536?(e[i++]=224|a>>>12,e[i++]=128|a>>>6&63,e[i++]=128|63&a):(e[i++]=240|a>>>18,e[i++]=128|a>>>12&63,e[i++]=128|a>>>6&63,e[i++]=128|63&a);return e}(a.data);return n.push(i,2),{type:"wrote",id:a.id,streamId:a.streamId,result:t(n.chunks.slice(r)),trailer:vt(n),additionalBytesCount:i.length}}case"reset":e.delete(a.streamId)}}(a,n.data);r&&e.postMessage(r)}catch(t){gt(e,t,n.data&&"streamId"in n.data?n.data.streamId:void 0)}})}catch(t){gt(e,t)}}()})();'])))}var Z={status:0};function $_(e,t,r){switch(0===Z.status&&tv(e,t),Z.status){case 1:return Z.initializationFailureCallbacks.push(r),Z.worker;case 3:return Z.worker}}function ev(){return Z.status}function tv(e,t){try{let r=z(Q_)(e),{stop:n}=V(e,r,"error",r=>{iv(e,t,r)}),{stop:i}=V(e,r,"message",({data:r})=>{"errored"===r.type?iv(e,t,r.error,r.streamId):"initialized"===r.type&&rv(r.version)});r.postMessage({action:"init"}),O(()=>nv(t),Z_),Z={status:1,worker:r,stop:()=>{n(),i()},initializationFailureCallbacks:[]}}catch(r){iv(e,t,r)}}function nv(e){1===Z.status&&(T.error(`${e} failed to start: a timeout occurred while initializing the Worker`),Z.initializationFailureCallbacks.forEach(e=>e()),Z={status:2})}function rv(e){1===Z.status&&(Z={status:3,worker:Z.worker,stop:Z.stop,version:e})}function iv(e,t,r,n){1===Z.status||0===Z.status?(Y_({configuredUrl:e.workerUrl,error:r,source:t,scriptType:"worker"}),1===Z.status&&Z.initializationFailureCallbacks.forEach(e=>e()),Z={status:2}):qc(r,{worker_version:3===Z.status&&Z.version,stream_id:n})}function av(){return"function"==typeof Array.from&&"function"==typeof CSSSupportsRule&&"function"==typeof URL.createObjectURL&&"forEach"in NodeList.prototype}function ov(e,t,r,n){let i=t.findTrackedSession(),o=sv(i,n);return F_(e,{viewContext:r.findView(),errorType:o,session:i})}function sv(e,t){return av()?e?0===e.sessionReplay?"incorrect-session-plan":t?void 0:"replay-not-started":"rum-not-tracked":"browser-not-supported"}function cv(e,t){if(!e.metricsEnabled)return{stop:L};let r,n,i,{unsubscribe:o}=t.subscribe(e=>{switch(e.type){case"start":r={forced:e.forced,timestamp:P()},n=void 0,i=void 0;break;case"document-ready":r&&(n=I(r.timestamp,P()));break;
1case"recorder-settled":r&&(i=I(r.timestamp,P()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":o(),r&&Yc("Recorder init metrics",{metrics:lv(r.forced,i,I(r.timestamp,P()),e.type,n)})}});return{stop:o}}function lv(e,t,r,n,i){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:r,result:n,waitForDocReadyDuration:i}}async function uv(){try{return await z(dv)()}catch(e){Y_({error:e,source:"Recorder",scriptType:"module"})}}async function dv(){return(await a(()=>import("./startRecording.BXmUHzJ7.js"),[])).startRecording}function fv(e,t,r,n,i,o){let a,s=0;t.subscribe(9,()=>{(2===s||3===s)&&(d(),s=1)}),t.subscribe(10,()=>{1===s&&c()});let l=new A;cv(o,l);let u=async u=>{l.notify({type:"start",forced:u});let[c]=await Promise.all([gv(l,{type:"recorder-settled"},uv()),gv(l,{type:"document-ready"},kl(e,"interactive"))]);if(2!==s)return void l.notify({type:"aborted"});if(!c)return s=0,void l.notify({type:"recorder-load-failed"});let d=i();if(!d)return s=0,void l.notify({type:"deflate-encoder-load-failed"});({stop:a}=c(t,e,r,n,d,o)),s=3,l.notify({type:"succeeded"})};function c(e){let t=r.findTrackedSession();if(pv(t,e))return void(s=1);if(mv(s))return;s=2;let n=hv(t,e)||!1;u(n).catch(Hr),n&&r.setForcedReplay()}function d(){3===s&&a?.(),s=0}return{start:c,stop:d,getSessionReplayLink:()=>ov(e,r,n,0!==s),isRecording:()=>3===s}}function pv(e,t){return!e||0===e.sessionReplay&&(!t||!t.force)}function mv(e){return 2===e||3===e}function hv(e,t){return t&&t.force&&0===e.sessionReplay}async function gv(e,t,r){try{return await r}finally{e.notify(t)}}function _v(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:L},shouldStartImmediately:t=>1===e||0===e&&!t.startSessionReplayRecordingManually}}function vv(){if(bc()&&!yc("records")||!av())return{start:L,stop:L,getReplayStats:()=>{},onRumStart:L,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:e,shouldStartImmediately:t}=_v();return{start:t=>e.start(t),stop:()=>e.stop(),getSessionReplayLink:()=>e.getSessionReplayLink(),onRumStart:function(r,n,i,o,a,s){let l;e=fv(n,r,i,o,function(){return l||(a??=$_(n,"Datadog Session Replay",()=>e.stop()),a&&(l=J_(n,a,1))),l},s),t(n)&&e.start()},isRecording:()=>3===ev()&&e.isRecording(),getReplayStats:e=>3===ev()?G_(e):void 0}}function yv(){return void 0!==E().Profiler}function bv(e){let t={status:"starting"};return e.register(0,({eventType:e})=>e!==J.VIEW&&e!==J.LONG_TASK&&e!==J.ACTION&&e!==J.VITAL?H:{type:e,_dd:{profiling:t}}),{get:()=>t,set:e=>{t=e}}}async function xv(){try{return await z(Sv)()}catch(e){Y_({error:e,source:"Profiler",scriptType:"module"})}}async function Sv(){return(await a(()=>import("./profiler.CACwe1W5.js"),[])).createRumProfiler}function Cv(){let e;return{onRumStart:function(t,r,n,i,o,a){let s=i.findTrackedSession();if(!s||!Yd(s.id,n.profilingSampleRate))return;let l=bv(r);yv()?xv().then(r=>{r?(e=r(n,t,i,l,a,o,void 0),e.start()):l.set({status:"error",error_reason:"failed-to-lazy-load"})}).catch(Hr):l.set({status:"error",error_reason:"not-supported-by-browser"})},stop:()=>{e?.stop()}}}var wv=e({datadogRum:()=>Tv}),Tv=N_(vv(),Cv(),{startDeflateWorker:$_,createDeflateEncoder:J_,sdkName:"rum"});ks(E(),"DD_RUM",Tv);var Ev=e({datadogAddFeatureFlag:()=>Av,datadogCaptureError:()=>Ov,datadogTrackAction:()=>kv,identifyDatadogUser:()=>jv,reportAnalyticsFailure:()=>Dv});function Dv(e,t={},r){console.error(`[analytics] ${e}`,t),Ov(r??Error(e),{name:"analytics-failure",context:{message:e,...t}})}function Ov(e,t){"function"==typeof Tv?.addError&&Tv.addError(e instanceof Error?e:Error(String(e)),{...t?.name?{errorName:t.name}:{},...t?.context})}function kv(e,t){e&&"function"==typeof Tv?.addAction&&Tv.addAction(e,t)}function Av(e,t){"function"==typeof Tv?.addFeatureFlagEvaluation&&Tv.addFeatureFlagEvaluation(e,t)}function jv(e){Object.entries(e).forEach(([e,t])=>{t&&"function"==typeof Tv?.setUserProperty&&Tv.setUserProperty(e,t)})}var Mv=new TextEncoder,Nv=new TextDecoder;function Pv(...e){let t=e.reduce((e,{length:t})=>e+t,0),r=new Uint8Array(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return r}function Fv(e){let t=new Uint8Array(e.length);for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n>127)throw TypeError("non-ASCII string encountered in encode()");t[r]=n}return t}function Iv(e){if(Uint8Array.prototype.toBase64)return e.toBase64();let t=[];for(let r=0;r<e.length;r+=32768)t.push(String.fromCharCode.apply(null,e.subarray(r,r+32768)));return btoa(t.join(""))}function Lv(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64(e);let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}function Rv(e){if(Uint8Array.fromBase64)return Uint8Array.fromBase64("string"==typeof e?e:Nv.decode(e),{alphabet:"base64url"});let t=e;t instanceof Uint8Array&&(t=Nv.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/");try{return Lv(t)}catch{throw TypeError("The input to be decoded is not correctly encoded.")}}function zv(e){let t=e;return"string"==typeof t&&(t=Mv.encode(t)),Uint8Array.prototype.toBase64?t.toBase64({alphabet:"base64url",omitPadding:!0}):Iv(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var Bv=(e,t="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`),Vv=(e,t)=>e.name===t;function Hv(e){return parseInt(e.name.slice(4),10)}function Uv(e,t){if(Hv(e.hash)!==t)throw Bv(`SHA-${t}`,"algorithm.hash")}function Wv(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw Error("unreachable")}}function Gv(e,t){if(t&&!e.usages.includes(t))throw TypeError(`CryptoKey does not support this operation, its usages must include ${t}.`)}
1function Kv(e,t,r){switch(t){case"HS256":case"HS384":case"HS512":if(!Vv(e.algorithm,"HMAC"))throw Bv("HMAC");Uv(e.algorithm,parseInt(t.slice(2),10));break;case"RS256":case"RS384":case"RS512":if(!Vv(e.algorithm,"RSASSA-PKCS1-v1_5"))throw Bv("RSASSA-PKCS1-v1_5");Uv(e.algorithm,parseInt(t.slice(2),10));break;case"PS256":case"PS384":case"PS512":if(!Vv(e.algorithm,"RSA-PSS"))throw Bv("RSA-PSS");Uv(e.algorithm,parseInt(t.slice(2),10));break;case"Ed25519":case"EdDSA":if(!Vv(e.algorithm,"Ed25519"))throw Bv("Ed25519");break;case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":if(!Vv(e.algorithm,t))throw Bv(t);break;case"ES256":case"ES384":case"ES512":{if(!Vv(e.algorithm,"ECDSA"))throw Bv("ECDSA");let r=Wv(t);if(e.algorithm.namedCurve!==r)throw Bv(r,"algorithm.namedCurve");break}default:throw TypeError("CryptoKey does not support this operation")}Gv(e,r)}function qv(e,t,...r){if((r=r.filter(Boolean)).length>2){let t=r.pop();e+=`one of type ${r.join(", ")}, or ${t}.`}else 2===r.length?e+=`one of type ${r[0]} or ${r[1]}.`:e+=`of type ${r[0]}.`;return null==t?e+=` Received ${t}`:"function"==typeof t&&t.name?e+=` Received function ${t.name}`:"object"==typeof t&&t&&t.constructor?.name&&(e+=` Received an instance of ${t.constructor.name}`),e}var Jv=(e,...t)=>qv("Key must be ",e,...t),Yv=(e,t,...r)=>qv(`Key for the ${e} algorithm must be `,t,...r),Xv=class extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(e,t){super(e,t),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}},Zv=class extends Xv{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"},Qv=class extends Xv{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"},$v=class extends Xv{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"},ey=e=>{if("CryptoKey"===e?.[Symbol.toStringTag])return!0;try{return e instanceof CryptoKey}catch{return!1}},ty=e=>"KeyObject"===e?.[Symbol.toStringTag],ny=e=>ey(e)||ty(e);function ry(e,t){if(e)throw TypeError(`${t} can only be called once`)}var iy=e=>"object"==typeof e&&!!e;function ay(e){if(!iy(e)||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function oy(...e){let t,r=e.filter(Boolean);if(0===r.length||1===r.length)return!0;for(let e of r){let r=Object.keys(e);if(t&&0!==t.size)for(let e of r){if(t.has(e))return!1;t.add(e)}else t=new Set(r)}return!0}var sy=e=>ay(e)&&"string"==typeof e.kty,cy=e=>"oct"!==e.kty&&("AKP"===e.kty&&"string"==typeof e.priv||"string"==typeof e.d),ly=e=>"oct"!==e.kty&&void 0===e.d&&void 0===e.priv,uy=e=>"oct"===e.kty&&"string"==typeof e.k;function dy(e,t){if(e.startsWith("RS")||e.startsWith("PS")){let{modulusLength:r}=t.algorithm;if("number"!=typeof r||r<2048)throw TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}}function fy(e,t){let r=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:r,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:r,name:"RSA-PSS",saltLength:parseInt(e.slice(-3),10)>>3};case"RS256":case"RS384":case"RS512":return{hash:r,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:r,name:"ECDSA",namedCurve:t.namedCurve};
1case"Ed25519":case"EdDSA":return{name:"Ed25519"};case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":return{name:e};default:throw new Zv(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}async function py(e,t,r){if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw TypeError(Jv(t,"CryptoKey","KeyObject","JSON Web Key"));return crypto.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[r])}return Kv(t,e,r),t}async function my(e,t,r){let n=await py(e,t,"sign");dy(e,n);let i=await crypto.subtle.sign(fy(e,n.algorithm),n,r);return new Uint8Array(i)}var hy='Invalid or unsupported JWK "alg" (Algorithm) Parameter value';function gy(e){let t,r;switch(e.kty){case"AKP":switch(e.alg){case"ML-DSA-44":case"ML-DSA-65":case"ML-DSA-87":t={name:e.alg},r=e.priv?["sign"]:["verify"];break;default:throw new Zv(hy)}break;case"RSA":switch(e.alg){case"PS256":case"PS384":case"PS512":t={name:"RSA-PSS",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RS256":case"RS384":case"RS512":t={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${e.alg.slice(-3)}`},r=e.d?["sign"]:["verify"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":t={name:"RSA-OAEP",hash:`SHA-${parseInt(e.alg.slice(-3),10)||1}`},r=e.d?["decrypt","unwrapKey"]:["encrypt","wrapKey"];break;default:throw new Zv(hy)}break;case"EC":switch(e.alg){case"ES256":case"ES384":case"ES512":t={name:"ECDSA",namedCurve:{ES256:"P-256",ES384:"P-384",ES512:"P-521"}[e.alg]},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:"ECDH",namedCurve:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Zv(hy)}break;
1case"OKP":switch(e.alg){case"Ed25519":case"EdDSA":t={name:"Ed25519"},r=e.d?["sign"]:["verify"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":t={name:e.crv},r=e.d?["deriveBits"]:[];break;default:throw new Zv(hy)}break;default:throw new Zv('Invalid or unsupported JWK "kty" (Key Type) Parameter value')}return{algorithm:t,keyUsages:r}}async function _y(e){if(!e.alg)throw TypeError('"alg" argument is required when "jwk.alg" is not present');let{algorithm:t,keyUsages:r}=gy(e),n={...e};return"AKP"!==n.kty&&delete n.alg,delete n.use,crypto.subtle.importKey("jwk",n,t,e.ext??!(e.d||e.priv),e.key_ops??r)}var yy,vy="given KeyObject instance cannot be used for this algorithm",by=async(e,t,r,n=!1)=>{yy||=new WeakMap;let i=yy.get(e);if(i?.[r])return i[r];let o=await _y({...t,alg:r});return n&&Object.freeze(e),i?i[r]=o:yy.set(e,{[r]:o}),o},xy=(e,t)=>{yy||=new WeakMap;let r=yy.get(e);if(r?.[t])return r[t];let n,i="public"===e.type,o=!!i;if("x25519"===e.asymmetricKeyType){switch(t){case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":break;default:throw TypeError(vy)}n=e.toCryptoKey(e.asymmetricKeyType,o,i?[]:["deriveBits"])}if("ed25519"===e.asymmetricKeyType){if("EdDSA"!==t&&"Ed25519"!==t)throw TypeError(vy);n=e.toCryptoKey(e.asymmetricKeyType,o,[i?"verify":"sign"])}switch(e.asymmetricKeyType){case"ml-dsa-44":case"ml-dsa-65":case"ml-dsa-87":if(t!==e.asymmetricKeyType.toUpperCase())throw TypeError(vy);n=e.toCryptoKey(e.asymmetricKeyType,o,[i?"verify":"sign"])}if("rsa"===e.asymmetricKeyType){let r;switch(t){case"RSA-OAEP":r="SHA-1";break;case"RS256":case"PS256":case"RSA-OAEP-256":r="SHA-256";break;case"RS384":case"PS384":case"RSA-OAEP-384":r="SHA-384";break;case"RS512":case"PS512":case"RSA-OAEP-512":r="SHA-512";break;default:throw TypeError(vy)}if(t.startsWith("RSA-OAEP"))return e.toCryptoKey({name:"RSA-OAEP",hash:r},o,i?["encrypt"]:["decrypt"]);n=e.toCryptoKey({name:t.startsWith("PS")?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:r},o,[i?"verify":"sign"])}if("ec"===e.asymmetricKeyType){let r=new Map([["prime256v1","P-256"],["secp384r1","P-384"],["secp521r1","P-521"]]).get(e.asymmetricKeyDetails?.namedCurve);if(!r)throw TypeError(vy);let a={ES256:"P-256",ES384:"P-384",ES512:"P-521"};a[t]&&r===a[t]&&(n=e.toCryptoKey({name:"ECDSA",namedCurve:r},o,[i?"verify":"sign"])),t.startsWith("ECDH-ES")&&(n=e.toCryptoKey({name:"ECDH",namedCurve:r},o,i?[]:["deriveBits"]))}if(!n)throw TypeError(vy);return r?r[t]=n:yy.set(e,{[t]:n}),n};async function Sy(e,t){if(e instanceof Uint8Array||ey(e))return e;if(ty(e)){if("secret"===e.type)return e.export();if("toCryptoKey"in e&&"function"==typeof e.toCryptoKey)try{return xy(e,t)}catch(e){if(e instanceof TypeError)throw e}return by(e,e.export({format:"jwk"}),t)}if(sy(e))return e.k?Rv(e.k):by(e,e,t,!0);throw Error("unreachable")}function Cy(e,t,r,n,i){if(void 0!==i.crit&&void 0===n?.crit)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!n||void 0===n.crit)return new Set;if(!Array.isArray(n.crit)||0===n.crit.length||n.crit.some(e=>"string"!=typeof e||0===e.length))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;o=void 0===r?t:new Map([...Object.entries(r),...t.entries()]);for(let t of n.crit){if(!o.has(t))throw new Zv(`Extension Header Parameter "${t}" is not recognized`);if(void 0===i[t])throw new e(`Extension Header Parameter "${t}" is missing`);if(o.get(t)&&void 0===n[t])throw new e(`Extension Header Parameter "${t}" MUST be integrity protected`)}return new Set(n.crit)}var wy=e=>e?.[Symbol.toStringTag],Ty=(e,t,r)=>{if(void 0!==t.use){let e;switch(r){case"sign":case"verify":e="sig";break;case"encrypt":case"decrypt":e="enc"}if(t.use!==e)throw TypeError(`Invalid key for this operation, its "use" must be "${e}" when present`)}if(void 0!==t.alg&&t.alg!==e)throw TypeError(`Invalid key for this operation, its "alg" must be "${e}" when present`);if(Array.isArray(t.key_ops)){let n;switch(!0){case"sign"===r||"verify"===r:case"dir"===e:case e.includes("CBC-HS"):n=r;break;case e.startsWith("PBES2"):n="deriveBits";break;case/^A\d{3}(?:GCM)?(?:KW)?$/.test(e):n=!e.includes("GCM")&&e.endsWith("KW")?"encrypt"===r?"wrapKey":"unwrapKey":r;break;case"encrypt"===r&&e.startsWith("RSA"):n="wrapKey";break;case"decrypt"===r:n=e.startsWith("RSA")?"unwrapKey":"deriveBits"}if(n&&!1===t.key_ops?.includes?.(n))throw TypeError(`Invalid key for this operation, its "key_ops" must include "${n}" when present`)}return!0},Ey=(e,t,r)=>{if(!(t instanceof Uint8Array)){if(sy(t)){if(uy(t)&&Ty(e,t,r))return;throw TypeError('JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present')}if(!ny(t))throw TypeError(Yv(e,t,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"));if("secret"!==t.type)throw TypeError(`${wy(t)} instances for symmetric algorithms must be of type "secret"`)}},Dy=(e,t,r)=>{if(sy(t))switch(r){case"decrypt":case"sign":if(cy(t)&&Ty(e,t,r))return;throw TypeError("JSON Web Key for this operation must be a private JWK");case"encrypt":case"verify":if(ly(t)&&Ty(e,t,r))return;throw TypeError("JSON Web Key for this operation must be a public JWK")}if(!ny(t))throw TypeError(Yv(e,t,"CryptoKey","KeyObject","JSON Web Key"));if("secret"===t.type)throw TypeError(`${wy(t)} instances for asymmetric algorithms must not be of type "secret"`);if("public"===t.type)switch(r){case"sign":throw TypeError(`${wy(t)} instances for asymmetric algorithm signing must be of type "private"`);case"decrypt":throw TypeError(`${wy(t)} instances for asymmetric algorithm decryption must be of type "private"`)}if("private"===t.type)switch(r){case"verify":throw TypeError(`${wy(t)} instances for asymmetric algorithm verifying must be of type "public"`);case"encrypt":throw TypeError(`${wy(t)} instances for asymmetric algorithm encryption must be of type "public"`)}};function Oy(e,t,r){switch(e.substring(0,2)){case"A1":case"A2":case"di":case"HS":case"PB":Ey(e,t,r);break;default:Dy(e,t,r)}}var ky=e=>Math.floor(e.getTime()/1e3),Ay=60,jy=60*Ay,My=24*jy,Ny=7*My,Py=365.25*My,Fy=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i;function Iy(e){let t=Fy.exec(e);if(!t||t[4]&&t[1])throw TypeError("Invalid time period format");let r,n=parseFloat(t[2]);switch(t[3].toLowerCase()){case"sec":case"secs":case"second":case"seconds":case"s":r=Math.round(n);break;case"minute":case"minutes":case"min":case"mins":case"m":r=Math.round(n*Ay);break;case"hour":case"hours":case"hr":case"hrs":case"h":r=Math.round(n*jy);break;case"day":case"days":case"d":r=Math.round(n*My);break;case"week":case"weeks":case"w":r=Math.round(n*Ny);break;default:r=Math.round(n*Py)}return"-"===t[1]||"ago"===t[4]?-r:r}function Ly(e,t){if(!Number.isFinite(t))throw TypeError(`Invalid ${e} input`);return t}var Ry=class{#e;constructor(e){if(!ay(e))throw TypeError("JWT Claims Set MUST be an object");this.#e=structuredClone(e)}data(){return Mv.encode(JSON.stringify(this.#e))}get iss(){return this.#e.iss}set iss(e){this.#e.iss=e}get sub(){return this.#e.sub}set sub(e){this.#e.sub=e}get aud(){return this.#e.aud}set aud(e){this.#e.aud=e}set jti(e){this.#e.jti=e}set nbf(e){"number"==typeof e?this.#e.nbf=Ly("setNotBefore",e):e instanceof Date?this.#e.nbf=Ly("setNotBefore",ky(e)):this.#e.nbf=ky(new Date)+Iy(e)}set exp(e){"number"==typeof e?this.#e.exp=Ly("setExpirationTime",e):e instanceof Date?this.#e.exp=Ly("setExpirationTime",ky(e)):this.#e.exp=ky(new Date)+Iy(e)}set iat(e){void 0===e?this.#e.iat=ky(new Date):e instanceof Date?this.#e.iat=Ly("setIssuedAt",ky(e)):this.#e.iat=Ly("setIssuedAt","string"==typeof e?ky(new Date)+Iy(e):e)}},zy=class{#e;#t;#r;constructor(e){if(!(e instanceof Uint8Array))throw TypeError("payload must be an instance of Uint8Array");this.#e=e}setProtectedHeader(e){return ry(this.#t,"setProtectedHeader"),this.#t=e,this}setUnprotectedHeader(e){return ry(this.#r,"setUnprotectedHeader"),this.#r=e,this}async sign(e,t){if(!this.#t&&!this.#r)throw new Qv("either setProtectedHeader or setUnprotectedHeader must be called before #sign()");if(!oy(this.#t,this.#r))throw new Qv("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");let r={...this.#t,...this.#r},n=!0;if(Cy(Qv,new Map([["b64",!0]]),t?.crit,this.#t,r).has("b64")&&(n=this.#t.b64,"boolean"!=typeof n))throw new Qv('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let i,o,a,s,{alg:l}=r;if("string"!=typeof l||!l)throw new Qv('JWS "alg" (Algorithm) Header Parameter missing or invalid');Oy(l,e,"sign"),n?(i=zv(this.#e),o=Fv(i)):(o=this.#e,i=""),this.#t?(a=zv(JSON.stringify(this.#t)),s=Fv(a)):(a="",s=new Uint8Array);let u=Pv(s,Fv("."),o),c={signature:zv(await my(l,await Sy(e,l),u)),payload:i};return this.#r&&(c.header=this.#r),this.#t&&(c.protected=a),c}},By=class{#e;constructor(e){this.#e=new zy(e)}setProtectedHeader(e){return this.#e.setProtectedHeader(e),this}async sign(e,t){let r=await this.#e.sign(e,t);if(void 0===r.payload)throw TypeError("use the flattened module for creating JWS with b64: false");return`${r.protected}.${r.payload}.${r.signature}`}},Vy=class{#e;#t;constructor(e={}){this.#t=new Ry(e)}setIssuer(e){return this.#t.iss=e,this}setSubject(e){return this.#t.sub=e,this}setAudience(e){return this.#t.aud=e,this}setJti(e){return this.#t.jti=e,this}setNotBefore(e){return this.#t.nbf=e,this}setExpirationTime(e){return this.#t.exp=e,this}
1setIssuedAt(e){return this.#t.iat=e,this}setProtectedHeader(e){return this.#e=e,this}async sign(e,t){let r=new By(this.#t.data());if(r.setProtectedHeader(this.#e),Array.isArray(this.#e?.crit)&&this.#e.crit.includes("b64")&&!1===this.#e.b64)throw new $v("JWTs MUST NOT use unencoded payload");return r.sign(e,t)}},Hy={accessToken:null,email:null};function Uy(){return!0}async function Wy(e){if(Hy.email!==e&&(Hy.accessToken=null,Hy.email=e),!Hy.accessToken){let t=(new TextEncoder).encode("eb70e36062d11656326a00d9180054122deb2f507207274ac9fb9a238dba945187b297f85f32f63c276d3094a44c334c7012836ca8c65a84acda0c25c36e34b2");Hy.accessToken=await new Vy({email:e}).setProtectedHeader({alg:"HS256"}).setIssuedAt().setExpirationTime("1h").sign(t)}return Hy.accessToken}async function Gy(e,t,r,n=!1){let i=await Wy(r),o=await fetch(`https://api.iterable.com/api${e}`,{method:"POST",headers:{"Content-Type":"application/json","api-key":"ed26eb4dca584c7fb8f9b37b33c09d36",Authorization:`Bearer ${i}`},body:JSON.stringify(t)});if(401===o.status&&!n)return Hy.accessToken=null,Gy(e,t,r,!0);if(!o.ok){let t="";try{t=await o.text()}catch{}Ov(Error(`Iterable ${e} failed: ${o.status} ${t}`),{name:"Iterable_request_error",context:{path:e,status:o.status,detail:t}})}}function Ky(e){Uy()&&Gy("/events/track",{...e},e.email).catch(t=>{Ov(t,{name:"Iterable_track_event_Error",context:{email:e.email,eventName:e.eventName}})})}function qy(e){Uy()&&Gy("/users/update",{...e},e.email).catch(t=>{Ov(t,{name:"Iterable_user_update_Error",context:{email:e.email}})})}var Q=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Log=e.LogLevel=void 0;function t(e){return e.unshift("[Statsig]"),e}e.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};var r=class r{static info(...n){r.level>=e.LogLevel.Info&&console.info("  INFO ",...t(n))}static debug(...n){r.level>=e.LogLevel.Debug&&console.debug(" DEBUG ",...t(n))}static warn(...n){r.level>=e.LogLevel.Warn&&console.warn("  WARN ",...t(n))}static error(...n){r.level>=e.LogLevel.Error&&console.error(" ERROR ",...t(n))}};e.Log=r,r.level=e.LogLevel.Warn}),Jy=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._getInstance=e._getStatsigGlobalFlag=e._getStatsigGlobal=void 0;var t=Q();e._getStatsigGlobal=()=>{try{return typeof __STATSIG__<"u"?__STATSIG__:a}catch{return a}},e._getStatsigGlobalFlag=t=>(0,e._getStatsigGlobal)()[t],e._getInstance=r=>{let n=(0,e._getStatsigGlobal)();return r?n.instances&&n.instances[r]:(n.instances&&Object.keys(n.instances).length>1&&t.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),n.firstInstance)};var r="__STATSIG__",n=typeof window<"u"?window:{},i=typeof global<"u"?global:{},o=typeof globalThis<"u"?globalThis:{},a=n[r]??i[r]??o[r]??{instance:e._getInstance};n[r]=a,i[r]=a,o[r]=a}),Yy=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Diagnostics=void 0;var t=new Map,r="start",n="end";function i(e,t,r,n){return Object.assign({key:r,action:t,step:n,timestamp:Date.now()},e)}function o(e,t){return{eventName:"statsig::diagnostics",user:e,value:null,metadata:t,time:Date.now()}}function a(e,r){let n=t.get(e)??[];n.push(r),t.set(e,n)}function s(e,t){if(t in e)return e[t]}e.Diagnostics={_getMarkers:e=>t.get(e),_markInitOverallStart:e=>{a(e,i({},r,"overall"))},_markInitOverallEnd:(e,t,r)=>{a(e,i({success:t,error:t?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:r},n,"overall"))},_markInitNetworkReqStart:(e,t)=>{a(e,i(t,r,"initialize","network_request"))},_markInitNetworkReqEnd:(e,t)=>{a(e,i(t,n,"initialize","network_request"))},_markInitProcessStart:e=>{a(e,i({},r,"initialize","process"))},_markInitProcessEnd:(e,t)=>{a(e,i(t,n,"initialize","process"))},_clearMarkers:e=>{t.delete(e)},_formatError(e){if(e&&"object"==typeof e)return{code:s(e,"code"),name:s(e,"name"),message:s(e,"message")}},_getDiagnosticsData:(t,r,n,i)=>({success:!0===t?.ok,statusCode:t?.status,sdkRegion:(t?.headers)?.get("x-statsig-region"),isDelta:!0===n.includes('"is_delta":true')||void 0,attempt:r,error:e.Diagnostics._formatError(i)}),_enqueueDiagnosticsEvent(t,r,n,i){let a=e.Diagnostics._getMarkers(n);if(null==a||a.length<=0)return-1;let s=a[a.length-1].timestamp-a[0].timestamp;e.Diagnostics._clearMarkers(n);let l=o(t,{context:"initialize",markers:a.slice(),statsigOptions:i});return r.enqueue(l),s}}}),Xy=t(e=>
1{Object.defineProperty(e,"__esModule",{value:!0}),e.EventBatch=void 0,e.EventBatch=class{constructor(e){this.attempts=0,this.createdAt=Date.now(),this.events=e}incrementAttempts(){this.attempts++}}}),Zy=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.EventRetryConstants=void 0,e.EventRetryConstants={MAX_RETRY_ATTEMPTS:8,DEFAULT_BATCH_SIZE:100,MAX_PENDING_BATCHES:40,TICK_INTERVAL_MS:1e3,QUICK_FLUSH_WINDOW_MS:200,MAX_LOCAL_STORAGE:500,get MAX_QUEUED_EVENTS(){return this.DEFAULT_BATCH_SIZE*this.MAX_PENDING_BATCHES}}}),Qy=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BatchQueue=void 0;var t=Xy(),r=Zy();e.BatchQueue=class{constructor(e=r.EventRetryConstants.DEFAULT_BATCH_SIZE){this._batches=[],this._batchSize=e}batchSize(){return this._batchSize}requeueBatch(e){return this._enqueueBatch(e)}hasFullBatch(){return this._batches.some(e=>e.events.length>=this._batchSize)}takeNextBatch(){return this._batches.shift()}takeAllBatches(){let e=this._batches;return this._batches=[],e}createBatches(e){let r=0,n=0;for(;r<e.length;){let i=e.slice(r,r+this._batchSize);n+=this._enqueueBatch(new t.EventBatch(i)),r+=this._batchSize}return n}_enqueueBatch(e){this._batches.push(e);let t=0;for(;this._batches.length>r.EventRetryConstants.MAX_PENDING_BATCHES;){let e=this._batches.shift();e&&(t+=e.events.length)}return t}}}),$y=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._isTypeMatch=e._typeOf=void 0,e._typeOf=function(e){return Array.isArray(e)?"array":typeof e},e._isTypeMatch=function(e,t){let r=e=>Array.isArray(e)?"array":null===e?"null":typeof e;return r(e)===r(t)}}),eb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._getSortedObject=e._DJB2Object=e._DJB2=void 0;var t=$y();e._DJB2=e=>{let t=0;for(let r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r),t&=t}return String(t>>>0)},e._DJB2Object=(t,r)=>(0,e._DJB2)(JSON.stringify((0,e._getSortedObject)(t,r))),e._getSortedObject=(r,n)=>{if(null==r)return null;let i=Object.keys(r).sort(),o={};return i.forEach(i=>{let a=r[i];0!==n&&"object"===(0,t._typeOf)(a)?o[i]=(0,e._getSortedObject)(a,null==n?n:n-1):o[i]=a}),o}}),tb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._getStorageKey=e._getUserStorageKey=void 0;var t=eb();function r(e,r,n){if(n)return n(e,r);let i=r&&r.customIDs?r.customIDs:{},o=[`uid:${r?.userID??""}`,`cids:${Object.keys(i).sort((e,t)=>e.localeCompare(t)).map(e=>`${e}-${i[e]}`).join(",")}`,`k:${e}`];return(0,t._DJB2)(o.join("|"))}e._getUserStorageKey=r,e._getStorageKey=function(e,n,i){return n?r(e,n,i):(0,t._DJB2)(`k:${e}`)}}),nb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkParam=e.NetworkDefault=e.Endpoint=void 0,e.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},e.NetworkDefault={[e.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[e.Endpoint._initialize]:"https://featureassets.org/v1",[e.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}}),rb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SDKType=void 0;var t,r={};e.SDKType={_get:e=>(r[e]??"js-mono")+(t??""),_setClientType(e,t){r[e]=t},_setBindingType(e){(!t||"-react"===t)&&(t="-"+e)}}}),ib=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="3.33.3";var t={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>t,add:e=>{t=Object.assign(Object.assign({},t),e)}}}),ab=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._cloneObject=e._getUnloadEvent=e._getCurrentPageUrlSafe=e._addDocumentEventListenerSafe=e._addWindowEventListenerSafe=e._isServerEnv=e._getDocumentSafe=e._getWindowSafe=void 0;var t=Q();e._getWindowSafe=()=>typeof window<"u"?window:null,e._getDocumentSafe=()=>(0,e._getWindowSafe)()?.document??null,e._isServerEnv=()=>{if(null!==(0,e._getDocumentSafe)())return!1;let t=typeof process<"u"&&null!=process.versions&&null!=process.versions.node;return"string"==typeof EdgeRuntime||t},e._addWindowEventListenerSafe=(t,r)=>{let n=(0,e._getWindowSafe)();"function"==typeof n?.addEventListener&&n.addEventListener(t,r)},e._addDocumentEventListenerSafe=(t,r)=>{let n=(0,e._getDocumentSafe)();"function"==typeof n?.addEventListener&&n.addEventListener(t,r)},e._getCurrentPageUrlSafe=()=>{try{return(0,e._getWindowSafe)()?.location.href.split(/[?#]/)[0]}catch{return}},e._getUnloadEvent=()=>{let t=(0,e._getWindowSafe)();return t&&"onpagehide"in t?"pagehide":"beforeunload"},e._cloneObject=(e,r)=>{try{return JSON.parse(JSON.stringify(r))}catch{return t.Log.error(`Failed to clone object ${e}`),null}}}),ob=t(e=>
1{Object.defineProperty(e,"__esModule",{value:!0}),e._notifyVisibilityChanged=e._subscribeToVisiblityChanged=e._isUnloading=e._isCurrentlyVisible=void 0;var t=ab(),r="foreground",n="background",i=[],o=r,a=!1;e._isCurrentlyVisible=()=>o===r,e._isUnloading=()=>a,e._subscribeToVisiblityChanged=e=>{i.unshift(e)},e._notifyVisibilityChanged=e=>{e!==o&&(o=e,i.forEach(t=>t(e)))},(0,t._addWindowEventListenerSafe)("focus",()=>{a=!1,(0,e._notifyVisibilityChanged)(r)}),(0,t._addWindowEventListenerSafe)("blur",()=>(0,e._notifyVisibilityChanged)(n)),(0,t._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,e._notifyVisibilityChanged)("visible"===document.visibilityState?r:n)}),(0,t._addWindowEventListenerSafe)((0,t._getUnloadEvent)(),()=>{a=!0,(0,e._notifyVisibilityChanged)(n)})}),sb=t(e=>{var t=e&&e.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||=Promise)(function(r,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){e.done?r(e.value):i(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.EventSender=void 0;var r=Q(),n=nb(),i=rb(),o=ib(),a=ob();e.EventSender=class{constructor(e,t,r,n,i){this._sdkKey=e,this._network=t,this._emitter=r,this._options=i,this._logEventUrlConfig=n}setLogEventCompressionMode(e){this._network.setLogEventCompressionMode(e)}sendBatch(e){return t(this,void 0,void 0,function*(){let t="event_sender_unexpected_exception",n={};try{let r=(0,a._isUnloading)()&&this._network.isBeaconSupported()&&null==this._options?.networkConfig?.networkOverrideFunc;t="event_sender_pre_logs_flushed_emitter_exception",this._emitter({name:"pre_logs_flushed",events:e.events}),t=r?"event_sender_unexpected_exception":"event_sender_post_exception";let i=r?this._sendEventsViaBeacon(e,n):yield this._sendEventsViaPost(e,n);return i.success?(t="event_sender_logs_flushed_emitter_exception",this._emitter({name:"logs_flushed",events:e.events}),i):Object.assign(Object.assign(Object.assign({success:!1,statusCode:i.statusCode,failurePath:i.failurePath},i.failureErrorMessage?{failureErrorMessage:i.failureErrorMessage}:{}),i.failureDiagnosticBucket?{failureDiagnosticBucket:i.failureDiagnosticBucket}:{}),i.failureDiagnosticMetadata?{failureDiagnosticMetadata:i.failureDiagnosticMetadata}:{})}catch(e){return r.Log.warn("Failed to send batch:",e),Object.assign(Object.assign(Object.assign({success:!1,statusCode:-1,failurePath:n.path??t},n.errorMessage?{failureErrorMessage:n.errorMessage}:{}),n.diagnosticBucket?{failureDiagnosticBucket:n.diagnosticBucket}:{}),n.diagnosticMetadata?{failureDiagnosticMetadata:n.diagnosticMetadata}:{})}})}_sendEventsViaPost(e,r){return t(this,void 0,void 0,function*(){let t=yield this._network.post(this._getRequestData(e),r),n=t?.code??-1;return-1===n?Object.assign(Object.assign(Object.assign({success:!1,statusCode:-1,failurePath:r.path??(void 0===t?"event_sender_post_returned_undefined":"event_sender_post_returned_null")},r.errorMessage?{failureErrorMessage:r.errorMessage}:{}),r.diagnosticBucket?{failureDiagnosticBucket:r.diagnosticBucket}:{}),r.diagnosticMetadata?{failureDiagnosticMetadata:r.diagnosticMetadata}:{}):{success:n>=200&&n<300,statusCode:n}})}_sendEventsViaBeacon(e,t){let r=this._network.beacon(this._getRequestData(e),t);return Object.assign(Object.assign(Object.assign({success:r,statusCode:r?200:-1,failurePath:r?void 0:t.path??"beacon_send_false"},!r&&t.errorMessage?{failureErrorMessage:t.errorMessage}:{}),!r&&t.diagnosticBucket?{failureDiagnosticBucket:t.diagnosticBucket}:{}),!r&&t.diagnosticMetadata?{failureDiagnosticMetadata:t.diagnosticMetadata}:{})}_getRequestData(e){return{sdkKey:this._sdkKey,data:{events:e.events},urlConfig:this._logEventUrlConfig,retries:3,preserveFailedStatusCode:!0,isCompressable:!0,params:{[n.NetworkParam.EventCount]:String(e.events.length)},headers:{"statsig-event-count":String(e.events.length),"statsig-retry-count":String(e.attempts),"statsig-sdk-type":i.SDKType._get(this._sdkKey),"statsig-sdk-version":o.SDK_VERSION},credentials:"same-origin"}}}}),cb=t(e=>
1{Object.defineProperty(e,"__esModule",{value:!0}),e.FlushInterval=void 0;var t=1e3,r=6e4;e.FlushInterval=class{constructor(){this._currentIntervalMs=t,this._lastFlushAttemptTime=Date.now()}getCurrentIntervalMs(){return this._currentIntervalMs}markFlushAttempt(){this._lastFlushAttemptTime=Date.now()}getTimeSinceLastAttempt(){return Date.now()-this._lastFlushAttemptTime}hasReachedMaxInterval(){return this.getTimeSinceLastAttempt()>=r}getTimeTillMaxInterval(){return r-this.getTimeSinceLastAttempt()}hasCompletelyRecoveredFromBackoff(){return this._currentIntervalMs<=t}adjustForSuccess(){let e=this._currentIntervalMs;e!==t&&(this._currentIntervalMs=Math.max(t,Math.floor(e/2)))}adjustForFailure(){let e=this._currentIntervalMs;this._currentIntervalMs=Math.min(r,2*e)}getTimeUntilNextFlush(){return this.getCurrentIntervalMs()-this.getTimeSinceLastAttempt()}}}),lb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.FlushTypeValues=void 0,e.FlushTypeValues={ScheduledMaxTime:"scheduled:max_time",ScheduledFullBatch:"scheduled:full_batch",Limit:"limit",Manual:"manual",Shutdown:"shutdown"}}),ub=t(e=>{var t=e&&e.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||=Promise)(function(r,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){e.done?r(e.value):i(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e._fetchTxtRecords=void 0;var r=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),n=["i","e","d"];function i(e){let t=e.findIndex((t,r)=>r<200&&"="===String.fromCharCode(t)&&n.includes(String.fromCharCode(e[r-1])));if(-1===t){let e=Error("Failed to parse TXT records from DNS");throw e.name="DnsTxtParseError",e}let r="";for(let n=t-1;n<e.length;n++)r+=String.fromCharCode(e[n]);return r.split(",")}e._fetchTxtRecords=function(e){return t(this,void 0,void 0,function*(){let t=yield e("https://cloudflare-dns.com/dns-query",{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:r});if(!t.ok){let e=Error("Failed to fetch TXT records from DNS");throw e.name="DnsTxtFetchError",e}let n=yield t.arrayBuffer();return i(new Uint8Array(n))})}}),db=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._setObjectInStorage=e._getObjectFromStorage=e.Storage=void 0;var t=Q(),r=ab(),n={},i={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:e=>n[e]?n[e]:null,setItem:(e,t)=>{n[e]=t},removeItem:e=>{delete n[e]},getAllKeys:()=>Object.keys(n)},o=null;try{let e=(0,r._getWindowSafe)();e&&e.localStorage&&"function"==typeof e.localStorage.getItem&&(o={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:t=>e.localStorage.getItem(t),setItem:(t,r)=>e.localStorage.setItem(t,r),removeItem:t=>e.localStorage.removeItem(t),getAllKeys:()=>Object.keys(e.localStorage)})}catch{t.Log.warn("Failed to setup localStorageProvider.")}var a=o??i,s=a;function l(t){try{return t()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return e.Storage._setProvider(i),null;throw t}}e.Storage={isReady:()=>s.isReady(),isReadyResolver:()=>s.isReadyResolver(),getProviderName:()=>s.getProviderName(),getItem:e=>l(()=>s.getItem(e)),setItem:(e,t)=>l(()=>s.setItem(e,t)),removeItem:e=>s.removeItem(e),getAllKeys:()=>s.getAllKeys(),_setProvider:e=>{a=e,s=e},_setDisabled:e=>{s=e?i:a}},e._getObjectFromStorage=function(r){let n=e.Storage.getItem(r);try{return JSON.parse(n??"null")}catch{return t.Log.error(`Failed to parse value for key "${r}"`),null}},e._setObjectInStorage=function(t,r){e.Storage.setItem(t,JSON.stringify(r))}}),fb=t(e=>{var t=e&&e.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||=Promise)(function(r,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){e.done?r(e.value):i(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())})};
1Object.defineProperty(e,"__esModule",{value:!0}),e._isDomainFailure=e.NetworkFallbackResolver=void 0;var r=ub(),n=eb(),i=Q(),o=db(),a=6048e5;function s(e,t){let r=e?.toLowerCase()??"";return t||r.includes("uncaught exception")||r.includes("failed to fetch")||r.includes("networkerror when attempting to fetch resource")}function l(e){return`statsig.network_fallback.${(0,n._DJB2)(e)}`}function u(e,t){let r=l(e);t&&0!==Object.keys(t).length?o.Storage.setItem(r,JSON.stringify(t)):o.Storage.removeItem(r)}e.NetworkFallbackResolver=class{constructor(e){this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=e.networkConfig?.networkOverrideFunc}setErrorBoundary(e){this._errorBoundary=e}tryBumpExpiryTime(e,t){let r=this._fallbackInfo?.[t.endpoint];r&&(r.expiryTime=Date.now()+a,u(e,Object.assign(Object.assign({},this._fallbackInfo),{[t.endpoint]:r})))}getActiveFallbackUrl(e,t){if(null!=t.customUrl&&null!=t.fallbackUrls)return null;let r=this._fallbackInfo;r??(r=function(e){let t=l(e),r=o.Storage.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch{return i.Log.error("Failed to parse FallbackInfo"),null}}(e)??{},this._fallbackInfo=r);let n=r[t.endpoint];return!n||Date.now()>(n.expiryTime??0)||t.getChecksum()!==n.urlConfigChecksum?(delete r[t.endpoint],this._fallbackInfo=r,u(e,this._fallbackInfo),null):n.url?n.url:null}tryFetchUpdatedFallbackInfo(e,r,n,i){return t(this,void 0,void 0,function*(){var t;try{if(!s(n,i))return!1;let t=null==r.customUrl&&null==r.fallbackUrls?yield this._tryFetchFallbackUrlsFromNetwork(r):r.fallbackUrls,o=this._pickNewFallbackUrl(this._fallbackInfo?.[r.endpoint],t);return!!o&&(this._updateFallbackInfoWithNewUrl(e,r,o),!0)}catch(e){return null==(t=this._errorBoundary)||t.logError("tryFetchUpdatedFallbackInfo",e),!1}})}_updateFallbackInfoWithNewUrl(e,t,r){let n={urlConfigChecksum:t.getChecksum(),url:r,expiryTime:Date.now()+a,previous:[]},i=t.endpoint,o=this._fallbackInfo?.[i];o&&n.previous.push(...o.previous),n.previous.length>10&&(n.previous=[]);let s=this._fallbackInfo?.[i]?.url;null!=s&&n.previous.push(s),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[i]:n}),u(e,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(e){return t(this,void 0,void 0,function*(){let t=this._dnsQueryCooldowns[e.endpoint];if(t&&Date.now()<t)return null;this._dnsQueryCooldowns[e.endpoint]=Date.now()+144e5;let n=[],i=yield(0,r._fetchTxtRecords)(this._networkOverrideFunc??fetch),o=function(e){try{return new URL(e).pathname}catch{return null}}(e.defaultUrl);for(let t of i){if(!t.startsWith(e.endpointDnsKey+"="))continue;let r=t.split("=");if(r.length>1){let e=r[1];e.endsWith("/")&&(e=e.slice(0,-1)),n.push(`https://${e}${o}`)}}return n})}_pickNewFallbackUrl(e,t){if(null==t)return null;let r=new Set(e?.previous??[]),n=e?.url,i=null;for(let e of t){let t=e.endsWith("/")?e.slice(0,-1):e;if(!r.has(e)&&t!==n){i=t;break}}return i}},e._isDomainFailure=s}),pb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SDKFlags=void 0;var t={};e.SDKFlags={setFlags:(e,r)=>{t[e]=r},get:(e,r)=>t[e]?.[r]??!1}}),mb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getUUID=void 0,e.getUUID=function(){if(typeof crypto<"u"&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let e=(new Date).getTime(),t=typeof performance<"u"&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,r=>{let n=16*Math.random();return e>0?(n=(e+n)%16|0,e=Math.floor(e/16)):(n=(t+n)%16|0,t=Math.floor(t/16)),("x"===r?n:7&n|8).toString(16)})}}),hb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigSession=e.SessionID=void 0;var t=tb(),r=Q(),n=db(),i=mb(),o=ob(),a=18e5,s=144e5,l={};function u(e){var t;let r=e.data,n=function({lastUpdate:e}){return Date.now()-e>a}(r)||function({startTime:e}){return Date.now()-e>s}(r);return n&&(e.data=f(),null==(t=null==__STATSIG__?void 0:__STATSIG__.instance(e.sdkKey))||t.$emt({name:"session_expired"})),n}function c(e){return`statsig.session_id.${(0,t._getStorageKey)(e)}`}function d(e){try{(0,n._setObjectInStorage)(e.storageKey,e.data),e.lastPersistedAt=Date.now()}catch{r.Log.warn("Failed to save SessionID")}}function f(){return{sessionID:(0,i.getUUID)(),startTime:Date.now(),lastUpdate:Date.now()}}(0,o._subscribeToVisiblityChanged)(e=>
1{"background"===e&&Object.values(l).forEach(e=>d(e))}),e.SessionID={get:t=>e.StatsigSession.get(t).data.sessionID},e.StatsigSession={get:(e,t=!0)=>(l[e]??(l[e]=function(e){let t=c(e),r=function(e){return(0,n._getObjectFromStorage)(e)}(t);return r&&r.sessionID&&r.startTime&&r.lastUpdate?{data:r,sdkKey:e,lastPersistedAt:0,storageKey:t}:{data:f(),sdkKey:e,lastPersistedAt:0,storageKey:t}}(e)),function(e,t){let r=Date.now();return u(e)?d(e):t&&(e.data.lastUpdate=r,function(e){Date.now()-e.lastPersistedAt>15e3&&d(e)}(e)),e}(l[e],t)),overrideInitialSessionID:(e,t)=>{let r=Date.now(),n={data:{sessionID:e,startTime:r,lastUpdate:r},sdkKey:t,lastPersistedAt:Date.now(),storageKey:c(t)};d(n),l[t]=n},checkForIdleSession:e=>{let t=l[e];t&&u(t)&&d(t)}}}),gb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getCookieName=e.StableID=void 0;var t=tb(),r=Q(),n=ab(),i=db(),o=mb(),a={},s={},l={};function u(e){return`statsig.stable_id.${(0,t._getStorageKey)(e)}`}function c(e,t){let n=u(t);try{(0,i._setObjectInStorage)(n,e)}catch{r.Log.warn("Failed to save StableID to storage")}}function d(e,t){if(!s[t]||null==(0,n._getDocumentSafe)())return;let r=new Date;r.setFullYear(r.getFullYear()+1),document.cookie=`${f(t)}=${encodeURIComponent(e)}; expires=${r.toUTCString()}; path=/`}function f(e){return`statsig.stable_id.${(0,t._getStorageKey)(e)}`}e.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:e=>{if(l[e])return null;if(null!=a[e])return a[e];let t=null;return t=function(e){if(!s[e]||null==(0,n._getDocumentSafe)())return null;let t=document.cookie.split(";");for(let r of t){let[t,n]=r.trim().split("=");if(t===f(e))return decodeURIComponent(n)}return null}(e),null==t?(t=function(e){let t=u(e);return(0,i._getObjectFromStorage)(t)}(e),t??=(0,o.getUUID)(),c(t,e),d(t,e),a[e]=t,t):(a[e]=t,c(t,e),t)},setOverride:(e,t)=>{a[t]=e,c(e,t),d(e,t)},_setCookiesEnabled:(e,t)=>{s[e]=t},_setDisabled:(e,t)=>{l[e]=t}},e.getCookieName=f}),_b=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorTag=void 0,e.ErrorTag={NetworkError:"NetworkError"}}),vb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.LoggingEnabledOption=e.LogEventCompressionMode=void 0,e.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},e.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"}}),yb=t(e=>{var t=e&&e.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||=Promise)(function(r,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){e.done?r(e.value):i(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkCore=e.RETRYABLE_CODES=void 0,Jy();var r=Jy(),n=Yy(),i=Q(),o=nb(),a=fb(),s=pb(),l=rb(),u=ab(),c=hb(),d=gb(),f=_b(),h=ib(),p=vb(),g=ob();e.RETRYABLE_CODES=new Set([408,500,502,503,504,522,524,599]),e.NetworkCore=class{constructor(e,t){this._emitter=t,this._errorBoundary=null,this._timeout=1e4,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,e&&(this._options=e),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new a.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(e))}setLogEventCompressionMode(e){this._options.logEventCompressionMode=e}setErrorBoundary(e){this._errorBoundary=e,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(e)}isBeaconSupported(){return typeof navigator<"u"&&"function"==typeof navigator.sendBeacon}getLastUsedInitUrlAndReset(){let e=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,e}beacon(e,t){if(!m(e))return t&&(t.path="beacon_invalid_sdk_key"),!1;let r=this._getInternalRequestArgs("POST",e),n=this._getPopulatedURL(r),i=navigator;try{let e=i.sendBeacon.bind(i)(n,r.body);return e||t&&(t.path="beacon_send_false"),e}catch(e){throw t&&(t.path="beacon_send_exception"),e}}post(e,r){return t(this,void 0,void 0,function*(){let t=this._getInternalRequestArgs("POST",e);return this._tryEncodeBody(t),yield this._tryToCompressBody(t),this._sendRequest(t,r)})}get(e){let t=this._getInternalRequestArgs("GET",e);return this._sendRequest(t)}
1_sendRequest(r,n){return t(this,void 0,void 0,function*(){var t,o;if(!m(r))return n&&(n.path="network_invalid_sdk_key"),null;if(this._netConfig.preventAllNetworkTraffic)return n&&(n.path="network_prevent_all_network_traffic"),null;let{method:a,body:s,retries:l,attempt:u}=r,c=r.urlConfig.endpoint;if(this._isRateLimited(c))return i.Log.warn(`Request to ${c} was blocked because you are making requests too frequently.`),n&&(n.path="network_rate_limited"),null;let d=u??1,h=!1,p=this._getPopulatedURL(r),_=Date.now(),v=null,E=(0,g._isUnloading)();try{let e={method:a,body:s,headers:Object.assign({},r.headers),priority:r.priority,keepalive:E};b(r,d);let t=this._leakyBucket[c];t&&(t.lastRequestTime=Date.now(),this._leakyBucket[c]=t);let n,i=this._netConfig.networkOverrideFunc??fetch;if(v=yield Promise.race([i(p,e).finally(()=>clearTimeout(n)),new Promise((e,t)=>{n=setTimeout(()=>{h=!0,t(Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})]),!v.ok){let e=yield v.text().catch(()=>"No Text"),t=Error(`NetworkError: ${p} ${e}`);throw t.name="NetworkError",t}let o=yield v.text();return S(r,v,d,o),this._fallbackResolver.tryBumpExpiryTime(r.sdkKey,r.urlConfig),{body:o,code:v.status}}catch(s){let u=function(e){return"string"==typeof e?e:e instanceof Error?`${e.name}: ${e.message}`:"Unknown Error"}(s),c=function(e,t){return e.includes("Timeout")||t}(u??"",h);if(S(r,v,d,"",s),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(r.sdkKey,r.urlConfig,u,c))&&(r.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(r.sdkKey,r.urlConfig)),!l||d>l||!e.RETRYABLE_CODES.has(v?.status??500)){null==(t=this._emitter)||t.call(this,{name:"error",error:s,tag:f.ErrorTag.NetworkError,requestArgs:r});let e=`A networking error occurred during ${a} request to ${p}.`;if(i.Log.error(e,u,s),null==(o=this._errorBoundary)||o.attachErrorIfNoneExists(e),r.preserveFailedStatusCode&&null!=v)return{body:null,code:v.status};if(null==v&&n){n.path=c?"network_request_timed_out_no_response":"network_request_exception_no_response",u&&(n.errorMessage=u);try{let e=y(r,p,c,Date.now()-_);n.diagnosticBucket=e.bucket,n.diagnosticMetadata=e.metadata}catch{}}return null}return yield w(d),this._sendRequest(Object.assign(Object.assign({},r),{retries:l,attempt:d+1}),n)}})}_getLogEventCompressionMode(e){let t=e?.logEventCompressionMode;return!t&&!0===e?.disableCompression&&(t=p.LogEventCompressionMode.Disabled),t||=p.LogEventCompressionMode.Enabled,t}_isRateLimited(e){let t=Date.now(),r=this._leakyBucket[e]??{count:0,lastRequestTime:t},n=t-r.lastRequestTime,i=Math.floor(.05*n);return r.count=Math.max(0,r.count-i),r.count>=50||(r.count+=1,r.lastRequestTime=t,this._leakyBucket[e]=r,!1)}_getPopulatedURL(e){let t=e.fallbackUrl??e.urlConfig.getUrl();(e.urlConfig.endpoint===o.Endpoint._initialize||e.urlConfig.endpoint===o.Endpoint._download_config_specs)&&(this._lastUsedInitUrl=t);let r=Object.assign({[o.NetworkParam.SdkKey]:e.sdkKey,[o.NetworkParam.SdkType]:l.SDKType._get(e.sdkKey),[o.NetworkParam.SdkVersion]:h.SDK_VERSION,[o.NetworkParam.Time]:String(Date.now()),[o.NetworkParam.SessionID]:c.SessionID.get(e.sdkKey)},e.params),n=Object.keys(r).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(r[e])}`).join("&");return`${t}${n?`?${n}`:""}`}_tryEncodeBody(e){let t=(0,u._getWindowSafe)(),n=e.body;if(e.isStatsigEncodable&&!this._options.disableStatsigEncoding&&"string"==typeof n&&null==(0,r._getStatsigGlobalFlag)("no-encode")&&t?.btoa)try{e.body=t.btoa(n).split("").reverse().join(""),e.params=Object.assign(Object.assign({},e.params??{}),{[o.NetworkParam.StatsigEncoded]:"1"})}catch(t){i.Log.warn(`Request encoding failed for ${e.urlConfig.getUrl()}`,t)}}_tryToCompressBody(e){return t(this,void 0,void 0,function*(){let t=e.body;if("string"==typeof t&&function(e,t){if(!e.isCompressable||null!=(0,r._getStatsigGlobalFlag)("no-compress")||typeof CompressionStream>"u"||typeof TextEncoder>"u")return!1;let n=null!=e.urlConfig.customUrl||null!=e.urlConfig.fallbackUrls,i=!0===s.SDKFlags.get(e.sdkKey,"enable_log_event_compression");switch(t.logEventCompressionMode){case p.LogEventCompressionMode.Disabled:return!1;case p.LogEventCompressionMode.Enabled:return!(n&&!i);case p.LogEventCompressionMode.Forced:return!0;default:return!1}}(e,this._options))try{let r=(new TextEncoder).encode(t),n=new CompressionStream("gzip"),a=n.writable.getWriter();
1a.write(r).catch(i.Log.error),a.close().catch(i.Log.error);let s,l=n.readable.getReader(),u=[];for(;!(s=yield l.read()).done;)u.push(s.value);let c=u.reduce((e,t)=>e+t.length,0),d=new Uint8Array(c),f=0;for(let e of u)d.set(e,f),f+=e.length;e.body=d,e.params=Object.assign(Object.assign({},e.params??{}),{[o.NetworkParam.IsGzipped]:"1"})}catch(t){i.Log.warn(`Request compression failed for ${e.urlConfig.getUrl()}`,t)}})}_getInternalRequestArgs(e,t){let r=this._fallbackResolver.getActiveFallbackUrl(t.sdkKey,t.urlConfig),n=Object.assign(Object.assign({},t),{method:e,fallbackUrl:r});return"data"in t&&_(n,t.data),n}};var m=e=>!!e.sdkKey||(i.Log.warn("Unable to make request without an SDK key"),!1),_=(e,t)=>{let{sdkKey:r,fallbackUrl:n}=e,i=d.StableID.get(r),o=c.SessionID.get(r),a=l.SDKType._get(r);e.body=JSON.stringify(Object.assign(Object.assign({},t),{statsigMetadata:Object.assign(Object.assign({},h.StatsigMetadataProvider.get()),{stableID:i,sessionID:o,sdkType:a,fallbackUrl:n})}))};function y(e,t,r,n){let i=(0,u._getWindowSafe)(),o=i?.document,a=typeof navigator<"u"?navigator:null,s=(0,g._isUnloading)(),l=a&&"boolean"==typeof a.onLine?String(a.onLine):"unknown",c=o?.visibilityState??"unknown",d=Object.keys(e.headers??{}).length>0,f=function(e,t){return!t||!e.startsWith(`${t}/`)&&!e.startsWith(`${t}?`)&&e!==t}(t,i?.location?.origin),h=null!=e.urlConfig.customUrl,p=null!=e.fallbackUrl,m=v(n,[250,1e3,5e3,1e4]),_=v(function(e){return null==e?0:"string"==typeof e?e.length:e instanceof Uint8Array?e.byteLength:typeof Blob<"u"&&e instanceof Blob?e.size:-1}(e.body),[16384,65536,262144,1048576]),y="unknown_no_response";return r?y="timeout":"false"===l?y="browser_offline":s?y="page_unloading":"hidden"===c?y="page_hidden":f&&d?y="cross_origin_custom_headers_preflight_risk":h||p?y="custom_url_no_response":n<250&&(y="immediate_network_rejection"),{bucket:y,metadata:{elapsedMsBucket:m,bodySizeBucket:_,online:l,visibilityState:c,isUnloading:String(s),crossOrigin:String(f),hasCustomUrl:String(h)}}}function v(e,t){if(e<0)return"unknown";for(let r of t)if(e<r)return`<${r}`;return`>=${t[t.length-1]}`}function b(e,t){e.urlConfig.endpoint===o.Endpoint._initialize&&n.Diagnostics._markInitNetworkReqStart(e.sdkKey,{attempt:t})}function S(e,t,r,i,a){e.urlConfig.endpoint===o.Endpoint._initialize&&n.Diagnostics._markInitNetworkReqEnd(e.sdkKey,n.Diagnostics._getDiagnosticsData(t,r,i,a))}function w(e){return t(this,void 0,void 0,function*(){yield new Promise(t=>setTimeout(t,Math.min(e*e*500,3e4)))})}}),bb=t(e=>{var t=e&&e.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||=Promise)(function(r,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){e.done?r(e.value):i(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.FlushCoordinator=void 0;var r=Zy(),n=sb(),i=cb(),o=lb(),a=eb(),s=Q(),l=yb(),u=ab(),c=hb(),d=vb(),f=db(),h=new Set(["network_request_timed_out_no_response","network_request_exception_no_response","event_sender_post_returned_null","event_sender_post_returned_undefined","event_sender_post_exception"]);e.FlushCoordinator=class{constructor(e,t,r,o,a,s,l,u,c,d){this._cooldownTimer=null,this._maxIntervalTimer=null,this._hasRunQuickFlush=!1,this._currentFlushPromise=null,this._creationTime=Date.now(),this._isShuttingDown=!1,this._storageKey=null,this._flushInterval=new i.FlushInterval,this._batchQueue=e,this._pendingEvents=t,this._onPrepareFlush=r,this._errorBoundary=d,this._sdkKey=o,this._loggingEnabled=c,this._eventSender=new n.EventSender(o,a,s,l,u)}setLoggingEnabled(e){this._loggingEnabled=e}setLogEventCompressionMode(e){this._eventSender.setLogEventCompressionMode(e)}startScheduledFlushCycle(){this._scheduleNextFlush()}stopScheduledFlushCycle(){this._clearAllTimers()}addEvent(e){this._pendingEvents.addToPendingEventsQueue(e),!this._currentFlushPromise&&this._pendingEvents.hasEventsForFullBatch()&&this.processLimitFlush()}processManualFlush(){return t(this,void 0,void 0,function*(){return this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(o.FlushTypeValues.Manual).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()}),this._currentFlushPromise})}processShutdown(){return t(this,void 0,void 0,function*(){return this._isShuttingDown=!0,this._clearAllTimers(),this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(o.FlushTypeValues.Shutdown).catch(e=>{s.Log.error(`Error during shutdown flush: ${e}`)}).finally(()=>{this._currentFlushPromise=null}),this._currentFlushPromise})}_executeFlush(e){return t(this,void 0,void 0,function*(){this._clearAllTimers();try{this._prepareQueueForFlush(e);let t=this._batchQueue.takeAllBatches();if(0===t.length)return;yield Promise.all(t.map(t=>this._processOneBatch(t,e)))}finally{this._isShuttingDown||this._scheduleNextFlush()}})}checkQuickFlush(){this._hasRunQuickFlush||Date.now()-this._creationTime>r.EventRetryConstants.QUICK_FLUSH_WINDOW_MS||(this._hasRunQuickFlush=!0,setTimeout(()=>{this.processManualFlush().catch(e=>{s.Log.warn("Quick flush failed:",e)})},r.EventRetryConstants.QUICK_FLUSH_WINDOW_MS))}_attemptScheduledFlush(){if(this._currentFlushPromise)return void this._scheduleNextFlush();let e,t=this.containsAtLeastOneFullBatch(),r=this._flushInterval.hasReachedMaxInterval();t||r?(this._flushInterval.markFlushAttempt(),e=t?o.FlushTypeValues.ScheduledFullBatch:o.FlushTypeValues.ScheduledMaxTime,this._currentFlushPromise=this._processNextBatch(e).then(()=>{}).catch(e=>{s.Log.error("Error during scheduled flush:",e)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()})):this._scheduleNoopPollTick()}processLimitFlush(){this._flushInterval.hasCompletelyRecoveredFromBackoff()&&(this._currentFlushPromise||=this._processLimitFlush
1Internal().catch(e=>{s.Log.error("Error during limit flush",e)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()}))}_processLimitFlushInternal(){return t(this,void 0,void 0,function*(){if(yield this._processNextBatch(o.FlushTypeValues.Limit))for(;this._flushInterval.hasCompletelyRecoveredFromBackoff()&&this.containsAtLeastOneFullBatch()&&(yield this._processNextBatch(o.FlushTypeValues.Limit)););})}_scheduleNextFlush(){if(this._clearAllTimers(),this._isShuttingDown)return;let e=Math.max(0,this._flushInterval.getTimeUntilNextFlush());this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,c.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},e);let t=Math.max(0,this._flushInterval.getTimeTillMaxInterval());this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,c.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},t)}_clearAllTimers(){null!==this._cooldownTimer&&(clearTimeout(this._cooldownTimer),this._cooldownTimer=null),null!==this._maxIntervalTimer&&(clearTimeout(this._maxIntervalTimer),this._maxIntervalTimer=null)}_scheduleNoopPollTick(){if(this._clearAllTimers(),this._isShuttingDown)return;this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,c.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},r.EventRetryConstants.TICK_INTERVAL_MS);let e=Math.max(0,this._flushInterval.getTimeTillMaxInterval());this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,c.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},e)}_processNextBatch(e){return t(this,void 0,void 0,function*(){this._prepareQueueForFlush(e);let t=this._batchQueue.takeNextBatch();return!!t&&this._processOneBatch(t,e)})}_processOneBatch(e,r){return t(this,void 0,void 0,function*(){if(this._loggingEnabled!==d.LoggingEnabledOption.always&&(0,u._isServerEnv)())return this._flushInterval.adjustForSuccess(),!0;let t=yield this._eventSender.sendBatch(e);return t.success?(this._flushInterval.adjustForSuccess(),!0):(this._flushInterval.adjustForFailure(),this._handleFailure(e,r,t.statusCode,t.failurePath,t.failureErrorMessage,t.failureDiagnosticBucket,t.failureDiagnosticMetadata),!1)})}_prepareQueueForFlush(e){this._onPrepareFlush();let t=this.convertPendingEventsToBatches();t>0&&(s.Log.warn(`Dropped ${t} events`),this._errorBoundary.logDroppedEvents(t,"Batch queue limit reached during batching",{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:r.EventRetryConstants.MAX_PENDING_BATCHES,flushType:e,retries:"dropped before batching"}))}containsAtLeastOneFullBatch(){return this._pendingEvents.hasEventsForFullBatch()||this._batchQueue.hasFullBatch()}convertPendingEventsToBatches(){if(this._pendingEvents.isEmpty())return 0;let e=this._pendingEvents.takeAll();return this._batchQueue.createBatches(e)}_isRetryableBatch(e,t){return!!(l.RETRYABLE_CODES.has(e)||-1===e&&t&&h.has(t))}_handleFailure(e,t,n,i,a,l,u){if(t===o.FlushTypeValues.Shutdown)return s.Log.warn(`${t} flush failed during shutdown. ${e.events.length} event(s) will be saved to storage for retry in next session.`),void this._saveShutdownFailedEventsToStorage(e.events);if(!this._isRetryableBatch(n,i))return s.Log.warn(`${t} flush failed after ${e.attempts} attempt(s). ${e.events.length} event(s) will be dropped. Non-retryable error: ${n}`),void this._errorBoundary.logEventRequestFailure(e.events.length,"non-retryable error",t,n,e.attempts,i,a,l,u);if(e.attempts>=r.EventRetryConstants.MAX_RETRY_ATTEMPTS)return s.Log.warn(`${t} flush failed after ${e.attempts} attempt(s). ${e.events.length} event(s) will be dropped.`),void this._errorBoundary.logEventRequestFailure(e.events.length,"max retry attempts exceeded",t,n,e.attempts,i,a,l,u);e.incrementAttempts();let c=this._batchQueue.requeueBatch(e);c>0&&(s.Log.warn(`Failed to requeue batch : dropped ${c} events due to full queue`),this._errorBoundary.logDroppedEvents(c,"Batch queue limit reached during requeue",{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:r.EventRetryConstants.MAX_PENDING_BATCHES,flushType:t,retries:e.attempts}))}loadAndRetryShutdownFailedEvents(){return t(this,void 0,void 0,function*(){let e=this._getStorageKey();try{f.Storage.isReady()||(yield f.Storage.isReadyResolver());let t=this._getShutdownFailedEventsFromStorage(e);if(0===t.length)return;s.Log.debug(`Loading ${t.length} failed shutdown event(s) from storage for retry`),f.Storage.removeItem(e),t.forEach(e
1=>{this.addEvent(e)}),yield this.processManualFlush()}catch(e){s.Log.warn("Failed to load and retry failed shutdown events:",e)}})}_getStorageKey(){return this._storageKey||=`statsig.failed_shutdown_events.${(0,a._DJB2)(this._sdkKey)}`,this._storageKey}_saveShutdownFailedEventsToStorage(e){let t=this._getStorageKey();try{let n=[...this._getShutdownFailedEventsFromStorage(t),...e];n.length>r.EventRetryConstants.MAX_LOCAL_STORAGE&&(n=n.slice(-r.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,f._setObjectInStorage)(t,n),s.Log.debug(`Saved ${e.length} failed shutdown event(s) to storage (total stored: ${n.length})`)}catch(e){s.Log.warn("Unable to save failed shutdown events to storage:",e)}}_getShutdownFailedEventsFromStorage(e){try{let t=(0,f._getObjectFromStorage)(e);return Array.isArray(t)?t:[]}catch{return[]}}}}),xb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.PendingEvents=void 0;var t=Q();e.PendingEvents=class{constructor(e){this._pendingEvents=[],this._batchSize=e}addToPendingEventsQueue(e){this._pendingEvents.push(e),t.Log.debug("Enqueued Event:",e)}hasEventsForFullBatch(){return this._pendingEvents.length>=this._batchSize}takeAll(){let e=this._pendingEvents;return this._pendingEvents=[],e}isEmpty(){return 0===this._pendingEvents.length}}}),Sb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._createLayerParameterExposure=e._createConfigExposure=e._mapExposures=e._createGateExposure=e._isExposureEvent=void 0;var t="statsig::config_exposure",r="statsig::gate_exposure",n="statsig::layer_exposure",i=(e,t,r,n,i)=>(r.bootstrapMetadata&&(n.bootstrapMetadata=r.bootstrapMetadata),{eventName:e,user:t,value:null,metadata:a(r,n),secondaryExposures:i,time:Date.now()});function o(e,t){return e.map(e=>"string"==typeof e?(t??{})[e]:e).filter(e=>null!=e)}e._isExposureEvent=({eventName:e})=>e===r||e===t||e===n,e._createGateExposure=(e,t,n)=>{let a={gate:t.name,gateValue:String(t.value),ruleID:t.ruleID};return null!=t.__evaluation?.version&&(a.configVersion=t.__evaluation.version),i(r,e,t.details,a,o(t.__evaluation?.secondary_exposures??[],n))},e._mapExposures=o,e._createConfigExposure=(e,r,n)=>{let a={config:r.name,ruleID:r.ruleID};return null!=r.__evaluation?.version&&(a.configVersion=r.__evaluation.version),null!=r.__evaluation?.passed&&(a.rulePassed=String(r.__evaluation.passed)),i(t,e,r.details,a,o(r.__evaluation?.secondary_exposures??[],n))},e._createLayerParameterExposure=(e,t,r,a)=>{let s=t.__evaluation,l=!0===(s?.explicit_parameters)?.includes(r),u="",c=s?.undelegated_secondary_exposures??[];l&&(u=s.allocated_experiment_name??"",c=s.secondary_exposures??[]);let d=t.__evaluation?.parameter_rule_ids,f={config:t.name,parameterName:r,ruleID:d?.[r]??t.ruleID,allocatedExperiment:u,isExplicitParameter:String(l)};return null!=t.__evaluation?.version&&(f.configVersion=t.__evaluation.version),i(n,e,t.details,f,o(c,a))};var a=(e,t)=>(t.reason=e.reason,e.lcut&&(t.lcut=String(e.lcut)),e.receivedAt&&(t.receivedAt=String(e.receivedAt)),t)}),Cb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.UrlConfiguration=void 0;var t=eb(),r=nb(),n={[r.Endpoint._initialize]:"i",[r.Endpoint._rgstr]:"e",[r.Endpoint._download_config_specs]:"d"};e.UrlConfiguration=class{constructor(e,t,i,o){this.customUrl=null,this.fallbackUrls=null,this.endpoint=e,this.endpointDnsKey=n[e],t&&(this.customUrl=t),!t&&i&&(this.customUrl=i.endsWith("/")?`${i}${e}`:`${i}/${e}`),o&&(this.fallbackUrls=o);let a=r.NetworkDefault[e];this.defaultUrl=`${a}/${e}`}getUrl(){return this.customUrl??this.defaultUrl}getChecksum(){let e=(this.fallbackUrls??[]).sort().join(",");return(0,t._DJB2)(this.customUrl+e)}}}),wb=t(e=>{var t=e&&e.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||=Promise)(function(r,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){e.done?r(e.value):i(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.EventLogger=void 0;var r=Qy(),n=tb(),i=Zy(),o=bb(),a=eb(),s=Q(),l=nb(),u=xb(),c=ab(),d=Sb(),f=vb(),h=db(),p=Cb(),g=ob(),m={};e.EventLogger=class e{static _safeFlushAndForget(e){var t;null==(t=m[e])||t.flush().catch(()=>{})}constructor(e,t,r,n,i){this._sdkKey=e,this._emitter=t,this._network=r,this._options=n,this._errorBoundary=i,this._pendingEvents=null,this._batchQueue=null,this._flushCoordinator=null,this._lastExposureTimeMap={},this._nonExposedChecks={},this._isShuttingDown=!1,this._storageKey=null,this._pendingCompressionMode=null,this._loggingEnabled=n?.loggingEnabled??(!0===n?.disableLogging?f.LoggingEnabledOption.disabled:f.LoggingEnabledOption.browserOnly),n?.loggingEnabled&&void 0!==n.disableLogging&&s.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging.");let o=n?.networkConfig;this._logEventUrlConfig=new p.UrlConfiguration(l.Endpoint._rgstr,o?.logEventUrl,o?.api,o?.logEventFallbackUrls)}setLogEventCompressionMode(e){this._flushCoordinator?this._flushCoordinator.setLogEventCompressionMode(e):this._pe
1ndingCompressionMode=e}setLoggingEnabled(e){let t="disabled"===this._loggingEnabled,r="disabled"!==e;if(this._loggingEnabled=e,this._flushCoordinator&&this._flushCoordinator.setLoggingEnabled(e),t&&r){let e=this._loadStoredEvents();s.Log.debug(`Loaded ${e.length} stored event(s) from storage`),e.length>0&&(e.forEach(e=>{this._initFlushCoordinator().addEvent(e)}),this.flush().catch(e=>{s.Log.warn("Failed to flush events after enabling logging:",e)}))}}enqueue(e){var t;if(!this._shouldLogEvent(e))return;let r=this._normalizeEvent(e);"disabled"!==this._loggingEnabled?(this._initFlushCoordinator().addEvent(r),null==(t=this._flushCoordinator)||t.checkQuickFlush()):this._storeEventToStorage(r)}incrementNonExposureCount(e){let t=this._nonExposedChecks[e]??0;this._nonExposedChecks[e]=t+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){let t=(0,c._isServerEnv)();if(t&&"always"!==this._options?.loggingEnabled)return;let r=this._initFlushCoordinator();m[this._sdkKey]=this,t||(0,g._subscribeToVisiblityChanged)(t=>{"background"===t?e._safeFlushAndForget(this._sdkKey):"foreground"===t&&r.startScheduledFlushCycle()}),r.loadAndRetryShutdownFailedEvents().catch(e=>{s.Log.warn("Failed to load failed shutdown events:",e)}),r.startScheduledFlushCycle()}stop(){return t(this,void 0,void 0,function*(){this._isShuttingDown=!0,this._flushCoordinator&&(yield this._flushCoordinator.processShutdown()),delete m[this._sdkKey],this._flushCoordinator=null,this._pendingEvents=null,this._batchQueue=null})}flush(){return t(this,void 0,void 0,function*(){if(this._flushCoordinator)return this._flushCoordinator.processManualFlush()})}appendAndResetNonExposedChecks(){if(0===Object.keys(this._nonExposedChecks).length)return;let e=Object.assign({},this._nonExposedChecks);this._nonExposedChecks={};let t=this._normalizeEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:e}});this._flushCoordinator&&this._flushCoordinator.addEvent(t)}_shouldLogEvent(e){if("always"!==this._options?.loggingEnabled&&(0,c._isServerEnv)())return!1;if(!(0,d._isExposureEvent)(e))return!0;let t=e.user?e.user:{statsigEnvironment:void 0},r=(0,n._getUserStorageKey)(this._sdkKey,t),i=e.metadata?e.metadata:{},o=[e.eventName,r,i.gate,i.config,i.ruleID,i.allocatedExperiment,i.parameterName,String(i.isExplicitParameter),i.reason].join("|"),a=this._lastExposureTimeMap[o],s=Date.now();return!(a&&s-a<6e5)&&(Object.keys(this._lastExposureTimeMap).length>1e3&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[o]=s,!0)}_getCurrentPageUrl(){if(!1!==this._options?.includeCurrentPageUrlWithEvents)return(0,c._getCurrentPageUrlSafe)()}_getStorageKey(){return this._storageKey||=`statsig.pending_events.${(0,a._DJB2)(this._sdkKey)}`,this._storageKey}_initFlushCoordinator(){if(this._flushCoordinator)return this._flushCoordinator;let e=this._options?.loggingBufferMaxSize??i.EventRetryConstants.DEFAULT_BATCH_SIZE;return this._pendingEvents=new u.PendingEvents(e),this._batchQueue=new r.BatchQueue(e),this._flushCoordinator=new o.FlushCoordinator(this._batchQueue,this._pendingEvents,()=>this.appendAndResetNonExposedChecks(),this._sdkKey,this._network,this._emitter,this._logEventUrlConfig,this._options,this._loggingEnabled,this._errorBoundary),this._pendingCompressionMode&&=(this._flushCoordinator.setLogEventCompressionMode(this._pendingCompressionMode),null),this._flushCoordinator}_storeEventToStorage(e){let t=this._getStorageKey();try{let r=this._getEventsFromStorage(t);r.push(e),r.length>i.EventRetryConstants.MAX_LOCAL_STORAGE&&(r=r.slice(-i.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,h._setObjectInStorage)(t,r)}catch{s.Log.warn("Unable to save events to storage")}}_getEventsFromStorage(e){try{let t=(0,h._getObjectFromStorage)(e);return Array.isArray(t)?t:[]}catch{return[]}}_loadStoredEvents(){let e=this._getStorageKey(),t=this._getEventsFromStorage(e);return t.length>0&&h.Storage.removeItem(e),t}_normalizeEvent(e){e.user&&(e.user=Object.assign({},e.user),delete e.user.privateAttributes);let t={},r=this._getCurrentPageUrl();return r&&(t.statsigMetadata={currentPage:r}),Object.assign(Object.assign({},e),t)}}}),Tb=t(e=>
1{Object.defineProperty(e,"__esModule",{value:!0}),e.PrecomputedEvaluationsContextHandle=void 0;var t=Q(),r=ab(),n=hb(),i=gb();e.PrecomputedEvaluationsContextHandle=class{constructor(e,t,r,n,i,o){this._sdkKey=e,this._getOptions=t,this._getErrorBoundary=r,this._getValues=n,this._getUser=i,this._getSdkInstanceID=o}get sdkKey(){return this._sdkKey}get options(){return this._getOptions()}get errorBoundary(){return this._getErrorBoundary()}get values(){return this._getValues()}get user(){let e=(0,r._cloneObject)("StatsigUser",this._getUser());return e??=(t.Log.error("Failed to clone user"),{}),e}getSession(e=!0){return n.StatsigSession.get(this._sdkKey,e)}get stableID(){return i.StableID.get(this._sdkKey)}get sdkInstanceID(){return this._getSdkInstanceID()}toContext(e=!0){return{sdkKey:this.sdkKey,options:this.options,values:this.values,user:this.user,errorBoundary:this.errorBoundary,session:this.getSession(e),stableID:this.stableID,sdkInstanceID:this.sdkInstanceID}}}}),Eb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._getUnitIDFromUser=e._getFullUserHash=e._normalizeUser=void 0;var t=eb(),r=Q(),n=ab();e._normalizeUser=function(e,t,i){let o=(0,n._cloneObject)("StatsigUser",e);return null==o?(r.Log.error("Failed to clone user"),{statsigEnvironment:void 0}):(null!=t&&null!=t.environment?o.statsigEnvironment=t.environment:null!=i&&(o.statsigEnvironment={tier:i}),o)},e._getFullUserHash=function(e){return e?(0,t._DJB2Object)(e):null},e._getUnitIDFromUser=function(e,t){if("string"!=typeof t)return e.userID;let r=t.toLowerCase();return"userid"===r?e.userID:e.customIDs?.[t]??e.customIDs?.[r]}}),Db=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._typedJsonParse=void 0;var t=Q();e._typedJsonParse=function(e,r,n){try{let t=JSON.parse(e);if(t&&"object"==typeof t&&r in t)return t}catch{}return t.Log.error(`Failed to parse ${n}`),null}}),Ob=t(e=>{var t=e&&e.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||=Promise)(function(r,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){e.done?r(e.value):i(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e._makeDataAdapterResult=e.DataAdapterCore=void 0;var r=Q(),n=gb(),i=Eb(),o=db(),a=Db();function s(e,t,r,n){return{source:e,data:t,receivedAt:Date.now(),stableID:r,fullUserHash:(0,i._getFullUserHash)(n)}}e.DataAdapterCore=class{constructor(e,t){this._adapterName=e,this._cacheSuffix=t,this._options=null,this._sdkKey=null,this._cacheLimit=10,this._lastModifiedStoreKey=`statsig.last_modified_time.${t}`,this._inMemoryCache=new l}attach(e,t,r){this._sdkKey=e,this._options=t}getDataSync(e){let t=e&&(0,i._normalizeUser)(e,this._options),r=this._getCacheKey(t),n=this._inMemoryCache.get(r,t);if(n&&this._getIsCacheValueValid(n))return n;let o=this._loadFromCache(r);return o&&this._getIsCacheValueValid(o)?(this._inMemoryCache.add(r,o,this._cacheLimit),this._inMemoryCache.get(r,t)):null}setData(e,t){let r=t&&(0,i._normalizeUser)(t,this._options),n=this._getCacheKey(r);this._inMemoryCache.add(n,s("Bootstrap",e,null,r),this._cacheLimit)}_getIsCacheValueValid(e){return null==e.stableID||e.stableID===n.StableID.get(this._getSdkKey())}_getDataAsyncImpl(e,n,i){return t(this,void 0,void 0,function*(){o.Storage.isReady()||(yield o.Storage.isReadyResolver());let t=e??this.getDataSync(n),a=[this._fetchAndPrepFromNetwork(t,n,i)];return i?.timeoutMs&&a.push(new Promise(e=>setTimeout(e,i.timeoutMs)).then(()=>(r.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(a)})}_prefetchDataImpl(e,r){return t(this,void 0,void 0,function*(){let t=e&&(0,i._normalizeUser)(e,this._options),n=this._getCacheKey(t),o=yield this._getDataAsyncImpl(null,t,r);o&&this._inMemoryCache.add(n,Object.assign(Object.assign({},o),{source:"Prefetch"}),this._cacheLimit)})}_fetchAndPrepFromNetwork(e,i,o){return t(this,void 0,void 0,function*(){let t=e?.data??null,l=null!=e&&this._isCachedResultValidFor204(e,i),u=yield this._fetchFromNetwork(t,i,o,l);if(!u)return r.Log.debug("No response returned for latest value"),null;
1let c=(0,a._typedJsonParse)(u,"has_updates","Response"),d=this._getSdkKey(),f=n.StableID.get(d),h=null;if(!0===c?.has_updates)h=s("Network",u,f,i);else{if(!t||!1!==c?.has_updates)return null;h=s("NetworkNotModified",t,f,i)}let p=this._getCacheKey(i);return this._inMemoryCache.add(p,h,this._cacheLimit),this._writeToCache(p,h),h})}_getSdkKey(){return null==this._sdkKey?(r.Log.error(`${this._adapterName} is not attached to a Client`),""):this._sdkKey}_loadFromCache(e){let t=o.Storage.getItem?.call(o.Storage,e);if(null==t)return null;let r=(0,a._typedJsonParse)(t,"source","Cached Result");return r?Object.assign(Object.assign({},r),{source:"Cache"}):null}_writeToCache(e,t){let r=JSON.stringify(t);for(let n=0;n<8;n++)try{o.Storage.setItem(e,r);break}catch(t){if(!(t instanceof Error)||!t.toString().includes("QuotaExceededError")&&!t.toString().includes("QUOTA_EXCEEDED_ERR")||this._cacheLimit<=1)throw t;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(e,this._cacheLimit-1)}this._runLocalStorageCacheEviction(e)}_runLocalStorageCacheEviction(e,t=this._cacheLimit){let r=(0,o._getObjectFromStorage)(this._lastModifiedStoreKey)??{};r[e]=Date.now();let n=u(r,t);for(let e of n)delete r[e],o.Storage.removeItem(e);(0,o._setObjectInStorage)(this._lastModifiedStoreKey,r)}},e._makeDataAdapterResult=s;var l=class{constructor(){this._data={}}get(e,t){let n=this._data[e],i=n?.stableID,o=t?.customIDs?.stableID;return o&&i&&o!==i?(r.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):n}add(e,t,r){let n=u(this._data,r-1);for(let e of n)delete this._data[e];this._data[e]=t}merge(e){this._data=Object.assign(Object.assign({},this._data),e)}};function u(e,t){let r=Object.keys(e);return r.length<=t?[]:0===t?r:r.sort((t,r)=>{let n=e[t],i=e[r];return"object"==typeof n&&"object"==typeof i?n.receivedAt-i.receivedAt:n-i}).slice(0,r.length-t)}}),kb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0})}),Ab=t(e=>{var t=e&&e.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||=Promise)(function(r,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){e.done?r(e.value):i(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.ErrorBoundary=e.EXCEPTION_ENDPOINT=void 0;var r=Q(),n=rb(),i=ib();e.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";var o="[Statsig] UnknownError";function a(e){return e instanceof Error?e:Error("string"==typeof e?e:"An unknown error occurred.")}function s(e){if(!e)return{};let t={};return Object.keys(e).forEach(r=>{let n=r,i=e[n];switch(typeof i){case"number":case"bigint":case"boolean":t[String(n)]=i;break;case"string":i.length<50?t[String(n)]=i:t[String(n)]="set";break;case"object":"environment"===n?t.environment=i:"networkConfig"===n?t.networkConfig=i:t[String(n)]=null==i?"unset":"set"}}),t}e.ErrorBoundary=class{constructor(e,t,r,n){this._sdkKey=e,this._options=t,this._emitter=r,this._lastSeenError=n,this._seen=new Set}wrap(e,t){try{let r=e;(function(e){let t=new Set,r=Object.getPrototypeOf(e);for(;r&&r!==Object.prototype;)Object.getOwnPropertyNames(r).filter(e=>
1"function"==typeof r?.[e]).forEach(e=>t.add(e)),r=Object.getPrototypeOf(r);return Array.from(t)})(r).forEach(n=>{let i=r[n];"$EB"in i||(r[n]=(...r)=>this._capture(t?`${t}:${n}`:n,()=>i.apply(e,r)),r[n].$EB=!0)})}catch(e){this._onError("eb:wrap",e)}}logError(e,t){this._onError(e,t)}logDroppedEvents(e,t,r){let n={eventCount:String(e),reason:t};r&&Object.keys(r).forEach(e=>{n[e]=String(r[e])}),this._onError("statsig::log_event_dropped_event_count",Error(t),!0,n)}logEventRequestFailure(e,t,r,n,i,o,a,s,l){let u={eventCount:String(e),flushType:r,statusCode:String(n),reason:t,retries:String(i)};o&&(u.failurePath=o),"string"==typeof a&&a.length>0&&(u.failureErrorMessage=a),"string"==typeof s&&s.length>0&&(u.failureDiagnosticBucket=s),l&&Object.keys(l).forEach(e=>{let t=l[e];t.length>0&&(u[`failureDiagnostic_${e}`]=t)}),this._onError("statsig::log_event_failed",Error(t),!0,u)}getLastSeenErrorAndReset(){let e=this._lastSeenError;return this._lastSeenError=void 0,e??null}attachErrorIfNoneExists(e){this._lastSeenError||=a(e)}_capture(e,t){try{let r=t();return r&&r instanceof Promise?r.catch(t=>this._onError(e,t)):r}catch(t){return this._onError(e,t),null}}_onError(l,u,c=!1,d){try{r.Log.warn(`Caught error in ${l}`,{error:u}),t(this,void 0,void 0,function*(){var t,r;let f=u||Error(o),h=f instanceof Error,p=h?f.name:"No Name",g=a(f);if(this._lastSeenError=g,!c&&this._seen.has(p))return;if(this._seen.add(p),this._options?.networkConfig?.preventAllNetworkTraffic)return void(null==(t=this._emitter)||t.call(this,{name:"error",error:u,tag:l}));let m=n.SDKType._get(this._sdkKey),_=i.StatsigMetadataProvider.get(),y=h?f.stack:function(e){try{return JSON.stringify(e)}catch{return o}}(f),v=Object.assign(Object.assign({tag:l,exception:p,info:y,statsigOptions:s(this._options)},Object.assign(Object.assign({},_),{sdkType:m})),d??{}),b=this._options?.networkConfig;yield(b?.networkOverrideFunc??fetch)(b?.sdkExceptionUrl??e.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(m),"STATSIG-SDK-VERSION":String(_.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(v)}),null==(r=this._emitter)||r.call(this,{name:"error",error:u,tag:l})}).then(()=>{}).catch(()=>{})}catch{}}}}),jb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0})}),Mb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0})}),Nb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0})}),Pb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createMemoKey=e.MemoPrefix=void 0,e.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};var t=new Set([]),r=new Set(["userPersistedValues"]);e.createMemoKey=function(e,n,i){let o=`${e}|${n}`;if(!i)return o;for(let e of Object.keys(i)){if(r.has(e))return;t.has(e)?o+=`|${e}=true`:o+=`|${e}=${i[e]}`}return o}}),Fb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0})}),Ib=t(e=>{Object.defineProperty(e,"__esModule",{value:!0})}),Lb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._fastApproxSizeOf=void 0,e._fastApproxSizeOf=(e,t)=>{let r=[e],n=[Object.keys(e)],i=[0],o=[0],a=0,s=0;for(;;){if(i[a]<n[a].length){let e=n[a][i[a]++],s=r[a][e];if(o[a]+=e.length,s&&"object"==typeof s){r[++a]=s,n[a]=Object.keys(s),i[a]=o[a]=0;continue}if(o[a]+=(s+"").length+1,o[a]<t)continue}for(s=o[a--];a>=0&&(o[a]+=s+2)>=t;s=o[a--]);if(a<0)return s}}}),Rb=t(e=>{var t=e&&e.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||=Promise)(function(r,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){e.done?r(e.value):i(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigClientBase=void 0,Jy();var r=Jy(),n=Ab(),i=wb(),o=Q(),a=Pb(),s=ab(),l=hb(),u=gb(),c=vb(),d=db();function f(e,t){if((0,s._isServerEnv)())return;let n=(0,r._getStatsigGlobal)(),i=n.instances??{},a=t;null!=i[e]&&o.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),i[e]=a,n.firstInstance||=a,n.instances=i,__STATSIG__=n}e.StatsigClientBase=class{constructor(e,t,r,a){var s,c;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};let h=this.$emt.bind(this);null!=a?.logLevel&&(o.Log.level=a.logLevel),null!=a&&a.disableStorage&&d.Storage._setDisabled(!0),null!=a&&a.initialSessionID&&l.StatsigSession.overrideInitialSessionID(a.initialSessionID,e),null!=a&&a.storageProvider&&d.Storage._setProvider(a.storageProvider),null!=a&&a.enableCookies&&u.StableID._setCo
1okiesEnabled(e,a.enableCookies),null!=a&&a.disableStableID&&u.StableID._setDisabled(e,!0),this._sdkKey=e,this._options=a??{},this._memoCache={},this.overrideAdapter=a?.overrideAdapter??null,this._errorBoundary=new n.ErrorBoundary(e,a,h),this._logger=new i.EventLogger(e,h,r,a,this._errorBoundary),this._errorBoundary.wrap(this),this._errorBoundary.wrap(t),this._errorBoundary.wrap(this._logger),r.setErrorBoundary(this._errorBoundary),this.dataAdapter=t,this.dataAdapter.attach(e,a,r),this.storageProvider=d.Storage,null==(c=((s=this.overrideAdapter)?.loadFromStorage)?.call(s))||c.catch(e=>this._errorBoundary.logError("OA::loadFromStorage",e)),this._primeReadyRipcord(),f(e,this)}updateRuntimeOptions(e){e.loggingEnabled?(this._options.loggingEnabled=e.loggingEnabled,this._logger.setLoggingEnabled(e.loggingEnabled)):null!=e.disableLogging&&(this._options.disableLogging=e.disableLogging,this._logger.setLoggingEnabled(e.disableLogging?"disabled":"browser-only")),null!=e.disableStorage&&(this._options.disableStorage=e.disableStorage,d.Storage._setDisabled(e.disableStorage)),null!=e.enableCookies&&(this._options.enableCookies=e.enableCookies,u.StableID._setCookiesEnabled(this._sdkKey,e.enableCookies)),e.logEventCompressionMode?this._logger.setLogEventCompressionMode(e.logEventCompressionMode):e.disableCompression&&this._logger.setLogEventCompressionMode(c.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return t(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){if(this._listeners[e]){let r=this._listeners[e].indexOf(t);-1!==r&&this._listeners[e].splice(r,1)}}$on(e,t){t.__isInternal=!0,this.on(e,t)}$emt(e){var t;let r=t=>{try{t(e)}catch(r){if(!0===t.__isInternal)return void this._errorBoundary.logError(`__emit:${e.name}`,r);o.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",e)}};this._listeners[e.name]&&this._listeners[e.name].forEach(e=>r(e)),null==(t=this._listeners["*"])||t.forEach(r)}_setStatus(e,t){this.loadingStatus=e,this._memoCache={},this.$emt({name:"values_updated",status:e,values:t})}_enqueueExposure(e,t,r){!0!==r?.disableExposureLog?this._logger.enqueue(t):this._logger.incrementNonExposureCount(e)}_memoize(e,t){return(r,n)=>{if(this._options.disableEvaluationMemoization)return t(r,n);let i=(0,a.createMemoKey)(e,r,n);return i?(i in this._memoCache||(Object.keys(this._memoCache).length>=3e3&&(this._memoCache={}),this._memoCache[i]=t(r,n)),this._memoCache[i]):t(r,n)}}}}),zb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"}),Bb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0})}),Vb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._makeTypedGet=e._mergeOverride=e._makeLayer=e._makeExperiment=e._makeDynamicConfig=e._makeFeatureGate=void 0;var t=Q(),r=$y();function n(e,t,r,n){return{name:e,details:t,ruleID:r?.rule_id??"",__evaluation:r,value:n}}function i(e,t,r){let i=r?.value??{};return Object.assign(Object.assign({},n(e,t,r,i)),{idType:r?.id_type??null,get:o(e,r?.value)})}function o(e,n,i){return(o,a)=>{let s=n?.[o]??null;return null==s?a??null:null==a||(0,r._isTypeMatch)(s,a)?(i?.(o),s):(t.Log.warn(`Parameter type mismatch. '${e}.${o}' was found to be type '${typeof s}' but fallback/return type is '${typeof a}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),a??null)}}e._makeFeatureGate=function(e,t,r){return Object.assign(Object.assign({},n(e,t,r,!0===r?.value)),{idType:r?.id_type??null})},e._makeDynamicConfig=i,e._makeExperiment=function(e,t,r){let n=i(e,t,r);return Object.assign(Object.assign({},n),{groupName:r?.group_name??null})},e._makeLayer=function(e,t,r,i){return Object.assign(Object.assign({},n(e,t,r,void 0)),{get:o(e,r?.value,i),groupName:r?.group_name??null,__value:r?.value??{}})},e._mergeOverride=function(e,t,r,n){return Object.assign(Object.assign(Object.assign({},e),t),{get:o(e.name,r,n)})},e._makeTypedGet=o}),Hb=t(e=>
1{Object.defineProperty(e,"__esModule",{value:!0})}),Ub=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.UPDATE_DETAIL_ERROR_MESSAGES=e.createUpdateDetails=void 0,e.createUpdateDetails=(e,t,r,n,i,o)=>({duration:r,source:t,success:e,error:n,sourceUrl:i,warnings:o}),e.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."}}),Wb=t(e=>{var t=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=e&&e.__exportStar||function(e,r){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(r,n)&&t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.Storage=e.Log=e.EventLogger=e.Diagnostics=void 0,Jy();var n=Jy(),i=Yy();Object.defineProperty(e,"Diagnostics",{enumerable:!0,get:function(){return i.Diagnostics}});var o=wb();Object.defineProperty(e,"EventLogger",{enumerable:!0,get:function(){return o.EventLogger}});var a=Q();Object.defineProperty(e,"Log",{enumerable:!0,get:function(){return a.Log}});var s=ib(),l=db();Object.defineProperty(e,"Storage",{enumerable:!0,get:function(){return l.Storage}}),r(Jy(),e),r(tb(),e),r(Tb(),e),r(Ob(),e),r(Yy(),e),r(kb(),e),r(Ab(),e),r(jb(),e),r(Mb(),e),r(eb(),e),r(Nb(),e),r(Q(),e),r(Pb(),e),r(nb(),e),r(yb(),e),r(Fb(),e),r(Ib(),e),r(ab(),e),r(rb(),e),r(hb(),e),r(Lb(),e),r(gb(),e),r(Rb(),e),r(_b(),e),r(zb(),e),r(Sb(),e),r(ib(),e),r(vb(),e),r(Bb(),e),r(Vb(),e),r(Hb(),e),r(Eb(
1),e),r(db(),e),r(Db(),e),r($y(),e),r(Cb(),e),r(mb(),e),r(ob(),e),r(Ub(),e),r(pb(),e),Object.assign((0,n._getStatsigGlobal)(),{Log:a.Log,SDK_VERSION:s.SDK_VERSION})}),Gb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.V1InitializeContainer=void 0;var t=Wb();e.V1InitializeContainer=class{constructor(e){this._values=e}getGate(e){return this._getResultFromLookup(this._values.feature_gates,e)}getConfig(e){return this._getResultFromLookup(this._values.dynamic_configs,e)}getLayer(e){return this._getResultFromLookup(this._values.layer_configs,e)}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,r){return e?e[r]??e[(0,t._DJB2)(r)]??null:null}}}),Kb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.V2InitializeContainer=void 0;var t=Wb();e.V2InitializeContainer=class{constructor(e){this._values=e}getGate(e){let t=this._getResultFromLookup(this._values.feature_gates,e);return t?{name:e,value:!0===t.v,rule_id:t.r??"default",secondary_exposures:t.s??[],id_type:t.i??""}:null}getConfig(e){let t=this._getResultFromLookup(this._values.dynamic_configs,e);return t?{name:e,value:this._values.values[t.v]??{},rule_id:t.r,secondary_exposures:t.s??[],id_type:t.i??"",is_user_in_experiment:!0===t.ue,passed:!0===t.p,group_name:t.gn??void 0,is_experiment_active:!0===t.ea,group:t.r,is_device_based:"stableID"===t.i}:null}getLayer(e){let t=this._getResultFromLookup(this._values.layer_configs,e);return t?{name:e,value:this._values.values[t.v]??{},rule_id:t.r,secondary_exposures:t.s??[],is_user_in_experiment:!0===t.ue,group_name:t.gn??void 0,is_experiment_active:!0===t.ea,group:t.r,is_device_based:"stableID"===t.i,allocated_experiment_name:t.ae??"",explicit_parameters:t.ep??[],undelegated_secondary_exposures:t.us??[],parameter_rule_ids:t.pr}:null}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,r){return e?e[r]??e[(0,t._DJB2)(r)]??null:null}}}),qb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Wb(),r=Gb(),n=Kb();e.default=class{constructor(e,t){this._sdkKey=e,this._options=t,this._valuesForExternalUse=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._valuesForExternalUse=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._valuesForExternalUse}setValues(e,i){if(!e)return!1;let o=(0,t._typedJsonParse)(e.data,"has_updates","EvaluationResponse");return null!=o&&(this._source=e.source,!0!==o?.has_updates||(o.time??0)<this._lcut||(this._valuesForExternalUse=(0,t._typedJsonParse)(e.data,"has_updates","EvaluationResponse"),this._lcut=o.time,this._receivedAt=e.receivedAt,"init-v2"===o.response_format?this._values=new n.V2InitializeContainer(o):this._values=new r.V1InitializeContainer(o),this._bootstrapMetadata=this._extractBootstrapMetadata(e.source,o),e.source&&o.user&&this._setWarningState(i,o),t.SDKFlags.setFlags(this._sdkKey,o.sdk_flags??{})),!0)}getWarnings(){if(0!==this._warnings.size)return Array.from(this._warnings)}getGate(e){let t=this._values?this._values.getGate(e):null;return this._getDetailedStoreResult(t)}getConfig(e){let t=this._values?this._values.getConfig(e):null;return this._getDetailedStoreResult(t)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(e){let t=this._values?this._values.getLayer(e):null;return this._getDetailedStoreResult(t)}getParamStore(e){let t=this._values?this._values.getParamStore(e):null;return this._getDetailedStoreResult(t)}getSource(){return this._source}getExposureMapping(){return this._values?.getExposureMapping()}_extractBootstrapMetadata(e,t){if("Bootstrap"!==e)return null;let r={};return t.user&&(r.user=t.user),t.sdkInfo&&(r.generatorSDKInfo=t.sdkInfo),r.lcut=t.time,r}_getDetailedStoreResult(e){return{result:e,details:this._getDetails(null==e)}}_setWarningState(e,r){let n=t.StableID.get(this._sdkKey);if(e.customIDs?.stableID===n||!e.customIDs?.stableID&&!n){if("user"in r){let n=r.user,i=Object.assign(Object.assign({},e),{analyticsOnlyMetadata:void 0,privateAttributes:void 0});this._options?.disableStableID&&(i=Object.assign(Object.assign({},i),{customIDs:Object.assign(Object.assign({},i.customIDs),{stableID:void 0})}),n=Object.assign(Object.assign({}
1,n),{customIDs:Object.assign(Object.assign({},n.customIDs),{stableID:void 0})})),(0,t._getFullUserHash)(i)!==(0,t._getFullUserHash)(n)&&this._warnings.add("PartialUserMatch")}}else this._warnings.add("StableIDMismatch")}getCurrentSourceDetails(){if("Uninitialized"===this._source||"NoValues"===this._source)return{reason:this._source};let e={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(e.warnings=Array.from(this._warnings)),e}_getDetails(e){let t=this.getCurrentSourceDetails(),r=t.reason,n=t.warnings??[];"Bootstrap"===this._source&&n.length>0&&(r+=n[0]),"Uninitialized"!==r&&"NoValues"!==r&&(r=`${r}:${e?"Unrecognized":"Recognized"}`);let i="Bootstrap"===this._source?this._bootstrapMetadata??void 0:void 0;return i&&(t.bootstrapMetadata=i),Object.assign(Object.assign({},t),{reason:r})}}}),Jb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._resolveDeltasResponse=void 0;var t=Wb();function r(e){let t=e;return n(e.deleted_gates,t.feature_gates),delete t.deleted_gates,n(e.deleted_configs,t.dynamic_configs),delete t.deleted_configs,n(e.deleted_layers,t.layer_configs),delete t.deleted_layers,t}function n(e,t){e?.forEach(e=>{delete t[e]})}e._resolveDeltasResponse=function(e,n){let i=(0,t._typedJsonParse)(n,"checksum","DeltasEvaluationResponse");if(!i)return{hadBadDeltaChecksum:!0};let o=r(function(e,t){return Object.assign(Object.assign(Object.assign({},e),t),{feature_gates:Object.assign(Object.assign({},e.feature_gates),t.feature_gates),layer_configs:Object.assign(Object.assign({},e.layer_configs),t.layer_configs),dynamic_configs:Object.assign(Object.assign({},e.dynamic_configs),t.dynamic_configs)})}(e,i)),a=(0,t._DJB2Object)({feature_gates:o.feature_gates,dynamic_configs:o.dynamic_configs,layer_configs:o.layer_configs},2);return a===i.checksumV2?JSON.stringify(o):{hadBadDeltaChecksum:!0,badChecksum:a,badMergedConfigs:o,badFullResponse:i.deltas_full_response}}}),Yb=t(e=>{var t=e&&e.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||=Promise)(function(r,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){e.done?r(e.value):i(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});var r=Wb(),n=Jb();e.default=class extends r.NetworkCore{constructor(e,t){super(e,t);let n=e?.networkConfig;this._option=e,this._initializeUrlConfig=new r.UrlConfiguration(r.Endpoint._initialize,n?.initializeUrl,n?.api,n?.initializeFallbackUrls)}fetchEvaluations(e,n,i,o,a){return t(this,void 0,void 0,function*(){let t=n?(0,r._typedJsonParse)(n,"has_updates","InitializeResponse"):null,s={user:o,hash:this._option?.networkConfig?.initializeHashAlgorithm??"djb2",deltasResponseRequested:!1,full_checksum:null};if(t?.has_updates){let e=t?.hash_used!==(this._option?.networkConfig?.initializeHashAlgorithm??"djb2");s=Object.assign(Object.assign({},s),{sinceTime:a&&!e?t.time:0,previousDerivedFields:"derived_fields"in t&&a?t.derived_fields:{},deltasResponseRequested:!0,full_checksum:t.full_checksum,partialUserMatchSinceTime:e?0:t.time})}return this._fetchEvaluations(e,t,s,i)})}_fetchEvaluations(e,r,i,o){return t(this,void 0,void 0,function*(){let t=yield this.post({sdkKey:e,urlConfig:this._initializeUrlConfig,data:i,retries:2,isStatsigEncodable:!0,priority:o});if(204===t?.code)return'{"has_updates": false}';if(200!==t?.code)return t?.body??null;if(!0!==r?.has_updates||!0!==t.body?.includes('"is_delta":true')||!0!==i.deltasResponseRequested)return t.body;let a=(0,n._resolveDeltasResponse)(r,t.body);return"string"==typeof a?a:this._fetchEvaluations(e,r,Object.assign(Object.assign(Object.assign({},i),a),{deltasResponseRequested:!1}),o)})}}}),Xb=t(e=>{Object.defineProperty(e,"__esModule",{value:!0}),e._makeParamStoreGetter=void 0;var t=Wb(),r={disableExposureLog:!0};function n(e){return null==e||!1===e.disableExposureLog}function i(e,r){return null!=r&&!(0,t._isTypeMatch)(e,r)}function o(e,t,i){return e.getFeatureGate(t.gate_name,n(i)?void 0:r).value?t.pass_value:t.fail_value}function a(e,t,o,a){let s=e.getDynamicConfig(t.config_name,n(a)?void 0:r).get(t.param_name);return i(s,o)?o:s}function s(e,t,o,a){let s=e.getExperiment(t.experiment_name,n(a)?void 0:r).get(t.param_name);return i(s,o)?o:s}function l(e,t,o,a){let s=e.getLayer(t.layer_name,n(a)?void 0:r).get(t.param_name);return i(s,o)?o:s}e._makeParamStoreGetter=function(e,r,n){return(i,u)=>{if(null==r)return u;let c=r[i];if(null==c||null!=u&&(0,t._typeOf)(u)!==c.param_type)return u;switch(c.ref_type){case"static":return function(e){return e.value}(c);case"gate":return o(e,c,n);case"dynamic_config":return a(e,c,u,n);case"experiment":return s(e,c,u,n);case"layer":return l(e,c,u,n);default:return u}}}}),Zb=t(e=>{var t=e&&e.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||=Promise)(function(r,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){e.done?r(e.value):i(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())})};
1Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigEvaluationsDataAdapter=void 0;var r=Wb(),n=Yb();e.StatsigEvaluationsDataAdapter=class extends r.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(e,t,r){super.attach(e,t,r),null!==r&&r instanceof n.default?this._network=r:this._network=new n.default(t??{})}getDataAsync(e,t,n){return this._getDataAsyncImpl(e,(0,r._normalizeUser)(t,this._options),n)}prefetchData(e,t){return this._prefetchDataImpl(e,t)}setData(e){let t=(0,r._typedJsonParse)(e,"has_updates","data");t&&"user"in t?super.setData(e,t.user):r.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(e,t){super.setData(e,t)}_fetchFromNetwork(e,r,n,i){return t(this,void 0,void 0,function*(){return(yield this._network?.fetchEvaluations(this._getSdkKey(),e,n?.priority,r,i))??null})}_getCacheKey(e){let t=(0,r._getStorageKey)(this._getSdkKey(),e,this._options?.customUserCacheKeyFunc);return`${r.DataAdapterCachePrefix}.${this._cacheSuffix}.${t}`}_isCachedResultValidFor204(e,t){return null!=e.fullUserHash&&e.fullUserHash===(0,r._getFullUserHash)(t)}}}),Qb=t(e=>{var t=e&&e.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||=Promise)(function(r,o){function a(e){try{l(n.next(e))}catch(e){o(e)}}function s(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){e.done?r(e.value):i(e.value).then(a,s)}l((n=n.apply(e,t||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});var r=Wb(),n=qb(),i=Yb(),o=Xb(),a=Zb();e.default=class e extends r.StatsigClientBase{static instance(t){let n=(0,r._getStatsigGlobal)().instance(t);return n instanceof e?n:(r.Log.warn((0,r._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new e(t??"",{}))}constructor(e,t,o=null){r.SDKType._setClientType(e,"javascript-client");let s=new i.default(o,e=>{this.$emt(e)});super(e,o?.dataAdapter??new a.StatsigEvaluationsDataAdapter,s,o),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(r.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(r.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(r.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(r.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(r.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(r.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new n.default(e,o??null),this._network=s,this._user=this._configureUser(t,o),this._sdkInstanceID=(0,r.getUUID)(),this._contextHandle=new r.PrecomputedEvaluationsContextHandle(e,()=>this._options,()=>this._errorBoundary,()=>this._store.getValues(),()=>this._user,()=>this._sdkInstanceID);let l=o?.plugins??[];for(let e of l)e.bind(this)}initializeSync(e){return"Uninitialized"===this.loadingStatus?(this._logger.start(),this.updateUserSync(this._user,e)):(0,r.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...this._store.getWarnings()??[]])}initializeAsync(e){return t(this,void 0,void 0,function*(){return this._initializePromise||=this._initializeAsyncImpl(e),this._initializePromise})}updateUserSync(e,t){let r=performance.now();try{return this._updateUserSyncImpl(e,t,r)}catch(e){let t=e instanceof Error?e:Error(String(e));return this._createErrorUpdateDetails(t,r)}}_updateUserSyncImpl(e,t,n){let i=[...this._store.getWarnings()??[]];this._resetForUser(e);let o=this.dataAdapter.getDataSync(this._user);o??i.push("NoCachedValues"),this._store.setValues(o,this._user),this._finalizeUpdate(o);let a=t?.disableBackgroundCacheRefresh;return!0===a||null==a&&"Bootstrap"===o?.source||this._runPostUpdate(o??null,this._user),(0,r.createUpdateDetails)(!0,this._store.getSource(),performance.now()-n,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),i)}updateUserAsync(e,r){return t(this,void 0,void 0,function*(){let t=performance.now();try{return yield this._updateUserAsyncImpl(e,r)}catch(e){let r=e instanceof Error?e:Error(String(e));return this._createErrorUpdateDetails(r,t)}})}_updateUserAsyncImpl(e,n){return t(this,void 0,void 0,function*(){this._resetForUser(e);let t=this._user;r.Diagnostics._markInitOverallStart(this._sdkKey);let i=this.dataAdapter.getDataSync(t);if(this._store.setValues(i,this._user),this._setStatus("Loading",i
1),i=yield this.dataAdapter.getDataAsync(i,t,n),t!==this._user)return(0,r.createUpdateDetails)(!1,this._store.getSource(),-1,Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let o=!1;null!=i&&(r.Diagnostics._markInitProcessStart(this._sdkKey),o=this._store.setValues(i,this._user),r.Diagnostics._markInitProcessEnd(this._sdkKey,{success:o})),this._finalizeUpdate(i),o||(this._errorBoundary.attachErrorIfNoneExists(r.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),r.Diagnostics._markInitOverallEnd(this._sdkKey,o,this._store.getCurrentSourceDetails());let a=r.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,r.createUpdateDetails)(o,this._store.getSource(),a,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){let e=(0,r._cloneObject)("StatsigUser",this._user);return e??=(r.Log.error("Failed to clone user"),{}),{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:e,errorBoundary:this._errorBoundary,session:r.StatsigSession.get(this._sdkKey),stableID:r.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}getContextHandle(){return this._contextHandle}checkGate(e,t){return this.getFeatureGate(e,t).value}logEvent(e,t,r){let n="string"==typeof e?{eventName:e,value:t,metadata:r}:e;this.$emt({name:"log_event_called",event:n}),this._logger.enqueue(Object.assign(Object.assign({},n),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(e){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:e}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this._finalizeUpdate(null)})}_initializeAsyncImpl(e){return t(this,void 0,void 0,function*(){return r.Storage.isReady()||(yield r.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,e)})}_createErrorUpdateDetails(e,t){return(0,r.createUpdateDetails)(!1,this._store.getSource(),performance.now()-t,e,null,[...this._store.getWarnings()??[]])}_finalizeUpdate(e){this._store.finalize(),this._setStatus("Ready",e)}_runPostUpdate(e,t){this.dataAdapter.getDataAsync(e,t,{priority:"low"}).catch(e=>{r.Log.error("An error occurred after update.",e)})}_resetForUser(e){this._logger.reset(),this._store.reset(),this._user=this._configureUser(e,this._options)}_configureUser(e,t){var n;let i=(0,r._normalizeUser)(e,t),o=i.customIDs?.stableID;if(o){let e=(n=this.storageProvider).isReadyResolver?.call(n);e?e.then(()=>r.StableID.setOverride(o,this._sdkKey),()=>r.StableID.setOverride(o,this._sdkKey)):r.StableID.setOverride(o,this._sdkKey)}return Object.keys(this._possibleFirstTouchMetadata).length>0&&(i.analyticsOnlyMetadata=Object.assign(Object.assign({},i.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),i}_getFeatureGateImpl(e,t){var n;let{result:i,details:o}=this._store.getGate(e);this._checkUserHasIdForEvaluation(i?.id_type,e,"Gate"),this._checkInitializationStatus(o.reason);let a=(0,r._makeFeatureGate)(e,o,i),s=((n=this.overrideAdapter)?.getGateOverride)?.call(n,a,this._user,t)??a;return this._enqueueExposure(e,(0,r._createGateExposure)(this._user,s,this._store.getExposureMapping()),t),this.$emt({name:"gate_evaluation",gate:s}),s}_getDynamicConfigImpl(e,t){var n;let{result:i,details:o}=this._store.getConfig(e);this._checkUserHasIdForEvaluation(i?.id_type,e,"Dynamic config"),this._checkInitializationStatus(o.reason);let a=(0,r._makeDynamicConfig)(e,o,i),s=((n=this.overrideAdapter)?.getDynamicConfigOverride)?.call(n,a,this._user,t)??a;return this._enqueueExposure(e,(0,r._createConfigExposure)(this._user,s,this._store.getExposureMapping()),t),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:s}),s}_getExperimentImpl(e,t){var n;let{result:i,details:o}=this._store.getConfig(e);this._checkUserHasIdForEvaluation(i?.id_type,e,"Experiment"),this._checkInitializationStatus(o.reason);let a=(0,r._makeExperiment)(e,o,i);null!=a.__evaluation&&(a.__evaluation.secondary_exposures=(0,r._mapExposures)(a.__evaluation?.secondary_exposures??[],this._store.getExposureMapping()));let s=((n=this.overrideAdapter)?.getExperimentOverride)?.call(n,a,this._user,t)??a;return this._enqueueExposure(e,(0,r._createConfigExposure)(this._user,s,this._store.getExposureMapping()),t),this.$emt({name:"experiment_evaluation",experiment:s}),s}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(e,t){var n;let{result:i,details:o}=this._store.getLayer(e),a=(0,r._makeLayer)(e,o,i),s=((n=this.overrideAdapter)?.getLayerOverride)?.call(n,a,this._user,t);t?.disableExposureLog&&this._logger.incrementNonExposureCount(e);let l=(0,r._mergeOverride)(a,s,s?.__value??a.__value,n=>{t?.disableExposureLog||this._enqueueExposure(e,(0,r._createLayerParameterExposure)(this._user,l,n,this._store.getExposureMapping()),t)}
1);return this.$emt({name:"layer_evaluation",layer:l}),l}_getParameterStoreImpl(e,t){var r;let{result:n,details:i}=this._store.getParamStore(e);this._logger.incrementNonExposureCount(e);let a={name:e,details:i,__configuration:n,get:(0,o._makeParamStoreGetter)(this,n,t)},s=((r=this.overrideAdapter)?.getParamStoreOverride)?.call(r,a,t);return null!=s&&(a.__configuration=s.config,a.details=s.details,a.get=(0,o._makeParamStoreGetter)(this,s.config,t)),a}_checkUserHasIdForEvaluation(e,t,n){e&&((0,r._getUnitIDFromUser)(this._user,e)||r.Log.warn(`The user does not have the required id_type "${e}" for ${n} "${t}"`))}_checkInitializationStatus(e){("Uninitialized"===e||e.startsWith("Loading"))&&r.Log.warn(`SDK initialization has not completed. Reason: ${e}`)}}}),$b=t(e=>{var t=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=e&&e.__exportStar||function(e,r){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(r,n)&&t(r,e,n)};Object.defineProperty(e,"__esModule",{value:!0}),e.StatsigClient=void 0;var n=Wb(),i=Qb();e.StatsigClient=i.default,r(Wb(),e),e.default=Object.assign((0,n._getStatsigGlobal)(),{StatsigClient:i.default})}),$=[];for(let e=0;e<256;++e)$.push((e+256).toString(16).slice(1));function ex(e,t=0){return($[e[t+0]]+$[e[t+1]]+$[e[t+2]]+$[e[t+3]]+"-"+$[e[t+4]]+$[e[t+5]]+"-"+$[e[t+6]]+$[e[t+7]]+"-"+$[e[t+8]]+$[e[t+9]]+"-"+$[e[t+10]]+$[e[t+11]]+$[e[t+12]]+$[e[t+13]]+$[e[t+14]]+$[e[t+15]]).toLowerCase()}var tx,nx=new Uint8Array(16);function rx(){if(!tx){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");tx=crypto.getRandomValues.bind(crypto)}return tx(nx)}var ix={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function ax(e,t,r){e||={};let n=e.random??e.rng?.()??rx();if(n.length<16)throw Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){if(r||=0,r<0||r+16>t.length)throw RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[r+e]=n[e];return t}return ex(n)}function ox(e,t,r){return!ix.randomUUID||t||e?ax(e,t,r):ix.randomUUID()}var sx=$b();function cx(){return typeof window<"u"&&window.crypto?.randomUUID?window.crypto.randomUUID():ox()}var lx={gclid:"utm_gclid",fbclid:"utm_fbclid",msclid:"utm_msclid",ttclid:"utm_ttclid",irclickid:"utm_irclickid"},ux=new Set(["utm_set_at","utm_set_by"]);function dx(e,t=lx,r=ux){let n=e.get("ref");if(n)return{ref:n,utm_medium:"product_features",utm_source:"share_earn"};let i={};for(let[t,n]of e.entries())n&&t.startsWith("utm_")&&!r.has(t)&&(i[t]=n);for(let[r,n]of Object.entries(t)){if(i[n])continue;let t=e.get(r);t&&(i[n]=t)}return i}function fx(e){return"ref"===e||e.startsWith("utm_")}function px(e,t){let r=Object.fromEntries(Object.entries(e??{}).filter(([e])=>!fx(e))),n=Object.fromEntries(Object.entries(t).filter(([e])=>!ux.has(e)));return{...r,...n}}var mx=["ref","utm_source","utm_campaign","utm_medium","utm_term","utm_content","utm_id","utm_source_platform","utm_campaign_id","utm_creative_format","utm_marketing_tactic","utm_matchtype","utm_campaignid","utm_keyword","utm_creative","utm_device","utm_placement","utm_email","utm_section","utm_usr","utm_fbp",...Object.values(lx)];function hx(){return dx(new URLSearchParams(window.location.search))}function gx(){return x("utm").get()}function _x(e){return Object.fromEntries((e??[]).map(({key:e,value:t})=>[e,t]))}function vx(e){return Object.fromEntries(Object.entries(e).filter(([e])=>!ux.has(e)))}function yx(e,t){x("utm").set({...e,utm_set_at:(new Date).toISOString(),utm_set_by:t})}function bx(){try{let e=gx();return e?Object.entries(vx(e)).map(([e,t])=>({key:e,value:t})):[]}catch{return[]}}var xx="faye-statsig-init",Sx="_ssui",Cx="_ssi",wx=2500,Tx={initialized:!1,userChangedSincePageLoad:!1};function Ex(){try{let e=hx();return Object.keys(e).length?e:gx()??{}}catch{return{}}}function Dx(){let e=_(Cx);return e||(e=cx(),y(Cx,e)),e}function Ox(e){try{let t=atob(decodeURIComponent(e)),r=Uint8Array.from(t,e=>e.charCodeAt(0));try{let e=new TextDecoder("utf-8",{fatal:!0}).decode(r);return JSON.parse(e)}catch{return JSON.parse(t)}}catch{return null}}function kx(e){let t=JSON.stringify(e),r=(new TextEncoder).encode(t),n=Array.from(r,e=>String.fromCharCode(e)).join("");return btoa(n)}function Ax(){let e=_(Sx),t=Dx(),r={};e&&(r=Ox(e)??{}),r?.customIDs?.stableID||(r.customIDs={stableID:t,...r.customIDs});let n=Ex();return Object.keys(n).length&&(r.custom=px(r.custom,n)),r}function jx(){return document.getElementById(xx)?.textContent?.trim()||window.__FAYE_STATSIG_
1CLIENT_INIT__||""}function Mx(e){if(!e||"null"===e)return!1;try{let t=JSON.parse(e);return"object"==typeof t&&!!t&&"feature_gates"in t}catch{return!1}}function Nx(e,t){if(!t)return e;try{let r=JSON.parse(t),n=r.user?.userAgent??null,i=r.user?.ip??null;return n||i?{...e,...n&&{userAgent:n},...i&&{ip:i}}:e}catch{return e}}async function Px(e,t){try{let r=await fetch(`/api/statsig-bootstrap${window.location.search}`),n=r.ok?await r.text():"";if(Tx.userChangedSincePageLoad)return;if(Mx(n))return e.dataAdapter.setData(n),void e.updateUserSync(Nx(t,n))}catch{}if(!Tx.userChangedSincePageLoad)try{let r=await e.updateUserAsync(t);!r.success&&"User changed during update"!==r.error?.message&&Ov(r.error??Error("Statsig bootstrap hydration failed"),{name:"statsig-bootstrap-hydrate",context:{source:r.source,duration:r.duration}})}catch(e){Ov(e,{name:"statsig-bootstrap-hydrate"})}}function Fx(){if(window.__fayeStatsigClient)return window.__fayeStatsigClient;if(!Tx.initialized){let e=jx(),t=Nx(Ax(),e),r=new sx.StatsigClient("client-FoZYxyyDg6jOaMAM10R4mexddFOmX84xXLlXIuPqcGR",t,{environment:{tier:"production"}});e?(r.dataAdapter.setData(e),r.initializeSync()):(r.initializeSync(),Px(r,t)),window.__fayeStatsigClient=r,Tx.initialized=!0}return sx.StatsigClient.instance()}async function Ix(e,t={}){try{let r=Fx();Tx.userChangedSincePageLoad=!0;let n=r.getContext().user??{},i={...n,...e,customIDs:{...n.customIDs,...e.customIDs},custom:t.replaceCustom?e.custom:{...n.custom,...e.custom}},{userAgent:o,ip:a,...s}=i;y(Sx,kx(s));let l=await r.updateUserAsync(i,{timeoutMs:wx});return!!l.success||("User changed during update"!==l.error?.message&&Ov(l.error??Error("Statsig user update failed"),{name:"statsig-user-update",context:{source:l.source,duration:l.duration}}),!1)}catch(e){return Ov(e,{name:"statsig-user-update"}),!1}}function Lx(e,t=!1){try{return Fx().checkGate(e,t?{disableExposureLog:!0}:void 0)}catch(e){return console.error(e),!1}}function Rx(e,t={}){let r=t.limit??50,n=[],i=new Set,o=t.reporter,a=!1,s=t=>{o?o(`${e}: ${t}`,{label:e,limit:r}):console.error(`[analytics] ${e}: ${t}`)},l=e=>{i.has(e)||(i.add(e),s(e))};return{enqueue:e=>n.length>=r?(l("pending queue overflow"),!1):(n.push(e),!0),flush:e=>{if(a)return!1;a=!0;let t=!1;try{let t=n.length;for(let r=0;r<t&&!1!==e(n[0]);r++)n.shift();n.length<r&&i.delete("pending queue overflow")}catch{t=!0}return a=!1,t&&l("pending queue delivery failed"),0===n.length},setReporter:e=>{o=e,i.forEach(s)}}}function zx(e,t){if(!t)return e.flush(()=>!1);let r=t;return t.has_opted_out_tracking()?e.flush(function(){return!0}):e.flush(function(e){return"register"===e.kind?r.register(e.dict,e.daysOrOptions):!1!==r.track(e.eventName,{...e.properties,queued_for_ms:Date.now()-e.queuedAt},e.optionsOrCallback)&&(e.onDelivered?.(),!0)})}var Bx="mixpanel:ready",Vx=()=>typeof window<"u";function Hx(){if(Vx())return window.__fayeMixpanel}var Ux=Vx()&&window.__fayeEarlyAnalytics?.mixpanelQueue||Rx("mixpanel");function Wx(e){return Ux.enqueue(e)}function Gx(e,t,r,n){try{return!1!==e.track(t,r,n)}catch(e){return Dv("mixpanel: track failed",{eventName:t},e),!1}}function Kx(e,t,r){try{return e.register(t,r),!0}catch(e){return Dv("mixpanel: register failed",{},e),!1}}function qx(){return zx(Ux,Hx())}function Jx({...e}={}){if(!e.$insert_id){let t=window.crypto?.randomUUID?.();t&&(e.$insert_id=t)}return e}function Yx(e,t,r,n){if(mr(e,t),r){let e=Hx();e?Kx(e,t,n):Wx({kind:"register",dict:t,daysOrOptions:n})}}function Xx(e,t={},r,n){let i={local_time:(new Date).toLocaleString("en-US",{hour12:!1}),...Jx(t)},o=Hx();if(o&&"function"==typeof o.track&&Gx(o,e,i,r))return n?.(),!0;let a=Date.now();return Wx({kind:"track",eventName:e,queuedAt:a,onDelivered:n,properties:{...i,time:i.time??a/1e3,was_queued:!0},optionsOrCallback:r})}function Zx(e,t="base"){mr(t,e),Qx(e)}function Qx(e){let t=Hx();t?Kx(t,e):Wx({kind:"register",dict:e})}function $x(e,t="base"){let r=x("mixpanelProperties"),n=r.get()||{},i={...n?.[t]||{}};if(void 0!==i[e]){let{[e]:o,...a}=i;r.set({...n,[t]:a})}let o=Hx();o&&o.persistence?.load_prop&&void 0!==o.get_property(e)&&o.unregister(e)}function eS(e){let t=Hx();t&&e&&t.people.set(e)}function tS(){let e=Hx();if(!e)return;let t=gx();if(!t)return;let r=e.get_property?.("utm_set_at");if(!t.utm_set_at||t.utm_set_at!==r){e.people?.unset(mx,()=>{e.people?.set(t)});for(let t of mx)e.unregister(t),e.unregister(t,{persistent:!1});e.register(t,{persistent:!1}),["bd-traveladvisors","bd-hospitality"].includes(t.utm_medium)&&(t.utm_campaign&&e.set_group("advisor",t.utm_campaign),t.utm_source&&e.set_group("agency",t.utm_source))}}function nS(e){Hx()&&Yx("base",{state_of_residence:e},!0)}function rS(e){Hx()&&Yx("base",{plan_name:e},!0,{persistent:!1})}function iS(e){Hx()&&Yx("base",{segment:e},!0,{persistent:!1})}function aS(){let e=Hx();if(!e)return;let t=pr(),r={...t.base,...t.experiments};Object.keys(r).length>0&&e.register(r),tS()}function oS(e){return e.trim().toLowerCase()}function sS(){let e=x("funnelState").get();return e?.identifiedEmail?oS(e.identifiedEmail):null}function cS(e){let t=x("funnelState"),r=t.get()??{};t.set({...r,identifiedEmail:oS(e)})}function lS(e){let t=Hx();if(!t)return;let r=oS(e),n=sS();n!==r&&(n?(t.reset(),aS(),t.alias(r,n),t.register({distinct_id:r,$user_id:r})):t.identify(r),cS(r))}function uS(e,t){let{email:r,firstName:n,lastName:i,dateOfBirth:o,travelersCount:a}=e;if(sS()===oS(r))return void t?.();if(lS(r),Ix({userID:r,email:r}),eS({$email:r,...n&&{$first_name:n},...i&&{$last_name:i},...null!=o&&{date_of_birth:o},...null!=a&&{total_travelers_count:a}}),jv({email:r,...n&&i&&{name:`${n} ${i}`}}),qy({email:r,dataFields:{...n&&{$first_name:n},...i&&{$last_name:i},$email:r}}),!t)return;let s=Hx();if(!s)return void t();let l=!1,u=()=>{l||(l=!0,t())};setTimeout(u,3e3),s.track("$identify_confirmed",{},u)}function dS(e,t,r,n){if(typeof window>"u")return!1;let i=window.__fayeAnalyticsEventCaches??={},{uniqueKeys:o,debounceTimers:a}=i[e]??={uniqueKeys:new Set,debounceTimers:new Map},s=()=>
1{if(r?.bustCacheFn){let e=r.bustCacheFn();"function"==typeof e?e(o):e&&o.delete(e)}let e=r?.onceWithUniqueKey;if(e&&o.has(e))return!0;e&&o.add(e);try{let t=!1!==n();return!t&&e&&o.delete(e),t}catch(t){throw e&&o.delete(e),t}};if(r?.debounce){let e=a.get(t);return e&&clearTimeout(e),a.set(t,setTimeout(s,r.debounce)),!0}return s()}function fS(e,t,r,n){let i=!0;for(let o of r)if(o in n)try{!1===n[o](e,t)&&(i=!1)}catch(e){i=!1,console.error(`[analytics] ${o}: delivery failed`,e)}return i}function pS(e){let t=Date.now();return{$insert_id:globalThis.crypto?.randomUUID?.()??`${t}-${Math.random()}`,time:t/1e3,local_time:new Date(t).toLocaleString("en-US",{hour12:!1}),...e}}function mS({groupName:e,ruleId:t}){return null!==e&&!t.includes("override")&&!t.includes("launchedGroup")}function hS(e,t){let r=e.getExperiment(t,{disableExposureLog:!0});return r.ruleID&&r.groupName&&mS({ruleId:r.ruleID,groupName:r.groupName})?r:null}function gS(e){let t=e.getContext();return t.user.customIDs?.stableID??t.stableID}function _S(e,t,r){let{name:n,groupName:i}=t;!i||!r||dS("experiment","Experiment Allocated",{onceWithUniqueKey:SS("allocated",t,r)},()=>{let o={[n]:i};return e.featureFlag(n,i),e.register(o),pr().experiments?.[t.name]===t.groupName||e.track("Experiment Allocated",xS(t,r),{eventType:"experiment",onDelivered:()=>mr("experiments",o)})})}function vS(e,t,r,n={}){return!!r&&e.track("Experiment Viewed",{...n,...bS(t,r)},{eventType:"experiment",event:{onceWithUniqueKey:SS("viewed",t,r)}})}function yS(e,t){let r=gS(e);r&&dS("experiment","Statsig Experiment Exposure",{onceWithUniqueKey:SS("exposed",t,r)},()=>e.getExperiment(t.name))}function bS(e,t){return{event_type:"experiment",experiment_name:e.name,experiment_variant:e.groupName,experiment_stable_id:t}}function xS(e,t){return{event_type:"experiment",experiment_name:e.name,experiment_variant:e.groupName,experiment_stable_id:t,experiment_data:{name:e.name,ruleID:e.ruleID,groupName:e.groupName,value:e.value},[e.name]:e.groupName}}function SS(e,t,r){return`${e}:${r}:${t.name}:${t.ruleID}:${t.groupName}`}function CS(){if(typeof performance>"u")return null;let e=performance.getEntriesByType("navigation")[0];return e?e.type:null}function wS(e,t){let r=e||"/";try{let r=t??ES();return TS(new URL(e,r).pathname||"/")}catch{return r.startsWith("/")?TS(r):r}}Ux.setReporter(Dv),Vx()&&(window.addEventListener(Bx,qx,{once:!0}),qx());var TS=e=>"/"===e?e:e.replace(/\/+$/g,""),ES=()=>typeof window<"u"?window.location.origin:"http://local",DS=["mixpanel","gtm","datadog"],OS=null;function kS(){if(typeof window<"u")return window.__fayeEarlyAnalytics}var AS=kS()?.datadogQueue??Rx("datadog",{reporter:Dv});function jS({kind:e,name:t,properties:r}){OS??=a(()=>Promise.resolve().then(()=>Ev),void 0),OS.then(({datadogTrackAction:n,datadogAddFeatureFlag:i})=>{"flag"===e?i(t,String(r.variant)):n(t,r)}).catch(e=>{Dv("datadog: action delivery failed",{eventName:t},e)})}function MS(){window.__fayeEarlyAnalytics&&(window.__fayeEarlyAnalytics.deliverDatadog=jS),AS.flush(jS)}function NS(e,t){if(!(typeof window>"u")){if(!window.__fayeDatadogReady)return void AS.enqueue({kind:"action",name:e,properties:t});jS({kind:"action",name:e,properties:t})}}function PS(e,t){let r={kind:"flag",name:e,properties:{variant:t}};typeof window>"u"||(window.__fayeDatadogReady?jS(r):AS.enqueue(r))}AS.setReporter(Dv);var FS=["/privacy-policy","/terms-and-conditions","/travel-care-terms-and-conditions","/additional-disclosures","/partnership-terms"],IS={"/quote/onboarding":"Landing Onboarding","/quote/destination":"Destinations","/quote/dates":"Dates","/quote/state":"State","/quote/travelers":"Travelers","/quote/offer":"Offer","/quote/checkout":"Checkout","/quote/confirmation":"Summary","/quote/coming-soon":"coming soon"};function LS(e){if(!e||"/"===e)return"Home";let t=IS[e];if(t)return t;let r=e.replace(/^\/+/,"");return r?`${r.charAt(0).toUpperCase()}${r.slice(1)}`:"Home"}var RS="/lps/";function zS(e){return wS(e).startsWith(RS)}function BS(e){if(typeof window>"u"&&!e)return{name_of_page:"Unknown",page_type:"content"};let t=wS(e??window.location.pathname??"/"),r=FS.some(e=>t===e||t.startsWith(`${e}/`))?"content":"public pages";return{name_of_page:t.startsWith(RS)?t.slice(5):LS(t),page_type:r,url_path:"/"===t?"homepage":t.slice(1)}}function VS(e){return new Set(e?.destinations??e?.endpoints??DS)}function HS(e,t){if(typeof window>"u")return t;let r=BS(),n={...t};return!("name_of_page"in n)&&r.name_of_page&&(n.name_of_page=r.name_of_page),!("page_type"in n)&&r.page_type&&(n.page_type=r.page_type),"page view"===e&&"public pages"===r.page_type&&r.url_path&&!("url_path"in n)&&(n.url_path=r.url_path),r.step&&!("step"in n)&&(n.step=r.step),"interaction"===e&&(!("interaction_text"in n)||null==n.interaction_text)&&(n.interaction_text=""),n}function US(e,t={},r={}){let n=BS(),i=e&&e.startsWith("/")?LS(e):e,o=String(i??n.name_of_page??"Unknown").trim(),a=o,s=`View ${o} Page`,l=CS();WS(s,{name_of_page:a,page_type:n.page_type,...n.step&&!("step"in t)?{step:n.step}:{},...n.url_path&&!("url_path"in t)?{url_path:n.url_path}:{},...l?{navigation_type:l}:{},...t},{...r,eventType:"page view",event:{onceWithUniqueKey:`page_view_${o}`,bustCacheFn:()=>e=>{e.forEach(t=>{t!==`page_view_${o}`&&t.startsWith("page_view_")&&e.delete(t)})}}}),dr("page_view",{page_location:typeof window<"u"?window.location.pathname:"/",page_title:o})}function WS(e,t={},r={}){let n=VS(r),i=r.eventType,o=i?HS(i,t):t,a=pS(i?{event_type:i,...o}:{...o}),s=gr(a),l=a,u=()=>{let i=fS(e,s,n,{mixpanel:()=>Xx(e,l,r.sendBeacon?{transport:"sendBeacon"}:{},r.onDelivered),gtm:dr,datadog:NS});if(n.has("iterable")){let r="string"==typeof t.email?t.email:"string"==typeof t.$email?t.$email:null;if(!r)try{r=(x("funnelState").get()?.tripInput??{}).email||null}catch{}r&&Ky({email:r,eventName:e,dataFields:{...s}})}return i};return i?dS(i,e,r.event,u):u()}function GS(e,t){_S({register:Qx,featureFlag:PS,track:(e,t,r)=>WS(e,t,{...r,eventType:"experiment",sendBeacon:!0})},e,t)}var KS={track:WS,pageView:US,register:Zx,registerExperiment:GS,unregister:$x,featureFlag:PS};function qS(e,t,r){let n={interaction_type:"link",interaction_text:e,interaction_region:t,component_name:"body_navigation"===t?"page content":"site navigation"},i=[{eventName:"Click Navigation Link",properties:{...n,..."body_navigation"!==t&&{header_navigation:"link"}}}],o=r.includes("privacy-policy")?"Click Privacy Policy":r.includes("terms-and-conditions")?"Click Terms of Use Link":null;return o&&i.push({eventName:o,properties:n}),i}function JS(e,t){KS.track("Click Navigation Link",qS(e,t,"")[0].properties,{eventType:"interaction",sendBeacon:!0})}function YS(){KS.track("Click Navigation Link",{interaction_type:"link",interaction_text:"",interaction_region:"browser",header_navigation:"browser_native",component_name:"site navigation"},{eventType:"interaction"})}function XS(e,t){e.addEventListener("click",r=>ZS(r,e,t))}function ZS(e,t,r){if(!(e.target instanceof Element))return;let n=e.target.closest("a[href]");if(!n||!t.contains(n))return;let i=(n.getAttribute("aria-label")??n.innerText).trim(),o=n.getAttribute("href")??"",a=window.__fayeEarlyAn
1alytics?.capturedClicks.get(e);for(let e of qS(i,r,o))KS.track(e.eventName,e.properties,{eventType:"interaction",sendBeacon:!0,...a?.has(e.eventName)?{destinations:["gtm","datadog"]}:{}});dr("navigation_click",{item:i,section:r})}function QS(e,t){if(!e.matches('a[href^="/quote/destination"]'))return;let r=e.closest("[data-onboarding-region]");if(!r)return;let n=e.closest("[data-onboarding-card]")?.getAttribute("data-onboarding-card");return{eventName:"Click Start Onboarding",properties:{interaction_type:"button",interaction_text:e.innerText.trim(),interaction_region:r.getAttribute("data-onboarding-region")??"",...n&&{component_name:n},name_of_page:t,page_type:"landing page"}}}function $S(e){document.addEventListener("click",function(t){if(!(t.target instanceof Element))return;let r=t.target.closest("a[href]");if(!r)return;let n=QS(r,e);if(!n)return;let i=window.__fayeEarlyAnalytics?.capturedClicks.get(t);KS.track(n.eventName,n.properties,{eventType:"interaction",sendBeacon:!0,...i?.has(n.eventName)?{destinations:["gtm","datadog"]}:{}}),dr("cta_click",{section:n.properties.interaction_region})})}export{_p as $,T as $t,hx as A,Qo as At,Ov as B,j as Bt,tS as C,bc as Ct,Fx as D,Bs as Dt,Lx as E,Gs as Et,yx as F,Vi as Ft,W_ as G,I as Gt,wv as H,F as Ht,px as I,wi as It,sg as J,k as Jt,V_ as K,P as Kt,cx as L,_i as Lt,bx as M,So as Mt,vx as N,Eo as Nt,Dx as O,V as Ot,_x as P,z as Pt,hp as Q,E as Qt,Ky as R,L as Rt,nS as S,wc as St,Bx as T,pc as Tt,U_ as U,ri as Ut,jv as V,ii as Vt,H_ as W,ei as Wt,ng as X,D as Xt,ag as Y,O as Yt,rg as Z,Hr as Zt,lS as _,wu as _t,KS as a,nt as an,X as at,rS as b,Kc as bt,zS as c,Qe as cn,Y as ct,gS as d,s as dn,Ef as dt,ur as en,Sp as et,hS as f,o as fn,Cf as ft,qx as g,wd as gt,mS as h,qd as ht,JS as i,cr as in,fp as it,gx as 
1j,$o as jt,Ix as k,js as kt,WS as l,x as ln,Df as lt,vS as m,Tf as mt,XS as n,fr as nn,yp as nt,MS as o,tt as on,lp as ot,yS as p,a as pn,wf as pt,R_ as q,A as qt,YS as r,lr as rn,vp as rt,BS as s,rt as sn,up as st,$S as t,dr as tn,gp as tt,wS as u,g as un,Of as ut,uS as v,Wl as vt,eS as w,vc as wt,iS as x,Yc as xt,Zx as y,al as yt,qy as z,ui as zt};

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