harperdb 4.7.0-alpha.7 → 4.7.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -285,7 +285,7 @@ function B3(e,t){for(var n=0;n<t.length;n++){const o=t[n];if(typeof o!="string"&
285
285
  ${g}`,x=>{n.notifyAfterAddMessage(x-v)})}function d(g){return g!==void 0&&r[g]!==void 0}function f(g){const v=r[g];delete r[g];const b=e.estimateEncodedBytesCount(v);n.notifyAfterRemoveMessage(b)}function m(g,v){const b=du(g),x=e.estimateEncodedBytesCount(b);if(x>=o){pt.warn(`Discarded a message whose size was bigger than the maximum allowed size ${o}KB. ${vS} ${gq}/#technical-limitations`);return}d(v)&&f(v),l(b,x,v)}function p(g){const v=VI(r).join(`
286
286
  `);r={};const b=V7(g.reason),x=b?t.sendOnExit:t.send;if(b&&e.isAsync){const S=e.finishSync();S.outputBytesCount&&x(OT(S));const C=[S.pendingData,v].filter(Boolean).join(`
287
287
  `);C&&x({data:C,bytesCount:II(C)})}else v&&e.write(e.isEmpty?v:`
288
- ${v}`),e.finish(S=>{x(OT(S))})}return{flushController:n,add:m,upsert:m,stop:i.unsubscribe}}function OT(e){let t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}function p$({messagesLimit:e,bytesLimit:t,durationLimit:n,pageMayExitObservable:o,sessionExpireObservable:r}){const i=o.subscribe(x=>p(x.reason)),l=r.subscribe(()=>p("session_expire")),d=new _t(()=>()=>{i.unsubscribe(),l.unsubscribe()});let f=0,m=0;function p(x){if(m===0)return;const S=m,C=f;m=0,f=0,b(),d.notify({reason:x,messagesCount:S,bytesCount:C})}let g;function v(){g===void 0&&(g=sr(()=>{p("duration_limit")},n))}function b(){Co(g),g=void 0}return{flushObservable:d,get messagesCount(){return m},notifyBeforeAddMessage(x){f+x>=t&&p("bytes_limit"),m+=1,f+=x,v()},notifyAfterAddMessage(x=0){f+=x,m>=e?p("messages_limit"):f>=t&&p("bytes_limit")},notifyAfterRemoveMessage(x){f-=x,m-=1,m===0&&b()}}}const Ks="DISCARDED",oo="SKIPPED";function B7(){const e={};return{register(t,n){return e[t]||(e[t]=[]),e[t].push(n),{unregister:()=>{e[t]=e[t].filter(o=>o!==n)}}},triggerHook(t,n){const o=e[t]||[],r=[];for(const i of o){const l=i(n);if(l===Ks)return Ks;l!==oo&&r.push(l)}return ns(...r)}}}const vi={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},H7=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],G7=[C7];let Rx;function mu(){return Rx||(Rx=new DI(100)),Rx}function q7(e,t,n,o,r,i){const l=new _t,{stop:d}=Z7(t,o,r,i,l),{enabled:f}=K7(e,t,n,l);return{stop:d,enabled:f}}function K7(e,t,n,o){const r={},i=!G7.includes(t.site)&&es(t.telemetrySampleRate),l={[vi.LOG]:i,[vi.CONFIGURATION]:i&&es(t.telemetryConfigurationSampleRate),[vi.USAGE]:i&&es(t.telemetryUsageSampleRate)},d=Y7(),f=mu();return f.subscribe(({rawEvent:p,kind:g})=>{if(!l[p.type])return;let v=r[g];if(v||(v=r[g]=new Set),v.size>=t.maxTelemetryEventsPerPage)return;const b=du(p);if(v.has(b))return;const x=n.triggerHook(1,{startTime:Gn().relative});if(x===Ks)return;const S=m(x,e,p,d);o.notify(S),r$("telemetry",S),v.add(b)}),f.unbuffer(),Rq(CS),{enabled:i};function m(p,g,v,b){const S={type:"telemetry",date:Gn().timeStamp,service:g,version:"6.19.0",source:"browser",_dd:{format_version:2},telemetry:ns(v,{runtime_env:b,connectivity:o$(),sdk_setup:"npm"}),experimental_features:Array.from(_7())};return ns(S,p)}}function Z7(e,t,n,o,r){const i=[];if(Bc()){const l=Af(),d=r.subscribe(f=>l.send("internal_telemetry",f));i.push(d.unsubscribe)}else{const l=[e.rumEndpointBuilder];e.replica&&X7(e)&&l.push(e.replica.rumEndpointBuilder);const d=h$({encoder:o(4),request:f$(l,e.batchBytesLimit,t),flushController:p$({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:n,sessionExpireObservable:new _t}),messageBytesLimit:e.messageBytesLimit});i.push(d.stop);const f=r.subscribe(d.add);i.push(f.unsubscribe)}return{stop:()=>i.forEach(l=>l())}}function Y7(){return{is_local_file:window.location.protocol==="file:",is_worker:"WorkerGlobalScope"in self}}function X7(e){return e.site===n$}function na(e,t){ew(Ag.debug,e,t),mu().notify({rawEvent:{type:vi.LOG,message:e,status:"debug",...t},kind:"debug"})}function CS(e,t){mu().notify({rawEvent:{type:vi.LOG,status:"error",...Q7(e),...t},kind:"error"})}function W7(e){mu().notify({rawEvent:{type:vi.CONFIGURATION,configuration:e},kind:vi.CONFIGURATION})}function ES(e,t){mu().notify({rawEvent:{type:vi.LOG,message:e,status:"debug",...t},kind:e})}function pr(e){mu().notify({rawEvent:{type:vi.USAGE,usage:e},kind:vi.USAGE})}function Q7(e){if(ul(e)){const t=Of(e);return{error:{kind:t.name,stack:kf(J7(t))},message:t.message}}return{error:{stack:t$},message:`Uncaught ${du(e)}`}}function J7(e){return e.stack=e.stack.filter(t=>!t.url||H7.some(n=>t.url.startsWith(n))),e}const eK=10,tK=100,nK=lr,g$="--",v$=[];let ap;function Ta(e,t,n=0){var o;const{isLockEnabled:r,persistSession:i,expireSession:l}=t,d=v=>i({...v,lock:m}),f=()=>{const{lock:v,...b}=t.retrieveSession();return{session:b,lock:v&&!oK(v)?v:void 0}};if(ap||(ap=e),e!==ap){v$.push(e);return}if(r&&n>=tK){na("Aborted session operation after max lock retries",{currentStore:f()}),kT(t);return}let m,p=f();if(r){if(p.lock){Oh(e,t,n);return}if(m=rK(),d(p.session),p=f(),p.lock!==m){Oh(e,t,n);return}}let g=e.process(p.session);if(r&&(p=f(),p.lock!==m)){Oh(e,t,n);return}if(g&&(Gd(g)?l(g):(KI(g),r?d(g):i(g))),r&&!(g&&Gd(g))){if(p=f(),p.lock!==m){Oh(e,t,n);return}i(p.session),g=p.session}(o=e.after)===null||o===void 0||o.call(e,g||p.session),kT(t)}function Oh(e,t,n){sr(()=>{Ta(e,t,n+1)},eK)}function kT(e){ap=void 0;const t=v$.shift();t&&Ta(t,e)}function rK(){return cr()+g$+Bn()}function oK(e){const[,t]=e.split(g$);return!t||Qt(Number(t),Bn())>nK}const AT=lr;function iK(e){switch(e.sessionPersistence){case of.COOKIE:return RT(e);case of.LOCAL_STORAGE:return NT();case void 0:{let t=RT(e);return!t&&e.allowFallbackToLocalStorage&&(t=NT()),t}default:pt.error(`Invalid session persistence '${String(e.sessionPersistence)}'`)}}function sK(e,t){return e.type===of.COOKIE?Bq(t,e.cookieOptions):qq(t)}function aK(e,t,n,o,r=sK(e,t)){const i=new _t,l=new _t,d=new _t,f=uu(b,AT);let m;S();const{throttled:p,cancel:g}=Pg(()=>{Ta({process:A=>{if(sp(A))return;const I=x(A);return C(I),I},after:A=>{qI(A)&&!E()&&T(A),m=A}},r)},AT);function v(){Ta({process:A=>E()?x(A):void 0},r)}function b(){const A=r.retrieveSession();Gd(A)?Ta({process:I=>Gd(I)?Na(I,t):void 0,after:x},r):x(A)}function x(A){return Gd(A)&&(A=Na(A,t)),E()&&(N(A)?j():(d.notify({previousState:m,newState:A}),m=A)),A}function S(){Ta({process:A=>{if(sp(A))return Na(A,t)},after:A=>{m=A}},r)}function C(A){if(sp(A))return!1;const I=o(A[n]);A[n]=I,delete A.isExpired,I!==HI&&!A.id&&(A.id=cr(),A.created=String(Oo()))}function E(){return m?.[n]!==void 0}function N(A){return m.id!==A.id||m[n]!==A[n]}function j(){m=Na(m,t),l.notify()}function T(A){m=A,i.notify()}function O(A){Ta({process:I=>({...I,...A}),after:x},r)}return{expandOrRenewSession:p,expandSession:v,getSession:()=>m,renewObservable:i,expireObservable:l,sessionStateUpdateObservable:d,restartSession:S,expire:()=>{g(),r.expireSession(m),x(Na(m,t))},stop:()=>{Mg(f)},updateSessionState:O}}const rw={GRANTED:"granted",NOT_GRANTED:"not-granted"};function lK(e){const t=new _t;return{tryToInit(n){e||(e=n)},update(n){e=n,t.notify()},isGranted(){return e===rw.GRANTED},observable:t}}function RS(e){const t=dl(e);return t==="string"||t==="function"||e instanceof RegExp}function jS(e,t,n=!1){return e.some(o=>{try{if(typeof o=="function")return o(t);if(o instanceof RegExp)return o.test(t);if(typeof o=="string")return n?t.startsWith(o):o===t}catch(r){pt.error(r)}return!1})}const y$=["chrome-extension://","moz-extension://"];function IT(e){return y$.some(t=>e.includes(t))}function cK(e,t=""){return!IT(e)&&IT(t)}function uK(e=""){for(const t of y$){const n=e.match(new RegExp(`${t}[^/]+`));if(n)return n[0]}}const $T="Running the Browser SDK in a Web extension content script is discouraged and will be forbidden in a future major release unless the `allowedTrackingOrigins` option is provided.",dK="SDK initialized on a non-allowed domain.";function fK(e,t=typeof location<"u"?location.origin:"",n=new Error().stack){const o=e.allowedTrackingOrigins;if(!o){if(cK(t,n)){pt.warn($T);const i=uK(n);na($T,{extensionUrl:i||"unknown"})}return!0}const r=jS(o,t);return r||pt.error(dK),r}function NS(e){return TS(e,location.href).href}function mK(e){try{return!!TS(e)}catch{return!1}}function hK(e){const t=TS(e).pathname;return t[0]==="/"?t:`/${t}`}function TS(e,t){const{URL:n}=pK();try{return t!==void 0?new n(e,t):new n(e)}catch(o){throw new Error(`Failed to construct URL: ${String(o)} ${du({url:e,base:t})}`)}}let jx;function pK(){if(!jx){let e,t;try{e=document.createElement("iframe"),e.style.display="none",document.body.appendChild(e),t=e.contentWindow}catch{t=window}jx={URL:t.URL},e?.remove()}return jx}function Oa(e,t,n){const o=gK(e,t);return{build(r,i){const l=vK(e,t,r,i,n);return o(l)},trackType:t}}function gK(e,t){const n=`/api/v2/${t}`,o=e.proxy;if(typeof o=="string"){const i=NS(o);return l=>`${i}?ddforward=${encodeURIComponent(`${n}?${l}`)}`}if(typeof o=="function")return i=>o({path:n,parameters:i});const r=b$(t,e);return i=>`https://${r}${n}?${i}`}function b$(e,t){const{site:n=Ia,internalAnalyticsSubdomain:o}=t;if(e==="logs"&&t.usePciIntake&&n===Ia)return E7;if(o&&n===Ia)return`${o}.${Ia}`;if(n===w7)return`http-intake.logs.${n}`;const r=n.split("."),i=r.pop();return`browser-intake-${r.join("-")}.${i}`}function vK({clientToken:e,internalAnalyticsSubdomain:t,source:n="browser"},o,r,{retry:i,encoding:l},d=[]){const f=[`ddsource=${n}`,`dd-api-key=${e}`,`dd-evp-origin-version=${encodeURIComponent("6.19.0")}`,"dd-evp-origin=browser",`dd-request-id=${cr()}`].concat(d);return l&&f.push(`dd-evp-encoding=${l}`),o==="rum"&&(f.push(`batch_time=${Bn()}`,`_dd.api=${r}`),i&&f.push(`_dd.retry_count=${i.count}`,`_dd.retry_after=${i.lastFailureStatus}`)),t&&f.reverse(),f.join("&")}function yK(e){const t=e.site||Ia,n=e.source==="flutter"?"flutter":"browser",o=bK({...e,site:t,source:n});return{replica:xK({...e,site:t,source:n}),site:t,source:n,...o}}function bK(e){return{logsEndpointBuilder:Oa(e,"logs"),rumEndpointBuilder:Oa(e,"rum"),profilingEndpointBuilder:Oa(e,"profile"),sessionReplayEndpointBuilder:Oa(e,"replay"),exposuresEndpointBuilder:Oa(e,"exposures")}}function xK(e){if(!e.replica)return;const t={...e,site:Ia,clientToken:e.replica.clientToken};return{logsEndpointBuilder:Oa(t,"logs"),rumEndpointBuilder:Oa(t,"rum",[`application.id=${e.replica.applicationId}`])}}function _K(e){return R7.every(t=>e.includes(t))}const qd={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input"},ow={ALL:"all",SAMPLED:"sampled"};function Nx(e,t){return e!=null&&typeof e!="string"?(pt.error(`${t} must be defined as a string`),!1):!0}function wK(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(pt.error(`Site should be a valid Datadog site. ${vS} ${Ig}/getting_started/site/.`),!1):!0}function yc(e,t){return e!==void 0&&!vq(e)?(pt.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function SK(e){var t,n,o,r,i,l,d,f,m,p;if(!e||!e.clientToken){pt.error("Client Token is not configured, we will not send any data.");return}if(e.allowedTrackingOrigins!==void 0&&!Array.isArray(e.allowedTrackingOrigins)){pt.error("Allowed Tracking Origins must be an array");return}if(!(!wK(e.site)||!yc(e.sessionSampleRate,"Session")||!yc(e.telemetrySampleRate,"Telemetry")||!yc(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!yc(e.telemetryUsageSampleRate,"Telemetry Usage")||!Nx(e.version,"Version")||!Nx(e.env,"Env")||!Nx(e.service,"Service")||!fK(e))){if(e.trackingConsent!==void 0&&!kp(rw,e.trackingConsent)){pt.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:e.beforeSend&&NI(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:iK(e),sessionSampleRate:(t=e.sessionSampleRate)!==null&&t!==void 0?t:100,telemetrySampleRate:(n=e.telemetrySampleRate)!==null&&n!==void 0?n:20,telemetryConfigurationSampleRate:(o=e.telemetryConfigurationSampleRate)!==null&&o!==void 0?o:5,telemetryUsageSampleRate:(r=e.telemetryUsageSampleRate)!==null&&r!==void 0?r:5,service:(i=e.service)!==null&&i!==void 0?i:void 0,env:(l=e.env)!==null&&l!==void 0?l:void 0,version:(d=e.version)!==null&&d!==void 0?d:void 0,datacenter:(f=e.datacenter)!==null&&f!==void 0?f:void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:(m=e.trackingConsent)!==null&&m!==void 0?m:rw.GRANTED,trackAnonymousUser:(p=e.trackAnonymousUser)!==null&&p!==void 0?p:!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,batchBytesLimit:16*tf,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*lr,batchMessagesLimit:50,messageBytesLimit:256*tf,variant:e.variant,sdkVersion:e.sdkVersion,...yK(e)}}}function CK(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: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),source:e.source,sdk_version:e.sdkVersion,variant:e.variant}}const EK=200;function RK(e){const{env:t,service:n,version:o,datacenter:r,sdkVersion:i,variant:l}=e,d=[sc("sdk_version",i??"6.19.0")];return t&&d.push(sc("env",t)),n&&d.push(sc("service",n)),o&&d.push(sc("version",o)),r&&d.push(sc("datacenter",r)),l&&d.push(sc("variant",l)),d}function sc(e,t){const n=t?`${e}:${t}`:e;return(n.length>EK||NK(n))&&pt.warn(`Tag ${n} doesn't meet tag requirements and will be sanitized. ${vS} ${Ig}/getting_started/tagging/#defining-tags`),jK(n)}function jK(e){return e.replace(/,/g,"_")}function NK(e){return TK()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e):!1}function TK(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function yi(e,t,n,{computeHandlingStack:o}={}){let r=e[t];if(typeof r!="function")if(t in e&&t.startsWith("on"))r=Ot;else return{stop:Ot};let i=!1;const l=function(){if(i)return r.apply(this,arguments);const d=Array.from(arguments);let f;Xa(n,null,[{target:this,parameters:d,onPostCall:p=>{f=p},handlingStack:o?sf("instrumented method"):void 0}]);const m=r.apply(this,d);return f&&Xa(f,null,[m]),m};return e[t]=l,{stop:()=>{i=!0,e[t]===l&&(e[t]=r)}}}function qye(e,t,n){const o=Object.getOwnPropertyDescriptor(e,t);if(!o||!o.set||!o.configurable)return{stop:Ot};const r=Ot;let i=(d,f)=>{sr(()=>{i!==r&&n(d,f)},0)};const l=function(d){o.set.call(this,d),i(this,d)};return Object.defineProperty(e,t,{set:l}),{stop:()=>{var d;((d=Object.getOwnPropertyDescriptor(e,t))===null||d===void 0?void 0:d.set)===l&&Object.defineProperty(e,t,o),i=r}}}function OK(){return new _t(e=>{const t=(r,i)=>{const l=_S({stackTrace:i,originalError:r,startClocks:Gn(),nonErrorPrefix:"Uncaught",source:fu.SOURCE,handling:"unhandled"});e.notify(l)},{stop:n}=kK(t),{stop:o}=AK(t);return()=>{n(),o()}})}function kK(e){return yi(Xo(),"onerror",({parameters:[t,n,o,r,i]})=>{let l;ul(i)||(l=d7(t,n,o,r)),e(i??t,l)})}function AK(e){return yi(Xo(),"onunhandledrejection",({parameters:[t]})=>{e(t.reason||"Empty reason")})}function IK(e){const t={version:"6.19.0",onReady(n){n()},...e};return Object.defineProperty(t,"_setDebug",{get(){return jq},enumerable:!1}),t}function $K(e,t,n){const o=e[t];o&&!o.q&&o.version&&pt.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),e[t]=n,o&&o.q&&o.q.forEach(r=>NI(r,"onReady callback threw an error:")())}function x$(e,t){t.silentMultipleInit||pt.error(`${e} is already initialized.`)}const af={intervention:"intervention",cspViolation:"csp_violation"};function MK(e,t){const n=[];t.includes(af.cspViolation)&&n.push(DK(e));const o=t.filter(r=>r!==af.cspViolation);return o.length&&n.push(PK(o)),PI(...n)}function PK(e){return new _t(t=>{if(!window.ReportingObserver)return;const n=tt((r,i)=>r.forEach(l=>t.notify(zK(l)))),o=new window.ReportingObserver(n,{types:e,buffered:!0});return o.observe(),()=>{o.disconnect()}})}function DK(e){return new _t(t=>{const{stop:n}=Wt(e,document,"securitypolicyviolation",o=>{t.notify(UK(o))});return n})}function zK(e){const{type:t,body:n}=e;return _$({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:w$(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}function UK(e){const t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return _$({type:e.effectiveDirective,message:`${af.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:w$(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${zI(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function _$(e){return{startClocks:Gn(),source:fu.REPORT,handling:"unhandled",...e}}function w$(e,t,n,o,r){return n?kf({name:e,message:t,stack:[{func:"?",url:n,line:o??void 0,column:r??void 0}]}):void 0}function S$(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}const kh=1/0,LK=Ar;let Rd=null;const lp=new Set;function FK(){lp.forEach(e=>e())}function hu({expireDelay:e,maxEntries:t}){let n=[];Rd||(Rd=uu(()=>FK(),LK));const o=()=>{const p=ro()-e;for(;n.length>0&&n[n.length-1].endTime<p;)n.pop()};lp.add(o);function r(p,g){const v={value:p,startTime:g,endTime:kh,remove:()=>{S$(n,v)},close:b=>{v.endTime=b}};return t&&n.length>=t&&n.pop(),n.unshift(v),v}function i(p=kh,g={returnInactive:!1}){for(const v of n)if(v.startTime<=p){if(g.returnInactive||p<=v.endTime)return v.value;break}}function l(p){const g=n[0];g&&g.endTime===kh&&g.close(p)}function d(p=kh,g=0){const v=cu(p,g);return n.filter(b=>b.startTime<=v&&p<=b.endTime).map(b=>b.value)}function f(){n=[]}function m(){lp.delete(o),lp.size===0&&Rd&&(Mg(Rd),Rd=null)}return{add:r,find:i,closeActive:l,findAll:d,reset:f,stop:m}}const VK="datadog-synthetics-public-id",BK="datadog-synthetics-result-id",HK="datadog-synthetics-injects-rum";function C$(){return!!(window._DATADOG_SYNTHETICS_INJECTS_RUM||Ds(HK))}function E$(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||Ds(VK);return typeof e=="string"?e:void 0}function R$(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||Ds(BK);return typeof e=="string"?e:void 0}function j$(){return!!(E$()&&R$())}const GK=Ar,qK=cl;function KK(e,t,n,o){const r=new _t,i=new _t,l=aK(e.sessionStoreStrategyType,e,t,n),d=hu({expireDelay:qK});l.renewObservable.subscribe(()=>{d.add(f(),ro()),r.notify()}),l.expireObservable.subscribe(()=>{i.notify(),d.closeActive(ro())}),l.expandOrRenewSession(),d.add(f(),kI().relative),o.observable.subscribe(()=>{o.isGranted()?l.expandOrRenewSession():l.expire()}),ZK(e,()=>{o.isGranted()&&l.expandOrRenewSession()}),YK(e,()=>l.expandSession()),XK(e,()=>l.restartSession());function f(){const m=l.getSession();return m?{id:m.id,trackingType:m[t],isReplayForced:!!m.forcedReplay,anonymousId:m.anonymousId}:(WK().catch(()=>{}),{id:"invalid",trackingType:HI,isReplayForced:!1,anonymousId:void 0})}return{findSession:(m,p)=>d.find(m,p),renewObservable:r,expireObservable:i,sessionStateUpdateObservable:l.sessionStateUpdateObservable,expire:l.expire,updateSessionState:l.updateSessionState}}function ZK(e,t){const{stop:n}=qs(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function YK(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:o}=Wt(e,document,"visibilitychange",n);uu(n,GK)}function XK(e,t){const{stop:n}=Wt(e,window,"resume",t,{capture:!0})}async function WK(){const e=XI();let t=[];"cookieStore"in window?t=await window.cookieStore.getAll("_dd_s"):t=document.cookie.split(/\s*;\s*/).filter(n=>n.startsWith("_dd_s")),na("Unexpected session state",{session:e,isSyntheticsTest:j$(),createdTimestamp:e?.created,expireTimestamp:e?.expire,cookie:{count:t.length,domain:FI(),...t},currentDomain:`${window.location.protocol}//${window.location.hostname}`})}function QK(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,o){const r=II(n);t+=r,e+=n,o&&o(r)},finish(n){n(this.finishSync())},finishSync(){const n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount(n){return n.length}}}class JK{constructor(){this.callbacks={}}notify(t,n){const o=this.callbacks[t];o&&o.forEach(r=>r(n))}subscribe(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(o=>n!==o)}}}}function Tx(e,t,n){let o=0,r=!1;return{isLimitReached(){if(o===0&&sr(()=>{o=0},Ar),o+=1,o<=t||r)return r=!1,!1;if(o===t+1){r=!0;try{n({message:`Reached max number of ${e}s by minute: ${t}`,source:fu.AGENT,startClocks:Gn()})}finally{r=!1}}return!0}}}function OS(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:Ot}):Wt(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function eZ(e,t){return new Promise(n=>{OS(e,t,n)})}let Ox;const kS=new WeakMap;function tZ(e){return Ox||(Ox=nZ(e)),Ox}function nZ(e){return new _t(t=>{const{stop:n}=yi(XMLHttpRequest.prototype,"open",rZ),{stop:o}=yi(XMLHttpRequest.prototype,"send",i=>{oZ(i,e,t)},{computeHandlingStack:!0}),{stop:r}=yi(XMLHttpRequest.prototype,"abort",iZ);return()=>{n(),o(),r()}})}function rZ({target:e,parameters:[t,n]}){kS.set(e,{state:"open",method:String(t).toUpperCase(),url:NS(String(n))})}function oZ({target:e,handlingStack:t},n,o){const r=kS.get(e);if(!r)return;const i=r;i.state="start",i.startClocks=Gn(),i.isAborted=!1,i.xhr=e,i.handlingStack=t;let l=!1;const{stop:d}=yi(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&f()}),f=()=>{if(m(),d(),l)return;l=!0;const p=r;p.state="complete",p.duration=Qt(i.startClocks.timeStamp,Bn()),p.status=e.status,o.notify(nf(p))},{stop:m}=Wt(n,e,"loadend",f);o.notify(i)}function iZ({target:e}){const t=kS.get(e);t&&(t.isAborted=!0)}let kx;function N$(){return kx||(kx=sZ()),kx}function sZ(){return new _t(e=>{if(!window.fetch)return;const{stop:t}=yi(window,"fetch",n=>aZ(n,e),{computeHandlingStack:!0});return t})}function aZ({parameters:e,onPostCall:t,handlingStack:n},o){const[r,i]=e;let l=i&&i.method;l===void 0&&r instanceof Request&&(l=r.method);const d=l!==void 0?String(l).toUpperCase():"GET",f=r instanceof Request?r.url:NS(String(r)),m=Gn(),p={state:"start",init:i,input:r,method:d,startClocks:m,url:f,handlingStack:n};o.notify(p),e[0]=p.input,e[1]=p.init,t(g=>lZ(o,g,p))}function lZ(e,t,n){const o=n;function r(i){o.state="resolve",Object.assign(o,i),e.notify(o)}t.then(tt(i=>{r({response:i,responseType:i.type,status:i.status,isAborted:!1})}),tt(i=>{var l,d;r({status:0,isAborted:((d=(l=o.init)===null||l===void 0?void 0:l.signal)===null||d===void 0?void 0:d.aborted)||i instanceof DOMException&&i.code===DOMException.ABORT_ERR,error:i})}))}function cZ(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(tt(e),t);return()=>window.cancelIdleCallback(n)}return dZ(e)}const uZ=50;function dZ(e){const t=Oo(),n=sr(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,uZ-(Oo()-t))})},0);return()=>Co(n)}const fZ=lr,mZ=30;function hZ(){const e=[];function t(o){let r;if(o.didTimeout){const i=performance.now();r=()=>mZ-(performance.now()-i)}else r=o.timeRemaining.bind(o);for(;r()>0&&e.length;)e.shift()();e.length&&n()}function n(){cZ(t,{timeout:fZ})}return{push(o){e.push(o)===1&&n()}}}let Ax={};function pZ(e){const t=e.map(n=>(Ax[n]||(Ax[n]=gZ(n)),Ax[n]));return PI(...t)}function gZ(e){return new _t(t=>{const n=Zi[e];return Zi[e]=(...o)=>{n.apply(console,o);const r=sf("console error");Xa(()=>{t.notify(vZ(o,e,r))})},()=>{Zi[e]=n}})}function vZ(e,t,n){const o=e.map(r=>yZ(r)).join(" ");if(t===Ag.error){const r=e.find(ul),i=_S({originalError:r,handlingStack:n,startClocks:Gn(),source:fu.CONSOLE,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return i.message=o,{api:t,message:o,handlingStack:n,error:i}}return{api:t,message:o,error:void 0,handlingStack:n}}function yZ(e){return typeof e=="string"?cn(e):ul(e)?e$(Of(e)):du(cn(e),void 0,2)}const bZ=500;function xZ(){const e=[];return{add:r=>{e.push(r)>bZ&&e.splice(0,1)},remove:r=>{S$(e,r)},drain:r=>{e.forEach(i=>i(r)),e.length=0}}}function _Z(e){const t=dl(e)==="object";return t||pt.error("Unsupported context:",e),t}function Ix(e,t,n){const o={...e};for(const[r,{required:i,type:l}]of Object.entries(t))l==="string"&&!MT(o[r])&&(o[r]=String(o[r])),i&&MT(o[r])&&pt.warn(`The property ${r} of ${n} is required; context will not be sent to the intake.`);return o}function MT(e){return e==null||e===""}function Lg(e="",{propertiesConfig:t={}}={}){let n={};const o=new _t,r={getContext:()=>SS(n),setContext:i=>{_Z(i)?n=cn(Ix(i,t,e)):r.clearContext(),o.notify()},setContextProperty:(i,l)=>{n=cn(Ix({...n,[i]:l},t,e)),o.notify()},removeContextProperty:i=>{delete n[i],Ix(n,t,e),o.notify()},clearContext:()=>{n={},o.notify()},changeObservable:o};return r}function fr(e,t,n,o){return tt((...r)=>(o&&pr({feature:o}),e()[t][n](...r)))}const wZ="_dd_c",SZ=[];function AS(e,t,n,o){const r=CZ(n,o);SZ.push(Wt(e,window,"storage",({key:m})=>{r===m&&l()})),t.changeObservable.subscribe(d);const i=ns(f(),t.getContext());ll(i)||t.setContext(i);function l(){t.setContext(f())}function d(){localStorage.setItem(r,JSON.stringify(t.getContext()))}function f(){const m=localStorage.getItem(r);return m?JSON.parse(m):{}}}function CZ(e,t){return`${wZ}_${e}_${t}`}function EZ(e,t,n){const o=T$();return t.storeContextsAcrossPages&&AS(t,o,n,4),e.register(0,()=>{const r=o.getContext();return ll(r)||!r.id?oo:{account:r}}),o}function T$(){return Lg("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function RZ(e,t,n,o){const r=O$();return t.storeContextsAcrossPages&&AS(t,r,n,2),e.register(0,()=>({context:r.getContext()})),r}function O$(){return Lg("global context")}function jZ(e,t,n,o){const r=k$();return t.storeContextsAcrossPages&&AS(t,r,o,1),e.register(0,({eventType:i,startTime:l})=>{const d=r.getContext(),f=n.findTrackedSession(l);return f&&f.anonymousId&&!d.anonymous_id&&t.trackAnonymousUser&&(d.anonymous_id=f.anonymousId),ll(d)?oo:{type:i,usr:d}}),e.register(1,({startTime:i})=>{var l;return{anonymous_id:(l=n.findTrackedSession(i))===null||l===void 0?void 0:l.anonymousId}}),r}function k$(){return Lg("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const Vn={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},mr={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"};function NZ(e,t,n){const o=e.getReader();let r=0;i();function i(){o.read().then(tt(d=>{if(d.done){l();return}r+=d.value.length,r>n.bytesLimit?l():i()}),tt(d=>t(d)))}function l(){o.cancel().catch(Ot),t(void 0,void 0,void 0)}}const vr={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},Fg={FETCH:vr.FETCH,XHR:vr.XHR},TZ=500;function OZ(e=OK){const t=new DI(TZ),n=e().subscribe(o=>{t.notify({type:0,error:o})});return{observable:t,stop:()=>{n.unsubscribe()}}}function kZ(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const it={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},A$={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},Yi={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},IS={CLICK:"click",CUSTOM:"custom"},jd={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"},I$={DURATION:"duration"};function AZ(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function IZ(e,t,n){function o(i){return!t.wasInPageStateDuringPeriod("frozen",i.startClocks.relative,i.duration)}function r(i){o(i)&&e.notify(12,MZ(i))}return{addDurationVital:r,startDurationVital:(i,l={})=>$$(n,i,l),stopDurationVital:(i,l={})=>{M$(r,n,i,l)}}}function $$({vitalsByName:e,vitalsByReference:t},n,o={}){const r={name:n,startClocks:Gn(),context:o.context,description:o.description},i={__dd_vital_reference:!0};return e.set(n,r),t.set(i,r),i}function M$(e,{vitalsByName:t,vitalsByReference:n},o,r={}){const i=typeof o=="string"?t.get(o):n.get(o);i&&(e($Z(i,i.startClocks,r,Gn())),typeof o=="string"?t.delete(o):n.delete(o))}function $Z(e,t,n,o){var r;return{name:e.name,type:I$.DURATION,startClocks:t,duration:Qt(t.timeStamp,o.timeStamp),context:ns(e.context,n.context),description:(r=n.description)!==null&&r!==void 0?r:e.description}}function MZ(e,t){const n={date:e.startClocks.timeStamp,vital:{id:cr(),type:e.type,name:e.name,duration:ot(e.duration),description:e.description},type:it.VITAL,context:e.context};return n._dd={vital:{computed_value:!0}},{rawRumEvent:n,startTime:e.startClocks.relative,duration:e.duration,domainContext:{}}}function P$(e,t,n){if(e)for(const o of e){const r=o[t];r&&r(n)}}const PT=new Map;function D$(e,t){if(t===100)return!0;if(t===0)return!1;const n=PT.get(t);if(n&&e===n.sessionId)return n.decision;let o;return window.BigInt?o=PZ(BigInt(`0x${e.split("-")[4]}`),t):o=es(t),PT.set(t,{sessionId:e,decision:o}),o}function PZ(e,t){const n=BigInt("1111111111111111111"),o=BigInt("0x10000000000000000"),r=e*n%o;return Number(r)<=t/100*Number(o)}function DZ(){return U$(64)}function z$(){return U$(63)}function U$(e){const t=crypto.getRandomValues(new Uint32Array(2));return e===63&&(t[t.length-1]>>>=1),{toString(n=10){let o=t[1],r=t[0],i="";do{const l=o%n*4294967296+r;o=Math.floor(o/n),r=Math.floor(l/n),i=(l%n).toString(n)+i}while(o||r);return i}}}function ac(e){return e.toString(16).padStart(16,"0")}function zZ(e){const t=e;return dl(t)==="object"&&RS(t.match)&&Array.isArray(t.propagatorTypes)}function UZ(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function LZ(e,t,n,o){return{clearTracingIfNeeded:UZ,traceFetch:r=>DT(e,r,t,n,o,i=>{var l;if(r.input instanceof Request&&!(!((l=r.init)===null||l===void 0)&&l.headers))r.input=new Request(r.input),Object.keys(i).forEach(d=>{r.input.headers.append(d,i[d])});else{r.init=nf(r.init);const d=[];r.init.headers instanceof Headers?r.init.headers.forEach((f,m)=>{d.push([m,f])}):Array.isArray(r.init.headers)?r.init.headers.forEach(f=>{d.push(f)}):r.init.headers&&Object.keys(r.init.headers).forEach(f=>{d.push([f,r.init.headers[f]])}),r.init.headers=d.concat(bS(i))}}),traceXhr:(r,i)=>DT(e,r,t,n,o,l=>{Object.keys(l).forEach(d=>{i.setRequestHeader(d,l[d])})})}}function DT(e,t,n,o,r,i){const l=n.findTrackedSession();if(!l)return;const d=e.allowedTracingUrls.find(p=>jS([p.match],t.url,!0));if(!d)return;const f=D$(l.id,e.traceSampleRate);(f||e.traceContextInjection===ow.ALL)&&(t.traceSampled=f,t.traceId=DZ(),t.spanId=z$(),i(FZ(t.traceId,t.spanId,t.traceSampled,l.id,d.propagatorTypes,o,r,e)))}function FZ(e,t,n,o,r,i,l,d){const f={};if(r.forEach(m=>{switch(m){case"datadog":{Object.assign(f,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Object.assign(f,{traceparent:`00-0000000000000000${ac(e)}-${ac(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(f,{b3:`${ac(e)}-${ac(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(f,{"X-B3-TraceId":ac(e),"X-B3-SpanId":ac(t),"X-B3-Sampled":n?"1":"0"});break}}}),d.propagateTraceBaggage){const m={"session.id":o},p=i.getContext().id;typeof p=="string"&&(m["user.id"]=p);const g=l.getContext().id;typeof g=="string"&&(m["account.id"]=g);const v=Object.entries(m).map(([b,x])=>`${b}=${encodeURIComponent(x)}`).join(",");v&&(f.baggage=v)}return f}const L$=["tracecontext","datadog"];function VZ(e){var t,n,o,r,i,l,d;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&pt.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){pt.error("Application ID is not configured, no RUM data will be collected.");return}if(!yc(e.sessionReplaySampleRate,"Session Replay")||!yc(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){pt.error("Excluded Activity Urls should be an array");return}const f=BZ(e);if(!f)return;const m=SK(e);if(!m)return;const p=(t=e.sessionReplaySampleRate)!==null&&t!==void 0?t:0;return{applicationId:e.applicationId,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:p,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:p===0,traceSampleRate:(n=e.traceSampleRate)!==null&&n!==void 0?n:100,rulePsr:jf(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:f,excludedActivityUrls:(o=e.excludedActivityUrls)!==null&&o!==void 0?o:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((r=e.trackUserInteractions)!==null&&r!==void 0)||r),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((i=e.trackResources)!==null&&i!==void 0)||i),trackLongTasks:!!(!((l=e.trackLongTasks)!==null&&l!==void 0)||l),trackBfcacheViews:!!e.trackBfcacheViews,subdomain:e.subdomain,defaultPrivacyLevel:kp(qd,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:qd.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,customerDataTelemetrySampleRate:1,initialViewMetricsTelemetrySampleRate:1,replayTelemetrySampleRate:1,traceContextInjection:kp(ow,e.traceContextInjection)?e.traceContextInjection:ow.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:(d=e.profilingSampleRate)!==null&&d!==void 0?d:0,propagateTraceBaggage:!!e.propagateTraceBaggage,...m}}function BZ(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){pt.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){pt.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{RS(n)?t.push({match:n,propagatorTypes:L$}):zZ(n)?t.push(n):pt.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function HZ(e){const t=new Set;return Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0&&e.allowedTracingUrls.forEach(n=>{RS(n)?L$.forEach(o=>t.add(o)):dl(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(o=>t.add(o))}),Array.from(t)}function GZ(e){var t;const n=CK(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,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0,selected_tracing_propagators:HZ(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:Array.isArray(e.excludedActivityUrls)&&e.excludedActivityUrls.length>0,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,plugins:(t=e.plugins)===null||t===void 0?void 0:t.map(o=>{var r;return{name:o.name,...(r=o.getConfigurationTelemetry)===null||r===void 0?void 0:r.call(o)}}),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,remote_configuration_id:e.remoteConfigurationId,...n}}const qZ="v1",KZ=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function ZZ(e,t){const n=await rY(e);if(!n.ok){pt.error(n.error);return}return YZ(e,n.value,t)}function YZ(e,t,n){const o={...e};return KZ.forEach(r=>{r in t&&(o[r]=$p(t[r]))}),Object.keys(n).forEach(r=>{t[r]!==void 0&&QZ(n[r],t[r])}),o}function $p(e){if(Array.isArray(e))return e.map($p);if(XZ(e)){if(WZ(e)){const t=e.rcSerializedType;switch(t){case"string":return e.value;case"regex":return F$(e.value);case"dynamic":return JZ(e);default:pt.error(`Unsupported remote configuration: "rcSerializedType": "${t}"`);return}}return $I(e,$p)}return e}function XZ(e){return typeof e=="object"&&e!==null}function WZ(e){return"rcSerializedType"in e}function F$(e){try{return new RegExp(e)}catch{pt.error(`Invalid regex in the remote configuration: '${e}'`)}}function QZ(e,t){t.forEach(({key:n,value:o})=>{e.setContextProperty(n,$p(o))})}function JZ(e){const t=e.strategy;switch(t){case"cookie":return eY(e);case"dom":return tY(e);default:pt.error(`Unsupported remote configuration: "strategy": "${t}"`);return}}function eY({name:e,extractor:t}){const n=zg(e);return t!==void 0&&n!==void 0?V$(t,n):n}function tY({selector:e,attribute:t,extractor:n}){let o;try{o=document.querySelector(e)}catch{o=null,pt.error(`Invalid selector in the remote configuration: '${e}'`)}if(o===null||nY(o,t))return;const r=t!==void 0?o.getAttribute(t):o.textContent;return n!==void 0&&r!==null?V$(n,r):r??void 0}function nY(e,t){return e.getAttribute("type")==="password"&&t==="value"}function V$(e,t){const n=F$(e.value);if(n===void 0)return;const o=n.exec(t);if(o===null)return;const[r,i]=o;return i||r}async function rY(e){let t;try{t=await fetch(oY(e))}catch{t=void 0}if(!t||!t.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};const n=await t.json();return n.rum?{ok:!0,value:n.rum}:{ok:!1,error:new Error("No remote configuration for RUM.")}}function oY(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${b$("rum",e)}/${qZ}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function iY({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,o,r){const i=xZ(),l=O$();$x(l,Vn.globalContext,i);const d=k$();$x(d,Vn.userContext,i);const f=T$();$x(f,Vn.accountContext,i);let m,p,g,v;const b=n.observable.subscribe(S),x={};function S(){if(!g||!v||!n.isGranted())return;b.unsubscribe();let j;if(v.trackViewsManually){if(!m)return;i.remove(m.callback),j=m.options}const T=r(v,p,j);i.drain(T)}function C(j){const T=Bc();if(T&&(j=sY(j)),g=j,W7(GZ(j)),v){x$("DD_RUM",j);return}const O=VZ(j);if(O){if(!T&&!O.sessionStoreStrategyType){pt.warn("No storage available for session. We will not send any data.");return}O.compressIntakeRequests&&!T&&t&&(p=t(O,"Datadog RUM",Ot),!p)||(v=O,N$().subscribe(Ot),n.tryToInit(O.trackingConsent),S())}}const E=j=>{i.add(T=>T.addDurationVital(j))};return{init(j,T){if(!j){pt.error("Missing configuration");return}b7(j.enableExperimentalFeatures),g=j,!(e&&C$())&&(P$(j.plugins,"onInit",{initConfiguration:j,publicApi:T}),j.remoteConfigurationId?ZZ(j,{user:d,context:l}).then(O=>{O&&C(O)}).catch(Lc):C(j))},get initConfiguration(){return g},getInternalContext:Ot,stopSession:Ot,addTiming(j,T=Bn()){i.add(O=>O.addTiming(j,T))},startView(j,T=Gn()){const O=A=>{A.startView(j,T)};i.add(O),m||(m={options:j,callback:O},S())},setViewName(j){i.add(T=>T.setViewName(j))},setViewContext(j){i.add(T=>T.setViewContext(j))},setViewContextProperty(j,T){i.add(O=>O.setViewContextProperty(j,T))},getViewContext:()=>x,globalContext:l,userContext:d,accountContext:f,addAction(j){i.add(T=>T.addAction(j))},addError(j){i.add(T=>T.addError(j))},addFeatureFlagEvaluation(j,T){i.add(O=>O.addFeatureFlagEvaluation(j,T))},startDurationVital(j,T){return $$(o,j,T)},stopDurationVital(j,T){M$(E,o,j,T)},addDurationVital:E}}function sY(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=Af())===null||n===void 0?void 0:n.getPrivacyLevel()}}function $x(e,t,n){e.changeObservable.subscribe(()=>{const o=e.getContext();n.add(r=>r[t].setContext(o))})}function aY(e,t,n,o={}){const r=lK(),i=AZ(),l=OZ().observable;let d=iY(o,r,i,(g,v,b)=>{const x=e(g,t,n,b,v&&o.createDeflateEncoder?S=>o.createDeflateEncoder(g,v,S):QK,r,i,l,o.sdkName);return t.onRumStart(x.lifeCycle,g,x.session,x.viewHistory,v,x.telemetry),n.onRumStart(x.lifeCycle,x.hooks,g,x.session,x.viewHistory),d=lY(d,x),P$(g.plugins,"onRumStart",{strategy:d,addEvent:x.addEvent}),x});const f=()=>d,m=tt(g=>{const v=typeof g=="object"?g:{name:g};d.startView(v),pr({feature:"start-view"})}),p=IK({init:tt(g=>{d.init(g,p)}),setTrackingConsent:tt(g=>{r.update(g),pr({feature:"set-tracking-consent",tracking_consent:g})}),setViewName:tt(g=>{d.setViewName(g),pr({feature:"set-view-name"})}),setViewContext:tt(g=>{d.setViewContext(g),pr({feature:"set-view-context"})}),setViewContextProperty:tt((g,v)=>{d.setViewContextProperty(g,v),pr({feature:"set-view-context-property"})}),getViewContext:tt(()=>(pr({feature:"set-view-context-property"}),d.getViewContext())),getInternalContext:tt(g=>d.getInternalContext(g)),getInitConfiguration:tt(()=>SS(d.initConfiguration)),addAction:(g,v)=>{const b=sf("action");Xa(()=>{d.addAction({name:cn(g),context:cn(v),startClocks:Gn(),type:IS.CUSTOM,handlingStack:b}),pr({feature:"add-action"})})},addError:(g,v)=>{const b=sf("error");Xa(()=>{d.addError({error:g,handlingStack:b,context:cn(v),startClocks:Gn()}),pr({feature:"add-error"})})},addTiming:tt((g,v)=>{d.addTiming(cn(g),v)}),setGlobalContext:fr(f,Vn.globalContext,mr.setContext,"set-global-context"),getGlobalContext:fr(f,Vn.globalContext,mr.getContext,"get-global-context"),setGlobalContextProperty:fr(f,Vn.globalContext,mr.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:fr(f,Vn.globalContext,mr.removeContextProperty,"remove-global-context-property"),clearGlobalContext:fr(f,Vn.globalContext,mr.clearContext,"clear-global-context"),setUser:fr(f,Vn.userContext,mr.setContext,"set-user"),getUser:fr(f,Vn.userContext,mr.getContext,"get-user"),setUserProperty:fr(f,Vn.userContext,mr.setContextProperty,"set-user-property"),removeUserProperty:fr(f,Vn.userContext,mr.removeContextProperty,"remove-user-property"),clearUser:fr(f,Vn.userContext,mr.clearContext,"clear-user"),setAccount:fr(f,Vn.accountContext,mr.setContext,"set-account"),getAccount:fr(f,Vn.accountContext,mr.getContext,"get-account"),setAccountProperty:fr(f,Vn.accountContext,mr.setContextProperty,"set-account-property"),removeAccountProperty:fr(f,Vn.accountContext,mr.removeContextProperty,"remove-account-property"),clearAccount:fr(f,Vn.accountContext,mr.clearContext,"clear-account"),startView:m,stopSession:tt(()=>{d.stopSession(),pr({feature:"stop-session"})}),addFeatureFlagEvaluation:tt((g,v)=>{d.addFeatureFlagEvaluation(cn(g),cn(v)),pr({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:tt(()=>t.getSessionReplayLink()),startSessionReplayRecording:tt(g=>{t.start(g),pr({feature:"start-session-replay-recording",force:g&&g.force})}),stopSessionReplayRecording:tt(()=>t.stop()),addDurationVital:tt((g,v)=>{pr({feature:"add-duration-vital"}),d.addDurationVital({name:cn(g),type:I$.DURATION,startClocks:bq(v.startTime),duration:v.duration,context:cn(v&&v.context),description:cn(v&&v.description)})}),startDurationVital:tt((g,v)=>(pr({feature:"start-duration-vital"}),d.startDurationVital(cn(g),{context:cn(v&&v.context),description:cn(v&&v.description)}))),stopDurationVital:tt((g,v)=>{pr({feature:"stop-duration-vital"}),d.stopDurationVital(typeof g=="string"?cn(g):g,{context:cn(v&&v.context),description:cn(v&&v.description)})})});return p}function lY(e,t){return{init:n=>{x$("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function cY(){const e=uY();return new _t(t=>{if(!e)return;const n=new e(tt(o=>t.notify(o)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function uY(){let e;const t=window;if(t.Zone&&(e=Gs(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(Ot),o=Gs(n,"originalInstance");e=o&&o.constructor}return e||(e=t.MutationObserver),e}function dY(){const e=new _t,{stop:t}=yi(window,"open",()=>e.notify());return{observable:e,stop:t}}function fY(e,t,n,o,r){return{get:i=>{const l=n.findView(i),d=r.findUrl(i),f=t.findTrackedSession(i);if(f&&l&&d){const m=o.findActionId(i);return{application_id:e,session_id:f.id,user_action:m?{id:m}:void 0,view:{id:l.id,name:l.name,referrer:d.referrer,url:d.url}}}}}}const mY=JK,hY=cl;function pY(e){const t=hu({expireDelay:hY});e.subscribe(1,o=>{t.add(n(o),o.startClocks.relative)}),e.subscribe(6,({endClocks:o})=>{t.closeActive(o.relative)}),e.subscribe(3,o=>{const r=t.find(o.startClocks.relative);r&&(o.name&&(r.name=o.name),o.context&&(r.context=o.context),r.sessionIsActive=o.sessionIsActive)}),e.subscribe(10,()=>{t.reset()});function n(o){return{service:o.service,version:o.version,context:o.context,id:o.id,name:o.name,startClocks:o.startClocks}}return{findView:o=>t.find(o),stop:()=>{t.stop()}}}const B$="initial_document",gY=[[vr.DOCUMENT,e=>B$===e],[vr.XHR,e=>e==="xmlhttprequest"],[vr.FETCH,e=>e==="fetch"],[vr.BEACON,e=>e==="beacon"],[vr.CSS,(e,t)=>/\.css$/i.test(t)],[vr.JS,(e,t)=>/\.js$/i.test(t)],[vr.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[vr.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[vr.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function vY(e){const t=e.name;if(!mK(t))return na(`Failed to construct URL for "${e.name}"`),vr.OTHER;const n=hK(t);for(const[o,r]of gY)if(r(e.initiatorType,n))return o;return vr.OTHER}function zT(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function H$(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function yY(e){const{duration:t,startTime:n,responseEnd:o}=e;return t===0&&n<o?Qt(n,o):t}function bY(e){if(!q$(e))return;const{startTime:t,fetchStart:n,workerStart:o,redirectStart:r,redirectEnd:i,domainLookupStart:l,domainLookupEnd:d,connectStart:f,secureConnectionStart:m,connectEnd:p,requestStart:g,responseStart:v,responseEnd:b}=e,x={download:ja(t,v,b),first_byte:ja(t,g,v)};return 0<o&&o<n&&(x.worker=ja(t,o,n)),n<p&&(x.connect=ja(t,f,p),f<=m&&m<=p&&(x.ssl=ja(t,m,p))),n<d&&(x.dns=ja(t,l,d)),t<i&&(x.redirect=ja(t,r,i)),x}function G$(e){return e.duration>=0}function q$(e){const t=zT(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=xY(e)?zT(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function xY(e){return e.redirectEnd>e.startTime}function ja(e,t,n){if(e<=t&&t<=n)return{duration:ot(Qt(t,n)),start:ot(Qt(e,t))}}function _Y(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function wY(e){return e.deliveryType===""?"other":e.deliveryType}function SY(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:n,transferSize:o}=e;return{size:n,encoded_body_size:t,decoded_body_size:n,transfer_size:o}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function $S(e){return e&&(!_K(e)||Ug(Wa.TRACK_INTAKE_REQUESTS))}const CY=/data:(.+)?(;base64)?,/g,EY=24e3;function RY(e,t=EY){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(CY);return n?`${n[0]}[...]`:e}let UT=1;function jY(e,t,n,o,r){const i=LZ(t,n,o,r);NY(e,t,i),TY(e,i)}function NY(e,t,n){const o=tZ(t).subscribe(r=>{const i=r;if($S(i.url))switch(i.state){case"start":n.traceXhr(i,i.xhr),i.requestIndex=K$(),e.notify(7,{requestIndex:i.requestIndex,url:i.url});break;case"complete":n.clearTracingIfNeeded(i),e.notify(8,{duration:i.duration,method:i.method,requestIndex:i.requestIndex,spanId:i.spanId,startClocks:i.startClocks,status:i.status,traceId:i.traceId,traceSampled:i.traceSampled,type:Fg.XHR,url:i.url,xhr:i.xhr,isAborted:i.isAborted,handlingStack:i.handlingStack});break}});return{stop:()=>o.unsubscribe()}}function TY(e,t){const n=N$().subscribe(o=>{const r=o;if($S(r.url))switch(r.state){case"start":t.traceFetch(r),r.requestIndex=K$(),e.notify(7,{requestIndex:r.requestIndex,url:r.url});break;case"resolve":OY(r,i=>{t.clearTracingIfNeeded(r),e.notify(8,{duration:i,method:r.method,requestIndex:r.requestIndex,responseType:r.responseType,spanId:r.spanId,startClocks:r.startClocks,status:r.status,traceId:r.traceId,traceSampled:r.traceSampled,type:Fg.FETCH,url:r.url,response:r.response,init:r.init,input:r.input,isAborted:r.isAborted,handlingStack:r.handlingStack})});break}});return{stop:()=>n.unsubscribe()}}function K$(){const e=UT;return UT+=1,e}function OY(e,t){const n=e.response&&T7(e.response);!n||!n.body?t(Qt(e.startClocks.timeStamp,Bn())):NZ(n.body,()=>{t(Qt(e.startClocks.timeStamp,Bn()))},{bytesLimit:Number.POSITIVE_INFINITY})}function Z$(e){return jf(e)&&e<0?void 0:e}function Y$({lifeCycle:e,isChildEvent:t,onChange:n=Ot}){const o={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},r=e.subscribe(13,i=>{var l;if(!(i.type==="view"||i.type==="vital"||!t(i)))switch(i.type){case it.ERROR:o.errorCount+=1,n();break;case it.ACTION:o.actionCount+=1,i.action.frustration&&(o.frustrationCount+=i.action.frustration.type.length),n();break;case it.LONG_TASK:o.longTaskCount+=1,n();break;case it.RESOURCE:!((l=i._dd)===null||l===void 0)&&l.discarded||(o.resourceCount+=1,n());break}});return{stop:()=>{r.unsubscribe()},eventCounts:o}}function kY(e,t){const n=Oo();let o=!1;const{stop:r}=qs(e,window,["click","mousedown","keydown","touchstart","pointerdown"],d=>{if(!d.cancelable)return;const f={entryType:"first-input",processingStart:ro(),processingEnd:ro(),startTime:d.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};d.type==="pointerdown"?i(e,f):l(f)},{passive:!0,capture:!0});return{stop:r};function i(d,f){qs(d,window,["pointerup","pointercancel"],m=>{m.type==="pointerup"&&l(f)},{once:!0})}function l(d){if(!o){o=!0,r();const f=d.processingStart-d.startTime;f>=0&&f<Oo()-n&&t(d)}}}var St;(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"})(St||(St={}));function _i(e,t){return new _t(n=>{if(!window.PerformanceObserver)return;const o=f=>{const m=$Y(f);m.length>0&&n.notify(m)};let r,i=!0;const l=new PerformanceObserver(tt(f=>{i?r=sr(()=>o(f.getEntries())):o(f.getEntries())}));try{l.observe(t)}catch{if([St.RESOURCE,St.NAVIGATION,St.LONG_TASK,St.PAINT].includes(t.type)){t.buffered&&(r=sr(()=>o(performance.getEntriesByType(t.type))));try{l.observe({entryTypes:[t.type]})}catch{return}}}i=!1,AY(e);let d;return!fl(St.FIRST_INPUT)&&t.type===St.FIRST_INPUT&&({stop:d}=kY(e,f=>{o([f])})),()=>{l.disconnect(),d&&d(),Co(r)}})}let Nd;function AY(e){return!Nd&&IY()&&"addEventListener"in performance&&(Nd=Wt(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{Nd?.stop()}}function IY(){return window.performance!==void 0&&"getEntries"in performance}function fl(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function $Y(e){return e.filter(t=>!MY(t))}function MY(e){return e.entryType===St.RESOURCE&&(!$S(e.name)||!G$(e))}function X$(e){return e.nodeType===Node.TEXT_NODE}function PY(e){return e.nodeType===Node.COMMENT_NODE}function rs(e){return e.nodeType===Node.ELEMENT_NODE}function W$(e){return rs(e)&&!!e.shadowRoot}function DY(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&rs(t.host)}function Kye(e){return e.childNodes.length>0||W$(e)}function Zye(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;W$(e)&&t(e.shadowRoot)}function zY(e){return DY(e)?e.host:e.parentNode}const Q$=100,UY=100,LT="data-dd-excluded-activity-mutations";function MS(e,t,n,o,r,i){const l=FY(e,t,n,o);return LY(l,r,i)}function LY(e,t,n){let o,r=!1;const i=sr(tt(()=>m({hadActivity:!1})),Q$),l=n!==void 0?sr(tt(()=>m({hadActivity:!0,end:Bn()})),n):void 0,d=e.subscribe(({isBusy:p})=>{Co(i),Co(o);const g=Bn();p||(o=sr(tt(()=>m({hadActivity:!0,end:g})),UY))}),f=()=>{r=!0,Co(i),Co(o),Co(l),d.unsubscribe()};function m(p){r||(f(),t(p))}return{stop:f}}function FY(e,t,n,o){return new _t(r=>{const i=[];let l,d=0;return i.push(t.subscribe(m=>{m.every(VY)||f()}),n.subscribe(f),_i(o,{type:St.RESOURCE}).subscribe(m=>{m.some(p=>!Mx(o,p.name))&&f()}),e.subscribe(7,m=>{Mx(o,m.url)||(l===void 0&&(l=m.requestIndex),d+=1,f())}),e.subscribe(8,m=>{Mx(o,m.url)||l===void 0||m.requestIndex<l||(d-=1,f())})),()=>{i.forEach(m=>m.unsubscribe())};function f(){r.notify({isBusy:d>0})}})}function Mx(e,t){return jS(e.excludedActivityUrls,t)}function VY(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&rs(t)&&t.matches(`[${LT}], [${LT}] *`))}const Rt={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:qd.ALLOW,MASK:qd.MASK,MASK_USER_INPUT:qd.MASK_USER_INPUT},BY="data-dd-privacy",Yye="hidden",HY="dd-privacy-",Px="***",Xye="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",GY={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},qY="x";function J$(e,t,n){if(n&&n.has(e))return n.get(e);const o=zY(e),r=o?J$(o,t,n):t,i=eM(e),l=KY(i,r);return n&&n.set(e,l),l}function KY(e,t){switch(t){case Rt.HIDDEN:case Rt.IGNORE:return t}switch(e){case Rt.ALLOW:case Rt.MASK:case Rt.MASK_USER_INPUT:case Rt.HIDDEN:case Rt.IGNORE:return e;default:return t}}function eM(e){if(rs(e)){if(e.tagName==="BASE")return Rt.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return Rt.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return Rt.MASK}if(e.matches(bc(Rt.HIDDEN)))return Rt.HIDDEN;if(e.matches(bc(Rt.MASK)))return Rt.MASK;if(e.matches(bc(Rt.MASK_USER_INPUT)))return Rt.MASK_USER_INPUT;if(e.matches(bc(Rt.ALLOW)))return Rt.ALLOW;if(YY(e))return Rt.IGNORE}}function tM(e,t){switch(t){case Rt.MASK:case Rt.HIDDEN:case Rt.IGNORE:return!0;case Rt.MASK_USER_INPUT:return X$(e)?FT(e.parentNode):FT(e);default:return!1}}function FT(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!GY[t.tagName]}const ZY=e=>e.replace(/\S/g,qY);function Wye(e,t,n){var o;const r=(o=e.parentElement)===null||o===void 0?void 0:o.tagName;let i=e.textContent||"";if(t&&!i.trim())return;const l=n;if(r==="SCRIPT")i=Px;else if(l===Rt.HIDDEN)i=Px;else if(tM(e,l))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=Px:i=ZY(i);return i}function YY(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const n=t("rel");return/preload|prefetch/i.test(n)&&t("as")==="script"||n==="shortcut icon"||n==="icon"}if(e.nodeName==="META"){const n=t("name"),o=t("rel"),r=t("property");return/^msapplication-tile(image|color)$/.test(n)||n==="application-name"||o==="icon"||o==="apple-touch-icon"||o==="shortcut icon"||n==="keywords"||n==="description"||/^(og|twitter|fb):/.test(r)||/^(og|twitter):/.test(n)||n==="pinterest"||n==="robots"||n==="googlebot"||n==="bingbot"||e.hasAttribute("http-equiv")||n==="author"||n==="generator"||n==="framework"||n==="publisher"||n==="progid"||/^article:/.test(r)||/^product:/.test(r)||n==="google-site-verification"||n==="yandex-verification"||n==="csrf-token"||n==="p:domain_verify"||n==="verify-v1"||n==="verification"||n==="shopify-checkout-api-token"}function t(n){return(e.getAttribute(n)||"").toLowerCase()}return!1}function bc(e){return`[${BY}="${e}"], .${HY}${e}`}const Vg="data-dd-action-name",XY="Masked Element";function WY(e,{enablePrivacyForActionName:t,actionNameAttribute:n},o=Rt.ALLOW){const r=VT(e,Vg)||n&&VT(e,n);return r?{name:r,nameSource:"custom_attribute"}:o===Rt.MASK?{name:XY,nameSource:"mask_placeholder"}:BT(e,n,QY,t)||BT(e,n,JY,t)||{name:"",nameSource:"blank"}}function VT(e,t){const n=e.closest(`[${t}]`);if(!n)return;const o=n.getAttribute(t);return rM(nM(o.trim()))}const QY=[(e,t,n)=>{if("labels"in e&&e.labels&&e.labels.length>0)return cp(e.labels[0],t,n)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,n)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return cp(e,t,n)},e=>Td(e,"aria-label"),(e,t,n)=>{const o=e.getAttribute("aria-labelledby");if(o)return{name:o.split(/\s+/).map(r=>tX(e,r)).filter(r=>!!r).map(r=>oM(r,t,n)).join(" "),nameSource:"text_content"}},e=>Td(e,"alt"),e=>Td(e,"name"),e=>Td(e,"title"),e=>Td(e,"placeholder"),(e,t,n)=>{if("options"in e&&e.options.length>0)return cp(e.options[0],t,n)}],JY=[(e,t,n)=>cp(e,t,n)],eX=10;function BT(e,t,n,o){let r=e,i=0;for(;i<=eX&&r&&r.nodeName!=="BODY"&&r.nodeName!=="HTML"&&r.nodeName!=="HEAD";){for(const l of n){const d=l(r,t,o);if(d){const{name:f,nameSource:m}=d,p=f&&f.trim();if(p)return{name:rM(nM(p)),nameSource:m}}}if(r.nodeName==="FORM")break;r=r.parentElement,i+=1}}function nM(e){return e.replace(/\s+/g," ")}function rM(e){return e.length>100?`${zI(e,100)} [...]`:e}function tX(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function Td(e,t){return{name:e.getAttribute(t)||"",nameSource:"standard_attribute"}}function cp(e,t,n){return{name:oM(e,t,n)||"",nameSource:"text_content"}}function oM(e,t,n){if(!e.isContentEditable){if(Ug(Wa.USE_TREE_WALKER_FOR_ACTION_NAME))return nX(e,t,n);if("innerText"in e){let o=e.innerText;const r=i=>{const l=e.querySelectorAll(i);for(let d=0;d<l.length;d+=1){const f=l[d];if("innerText"in f){const m=f.innerText;m&&m.trim().length>0&&(o=o.replace(m,""))}}};return r(`[${Vg}]`),t&&r(`[${t}]`),n&&r(`${bc(Rt.HIDDEN)}, ${bc(Rt.MASK)}`),o}return e.textContent}}function nX(e,t,n){const o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,i);let r="";for(;o.nextNode();){const l=o.currentNode;if(rs(l)){(l.nodeName==="BR"||l.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(l).display))&&(r+=" ");continue}r+=l.textContent||""}return r.replace(/\s+/g," ").trim();function i(l){if(rs(l)){const d=eM(l);if(l.hasAttribute(Vg)||t&&l.hasAttribute(t)||n&&d&&tM(l,d))return NodeFilter.FILTER_REJECT;const f=getComputedStyle(l);if(f.visibility!=="visible"||f.display==="none"||f.contentVisibility&&f.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}const rX=[Vg,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],oX=[sM,sX],iX=[sM,aX,lX];function If(e,t){if(!e.isConnected)return;let n,o=e;for(;o&&o.nodeName!=="HTML";){const r=HT(o,oX,uX,t,n);if(r)return r;n=HT(o,iX,dX,t,n)||Bg(cX(o),n),o=o.parentElement}return n}function iM(e){return/[0-9]/.test(e)}function sX(e){if(e.id&&!iM(e.id))return`#${CSS.escape(e.id)}`}function aX(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const o=t[n];if(!iM(o))return`${CSS.escape(e.tagName)}.${CSS.escape(o)}`}}function lX(e){return CSS.escape(e.tagName)}function sM(e,t){if(t){const o=n(t);if(o)return o}for(const o of rX){const r=n(o);if(r)return r}function n(o){if(e.hasAttribute(o))return`${CSS.escape(e.tagName)}[${o}="${CSS.escape(e.getAttribute(o))}"]`}}function cX(e){let t=e.parentElement.firstElementChild,n=1;for(;t&&t!==e;)t.tagName===e.tagName&&(n+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${n})`}function HT(e,t,n,o,r){for(const i of t){const l=i(e,o);if(l&&n(e,l,r))return Bg(l,r)}}function uX(e,t,n){return e.ownerDocument.querySelectorAll(Bg(t,n)).length===1}function dX(e,t,n){let o;if(n===void 0)o=l=>l.matches(t);else{const l=Bg(`${t}:scope`,n);o=d=>d.querySelector(l)!==null}let i=e.parentElement.firstElementChild;for(;i;){if(i!==e&&o(i))return!1;i=i.nextElementSibling}return!0}function Bg(e,t){return t?`${e}>${t}`:e}const aM=lr,fX=100;function mX(e,t){const n=[];let o=0,r;i(e);function i(f){f.stopObservable.subscribe(l),n.push(f),Co(r),r=sr(d,aM)}function l(){o===1&&n.every(f=>f.isStopped())&&(o=2,t(n))}function d(){Co(r),o===0&&(o=1,l())}return{tryAppend:f=>o!==0?!1:n.length>0&&!hX(n[n.length-1].event,f.event)?(d(),!1):(i(f),!0),stop:()=>{d()}}}function hX(e,t){return e.target===t.target&&pX(e,t)<=fX&&e.timeStamp-t.timeStamp<=aM}function pX(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function gX(e,{onPointerDown:t,onPointerUp:n}){let o,r={selection:!1,input:!1,scroll:!1},i;const l=[Wt(e,window,"pointerdown",d=>{qT(d)&&(o=GT(),r={selection:!1,input:!1,scroll:!1},i=t(d))},{capture:!0}),Wt(e,window,"selectionchange",()=>{(!o||!GT())&&(r.selection=!0)},{capture:!0}),Wt(e,window,"scroll",()=>{r.scroll=!0},{capture:!0,passive:!0}),Wt(e,window,"pointerup",d=>{if(qT(d)&&i){const f=r;n(i,d,()=>f),i=void 0}},{capture:!0}),Wt(e,window,"input",()=>{r.input=!0},{capture:!0})];return{stop:()=>{l.forEach(d=>d.stop())}}}function GT(){const e=window.getSelection();return!e||e.isCollapsed}function qT(e){return e.target instanceof Element&&e.isPrimary!==!1}const KT=3;function vX(e,t){if(yX(e))return t.addFrustration(jd.RAGE_CLICK),e.some(ZT)&&t.addFrustration(jd.DEAD_CLICK),t.hasError&&t.addFrustration(jd.ERROR_CLICK),{isRage:!0};const n=e.some(o=>o.getUserActivity().selection);return e.forEach(o=>{o.hasError&&o.addFrustration(jd.ERROR_CLICK),ZT(o)&&!n&&o.addFrustration(jd.DEAD_CLICK)}),{isRage:!1}}function yX(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(KT-1);t+=1)if(e[t+KT-1].event.timeStamp-e[t].event.timeStamp<=lr)return!0;return!1}const bX='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 ZT(e){if(e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll)return!1;let t=e.event.target;return t.tagName==="LABEL"&&t.hasAttribute("for")&&(t=document.getElementById(t.getAttribute("for"))),!t||!t.matches(bX)}const lM=10*lr,Kd=new Map;function xX(e){const t=Kd.get(e);return Kd.delete(e),t}function cM(e,t){Kd.set(e,t),Kd.forEach((n,o)=>{Qt(o,ro())>lM&&Kd.delete(o)})}const _X=5*Ar;function wX(e,t,n,o){const r=hu({expireDelay:_X}),i=new _t;let l;e.subscribe(10,()=>{r.reset()}),e.subscribe(5,p),e.subscribe(11,g=>{g.reason===Ec.UNLOADING&&p()});const{stop:d}=gX(o,{onPointerDown:g=>SX(o,e,t,g,n),onPointerUp:({clickActionBase:g,hadActivityOnPointerDown:v},b,x)=>{CX(o,e,t,n,r,i,m,g,b,x,v)}});return{stop:()=>{p(),i.notify(),d()},actionContexts:{findActionId:g=>r.findAll(g)}};function m(g){if(!l||!l.tryAppend(g)){const v=g.clone();l=mX(g,b=>{RX(b,v)})}}function p(){l&&l.stop()}}function SX(e,t,n,o,r){const i=e.enablePrivacyForActionName?J$(o.target,e.defaultPrivacyLevel):Rt.ALLOW;if(i===Rt.HIDDEN)return;const l=EX(o,i,e);let d=!1;return MS(t,n,r,e,f=>{d=f.hadActivity},Q$),{clickActionBase:l,hadActivityOnPointerDown:()=>d}}function CX(e,t,n,o,r,i,l,d,f,m,p){var g;const v=uM(t,r,m,d,f);l(v);const b=(g=d?.target)===null||g===void 0?void 0:g.selector;b&&cM(f.timeStamp,b);const{stop:x}=MS(t,n,o,e,E=>{E.hadActivity&&E.end<v.startClocks.timeStamp?v.discard():E.hadActivity?v.stop(E.end):p()?v.stop(v.startClocks.timeStamp):v.stop()},lM),S=t.subscribe(5,({endClocks:E})=>{v.stop(E.timeStamp)}),C=i.subscribe(()=>{v.stop()});v.stopObservable.subscribe(()=>{S.unsubscribe(),x(),C.unsubscribe()})}function EX(e,t,n){const o=e.target.getBoundingClientRect(),r=If(e.target,n.actionNameAttribute);r&&cM(e.timeStamp,r);const i=WY(e.target,n,t);return{type:IS.CLICK,target:{width:Math.round(o.width),height:Math.round(o.height),selector:r},position:{x:Math.round(e.clientX-o.left),y:Math.round(e.clientY-o.top)},name:i.name,nameSource:i.nameSource}}function uM(e,t,n,o,r){const i=cr(),l=Gn(),d=t.add(i,l.relative),f=Y$({lifeCycle:e,isChildEvent:x=>x.action!==void 0&&(Array.isArray(x.action.id)?x.action.id.includes(i):x.action.id===i)});let m=0,p;const g=[],v=new _t;function b(x){m===0&&(p=x,m=1,p?d.close(yS(p)):d.remove(),f.stop(),v.notify())}return{event:r,stop:b,stopObservable:v,get hasError(){return f.eventCounts.errorCount>0},get hasPageActivity(){return p!==void 0},getUserActivity:n,addFrustration:x=>{g.push(x)},startClocks:l,isStopped:()=>m===1||m===2,clone:()=>uM(e,t,n,o,r),validate:x=>{if(b(),m!==1)return;const{resourceCount:S,errorCount:C,longTaskCount:E}=f.eventCounts,N={duration:p&&Qt(l.timeStamp,p),startClocks:l,id:i,frustrationTypes:g,counts:{resourceCount:S,errorCount:C,longTaskCount:E},events:x??[r],event:r,...o};e.notify(0,N),m=2},discard:()=>{b(),m=2}}}function RX(e,t){const{isRage:n}=vX(e,t);n?(e.forEach(o=>o.discard()),t.stop(Bn()),t.validate(e.map(o=>o.event))):(t.discard(),e.forEach(o=>o.validate()))}function jX(e,t,n,o,r){e.subscribe(0,d=>e.notify(12,YT(d))),t.register(0,({startTime:d,eventType:f})=>{if(f!==it.ERROR&&f!==it.RESOURCE&&f!==it.LONG_TASK)return oo;const m=i.findActionId(d);return m?{type:f,action:{id:m}}:oo}),t.register(1,({startTime:d})=>({action:{id:i.findActionId(d)}}));let i={findActionId:Ot},l=Ot;return r.trackUserInteractions&&({actionContexts:i,stop:l}=wX(e,n,o,r)),{addAction:d=>{e.notify(12,YT(d))},actionContexts:i,stop:l}}function YT(e){const t=Dx(e)?{action:{id:e.id,loading_time:Z$(ot(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:{context:e.context},n=ns({action:{id:cr(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:it.ACTION},t),o=Dx(e)?e.duration:void 0,r=Dx(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:o,startTime:e.startClocks.relative,domainContext:r}}function Dx(e){return e.type!==IS.CUSTOM}function NX(e){const t=pZ([Ag.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function TX(e,t){const n=MK(e,[af.cspViolation,af.intervention]).subscribe(o=>t.notify(o));return{stop:()=>{n.unsubscribe()}}}function OX(e,t,n){const o=new _t;return n.subscribe(r=>{r.type===0&&o.notify(r.error)}),NX(o),TX(t,o),o.subscribe(r=>e.notify(14,{error:r})),kX(e)}function kX(e){return e.subscribe(14,({error:t})=>{e.notify(12,AX(t))}),{addError:({error:t,handlingStack:n,componentStack:o,startClocks:r,context:i})=>{const l=_S({originalError:t,handlingStack:n,componentStack:o,startClocks:r,nonErrorPrefix:"Provided",source:fu.CUSTOM,handling:"handled"});l.context=ns(l.context,i),e.notify(14,{error:l})}}}function AX(e){const t={date:e.startClocks.timeStamp,error:{id:cr(),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:it.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const XT=new WeakSet;function IX(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const n=t.filter(o=>!XT.has(o)).filter(o=>G$(o)&&q$(o)).filter(o=>$X(o,e.startClocks.relative,dM({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return XT.add(n[0]),n[0].toJSON()}function dM(e){return cu(e.startTime,e.duration)}function $X(e,t,n){return e.startTime>=t-1&&dM(e)<=cu(n,1)}const MX=2*Ar;function PX(e){const t=DX(e)||zX(e);if(!(!t||t.traceTime<=Oo()-MX))return t.traceId}function DX(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return fM(t&&t.content,n&&n.content)}function zX(e){const t=UX(e);if(t)return fM(rf(t,"trace-id"),rf(t,"trace-time"))}function fM(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function UX(e){for(let t=0;t<e.childNodes.length;t+=1){const n=WT(e.childNodes[t]);if(n)return n}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const n=e.body.childNodes[t],o=WT(n);if(o)return o;if(!X$(n))break}}function WT(e){if(e&&PY(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function mM(){if(fl(St.NAVIGATION)){const n=performance.getEntriesByType(St.NAVIGATION)[0];if(n)return n}const e=LX(),t={entryType:St.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 LX(){const e={},t=performance.timing;for(const n in t)if(jf(t[n])){const o=n,r=t[o];e[o]=r===0?0:yS(r)}return e}function FX(e,t,n=mM){OS(e,"interactive",()=>{const o=n(),r=Object.assign(o.toJSON(),{entryType:St.RESOURCE,initiatorType:B$,duration:o.responseEnd,traceId:PX(document),toJSON:()=>({...r,toJSON:void 0})});t(r)})}const VX=1e3;function BX(e){const t=new Set,n=e.subscribe(8,o=>{t.add(o),t.size>VX&&(na("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(o){let r=1/0,i;for(const l of t){const d=o.startTime-l.startClocks.relative;0<=d&&d<r&&l.url===o.name&&(r=Math.abs(d),i=l)}return i&&t.delete(i),i},stop(){n.unsubscribe()}}}function HX(e,t,n,o=hZ(),r=FX){let i;const l=Ug(Wa.EARLY_REQUEST_COLLECTION);l?i=BX(e):e.subscribe(8,m=>{f(()=>GX(m,t,n))});const d=_i(t,{type:St.RESOURCE,buffered:!0}).subscribe(m=>{for(const p of m)(l||!H$(p))&&f(()=>QT(p,t,n,i))});r(t,m=>{f(()=>QT(m,t,n,i))});function f(m){o.push(()=>{const p=m();p&&e.notify(12,p)})}return{stop:()=>{d.unsubscribe()}}}function GX(e,t,n){const o=IX(e);return hM(o,e,n,t)}function QT(e,t,n,o){const r=H$(e)&&o?o.getMatchingRequest(e):void 0;return hM(e,r,n,t)}function hM(e,t,n,o){if(!e&&!t)return;const r=t?ZX(t,o):YX(e,o);if(!o.trackResources&&!r)return;const i=e?$g(e.startTime):t.startClocks,l=e?yY(e):XX(n,i,t.duration),d=ns({date:i.timeStamp,resource:{id:cr(),duration:ot(l),type:t?t.type===Fg.XHR?vr.XHR:vr.FETCH:vY(e),method:t?t.method:void 0,status_code:t?t.status:WX(e.responseStatus),url:t?RY(t.url):e.name,protocol:e&&_Y(e),delivery_type:e&&wY(e)},type:it.RESOURCE,_dd:{discarded:!o.trackResources}},r,e&&KX(e));return{startTime:i.relative,duration:l,rawRumEvent:d,domainContext:qX(e,t)}}function qX(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===Fg.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function KX(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...SY(e),...bY(e)}}}function ZX(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 YX(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:z$().toString(),rule_psr:t.rulePsr}}}function XX(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function WX(e){return e===0?void 0:e}function QX(e,t,n){const{stop:o,eventCounts:r}=Y$({lifeCycle:e,isChildEvent:i=>i.view.id===t,onChange:n});return{stop:o,eventCounts:r}}const JX=10*Ar;function eW(e,t,n){return{stop:_i(e,{type:St.PAINT,buffered:!0}).subscribe(r=>{const i=r.find(l=>l.name==="first-contentful-paint"&&l.startTime<t.timeStamp&&l.startTime<JX);i&&n(i.startTime)}).unsubscribe}}function tW(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(Qt(e,ro()))})})}function nW(e,t,n){const o=_i(e,{type:St.FIRST_INPUT,buffered:!0}).subscribe(r=>{const i=r.find(l=>l.startTime<t.timeStamp);if(i){const l=Qt(i.startTime,i.processingStart);let d;i.target&&rs(i.target)&&(d=If(i.target,e.actionNameAttribute)),n({delay:l>=0?l:0,time:i.startTime,targetSelector:d})}});return{stop:()=>{o.unsubscribe()}}}function rW(e,t,n=mM){return sW(e,()=>{const o=n();iW(o)||t(oW(o))})}function oW(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=ro()?e.responseStart:void 0}}function iW(e){return e.loadEventEnd<=0}function sW(e,t){let n;const{stop:o}=OS(e,"complete",()=>{n=sr(()=>t())});return{stop:()=>{o(),Co(n)}}}const aW=10*Ar;function lW(e,t,n,o){let r=1/0;const{stop:i}=qs(e,n,["pointerdown","keydown"],f=>{r=f.timeStamp},{capture:!0,once:!0});let l=0;const d=_i(e,{type:St.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(f=>{const m=Aq(f,p=>p.entryType===St.LARGEST_CONTENTFUL_PAINT&&p.startTime<r&&p.startTime<t.timeStamp&&p.startTime<aW&&p.size>l);if(m){let p;m.element&&(p=If(m.element,e.actionNameAttribute)),o({value:m.startTime,targetSelector:p,resourceUrl:cW(m)}),l=m.size}});return{stop:()=>{i(),d.unsubscribe()}}}function cW(e){return e.url===""?void 0:e.url}function pM(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:Ot};if(fl(St.VISIBILITY_STATE)){const i=performance.getEntriesByType(St.VISIBILITY_STATE).filter(l=>l.name==="hidden").find(l=>l.startTime>=t.relative);if(i)return{timeStamp:i.startTime,stop:Ot}}let o=1/0;const{stop:r}=qs(e,n,["pagehide","visibilitychange"],i=>{(i.type==="pagehide"||document.visibilityState==="hidden")&&(o=i.timeStamp,r())},{capture:!0});return{get timeStamp(){return o},stop:r}}function uW(e,t,n,o){const r={},{stop:i}=rW(e,g=>{n(g.loadEvent),r.navigationTimings=g,o()}),l=pM(e,t),{stop:d}=eW(e,l,g=>{r.firstContentfulPaint=g,o()}),{stop:f}=lW(e,l,window,g=>{r.largestContentfulPaint=g,o()}),{stop:m}=nW(e,l,g=>{r.firstInput=g,o()});function p(){i(),d(),f(),m(),l.stop()}return{stop:p,initialViewMetrics:r}}const iw=(e,t)=>e*t,dW=(e,t)=>{const n=Math.max(e.left,t.left),o=Math.max(e.top,t.top),r=Math.min(e.right,t.right),i=Math.min(e.bottom,t.bottom);return n>=r||o>=i?0:iw(r-n,i-o)},JT=e=>{const t=iw(e.previousRect.width,e.previousRect.height),n=iw(e.currentRect.width,e.currentRect.height),o=dW(e.previousRect,e.currentRect);return t+n-o};function fW(e,t,n){if(!vW())return{stop:Ot};let o=0,r;n({value:0});const i=gW(),l=_i(e,{type:St.LAYOUT_SHIFT,buffered:!0}).subscribe(d=>{var f;for(const m of d){if(m.hadRecentInput||m.startTime<t)continue;const{cumulatedValue:p,isMaxValue:g}=i.update(m);if(g){const v=mW(m.sources);r={target:v?.node?new WeakRef(v.node):void 0,time:Qt(t,m.startTime),previousRect:v?.previousRect,currentRect:v?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(p>o){o=p;const v=(f=r?.target)===null||f===void 0?void 0:f.deref();n({value:Hd(o,4),targetSelector:v&&If(v,e.actionNameAttribute),time:r?.time,previousRect:r?.previousRect?eO(r.previousRect):void 0,currentRect:r?.currentRect?eO(r.currentRect):void 0,devicePixelRatio:r?.devicePixelRatio})}}});return{stop:()=>{l.unsubscribe()}}}function mW(e){let t;for(const n of e)if(n.node&&rs(n.node)){const o=JT(n);(!t||JT(t)<o)&&(t=n)}return t}function eO({x:e,y:t,width:n,height:o}){return{x:e,y:t,width:n,height:o}}const hW=5*lr,pW=lr;function gW(){let e=0,t,n,o=0;return{update:r=>{const i=t===void 0||r.startTime-n>=pW||r.startTime-t>=hW;let l;return i?(t=n=r.startTime,o=e=r.value,l=!0):(e+=r.value,n=r.startTime,l=r.value>o,l&&(o=r.value)),{cumulatedValue:e,isMaxValue:l}}}}function vW(){return fl(St.LAYOUT_SHIFT)&&"WeakRef"in window}let up,gM=0,zx=1/0,Ux=0;function yW(){"interactionCount"in performance||up||(up=new window.PerformanceObserver(tt(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(zx=Math.min(zx,n.interactionId),Ux=Math.max(Ux,n.interactionId),gM=(Ux-zx)/7+1)})})),up.observe({type:"event",buffered:!0,durationThreshold:0}))}const tO=()=>up?gM:window.performance.interactionCount||0,nO=10,bW=1*Ar;function xW(e,t,n){if(!SW())return{getInteractionToNextPaint:()=>{},setViewEnd:Ot,stop:Ot};const{getViewInteractionCount:o,stopViewInteractionCount:r}=wW(n);let i=1/0;const l=_W(o);let d=-1,f,m;function p(b){for(const S of b)S.interactionId&&S.startTime>=t&&S.startTime<=i&&l.process(S);const x=l.estimateP98Interaction();x&&x.duration!==d&&(d=x.duration,m=Qt(t,x.startTime),f=xX(x.startTime),!f&&x.target&&rs(x.target)&&(f=If(x.target,e.actionNameAttribute)))}const g=_i(e,{type:St.FIRST_INPUT,buffered:!0}).subscribe(p),v=_i(e,{type:St.EVENT,durationThreshold:40,buffered:!0}).subscribe(p);return{getInteractionToNextPaint:()=>{if(d>=0)return{value:Math.min(d,bW),targetSelector:f,time:m};if(o())return{value:0}},setViewEnd:b=>{i=b,r()},stop:()=>{v.unsubscribe(),g.unsubscribe()}}}function _W(e){const t=[];function n(){t.sort((o,r)=>r.duration-o.duration).splice(nO)}return{process(o){const r=t.findIndex(l=>o.interactionId===l.interactionId),i=t[t.length-1];r!==-1?o.duration>t[r].duration&&(t[r]=o,n()):(t.length<nO||o.duration>i.duration)&&(t.push(o),n())},estimateP98Interaction(){const o=Math.min(t.length-1,Math.floor(e()/50));return t[o]}}}function wW(e){yW();const t=e===Yi.INITIAL_LOAD?0:tO();let n={stopped:!1};function o(){return tO()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:o(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:o()}}}}function SW(){return fl(St.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function CW(e,t,n,o,r,i,l){let d=r===Yi.INITIAL_LOAD,f=!0;const m=[],p=pM(o,i);function g(){if(!f&&!d&&m.length>0){const b=Math.max(...m);b<p.timeStamp-i.relative&&l(b)}}const{stop:v}=MS(e,t,n,o,b=>{f&&(f=!1,b.hadActivity&&m.push(Qt(i.timeStamp,b.end)),g())});return{stop:()=>{v(),p.stop()},setLoadEvent:b=>{d&&(d=!1,m.push(b),g())}}}function Qye(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function EW(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let Lx;function RW(e){return Lx||(Lx=jW(e)),Lx}function jW(e){return new _t(t=>{const{throttled:n}=Pg(()=>{t.notify(PS())},200);return Wt(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function PS(){const 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)}}const NW=lr;function TW(e,t,n,o=kW(e)){let r=0,i=0,l=0;const d=o.subscribe(({scrollDepth:f,scrollTop:m,scrollHeight:p})=>{let g=!1;if(f>r&&(r=f,g=!0),p>i){i=p;const v=ro();l=Qt(t.relative,v),g=!0}g&&n({maxDepth:Math.min(r,i),maxDepthScrollTop:m,maxScrollHeight:i,maxScrollHeightTime:l})});return{stop:()=>d.unsubscribe()}}function OW(){const e=EW(),{height:t}=PS(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),o=Math.round(t+e);return{scrollHeight:n,scrollDepth:o,scrollTop:e}}function kW(e,t=NW){return new _t(n=>{function o(){n.notify(OW())}if(window.ResizeObserver){const r=Pg(o,t,{leading:!1,trailing:!0}),i=document.scrollingElement||document.documentElement,l=new ResizeObserver(tt(r.throttled));i&&l.observe(i);const d=Wt(e,window,"scroll",r.throttled,{passive:!0});return()=>{r.cancel(),l.disconnect(),d.stop()}}})}function AW(e,t,n,o,r,i,l){const d={},{stop:f,setLoadEvent:m}=CW(e,t,n,o,i,l,S=>{d.loadingTime=S,r()}),{stop:p}=TW(o,l,S=>{d.scroll=S}),{stop:g}=fW(o,l.relative,S=>{d.cumulativeLayoutShift=S,r()}),{stop:v,getInteractionToNextPaint:b,setViewEnd:x}=xW(o,l.relative,i);return{stop:()=>{f(),g(),p()},stopINPTracking:v,setLoadEvent:m,setViewEnd:x,getCommonViewMetrics:()=>(d.interactionToNextPaint=b(),d)}}function IW(e,t){const{stop:n}=Wt(e,window,"pageshow",o=>{o.persisted&&t(o)},{capture:!0});return n}function $W(e,t,n){tW(e.relative,o=>{t.firstContentfulPaint=o,t.largestContentfulPaint={value:o},n()})}const MW=3e3,PW=5*Ar,DW=5*Ar;function zW(e,t,n,o,r,i,l,d){const f=new Set;let m=v(Yi.INITIAL_LOAD,kI(),d),p;b();let g;l&&(g=x(i),r.trackBfcacheViews&&(p=IW(r,S=>{m.end();const C=$g(S.timeStamp);m=v(Yi.BF_CACHE,C,void 0)})));function v(S,C,E){const N=UW(t,n,o,r,e,S,C,E);return f.add(N),N.stopObservable.subscribe(()=>{f.delete(N)}),N}function b(){t.subscribe(10,()=>{m=v(Yi.ROUTE_CHANGE,void 0,{name:m.name,service:m.service,version:m.version,context:m.contextManager.getContext()})}),t.subscribe(9,()=>{m.end({sessionIsActive:!1})})}function x(S){return S.subscribe(({oldLocation:C,newLocation:E})=>{FW(C,E)&&(m.end(),m=v(Yi.ROUTE_CHANGE))})}return{addTiming:(S,C=Bn())=>{m.addTiming(S,C)},startView:(S,C)=>{m.end({endClocks:C}),m=v(Yi.ROUTE_CHANGE,C,S)},setViewContext:S=>{m.contextManager.setContext(S)},setViewContextProperty:(S,C)=>{m.contextManager.setContextProperty(S,C)},setViewName:S=>{m.setViewName(S)},getViewContext:()=>m.contextManager.getContext(),stop:()=>{g&&g.unsubscribe(),p&&p(),m.end(),f.forEach(S=>S.stop())}}}function UW(e,t,n,o,r,i,l=Gn(),d){const f=cr(),m=new _t,p={};let g=0,v;const b=nf(r),x=Lg();let S=!0,C=d?.name;const E=d?.service||o.service,N=d?.version||o.version,j=d?.context;j&&x.setContext(j);const T={id:f,name:C,startClocks:l,service:E,version:N,context:j};e.notify(1,T),e.notify(2,T);const{throttled:O,cancel:A}=Pg($,MW,{leading:!1}),{setLoadEvent:I,setViewEnd:P,stop:U,stopINPTracking:V,getCommonViewMetrics:oe}=AW(e,t,n,o,se,i,l),{stop:ae,initialViewMetrics:de}=i===Yi.INITIAL_LOAD?uW(o,l,I,se):{stop:Ot,initialViewMetrics:{}};i===Yi.BF_CACHE&&$W(l,de,se);const{stop:ce,eventCounts:le}=QX(e,f,se),M=uu($,PW),Z=e.subscribe(11,q=>{q.reason===Ec.UNLOADING&&$()});$(),x.changeObservable.subscribe(se);function F(){e.notify(3,{id:f,name:C,context:x.getContext(),startClocks:l,sessionIsActive:S})}function se(){F(),O()}function $(){A(),F(),g+=1;const q=v===void 0?Bn():v.timeStamp;e.notify(4,{customTimings:p,documentVersion:g,id:f,name:C,service:E,version:N,context:x.getContext(),loadingType:i,location:b,startClocks:l,commonViewMetrics:oe(),initialViewMetrics:de,duration:Qt(l.timeStamp,q),isActive:v===void 0,sessionIsActive:S,eventCounts:le})}return{get name(){return C},service:E,version:N,contextManager:x,stopObservable:m,end(q={}){var te,B;v||(v=(te=q.endClocks)!==null&&te!==void 0?te:Gn(),S=(B=q.sessionIsActive)!==null&&B!==void 0?B:!0,e.notify(5,{endClocks:v}),e.notify(6,{endClocks:v}),Mg(M),P(v.relative),U(),Z.unsubscribe(),$(),sr(()=>{this.stop()},DW))},stop(){ae(),ce(),V(),m.notify()},addTiming(q,te){if(v)return;const B=Sq(te)?te:Qt(l.timeStamp,te);p[LW(q)]=B,se()},setViewName(q){C=q,$()}}}function LW(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&pt.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function FW(e,t){return e.pathname!==t.pathname||!VW(t.hash)&&rO(t.hash)!==rO(e.hash)}function VW(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function rO(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function BW(e,t,n,o,r,i,l,d,f,m){return e.subscribe(4,p=>e.notify(12,HW(p,n,d))),t.register(0,({startTime:p,eventType:g})=>{const v=f.findView(p);return v?{type:g,service:v.service,version:v.version,context:v.context,view:{id:v.id,name:v.name}}:Ks}),t.register(1,({startTime:p})=>{var g;return{view:{id:(g=f.findView(p))===null||g===void 0?void 0:g.id}}}),zW(o,e,r,i,n,l,!n.trackViewsManually,m)}function HW(e,t,n){var o,r,i,l,d,f,m,p,g,v,b,x,S,C,E,N,j,T;const O=n.getReplayStats(e.id),A=(r=(o=e.commonViewMetrics)===null||o===void 0?void 0:o.cumulativeLayoutShift)===null||r===void 0?void 0:r.devicePixelRatio,I={_dd:{document_version:e.documentVersion,replay_stats:O,cls:A?{device_pixel_ratio:A}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:it.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(i=e.commonViewMetrics.cumulativeLayoutShift)===null||i===void 0?void 0:i.value,cumulative_layout_shift_time:ot((l=e.commonViewMetrics.cumulativeLayoutShift)===null||l===void 0?void 0:l.time),cumulative_layout_shift_target_selector:(d=e.commonViewMetrics.cumulativeLayoutShift)===null||d===void 0?void 0:d.targetSelector,first_byte:ot((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.firstByte),dom_complete:ot((m=e.initialViewMetrics.navigationTimings)===null||m===void 0?void 0:m.domComplete),dom_content_loaded:ot((p=e.initialViewMetrics.navigationTimings)===null||p===void 0?void 0:p.domContentLoaded),dom_interactive:ot((g=e.initialViewMetrics.navigationTimings)===null||g===void 0?void 0:g.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:ot(e.initialViewMetrics.firstContentfulPaint),first_input_delay:ot((v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.delay),first_input_time:ot((b=e.initialViewMetrics.firstInput)===null||b===void 0?void 0:b.time),first_input_target_selector:(x=e.initialViewMetrics.firstInput)===null||x===void 0?void 0:x.targetSelector,interaction_to_next_paint:ot((S=e.commonViewMetrics.interactionToNextPaint)===null||S===void 0?void 0:S.value),interaction_to_next_paint_time:ot((C=e.commonViewMetrics.interactionToNextPaint)===null||C===void 0?void 0:C.time),interaction_to_next_paint_target_selector:(E=e.commonViewMetrics.interactionToNextPaint)===null||E===void 0?void 0:E.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:ot((N=e.initialViewMetrics.largestContentfulPaint)===null||N===void 0?void 0:N.value),largest_contentful_paint_target_selector:(j=e.initialViewMetrics.largestContentfulPaint)===null||j===void 0?void 0:j.targetSelector,load_event:ot((T=e.initialViewMetrics.navigationTimings)===null||T===void 0?void 0:T.loadEvent),loading_time:Z$(ot(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:GW(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:ot(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:ot(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:kZ()}};return ll(e.customTimings)||(I.view.custom_timings=$I(e.customTimings,ot)),{rawRumEvent:I,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function GW({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:o,largestContentfulPaint:r}){return{cls:e&&{score:e.value,timestamp:ot(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:ot(n)},fid:o&&{duration:ot(o.delay),timestamp:ot(o.time),target_selector:o.targetSelector},inp:t&&{duration:ot(t.value),timestamp:ot(t.time),target_selector:t.targetSelector},lcp:r&&{timestamp:ot(r.value),target_selector:r.targetSelector,resource_url:r.resourceUrl}}}const qW="rum";function KW(e,t,n){const o=KK(e,qW,r=>YW(e,r),n);return o.expireObservable.subscribe(()=>{t.notify(9)}),o.renewObservable.subscribe(()=>{t.notify(10)}),o.sessionStateUpdateObservable.subscribe(({previousState:r,newState:i})=>{if(!r.forcedReplay&&i.forcedReplay){const l=o.findSession();l&&(l.isReplayForced=!0)}}),{findTrackedSession:r=>{const i=o.findSession(r);if(!(!i||i.trackingType==="0"))return{id:i.id,sessionReplay:i.trackingType==="1"?1:i.isReplayForced?2:0,anonymousId:i.anonymousId}},expire:o.expire,expireObservable:o.expireObservable,setForcedReplay:()=>o.updateSessionState({forcedReplay:"1"})}}function ZW(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:m$("records")?1:0};return{findTrackedSession:()=>e,expire:Ot,expireObservable:new _t,setForcedReplay:Ot}}function YW(e,t){return XW(t)?t:es(e.sessionSampleRate)?es(e.sessionReplaySampleRate)?"1":"2":"0"}function XW(e){return e==="0"||e==="1"||e==="2"}function WW(e,t,n,o,r,i){const l=[e.rumEndpointBuilder];e.replica&&l.push(e.replica.rumEndpointBuilder);const d=h$({encoder:i(2),request:f$(l,e.batchBytesLimit,n),flushController:p$({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:o,sessionExpireObservable:r}),messageBytesLimit:e.messageBytesLimit});return t.subscribe(13,f=>{f.type===it.VIEW?d.upsert(f,f.view.id):d.add(f)}),d}function QW(e){const t=Af();e.subscribe(13,n=>{t.send("rum",n)})}const JW=cl;function eQ(e,t,n,o){const r=hu({expireDelay:JW});let i;e.subscribe(1,({startClocks:f})=>{const m=o.href;r.add(d({url:m,referrer:i||document.referrer}),f.relative),i=m}),e.subscribe(6,({endClocks:f})=>{r.closeActive(f.relative)});const l=n.subscribe(({newLocation:f})=>{const m=r.find();if(m){const p=ro();r.closeActive(p),r.add(d({url:f.href,referrer:m.referrer}),p)}});function d({url:f,referrer:m}){return{url:f,referrer:m}}return t.register(0,({startTime:f,eventType:m})=>{const p=r.find(f);return p?{type:m,view:{url:p.url,referrer:p.referrer}}:Ks}),{findUrl:f=>r.find(f),stop:()=>{l.unsubscribe(),r.stop()}}}function tQ(e,t){let n=nf(t);return new _t(o=>{const{stop:r}=nQ(e,l),{stop:i}=rQ(e,l);function l(){if(n.href===t.href)return;const d=nf(t);o.notify({newLocation:d,oldLocation:n}),n=d}return()=>{r(),i()}})}function nQ(e,t){const{stop:n}=yi(oO("pushState"),"pushState",({onPostCall:i})=>{i(t)}),{stop:o}=yi(oO("replaceState"),"replaceState",({onPostCall:i})=>{i(t)}),{stop:r}=Wt(e,window,"popstate",t);return{stop:()=>{n(),o(),r()}}}function rQ(e,t){return Wt(e,window,"hashchange",t)}function oO(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const oQ=cl;function iQ(e,t,n){const o=hu({expireDelay:oQ});return e.subscribe(1,({startClocks:r})=>{o.add({},r.relative)}),e.subscribe(6,({endClocks:r})=>{o.closeActive(r.relative)}),t.register(0,({startTime:r,eventType:i})=>{if(!n.trackFeatureFlagsForEvents.concat([it.VIEW,it.ERROR]).includes(i))return oo;const d=o.find(r);return!d||ll(d)?oo:{type:i,feature_flags:d}}),{addFeatureFlagEvaluation:(r,i)=>{const l=o.find();l&&(l[r]=i)}}}const sQ=10*lr;let Rc,Ah;function aQ(e,t,n,o){t.enabled&&es(e.customerDataTelemetrySampleRate)&&(vM(),Ah=!1,n.subscribe(13,()=>{Ah=!0}),o.subscribe(({bytesCount:i,messagesCount:l})=>{Ah&&(Ah=!1,Rc.batchCount+=1,sO(Rc.batchBytesCount,i),sO(Rc.batchMessagesCount,l))}),uu(lQ,sQ))}function lQ(){Rc.batchCount!==0&&(ES("Customer data measures",Rc),vM())}function iO(){return{min:1/0,max:0,sum:0}}function sO(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function vM(){Rc={batchCount:0,batchBytesCount:iO(),batchMessagesCount:iO()}}const cQ=4e3,uQ=500,dQ=cl;function fQ(e,t,n=uQ){const o=hu({expireDelay:dQ,maxEntries:cQ});let r;fl(St.VISIBILITY_STATE)&&performance.getEntriesByType(St.VISIBILITY_STATE).forEach(m=>{const p=m.name==="hidden"?"hidden":"active";l(p,m.startTime)}),l(yM(),ro());const{stop:i}=qs(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],f=>{l(hQ(f),f.timeStamp)},{capture:!0});function l(f,m=ro()){f!==r&&(r=f,o.closeActive(m),o.add({state:r,startTime:m},m))}function d(f,m,p){return o.findAll(m,p).some(g=>g.state===f)}return e.register(0,({startTime:f,duration:m=0,eventType:p})=>{if(p===it.VIEW){const g=o.findAll(f,m);return{type:p,_dd:{page_states:mQ(g,f,n)}}}return p===it.ACTION||p===it.ERROR?{type:p,view:{in_foreground:d("active",f,0)}}:oo}),{wasInPageStateDuringPeriod:d,addPageState:l,stop:()=>{i(),o.stop()}}}function mQ(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:o,startTime:r})=>({state:o,start:ot(Qt(t,r))}))}function hQ(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":yM()}function yM(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function pQ(e,t){let n;const o=requestAnimationFrame(tt(()=>{n=PS()})),r=RW(t).subscribe(i=>{n=i}).unsubscribe;return e.register(0,({eventType:i})=>({type:i,display:n?{viewport:n}:void 0})),{stop:()=>{r(),o&&cancelAnimationFrame(o)}}}function gQ(e,t){const n=window.cookieStore?vQ(e):bQ;return new _t(o=>n(t,r=>o.notify(r)))}function vQ(e){return(t,n)=>Wt(e,window.cookieStore,"change",r=>{const i=r.changed.find(l=>l.name===t)||r.deleted.find(l=>l.name===t);i&&n(i.value)}).stop}const yQ=lr;function bQ(e,t){const n=rf(document.cookie,e),o=uu(()=>{const r=rf(document.cookie,e);r!==n&&t(r)},yQ);return()=>{Mg(o)}}const aO="datadog-ci-visibility-test-execution-id";function xQ(e,t,n=gQ(e,aO)){var o;let r=Ds(aO)||((o=window.Cypress)===null||o===void 0?void 0:o.env("traceId"));const i=n.subscribe(l=>{r=l});return t.register(0,({eventType:l})=>typeof r!="string"?oo:{type:l,session:{type:"ci_test"},ci_test:{test_execution_id:r}}),{stop:()=>{i.unsubscribe()}}}function _Q(e,t){const n=_i(t,{type:St.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(o=>{for(const r of o){const i=$g(r.startTime),l={date:i.timeStamp,long_task:{id:cr(),entry_type:A$.LONG_ANIMATION_FRAME,duration:ot(r.duration),blocking_duration:ot(r.blockingDuration),first_ui_event_timestamp:ot(r.firstUIEventTimestamp),render_start:ot(r.renderStart),style_and_layout_start:ot(r.styleAndLayoutStart),start_time:ot(r.startTime),scripts:r.scripts.map(d=>({duration:ot(d.duration),pause_duration:ot(d.pauseDuration),forced_style_and_layout_duration:ot(d.forcedStyleAndLayoutDuration),start_time:ot(d.startTime),execution_start:ot(d.executionStart),source_url:d.sourceURL,source_function_name:d.sourceFunctionName,source_char_position:d.sourceCharPosition,invoker:d.invoker,invoker_type:d.invokerType,window_attribution:d.windowAttribution}))},type:it.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:l,startTime:i.relative,duration:r.duration,domainContext:{performanceEntry:r}})}});return{stop:()=>n.unsubscribe()}}function wQ(e,t){const n=_i(t,{type:St.LONG_TASK,buffered:!0}).subscribe(o=>{for(const r of o){if(r.entryType!==St.LONG_TASK||!t.trackLongTasks)break;const i=$g(r.startTime),l={date:i.timeStamp,long_task:{id:cr(),entry_type:A$.LONG_TASK,duration:ot(r.duration)},type:it.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:l,startTime:i.relative,duration:r.duration,domainContext:{performanceEntry:r}})}});return{stop(){n.unsubscribe()}}}function SQ(e){e.register(0,({eventType:t})=>{if(!j$())return oo;const n=E$(),o=R$();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:o,injected:C$()}}})}function CQ(e,t,n){const o=SS(e),r=n(o);return bS(t).forEach(([i,l])=>sw(e,o,i.split(/\.|(?=\[\])/),l)),r}function sw(e,t,n,o){const[r,...i]=n;if(r==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((l,d)=>sw(l,t[d],i,o));return}if(!(!lO(e)||!lO(t))){if(i.length>0)return sw(e[r],t[r],i,o);EQ(e,r,t[r],o)}}function EQ(e,t,n,o){const r=dl(n);r===o?e[t]=cn(n):o==="object"&&(r==="undefined"||r==="null")&&(e[t]={})}function lO(e){return dl(e)==="object"}const lc={"view.name":"string","view.url":"string","view.referrer":"string"},cc={context:"object"},uc={service:"string",version:"string"};let bM;function RQ(e,t,n,o){bM={[it.VIEW]:{"view.performance.lcp.resource_url":"string",...cc,...lc,...uc},[it.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...cc,...lc,...uc},[it.RESOURCE]:{"resource.url":"string",...Ug(Wa.WRITABLE_RESOURCE_GRAPHQL)?{"resource.graphql":"object"}:{},...cc,...lc,...uc},[it.ACTION]:{"action.target.name":"string",...cc,...lc,...uc},[it.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...cc,...lc,...uc},[it.VITAL]:{...cc,...lc,...uc}};const r={[it.ERROR]:Tx(it.ERROR,e.eventRateLimiterThreshold,o),[it.ACTION]:Tx(it.ACTION,e.eventRateLimiterThreshold,o),[it.VITAL]:Tx(it.VITAL,e.eventRateLimiterThreshold,o)};t.subscribe(12,({startTime:i,duration:l,rawRumEvent:d,domainContext:f})=>{const m=n.triggerHook(0,{eventType:d.type,startTime:i,duration:l});if(m===Ks)return;const p=ns(m,d,{ddtags:RK(e).join(",")});jQ(p,e.beforeSend,f,r)&&(ll(p.context)&&delete p.context,t.notify(13,p))})}function jQ(e,t,n,o){var r;if(t){const l=CQ(e,bM[e.type],d=>t(d,n));if(l===!1&&e.type!==it.VIEW)return!1;l===!1&&pt.warn("Can't dismiss view events using beforeSend!")}return!((r=o[e.type])===null||r===void 0?void 0:r.isLimitReached())}function NQ(e,t,n,o){e.register(0,({eventType:r,startTime:i})=>{const l=t.findTrackedSession(i),d=o.findView(i);if(!l||!d)return Ks;let f,m,p;return r===it.VIEW?(f=n.getReplayStats(d.id)?!0:void 0,m=l.sessionReplay===1,p=d.sessionIsActive?void 0:!1):f=n.isRecording()?!0:void 0,{type:r,session:{id:l.id,type:"user",has_replay:f,sampled_for_replay:m,is_active:p}}}),e.register(1,({startTime:r})=>{const i=t.findTrackedSession(r);return i?{session:{id:i.id}}:oo})}function TQ(e){e.register(0,({eventType:t})=>({type:t,connectivity:o$()}))}function OQ(e,t,n){e.register(0,({eventType:o})=>{const r=t.source;return{type:o,_dd:{format_version:2,drift:_q(),configuration:{session_sample_rate:Hd(t.sessionSampleRate,3),session_replay_sample_rate:Hd(t.sessionReplaySampleRate,3),profiling_sample_rate:Hd(t.profilingSampleRate,3)},browser_sdk_version:Bc()?"6.19.0":void 0,sdk_name:n},application:{id:t.applicationId},date:Bn(),source:r}}),e.register(1,()=>({application:{id:t.applicationId}}))}function kQ(e,t){e.register(1,()=>t.isGranted()?oo:Ks)}const AQ=B7,IQ=[it.ACTION,it.ERROR,it.LONG_TASK,it.RESOURCE,it.VITAL];function $Q(e){return{addEvent:(t,n,o,r)=>{IQ.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:o,duration:r})}}}const MQ="Initial view metrics";function PQ(e,t,n){if(!(n.enabled&&es(e.initialViewMetricsTelemetrySampleRate)))return{stop:Ot};const{unsubscribe:r}=t.subscribe(4,({initialViewMetrics:i})=>{!i.largestContentfulPaint||!i.navigationTimings||(ES(MQ,{metrics:DQ(i.largestContentfulPaint,i.navigationTimings)}),r())});return{stop:r}}function DQ(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function zQ(e,t,n,o,r,i,l,d,f){const m=[],p=new mY,g=AQ();p.subscribe(13,me=>r$("rum",me));const v=me=>{p.notify(14,{error:me}),na("Error reported to customer",{"error.message":me.message})},b=F7(e),x=b.subscribe(me=>{p.notify(11,me)});m.push(()=>x.unsubscribe());const S=q7("browser-rum-sdk",e,g,v,b,r);m.push(S.stop);const C=Bc()?ZW():KW(e,p,i);if(Bc())QW(p);else{const me=WW(e,p,v,b,C.expireObservable,r);m.push(()=>me.stop()),aQ(e,S,p,me.flushController.flushObservable)}const E=cY(),N=tQ(e,location),{observable:j,stop:T}=dY();m.push(T),OQ(g,e,f);const O=fQ(g,e),A=pY(p);m.push(()=>A.stop());const I=eQ(p,g,N,location);m.push(()=>I.stop());const P=iQ(p,g,e);NQ(g,C,t,A),TQ(g),kQ(g,i);const U=RZ(g,e,"rum"),V=jZ(g,e,C,"rum"),oe=EZ(g,e,"rum"),{actionContexts:ae,addAction:de,addEvent:ce,stop:le}=UQ(p,g,e,O,E,j,v);m.push(le);const{addTiming:M,startView:Z,setViewName:F,setViewContext:se,setViewContextProperty:$,getViewContext:q,stop:te}=BW(p,g,e,location,E,j,N,t,A,o);m.push(te);const{stop:B}=PQ(e,p,S);m.push(B);const{stop:J}=HX(p,e,O);if(m.push(J),e.trackLongTasks)if(fl(St.LONG_ANIMATION_FRAME)){const{stop:me}=_Q(p,e);m.push(me)}else wQ(p,e);const{addError:be}=OX(p,e,d);d.unbuffer(),jY(p,e,C,V,oe);const ge=IZ(p,O,l),ie=fY(e.applicationId,C,A,ae,I);return m.push(()=>n.stop()),{addAction:de,addEvent:ce,addError:be,addTiming:M,addFeatureFlagEvaluation:P.addFeatureFlagEvaluation,startView:Z,setViewContext:se,setViewContextProperty:$,getViewContext:q,setViewName:F,lifeCycle:p,viewHistory:A,session:C,stopSession:()=>C.expire(),getInternalContext:ie.get,startDurationVital:ge.startDurationVital,stopDurationVital:ge.stopDurationVital,addDurationVital:ge.addDurationVital,globalContext:U,userContext:V,accountContext:oe,telemetry:S,stop:()=>{m.forEach(me=>me())},hooks:g}}function UQ(e,t,n,o,r,i,l){const d=jX(e,t,r,i,n),f=$Q(e),m=pQ(t,n),p=xQ(n,t);return SQ(t),RQ(n,e,t,l),{pageStateHistory:o,addAction:d.addAction,addEvent:f.addEvent,actionContexts:d.actionContexts,stop:()=>{d.stop(),p.stop(),m.stop(),o.stop()}}}function LQ(e,{session:t,viewContext:n,errorType:o}){const r=t?t.id:"no-session-id",i=[];o!==void 0&&i.push(`error-type=${o}`),n&&(i.push(`seed=${n.id}`),i.push(`from=${n.startClocks.timeStamp}`));const l=FQ(e),d=`/rum/replay/sessions/${r}`;return`${l}${d}?${i.join("&")}`}function FQ(e){const t=e.site,n=e.subdomain||VQ(e);return`https://${n?`${n}.`:""}${t}`}function VQ(e){switch(e.site){case Ia:case S7:return"app";case n$:return"dd";default:return}}const BQ=1e3;let So;function Jye(e){return Hg(e).segments_count}function ebe(e){Hg(e).segments_count+=1}function tbe(e){Hg(e).records_count+=1}function nbe(e,t){Hg(e).segments_total_raw_size+=t}function HQ(e){return So?.get(e)}function Hg(e){So||(So=new Map);let t;return So.has(e)?t=So.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},So.set(e,t),So.size>BQ&&GQ()),t}function GQ(){if(!So)return;const e=So.keys().next().value;e&&So.delete(e)}function xM(e,t,n){let o=0,r=[],i,l=!0,d=0;const f=[],{stop:m}=Wt(e,t,"message",({data:v})=>{if(v.type!=="wrote"||v.streamId!==n)return;const b=f[0];b&&(b.id===v.id?(f.shift(),o+=v.additionalBytesCount,r.push(v.result),i=v.trailer,b.writeCallback?b.writeCallback(v.result.byteLength):b.finishCallback&&b.finishCallback()):b.id<v.id&&(m(),na("Worker responses received out of order.")))});function p(){const v=r.length===0?new Uint8Array(0):Eq(r.concat(i)),b={rawBytesCount:o,output:v,outputBytesCount:v.byteLength,encoding:"deflate"};return o=0,r=[],b}function g(){l||(t.postMessage({action:"reset",streamId:n}),l=!0)}return{isAsync:!0,get isEmpty(){return l},write(v,b){t.postMessage({action:"write",id:d,data:v,streamId:n}),f.push({id:d,writeCallback:b,data:v}),l=!1,d+=1},finish(v){g(),f.length?(f.forEach(b=>{delete b.writeCallback}),f[f.length-1].finishCallback=()=>v(p())):v(p())},finishSync(){g();const v=f.map(b=>b.data).join("");return f.length=0,{...p(),pendingData:v}},estimateEncodedBytesCount(v){return v.length/8},stop(){m()}}}function DS({configuredUrl:e,error:t,source:n,scriptType:o}){if(pt.error(`${n} failed to start: an error occurred while initializing the ${o}:`,t),t instanceof Event||t instanceof Error&&qQ(t.message)){let r;e?r=`Please make sure the ${o} URL ${e} is correct and CSP is correctly configured.`:r="Please make sure CSP is correctly configured.",pt.error(`${r} See documentation at ${Ig}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else o==="worker"&&CS(t)}function qQ(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const KQ=30*lr;function _M(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){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;)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)}(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);i.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.19.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)}}()})();'])))}let un={status:0};function wM(e,t,n,o=_M){switch(un.status===0&&ZQ(e,t,o),un.status){case 1:return un.initializationFailureCallbacks.push(n),un.worker;case 3:return un.worker}}function cO(){return un.status}function ZQ(e,t,n=_M){try{const o=n(e),{stop:r}=Wt(e,o,"error",d=>{Fx(e,t,d)}),{stop:i}=Wt(e,o,"message",({data:d})=>{d.type==="errored"?Fx(e,t,d.error,d.streamId):d.type==="initialized"&&XQ(d.version)});o.postMessage({action:"init"}),sr(()=>YQ(t),KQ),un={status:1,worker:o,stop:()=>{r(),i()},initializationFailureCallbacks:[]}}catch(o){Fx(e,t,o)}}function YQ(e){un.status===1&&(pt.error(`${e} failed to start: a timeout occurred while initializing the Worker`),un.initializationFailureCallbacks.forEach(t=>t()),un={status:2})}function XQ(e){un.status===1&&(un={status:3,worker:un.worker,stop:un.stop,version:e})}function Fx(e,t,n,o){un.status===1||un.status===0?(DS({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),un.status===1&&un.initializationFailureCallbacks.forEach(r=>r()),un={status:2}):CS(n,{worker_version:un.status===3&&un.version,stream_id:o})}function SM(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function WQ(e,t,n,o){const r=t.findTrackedSession(),i=QQ(r,o),l=n.findView();return LQ(e,{viewContext:l,errorType:i,session:r})}function QQ(e,t){if(!SM())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}const JQ="Recorder init metrics";function eJ(e,t,n){if(!(t.enabled&&es(e.replayTelemetrySampleRate)))return{stop:Ot};let r,i,l;const{unsubscribe:d}=n.subscribe(f=>{switch(f.type){case"start":r={forced:f.forced,timestamp:Bn()},i=void 0,l=void 0;break;case"document-ready":r&&(i=Qt(r.timestamp,Bn()));break;case"recorder-settled":r&&(l=Qt(r.timestamp,Bn()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":d(),r&&ES(JQ,{metrics:tJ(r.forced,l,Qt(r.timestamp,Bn()),f.type,i)});break}});return{stop:d}}function tJ(e,t,n,o,r){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:o,waitForDocReadyDuration:r}}function nJ(e,t,n,o,r,i,l){let d=0,f;t.subscribe(9,()=>{(d===2||d===3)&&(v(),d=1)}),t.subscribe(10,()=>{d===1&&g()});const m=new _t;eJ(e,l,m);const p=async b=>{m.notify({type:"start",forced:b});const[x]=await Promise.all([uO(m,{type:"recorder-settled"},r()),uO(m,{type:"document-ready"},eZ(e,"interactive"))]);if(d!==2){m.notify({type:"aborted"});return}if(!x){d=0,m.notify({type:"recorder-load-failed"});return}const S=i();if(!S){d=0,m.notify({type:"deflate-encoder-load-failed"});return}({stop:f}=x(t,e,n,o,S,l)),d=3,m.notify({type:"succeeded"})};function g(b){const x=n.findTrackedSession();if(rJ(x,b)){d=1;return}if(oJ(d))return;d=2;const S=iJ(x,b)||!1;p(S).catch(Lc),S&&n.setForcedReplay()}function v(){d===3&&f?.(),d=0}return{start:g,stop:v,getSessionReplayLink(){return WQ(e,n,o,d!==0)},isRecording:()=>d===3}}function rJ(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function oJ(e){return e===2||e===3}function iJ(e,t){return t&&t.force&&e.sessionReplay===0}async function uO(e,t,n){try{return await n}finally{e.notify(t)}}function sJ(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:Ot},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function aJ(e,t){if(Bc()&&!m$("records")||!SM())return{start:Ot,stop:Ot,getReplayStats:()=>{},onRumStart:Ot,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:o}=sJ();return{start:i=>n.start(i),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:r,isRecording:()=>cO()===3&&n.isRecording(),getReplayStats:i=>cO()===3?HQ(i):void 0};function r(i,l,d,f,m,p){let g;function v(){return g||(m??(m=wM(l,"Datadog Session Replay",()=>{n.stop()},t)),m&&(g=xM(l,m,1))),g}n=nJ(l,i,d,f,e,v,p),o(l)&&n.start()}}const lJ="modulepreload",cJ=function(e){return"/"+e},dO={},zS=function(t,n,o){let r=Promise.resolve();if(n&&n.length>0){let f=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),d=l?.nonce||l?.getAttribute("nonce");r=f(n.map(m=>{if(m=cJ(m),m in dO)return;dO[m]=!0;const p=m.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const v=document.createElement("link");if(v.rel=p?"stylesheet":lJ,p||(v.as="script"),v.crossOrigin="",v.href=m,d&&v.setAttribute("nonce",d),document.head.appendChild(v),p)return new Promise((b,x)=>{v.addEventListener("load",b),v.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${m}`)))})}))}function i(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return r.then(l=>{for(const d of l||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};async function uJ(e=dJ){try{return await e()}catch(t){DS({error:t,source:"Recorder",scriptType:"module"})}}async function dJ(){return(await zS(()=>import("./startRecording-Cxpf6x5g.js"),[])).startRecording}function fJ(){return Xo().Profiler!==void 0}const mJ=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==it.VIEW&&n!==it.LONG_TASK?oo:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function hJ(e=pJ){try{return await e()}catch(t){DS({error:t,source:"Profiler",scriptType:"module"})}}async function pJ(){return(await zS(()=>import("./profiler-CBPieNr1.js"),[])).createRumProfiler}function gJ(){let e;function t(n,o,r,i,l){const d=i.findTrackedSession();if(!d||!D$(d.id,r.profilingSampleRate))return;const f=mJ(o);if(!fJ()){f.set({status:"error",error_reason:"not-supported-by-browser"});return}hJ().then(m=>{if(!m){na("[DD_RUM] Failed to lazy load the RUM Profiler"),f.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=m(r,n,i,f),e.start(l.findView())}).catch(Lc)}return{onRumStart:t,stop:()=>{e?.stop().catch(Lc)}}}const vJ=aJ(uJ),yJ=gJ(),bJ=aY(zQ,vJ,yJ,{startDeflateWorker:wM,createDeflateEncoder:xM,sdkName:"rum"});$K(Xo(),"DD_RUM",bJ);function dp(e,t){sf("react error"),Gn()}const fO={didCatch:!1,error:null};class rbe extends G.Component{constructor(t){super(t),this.resetError=()=>{this.setState(fO)},this.state=fO}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}componentDidCatch(t,n){dp()}render(){return this.state.didCatch?G.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}}let mO=!1;function xJ(){_.useEffect(()=>{mO||(mO=!0)},[])}function _J(){return c.jsx(c.Fragment,{children:c.jsx(ss,{})})}const Gg=m9()({component:_J});function wJ(e,t){const n=_.createContext(t),o=i=>{const{children:l,...d}=i,f=_.useMemo(()=>d,Object.values(d));return c.jsx(n.Provider,{value:f,children:l})};o.displayName=e+"Provider";function r(i){const l=_.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function Wo(e,t=[]){let n=[];function o(i,l){const d=_.createContext(l),f=n.length;n=[...n,l];const m=g=>{const{scope:v,children:b,...x}=g,S=v?.[e]?.[f]||d,C=_.useMemo(()=>x,Object.values(x));return c.jsx(S.Provider,{value:C,children:b})};m.displayName=i+"Provider";function p(g,v){const b=v?.[e]?.[f]||d,x=_.useContext(b);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[m,p]}const r=()=>{const i=n.map(l=>_.createContext(l));return function(d){const f=d?.[e]||i;return _.useMemo(()=>({[`__scope${e}`]:{...d,[e]:f}}),[d,f])}};return r.scopeName=e,[o,SJ(r,...t)]}function SJ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const l=o.reduce((d,{useScope:f,scopeName:m})=>{const g=f(i)[`__scope${m}`];return{...d,...g}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function we(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var CJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=CJ.reduce((e,t)=>{const n=Ba(`Primitive.${t}`),o=_.forwardRef((r,i)=>{const{asChild:l,...d}=r,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(f,{...d,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Mp(e,t){e&&au.flushSync(()=>e.dispatchEvent(t))}var Sn=globalThis?.document?_.useLayoutEffect:()=>{},EJ=cA[" useInsertionEffect ".trim().toString()]||Sn;function wi({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,l]=RJ({defaultProp:t,onChange:n}),d=e!==void 0,f=d?e:r;{const p=_.useRef(e!==void 0);_.useEffect(()=>{const g=p.current;g!==d&&console.warn(`${o} is changing from ${g?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=d},[d,o])}const m=_.useCallback(p=>{if(d){const g=jJ(p)?p(e):p;g!==e&&l.current?.(g)}else i(p)},[d,e,i,l]);return[f,m]}function RJ({defaultProp:e,onChange:t}){const[n,o]=_.useState(e),r=_.useRef(n),i=_.useRef(t);return EJ(()=>{i.current=t},[t]),_.useEffect(()=>{r.current!==n&&(i.current?.(n),r.current=n)},[n,r]),[n,o,i]}function jJ(e){return typeof e=="function"}var NJ=_.createContext(void 0);function pu(e){const t=_.useContext(NJ);return e||t||"ltr"}function TJ(e,t){return _.useReducer((n,o)=>t[n][o]??n,e)}var Pn=e=>{const{present:t,children:n}=e,o=OJ(t),r=typeof n=="function"?n({present:o.isPresent}):_.Children.only(n),i=st(o.ref,kJ(r));return typeof n=="function"||o.isPresent?_.cloneElement(r,{ref:i}):null};Pn.displayName="Presence";function OJ(e){const[t,n]=_.useState(),o=_.useRef(null),r=_.useRef(e),i=_.useRef("none"),l=e?"mounted":"unmounted",[d,f]=TJ(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const m=Ih(o.current);i.current=d==="mounted"?m:"none"},[d]),Sn(()=>{const m=o.current,p=r.current;if(p!==e){const v=i.current,b=Ih(m);e?f("MOUNT"):b==="none"||m?.display==="none"?f("UNMOUNT"):f(p&&v!==b?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,f]),Sn(()=>{if(t){let m;const p=t.ownerDocument.defaultView??window,g=b=>{const S=Ih(o.current).includes(CSS.escape(b.animationName));if(b.target===t&&S&&(f("ANIMATION_END"),!r.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",m=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=b=>{b.target===t&&(i.current=Ih(o.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(m),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:_.useCallback(m=>{o.current=m?getComputedStyle(m):null,n(m)},[])}}function Ih(e){return e?.animationName||"none"}function kJ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var AJ=cA[" useId ".trim().toString()]||(()=>{}),IJ=0;function Xr(e){const[t,n]=_.useState(AJ());return Sn(()=>{n(o=>o??String(IJ++))},[e]),t?`radix-${t}`:""}function $f(e){const t=e+"CollectionProvider",[n,o]=Wo(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=S=>{const{scope:C,children:E}=S,N=G.useRef(null),j=G.useRef(new Map).current;return c.jsx(r,{scope:C,itemMap:j,collectionRef:N,children:E})};l.displayName=t;const d=e+"CollectionSlot",f=Ba(d),m=G.forwardRef((S,C)=>{const{scope:E,children:N}=S,j=i(d,E),T=st(C,j.collectionRef);return c.jsx(f,{ref:T,children:N})});m.displayName=d;const p=e+"CollectionItemSlot",g="data-radix-collection-item",v=Ba(p),b=G.forwardRef((S,C)=>{const{scope:E,children:N,...j}=S,T=G.useRef(null),O=st(C,T),A=i(p,E);return G.useEffect(()=>(A.itemMap.set(T,{ref:T,...j}),()=>void A.itemMap.delete(T))),c.jsx(v,{[g]:"",ref:O,children:N})});b.displayName=p;function x(S){const C=i(e+"CollectionConsumer",S);return G.useCallback(()=>{const N=C.collectionRef.current;if(!N)return[];const j=Array.from(N.querySelectorAll(`[${g}]`));return Array.from(C.itemMap.values()).sort((A,I)=>j.indexOf(A.ref.current)-j.indexOf(I.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:m,ItemSlot:b},x,o]}function Kt(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>t.current?.(...n),[])}function $J(e,t=globalThis?.document){const n=Kt(e);_.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var MJ="DismissableLayer",aw="dismissableLayer.update",PJ="dismissableLayer.pointerDownOutside",DJ="dismissableLayer.focusOutside",hO,CM=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gu=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:l,onDismiss:d,...f}=e,m=_.useContext(CM),[p,g]=_.useState(null),v=p?.ownerDocument??globalThis?.document,[,b]=_.useState({}),x=st(t,I=>g(I)),S=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),E=S.indexOf(C),N=p?S.indexOf(p):-1,j=m.layersWithOutsidePointerEventsDisabled.size>0,T=N>=E,O=LJ(I=>{const P=I.target,U=[...m.branches].some(V=>V.contains(P));!T||U||(r?.(I),l?.(I),I.defaultPrevented||d?.())},v),A=FJ(I=>{const P=I.target;[...m.branches].some(V=>V.contains(P))||(i?.(I),l?.(I),I.defaultPrevented||d?.())},v);return $J(I=>{N===m.layers.size-1&&(o?.(I),!I.defaultPrevented&&d&&(I.preventDefault(),d()))},v),_.useEffect(()=>{if(p)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(hO=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),pO(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=hO)}},[p,v,n,m]),_.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),pO())},[p,m]),_.useEffect(()=>{const I=()=>b({});return document.addEventListener(aw,I),()=>document.removeEventListener(aw,I)},[]),c.jsx(Pe.div,{...f,ref:x,style:{pointerEvents:j?T?"auto":"none":void 0,...e.style},onFocusCapture:we(e.onFocusCapture,A.onFocusCapture),onBlurCapture:we(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:we(e.onPointerDownCapture,O.onPointerDownCapture)})});gu.displayName=MJ;var zJ="DismissableLayerBranch",UJ=_.forwardRef((e,t)=>{const n=_.useContext(CM),o=_.useRef(null),r=st(t,o);return _.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),c.jsx(Pe.div,{...e,ref:r})});UJ.displayName=zJ;function LJ(e,t=globalThis?.document){const n=Kt(e),o=_.useRef(!1),r=_.useRef(()=>{});return _.useEffect(()=>{const i=d=>{if(d.target&&!o.current){let f=function(){EM(PJ,n,m,{discrete:!0})};const m={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=f,t.addEventListener("click",r.current,{once:!0})):f()}else t.removeEventListener("click",r.current);o.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function FJ(e,t=globalThis?.document){const n=Kt(e),o=_.useRef(!1);return _.useEffect(()=>{const r=i=>{i.target&&!o.current&&EM(DJ,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function pO(){const e=new CustomEvent(aw);document.dispatchEvent(e)}function EM(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Mp(r,i):r.dispatchEvent(i)}function RM(e){const t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var jM=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),VJ="VisuallyHidden",NM=_.forwardRef((e,t)=>c.jsx(Pe.span,{...e,ref:t,style:{...jM,...e.style}}));NM.displayName=VJ;var TM=NM,ml="NavigationMenu",[US,OM,BJ]=$f(ml),[lw,HJ,GJ]=$f(ml),[LS,obe]=Wo(ml,[BJ,GJ]),[qJ,ko]=LS(ml),[KJ,ZJ]=LS(ml),kM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:i,delayDuration:l=200,skipDelayDuration:d=300,orientation:f="horizontal",dir:m,...p}=e,[g,v]=_.useState(null),b=st(t,U=>v(U)),x=pu(m),S=_.useRef(0),C=_.useRef(0),E=_.useRef(0),[N,j]=_.useState(!0),[T,O]=wi({prop:o,onChange:U=>{const V=U!=="",oe=d>0;V?(window.clearTimeout(E.current),oe&&j(!1)):(window.clearTimeout(E.current),E.current=window.setTimeout(()=>j(!0),d)),r?.(U)},defaultProp:i??"",caller:ml}),A=_.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>O(""),150)},[O]),I=_.useCallback(U=>{window.clearTimeout(C.current),O(U)},[O]),P=_.useCallback(U=>{T===U?window.clearTimeout(C.current):S.current=window.setTimeout(()=>{window.clearTimeout(C.current),O(U)},l)},[T,O,l]);return _.useEffect(()=>()=>{window.clearTimeout(S.current),window.clearTimeout(C.current),window.clearTimeout(E.current)},[]),c.jsx(AM,{scope:n,isRootMenu:!0,value:T,dir:x,orientation:f,rootNavigationMenu:g,onTriggerEnter:U=>{window.clearTimeout(S.current),N?P(U):I(U)},onTriggerLeave:()=>{window.clearTimeout(S.current),A()},onContentEnter:()=>window.clearTimeout(C.current),onContentLeave:A,onItemSelect:U=>{O(V=>V===U?"":U)},onItemDismiss:()=>O(""),children:c.jsx(Pe.nav,{"aria-label":"Main","data-orientation":f,dir:x,...p,ref:b})})});kM.displayName=ml;var cw="NavigationMenuSub",YJ=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:i,orientation:l="horizontal",...d}=e,f=ko(cw,n),[m,p]=wi({prop:o,onChange:r,defaultProp:i??"",caller:cw});return c.jsx(AM,{scope:n,isRootMenu:!1,value:m,dir:f.dir,orientation:l,rootNavigationMenu:f.rootNavigationMenu,onTriggerEnter:g=>p(g),onItemSelect:g=>p(g),onItemDismiss:()=>p(""),children:c.jsx(Pe.div,{"data-orientation":l,...d,ref:t})})});YJ.displayName=cw;var AM=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:o,dir:r,orientation:i,children:l,value:d,onItemSelect:f,onItemDismiss:m,onTriggerEnter:p,onTriggerLeave:g,onContentEnter:v,onContentLeave:b}=e,[x,S]=_.useState(null),[C,E]=_.useState(new Map),[N,j]=_.useState(null);return c.jsx(qJ,{scope:t,isRootMenu:n,rootNavigationMenu:o,value:d,previousValue:RM(d),baseId:Xr(),dir:r,orientation:i,viewport:x,onViewportChange:S,indicatorTrack:N,onIndicatorTrackChange:j,onTriggerEnter:Kt(p),onTriggerLeave:Kt(g),onContentEnter:Kt(v),onContentLeave:Kt(b),onItemSelect:Kt(f),onItemDismiss:Kt(m),onViewportContentChange:_.useCallback((T,O)=>{E(A=>(A.set(T,O),new Map(A)))},[]),onViewportContentRemove:_.useCallback(T=>{E(O=>O.has(T)?(O.delete(T),new Map(O)):O)},[]),children:c.jsx(US.Provider,{scope:t,children:c.jsx(KJ,{scope:t,items:C,children:l})})})},IM="NavigationMenuList",$M=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=ko(IM,n),i=c.jsx(Pe.ul,{"data-orientation":r.orientation,...o,ref:t});return c.jsx(Pe.div,{style:{position:"relative"},ref:r.onIndicatorTrackChange,children:c.jsx(US.Slot,{scope:n,children:r.isRootMenu?c.jsx(FM,{asChild:!0,children:i}):i})})});$M.displayName=IM;var MM="NavigationMenuItem",[XJ,PM]=LS(MM),DM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,...r}=e,i=Xr(),l=o||i||"LEGACY_REACT_AUTO_VALUE",d=_.useRef(null),f=_.useRef(null),m=_.useRef(null),p=_.useRef(()=>{}),g=_.useRef(!1),v=_.useCallback((x="start")=>{if(d.current){p.current();const S=dw(d.current);S.length&&BS(x==="start"?S:S.reverse())}},[]),b=_.useCallback(()=>{if(d.current){const x=dw(d.current);x.length&&(p.current=see(x))}},[]);return c.jsx(XJ,{scope:n,value:l,triggerRef:f,contentRef:d,focusProxyRef:m,wasEscapeCloseRef:g,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:b,onContentFocusOutside:b,children:c.jsx(Pe.li,{...r,ref:t})})});DM.displayName=MM;var uw="NavigationMenuTrigger",WJ=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:o,...r}=e,i=ko(uw,e.__scopeNavigationMenu),l=PM(uw,e.__scopeNavigationMenu),d=_.useRef(null),f=st(d,l.triggerRef,t),m=BM(i.baseId,l.value),p=HM(i.baseId,l.value),g=_.useRef(!1),v=_.useRef(!1),b=l.value===i.value;return c.jsxs(c.Fragment,{children:[c.jsx(US.ItemSlot,{scope:n,value:l.value,children:c.jsx(VM,{asChild:!0,children:c.jsx(Pe.button,{id:m,disabled:o,"data-disabled":o?"":void 0,"data-state":HS(b),"aria-expanded":b,"aria-controls":p,...r,ref:f,onPointerEnter:we(e.onPointerEnter,()=>{v.current=!1,l.wasEscapeCloseRef.current=!1}),onPointerMove:we(e.onPointerMove,Pp(()=>{o||v.current||l.wasEscapeCloseRef.current||g.current||(i.onTriggerEnter(l.value),g.current=!0)})),onPointerLeave:we(e.onPointerLeave,Pp(()=>{o||(i.onTriggerLeave(),g.current=!1)})),onClick:we(e.onClick,()=>{i.onItemSelect(l.value),v.current=b}),onKeyDown:we(e.onKeyDown,x=>{const C={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];b&&x.key===C&&(l.onEntryKeyDown(),x.preventDefault())})})})}),b&&c.jsxs(c.Fragment,{children:[c.jsx(TM,{"aria-hidden":!0,tabIndex:0,ref:l.focusProxyRef,onFocus:x=>{const S=l.contentRef.current,C=x.relatedTarget,E=C===d.current,N=S?.contains(C);(E||!N)&&l.onFocusProxyEnter(E?"start":"end")}}),i.viewport&&c.jsx("span",{"aria-owns":p})]})]})});WJ.displayName=uw;var QJ="NavigationMenuLink",gO="navigationMenu.linkSelect",zM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:o,onSelect:r,...i}=e;return c.jsx(VM,{asChild:!0,children:c.jsx(Pe.a,{"data-active":o?"":void 0,"aria-current":o?"page":void 0,...i,ref:t,onClick:we(e.onClick,l=>{const d=l.target,f=new CustomEvent(gO,{bubbles:!0,cancelable:!0});if(d.addEventListener(gO,m=>r?.(m),{once:!0}),Mp(d,f),!f.defaultPrevented&&!l.metaKey){const m=new CustomEvent(fp,{bubbles:!0,cancelable:!0});Mp(d,m)}},{checkForDefaultPrevented:!1})})})});zM.displayName=QJ;var FS="NavigationMenuIndicator",JJ=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=ko(FS,e.__scopeNavigationMenu),i=!!r.value;return r.indicatorTrack?hS.createPortal(c.jsx(Pn,{present:n||i,children:c.jsx(eee,{...o,ref:t})}),r.indicatorTrack):null});JJ.displayName=FS;var eee=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=ko(FS,n),i=OM(n),[l,d]=_.useState(null),[f,m]=_.useState(null),p=r.orientation==="horizontal",g=!!r.value;_.useEffect(()=>{const x=i().find(S=>S.value===r.value)?.ref.current;x&&d(x)},[i,r.value]);const v=()=>{l&&m({size:p?l.offsetWidth:l.offsetHeight,offset:p?l.offsetLeft:l.offsetTop})};return fw(l,v),fw(r.indicatorTrack,v),f?c.jsx(Pe.div,{"aria-hidden":!0,"data-state":g?"visible":"hidden","data-orientation":r.orientation,...o,ref:t,style:{position:"absolute",...p?{left:0,width:f.size+"px",transform:`translateX(${f.offset}px)`}:{top:0,height:f.size+"px",transform:`translateY(${f.offset}px)`},...o.style}}):null}),Hc="NavigationMenuContent",tee=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=ko(Hc,e.__scopeNavigationMenu),i=PM(Hc,e.__scopeNavigationMenu),l=st(i.contentRef,t),d=i.value===r.value,f={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...o};return r.viewport?c.jsx(nee,{forceMount:n,...f,ref:l}):c.jsx(Pn,{present:n||d,children:c.jsx(UM,{"data-state":HS(d),...f,ref:l,onPointerEnter:we(e.onPointerEnter,r.onContentEnter),onPointerLeave:we(e.onPointerLeave,Pp(r.onContentLeave)),style:{pointerEvents:!d&&r.isRootMenu?"none":void 0,...f.style}})})});tee.displayName=Hc;var nee=_.forwardRef((e,t)=>{const n=ko(Hc,e.__scopeNavigationMenu),{onViewportContentChange:o,onViewportContentRemove:r}=n;return Sn(()=>{o(e.value,{ref:t,...e})},[e,t,o]),Sn(()=>()=>r(e.value),[e.value,r]),null}),fp="navigationMenu.rootContentDismiss",UM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,triggerRef:r,focusProxyRef:i,wasEscapeCloseRef:l,onRootContentClose:d,onContentFocusOutside:f,...m}=e,p=ko(Hc,n),g=_.useRef(null),v=st(g,t),b=BM(p.baseId,o),x=HM(p.baseId,o),S=OM(n),C=_.useRef(null),{onItemDismiss:E}=p;_.useEffect(()=>{const j=g.current;if(p.isRootMenu&&j){const T=()=>{E(),d(),j.contains(document.activeElement)&&r.current?.focus()};return j.addEventListener(fp,T),()=>j.removeEventListener(fp,T)}},[p.isRootMenu,e.value,r,E,d]);const N=_.useMemo(()=>{const T=S().map(V=>V.value);p.dir==="rtl"&&T.reverse();const O=T.indexOf(p.value),A=T.indexOf(p.previousValue),I=o===p.value,P=A===T.indexOf(o);if(!I&&!P)return C.current;const U=(()=>{if(O!==A){if(I&&A!==-1)return O>A?"from-end":"from-start";if(P&&O!==-1)return O>A?"to-start":"to-end"}return null})();return C.current=U,U},[p.previousValue,p.value,p.dir,S,o]);return c.jsx(FM,{asChild:!0,children:c.jsx(gu,{id:x,"aria-labelledby":b,"data-motion":N,"data-orientation":p.orientation,...m,ref:v,disableOutsidePointerEvents:!1,onDismiss:()=>{const j=new Event(fp,{bubbles:!0,cancelable:!0});g.current?.dispatchEvent(j)},onFocusOutside:we(e.onFocusOutside,j=>{f();const T=j.target;p.rootNavigationMenu?.contains(T)&&j.preventDefault()}),onPointerDownOutside:we(e.onPointerDownOutside,j=>{const T=j.target,O=S().some(I=>I.ref.current?.contains(T)),A=p.isRootMenu&&p.viewport?.contains(T);(O||A||!p.isRootMenu)&&j.preventDefault()}),onKeyDown:we(e.onKeyDown,j=>{const T=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!T){const A=dw(j.currentTarget),I=document.activeElement,P=A.findIndex(oe=>oe===I),V=j.shiftKey?A.slice(0,P).reverse():A.slice(P+1,A.length);BS(V)?j.preventDefault():i.current?.focus()}}),onEscapeKeyDown:we(e.onEscapeKeyDown,j=>{l.current=!0})})})}),VS="NavigationMenuViewport",LM=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,i=!!ko(VS,e.__scopeNavigationMenu).value;return c.jsx(Pn,{present:n||i,children:c.jsx(ree,{...o,ref:t})})});LM.displayName=VS;var ree=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:o,...r}=e,i=ko(VS,n),l=st(t,i.onViewportChange),d=ZJ(Hc,e.__scopeNavigationMenu),[f,m]=_.useState(null),[p,g]=_.useState(null),v=f?f?.width+"px":void 0,b=f?f?.height+"px":void 0,x=!!i.value,S=x?i.value:i.previousValue;return fw(p,()=>{p&&m({width:p.offsetWidth,height:p.offsetHeight})}),c.jsx(Pe.div,{"data-state":HS(x),"data-orientation":i.orientation,...r,ref:l,style:{pointerEvents:!x&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":v,"--radix-navigation-menu-viewport-height":b,...r.style},onPointerEnter:we(e.onPointerEnter,i.onContentEnter),onPointerLeave:we(e.onPointerLeave,Pp(i.onContentLeave)),children:Array.from(d.items).map(([E,{ref:N,forceMount:j,...T}])=>{const O=S===E;return c.jsx(Pn,{present:j||O,children:c.jsx(UM,{...T,ref:yf(N,A=>{O&&A&&g(A)})})},E)})})}),oee="FocusGroup",FM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=ko(oee,n);return c.jsx(lw.Provider,{scope:n,children:c.jsx(lw.Slot,{scope:n,children:c.jsx(Pe.div,{dir:r.dir,...o,ref:t})})})}),vO=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],iee="FocusGroupItem",VM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=HJ(n),i=ko(iee,n);return c.jsx(lw.ItemSlot,{scope:n,children:c.jsx(Pe.button,{...o,ref:t,onKeyDown:we(e.onKeyDown,l=>{if(["Home","End",...vO].includes(l.key)){let f=r().map(g=>g.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(l.key)&&f.reverse(),vO.includes(l.key)){const g=f.indexOf(l.currentTarget);f=f.slice(g+1)}setTimeout(()=>BS(f)),l.preventDefault()}})})})});function dw(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function BS(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function see(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function fw(e,t){const n=Kt(t);Sn(()=>{let o=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(o),r.unobserve(e)}}},[e,n])}function HS(e){return e?"open":"closed"}function BM(e,t){return`${e}-trigger-${t}`}function HM(e,t){return`${e}-content-${t}`}function Pp(e){return t=>t.pointerType==="mouse"?e(t):void 0}var aee=kM,lee=$M,cee=DM,uee=zM,dee=LM;function fee({className:e,...t}){return c.jsx("div",{className:De("absolute top-full left-0 isolate z-50 flex justify-center"),children:c.jsx(dee,{"data-slot":"navigation-menu-viewport",className:De("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",e),...t})})}function GM({className:e,children:t,viewport:n=!0,...o}){return c.jsxs(aee,{"data-slot":"navigation-menu","data-viewport":n,className:De("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...o,children:[t,n&&c.jsx(fee,{})]})}function Dp({className:e,...t}){return c.jsx(cee,{"data-slot":"navigation-menu-item",className:De("relative",e),...t})}function zp({className:e,...t}){return c.jsx(uee,{"data-slot":"navigation-menu-link",className:De("hover:text-white ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",e),...t})}function qM({className:e,...t}){return c.jsx(lee,{"data-slot":"navigation-menu-list",className:De("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}function Mf(e){const{instanceId:t,clusterId:n}=Ze({strict:!1});return Us({id:wn,operationsUrl:e})}function Pf(e){const{instanceId:t,clusterId:n}=Ze({strict:!1});return{instanceClient:Us({id:wn,operationsUrl:e}),entityType:"instance"}}function ur(e){const{instanceId:t,clusterId:n}=Ze({strict:!1}),o=wn;return{instanceClient:Us({id:o,operationsUrl:e}),entityId:o,entityType:"instance"}}async function mee(){Hn.setUserForEntity(wn,null),ef.getQueryCache().clear(),await ef.invalidateQueries({refetchType:"none"})}async function hee(e){await Hn.signOutFromPotentiallyAuthenticatedInstances(),await Ef(e)}function pee(){const e=Mf();return at({mutationFn:()=>hee({instanceClient:e}),onSuccess:mee})}function Df(e){const{user:t}=Rf(),{organizationId:n}=Ze({strict:!1}),o=t?.roles?.[e??n];return!o?.permission&&!o?.organization?{update:!1,remove:!1}:o.permission?.super_user?{update:!0,remove:!0}:{update:o.organization.update,remove:o.organization.delete}}function vu(e){const{user:t}=Rf(),{organizationId:n}=Ze({strict:!1}),o=t?.roles?.[e??n];if(!o?.permission&&!o?.organization?.roles)return{create:!1,remove:!1,update:!1,view:!1};if(o.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const r=o.organization.roles;return{create:r.create,remove:r.delete,update:r.update,view:r.view}}function GS(e,t){const{user:n}=Rf(),{organizationId:o,clusterId:r}=Ze({strict:!1}),i=t??r,l=n?.roles?.[e??o];if(!l?.permission&&!l?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(l.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const d=l.organization.clusters.resources?.find(m=>m.id===i),f=l.organization.clusters;return{create:f.create,remove:d?d.delete:f.delete,update:d?d.update:f.update,view:d?d.view:f.view}}function KM(e){const{clusterId:t,instanceId:n}=Ze({strict:!1}),{user:o}=ta(n??t),r=o?.role?.permission;return r?r.super_user===!0:!1}function qS(e){const{clusterId:t,instanceId:n}=Ze({strict:!1}),{user:o}=ta(n??t),r=o?.role?.permission;return r?r.super_user===!0||r.structure_user===!0:!1}function Vx(e,t,n,o){const{clusterId:r,instanceId:i}=Ze({strict:!1}),{user:l}=ta(e??i??r),d=l?.role?.permission;return d?d.super_user===!0||d.structure_user===!0?!0:d[t]?.tables?.[n][o]===!0:!1}const gee={className:"text-white"};function vee({signOut:e}){const{user:t}=al();lu(t);const{organizationId:n}=Ze({strict:!1}),{update:o}=Df(n),{view:r}=vu(n),[i,l]=_.useState(!1);return c.jsxs("div",{className:"md:hidden",id:"mobile-menu",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs(Ue,{to:ea,children:[c.jsx(KS,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-alpha.7"})]}),c.jsxs("button",{type:"button",className:"shadow-xs text-grey-400 hover:text-white hover:bg-black-dark",onClick:()=>{l(!i)},children:[c.jsx("span",{className:"sr-only",children:i?"Close menu":"Open menu"}),i?c.jsx(jI,{}):c.jsx(CI,{})]})]}),c.jsxs("div",{className:`${i?"block":"hidden"} md:hidden space-y-1 pb-3 bg-black-dark absolute left-0 top-full w-full rounded-b-md`,children:[!Ic,!Ic,c.jsxs(Ue,{to:"/docs",className:"flex flex-row px-3 py-2 text-base font-medium text-gray-300 rounded-md hover:bg-gray-700 hover:text-white",children:[c.jsx(pS,{className:"mr-4"})," Docs"]}),c.jsxs(Ue,{to:void 0,onClick:e,className:"flex flex-row px-3 py-2 text-base font-medium text-gray-300 rounded-md hover:bg-gray-700 hover:text-white",children:[c.jsx(SI,{className:"mr-4"})," Sign Out"]})]})]})}function yee({signOut:e}){const{user:t}=al();lu(t);const{organizationId:n}=Ze({strict:!1}),{update:o}=Df(n),{view:r}=vu(n);return c.jsx("div",{className:"hidden md:block",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"inline-block",children:c.jsxs(Ue,{to:ea,children:[c.jsx(KS,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-alpha.7"})]})}),c.jsx(GM,{children:c.jsxs(qM,{className:"text-grey-400",children:[!Ic,!Ic,c.jsx(Dp,{children:c.jsx(zp,{asChild:!0,children:c.jsxs(Ue,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[c.jsx(pS,{})," ",c.jsx("span",{className:"hidden lg:inline-block",children:"Docs"})]})})}),c.jsx(Dp,{children:c.jsx(zp,{asChild:!0,children:c.jsxs(Ue,{to:void 0,onClick:e,className:"flex-row items-center",children:[c.jsx(SI,{})," ",c.jsx("span",{className:"hidden lg:inline-block",children:"Sign Out"})]})})})]})})]})})}function bee(){return c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"inline-block",children:c.jsxs(Ue,{to:"/",children:[c.jsx(KS,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-alpha.7"})]})}),c.jsx(GM,{children:c.jsxs(qM,{className:"text-grey-400",children:[c.jsx(Dp,{children:c.jsx(zp,{asChild:!0,children:c.jsxs(Ue,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[c.jsx(pS,{})," ",c.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),c.jsx(Dp,{children:c.jsx(zp,{asChild:!0,children:c.jsxs(Ue,{to:"/",className:"flex-row items-center",activeProps:gee,children:[c.jsx(hG,{})," Sign In"]})})})]})})]})}function KS(){return c.jsxs(c.Fragment,{children:[c.jsx("img",{src:"/logo_harper_db_studio.png",alt:"logo",className:"w-64 hidden md:inline-block"}),c.jsx("img",{src:"/HDBDogOnly.svg",width:"50px",height:"44px",alt:"Harper",className:"inline-block md:hidden"})]})}function ZM(){const{mutate:e}=pee(),t=hn(),{user:n}=al(),o=Cn(),r=_.useCallback(()=>{e(void 0,{onSuccess:async()=>{Ee.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}),t({to:"/sign-in"}),o.invalidate()}})},[e,o,t]);return n?c.jsxs(c.Fragment,{children:[c.jsx(vee,{signOut:r}),c.jsx(yee,{signOut:r})]}):c.jsx(bee,{})}function $h({title:e,children:t}){return c.jsxs("li",{className:"list-image-(--checkmark-icon) mt-4",children:[c.jsx("h3",{className:"text-xl font-bold",children:e}),t]})}function xee(){return c.jsxs(c.Fragment,{children:[c.jsx("header",{className:"fixed top-0 z-40 w-full h-20 p-4 bg-black-dark dark:bg-black-dark dark:border-b dark:border-black md:px-12",children:c.jsx(ZM,{})}),c.jsxs("div",{className:"pt-20 grid h-screen grid-cols-1 md:grid-cols-2",children:[c.jsx("section",{className:"items-center justify-center hidden text-white md:flex bg-linear-(--blue-pink-gradient) px-6",children:c.jsxs("div",{children:[c.jsx("h1",{className:"text-4xl font-bold",children:"Harper Studio"}),c.jsx("span",{children:"Manage all your Harper instances."}),c.jsxs("ul",{className:"ps-5",children:[c.jsx($h,{title:"Manage All Instances",children:c.jsx("span",{children:"View, create, and delete instances from one location."})}),c.jsx($h,{title:"Embedded API Server",children:c.jsx("span",{children:"Harper components give you unlimited application flexibility"})}),c.jsx($h,{title:"Fully Managed Cloud & 5G Instances",children:c.jsx("span",{children:"Go from zero to code in minutes."})}),c.jsx($h,{title:"Deploy Anywhere",children:c.jsxs("div",{className:"mt-6",children:[c.jsx("a",{href:"https://hub.docker.com/r/harperdb/harperdb",target:"_blank",rel:"noreferrer noopener",className:"p-2 mr-2 border-2 border-blue-100 rounded-md",children:"Docker"}),c.jsx("a",{href:"https://www.npmjs.com/package/harperdb",target:"_blank",rel:"noreferrer noopener",className:"p-2 mr-2 border-2 border-blue-100 rounded-md",children:"npm"}),c.jsx("a",{href:"https://docs.harperdb.io/docs/deployments/install-harperdb",target:"_blank",rel:"noreferrer noopener",className:"p-2 border-2 border-blue-100 rounded-md",children:"all options"})]})})]})]})}),c.jsx("section",{className:"flex items-center justify-center px-6 bg-linear-(--purple-gradient) dark:bg-linear-(--black-dark-gradient)",children:c.jsx(ss,{})})]})]})}function _ee(e){if(!e)return"";const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!t)return"";const n=t.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!n)return"";const o=[];for(let i=0;i<n.length;i++){const l=n[i],d=i+1<n.length?n[i+1]:void 0;/^[A-Z]{2,}$/.test(l)&&d==="s"?(o.push(l+"s"),i++):/^[A-Z]$/.test(l)&&d!==void 0&&/^[A-Z]s$/.test(d)?(o.push(l+d),i++):o.push(l)}return o.map(i=>/^[A-Z]{2,}s?$/.test(i)||/^[0-9]+$/.test(i)?i:i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join(" ")}function qg(){const e=O9(),t=T9({strict:!1}),n=_.useMemo(()=>{const o=e.pathname.split("/").filter(i=>i&&i.length>0),r=[c.jsxs(Ue,{to:"/",children:[c.jsx(cG,{"aria-hidden":"true",className:"size-5 shrink-0"}),c.jsx("span",{className:"sr-only",children:"Home"})]})];for(let i=0;i<o.length;i++){const l=o[i];if(l==="instance")continue;const d=`/${o.slice(0,i+1).join("/")}`;let f=_ee(l),m;f.startsWith("Org ")?(m=l.split("org-").pop(),f=t?.organization?.name||"Org"):f.startsWith("Clu ")?(m=l.split("clu-").pop(),f=t?.cluster?.name||"Cluster"):f.startsWith("Ins ")&&(m=l.split("ins-").pop(),f="Instance"),r.push(c.jsx("svg",{fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",className:"size-5 shrink-0 text-grey",children:c.jsx("path",{d:"M5.555 17.776l8-16 .894.448-8 16-.894-.448z"})}),c.jsxs(Ue,{to:d,className:"text-xs md:text-sm font-medium hover:text-grey",children:[f,m&&c.jsx("div",{className:"text-gray-500 text-xs",children:m})]}))}return r},[e.pathname,t?.cluster?.name,t?.organization?.name]);return c.jsxs("div",{role:"list",className:"flex items-center space-x-0 lg:space-x-2 xl:space-x-4 overflow-x-auto",children:[...n]})}var zf=e=>e.type==="checkbox",$a=e=>e instanceof Date,br=e=>e==null;const YM=e=>typeof e=="object";var fn=e=>!br(e)&&!Array.isArray(e)&&YM(e)&&!$a(e),XM=e=>fn(e)&&e.target?zf(e.target)?e.target.checked:e.target.value:e,wee=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,WM=(e,t)=>e.has(wee(t)),See=e=>{const t=e.constructor&&e.constructor.prototype;return fn(t)&&t.hasOwnProperty("isPrototypeOf")},ZS=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Lt(e){let t;const n=Array.isArray(e),o=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(ZS&&(e instanceof Blob||o))&&(n||fn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!See(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Lt(e[r]));else return e;return t}var Kg=e=>/^\w*$/.test(e),Vt=e=>e===void 0,Zg=e=>Array.isArray(e)?e.filter(Boolean):[],YS=e=>Zg(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ce=(e,t,n)=>{if(!t||!fn(e))return n;const o=(Kg(t)?[t]:YS(t)).reduce((r,i)=>br(r)?r:r[i],e);return Vt(o)||o===e?Vt(e[t])?n:e[t]:o},Gr=e=>typeof e=="boolean",Et=(e,t,n)=>{let o=-1;const r=Kg(t)?[t]:YS(t),i=r.length,l=i-1;for(;++o<i;){const d=r[o];let f=n;if(o!==l){const m=e[d];f=fn(m)||Array.isArray(m)?m:isNaN(+r[o+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=f,e=e[d]}};const Up={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Eo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Gi={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},XS=G.createContext(null);XS.displayName="HookFormContext";const Uf=()=>G.useContext(XS),Cee=e=>{const{children:t,...n}=e;return G.createElement(XS.Provider,{value:n},t)};var QM=(e,t,n,o=!0)=>{const r={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(r,i,{get:()=>{const l=i;return t._proxyFormState[l]!==Eo.all&&(t._proxyFormState[l]=!o||Eo.all),n&&(n[l]=!0),e[l]}});return r};const Yg=typeof window<"u"?G.useLayoutEffect:G.useEffect;function WS(e){const t=Uf(),{control:n=t.control,disabled:o,name:r,exact:i}=e||{},[l,d]=G.useState(n._formState),f=G.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Yg(()=>n._subscribe({name:r,formState:f.current,exact:i,callback:m=>{!o&&d({...n._formState,...m})}}),[r,o,i]),G.useEffect(()=>{f.current.isValid&&n._setValid(!0)},[n]),G.useMemo(()=>QM(l,n,f.current,!1),[l,n])}var hi=e=>typeof e=="string",JM=(e,t,n,o,r)=>hi(e)?(o&&t.watch.add(e),Ce(n,e,r)):Array.isArray(e)?e.map(i=>(o&&t.watch.add(i),Ce(n,i))):(o&&(t.watchAll=!0),n),mw=e=>br(e)||!YM(e);function Xi(e,t,n=new WeakSet){if(mw(e)||mw(t))return e===t;if($a(e)&&$a(t))return e.getTime()===t.getTime();const o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const i of o){const l=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const d=t[i];if($a(l)&&$a(d)||fn(l)&&fn(d)||Array.isArray(l)&&Array.isArray(d)?!Xi(l,d,n):l!==d)return!1}}return!0}function Eee(e){const t=Uf(),{control:n=t.control,name:o,defaultValue:r,disabled:i,exact:l,compute:d}=e||{},f=G.useRef(r),m=G.useRef(d),p=G.useRef(void 0);m.current=d;const g=G.useMemo(()=>n._getWatch(o,f.current),[n,o]),[v,b]=G.useState(m.current?m.current(g):g);return Yg(()=>n._subscribe({name:o,formState:{values:!0},exact:l,callback:x=>{if(!i){const S=JM(o,n._names,x.values||n._formValues,!1,f.current);if(m.current){const C=m.current(S);Xi(C,p.current)||(b(C),p.current=C)}else b(S)}}}),[n,i,o,l]),G.useEffect(()=>n._removeUnmounted()),v}function Ree(e){const t=Uf(),{name:n,disabled:o,control:r=t.control,shouldUnregister:i,defaultValue:l}=e,d=WM(r._names.array,n),f=G.useMemo(()=>Ce(r._formValues,n,Ce(r._defaultValues,n,l)),[r,n,l]),m=Eee({control:r,name:n,defaultValue:f,exact:!0}),p=WS({control:r,name:n,exact:!0}),g=G.useRef(e),v=G.useRef(r.register(n,{...e.rules,value:m,...Gr(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const b=G.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ce(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ce(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ce(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ce(p.validatingFields,n)},error:{enumerable:!0,get:()=>Ce(p.errors,n)}}),[p,n]),x=G.useCallback(N=>v.current.onChange({target:{value:XM(N),name:n},type:Up.CHANGE}),[n]),S=G.useCallback(()=>v.current.onBlur({target:{value:Ce(r._formValues,n),name:n},type:Up.BLUR}),[n,r._formValues]),C=G.useCallback(N=>{const j=Ce(r._fields,n);j&&N&&(j._f.ref={focus:()=>N.focus&&N.focus(),select:()=>N.select&&N.select(),setCustomValidity:T=>N.setCustomValidity(T),reportValidity:()=>N.reportValidity()})},[r._fields,n]),E=G.useMemo(()=>({name:n,value:m,...Gr(o)||p.disabled?{disabled:p.disabled||o}:{},onChange:x,onBlur:S,ref:C}),[n,o,p.disabled,x,S,C,m]);return G.useEffect(()=>{const N=r._options.shouldUnregister||i;r.register(n,{...g.current.rules,...Gr(g.current.disabled)?{disabled:g.current.disabled}:{}});const j=(T,O)=>{const A=Ce(r._fields,T);A&&A._f&&(A._f.mount=O)};if(j(n,!0),N){const T=Lt(Ce(r._options.defaultValues,n));Et(r._defaultValues,n,T),Vt(Ce(r._formValues,n))&&Et(r._formValues,n,T)}return!d&&r.register(n),()=>{(d?N&&!r._state.action:N)?r.unregister(n):j(n,!1)}},[n,r,d,i]),G.useEffect(()=>{r._setDisabledField({disabled:o,name:n})},[o,n,r]),G.useMemo(()=>({field:E,formState:p,fieldState:b}),[E,p,b])}const jee=e=>e.render(Ree(e));var QS=(e,t,n,o,r)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[o]:r||!0}}:{},Tr=e=>Array.isArray(e)?e:[e],yO=()=>{let e=[];return{get observers(){return e},next:r=>{for(const i of e)i.next&&i.next(r)},subscribe:r=>(e.push(r),{unsubscribe:()=>{e=e.filter(i=>i!==r)}}),unsubscribe:()=>{e=[]}}},gr=e=>fn(e)&&!Object.keys(e).length,JS=e=>e.type==="file",Lo=e=>typeof e=="function",Lp=e=>{if(!ZS)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},eP=e=>e.type==="select-multiple",e0=e=>e.type==="radio",Nee=e=>e0(e)||zf(e),Bx=e=>Lp(e)&&e.isConnected;function Tee(e,t){const n=t.slice(0,-1).length;let o=0;for(;o<n;)e=Vt(e)?o++:e[t[o++]];return e}function Oee(e){for(const t in e)if(e.hasOwnProperty(t)&&!Vt(e[t]))return!1;return!0}function ln(e,t){const n=Array.isArray(t)?t:Kg(t)?[t]:YS(t),o=n.length===1?e:Tee(e,n),r=n.length-1,i=n[r];return o&&delete o[i],r!==0&&(fn(o)&&gr(o)||Array.isArray(o)&&Oee(o))&&ln(e,n.slice(0,-1)),e}var tP=e=>{for(const t in e)if(Lo(e[t]))return!0;return!1};function Fp(e,t={}){const n=Array.isArray(e);if(fn(e)||n)for(const o in e)Array.isArray(e[o])||fn(e[o])&&!tP(e[o])?(t[o]=Array.isArray(e[o])?[]:{},Fp(e[o],t[o])):br(e[o])||(t[o]=!0);return t}function nP(e,t,n){const o=Array.isArray(e);if(fn(e)||o)for(const r in e)Array.isArray(e[r])||fn(e[r])&&!tP(e[r])?Vt(t)||mw(n[r])?n[r]=Array.isArray(e[r])?Fp(e[r],[]):{...Fp(e[r])}:nP(e[r],br(t)?{}:t[r],n[r]):n[r]=!Xi(e[r],t[r]);return n}var Od=(e,t)=>nP(e,t,Fp(t));const bO={value:!1,isValid:!1},xO={value:!0,isValid:!0};var rP=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Vt(e[0].attributes.value)?Vt(e[0].value)||e[0].value===""?xO:{value:e[0].value,isValid:!0}:xO:bO}return bO},oP=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:o})=>Vt(e)?e:t?e===""?NaN:e&&+e:n&&hi(e)?new Date(e):o?o(e):e;const _O={isValid:!1,value:null};var iP=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,_O):_O;function wO(e){const t=e.ref;return JS(t)?t.files:e0(t)?iP(e.refs).value:eP(t)?[...t.selectedOptions].map(({value:n})=>n):zf(t)?rP(e.refs).value:oP(Vt(t.value)?e.ref.value:t.value,e)}var kee=(e,t,n,o)=>{const r={};for(const i of e){const l=Ce(t,i);l&&Et(r,i,l._f)}return{criteriaMode:n,names:[...e],fields:r,shouldUseNativeValidation:o}},Vp=e=>e instanceof RegExp,kd=e=>Vt(e)?e:Vp(e)?e.source:fn(e)?Vp(e.value)?e.value.source:e.value:e,xc=e=>({isOnSubmit:!e||e===Eo.onSubmit,isOnBlur:e===Eo.onBlur,isOnChange:e===Eo.onChange,isOnAll:e===Eo.all,isOnTouch:e===Eo.onTouched});const SO="AsyncFunction";var Aee=e=>!!e&&!!e.validate&&!!(Lo(e.validate)&&e.validate.constructor.name===SO||fn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===SO)),Iee=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),hw=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length))));const jc=(e,t,n,o)=>{for(const r of n||Object.keys(e)){const i=Ce(e,r);if(i){const{_f:l,...d}=i;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],r)&&!o)return!0;if(l.ref&&t(l.ref,l.name)&&!o)return!0;if(jc(d,t))break}else if(fn(d)&&jc(d,t))break}}};function CO(e,t,n){const o=Ce(e,n);if(o||Kg(n))return{error:o,name:n};const r=n.split(".");for(;r.length;){const i=r.join("."),l=Ce(t,i),d=Ce(e,i);if(l&&!Array.isArray(l)&&n!==i)return{name:n};if(d&&d.type)return{name:i,error:d};if(d&&d.root&&d.root.type)return{name:`${i}.root`,error:d.root};r.pop()}return{name:n}}var $ee=(e,t,n,o)=>{n(e);const{name:r,...i}=e;return gr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(l=>t[l]===(!o||Eo.all))},Mee=(e,t,n)=>!e||!t||e===t||Tr(e).some(o=>o&&(n?o===t:o.startsWith(t)||t.startsWith(o))),Pee=(e,t,n,o,r)=>r.isOnAll?!1:!n&&r.isOnTouch?!(t||e):(n?o.isOnBlur:r.isOnBlur)?!e:(n?o.isOnChange:r.isOnChange)?e:!0,Dee=(e,t)=>!Zg(Ce(e,t)).length&&ln(e,t),sP=(e,t,n)=>{const o=Tr(Ce(e,n));return Et(o,"root",t[n]),Et(e,n,o),e},mp=e=>hi(e);function EO(e,t,n="validate"){if(mp(e)||Array.isArray(e)&&e.every(mp)||Gr(e)&&!e)return{type:n,message:mp(e)?e:"",ref:t}}var dc=e=>fn(e)&&!Vp(e)?e:{value:e,message:""},pw=async(e,t,n,o,r,i)=>{const{ref:l,refs:d,required:f,maxLength:m,minLength:p,min:g,max:v,pattern:b,validate:x,name:S,valueAsNumber:C,mount:E}=e._f,N=Ce(n,S);if(!E||t.has(S))return{};const j=d?d[0]:l,T=ae=>{r&&j.reportValidity&&(j.setCustomValidity(Gr(ae)?"":ae||""),j.reportValidity())},O={},A=e0(l),I=zf(l),P=A||I,U=(C||JS(l))&&Vt(l.value)&&Vt(N)||Lp(l)&&l.value===""||N===""||Array.isArray(N)&&!N.length,V=QS.bind(null,S,o,O),oe=(ae,de,ce,le=Gi.maxLength,M=Gi.minLength)=>{const Z=ae?de:ce;O[S]={type:ae?le:M,message:Z,ref:l,...V(ae?le:M,Z)}};if(i?!Array.isArray(N)||!N.length:f&&(!P&&(U||br(N))||Gr(N)&&!N||I&&!rP(d).isValid||A&&!iP(d).isValid)){const{value:ae,message:de}=mp(f)?{value:!!f,message:f}:dc(f);if(ae&&(O[S]={type:Gi.required,message:de,ref:j,...V(Gi.required,de)},!o))return T(de),O}if(!U&&(!br(g)||!br(v))){let ae,de;const ce=dc(v),le=dc(g);if(!br(N)&&!isNaN(N)){const M=l.valueAsNumber||N&&+N;br(ce.value)||(ae=M>ce.value),br(le.value)||(de=M<le.value)}else{const M=l.valueAsDate||new Date(N),Z=$=>new Date(new Date().toDateString()+" "+$),F=l.type=="time",se=l.type=="week";hi(ce.value)&&N&&(ae=F?Z(N)>Z(ce.value):se?N>ce.value:M>new Date(ce.value)),hi(le.value)&&N&&(de=F?Z(N)<Z(le.value):se?N<le.value:M<new Date(le.value))}if((ae||de)&&(oe(!!ae,ce.message,le.message,Gi.max,Gi.min),!o))return T(O[S].message),O}if((m||p)&&!U&&(hi(N)||i&&Array.isArray(N))){const ae=dc(m),de=dc(p),ce=!br(ae.value)&&N.length>+ae.value,le=!br(de.value)&&N.length<+de.value;if((ce||le)&&(oe(ce,ae.message,de.message),!o))return T(O[S].message),O}if(b&&!U&&hi(N)){const{value:ae,message:de}=dc(b);if(Vp(ae)&&!N.match(ae)&&(O[S]={type:Gi.pattern,message:de,ref:l,...V(Gi.pattern,de)},!o))return T(de),O}if(x){if(Lo(x)){const ae=await x(N,n),de=EO(ae,j);if(de&&(O[S]={...de,...V(Gi.validate,de.message)},!o))return T(de.message),O}else if(fn(x)){let ae={};for(const de in x){if(!gr(ae)&&!o)break;const ce=EO(await x[de](N,n),j,de);ce&&(ae={...ce,...V(de,ce.message)},T(ce.message),o&&(O[S]=ae))}if(!gr(ae)&&(O[S]={ref:j,...ae},!o))return O}}return T(!0),O};const zee={mode:Eo.onSubmit,reValidateMode:Eo.onChange,shouldFocusError:!0};function Uee(e={}){let t={...zee,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Lo(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},o={},r=fn(t.defaultValues)||fn(t.values)?Lt(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Lt(r),l={action:!1,mount:!1,watch:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},f,m=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...p};const v={array:yO(),state:yO()},b=t.criteriaMode===Eo.all,x=z=>X=>{clearTimeout(m),m=setTimeout(z,X)},S=async z=>{if(!t.disabled&&(p.isValid||g.isValid||z)){const X=t.resolver?gr((await I()).errors):await U(o,!0);X!==n.isValid&&v.state.next({isValid:X})}},C=(z,X)=>{!t.disabled&&(p.isValidating||p.validatingFields||g.isValidating||g.validatingFields)&&((z||Array.from(d.mount)).forEach(ne=>{ne&&(X?Et(n.validatingFields,ne,X):ln(n.validatingFields,ne))}),v.state.next({validatingFields:n.validatingFields,isValidating:!gr(n.validatingFields)}))},E=(z,X=[],ne,ve,xe=!0,ye=!0)=>{if(ve&&ne&&!t.disabled){if(l.action=!0,ye&&Array.isArray(Ce(o,z))){const Re=ne(Ce(o,z),ve.argA,ve.argB);xe&&Et(o,z,Re)}if(ye&&Array.isArray(Ce(n.errors,z))){const Re=ne(Ce(n.errors,z),ve.argA,ve.argB);xe&&Et(n.errors,z,Re),Dee(n.errors,z)}if((p.touchedFields||g.touchedFields)&&ye&&Array.isArray(Ce(n.touchedFields,z))){const Re=ne(Ce(n.touchedFields,z),ve.argA,ve.argB);xe&&Et(n.touchedFields,z,Re)}(p.dirtyFields||g.dirtyFields)&&(n.dirtyFields=Od(r,i)),v.state.next({name:z,isDirty:oe(z,X),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Et(i,z,X)},N=(z,X)=>{Et(n.errors,z,X),v.state.next({errors:n.errors})},j=z=>{n.errors=z,v.state.next({errors:n.errors,isValid:!1})},T=(z,X,ne,ve)=>{const xe=Ce(o,z);if(xe){const ye=Ce(i,z,Vt(ne)?Ce(r,z):ne);Vt(ye)||ve&&ve.defaultChecked||X?Et(i,z,X?ye:wO(xe._f)):ce(z,ye),l.mount&&S()}},O=(z,X,ne,ve,xe)=>{let ye=!1,Re=!1;const Xe={name:z};if(!t.disabled){if(!ne||ve){(p.isDirty||g.isDirty)&&(Re=n.isDirty,n.isDirty=Xe.isDirty=oe(),ye=Re!==Xe.isDirty);const mt=Xi(Ce(r,z),X);Re=!!Ce(n.dirtyFields,z),mt?ln(n.dirtyFields,z):Et(n.dirtyFields,z,!0),Xe.dirtyFields=n.dirtyFields,ye=ye||(p.dirtyFields||g.dirtyFields)&&Re!==!mt}if(ne){const mt=Ce(n.touchedFields,z);mt||(Et(n.touchedFields,z,ne),Xe.touchedFields=n.touchedFields,ye=ye||(p.touchedFields||g.touchedFields)&&mt!==ne)}ye&&xe&&v.state.next(Xe)}return ye?Xe:{}},A=(z,X,ne,ve)=>{const xe=Ce(n.errors,z),ye=(p.isValid||g.isValid)&&Gr(X)&&n.isValid!==X;if(t.delayError&&ne?(f=x(()=>N(z,ne)),f(t.delayError)):(clearTimeout(m),f=null,ne?Et(n.errors,z,ne):ln(n.errors,z)),(ne?!Xi(xe,ne):xe)||!gr(ve)||ye){const Re={...ve,...ye&&Gr(X)?{isValid:X}:{},errors:n.errors,name:z};n={...n,...Re},v.state.next(Re)}},I=async z=>{C(z,!0);const X=await t.resolver(i,t.context,kee(z||d.mount,o,t.criteriaMode,t.shouldUseNativeValidation));return C(z),X},P=async z=>{const{errors:X}=await I(z);if(z)for(const ne of z){const ve=Ce(X,ne);ve?Et(n.errors,ne,ve):ln(n.errors,ne)}else n.errors=X;return X},U=async(z,X,ne={valid:!0})=>{for(const ve in z){const xe=z[ve];if(xe){const{_f:ye,...Re}=xe;if(ye){const Xe=d.array.has(ye.name),mt=xe._f&&Aee(xe._f);mt&&p.validatingFields&&C([ve],!0);const jt=await pw(xe,d.disabled,i,b,t.shouldUseNativeValidation&&!X,Xe);if(mt&&p.validatingFields&&C([ve]),jt[ye.name]&&(ne.valid=!1,X))break;!X&&(Ce(jt,ye.name)?Xe?sP(n.errors,jt,ye.name):Et(n.errors,ye.name,jt[ye.name]):ln(n.errors,ye.name))}!gr(Re)&&await U(Re,X,ne)}}return ne.valid},V=()=>{for(const z of d.unMount){const X=Ce(o,z);X&&(X._f.refs?X._f.refs.every(ne=>!Bx(ne)):!Bx(X._f.ref))&&ie(z)}d.unMount=new Set},oe=(z,X)=>!t.disabled&&(z&&X&&Et(i,z,X),!Xi($(),r)),ae=(z,X,ne)=>JM(z,d,{...l.mount?i:Vt(X)?r:hi(z)?{[z]:X}:X},ne,X),de=z=>Zg(Ce(l.mount?i:r,z,t.shouldUnregister?Ce(r,z,[]):[])),ce=(z,X,ne={})=>{const ve=Ce(o,z);let xe=X;if(ve){const ye=ve._f;ye&&(!ye.disabled&&Et(i,z,oP(X,ye)),xe=Lp(ye.ref)&&br(X)?"":X,eP(ye.ref)?[...ye.ref.options].forEach(Re=>Re.selected=xe.includes(Re.value)):ye.refs?zf(ye.ref)?ye.refs.forEach(Re=>{(!Re.defaultChecked||!Re.disabled)&&(Array.isArray(xe)?Re.checked=!!xe.find(Xe=>Xe===Re.value):Re.checked=xe===Re.value||!!xe)}):ye.refs.forEach(Re=>Re.checked=Re.value===xe):JS(ye.ref)?ye.ref.value="":(ye.ref.value=xe,ye.ref.type||v.state.next({name:z,values:Lt(i)})))}(ne.shouldDirty||ne.shouldTouch)&&O(z,xe,ne.shouldTouch,ne.shouldDirty,!0),ne.shouldValidate&&se(z)},le=(z,X,ne)=>{for(const ve in X){if(!X.hasOwnProperty(ve))return;const xe=X[ve],ye=z+"."+ve,Re=Ce(o,ye);(d.array.has(z)||fn(xe)||Re&&!Re._f)&&!$a(xe)?le(ye,xe,ne):ce(ye,xe,ne)}},M=(z,X,ne={})=>{const ve=Ce(o,z),xe=d.array.has(z),ye=Lt(X);Et(i,z,ye),xe?(v.array.next({name:z,values:Lt(i)}),(p.isDirty||p.dirtyFields||g.isDirty||g.dirtyFields)&&ne.shouldDirty&&v.state.next({name:z,dirtyFields:Od(r,i),isDirty:oe(z,ye)})):ve&&!ve._f&&!br(ye)?le(z,ye,ne):ce(z,ye,ne),hw(z,d)&&v.state.next({...n,name:z}),v.state.next({name:l.mount?z:void 0,values:Lt(i)})},Z=async z=>{l.mount=!0;const X=z.target;let ne=X.name,ve=!0;const xe=Ce(o,ne),ye=mt=>{ve=Number.isNaN(mt)||$a(mt)&&isNaN(mt.getTime())||Xi(mt,Ce(i,ne,mt))},Re=xc(t.mode),Xe=xc(t.reValidateMode);if(xe){let mt,jt;const Pr=X.type?wO(xe._f):XM(z),Dr=z.type===Up.BLUR||z.type===Up.FOCUS_OUT,ei=!Iee(xe._f)&&!t.resolver&&!Ce(n.errors,ne)&&!xe._f.deps||Pee(Dr,Ce(n.touchedFields,ne),n.isSubmitted,Xe,Re),ti=hw(ne,d,Dr);Et(i,ne,Pr),Dr?(!X||!X.readOnly)&&(xe._f.onBlur&&xe._f.onBlur(z),f&&f(0)):xe._f.onChange&&xe._f.onChange(z);const ni=O(ne,Pr,Dr),lo=!gr(ni)||ti;if(!Dr&&v.state.next({name:ne,type:z.type,values:Lt(i)}),ei)return(p.isValid||g.isValid)&&(t.mode==="onBlur"?Dr&&S():Dr||S()),lo&&v.state.next({name:ne,...ti?{}:ni});if(!Dr&&ti&&v.state.next({...n}),t.resolver){const{errors:ri}=await I([ne]);if(ye(Pr),ve){const ji=CO(n.errors,o,ne),cs=CO(ri,o,ji.name||ne);mt=cs.error,ne=cs.name,jt=gr(ri)}}else C([ne],!0),mt=(await pw(xe,d.disabled,i,b,t.shouldUseNativeValidation))[ne],C([ne]),ye(Pr),ve&&(mt?jt=!1:(p.isValid||g.isValid)&&(jt=await U(o,!0)));ve&&(xe._f.deps&&se(xe._f.deps),A(ne,jt,mt,ni))}},F=(z,X)=>{if(Ce(n.errors,X)&&z.focus)return z.focus(),1},se=async(z,X={})=>{let ne,ve;const xe=Tr(z);if(t.resolver){const ye=await P(Vt(z)?z:xe);ne=gr(ye),ve=z?!xe.some(Re=>Ce(ye,Re)):ne}else z?(ve=(await Promise.all(xe.map(async ye=>{const Re=Ce(o,ye);return await U(Re&&Re._f?{[ye]:Re}:Re)}))).every(Boolean),!(!ve&&!n.isValid)&&S()):ve=ne=await U(o);return v.state.next({...!hi(z)||(p.isValid||g.isValid)&&ne!==n.isValid?{}:{name:z},...t.resolver||!z?{isValid:ne}:{},errors:n.errors}),X.shouldFocus&&!ve&&jc(o,F,z?xe:d.mount),ve},$=z=>{const X={...l.mount?i:r};return Vt(z)?X:hi(z)?Ce(X,z):z.map(ne=>Ce(X,ne))},q=(z,X)=>({invalid:!!Ce((X||n).errors,z),isDirty:!!Ce((X||n).dirtyFields,z),error:Ce((X||n).errors,z),isValidating:!!Ce(n.validatingFields,z),isTouched:!!Ce((X||n).touchedFields,z)}),te=z=>{z&&Tr(z).forEach(X=>ln(n.errors,X)),v.state.next({errors:z?n.errors:{}})},B=(z,X,ne)=>{const ve=(Ce(o,z,{_f:{}})._f||{}).ref,xe=Ce(n.errors,z)||{},{ref:ye,message:Re,type:Xe,...mt}=xe;Et(n.errors,z,{...mt,...X,ref:ve}),v.state.next({name:z,errors:n.errors,isValid:!1}),ne&&ne.shouldFocus&&ve&&ve.focus&&ve.focus()},J=(z,X)=>Lo(z)?v.state.subscribe({next:ne=>"values"in ne&&z(ae(void 0,X),ne)}):ae(z,X,!0),be=z=>v.state.subscribe({next:X=>{Mee(z.name,X.name,z.exact)&&$ee(X,z.formState||p,ft,z.reRenderRoot)&&z.callback({values:{...i},...n,...X,defaultValues:r})}}).unsubscribe,ge=z=>(l.mount=!0,g={...g,...z.formState},be({...z,formState:g})),ie=(z,X={})=>{for(const ne of z?Tr(z):d.mount)d.mount.delete(ne),d.array.delete(ne),X.keepValue||(ln(o,ne),ln(i,ne)),!X.keepError&&ln(n.errors,ne),!X.keepDirty&&ln(n.dirtyFields,ne),!X.keepTouched&&ln(n.touchedFields,ne),!X.keepIsValidating&&ln(n.validatingFields,ne),!t.shouldUnregister&&!X.keepDefaultValue&&ln(r,ne);v.state.next({values:Lt(i)}),v.state.next({...n,...X.keepDirty?{isDirty:oe()}:{}}),!X.keepIsValid&&S()},me=({disabled:z,name:X})=>{(Gr(z)&&l.mount||z||d.disabled.has(X))&&(z?d.disabled.add(X):d.disabled.delete(X))},ze=(z,X={})=>{let ne=Ce(o,z);const ve=Gr(X.disabled)||Gr(t.disabled);return Et(o,z,{...ne||{},_f:{...ne&&ne._f?ne._f:{ref:{name:z}},name:z,mount:!0,...X}}),d.mount.add(z),ne?me({disabled:Gr(X.disabled)?X.disabled:t.disabled,name:z}):T(z,!0,X.value),{...ve?{disabled:X.disabled||t.disabled}:{},...t.progressive?{required:!!X.required,min:kd(X.min),max:kd(X.max),minLength:kd(X.minLength),maxLength:kd(X.maxLength),pattern:kd(X.pattern)}:{},name:z,onChange:Z,onBlur:Z,ref:xe=>{if(xe){ze(z,X),ne=Ce(o,z);const ye=Vt(xe.value)&&xe.querySelectorAll&&xe.querySelectorAll("input,select,textarea")[0]||xe,Re=Nee(ye),Xe=ne._f.refs||[];if(Re?Xe.find(mt=>mt===ye):ye===ne._f.ref)return;Et(o,z,{_f:{...ne._f,...Re?{refs:[...Xe.filter(Bx),ye,...Array.isArray(Ce(r,z))?[{}]:[]],ref:{type:ye.type,name:z}}:{ref:ye}}}),T(z,!1,void 0,ye)}else ne=Ce(o,z,{}),ne._f&&(ne._f.mount=!1),(t.shouldUnregister||X.shouldUnregister)&&!(WM(d.array,z)&&l.action)&&d.unMount.add(z)}}},Ve=()=>t.shouldFocusError&&jc(o,F,d.mount),Ye=z=>{Gr(z)&&(v.state.next({disabled:z}),jc(o,(X,ne)=>{const ve=Ce(o,ne);ve&&(X.disabled=ve._f.disabled||z,Array.isArray(ve._f.refs)&&ve._f.refs.forEach(xe=>{xe.disabled=ve._f.disabled||z}))},0,!1))},He=(z,X)=>async ne=>{let ve;ne&&(ne.preventDefault&&ne.preventDefault(),ne.persist&&ne.persist());let xe=Lt(i);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:ye,values:Re}=await I();n.errors=ye,xe=Lt(Re)}else await U(o);if(d.disabled.size)for(const ye of d.disabled)ln(xe,ye);if(ln(n.errors,"root"),gr(n.errors)){v.state.next({errors:{}});try{await z(xe,ne)}catch(ye){ve=ye}}else X&&await X({...n.errors},ne),Ve(),setTimeout(Ve);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:gr(n.errors)&&!ve,submitCount:n.submitCount+1,errors:n.errors}),ve)throw ve},Ht=(z,X={})=>{Ce(o,z)&&(Vt(X.defaultValue)?M(z,Lt(Ce(r,z))):(M(z,X.defaultValue),Et(r,z,Lt(X.defaultValue))),X.keepTouched||ln(n.touchedFields,z),X.keepDirty||(ln(n.dirtyFields,z),n.isDirty=X.defaultValue?oe(z,Lt(Ce(r,z))):oe()),X.keepError||(ln(n.errors,z),p.isValid&&S()),v.state.next({...n}))},Gt=(z,X={})=>{const ne=z?Lt(z):r,ve=Lt(ne),xe=gr(z),ye=xe?r:ve;if(X.keepDefaultValues||(r=ne),!X.keepValues){if(X.keepDirtyValues){const Re=new Set([...d.mount,...Object.keys(Od(r,i))]);for(const Xe of Array.from(Re))Ce(n.dirtyFields,Xe)?Et(ye,Xe,Ce(i,Xe)):M(Xe,Ce(ye,Xe))}else{if(ZS&&Vt(z))for(const Re of d.mount){const Xe=Ce(o,Re);if(Xe&&Xe._f){const mt=Array.isArray(Xe._f.refs)?Xe._f.refs[0]:Xe._f.ref;if(Lp(mt)){const jt=mt.closest("form");if(jt){jt.reset();break}}}}if(X.keepFieldsRef)for(const Re of d.mount)M(Re,Ce(ye,Re));else o={}}i=t.shouldUnregister?X.keepDefaultValues?Lt(r):{}:Lt(ye),v.array.next({values:{...ye}}),v.state.next({values:{...ye}})}d={mount:X.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!p.isValid||!!X.keepIsValid||!!X.keepDirtyValues,l.watch=!!t.shouldUnregister,v.state.next({submitCount:X.keepSubmitCount?n.submitCount:0,isDirty:xe?!1:X.keepDirty?n.isDirty:!!(X.keepDefaultValues&&!Xi(z,r)),isSubmitted:X.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:xe?{}:X.keepDirtyValues?X.keepDefaultValues&&i?Od(r,i):n.dirtyFields:X.keepDefaultValues&&z?Od(r,z):X.keepDirty?n.dirtyFields:{},touchedFields:X.keepTouched?n.touchedFields:{},errors:X.keepErrors?n.errors:{},isSubmitSuccessful:X.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:r})},er=(z,X)=>Gt(Lo(z)?z(i):z,X),Sr=(z,X={})=>{const ne=Ce(o,z),ve=ne&&ne._f;if(ve){const xe=ve.refs?ve.refs[0]:ve.ref;xe.focus&&(xe.focus(),X.shouldSelect&&Lo(xe.select)&&xe.select())}},ft=z=>{n={...n,...z}},yn={control:{register:ze,unregister:ie,getFieldState:q,handleSubmit:He,setError:B,_subscribe:be,_runSchema:I,_focusError:Ve,_getWatch:ae,_getDirty:oe,_setValid:S,_setFieldArray:E,_setDisabledField:me,_setErrors:j,_getFieldArray:de,_reset:Gt,_resetDefaultValues:()=>Lo(t.defaultValues)&&t.defaultValues().then(z=>{er(z,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:V,_disableForm:Ye,_subjects:v,_proxyFormState:p,get _fields(){return o},get _formValues(){return i},get _state(){return l},set _state(z){l=z},get _defaultValues(){return r},get _names(){return d},set _names(z){d=z},get _formState(){return n},get _options(){return t},set _options(z){t={...t,...z}}},subscribe:ge,trigger:se,register:ze,handleSubmit:He,watch:J,setValue:M,getValues:$,reset:er,resetField:Ht,clearErrors:te,unregister:ie,setError:B,setFocus:Sr,getFieldState:q};return{...yn,formControl:yn}}var $s=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},Hx=(e,t,n={})=>n.shouldFocus||Vt(n.shouldFocus)?n.focusName||`${e}.${Vt(n.focusIndex)?t:n.focusIndex}.`:"",Gx=(e,t)=>[...e,...Tr(t)],qx=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Kx(e,t,n){return[...e.slice(0,t),...Tr(n),...e.slice(t)]}var Zx=(e,t,n)=>Array.isArray(e)?(Vt(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],Yx=(e,t)=>[...Tr(t),...Tr(e)];function Lee(e,t){let n=0;const o=[...e];for(const r of t)o.splice(r-n,1),n++;return Zg(o).length?o:[]}var Xx=(e,t)=>Vt(t)?[]:Lee(e,Tr(t).sort((n,o)=>n-o)),Wx=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},RO=(e,t,n)=>(e[t]=n,e);function aP(e){const t=Uf(),{control:n=t.control,name:o,keyName:r="id",shouldUnregister:i,rules:l}=e,[d,f]=G.useState(n._getFieldArray(o)),m=G.useRef(n._getFieldArray(o).map($s)),p=G.useRef(d),g=G.useRef(!1);p.current=d,n._names.array.add(o),G.useMemo(()=>l&&n.register(o,l),[n,l,o]),Yg(()=>n._subjects.array.subscribe({next:({values:O,name:A})=>{if(A===o||!A){const I=Ce(O,o);Array.isArray(I)&&(f(I),m.current=I.map($s))}}}).unsubscribe,[n,o]);const v=G.useCallback(O=>{g.current=!0,n._setFieldArray(o,O)},[n,o]),b=(O,A)=>{const I=Tr(Lt(O)),P=Gx(n._getFieldArray(o),I);n._names.focus=Hx(o,P.length-1,A),m.current=Gx(m.current,I.map($s)),v(P),f(P),n._setFieldArray(o,P,Gx,{argA:qx(O)})},x=(O,A)=>{const I=Tr(Lt(O)),P=Yx(n._getFieldArray(o),I);n._names.focus=Hx(o,0,A),m.current=Yx(m.current,I.map($s)),v(P),f(P),n._setFieldArray(o,P,Yx,{argA:qx(O)})},S=O=>{const A=Xx(n._getFieldArray(o),O);m.current=Xx(m.current,O),v(A),f(A),!Array.isArray(Ce(n._fields,o))&&Et(n._fields,o,void 0),n._setFieldArray(o,A,Xx,{argA:O})},C=(O,A,I)=>{const P=Tr(Lt(A)),U=Kx(n._getFieldArray(o),O,P);n._names.focus=Hx(o,O,I),m.current=Kx(m.current,O,P.map($s)),v(U),f(U),n._setFieldArray(o,U,Kx,{argA:O,argB:qx(A)})},E=(O,A)=>{const I=n._getFieldArray(o);Wx(I,O,A),Wx(m.current,O,A),v(I),f(I),n._setFieldArray(o,I,Wx,{argA:O,argB:A},!1)},N=(O,A)=>{const I=n._getFieldArray(o);Zx(I,O,A),Zx(m.current,O,A),v(I),f(I),n._setFieldArray(o,I,Zx,{argA:O,argB:A},!1)},j=(O,A)=>{const I=Lt(A),P=RO(n._getFieldArray(o),O,I);m.current=[...P].map((U,V)=>!U||V===O?$s():m.current[V]),v(P),f([...P]),n._setFieldArray(o,P,RO,{argA:O,argB:I},!0,!1)},T=O=>{const A=Tr(Lt(O));m.current=A.map($s),v([...A]),f([...A]),n._setFieldArray(o,[...A],I=>I,{},!0,!1)};return G.useEffect(()=>{if(n._state.action=!1,hw(o,n._names)&&n._subjects.state.next({...n._formState}),g.current&&(!xc(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!xc(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([o]).then(O=>{const A=Ce(O.errors,o),I=Ce(n._formState.errors,o);(I?!A&&I.type||A&&(I.type!==A.type||I.message!==A.message):A&&A.type)&&(A?Et(n._formState.errors,o,A):ln(n._formState.errors,o),n._subjects.state.next({errors:n._formState.errors}))});else{const O=Ce(n._fields,o);O&&O._f&&!(xc(n._options.reValidateMode).isOnSubmit&&xc(n._options.mode).isOnSubmit)&&pw(O,n._names.disabled,n._formValues,n._options.criteriaMode===Eo.all,n._options.shouldUseNativeValidation,!0).then(A=>!gr(A)&&n._subjects.state.next({errors:sP(n._formState.errors,A,o)}))}n._subjects.state.next({name:o,values:Lt(n._formValues)}),n._names.focus&&jc(n._fields,(O,A)=>{if(n._names.focus&&A.startsWith(n._names.focus)&&O.focus)return O.focus(),1}),n._names.focus="",n._setValid(),g.current=!1},[d,o,n]),G.useEffect(()=>(!Ce(n._formValues,o)&&n._setFieldArray(o),()=>{const O=(A,I)=>{const P=Ce(n._fields,A);P&&P._f&&(P._f.mount=I)};n._options.shouldUnregister||i?n.unregister(o):O(o,!1)}),[o,n,r,i]),{swap:G.useCallback(E,[v,o,n]),move:G.useCallback(N,[v,o,n]),prepend:G.useCallback(x,[v,o,n]),append:G.useCallback(b,[v,o,n]),remove:G.useCallback(S,[v,o,n]),insert:G.useCallback(C,[v,o,n]),update:G.useCallback(j,[v,o,n]),replace:G.useCallback(T,[v,o,n]),fields:G.useMemo(()=>d.map((O,A)=>({...O,[r]:m.current[A]||$s()})),[d,r])}}function pn(e={}){const t=G.useRef(void 0),n=G.useRef(void 0),[o,r]=G.useState({isDirty:!1,isValidating:!1,isLoading:Lo(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Lo(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!Lo(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...d}=Uee(e);t.current={...d,formState:o}}const i=t.current.control;return i._options=e,Yg(()=>{const l=i._subscribe({formState:i._proxyFormState,callback:()=>r({...i._formState}),reRenderRoot:!0});return r(d=>({...d,isReady:!0})),i._formState.isReady=!0,l},[i]),G.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),G.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),G.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),G.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),G.useEffect(()=>{if(i._proxyFormState.isDirty){const l=i._getDirty();l!==o.isDirty&&i._subjects.state.next({isDirty:l})}},[i,o.isDirty]),G.useEffect(()=>{e.values&&!Xi(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),n.current=e.values,r(l=>({...l}))):i._resetDefaultValues()},[i,e.values]),G.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=QM(o,i),t.current}const gn=Cee,lP=_.createContext({}),cP=_.createContext({});function t0(){const e=_.useContext(lP),t=_.useContext(cP),{getFieldState:n}=Uf(),o=WS({name:e.name}),r=n(e.name,o);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...r}}function Ie({...e}){const{error:t,formItemId:n,formDescriptionId:o,formMessageId:r}=t0();return c.jsx(Ww,{"data-slot":"form-control",id:n,"aria-describedby":t?`${o} ${r}`:`${o}`,"aria-invalid":!!t,...e})}function $e({...e}){return c.jsx(lP,{value:{name:e.name},children:c.jsx(jee,{...e})})}function Oe({className:e,...t}){const n=_.useId();return c.jsx(cP,{value:{id:n},children:c.jsx("div",{"data-slot":"form-item",className:De("grid gap-2",e),...t})})}var Fee="Label",uP=_.forwardRef((e,t)=>c.jsx(Pe.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));uP.displayName=Fee;var Vee=uP;function n0({className:e,...t}){return c.jsx(Vee,{"data-slot":"label",className:De("text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function ke({className:e,...t}){const{error:n,formItemId:o}=t0();return c.jsx(n0,{"data-slot":"form-label","data-error":!!n,className:De("data-[error=true]:text-destructive",e),htmlFor:o,...t})}function Ae({className:e,...t}){const{error:n,formMessageId:o}=t0(),r=n?String(n?.message):t.children;return r?c.jsx("p",{"data-slot":"form-message",id:o,className:De("text-destructive text-sm",e),...t,children:r}):null}function Le({className:e,type:t,...n}){return c.jsx("input",{type:t,"data-slot":"input",className:De(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
288
+ ${v}`),e.finish(S=>{x(OT(S))})}return{flushController:n,add:m,upsert:m,stop:i.unsubscribe}}function OT(e){let t;return typeof e.output=="string"?t=e.output:t=new Blob([e.output],{type:"text/plain"}),{data:t,bytesCount:e.outputBytesCount,encoding:e.encoding}}function p$({messagesLimit:e,bytesLimit:t,durationLimit:n,pageMayExitObservable:o,sessionExpireObservable:r}){const i=o.subscribe(x=>p(x.reason)),l=r.subscribe(()=>p("session_expire")),d=new _t(()=>()=>{i.unsubscribe(),l.unsubscribe()});let f=0,m=0;function p(x){if(m===0)return;const S=m,C=f;m=0,f=0,b(),d.notify({reason:x,messagesCount:S,bytesCount:C})}let g;function v(){g===void 0&&(g=sr(()=>{p("duration_limit")},n))}function b(){Co(g),g=void 0}return{flushObservable:d,get messagesCount(){return m},notifyBeforeAddMessage(x){f+x>=t&&p("bytes_limit"),m+=1,f+=x,v()},notifyAfterAddMessage(x=0){f+=x,m>=e?p("messages_limit"):f>=t&&p("bytes_limit")},notifyAfterRemoveMessage(x){f-=x,m-=1,m===0&&b()}}}const Ks="DISCARDED",oo="SKIPPED";function B7(){const e={};return{register(t,n){return e[t]||(e[t]=[]),e[t].push(n),{unregister:()=>{e[t]=e[t].filter(o=>o!==n)}}},triggerHook(t,n){const o=e[t]||[],r=[];for(const i of o){const l=i(n);if(l===Ks)return Ks;l!==oo&&r.push(l)}return ns(...r)}}}const vi={LOG:"log",CONFIGURATION:"configuration",USAGE:"usage"},H7=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],G7=[C7];let Rx;function mu(){return Rx||(Rx=new DI(100)),Rx}function q7(e,t,n,o,r,i){const l=new _t,{stop:d}=Z7(t,o,r,i,l),{enabled:f}=K7(e,t,n,l);return{stop:d,enabled:f}}function K7(e,t,n,o){const r={},i=!G7.includes(t.site)&&es(t.telemetrySampleRate),l={[vi.LOG]:i,[vi.CONFIGURATION]:i&&es(t.telemetryConfigurationSampleRate),[vi.USAGE]:i&&es(t.telemetryUsageSampleRate)},d=Y7(),f=mu();return f.subscribe(({rawEvent:p,kind:g})=>{if(!l[p.type])return;let v=r[g];if(v||(v=r[g]=new Set),v.size>=t.maxTelemetryEventsPerPage)return;const b=du(p);if(v.has(b))return;const x=n.triggerHook(1,{startTime:Gn().relative});if(x===Ks)return;const S=m(x,e,p,d);o.notify(S),r$("telemetry",S),v.add(b)}),f.unbuffer(),Rq(CS),{enabled:i};function m(p,g,v,b){const S={type:"telemetry",date:Gn().timeStamp,service:g,version:"6.19.0",source:"browser",_dd:{format_version:2},telemetry:ns(v,{runtime_env:b,connectivity:o$(),sdk_setup:"npm"}),experimental_features:Array.from(_7())};return ns(S,p)}}function Z7(e,t,n,o,r){const i=[];if(Bc()){const l=Af(),d=r.subscribe(f=>l.send("internal_telemetry",f));i.push(d.unsubscribe)}else{const l=[e.rumEndpointBuilder];e.replica&&X7(e)&&l.push(e.replica.rumEndpointBuilder);const d=h$({encoder:o(4),request:f$(l,e.batchBytesLimit,t),flushController:p$({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:n,sessionExpireObservable:new _t}),messageBytesLimit:e.messageBytesLimit});i.push(d.stop);const f=r.subscribe(d.add);i.push(f.unsubscribe)}return{stop:()=>i.forEach(l=>l())}}function Y7(){return{is_local_file:window.location.protocol==="file:",is_worker:"WorkerGlobalScope"in self}}function X7(e){return e.site===n$}function na(e,t){ew(Ag.debug,e,t),mu().notify({rawEvent:{type:vi.LOG,message:e,status:"debug",...t},kind:"debug"})}function CS(e,t){mu().notify({rawEvent:{type:vi.LOG,status:"error",...Q7(e),...t},kind:"error"})}function W7(e){mu().notify({rawEvent:{type:vi.CONFIGURATION,configuration:e},kind:vi.CONFIGURATION})}function ES(e,t){mu().notify({rawEvent:{type:vi.LOG,message:e,status:"debug",...t},kind:e})}function pr(e){mu().notify({rawEvent:{type:vi.USAGE,usage:e},kind:vi.USAGE})}function Q7(e){if(ul(e)){const t=Of(e);return{error:{kind:t.name,stack:kf(J7(t))},message:t.message}}return{error:{stack:t$},message:`Uncaught ${du(e)}`}}function J7(e){return e.stack=e.stack.filter(t=>!t.url||H7.some(n=>t.url.startsWith(n))),e}const eK=10,tK=100,nK=lr,g$="--",v$=[];let ap;function Ta(e,t,n=0){var o;const{isLockEnabled:r,persistSession:i,expireSession:l}=t,d=v=>i({...v,lock:m}),f=()=>{const{lock:v,...b}=t.retrieveSession();return{session:b,lock:v&&!oK(v)?v:void 0}};if(ap||(ap=e),e!==ap){v$.push(e);return}if(r&&n>=tK){na("Aborted session operation after max lock retries",{currentStore:f()}),kT(t);return}let m,p=f();if(r){if(p.lock){Oh(e,t,n);return}if(m=rK(),d(p.session),p=f(),p.lock!==m){Oh(e,t,n);return}}let g=e.process(p.session);if(r&&(p=f(),p.lock!==m)){Oh(e,t,n);return}if(g&&(Gd(g)?l(g):(KI(g),r?d(g):i(g))),r&&!(g&&Gd(g))){if(p=f(),p.lock!==m){Oh(e,t,n);return}i(p.session),g=p.session}(o=e.after)===null||o===void 0||o.call(e,g||p.session),kT(t)}function Oh(e,t,n){sr(()=>{Ta(e,t,n+1)},eK)}function kT(e){ap=void 0;const t=v$.shift();t&&Ta(t,e)}function rK(){return cr()+g$+Bn()}function oK(e){const[,t]=e.split(g$);return!t||Qt(Number(t),Bn())>nK}const AT=lr;function iK(e){switch(e.sessionPersistence){case of.COOKIE:return RT(e);case of.LOCAL_STORAGE:return NT();case void 0:{let t=RT(e);return!t&&e.allowFallbackToLocalStorage&&(t=NT()),t}default:pt.error(`Invalid session persistence '${String(e.sessionPersistence)}'`)}}function sK(e,t){return e.type===of.COOKIE?Bq(t,e.cookieOptions):qq(t)}function aK(e,t,n,o,r=sK(e,t)){const i=new _t,l=new _t,d=new _t,f=uu(b,AT);let m;S();const{throttled:p,cancel:g}=Pg(()=>{Ta({process:A=>{if(sp(A))return;const I=x(A);return C(I),I},after:A=>{qI(A)&&!E()&&T(A),m=A}},r)},AT);function v(){Ta({process:A=>E()?x(A):void 0},r)}function b(){const A=r.retrieveSession();Gd(A)?Ta({process:I=>Gd(I)?Na(I,t):void 0,after:x},r):x(A)}function x(A){return Gd(A)&&(A=Na(A,t)),E()&&(N(A)?j():(d.notify({previousState:m,newState:A}),m=A)),A}function S(){Ta({process:A=>{if(sp(A))return Na(A,t)},after:A=>{m=A}},r)}function C(A){if(sp(A))return!1;const I=o(A[n]);A[n]=I,delete A.isExpired,I!==HI&&!A.id&&(A.id=cr(),A.created=String(Oo()))}function E(){return m?.[n]!==void 0}function N(A){return m.id!==A.id||m[n]!==A[n]}function j(){m=Na(m,t),l.notify()}function T(A){m=A,i.notify()}function O(A){Ta({process:I=>({...I,...A}),after:x},r)}return{expandOrRenewSession:p,expandSession:v,getSession:()=>m,renewObservable:i,expireObservable:l,sessionStateUpdateObservable:d,restartSession:S,expire:()=>{g(),r.expireSession(m),x(Na(m,t))},stop:()=>{Mg(f)},updateSessionState:O}}const rw={GRANTED:"granted",NOT_GRANTED:"not-granted"};function lK(e){const t=new _t;return{tryToInit(n){e||(e=n)},update(n){e=n,t.notify()},isGranted(){return e===rw.GRANTED},observable:t}}function RS(e){const t=dl(e);return t==="string"||t==="function"||e instanceof RegExp}function jS(e,t,n=!1){return e.some(o=>{try{if(typeof o=="function")return o(t);if(o instanceof RegExp)return o.test(t);if(typeof o=="string")return n?t.startsWith(o):o===t}catch(r){pt.error(r)}return!1})}const y$=["chrome-extension://","moz-extension://"];function IT(e){return y$.some(t=>e.includes(t))}function cK(e,t=""){return!IT(e)&&IT(t)}function uK(e=""){for(const t of y$){const n=e.match(new RegExp(`${t}[^/]+`));if(n)return n[0]}}const $T="Running the Browser SDK in a Web extension content script is discouraged and will be forbidden in a future major release unless the `allowedTrackingOrigins` option is provided.",dK="SDK initialized on a non-allowed domain.";function fK(e,t=typeof location<"u"?location.origin:"",n=new Error().stack){const o=e.allowedTrackingOrigins;if(!o){if(cK(t,n)){pt.warn($T);const i=uK(n);na($T,{extensionUrl:i||"unknown"})}return!0}const r=jS(o,t);return r||pt.error(dK),r}function NS(e){return TS(e,location.href).href}function mK(e){try{return!!TS(e)}catch{return!1}}function hK(e){const t=TS(e).pathname;return t[0]==="/"?t:`/${t}`}function TS(e,t){const{URL:n}=pK();try{return t!==void 0?new n(e,t):new n(e)}catch(o){throw new Error(`Failed to construct URL: ${String(o)} ${du({url:e,base:t})}`)}}let jx;function pK(){if(!jx){let e,t;try{e=document.createElement("iframe"),e.style.display="none",document.body.appendChild(e),t=e.contentWindow}catch{t=window}jx={URL:t.URL},e?.remove()}return jx}function Oa(e,t,n){const o=gK(e,t);return{build(r,i){const l=vK(e,t,r,i,n);return o(l)},trackType:t}}function gK(e,t){const n=`/api/v2/${t}`,o=e.proxy;if(typeof o=="string"){const i=NS(o);return l=>`${i}?ddforward=${encodeURIComponent(`${n}?${l}`)}`}if(typeof o=="function")return i=>o({path:n,parameters:i});const r=b$(t,e);return i=>`https://${r}${n}?${i}`}function b$(e,t){const{site:n=Ia,internalAnalyticsSubdomain:o}=t;if(e==="logs"&&t.usePciIntake&&n===Ia)return E7;if(o&&n===Ia)return`${o}.${Ia}`;if(n===w7)return`http-intake.logs.${n}`;const r=n.split("."),i=r.pop();return`browser-intake-${r.join("-")}.${i}`}function vK({clientToken:e,internalAnalyticsSubdomain:t,source:n="browser"},o,r,{retry:i,encoding:l},d=[]){const f=[`ddsource=${n}`,`dd-api-key=${e}`,`dd-evp-origin-version=${encodeURIComponent("6.19.0")}`,"dd-evp-origin=browser",`dd-request-id=${cr()}`].concat(d);return l&&f.push(`dd-evp-encoding=${l}`),o==="rum"&&(f.push(`batch_time=${Bn()}`,`_dd.api=${r}`),i&&f.push(`_dd.retry_count=${i.count}`,`_dd.retry_after=${i.lastFailureStatus}`)),t&&f.reverse(),f.join("&")}function yK(e){const t=e.site||Ia,n=e.source==="flutter"?"flutter":"browser",o=bK({...e,site:t,source:n});return{replica:xK({...e,site:t,source:n}),site:t,source:n,...o}}function bK(e){return{logsEndpointBuilder:Oa(e,"logs"),rumEndpointBuilder:Oa(e,"rum"),profilingEndpointBuilder:Oa(e,"profile"),sessionReplayEndpointBuilder:Oa(e,"replay"),exposuresEndpointBuilder:Oa(e,"exposures")}}function xK(e){if(!e.replica)return;const t={...e,site:Ia,clientToken:e.replica.clientToken};return{logsEndpointBuilder:Oa(t,"logs"),rumEndpointBuilder:Oa(t,"rum",[`application.id=${e.replica.applicationId}`])}}function _K(e){return R7.every(t=>e.includes(t))}const qd={ALLOW:"allow",MASK:"mask",MASK_USER_INPUT:"mask-user-input"},ow={ALL:"all",SAMPLED:"sampled"};function Nx(e,t){return e!=null&&typeof e!="string"?(pt.error(`${t} must be defined as a string`),!1):!0}function wK(e){return e&&typeof e=="string"&&!/(datadog|ddog|datad0g|dd0g)/.test(e)?(pt.error(`Site should be a valid Datadog site. ${vS} ${Ig}/getting_started/site/.`),!1):!0}function yc(e,t){return e!==void 0&&!vq(e)?(pt.error(`${t} Sample Rate should be a number between 0 and 100`),!1):!0}function SK(e){var t,n,o,r,i,l,d,f,m,p;if(!e||!e.clientToken){pt.error("Client Token is not configured, we will not send any data.");return}if(e.allowedTrackingOrigins!==void 0&&!Array.isArray(e.allowedTrackingOrigins)){pt.error("Allowed Tracking Origins must be an array");return}if(!(!wK(e.site)||!yc(e.sessionSampleRate,"Session")||!yc(e.telemetrySampleRate,"Telemetry")||!yc(e.telemetryConfigurationSampleRate,"Telemetry Configuration")||!yc(e.telemetryUsageSampleRate,"Telemetry Usage")||!Nx(e.version,"Version")||!Nx(e.env,"Env")||!Nx(e.service,"Service")||!fK(e))){if(e.trackingConsent!==void 0&&!kp(rw,e.trackingConsent)){pt.error('Tracking Consent should be either "granted" or "not-granted"');return}return{beforeSend:e.beforeSend&&NI(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:iK(e),sessionSampleRate:(t=e.sessionSampleRate)!==null&&t!==void 0?t:100,telemetrySampleRate:(n=e.telemetrySampleRate)!==null&&n!==void 0?n:20,telemetryConfigurationSampleRate:(o=e.telemetryConfigurationSampleRate)!==null&&o!==void 0?o:5,telemetryUsageSampleRate:(r=e.telemetryUsageSampleRate)!==null&&r!==void 0?r:5,service:(i=e.service)!==null&&i!==void 0?i:void 0,env:(l=e.env)!==null&&l!==void 0?l:void 0,version:(d=e.version)!==null&&d!==void 0?d:void 0,datacenter:(f=e.datacenter)!==null&&f!==void 0?f:void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:(m=e.trackingConsent)!==null&&m!==void 0?m:rw.GRANTED,trackAnonymousUser:(p=e.trackAnonymousUser)!==null&&p!==void 0?p:!0,storeContextsAcrossPages:!!e.storeContextsAcrossPages,batchBytesLimit:16*tf,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*lr,batchMessagesLimit:50,messageBytesLimit:256*tf,variant:e.variant,sdkVersion:e.sdkVersion,...yK(e)}}}function CK(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: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),source:e.source,sdk_version:e.sdkVersion,variant:e.variant}}const EK=200;function RK(e){const{env:t,service:n,version:o,datacenter:r,sdkVersion:i,variant:l}=e,d=[sc("sdk_version",i??"6.19.0")];return t&&d.push(sc("env",t)),n&&d.push(sc("service",n)),o&&d.push(sc("version",o)),r&&d.push(sc("datacenter",r)),l&&d.push(sc("variant",l)),d}function sc(e,t){const n=t?`${e}:${t}`:e;return(n.length>EK||NK(n))&&pt.warn(`Tag ${n} doesn't meet tag requirements and will be sanitized. ${vS} ${Ig}/getting_started/tagging/#defining-tags`),jK(n)}function jK(e){return e.replace(/,/g,"_")}function NK(e){return TK()?new RegExp("[^\\p{Ll}\\p{Lo}0-9_:./-]","u").test(e):!1}function TK(){try{return new RegExp("[\\p{Ll}]","u"),!0}catch{return!1}}function yi(e,t,n,{computeHandlingStack:o}={}){let r=e[t];if(typeof r!="function")if(t in e&&t.startsWith("on"))r=Ot;else return{stop:Ot};let i=!1;const l=function(){if(i)return r.apply(this,arguments);const d=Array.from(arguments);let f;Xa(n,null,[{target:this,parameters:d,onPostCall:p=>{f=p},handlingStack:o?sf("instrumented method"):void 0}]);const m=r.apply(this,d);return f&&Xa(f,null,[m]),m};return e[t]=l,{stop:()=>{i=!0,e[t]===l&&(e[t]=r)}}}function qye(e,t,n){const o=Object.getOwnPropertyDescriptor(e,t);if(!o||!o.set||!o.configurable)return{stop:Ot};const r=Ot;let i=(d,f)=>{sr(()=>{i!==r&&n(d,f)},0)};const l=function(d){o.set.call(this,d),i(this,d)};return Object.defineProperty(e,t,{set:l}),{stop:()=>{var d;((d=Object.getOwnPropertyDescriptor(e,t))===null||d===void 0?void 0:d.set)===l&&Object.defineProperty(e,t,o),i=r}}}function OK(){return new _t(e=>{const t=(r,i)=>{const l=_S({stackTrace:i,originalError:r,startClocks:Gn(),nonErrorPrefix:"Uncaught",source:fu.SOURCE,handling:"unhandled"});e.notify(l)},{stop:n}=kK(t),{stop:o}=AK(t);return()=>{n(),o()}})}function kK(e){return yi(Xo(),"onerror",({parameters:[t,n,o,r,i]})=>{let l;ul(i)||(l=d7(t,n,o,r)),e(i??t,l)})}function AK(e){return yi(Xo(),"onunhandledrejection",({parameters:[t]})=>{e(t.reason||"Empty reason")})}function IK(e){const t={version:"6.19.0",onReady(n){n()},...e};return Object.defineProperty(t,"_setDebug",{get(){return jq},enumerable:!1}),t}function $K(e,t,n){const o=e[t];o&&!o.q&&o.version&&pt.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),e[t]=n,o&&o.q&&o.q.forEach(r=>NI(r,"onReady callback threw an error:")())}function x$(e,t){t.silentMultipleInit||pt.error(`${e} is already initialized.`)}const af={intervention:"intervention",cspViolation:"csp_violation"};function MK(e,t){const n=[];t.includes(af.cspViolation)&&n.push(DK(e));const o=t.filter(r=>r!==af.cspViolation);return o.length&&n.push(PK(o)),PI(...n)}function PK(e){return new _t(t=>{if(!window.ReportingObserver)return;const n=tt((r,i)=>r.forEach(l=>t.notify(zK(l)))),o=new window.ReportingObserver(n,{types:e,buffered:!0});return o.observe(),()=>{o.disconnect()}})}function DK(e){return new _t(t=>{const{stop:n}=Wt(e,document,"securitypolicyviolation",o=>{t.notify(UK(o))});return n})}function zK(e){const{type:t,body:n}=e;return _$({type:n.id,message:`${t}: ${n.message}`,originalError:e,stack:w$(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)})}function UK(e){const t=`'${e.blockedURI}' blocked by '${e.effectiveDirective}' directive`;return _$({type:e.effectiveDirective,message:`${af.cspViolation}: ${t}`,originalError:e,csp:{disposition:e.disposition},stack:w$(e.effectiveDirective,e.originalPolicy?`${t} of the policy "${zI(e.originalPolicy,100,"...")}"`:"no policy",e.sourceFile,e.lineNumber,e.columnNumber)})}function _$(e){return{startClocks:Gn(),source:fu.REPORT,handling:"unhandled",...e}}function w$(e,t,n,o,r){return n?kf({name:e,message:t,stack:[{func:"?",url:n,line:o??void 0,column:r??void 0}]}):void 0}function S$(e,t){const n=e.indexOf(t);n>=0&&e.splice(n,1)}const kh=1/0,LK=Ar;let Rd=null;const lp=new Set;function FK(){lp.forEach(e=>e())}function hu({expireDelay:e,maxEntries:t}){let n=[];Rd||(Rd=uu(()=>FK(),LK));const o=()=>{const p=ro()-e;for(;n.length>0&&n[n.length-1].endTime<p;)n.pop()};lp.add(o);function r(p,g){const v={value:p,startTime:g,endTime:kh,remove:()=>{S$(n,v)},close:b=>{v.endTime=b}};return t&&n.length>=t&&n.pop(),n.unshift(v),v}function i(p=kh,g={returnInactive:!1}){for(const v of n)if(v.startTime<=p){if(g.returnInactive||p<=v.endTime)return v.value;break}}function l(p){const g=n[0];g&&g.endTime===kh&&g.close(p)}function d(p=kh,g=0){const v=cu(p,g);return n.filter(b=>b.startTime<=v&&p<=b.endTime).map(b=>b.value)}function f(){n=[]}function m(){lp.delete(o),lp.size===0&&Rd&&(Mg(Rd),Rd=null)}return{add:r,find:i,closeActive:l,findAll:d,reset:f,stop:m}}const VK="datadog-synthetics-public-id",BK="datadog-synthetics-result-id",HK="datadog-synthetics-injects-rum";function C$(){return!!(window._DATADOG_SYNTHETICS_INJECTS_RUM||Ds(HK))}function E$(){const e=window._DATADOG_SYNTHETICS_PUBLIC_ID||Ds(VK);return typeof e=="string"?e:void 0}function R$(){const e=window._DATADOG_SYNTHETICS_RESULT_ID||Ds(BK);return typeof e=="string"?e:void 0}function j$(){return!!(E$()&&R$())}const GK=Ar,qK=cl;function KK(e,t,n,o){const r=new _t,i=new _t,l=aK(e.sessionStoreStrategyType,e,t,n),d=hu({expireDelay:qK});l.renewObservable.subscribe(()=>{d.add(f(),ro()),r.notify()}),l.expireObservable.subscribe(()=>{i.notify(),d.closeActive(ro())}),l.expandOrRenewSession(),d.add(f(),kI().relative),o.observable.subscribe(()=>{o.isGranted()?l.expandOrRenewSession():l.expire()}),ZK(e,()=>{o.isGranted()&&l.expandOrRenewSession()}),YK(e,()=>l.expandSession()),XK(e,()=>l.restartSession());function f(){const m=l.getSession();return m?{id:m.id,trackingType:m[t],isReplayForced:!!m.forcedReplay,anonymousId:m.anonymousId}:(WK().catch(()=>{}),{id:"invalid",trackingType:HI,isReplayForced:!1,anonymousId:void 0})}return{findSession:(m,p)=>d.find(m,p),renewObservable:r,expireObservable:i,sessionStateUpdateObservable:l.sessionStateUpdateObservable,expire:l.expire,updateSessionState:l.updateSessionState}}function ZK(e,t){const{stop:n}=qs(e,window,["click","touchstart","keydown","scroll"],t,{capture:!0,passive:!0})}function YK(e,t){const n=()=>{document.visibilityState==="visible"&&t()},{stop:o}=Wt(e,document,"visibilitychange",n);uu(n,GK)}function XK(e,t){const{stop:n}=Wt(e,window,"resume",t,{capture:!0})}async function WK(){const e=XI();let t=[];"cookieStore"in window?t=await window.cookieStore.getAll("_dd_s"):t=document.cookie.split(/\s*;\s*/).filter(n=>n.startsWith("_dd_s")),na("Unexpected session state",{session:e,isSyntheticsTest:j$(),createdTimestamp:e?.created,expireTimestamp:e?.expire,cookie:{count:t.length,domain:FI(),...t},currentDomain:`${window.location.protocol}//${window.location.hostname}`})}function QK(){let e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write(n,o){const r=II(n);t+=r,e+=n,o&&o(r)},finish(n){n(this.finishSync())},finishSync(){const n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount(n){return n.length}}}class JK{constructor(){this.callbacks={}}notify(t,n){const o=this.callbacks[t];o&&o.forEach(r=>r(n))}subscribe(t,n){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(n),{unsubscribe:()=>{this.callbacks[t]=this.callbacks[t].filter(o=>n!==o)}}}}function Tx(e,t,n){let o=0,r=!1;return{isLimitReached(){if(o===0&&sr(()=>{o=0},Ar),o+=1,o<=t||r)return r=!1,!1;if(o===t+1){r=!0;try{n({message:`Reached max number of ${e}s by minute: ${t}`,source:fu.AGENT,startClocks:Gn()})}finally{r=!1}}return!0}}}function OS(e,t,n){return document.readyState===t||document.readyState==="complete"?(n(),{stop:Ot}):Wt(e,window,t==="complete"?"load":"DOMContentLoaded",n,{once:!0})}function eZ(e,t){return new Promise(n=>{OS(e,t,n)})}let Ox;const kS=new WeakMap;function tZ(e){return Ox||(Ox=nZ(e)),Ox}function nZ(e){return new _t(t=>{const{stop:n}=yi(XMLHttpRequest.prototype,"open",rZ),{stop:o}=yi(XMLHttpRequest.prototype,"send",i=>{oZ(i,e,t)},{computeHandlingStack:!0}),{stop:r}=yi(XMLHttpRequest.prototype,"abort",iZ);return()=>{n(),o(),r()}})}function rZ({target:e,parameters:[t,n]}){kS.set(e,{state:"open",method:String(t).toUpperCase(),url:NS(String(n))})}function oZ({target:e,handlingStack:t},n,o){const r=kS.get(e);if(!r)return;const i=r;i.state="start",i.startClocks=Gn(),i.isAborted=!1,i.xhr=e,i.handlingStack=t;let l=!1;const{stop:d}=yi(e,"onreadystatechange",()=>{e.readyState===XMLHttpRequest.DONE&&f()}),f=()=>{if(m(),d(),l)return;l=!0;const p=r;p.state="complete",p.duration=Qt(i.startClocks.timeStamp,Bn()),p.status=e.status,o.notify(nf(p))},{stop:m}=Wt(n,e,"loadend",f);o.notify(i)}function iZ({target:e}){const t=kS.get(e);t&&(t.isAborted=!0)}let kx;function N$(){return kx||(kx=sZ()),kx}function sZ(){return new _t(e=>{if(!window.fetch)return;const{stop:t}=yi(window,"fetch",n=>aZ(n,e),{computeHandlingStack:!0});return t})}function aZ({parameters:e,onPostCall:t,handlingStack:n},o){const[r,i]=e;let l=i&&i.method;l===void 0&&r instanceof Request&&(l=r.method);const d=l!==void 0?String(l).toUpperCase():"GET",f=r instanceof Request?r.url:NS(String(r)),m=Gn(),p={state:"start",init:i,input:r,method:d,startClocks:m,url:f,handlingStack:n};o.notify(p),e[0]=p.input,e[1]=p.init,t(g=>lZ(o,g,p))}function lZ(e,t,n){const o=n;function r(i){o.state="resolve",Object.assign(o,i),e.notify(o)}t.then(tt(i=>{r({response:i,responseType:i.type,status:i.status,isAborted:!1})}),tt(i=>{var l,d;r({status:0,isAborted:((d=(l=o.init)===null||l===void 0?void 0:l.signal)===null||d===void 0?void 0:d.aborted)||i instanceof DOMException&&i.code===DOMException.ABORT_ERR,error:i})}))}function cZ(e,t){if(window.requestIdleCallback&&window.cancelIdleCallback){const n=window.requestIdleCallback(tt(e),t);return()=>window.cancelIdleCallback(n)}return dZ(e)}const uZ=50;function dZ(e){const t=Oo(),n=sr(()=>{e({didTimeout:!1,timeRemaining:()=>Math.max(0,uZ-(Oo()-t))})},0);return()=>Co(n)}const fZ=lr,mZ=30;function hZ(){const e=[];function t(o){let r;if(o.didTimeout){const i=performance.now();r=()=>mZ-(performance.now()-i)}else r=o.timeRemaining.bind(o);for(;r()>0&&e.length;)e.shift()();e.length&&n()}function n(){cZ(t,{timeout:fZ})}return{push(o){e.push(o)===1&&n()}}}let Ax={};function pZ(e){const t=e.map(n=>(Ax[n]||(Ax[n]=gZ(n)),Ax[n]));return PI(...t)}function gZ(e){return new _t(t=>{const n=Zi[e];return Zi[e]=(...o)=>{n.apply(console,o);const r=sf("console error");Xa(()=>{t.notify(vZ(o,e,r))})},()=>{Zi[e]=n}})}function vZ(e,t,n){const o=e.map(r=>yZ(r)).join(" ");if(t===Ag.error){const r=e.find(ul),i=_S({originalError:r,handlingStack:n,startClocks:Gn(),source:fu.CONSOLE,handling:"handled",nonErrorPrefix:"Provided",useFallbackStack:!1});return i.message=o,{api:t,message:o,handlingStack:n,error:i}}return{api:t,message:o,error:void 0,handlingStack:n}}function yZ(e){return typeof e=="string"?cn(e):ul(e)?e$(Of(e)):du(cn(e),void 0,2)}const bZ=500;function xZ(){const e=[];return{add:r=>{e.push(r)>bZ&&e.splice(0,1)},remove:r=>{S$(e,r)},drain:r=>{e.forEach(i=>i(r)),e.length=0}}}function _Z(e){const t=dl(e)==="object";return t||pt.error("Unsupported context:",e),t}function Ix(e,t,n){const o={...e};for(const[r,{required:i,type:l}]of Object.entries(t))l==="string"&&!MT(o[r])&&(o[r]=String(o[r])),i&&MT(o[r])&&pt.warn(`The property ${r} of ${n} is required; context will not be sent to the intake.`);return o}function MT(e){return e==null||e===""}function Lg(e="",{propertiesConfig:t={}}={}){let n={};const o=new _t,r={getContext:()=>SS(n),setContext:i=>{_Z(i)?n=cn(Ix(i,t,e)):r.clearContext(),o.notify()},setContextProperty:(i,l)=>{n=cn(Ix({...n,[i]:l},t,e)),o.notify()},removeContextProperty:i=>{delete n[i],Ix(n,t,e),o.notify()},clearContext:()=>{n={},o.notify()},changeObservable:o};return r}function fr(e,t,n,o){return tt((...r)=>(o&&pr({feature:o}),e()[t][n](...r)))}const wZ="_dd_c",SZ=[];function AS(e,t,n,o){const r=CZ(n,o);SZ.push(Wt(e,window,"storage",({key:m})=>{r===m&&l()})),t.changeObservable.subscribe(d);const i=ns(f(),t.getContext());ll(i)||t.setContext(i);function l(){t.setContext(f())}function d(){localStorage.setItem(r,JSON.stringify(t.getContext()))}function f(){const m=localStorage.getItem(r);return m?JSON.parse(m):{}}}function CZ(e,t){return`${wZ}_${e}_${t}`}function EZ(e,t,n){const o=T$();return t.storeContextsAcrossPages&&AS(t,o,n,4),e.register(0,()=>{const r=o.getContext();return ll(r)||!r.id?oo:{account:r}}),o}function T$(){return Lg("account",{propertiesConfig:{id:{type:"string",required:!0},name:{type:"string"}}})}function RZ(e,t,n,o){const r=O$();return t.storeContextsAcrossPages&&AS(t,r,n,2),e.register(0,()=>({context:r.getContext()})),r}function O$(){return Lg("global context")}function jZ(e,t,n,o){const r=k$();return t.storeContextsAcrossPages&&AS(t,r,o,1),e.register(0,({eventType:i,startTime:l})=>{const d=r.getContext(),f=n.findTrackedSession(l);return f&&f.anonymousId&&!d.anonymous_id&&t.trackAnonymousUser&&(d.anonymous_id=f.anonymousId),ll(d)?oo:{type:i,usr:d}}),e.register(1,({startTime:i})=>{var l;return{anonymous_id:(l=n.findTrackedSession(i))===null||l===void 0?void 0:l.anonymousId}}),r}function k$(){return Lg("user",{propertiesConfig:{id:{type:"string"},name:{type:"string"},email:{type:"string"}}})}const Vn={userContext:"userContext",globalContext:"globalContext",accountContext:"accountContext"},mr={getContext:"getContext",setContext:"setContext",setContextProperty:"setContextProperty",removeContextProperty:"removeContextProperty",clearContext:"clearContext"};function NZ(e,t,n){const o=e.getReader();let r=0;i();function i(){o.read().then(tt(d=>{if(d.done){l();return}r+=d.value.length,r>n.bytesLimit?l():i()}),tt(d=>t(d)))}function l(){o.cancel().catch(Ot),t(void 0,void 0,void 0)}}const vr={DOCUMENT:"document",XHR:"xhr",BEACON:"beacon",FETCH:"fetch",CSS:"css",JS:"js",IMAGE:"image",FONT:"font",MEDIA:"media",OTHER:"other"},Fg={FETCH:vr.FETCH,XHR:vr.XHR},TZ=500;function OZ(e=OK){const t=new DI(TZ),n=e().subscribe(o=>{t.notify({type:0,error:o})});return{observable:t,stop:()=>{n.unsubscribe()}}}function kZ(){try{return new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}const it={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",VITAL:"vital"},A$={LONG_TASK:"long-task",LONG_ANIMATION_FRAME:"long-animation-frame"},Yi={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change",BF_CACHE:"bf_cache"},IS={CLICK:"click",CUSTOM:"custom"},jd={RAGE_CLICK:"rage_click",ERROR_CLICK:"error_click",DEAD_CLICK:"dead_click"},I$={DURATION:"duration"};function AZ(){return{vitalsByName:new Map,vitalsByReference:new WeakMap}}function IZ(e,t,n){function o(i){return!t.wasInPageStateDuringPeriod("frozen",i.startClocks.relative,i.duration)}function r(i){o(i)&&e.notify(12,MZ(i))}return{addDurationVital:r,startDurationVital:(i,l={})=>$$(n,i,l),stopDurationVital:(i,l={})=>{M$(r,n,i,l)}}}function $$({vitalsByName:e,vitalsByReference:t},n,o={}){const r={name:n,startClocks:Gn(),context:o.context,description:o.description},i={__dd_vital_reference:!0};return e.set(n,r),t.set(i,r),i}function M$(e,{vitalsByName:t,vitalsByReference:n},o,r={}){const i=typeof o=="string"?t.get(o):n.get(o);i&&(e($Z(i,i.startClocks,r,Gn())),typeof o=="string"?t.delete(o):n.delete(o))}function $Z(e,t,n,o){var r;return{name:e.name,type:I$.DURATION,startClocks:t,duration:Qt(t.timeStamp,o.timeStamp),context:ns(e.context,n.context),description:(r=n.description)!==null&&r!==void 0?r:e.description}}function MZ(e,t){const n={date:e.startClocks.timeStamp,vital:{id:cr(),type:e.type,name:e.name,duration:ot(e.duration),description:e.description},type:it.VITAL,context:e.context};return n._dd={vital:{computed_value:!0}},{rawRumEvent:n,startTime:e.startClocks.relative,duration:e.duration,domainContext:{}}}function P$(e,t,n){if(e)for(const o of e){const r=o[t];r&&r(n)}}const PT=new Map;function D$(e,t){if(t===100)return!0;if(t===0)return!1;const n=PT.get(t);if(n&&e===n.sessionId)return n.decision;let o;return window.BigInt?o=PZ(BigInt(`0x${e.split("-")[4]}`),t):o=es(t),PT.set(t,{sessionId:e,decision:o}),o}function PZ(e,t){const n=BigInt("1111111111111111111"),o=BigInt("0x10000000000000000"),r=e*n%o;return Number(r)<=t/100*Number(o)}function DZ(){return U$(64)}function z$(){return U$(63)}function U$(e){const t=crypto.getRandomValues(new Uint32Array(2));return e===63&&(t[t.length-1]>>>=1),{toString(n=10){let o=t[1],r=t[0],i="";do{const l=o%n*4294967296+r;o=Math.floor(o/n),r=Math.floor(l/n),i=(l%n).toString(n)+i}while(o||r);return i}}}function ac(e){return e.toString(16).padStart(16,"0")}function zZ(e){const t=e;return dl(t)==="object"&&RS(t.match)&&Array.isArray(t.propagatorTypes)}function UZ(e){e.status===0&&!e.isAborted&&(e.traceId=void 0,e.spanId=void 0,e.traceSampled=void 0)}function LZ(e,t,n,o){return{clearTracingIfNeeded:UZ,traceFetch:r=>DT(e,r,t,n,o,i=>{var l;if(r.input instanceof Request&&!(!((l=r.init)===null||l===void 0)&&l.headers))r.input=new Request(r.input),Object.keys(i).forEach(d=>{r.input.headers.append(d,i[d])});else{r.init=nf(r.init);const d=[];r.init.headers instanceof Headers?r.init.headers.forEach((f,m)=>{d.push([m,f])}):Array.isArray(r.init.headers)?r.init.headers.forEach(f=>{d.push(f)}):r.init.headers&&Object.keys(r.init.headers).forEach(f=>{d.push([f,r.init.headers[f]])}),r.init.headers=d.concat(bS(i))}}),traceXhr:(r,i)=>DT(e,r,t,n,o,l=>{Object.keys(l).forEach(d=>{i.setRequestHeader(d,l[d])})})}}function DT(e,t,n,o,r,i){const l=n.findTrackedSession();if(!l)return;const d=e.allowedTracingUrls.find(p=>jS([p.match],t.url,!0));if(!d)return;const f=D$(l.id,e.traceSampleRate);(f||e.traceContextInjection===ow.ALL)&&(t.traceSampled=f,t.traceId=DZ(),t.spanId=z$(),i(FZ(t.traceId,t.spanId,t.traceSampled,l.id,d.propagatorTypes,o,r,e)))}function FZ(e,t,n,o,r,i,l,d){const f={};if(r.forEach(m=>{switch(m){case"datadog":{Object.assign(f,{"x-datadog-origin":"rum","x-datadog-parent-id":t.toString(),"x-datadog-sampling-priority":n?"1":"0","x-datadog-trace-id":e.toString()});break}case"tracecontext":{Object.assign(f,{traceparent:`00-0000000000000000${ac(e)}-${ac(t)}-0${n?"1":"0"}`,tracestate:`dd=s:${n?"1":"0"};o:rum`});break}case"b3":{Object.assign(f,{b3:`${ac(e)}-${ac(t)}-${n?"1":"0"}`});break}case"b3multi":{Object.assign(f,{"X-B3-TraceId":ac(e),"X-B3-SpanId":ac(t),"X-B3-Sampled":n?"1":"0"});break}}}),d.propagateTraceBaggage){const m={"session.id":o},p=i.getContext().id;typeof p=="string"&&(m["user.id"]=p);const g=l.getContext().id;typeof g=="string"&&(m["account.id"]=g);const v=Object.entries(m).map(([b,x])=>`${b}=${encodeURIComponent(x)}`).join(",");v&&(f.baggage=v)}return f}const L$=["tracecontext","datadog"];function VZ(e){var t,n,o,r,i,l,d;if(e.trackFeatureFlagsForEvents!==void 0&&!Array.isArray(e.trackFeatureFlagsForEvents)&&pt.warn("trackFeatureFlagsForEvents should be an array"),!e.applicationId){pt.error("Application ID is not configured, no RUM data will be collected.");return}if(!yc(e.sessionReplaySampleRate,"Session Replay")||!yc(e.traceSampleRate,"Trace"))return;if(e.excludedActivityUrls!==void 0&&!Array.isArray(e.excludedActivityUrls)){pt.error("Excluded Activity Urls should be an array");return}const f=BZ(e);if(!f)return;const m=SK(e);if(!m)return;const p=(t=e.sessionReplaySampleRate)!==null&&t!==void 0?t:0;return{applicationId:e.applicationId,actionNameAttribute:e.actionNameAttribute,sessionReplaySampleRate:p,startSessionReplayRecordingManually:e.startSessionReplayRecordingManually!==void 0?!!e.startSessionReplayRecordingManually:p===0,traceSampleRate:(n=e.traceSampleRate)!==null&&n!==void 0?n:100,rulePsr:jf(e.traceSampleRate)?e.traceSampleRate/100:void 0,allowedTracingUrls:f,excludedActivityUrls:(o=e.excludedActivityUrls)!==null&&o!==void 0?o:[],workerUrl:e.workerUrl,compressIntakeRequests:!!e.compressIntakeRequests,trackUserInteractions:!!(!((r=e.trackUserInteractions)!==null&&r!==void 0)||r),trackViewsManually:!!e.trackViewsManually,trackResources:!!(!((i=e.trackResources)!==null&&i!==void 0)||i),trackLongTasks:!!(!((l=e.trackLongTasks)!==null&&l!==void 0)||l),trackBfcacheViews:!!e.trackBfcacheViews,subdomain:e.subdomain,defaultPrivacyLevel:kp(qd,e.defaultPrivacyLevel)?e.defaultPrivacyLevel:qd.MASK,enablePrivacyForActionName:!!e.enablePrivacyForActionName,customerDataTelemetrySampleRate:1,initialViewMetricsTelemetrySampleRate:1,replayTelemetrySampleRate:1,traceContextInjection:kp(ow,e.traceContextInjection)?e.traceContextInjection:ow.SAMPLED,plugins:e.plugins||[],trackFeatureFlagsForEvents:e.trackFeatureFlagsForEvents||[],profilingSampleRate:(d=e.profilingSampleRate)!==null&&d!==void 0?d:0,propagateTraceBaggage:!!e.propagateTraceBaggage,...m}}function BZ(e){if(e.allowedTracingUrls===void 0)return[];if(!Array.isArray(e.allowedTracingUrls)){pt.error("Allowed Tracing URLs should be an array");return}if(e.allowedTracingUrls.length!==0&&e.service===void 0){pt.error("Service needs to be configured when tracing is enabled");return}const t=[];return e.allowedTracingUrls.forEach(n=>{RS(n)?t.push({match:n,propagatorTypes:L$}):zZ(n)?t.push(n):pt.warn("Allowed Tracing Urls parameters should be a string, RegExp, function, or an object. Ignoring parameter",n)}),t}function HZ(e){const t=new Set;return Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0&&e.allowedTracingUrls.forEach(n=>{RS(n)?L$.forEach(o=>t.add(o)):dl(n)==="object"&&Array.isArray(n.propagatorTypes)&&n.propagatorTypes.forEach(o=>t.add(o))}),Array.from(t)}function GZ(e){var t;const n=CK(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,action_name_attribute:e.actionNameAttribute,use_allowed_tracing_urls:Array.isArray(e.allowedTracingUrls)&&e.allowedTracingUrls.length>0,selected_tracing_propagators:HZ(e),default_privacy_level:e.defaultPrivacyLevel,enable_privacy_for_action_name:e.enablePrivacyForActionName,use_excluded_activity_urls:Array.isArray(e.excludedActivityUrls)&&e.excludedActivityUrls.length>0,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,plugins:(t=e.plugins)===null||t===void 0?void 0:t.map(o=>{var r;return{name:o.name,...(r=o.getConfigurationTelemetry)===null||r===void 0?void 0:r.call(o)}}),track_feature_flags_for_events:e.trackFeatureFlagsForEvents,remote_configuration_id:e.remoteConfigurationId,...n}}const qZ="v1",KZ=["applicationId","service","env","version","sessionSampleRate","sessionReplaySampleRate","defaultPrivacyLevel","enablePrivacyForActionName","traceSampleRate","trackSessionAcrossSubdomains","allowedTracingUrls","allowedTrackingOrigins"];async function ZZ(e,t){const n=await rY(e);if(!n.ok){pt.error(n.error);return}return YZ(e,n.value,t)}function YZ(e,t,n){const o={...e};return KZ.forEach(r=>{r in t&&(o[r]=$p(t[r]))}),Object.keys(n).forEach(r=>{t[r]!==void 0&&QZ(n[r],t[r])}),o}function $p(e){if(Array.isArray(e))return e.map($p);if(XZ(e)){if(WZ(e)){const t=e.rcSerializedType;switch(t){case"string":return e.value;case"regex":return F$(e.value);case"dynamic":return JZ(e);default:pt.error(`Unsupported remote configuration: "rcSerializedType": "${t}"`);return}}return $I(e,$p)}return e}function XZ(e){return typeof e=="object"&&e!==null}function WZ(e){return"rcSerializedType"in e}function F$(e){try{return new RegExp(e)}catch{pt.error(`Invalid regex in the remote configuration: '${e}'`)}}function QZ(e,t){t.forEach(({key:n,value:o})=>{e.setContextProperty(n,$p(o))})}function JZ(e){const t=e.strategy;switch(t){case"cookie":return eY(e);case"dom":return tY(e);default:pt.error(`Unsupported remote configuration: "strategy": "${t}"`);return}}function eY({name:e,extractor:t}){const n=zg(e);return t!==void 0&&n!==void 0?V$(t,n):n}function tY({selector:e,attribute:t,extractor:n}){let o;try{o=document.querySelector(e)}catch{o=null,pt.error(`Invalid selector in the remote configuration: '${e}'`)}if(o===null||nY(o,t))return;const r=t!==void 0?o.getAttribute(t):o.textContent;return n!==void 0&&r!==null?V$(n,r):r??void 0}function nY(e,t){return e.getAttribute("type")==="password"&&t==="value"}function V$(e,t){const n=F$(e.value);if(n===void 0)return;const o=n.exec(t);if(o===null)return;const[r,i]=o;return i||r}async function rY(e){let t;try{t=await fetch(oY(e))}catch{t=void 0}if(!t||!t.ok)return{ok:!1,error:new Error("Error fetching the remote configuration.")};const n=await t.json();return n.rum?{ok:!0,value:n.rum}:{ok:!1,error:new Error("No remote configuration for RUM.")}}function oY(e){return e.remoteConfigurationProxy?e.remoteConfigurationProxy:`https://sdk-configuration.${b$("rum",e)}/${qZ}/${encodeURIComponent(e.remoteConfigurationId)}.json`}function iY({ignoreInitIfSyntheticsWillInjectRum:e=!0,startDeflateWorker:t},n,o,r){const i=xZ(),l=O$();$x(l,Vn.globalContext,i);const d=k$();$x(d,Vn.userContext,i);const f=T$();$x(f,Vn.accountContext,i);let m,p,g,v;const b=n.observable.subscribe(S),x={};function S(){if(!g||!v||!n.isGranted())return;b.unsubscribe();let j;if(v.trackViewsManually){if(!m)return;i.remove(m.callback),j=m.options}const T=r(v,p,j);i.drain(T)}function C(j){const T=Bc();if(T&&(j=sY(j)),g=j,W7(GZ(j)),v){x$("DD_RUM",j);return}const O=VZ(j);if(O){if(!T&&!O.sessionStoreStrategyType){pt.warn("No storage available for session. We will not send any data.");return}O.compressIntakeRequests&&!T&&t&&(p=t(O,"Datadog RUM",Ot),!p)||(v=O,N$().subscribe(Ot),n.tryToInit(O.trackingConsent),S())}}const E=j=>{i.add(T=>T.addDurationVital(j))};return{init(j,T){if(!j){pt.error("Missing configuration");return}b7(j.enableExperimentalFeatures),g=j,!(e&&C$())&&(P$(j.plugins,"onInit",{initConfiguration:j,publicApi:T}),j.remoteConfigurationId?ZZ(j,{user:d,context:l}).then(O=>{O&&C(O)}).catch(Lc):C(j))},get initConfiguration(){return g},getInternalContext:Ot,stopSession:Ot,addTiming(j,T=Bn()){i.add(O=>O.addTiming(j,T))},startView(j,T=Gn()){const O=A=>{A.startView(j,T)};i.add(O),m||(m={options:j,callback:O},S())},setViewName(j){i.add(T=>T.setViewName(j))},setViewContext(j){i.add(T=>T.setViewContext(j))},setViewContextProperty(j,T){i.add(O=>O.setViewContextProperty(j,T))},getViewContext:()=>x,globalContext:l,userContext:d,accountContext:f,addAction(j){i.add(T=>T.addAction(j))},addError(j){i.add(T=>T.addError(j))},addFeatureFlagEvaluation(j,T){i.add(O=>O.addFeatureFlagEvaluation(j,T))},startDurationVital(j,T){return $$(o,j,T)},stopDurationVital(j,T){M$(E,o,j,T)},addDurationVital:E}}function sY(e){var t,n;return{...e,applicationId:"00000000-aaaa-0000-aaaa-000000000000",clientToken:"empty",sessionSampleRate:100,defaultPrivacyLevel:(t=e.defaultPrivacyLevel)!==null&&t!==void 0?t:(n=Af())===null||n===void 0?void 0:n.getPrivacyLevel()}}function $x(e,t,n){e.changeObservable.subscribe(()=>{const o=e.getContext();n.add(r=>r[t].setContext(o))})}function aY(e,t,n,o={}){const r=lK(),i=AZ(),l=OZ().observable;let d=iY(o,r,i,(g,v,b)=>{const x=e(g,t,n,b,v&&o.createDeflateEncoder?S=>o.createDeflateEncoder(g,v,S):QK,r,i,l,o.sdkName);return t.onRumStart(x.lifeCycle,g,x.session,x.viewHistory,v,x.telemetry),n.onRumStart(x.lifeCycle,x.hooks,g,x.session,x.viewHistory),d=lY(d,x),P$(g.plugins,"onRumStart",{strategy:d,addEvent:x.addEvent}),x});const f=()=>d,m=tt(g=>{const v=typeof g=="object"?g:{name:g};d.startView(v),pr({feature:"start-view"})}),p=IK({init:tt(g=>{d.init(g,p)}),setTrackingConsent:tt(g=>{r.update(g),pr({feature:"set-tracking-consent",tracking_consent:g})}),setViewName:tt(g=>{d.setViewName(g),pr({feature:"set-view-name"})}),setViewContext:tt(g=>{d.setViewContext(g),pr({feature:"set-view-context"})}),setViewContextProperty:tt((g,v)=>{d.setViewContextProperty(g,v),pr({feature:"set-view-context-property"})}),getViewContext:tt(()=>(pr({feature:"set-view-context-property"}),d.getViewContext())),getInternalContext:tt(g=>d.getInternalContext(g)),getInitConfiguration:tt(()=>SS(d.initConfiguration)),addAction:(g,v)=>{const b=sf("action");Xa(()=>{d.addAction({name:cn(g),context:cn(v),startClocks:Gn(),type:IS.CUSTOM,handlingStack:b}),pr({feature:"add-action"})})},addError:(g,v)=>{const b=sf("error");Xa(()=>{d.addError({error:g,handlingStack:b,context:cn(v),startClocks:Gn()}),pr({feature:"add-error"})})},addTiming:tt((g,v)=>{d.addTiming(cn(g),v)}),setGlobalContext:fr(f,Vn.globalContext,mr.setContext,"set-global-context"),getGlobalContext:fr(f,Vn.globalContext,mr.getContext,"get-global-context"),setGlobalContextProperty:fr(f,Vn.globalContext,mr.setContextProperty,"set-global-context-property"),removeGlobalContextProperty:fr(f,Vn.globalContext,mr.removeContextProperty,"remove-global-context-property"),clearGlobalContext:fr(f,Vn.globalContext,mr.clearContext,"clear-global-context"),setUser:fr(f,Vn.userContext,mr.setContext,"set-user"),getUser:fr(f,Vn.userContext,mr.getContext,"get-user"),setUserProperty:fr(f,Vn.userContext,mr.setContextProperty,"set-user-property"),removeUserProperty:fr(f,Vn.userContext,mr.removeContextProperty,"remove-user-property"),clearUser:fr(f,Vn.userContext,mr.clearContext,"clear-user"),setAccount:fr(f,Vn.accountContext,mr.setContext,"set-account"),getAccount:fr(f,Vn.accountContext,mr.getContext,"get-account"),setAccountProperty:fr(f,Vn.accountContext,mr.setContextProperty,"set-account-property"),removeAccountProperty:fr(f,Vn.accountContext,mr.removeContextProperty,"remove-account-property"),clearAccount:fr(f,Vn.accountContext,mr.clearContext,"clear-account"),startView:m,stopSession:tt(()=>{d.stopSession(),pr({feature:"stop-session"})}),addFeatureFlagEvaluation:tt((g,v)=>{d.addFeatureFlagEvaluation(cn(g),cn(v)),pr({feature:"add-feature-flag-evaluation"})}),getSessionReplayLink:tt(()=>t.getSessionReplayLink()),startSessionReplayRecording:tt(g=>{t.start(g),pr({feature:"start-session-replay-recording",force:g&&g.force})}),stopSessionReplayRecording:tt(()=>t.stop()),addDurationVital:tt((g,v)=>{pr({feature:"add-duration-vital"}),d.addDurationVital({name:cn(g),type:I$.DURATION,startClocks:bq(v.startTime),duration:v.duration,context:cn(v&&v.context),description:cn(v&&v.description)})}),startDurationVital:tt((g,v)=>(pr({feature:"start-duration-vital"}),d.startDurationVital(cn(g),{context:cn(v&&v.context),description:cn(v&&v.description)}))),stopDurationVital:tt((g,v)=>{pr({feature:"stop-duration-vital"}),d.stopDurationVital(typeof g=="string"?cn(g):g,{context:cn(v&&v.context),description:cn(v&&v.description)})})});return p}function lY(e,t){return{init:n=>{x$("DD_RUM",n)},initConfiguration:e.initConfiguration,...t}}function cY(){const e=uY();return new _t(t=>{if(!e)return;const n=new e(tt(o=>t.notify(o)));return n.observe(document,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),()=>n.disconnect()})}function uY(){let e;const t=window;if(t.Zone&&(e=Gs(t,"MutationObserver"),t.MutationObserver&&e===t.MutationObserver)){const n=new t.MutationObserver(Ot),o=Gs(n,"originalInstance");e=o&&o.constructor}return e||(e=t.MutationObserver),e}function dY(){const e=new _t,{stop:t}=yi(window,"open",()=>e.notify());return{observable:e,stop:t}}function fY(e,t,n,o,r){return{get:i=>{const l=n.findView(i),d=r.findUrl(i),f=t.findTrackedSession(i);if(f&&l&&d){const m=o.findActionId(i);return{application_id:e,session_id:f.id,user_action:m?{id:m}:void 0,view:{id:l.id,name:l.name,referrer:d.referrer,url:d.url}}}}}}const mY=JK,hY=cl;function pY(e){const t=hu({expireDelay:hY});e.subscribe(1,o=>{t.add(n(o),o.startClocks.relative)}),e.subscribe(6,({endClocks:o})=>{t.closeActive(o.relative)}),e.subscribe(3,o=>{const r=t.find(o.startClocks.relative);r&&(o.name&&(r.name=o.name),o.context&&(r.context=o.context),r.sessionIsActive=o.sessionIsActive)}),e.subscribe(10,()=>{t.reset()});function n(o){return{service:o.service,version:o.version,context:o.context,id:o.id,name:o.name,startClocks:o.startClocks}}return{findView:o=>t.find(o),stop:()=>{t.stop()}}}const B$="initial_document",gY=[[vr.DOCUMENT,e=>B$===e],[vr.XHR,e=>e==="xmlhttprequest"],[vr.FETCH,e=>e==="fetch"],[vr.BEACON,e=>e==="beacon"],[vr.CSS,(e,t)=>/\.css$/i.test(t)],[vr.JS,(e,t)=>/\.js$/i.test(t)],[vr.IMAGE,(e,t)=>["image","img","icon"].includes(e)||/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i.exec(t)!==null],[vr.FONT,(e,t)=>/\.(woff|eot|woff2|ttf)$/i.exec(t)!==null],[vr.MEDIA,(e,t)=>["audio","video"].includes(e)||/\.(mp3|mp4)$/i.exec(t)!==null]];function vY(e){const t=e.name;if(!mK(t))return na(`Failed to construct URL for "${e.name}"`),vr.OTHER;const n=hK(t);for(const[o,r]of gY)if(r(e.initiatorType,n))return o;return vr.OTHER}function zT(...e){for(let t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function H$(e){return e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch"}function yY(e){const{duration:t,startTime:n,responseEnd:o}=e;return t===0&&n<o?Qt(n,o):t}function bY(e){if(!q$(e))return;const{startTime:t,fetchStart:n,workerStart:o,redirectStart:r,redirectEnd:i,domainLookupStart:l,domainLookupEnd:d,connectStart:f,secureConnectionStart:m,connectEnd:p,requestStart:g,responseStart:v,responseEnd:b}=e,x={download:ja(t,v,b),first_byte:ja(t,g,v)};return 0<o&&o<n&&(x.worker=ja(t,o,n)),n<p&&(x.connect=ja(t,f,p),f<=m&&m<=p&&(x.ssl=ja(t,m,p))),n<d&&(x.dns=ja(t,l,d)),t<i&&(x.redirect=ja(t,r,i)),x}function G$(e){return e.duration>=0}function q$(e){const t=zT(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd),n=xY(e)?zT(e.startTime,e.redirectStart,e.redirectEnd,e.fetchStart):!0;return t&&n}function xY(e){return e.redirectEnd>e.startTime}function ja(e,t,n){if(e<=t&&t<=n)return{duration:ot(Qt(t,n)),start:ot(Qt(e,t))}}function _Y(e){return e.nextHopProtocol===""?void 0:e.nextHopProtocol}function wY(e){return e.deliveryType===""?"other":e.deliveryType}function SY(e){if(e.startTime<e.responseStart){const{encodedBodySize:t,decodedBodySize:n,transferSize:o}=e;return{size:n,encoded_body_size:t,decoded_body_size:n,transfer_size:o}}return{size:void 0,encoded_body_size:void 0,decoded_body_size:void 0,transfer_size:void 0}}function $S(e){return e&&(!_K(e)||Ug(Wa.TRACK_INTAKE_REQUESTS))}const CY=/data:(.+)?(;base64)?,/g,EY=24e3;function RY(e,t=EY){if(e.length<=t||!e.startsWith("data:"))return e;const n=e.substring(0,100).match(CY);return n?`${n[0]}[...]`:e}let UT=1;function jY(e,t,n,o,r){const i=LZ(t,n,o,r);NY(e,t,i),TY(e,i)}function NY(e,t,n){const o=tZ(t).subscribe(r=>{const i=r;if($S(i.url))switch(i.state){case"start":n.traceXhr(i,i.xhr),i.requestIndex=K$(),e.notify(7,{requestIndex:i.requestIndex,url:i.url});break;case"complete":n.clearTracingIfNeeded(i),e.notify(8,{duration:i.duration,method:i.method,requestIndex:i.requestIndex,spanId:i.spanId,startClocks:i.startClocks,status:i.status,traceId:i.traceId,traceSampled:i.traceSampled,type:Fg.XHR,url:i.url,xhr:i.xhr,isAborted:i.isAborted,handlingStack:i.handlingStack});break}});return{stop:()=>o.unsubscribe()}}function TY(e,t){const n=N$().subscribe(o=>{const r=o;if($S(r.url))switch(r.state){case"start":t.traceFetch(r),r.requestIndex=K$(),e.notify(7,{requestIndex:r.requestIndex,url:r.url});break;case"resolve":OY(r,i=>{t.clearTracingIfNeeded(r),e.notify(8,{duration:i,method:r.method,requestIndex:r.requestIndex,responseType:r.responseType,spanId:r.spanId,startClocks:r.startClocks,status:r.status,traceId:r.traceId,traceSampled:r.traceSampled,type:Fg.FETCH,url:r.url,response:r.response,init:r.init,input:r.input,isAborted:r.isAborted,handlingStack:r.handlingStack})});break}});return{stop:()=>n.unsubscribe()}}function K$(){const e=UT;return UT+=1,e}function OY(e,t){const n=e.response&&T7(e.response);!n||!n.body?t(Qt(e.startClocks.timeStamp,Bn())):NZ(n.body,()=>{t(Qt(e.startClocks.timeStamp,Bn()))},{bytesLimit:Number.POSITIVE_INFINITY})}function Z$(e){return jf(e)&&e<0?void 0:e}function Y$({lifeCycle:e,isChildEvent:t,onChange:n=Ot}){const o={errorCount:0,longTaskCount:0,resourceCount:0,actionCount:0,frustrationCount:0},r=e.subscribe(13,i=>{var l;if(!(i.type==="view"||i.type==="vital"||!t(i)))switch(i.type){case it.ERROR:o.errorCount+=1,n();break;case it.ACTION:o.actionCount+=1,i.action.frustration&&(o.frustrationCount+=i.action.frustration.type.length),n();break;case it.LONG_TASK:o.longTaskCount+=1,n();break;case it.RESOURCE:!((l=i._dd)===null||l===void 0)&&l.discarded||(o.resourceCount+=1,n());break}});return{stop:()=>{r.unsubscribe()},eventCounts:o}}function kY(e,t){const n=Oo();let o=!1;const{stop:r}=qs(e,window,["click","mousedown","keydown","touchstart","pointerdown"],d=>{if(!d.cancelable)return;const f={entryType:"first-input",processingStart:ro(),processingEnd:ro(),startTime:d.timeStamp,duration:0,name:"",cancelable:!1,target:null,toJSON:()=>({})};d.type==="pointerdown"?i(e,f):l(f)},{passive:!0,capture:!0});return{stop:r};function i(d,f){qs(d,window,["pointerup","pointercancel"],m=>{m.type==="pointerup"&&l(f)},{once:!0})}function l(d){if(!o){o=!0,r();const f=d.processingStart-d.startTime;f>=0&&f<Oo()-n&&t(d)}}}var St;(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"})(St||(St={}));function _i(e,t){return new _t(n=>{if(!window.PerformanceObserver)return;const o=f=>{const m=$Y(f);m.length>0&&n.notify(m)};let r,i=!0;const l=new PerformanceObserver(tt(f=>{i?r=sr(()=>o(f.getEntries())):o(f.getEntries())}));try{l.observe(t)}catch{if([St.RESOURCE,St.NAVIGATION,St.LONG_TASK,St.PAINT].includes(t.type)){t.buffered&&(r=sr(()=>o(performance.getEntriesByType(t.type))));try{l.observe({entryTypes:[t.type]})}catch{return}}}i=!1,AY(e);let d;return!fl(St.FIRST_INPUT)&&t.type===St.FIRST_INPUT&&({stop:d}=kY(e,f=>{o([f])})),()=>{l.disconnect(),d&&d(),Co(r)}})}let Nd;function AY(e){return!Nd&&IY()&&"addEventListener"in performance&&(Nd=Wt(e,performance,"resourcetimingbufferfull",()=>{performance.clearResourceTimings()})),()=>{Nd?.stop()}}function IY(){return window.performance!==void 0&&"getEntries"in performance}function fl(e){return window.PerformanceObserver&&PerformanceObserver.supportedEntryTypes!==void 0&&PerformanceObserver.supportedEntryTypes.includes(e)}function $Y(e){return e.filter(t=>!MY(t))}function MY(e){return e.entryType===St.RESOURCE&&(!$S(e.name)||!G$(e))}function X$(e){return e.nodeType===Node.TEXT_NODE}function PY(e){return e.nodeType===Node.COMMENT_NODE}function rs(e){return e.nodeType===Node.ELEMENT_NODE}function W$(e){return rs(e)&&!!e.shadowRoot}function DY(e){const t=e;return!!t.host&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&rs(t.host)}function Kye(e){return e.childNodes.length>0||W$(e)}function Zye(e,t){let n=e.firstChild;for(;n;)t(n),n=n.nextSibling;W$(e)&&t(e.shadowRoot)}function zY(e){return DY(e)?e.host:e.parentNode}const Q$=100,UY=100,LT="data-dd-excluded-activity-mutations";function MS(e,t,n,o,r,i){const l=FY(e,t,n,o);return LY(l,r,i)}function LY(e,t,n){let o,r=!1;const i=sr(tt(()=>m({hadActivity:!1})),Q$),l=n!==void 0?sr(tt(()=>m({hadActivity:!0,end:Bn()})),n):void 0,d=e.subscribe(({isBusy:p})=>{Co(i),Co(o);const g=Bn();p||(o=sr(tt(()=>m({hadActivity:!0,end:g})),UY))}),f=()=>{r=!0,Co(i),Co(o),Co(l),d.unsubscribe()};function m(p){r||(f(),t(p))}return{stop:f}}function FY(e,t,n,o){return new _t(r=>{const i=[];let l,d=0;return i.push(t.subscribe(m=>{m.every(VY)||f()}),n.subscribe(f),_i(o,{type:St.RESOURCE}).subscribe(m=>{m.some(p=>!Mx(o,p.name))&&f()}),e.subscribe(7,m=>{Mx(o,m.url)||(l===void 0&&(l=m.requestIndex),d+=1,f())}),e.subscribe(8,m=>{Mx(o,m.url)||l===void 0||m.requestIndex<l||(d-=1,f())})),()=>{i.forEach(m=>m.unsubscribe())};function f(){r.notify({isBusy:d>0})}})}function Mx(e,t){return jS(e.excludedActivityUrls,t)}function VY(e){const t=e.type==="characterData"?e.target.parentElement:e.target;return!!(t&&rs(t)&&t.matches(`[${LT}], [${LT}] *`))}const Rt={IGNORE:"ignore",HIDDEN:"hidden",ALLOW:qd.ALLOW,MASK:qd.MASK,MASK_USER_INPUT:qd.MASK_USER_INPUT},BY="data-dd-privacy",Yye="hidden",HY="dd-privacy-",Px="***",Xye="data:image/gif;base64,R0lGODlhAQABAIAAAMLCwgAAACH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==",GY={INPUT:!0,OUTPUT:!0,TEXTAREA:!0,SELECT:!0,OPTION:!0,DATALIST:!0,OPTGROUP:!0},qY="x";function J$(e,t,n){if(n&&n.has(e))return n.get(e);const o=zY(e),r=o?J$(o,t,n):t,i=eM(e),l=KY(i,r);return n&&n.set(e,l),l}function KY(e,t){switch(t){case Rt.HIDDEN:case Rt.IGNORE:return t}switch(e){case Rt.ALLOW:case Rt.MASK:case Rt.MASK_USER_INPUT:case Rt.HIDDEN:case Rt.IGNORE:return e;default:return t}}function eM(e){if(rs(e)){if(e.tagName==="BASE")return Rt.ALLOW;if(e.tagName==="INPUT"){const t=e;if(t.type==="password"||t.type==="email"||t.type==="tel"||t.type==="hidden")return Rt.MASK;const n=t.getAttribute("autocomplete");if(n&&(n.startsWith("cc-")||n.endsWith("-password")))return Rt.MASK}if(e.matches(bc(Rt.HIDDEN)))return Rt.HIDDEN;if(e.matches(bc(Rt.MASK)))return Rt.MASK;if(e.matches(bc(Rt.MASK_USER_INPUT)))return Rt.MASK_USER_INPUT;if(e.matches(bc(Rt.ALLOW)))return Rt.ALLOW;if(YY(e))return Rt.IGNORE}}function tM(e,t){switch(t){case Rt.MASK:case Rt.HIDDEN:case Rt.IGNORE:return!0;case Rt.MASK_USER_INPUT:return X$(e)?FT(e.parentNode):FT(e);default:return!1}}function FT(e){if(!e||e.nodeType!==e.ELEMENT_NODE)return!1;const t=e;if(t.tagName==="INPUT")switch(t.type){case"button":case"color":case"reset":case"submit":return!1}return!!GY[t.tagName]}const ZY=e=>e.replace(/\S/g,qY);function Wye(e,t,n){var o;const r=(o=e.parentElement)===null||o===void 0?void 0:o.tagName;let i=e.textContent||"";if(t&&!i.trim())return;const l=n;if(r==="SCRIPT")i=Px;else if(l===Rt.HIDDEN)i=Px;else if(tM(e,l))if(r==="DATALIST"||r==="SELECT"||r==="OPTGROUP"){if(!i.trim())return}else r==="OPTION"?i=Px:i=ZY(i);return i}function YY(e){if(e.nodeName==="SCRIPT")return!0;if(e.nodeName==="LINK"){const n=t("rel");return/preload|prefetch/i.test(n)&&t("as")==="script"||n==="shortcut icon"||n==="icon"}if(e.nodeName==="META"){const n=t("name"),o=t("rel"),r=t("property");return/^msapplication-tile(image|color)$/.test(n)||n==="application-name"||o==="icon"||o==="apple-touch-icon"||o==="shortcut icon"||n==="keywords"||n==="description"||/^(og|twitter|fb):/.test(r)||/^(og|twitter):/.test(n)||n==="pinterest"||n==="robots"||n==="googlebot"||n==="bingbot"||e.hasAttribute("http-equiv")||n==="author"||n==="generator"||n==="framework"||n==="publisher"||n==="progid"||/^article:/.test(r)||/^product:/.test(r)||n==="google-site-verification"||n==="yandex-verification"||n==="csrf-token"||n==="p:domain_verify"||n==="verify-v1"||n==="verification"||n==="shopify-checkout-api-token"}function t(n){return(e.getAttribute(n)||"").toLowerCase()}return!1}function bc(e){return`[${BY}="${e}"], .${HY}${e}`}const Vg="data-dd-action-name",XY="Masked Element";function WY(e,{enablePrivacyForActionName:t,actionNameAttribute:n},o=Rt.ALLOW){const r=VT(e,Vg)||n&&VT(e,n);return r?{name:r,nameSource:"custom_attribute"}:o===Rt.MASK?{name:XY,nameSource:"mask_placeholder"}:BT(e,n,QY,t)||BT(e,n,JY,t)||{name:"",nameSource:"blank"}}function VT(e,t){const n=e.closest(`[${t}]`);if(!n)return;const o=n.getAttribute(t);return rM(nM(o.trim()))}const QY=[(e,t,n)=>{if("labels"in e&&e.labels&&e.labels.length>0)return cp(e.labels[0],t,n)},e=>{if(e.nodeName==="INPUT"){const t=e,n=t.getAttribute("type");if(n==="button"||n==="submit"||n==="reset")return{name:t.value,nameSource:"text_content"}}},(e,t,n)=>{if(e.nodeName==="BUTTON"||e.nodeName==="LABEL"||e.getAttribute("role")==="button")return cp(e,t,n)},e=>Td(e,"aria-label"),(e,t,n)=>{const o=e.getAttribute("aria-labelledby");if(o)return{name:o.split(/\s+/).map(r=>tX(e,r)).filter(r=>!!r).map(r=>oM(r,t,n)).join(" "),nameSource:"text_content"}},e=>Td(e,"alt"),e=>Td(e,"name"),e=>Td(e,"title"),e=>Td(e,"placeholder"),(e,t,n)=>{if("options"in e&&e.options.length>0)return cp(e.options[0],t,n)}],JY=[(e,t,n)=>cp(e,t,n)],eX=10;function BT(e,t,n,o){let r=e,i=0;for(;i<=eX&&r&&r.nodeName!=="BODY"&&r.nodeName!=="HTML"&&r.nodeName!=="HEAD";){for(const l of n){const d=l(r,t,o);if(d){const{name:f,nameSource:m}=d,p=f&&f.trim();if(p)return{name:rM(nM(p)),nameSource:m}}}if(r.nodeName==="FORM")break;r=r.parentElement,i+=1}}function nM(e){return e.replace(/\s+/g," ")}function rM(e){return e.length>100?`${zI(e,100)} [...]`:e}function tX(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}function Td(e,t){return{name:e.getAttribute(t)||"",nameSource:"standard_attribute"}}function cp(e,t,n){return{name:oM(e,t,n)||"",nameSource:"text_content"}}function oM(e,t,n){if(!e.isContentEditable){if(Ug(Wa.USE_TREE_WALKER_FOR_ACTION_NAME))return nX(e,t,n);if("innerText"in e){let o=e.innerText;const r=i=>{const l=e.querySelectorAll(i);for(let d=0;d<l.length;d+=1){const f=l[d];if("innerText"in f){const m=f.innerText;m&&m.trim().length>0&&(o=o.replace(m,""))}}};return r(`[${Vg}]`),t&&r(`[${t}]`),n&&r(`${bc(Rt.HIDDEN)}, ${bc(Rt.MASK)}`),o}return e.textContent}}function nX(e,t,n){const o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,i);let r="";for(;o.nextNode();){const l=o.currentNode;if(rs(l)){(l.nodeName==="BR"||l.nodeName==="P"||["block","flex","grid","list-item","table","table-caption"].includes(getComputedStyle(l).display))&&(r+=" ");continue}r+=l.textContent||""}return r.replace(/\s+/g," ").trim();function i(l){if(rs(l)){const d=eM(l);if(l.hasAttribute(Vg)||t&&l.hasAttribute(t)||n&&d&&tM(l,d))return NodeFilter.FILTER_REJECT;const f=getComputedStyle(l);if(f.visibility!=="visible"||f.display==="none"||f.contentVisibility&&f.contentVisibility!=="visible")return NodeFilter.FILTER_REJECT}return NodeFilter.FILTER_ACCEPT}}const rX=[Vg,"data-testid","data-test","data-qa","data-cy","data-test-id","data-qa-id","data-testing","data-component","data-element","data-source-file"],oX=[sM,sX],iX=[sM,aX,lX];function If(e,t){if(!e.isConnected)return;let n,o=e;for(;o&&o.nodeName!=="HTML";){const r=HT(o,oX,uX,t,n);if(r)return r;n=HT(o,iX,dX,t,n)||Bg(cX(o),n),o=o.parentElement}return n}function iM(e){return/[0-9]/.test(e)}function sX(e){if(e.id&&!iM(e.id))return`#${CSS.escape(e.id)}`}function aX(e){if(e.tagName==="BODY")return;const t=e.classList;for(let n=0;n<t.length;n+=1){const o=t[n];if(!iM(o))return`${CSS.escape(e.tagName)}.${CSS.escape(o)}`}}function lX(e){return CSS.escape(e.tagName)}function sM(e,t){if(t){const o=n(t);if(o)return o}for(const o of rX){const r=n(o);if(r)return r}function n(o){if(e.hasAttribute(o))return`${CSS.escape(e.tagName)}[${o}="${CSS.escape(e.getAttribute(o))}"]`}}function cX(e){let t=e.parentElement.firstElementChild,n=1;for(;t&&t!==e;)t.tagName===e.tagName&&(n+=1),t=t.nextElementSibling;return`${CSS.escape(e.tagName)}:nth-of-type(${n})`}function HT(e,t,n,o,r){for(const i of t){const l=i(e,o);if(l&&n(e,l,r))return Bg(l,r)}}function uX(e,t,n){return e.ownerDocument.querySelectorAll(Bg(t,n)).length===1}function dX(e,t,n){let o;if(n===void 0)o=l=>l.matches(t);else{const l=Bg(`${t}:scope`,n);o=d=>d.querySelector(l)!==null}let i=e.parentElement.firstElementChild;for(;i;){if(i!==e&&o(i))return!1;i=i.nextElementSibling}return!0}function Bg(e,t){return t?`${e}>${t}`:e}const aM=lr,fX=100;function mX(e,t){const n=[];let o=0,r;i(e);function i(f){f.stopObservable.subscribe(l),n.push(f),Co(r),r=sr(d,aM)}function l(){o===1&&n.every(f=>f.isStopped())&&(o=2,t(n))}function d(){Co(r),o===0&&(o=1,l())}return{tryAppend:f=>o!==0?!1:n.length>0&&!hX(n[n.length-1].event,f.event)?(d(),!1):(i(f),!0),stop:()=>{d()}}}function hX(e,t){return e.target===t.target&&pX(e,t)<=fX&&e.timeStamp-t.timeStamp<=aM}function pX(e,t){return Math.sqrt(Math.pow(e.clientX-t.clientX,2)+Math.pow(e.clientY-t.clientY,2))}function gX(e,{onPointerDown:t,onPointerUp:n}){let o,r={selection:!1,input:!1,scroll:!1},i;const l=[Wt(e,window,"pointerdown",d=>{qT(d)&&(o=GT(),r={selection:!1,input:!1,scroll:!1},i=t(d))},{capture:!0}),Wt(e,window,"selectionchange",()=>{(!o||!GT())&&(r.selection=!0)},{capture:!0}),Wt(e,window,"scroll",()=>{r.scroll=!0},{capture:!0,passive:!0}),Wt(e,window,"pointerup",d=>{if(qT(d)&&i){const f=r;n(i,d,()=>f),i=void 0}},{capture:!0}),Wt(e,window,"input",()=>{r.input=!0},{capture:!0})];return{stop:()=>{l.forEach(d=>d.stop())}}}function GT(){const e=window.getSelection();return!e||e.isCollapsed}function qT(e){return e.target instanceof Element&&e.isPrimary!==!1}const KT=3;function vX(e,t){if(yX(e))return t.addFrustration(jd.RAGE_CLICK),e.some(ZT)&&t.addFrustration(jd.DEAD_CLICK),t.hasError&&t.addFrustration(jd.ERROR_CLICK),{isRage:!0};const n=e.some(o=>o.getUserActivity().selection);return e.forEach(o=>{o.hasError&&o.addFrustration(jd.ERROR_CLICK),ZT(o)&&!n&&o.addFrustration(jd.DEAD_CLICK)}),{isRage:!1}}function yX(e){if(e.some(t=>t.getUserActivity().selection||t.getUserActivity().scroll))return!1;for(let t=0;t<e.length-(KT-1);t+=1)if(e[t+KT-1].event.timeStamp-e[t].event.timeStamp<=lr)return!0;return!1}const bX='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 ZT(e){if(e.hasPageActivity||e.getUserActivity().input||e.getUserActivity().scroll)return!1;let t=e.event.target;return t.tagName==="LABEL"&&t.hasAttribute("for")&&(t=document.getElementById(t.getAttribute("for"))),!t||!t.matches(bX)}const lM=10*lr,Kd=new Map;function xX(e){const t=Kd.get(e);return Kd.delete(e),t}function cM(e,t){Kd.set(e,t),Kd.forEach((n,o)=>{Qt(o,ro())>lM&&Kd.delete(o)})}const _X=5*Ar;function wX(e,t,n,o){const r=hu({expireDelay:_X}),i=new _t;let l;e.subscribe(10,()=>{r.reset()}),e.subscribe(5,p),e.subscribe(11,g=>{g.reason===Ec.UNLOADING&&p()});const{stop:d}=gX(o,{onPointerDown:g=>SX(o,e,t,g,n),onPointerUp:({clickActionBase:g,hadActivityOnPointerDown:v},b,x)=>{CX(o,e,t,n,r,i,m,g,b,x,v)}});return{stop:()=>{p(),i.notify(),d()},actionContexts:{findActionId:g=>r.findAll(g)}};function m(g){if(!l||!l.tryAppend(g)){const v=g.clone();l=mX(g,b=>{RX(b,v)})}}function p(){l&&l.stop()}}function SX(e,t,n,o,r){const i=e.enablePrivacyForActionName?J$(o.target,e.defaultPrivacyLevel):Rt.ALLOW;if(i===Rt.HIDDEN)return;const l=EX(o,i,e);let d=!1;return MS(t,n,r,e,f=>{d=f.hadActivity},Q$),{clickActionBase:l,hadActivityOnPointerDown:()=>d}}function CX(e,t,n,o,r,i,l,d,f,m,p){var g;const v=uM(t,r,m,d,f);l(v);const b=(g=d?.target)===null||g===void 0?void 0:g.selector;b&&cM(f.timeStamp,b);const{stop:x}=MS(t,n,o,e,E=>{E.hadActivity&&E.end<v.startClocks.timeStamp?v.discard():E.hadActivity?v.stop(E.end):p()?v.stop(v.startClocks.timeStamp):v.stop()},lM),S=t.subscribe(5,({endClocks:E})=>{v.stop(E.timeStamp)}),C=i.subscribe(()=>{v.stop()});v.stopObservable.subscribe(()=>{S.unsubscribe(),x(),C.unsubscribe()})}function EX(e,t,n){const o=e.target.getBoundingClientRect(),r=If(e.target,n.actionNameAttribute);r&&cM(e.timeStamp,r);const i=WY(e.target,n,t);return{type:IS.CLICK,target:{width:Math.round(o.width),height:Math.round(o.height),selector:r},position:{x:Math.round(e.clientX-o.left),y:Math.round(e.clientY-o.top)},name:i.name,nameSource:i.nameSource}}function uM(e,t,n,o,r){const i=cr(),l=Gn(),d=t.add(i,l.relative),f=Y$({lifeCycle:e,isChildEvent:x=>x.action!==void 0&&(Array.isArray(x.action.id)?x.action.id.includes(i):x.action.id===i)});let m=0,p;const g=[],v=new _t;function b(x){m===0&&(p=x,m=1,p?d.close(yS(p)):d.remove(),f.stop(),v.notify())}return{event:r,stop:b,stopObservable:v,get hasError(){return f.eventCounts.errorCount>0},get hasPageActivity(){return p!==void 0},getUserActivity:n,addFrustration:x=>{g.push(x)},startClocks:l,isStopped:()=>m===1||m===2,clone:()=>uM(e,t,n,o,r),validate:x=>{if(b(),m!==1)return;const{resourceCount:S,errorCount:C,longTaskCount:E}=f.eventCounts,N={duration:p&&Qt(l.timeStamp,p),startClocks:l,id:i,frustrationTypes:g,counts:{resourceCount:S,errorCount:C,longTaskCount:E},events:x??[r],event:r,...o};e.notify(0,N),m=2},discard:()=>{b(),m=2}}}function RX(e,t){const{isRage:n}=vX(e,t);n?(e.forEach(o=>o.discard()),t.stop(Bn()),t.validate(e.map(o=>o.event))):(t.discard(),e.forEach(o=>o.validate()))}function jX(e,t,n,o,r){e.subscribe(0,d=>e.notify(12,YT(d))),t.register(0,({startTime:d,eventType:f})=>{if(f!==it.ERROR&&f!==it.RESOURCE&&f!==it.LONG_TASK)return oo;const m=i.findActionId(d);return m?{type:f,action:{id:m}}:oo}),t.register(1,({startTime:d})=>({action:{id:i.findActionId(d)}}));let i={findActionId:Ot},l=Ot;return r.trackUserInteractions&&({actionContexts:i,stop:l}=wX(e,n,o,r)),{addAction:d=>{e.notify(12,YT(d))},actionContexts:i,stop:l}}function YT(e){const t=Dx(e)?{action:{id:e.id,loading_time:Z$(ot(e.duration)),frustration:{type:e.frustrationTypes},error:{count:e.counts.errorCount},long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}},_dd:{action:{target:e.target,position:e.position,name_source:e.nameSource}}}:{context:e.context},n=ns({action:{id:cr(),target:{name:e.name},type:e.type},date:e.startClocks.timeStamp,type:it.ACTION},t),o=Dx(e)?e.duration:void 0,r=Dx(e)?{events:e.events}:{handlingStack:e.handlingStack};return{rawRumEvent:n,duration:o,startTime:e.startClocks.relative,domainContext:r}}function Dx(e){return e.type!==IS.CUSTOM}function NX(e){const t=pZ([Ag.error]).subscribe(n=>e.notify(n.error));return{stop:()=>{t.unsubscribe()}}}function TX(e,t){const n=MK(e,[af.cspViolation,af.intervention]).subscribe(o=>t.notify(o));return{stop:()=>{n.unsubscribe()}}}function OX(e,t,n){const o=new _t;return n.subscribe(r=>{r.type===0&&o.notify(r.error)}),NX(o),TX(t,o),o.subscribe(r=>e.notify(14,{error:r})),kX(e)}function kX(e){return e.subscribe(14,({error:t})=>{e.notify(12,AX(t))}),{addError:({error:t,handlingStack:n,componentStack:o,startClocks:r,context:i})=>{const l=_S({originalError:t,handlingStack:n,componentStack:o,startClocks:r,nonErrorPrefix:"Provided",source:fu.CUSTOM,handling:"handled"});l.context=ns(l.context,i),e.notify(14,{error:l})}}}function AX(e){const t={date:e.startClocks.timeStamp,error:{id:cr(),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:it.ERROR,context:e.context},n={error:e.originalError,handlingStack:e.handlingStack};return{rawRumEvent:t,startTime:e.startClocks.relative,domainContext:n}}const XT=new WeakSet;function IX(e){if(!performance||!("getEntriesByName"in performance))return;const t=performance.getEntriesByName(e.url,"resource");if(!t.length||!("toJSON"in t[0]))return;const n=t.filter(o=>!XT.has(o)).filter(o=>G$(o)&&q$(o)).filter(o=>$X(o,e.startClocks.relative,dM({startTime:e.startClocks.relative,duration:e.duration})));if(n.length===1)return XT.add(n[0]),n[0].toJSON()}function dM(e){return cu(e.startTime,e.duration)}function $X(e,t,n){return e.startTime>=t-1&&dM(e)<=cu(n,1)}const MX=2*Ar;function PX(e){const t=DX(e)||zX(e);if(!(!t||t.traceTime<=Oo()-MX))return t.traceId}function DX(e){const t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return fM(t&&t.content,n&&n.content)}function zX(e){const t=UX(e);if(t)return fM(rf(t,"trace-id"),rf(t,"trace-time"))}function fM(e,t){const n=t&&Number(t);if(!(!e||!n))return{traceId:e,traceTime:n}}function UX(e){for(let t=0;t<e.childNodes.length;t+=1){const n=WT(e.childNodes[t]);if(n)return n}if(e.body)for(let t=e.body.childNodes.length-1;t>=0;t-=1){const n=e.body.childNodes[t],o=WT(n);if(o)return o;if(!X$(n))break}}function WT(e){if(e&&PY(e)){const t=/^\s*DATADOG;(.*?)\s*$/.exec(e.data);if(t)return t[1]}}function mM(){if(fl(St.NAVIGATION)){const n=performance.getEntriesByType(St.NAVIGATION)[0];if(n)return n}const e=LX(),t={entryType:St.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 LX(){const e={},t=performance.timing;for(const n in t)if(jf(t[n])){const o=n,r=t[o];e[o]=r===0?0:yS(r)}return e}function FX(e,t,n=mM){OS(e,"interactive",()=>{const o=n(),r=Object.assign(o.toJSON(),{entryType:St.RESOURCE,initiatorType:B$,duration:o.responseEnd,traceId:PX(document),toJSON:()=>({...r,toJSON:void 0})});t(r)})}const VX=1e3;function BX(e){const t=new Set,n=e.subscribe(8,o=>{t.add(o),t.size>VX&&(na("Too many requests"),t.delete(t.values().next().value))});return{getMatchingRequest(o){let r=1/0,i;for(const l of t){const d=o.startTime-l.startClocks.relative;0<=d&&d<r&&l.url===o.name&&(r=Math.abs(d),i=l)}return i&&t.delete(i),i},stop(){n.unsubscribe()}}}function HX(e,t,n,o=hZ(),r=FX){let i;const l=Ug(Wa.EARLY_REQUEST_COLLECTION);l?i=BX(e):e.subscribe(8,m=>{f(()=>GX(m,t,n))});const d=_i(t,{type:St.RESOURCE,buffered:!0}).subscribe(m=>{for(const p of m)(l||!H$(p))&&f(()=>QT(p,t,n,i))});r(t,m=>{f(()=>QT(m,t,n,i))});function f(m){o.push(()=>{const p=m();p&&e.notify(12,p)})}return{stop:()=>{d.unsubscribe()}}}function GX(e,t,n){const o=IX(e);return hM(o,e,n,t)}function QT(e,t,n,o){const r=H$(e)&&o?o.getMatchingRequest(e):void 0;return hM(e,r,n,t)}function hM(e,t,n,o){if(!e&&!t)return;const r=t?ZX(t,o):YX(e,o);if(!o.trackResources&&!r)return;const i=e?$g(e.startTime):t.startClocks,l=e?yY(e):XX(n,i,t.duration),d=ns({date:i.timeStamp,resource:{id:cr(),duration:ot(l),type:t?t.type===Fg.XHR?vr.XHR:vr.FETCH:vY(e),method:t?t.method:void 0,status_code:t?t.status:WX(e.responseStatus),url:t?RY(t.url):e.name,protocol:e&&_Y(e),delivery_type:e&&wY(e)},type:it.RESOURCE,_dd:{discarded:!o.trackResources}},r,e&&KX(e));return{startTime:i.relative,duration:l,rawRumEvent:d,domainContext:qX(e,t)}}function qX(e,t){if(t){const n={performanceEntry:e,isAborted:t.isAborted,handlingStack:t.handlingStack};return t.type===Fg.XHR?{xhr:t.xhr,...n}:{requestInput:t.input,requestInit:t.init,response:t.response,error:t.error,...n}}return{performanceEntry:e}}function KX(e){const{renderBlockingStatus:t}=e;return{resource:{render_blocking_status:t,...SY(e),...bY(e)}}}function ZX(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 YX(e,t){if(e.traceId)return{_dd:{trace_id:e.traceId,span_id:z$().toString(),rule_psr:t.rulePsr}}}function XX(e,t,n){return e.wasInPageStateDuringPeriod("frozen",t.relative,n)?void 0:n}function WX(e){return e===0?void 0:e}function QX(e,t,n){const{stop:o,eventCounts:r}=Y$({lifeCycle:e,isChildEvent:i=>i.view.id===t,onChange:n});return{stop:o,eventCounts:r}}const JX=10*Ar;function eW(e,t,n){return{stop:_i(e,{type:St.PAINT,buffered:!0}).subscribe(r=>{const i=r.find(l=>l.name==="first-contentful-paint"&&l.startTime<t.timeStamp&&l.startTime<JX);i&&n(i.startTime)}).unsubscribe}}function tW(e,t){requestAnimationFrame(()=>{requestAnimationFrame(()=>{t(Qt(e,ro()))})})}function nW(e,t,n){const o=_i(e,{type:St.FIRST_INPUT,buffered:!0}).subscribe(r=>{const i=r.find(l=>l.startTime<t.timeStamp);if(i){const l=Qt(i.startTime,i.processingStart);let d;i.target&&rs(i.target)&&(d=If(i.target,e.actionNameAttribute)),n({delay:l>=0?l:0,time:i.startTime,targetSelector:d})}});return{stop:()=>{o.unsubscribe()}}}function rW(e,t,n=mM){return sW(e,()=>{const o=n();iW(o)||t(oW(o))})}function oW(e){return{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,firstByte:e.responseStart>=0&&e.responseStart<=ro()?e.responseStart:void 0}}function iW(e){return e.loadEventEnd<=0}function sW(e,t){let n;const{stop:o}=OS(e,"complete",()=>{n=sr(()=>t())});return{stop:()=>{o(),Co(n)}}}const aW=10*Ar;function lW(e,t,n,o){let r=1/0;const{stop:i}=qs(e,n,["pointerdown","keydown"],f=>{r=f.timeStamp},{capture:!0,once:!0});let l=0;const d=_i(e,{type:St.LARGEST_CONTENTFUL_PAINT,buffered:!0}).subscribe(f=>{const m=Aq(f,p=>p.entryType===St.LARGEST_CONTENTFUL_PAINT&&p.startTime<r&&p.startTime<t.timeStamp&&p.startTime<aW&&p.size>l);if(m){let p;m.element&&(p=If(m.element,e.actionNameAttribute)),o({value:m.startTime,targetSelector:p,resourceUrl:cW(m)}),l=m.size}});return{stop:()=>{i(),d.unsubscribe()}}}function cW(e){return e.url===""?void 0:e.url}function pM(e,t,n=window){if(document.visibilityState==="hidden")return{timeStamp:0,stop:Ot};if(fl(St.VISIBILITY_STATE)){const i=performance.getEntriesByType(St.VISIBILITY_STATE).filter(l=>l.name==="hidden").find(l=>l.startTime>=t.relative);if(i)return{timeStamp:i.startTime,stop:Ot}}let o=1/0;const{stop:r}=qs(e,n,["pagehide","visibilitychange"],i=>{(i.type==="pagehide"||document.visibilityState==="hidden")&&(o=i.timeStamp,r())},{capture:!0});return{get timeStamp(){return o},stop:r}}function uW(e,t,n,o){const r={},{stop:i}=rW(e,g=>{n(g.loadEvent),r.navigationTimings=g,o()}),l=pM(e,t),{stop:d}=eW(e,l,g=>{r.firstContentfulPaint=g,o()}),{stop:f}=lW(e,l,window,g=>{r.largestContentfulPaint=g,o()}),{stop:m}=nW(e,l,g=>{r.firstInput=g,o()});function p(){i(),d(),f(),m(),l.stop()}return{stop:p,initialViewMetrics:r}}const iw=(e,t)=>e*t,dW=(e,t)=>{const n=Math.max(e.left,t.left),o=Math.max(e.top,t.top),r=Math.min(e.right,t.right),i=Math.min(e.bottom,t.bottom);return n>=r||o>=i?0:iw(r-n,i-o)},JT=e=>{const t=iw(e.previousRect.width,e.previousRect.height),n=iw(e.currentRect.width,e.currentRect.height),o=dW(e.previousRect,e.currentRect);return t+n-o};function fW(e,t,n){if(!vW())return{stop:Ot};let o=0,r;n({value:0});const i=gW(),l=_i(e,{type:St.LAYOUT_SHIFT,buffered:!0}).subscribe(d=>{var f;for(const m of d){if(m.hadRecentInput||m.startTime<t)continue;const{cumulatedValue:p,isMaxValue:g}=i.update(m);if(g){const v=mW(m.sources);r={target:v?.node?new WeakRef(v.node):void 0,time:Qt(t,m.startTime),previousRect:v?.previousRect,currentRect:v?.currentRect,devicePixelRatio:window.devicePixelRatio}}if(p>o){o=p;const v=(f=r?.target)===null||f===void 0?void 0:f.deref();n({value:Hd(o,4),targetSelector:v&&If(v,e.actionNameAttribute),time:r?.time,previousRect:r?.previousRect?eO(r.previousRect):void 0,currentRect:r?.currentRect?eO(r.currentRect):void 0,devicePixelRatio:r?.devicePixelRatio})}}});return{stop:()=>{l.unsubscribe()}}}function mW(e){let t;for(const n of e)if(n.node&&rs(n.node)){const o=JT(n);(!t||JT(t)<o)&&(t=n)}return t}function eO({x:e,y:t,width:n,height:o}){return{x:e,y:t,width:n,height:o}}const hW=5*lr,pW=lr;function gW(){let e=0,t,n,o=0;return{update:r=>{const i=t===void 0||r.startTime-n>=pW||r.startTime-t>=hW;let l;return i?(t=n=r.startTime,o=e=r.value,l=!0):(e+=r.value,n=r.startTime,l=r.value>o,l&&(o=r.value)),{cumulatedValue:e,isMaxValue:l}}}}function vW(){return fl(St.LAYOUT_SHIFT)&&"WeakRef"in window}let up,gM=0,zx=1/0,Ux=0;function yW(){"interactionCount"in performance||up||(up=new window.PerformanceObserver(tt(e=>{e.getEntries().forEach(t=>{const n=t;n.interactionId&&(zx=Math.min(zx,n.interactionId),Ux=Math.max(Ux,n.interactionId),gM=(Ux-zx)/7+1)})})),up.observe({type:"event",buffered:!0,durationThreshold:0}))}const tO=()=>up?gM:window.performance.interactionCount||0,nO=10,bW=1*Ar;function xW(e,t,n){if(!SW())return{getInteractionToNextPaint:()=>{},setViewEnd:Ot,stop:Ot};const{getViewInteractionCount:o,stopViewInteractionCount:r}=wW(n);let i=1/0;const l=_W(o);let d=-1,f,m;function p(b){for(const S of b)S.interactionId&&S.startTime>=t&&S.startTime<=i&&l.process(S);const x=l.estimateP98Interaction();x&&x.duration!==d&&(d=x.duration,m=Qt(t,x.startTime),f=xX(x.startTime),!f&&x.target&&rs(x.target)&&(f=If(x.target,e.actionNameAttribute)))}const g=_i(e,{type:St.FIRST_INPUT,buffered:!0}).subscribe(p),v=_i(e,{type:St.EVENT,durationThreshold:40,buffered:!0}).subscribe(p);return{getInteractionToNextPaint:()=>{if(d>=0)return{value:Math.min(d,bW),targetSelector:f,time:m};if(o())return{value:0}},setViewEnd:b=>{i=b,r()},stop:()=>{v.unsubscribe(),g.unsubscribe()}}}function _W(e){const t=[];function n(){t.sort((o,r)=>r.duration-o.duration).splice(nO)}return{process(o){const r=t.findIndex(l=>o.interactionId===l.interactionId),i=t[t.length-1];r!==-1?o.duration>t[r].duration&&(t[r]=o,n()):(t.length<nO||o.duration>i.duration)&&(t.push(o),n())},estimateP98Interaction(){const o=Math.min(t.length-1,Math.floor(e()/50));return t[o]}}}function wW(e){yW();const t=e===Yi.INITIAL_LOAD?0:tO();let n={stopped:!1};function o(){return tO()-t}return{getViewInteractionCount:()=>n.stopped?n.interactionCount:o(),stopViewInteractionCount:()=>{n={stopped:!0,interactionCount:o()}}}}function SW(){return fl(St.EVENT)&&window.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype}function CW(e,t,n,o,r,i,l){let d=r===Yi.INITIAL_LOAD,f=!0;const m=[],p=pM(o,i);function g(){if(!f&&!d&&m.length>0){const b=Math.max(...m);b<p.timeStamp-i.relative&&l(b)}}const{stop:v}=MS(e,t,n,o,b=>{f&&(f=!1,b.hadActivity&&m.push(Qt(i.timeStamp,b.end)),g())});return{stop:()=>{v(),p.stop()},setLoadEvent:b=>{d&&(d=!1,m.push(b),g())}}}function Qye(){let e;const t=window.visualViewport;return t?e=t.pageLeft-t.offsetLeft:window.scrollX!==void 0?e=window.scrollX:e=window.pageXOffset||0,Math.round(e)}function EW(){let e;const t=window.visualViewport;return t?e=t.pageTop-t.offsetTop:window.scrollY!==void 0?e=window.scrollY:e=window.pageYOffset||0,Math.round(e)}let Lx;function RW(e){return Lx||(Lx=jW(e)),Lx}function jW(e){return new _t(t=>{const{throttled:n}=Pg(()=>{t.notify(PS())},200);return Wt(e,window,"resize",n,{capture:!0,passive:!0}).stop})}function PS(){const 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)}}const NW=lr;function TW(e,t,n,o=kW(e)){let r=0,i=0,l=0;const d=o.subscribe(({scrollDepth:f,scrollTop:m,scrollHeight:p})=>{let g=!1;if(f>r&&(r=f,g=!0),p>i){i=p;const v=ro();l=Qt(t.relative,v),g=!0}g&&n({maxDepth:Math.min(r,i),maxDepthScrollTop:m,maxScrollHeight:i,maxScrollHeightTime:l})});return{stop:()=>d.unsubscribe()}}function OW(){const e=EW(),{height:t}=PS(),n=Math.round((document.scrollingElement||document.documentElement).scrollHeight),o=Math.round(t+e);return{scrollHeight:n,scrollDepth:o,scrollTop:e}}function kW(e,t=NW){return new _t(n=>{function o(){n.notify(OW())}if(window.ResizeObserver){const r=Pg(o,t,{leading:!1,trailing:!0}),i=document.scrollingElement||document.documentElement,l=new ResizeObserver(tt(r.throttled));i&&l.observe(i);const d=Wt(e,window,"scroll",r.throttled,{passive:!0});return()=>{r.cancel(),l.disconnect(),d.stop()}}})}function AW(e,t,n,o,r,i,l){const d={},{stop:f,setLoadEvent:m}=CW(e,t,n,o,i,l,S=>{d.loadingTime=S,r()}),{stop:p}=TW(o,l,S=>{d.scroll=S}),{stop:g}=fW(o,l.relative,S=>{d.cumulativeLayoutShift=S,r()}),{stop:v,getInteractionToNextPaint:b,setViewEnd:x}=xW(o,l.relative,i);return{stop:()=>{f(),g(),p()},stopINPTracking:v,setLoadEvent:m,setViewEnd:x,getCommonViewMetrics:()=>(d.interactionToNextPaint=b(),d)}}function IW(e,t){const{stop:n}=Wt(e,window,"pageshow",o=>{o.persisted&&t(o)},{capture:!0});return n}function $W(e,t,n){tW(e.relative,o=>{t.firstContentfulPaint=o,t.largestContentfulPaint={value:o},n()})}const MW=3e3,PW=5*Ar,DW=5*Ar;function zW(e,t,n,o,r,i,l,d){const f=new Set;let m=v(Yi.INITIAL_LOAD,kI(),d),p;b();let g;l&&(g=x(i),r.trackBfcacheViews&&(p=IW(r,S=>{m.end();const C=$g(S.timeStamp);m=v(Yi.BF_CACHE,C,void 0)})));function v(S,C,E){const N=UW(t,n,o,r,e,S,C,E);return f.add(N),N.stopObservable.subscribe(()=>{f.delete(N)}),N}function b(){t.subscribe(10,()=>{m=v(Yi.ROUTE_CHANGE,void 0,{name:m.name,service:m.service,version:m.version,context:m.contextManager.getContext()})}),t.subscribe(9,()=>{m.end({sessionIsActive:!1})})}function x(S){return S.subscribe(({oldLocation:C,newLocation:E})=>{FW(C,E)&&(m.end(),m=v(Yi.ROUTE_CHANGE))})}return{addTiming:(S,C=Bn())=>{m.addTiming(S,C)},startView:(S,C)=>{m.end({endClocks:C}),m=v(Yi.ROUTE_CHANGE,C,S)},setViewContext:S=>{m.contextManager.setContext(S)},setViewContextProperty:(S,C)=>{m.contextManager.setContextProperty(S,C)},setViewName:S=>{m.setViewName(S)},getViewContext:()=>m.contextManager.getContext(),stop:()=>{g&&g.unsubscribe(),p&&p(),m.end(),f.forEach(S=>S.stop())}}}function UW(e,t,n,o,r,i,l=Gn(),d){const f=cr(),m=new _t,p={};let g=0,v;const b=nf(r),x=Lg();let S=!0,C=d?.name;const E=d?.service||o.service,N=d?.version||o.version,j=d?.context;j&&x.setContext(j);const T={id:f,name:C,startClocks:l,service:E,version:N,context:j};e.notify(1,T),e.notify(2,T);const{throttled:O,cancel:A}=Pg($,MW,{leading:!1}),{setLoadEvent:I,setViewEnd:P,stop:U,stopINPTracking:V,getCommonViewMetrics:oe}=AW(e,t,n,o,se,i,l),{stop:ae,initialViewMetrics:de}=i===Yi.INITIAL_LOAD?uW(o,l,I,se):{stop:Ot,initialViewMetrics:{}};i===Yi.BF_CACHE&&$W(l,de,se);const{stop:ce,eventCounts:le}=QX(e,f,se),M=uu($,PW),Z=e.subscribe(11,q=>{q.reason===Ec.UNLOADING&&$()});$(),x.changeObservable.subscribe(se);function F(){e.notify(3,{id:f,name:C,context:x.getContext(),startClocks:l,sessionIsActive:S})}function se(){F(),O()}function $(){A(),F(),g+=1;const q=v===void 0?Bn():v.timeStamp;e.notify(4,{customTimings:p,documentVersion:g,id:f,name:C,service:E,version:N,context:x.getContext(),loadingType:i,location:b,startClocks:l,commonViewMetrics:oe(),initialViewMetrics:de,duration:Qt(l.timeStamp,q),isActive:v===void 0,sessionIsActive:S,eventCounts:le})}return{get name(){return C},service:E,version:N,contextManager:x,stopObservable:m,end(q={}){var te,B;v||(v=(te=q.endClocks)!==null&&te!==void 0?te:Gn(),S=(B=q.sessionIsActive)!==null&&B!==void 0?B:!0,e.notify(5,{endClocks:v}),e.notify(6,{endClocks:v}),Mg(M),P(v.relative),U(),Z.unsubscribe(),$(),sr(()=>{this.stop()},DW))},stop(){ae(),ce(),V(),m.notify()},addTiming(q,te){if(v)return;const B=Sq(te)?te:Qt(l.timeStamp,te);p[LW(q)]=B,se()},setViewName(q){C=q,$()}}}function LW(e){const t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t!==e&&pt.warn(`Invalid timing name: ${e}, sanitized to: ${t}`),t}function FW(e,t){return e.pathname!==t.pathname||!VW(t.hash)&&rO(t.hash)!==rO(e.hash)}function VW(e){const t=e.substring(1);return t!==""&&!!document.getElementById(t)}function rO(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}function BW(e,t,n,o,r,i,l,d,f,m){return e.subscribe(4,p=>e.notify(12,HW(p,n,d))),t.register(0,({startTime:p,eventType:g})=>{const v=f.findView(p);return v?{type:g,service:v.service,version:v.version,context:v.context,view:{id:v.id,name:v.name}}:Ks}),t.register(1,({startTime:p})=>{var g;return{view:{id:(g=f.findView(p))===null||g===void 0?void 0:g.id}}}),zW(o,e,r,i,n,l,!n.trackViewsManually,m)}function HW(e,t,n){var o,r,i,l,d,f,m,p,g,v,b,x,S,C,E,N,j,T;const O=n.getReplayStats(e.id),A=(r=(o=e.commonViewMetrics)===null||o===void 0?void 0:o.cumulativeLayoutShift)===null||r===void 0?void 0:r.devicePixelRatio,I={_dd:{document_version:e.documentVersion,replay_stats:O,cls:A?{device_pixel_ratio:A}:void 0,configuration:{start_session_replay_recording_manually:t.startSessionReplayRecordingManually}},date:e.startClocks.timeStamp,type:it.VIEW,view:{action:{count:e.eventCounts.actionCount},frustration:{count:e.eventCounts.frustrationCount},cumulative_layout_shift:(i=e.commonViewMetrics.cumulativeLayoutShift)===null||i===void 0?void 0:i.value,cumulative_layout_shift_time:ot((l=e.commonViewMetrics.cumulativeLayoutShift)===null||l===void 0?void 0:l.time),cumulative_layout_shift_target_selector:(d=e.commonViewMetrics.cumulativeLayoutShift)===null||d===void 0?void 0:d.targetSelector,first_byte:ot((f=e.initialViewMetrics.navigationTimings)===null||f===void 0?void 0:f.firstByte),dom_complete:ot((m=e.initialViewMetrics.navigationTimings)===null||m===void 0?void 0:m.domComplete),dom_content_loaded:ot((p=e.initialViewMetrics.navigationTimings)===null||p===void 0?void 0:p.domContentLoaded),dom_interactive:ot((g=e.initialViewMetrics.navigationTimings)===null||g===void 0?void 0:g.domInteractive),error:{count:e.eventCounts.errorCount},first_contentful_paint:ot(e.initialViewMetrics.firstContentfulPaint),first_input_delay:ot((v=e.initialViewMetrics.firstInput)===null||v===void 0?void 0:v.delay),first_input_time:ot((b=e.initialViewMetrics.firstInput)===null||b===void 0?void 0:b.time),first_input_target_selector:(x=e.initialViewMetrics.firstInput)===null||x===void 0?void 0:x.targetSelector,interaction_to_next_paint:ot((S=e.commonViewMetrics.interactionToNextPaint)===null||S===void 0?void 0:S.value),interaction_to_next_paint_time:ot((C=e.commonViewMetrics.interactionToNextPaint)===null||C===void 0?void 0:C.time),interaction_to_next_paint_target_selector:(E=e.commonViewMetrics.interactionToNextPaint)===null||E===void 0?void 0:E.targetSelector,is_active:e.isActive,name:e.name,largest_contentful_paint:ot((N=e.initialViewMetrics.largestContentfulPaint)===null||N===void 0?void 0:N.value),largest_contentful_paint_target_selector:(j=e.initialViewMetrics.largestContentfulPaint)===null||j===void 0?void 0:j.targetSelector,load_event:ot((T=e.initialViewMetrics.navigationTimings)===null||T===void 0?void 0:T.loadEvent),loading_time:Z$(ot(e.commonViewMetrics.loadingTime)),loading_type:e.loadingType,long_task:{count:e.eventCounts.longTaskCount},performance:GW(e.commonViewMetrics,e.initialViewMetrics),resource:{count:e.eventCounts.resourceCount},time_spent:ot(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:ot(e.commonViewMetrics.scroll.maxScrollHeightTime)}}:void 0,privacy:{replay_level:t.defaultPrivacyLevel},device:{locale:navigator.language,locales:navigator.languages,time_zone:kZ()}};return ll(e.customTimings)||(I.view.custom_timings=$I(e.customTimings,ot)),{rawRumEvent:I,startTime:e.startClocks.relative,duration:e.duration,domainContext:{location:e.location}}}function GW({cumulativeLayoutShift:e,interactionToNextPaint:t},{firstContentfulPaint:n,firstInput:o,largestContentfulPaint:r}){return{cls:e&&{score:e.value,timestamp:ot(e.time),target_selector:e.targetSelector,previous_rect:e.previousRect,current_rect:e.currentRect},fcp:n&&{timestamp:ot(n)},fid:o&&{duration:ot(o.delay),timestamp:ot(o.time),target_selector:o.targetSelector},inp:t&&{duration:ot(t.value),timestamp:ot(t.time),target_selector:t.targetSelector},lcp:r&&{timestamp:ot(r.value),target_selector:r.targetSelector,resource_url:r.resourceUrl}}}const qW="rum";function KW(e,t,n){const o=KK(e,qW,r=>YW(e,r),n);return o.expireObservable.subscribe(()=>{t.notify(9)}),o.renewObservable.subscribe(()=>{t.notify(10)}),o.sessionStateUpdateObservable.subscribe(({previousState:r,newState:i})=>{if(!r.forcedReplay&&i.forcedReplay){const l=o.findSession();l&&(l.isReplayForced=!0)}}),{findTrackedSession:r=>{const i=o.findSession(r);if(!(!i||i.trackingType==="0"))return{id:i.id,sessionReplay:i.trackingType==="1"?1:i.isReplayForced?2:0,anonymousId:i.anonymousId}},expire:o.expire,expireObservable:o.expireObservable,setForcedReplay:()=>o.updateSessionState({forcedReplay:"1"})}}function ZW(){const e={id:"00000000-aaaa-0000-aaaa-000000000000",sessionReplay:m$("records")?1:0};return{findTrackedSession:()=>e,expire:Ot,expireObservable:new _t,setForcedReplay:Ot}}function YW(e,t){return XW(t)?t:es(e.sessionSampleRate)?es(e.sessionReplaySampleRate)?"1":"2":"0"}function XW(e){return e==="0"||e==="1"||e==="2"}function WW(e,t,n,o,r,i){const l=[e.rumEndpointBuilder];e.replica&&l.push(e.replica.rumEndpointBuilder);const d=h$({encoder:i(2),request:f$(l,e.batchBytesLimit,n),flushController:p$({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageMayExitObservable:o,sessionExpireObservable:r}),messageBytesLimit:e.messageBytesLimit});return t.subscribe(13,f=>{f.type===it.VIEW?d.upsert(f,f.view.id):d.add(f)}),d}function QW(e){const t=Af();e.subscribe(13,n=>{t.send("rum",n)})}const JW=cl;function eQ(e,t,n,o){const r=hu({expireDelay:JW});let i;e.subscribe(1,({startClocks:f})=>{const m=o.href;r.add(d({url:m,referrer:i||document.referrer}),f.relative),i=m}),e.subscribe(6,({endClocks:f})=>{r.closeActive(f.relative)});const l=n.subscribe(({newLocation:f})=>{const m=r.find();if(m){const p=ro();r.closeActive(p),r.add(d({url:f.href,referrer:m.referrer}),p)}});function d({url:f,referrer:m}){return{url:f,referrer:m}}return t.register(0,({startTime:f,eventType:m})=>{const p=r.find(f);return p?{type:m,view:{url:p.url,referrer:p.referrer}}:Ks}),{findUrl:f=>r.find(f),stop:()=>{l.unsubscribe(),r.stop()}}}function tQ(e,t){let n=nf(t);return new _t(o=>{const{stop:r}=nQ(e,l),{stop:i}=rQ(e,l);function l(){if(n.href===t.href)return;const d=nf(t);o.notify({newLocation:d,oldLocation:n}),n=d}return()=>{r(),i()}})}function nQ(e,t){const{stop:n}=yi(oO("pushState"),"pushState",({onPostCall:i})=>{i(t)}),{stop:o}=yi(oO("replaceState"),"replaceState",({onPostCall:i})=>{i(t)}),{stop:r}=Wt(e,window,"popstate",t);return{stop:()=>{n(),o(),r()}}}function rQ(e,t){return Wt(e,window,"hashchange",t)}function oO(e){return Object.prototype.hasOwnProperty.call(history,e)?history:History.prototype}const oQ=cl;function iQ(e,t,n){const o=hu({expireDelay:oQ});return e.subscribe(1,({startClocks:r})=>{o.add({},r.relative)}),e.subscribe(6,({endClocks:r})=>{o.closeActive(r.relative)}),t.register(0,({startTime:r,eventType:i})=>{if(!n.trackFeatureFlagsForEvents.concat([it.VIEW,it.ERROR]).includes(i))return oo;const d=o.find(r);return!d||ll(d)?oo:{type:i,feature_flags:d}}),{addFeatureFlagEvaluation:(r,i)=>{const l=o.find();l&&(l[r]=i)}}}const sQ=10*lr;let Rc,Ah;function aQ(e,t,n,o){t.enabled&&es(e.customerDataTelemetrySampleRate)&&(vM(),Ah=!1,n.subscribe(13,()=>{Ah=!0}),o.subscribe(({bytesCount:i,messagesCount:l})=>{Ah&&(Ah=!1,Rc.batchCount+=1,sO(Rc.batchBytesCount,i),sO(Rc.batchMessagesCount,l))}),uu(lQ,sQ))}function lQ(){Rc.batchCount!==0&&(ES("Customer data measures",Rc),vM())}function iO(){return{min:1/0,max:0,sum:0}}function sO(e,t){e.sum+=t,e.min=Math.min(e.min,t),e.max=Math.max(e.max,t)}function vM(){Rc={batchCount:0,batchBytesCount:iO(),batchMessagesCount:iO()}}const cQ=4e3,uQ=500,dQ=cl;function fQ(e,t,n=uQ){const o=hu({expireDelay:dQ,maxEntries:cQ});let r;fl(St.VISIBILITY_STATE)&&performance.getEntriesByType(St.VISIBILITY_STATE).forEach(m=>{const p=m.name==="hidden"?"hidden":"active";l(p,m.startTime)}),l(yM(),ro());const{stop:i}=qs(t,window,["pageshow","focus","blur","visibilitychange","resume","freeze","pagehide"],f=>{l(hQ(f),f.timeStamp)},{capture:!0});function l(f,m=ro()){f!==r&&(r=f,o.closeActive(m),o.add({state:r,startTime:m},m))}function d(f,m,p){return o.findAll(m,p).some(g=>g.state===f)}return e.register(0,({startTime:f,duration:m=0,eventType:p})=>{if(p===it.VIEW){const g=o.findAll(f,m);return{type:p,_dd:{page_states:mQ(g,f,n)}}}return p===it.ACTION||p===it.ERROR?{type:p,view:{in_foreground:d("active",f,0)}}:oo}),{wasInPageStateDuringPeriod:d,addPageState:l,stop:()=>{i(),o.stop()}}}function mQ(e,t,n){if(e.length!==0)return e.slice(-n).reverse().map(({state:o,startTime:r})=>({state:o,start:ot(Qt(t,r))}))}function hQ(e){return e.type==="freeze"?"frozen":e.type==="pagehide"?e.persisted?"frozen":"terminated":yM()}function yM(){return document.visibilityState==="hidden"?"hidden":document.hasFocus()?"active":"passive"}function pQ(e,t){let n;const o=requestAnimationFrame(tt(()=>{n=PS()})),r=RW(t).subscribe(i=>{n=i}).unsubscribe;return e.register(0,({eventType:i})=>({type:i,display:n?{viewport:n}:void 0})),{stop:()=>{r(),o&&cancelAnimationFrame(o)}}}function gQ(e,t){const n=window.cookieStore?vQ(e):bQ;return new _t(o=>n(t,r=>o.notify(r)))}function vQ(e){return(t,n)=>Wt(e,window.cookieStore,"change",r=>{const i=r.changed.find(l=>l.name===t)||r.deleted.find(l=>l.name===t);i&&n(i.value)}).stop}const yQ=lr;function bQ(e,t){const n=rf(document.cookie,e),o=uu(()=>{const r=rf(document.cookie,e);r!==n&&t(r)},yQ);return()=>{Mg(o)}}const aO="datadog-ci-visibility-test-execution-id";function xQ(e,t,n=gQ(e,aO)){var o;let r=Ds(aO)||((o=window.Cypress)===null||o===void 0?void 0:o.env("traceId"));const i=n.subscribe(l=>{r=l});return t.register(0,({eventType:l})=>typeof r!="string"?oo:{type:l,session:{type:"ci_test"},ci_test:{test_execution_id:r}}),{stop:()=>{i.unsubscribe()}}}function _Q(e,t){const n=_i(t,{type:St.LONG_ANIMATION_FRAME,buffered:!0}).subscribe(o=>{for(const r of o){const i=$g(r.startTime),l={date:i.timeStamp,long_task:{id:cr(),entry_type:A$.LONG_ANIMATION_FRAME,duration:ot(r.duration),blocking_duration:ot(r.blockingDuration),first_ui_event_timestamp:ot(r.firstUIEventTimestamp),render_start:ot(r.renderStart),style_and_layout_start:ot(r.styleAndLayoutStart),start_time:ot(r.startTime),scripts:r.scripts.map(d=>({duration:ot(d.duration),pause_duration:ot(d.pauseDuration),forced_style_and_layout_duration:ot(d.forcedStyleAndLayoutDuration),start_time:ot(d.startTime),execution_start:ot(d.executionStart),source_url:d.sourceURL,source_function_name:d.sourceFunctionName,source_char_position:d.sourceCharPosition,invoker:d.invoker,invoker_type:d.invokerType,window_attribution:d.windowAttribution}))},type:it.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:l,startTime:i.relative,duration:r.duration,domainContext:{performanceEntry:r}})}});return{stop:()=>n.unsubscribe()}}function wQ(e,t){const n=_i(t,{type:St.LONG_TASK,buffered:!0}).subscribe(o=>{for(const r of o){if(r.entryType!==St.LONG_TASK||!t.trackLongTasks)break;const i=$g(r.startTime),l={date:i.timeStamp,long_task:{id:cr(),entry_type:A$.LONG_TASK,duration:ot(r.duration)},type:it.LONG_TASK,_dd:{discarded:!1}};e.notify(12,{rawRumEvent:l,startTime:i.relative,duration:r.duration,domainContext:{performanceEntry:r}})}});return{stop(){n.unsubscribe()}}}function SQ(e){e.register(0,({eventType:t})=>{if(!j$())return oo;const n=E$(),o=R$();return{type:t,session:{type:"synthetics"},synthetics:{test_id:n,result_id:o,injected:C$()}}})}function CQ(e,t,n){const o=SS(e),r=n(o);return bS(t).forEach(([i,l])=>sw(e,o,i.split(/\.|(?=\[\])/),l)),r}function sw(e,t,n,o){const[r,...i]=n;if(r==="[]"){Array.isArray(e)&&Array.isArray(t)&&e.forEach((l,d)=>sw(l,t[d],i,o));return}if(!(!lO(e)||!lO(t))){if(i.length>0)return sw(e[r],t[r],i,o);EQ(e,r,t[r],o)}}function EQ(e,t,n,o){const r=dl(n);r===o?e[t]=cn(n):o==="object"&&(r==="undefined"||r==="null")&&(e[t]={})}function lO(e){return dl(e)==="object"}const lc={"view.name":"string","view.url":"string","view.referrer":"string"},cc={context:"object"},uc={service:"string",version:"string"};let bM;function RQ(e,t,n,o){bM={[it.VIEW]:{"view.performance.lcp.resource_url":"string",...cc,...lc,...uc},[it.ERROR]:{"error.message":"string","error.stack":"string","error.resource.url":"string","error.fingerprint":"string",...cc,...lc,...uc},[it.RESOURCE]:{"resource.url":"string",...Ug(Wa.WRITABLE_RESOURCE_GRAPHQL)?{"resource.graphql":"object"}:{},...cc,...lc,...uc},[it.ACTION]:{"action.target.name":"string",...cc,...lc,...uc},[it.LONG_TASK]:{"long_task.scripts[].source_url":"string","long_task.scripts[].invoker":"string",...cc,...lc,...uc},[it.VITAL]:{...cc,...lc,...uc}};const r={[it.ERROR]:Tx(it.ERROR,e.eventRateLimiterThreshold,o),[it.ACTION]:Tx(it.ACTION,e.eventRateLimiterThreshold,o),[it.VITAL]:Tx(it.VITAL,e.eventRateLimiterThreshold,o)};t.subscribe(12,({startTime:i,duration:l,rawRumEvent:d,domainContext:f})=>{const m=n.triggerHook(0,{eventType:d.type,startTime:i,duration:l});if(m===Ks)return;const p=ns(m,d,{ddtags:RK(e).join(",")});jQ(p,e.beforeSend,f,r)&&(ll(p.context)&&delete p.context,t.notify(13,p))})}function jQ(e,t,n,o){var r;if(t){const l=CQ(e,bM[e.type],d=>t(d,n));if(l===!1&&e.type!==it.VIEW)return!1;l===!1&&pt.warn("Can't dismiss view events using beforeSend!")}return!((r=o[e.type])===null||r===void 0?void 0:r.isLimitReached())}function NQ(e,t,n,o){e.register(0,({eventType:r,startTime:i})=>{const l=t.findTrackedSession(i),d=o.findView(i);if(!l||!d)return Ks;let f,m,p;return r===it.VIEW?(f=n.getReplayStats(d.id)?!0:void 0,m=l.sessionReplay===1,p=d.sessionIsActive?void 0:!1):f=n.isRecording()?!0:void 0,{type:r,session:{id:l.id,type:"user",has_replay:f,sampled_for_replay:m,is_active:p}}}),e.register(1,({startTime:r})=>{const i=t.findTrackedSession(r);return i?{session:{id:i.id}}:oo})}function TQ(e){e.register(0,({eventType:t})=>({type:t,connectivity:o$()}))}function OQ(e,t,n){e.register(0,({eventType:o})=>{const r=t.source;return{type:o,_dd:{format_version:2,drift:_q(),configuration:{session_sample_rate:Hd(t.sessionSampleRate,3),session_replay_sample_rate:Hd(t.sessionReplaySampleRate,3),profiling_sample_rate:Hd(t.profilingSampleRate,3)},browser_sdk_version:Bc()?"6.19.0":void 0,sdk_name:n},application:{id:t.applicationId},date:Bn(),source:r}}),e.register(1,()=>({application:{id:t.applicationId}}))}function kQ(e,t){e.register(1,()=>t.isGranted()?oo:Ks)}const AQ=B7,IQ=[it.ACTION,it.ERROR,it.LONG_TASK,it.RESOURCE,it.VITAL];function $Q(e){return{addEvent:(t,n,o,r)=>{IQ.includes(n.type)&&e.notify(12,{startTime:t,rawRumEvent:n,domainContext:o,duration:r})}}}const MQ="Initial view metrics";function PQ(e,t,n){if(!(n.enabled&&es(e.initialViewMetricsTelemetrySampleRate)))return{stop:Ot};const{unsubscribe:r}=t.subscribe(4,({initialViewMetrics:i})=>{!i.largestContentfulPaint||!i.navigationTimings||(ES(MQ,{metrics:DQ(i.largestContentfulPaint,i.navigationTimings)}),r())});return{stop:r}}function DQ(e,t){return{lcp:{value:e.value},navigation:{domComplete:t.domComplete,domContentLoaded:t.domContentLoaded,domInteractive:t.domInteractive,firstByte:t.firstByte,loadEvent:t.loadEvent}}}function zQ(e,t,n,o,r,i,l,d,f){const m=[],p=new mY,g=AQ();p.subscribe(13,me=>r$("rum",me));const v=me=>{p.notify(14,{error:me}),na("Error reported to customer",{"error.message":me.message})},b=F7(e),x=b.subscribe(me=>{p.notify(11,me)});m.push(()=>x.unsubscribe());const S=q7("browser-rum-sdk",e,g,v,b,r);m.push(S.stop);const C=Bc()?ZW():KW(e,p,i);if(Bc())QW(p);else{const me=WW(e,p,v,b,C.expireObservable,r);m.push(()=>me.stop()),aQ(e,S,p,me.flushController.flushObservable)}const E=cY(),N=tQ(e,location),{observable:j,stop:T}=dY();m.push(T),OQ(g,e,f);const O=fQ(g,e),A=pY(p);m.push(()=>A.stop());const I=eQ(p,g,N,location);m.push(()=>I.stop());const P=iQ(p,g,e);NQ(g,C,t,A),TQ(g),kQ(g,i);const U=RZ(g,e,"rum"),V=jZ(g,e,C,"rum"),oe=EZ(g,e,"rum"),{actionContexts:ae,addAction:de,addEvent:ce,stop:le}=UQ(p,g,e,O,E,j,v);m.push(le);const{addTiming:M,startView:Z,setViewName:F,setViewContext:se,setViewContextProperty:$,getViewContext:q,stop:te}=BW(p,g,e,location,E,j,N,t,A,o);m.push(te);const{stop:B}=PQ(e,p,S);m.push(B);const{stop:J}=HX(p,e,O);if(m.push(J),e.trackLongTasks)if(fl(St.LONG_ANIMATION_FRAME)){const{stop:me}=_Q(p,e);m.push(me)}else wQ(p,e);const{addError:be}=OX(p,e,d);d.unbuffer(),jY(p,e,C,V,oe);const ge=IZ(p,O,l),ie=fY(e.applicationId,C,A,ae,I);return m.push(()=>n.stop()),{addAction:de,addEvent:ce,addError:be,addTiming:M,addFeatureFlagEvaluation:P.addFeatureFlagEvaluation,startView:Z,setViewContext:se,setViewContextProperty:$,getViewContext:q,setViewName:F,lifeCycle:p,viewHistory:A,session:C,stopSession:()=>C.expire(),getInternalContext:ie.get,startDurationVital:ge.startDurationVital,stopDurationVital:ge.stopDurationVital,addDurationVital:ge.addDurationVital,globalContext:U,userContext:V,accountContext:oe,telemetry:S,stop:()=>{m.forEach(me=>me())},hooks:g}}function UQ(e,t,n,o,r,i,l){const d=jX(e,t,r,i,n),f=$Q(e),m=pQ(t,n),p=xQ(n,t);return SQ(t),RQ(n,e,t,l),{pageStateHistory:o,addAction:d.addAction,addEvent:f.addEvent,actionContexts:d.actionContexts,stop:()=>{d.stop(),p.stop(),m.stop(),o.stop()}}}function LQ(e,{session:t,viewContext:n,errorType:o}){const r=t?t.id:"no-session-id",i=[];o!==void 0&&i.push(`error-type=${o}`),n&&(i.push(`seed=${n.id}`),i.push(`from=${n.startClocks.timeStamp}`));const l=FQ(e),d=`/rum/replay/sessions/${r}`;return`${l}${d}?${i.join("&")}`}function FQ(e){const t=e.site,n=e.subdomain||VQ(e);return`https://${n?`${n}.`:""}${t}`}function VQ(e){switch(e.site){case Ia:case S7:return"app";case n$:return"dd";default:return}}const BQ=1e3;let So;function Jye(e){return Hg(e).segments_count}function ebe(e){Hg(e).segments_count+=1}function tbe(e){Hg(e).records_count+=1}function nbe(e,t){Hg(e).segments_total_raw_size+=t}function HQ(e){return So?.get(e)}function Hg(e){So||(So=new Map);let t;return So.has(e)?t=So.get(e):(t={records_count:0,segments_count:0,segments_total_raw_size:0},So.set(e,t),So.size>BQ&&GQ()),t}function GQ(){if(!So)return;const e=So.keys().next().value;e&&So.delete(e)}function xM(e,t,n){let o=0,r=[],i,l=!0,d=0;const f=[],{stop:m}=Wt(e,t,"message",({data:v})=>{if(v.type!=="wrote"||v.streamId!==n)return;const b=f[0];b&&(b.id===v.id?(f.shift(),o+=v.additionalBytesCount,r.push(v.result),i=v.trailer,b.writeCallback?b.writeCallback(v.result.byteLength):b.finishCallback&&b.finishCallback()):b.id<v.id&&(m(),na("Worker responses received out of order.")))});function p(){const v=r.length===0?new Uint8Array(0):Eq(r.concat(i)),b={rawBytesCount:o,output:v,outputBytesCount:v.byteLength,encoding:"deflate"};return o=0,r=[],b}function g(){l||(t.postMessage({action:"reset",streamId:n}),l=!0)}return{isAsync:!0,get isEmpty(){return l},write(v,b){t.postMessage({action:"write",id:d,data:v,streamId:n}),f.push({id:d,writeCallback:b,data:v}),l=!1,d+=1},finish(v){g(),f.length?(f.forEach(b=>{delete b.writeCallback}),f[f.length-1].finishCallback=()=>v(p())):v(p())},finishSync(){g();const v=f.map(b=>b.data).join("");return f.length=0,{...p(),pendingData:v}},estimateEncodedBytesCount(v){return v.length/8},stop(){m()}}}function DS({configuredUrl:e,error:t,source:n,scriptType:o}){if(pt.error(`${n} failed to start: an error occurred while initializing the ${o}:`,t),t instanceof Event||t instanceof Error&&qQ(t.message)){let r;e?r=`Please make sure the ${o} URL ${e} is correct and CSP is correctly configured.`:r="Please make sure CSP is correctly configured.",pt.error(`${r} See documentation at ${Ig}/integrations/content_security_policy_logs/#use-csp-with-real-user-monitoring-and-session-replay`)}else o==="worker"&&CS(t)}function qQ(e){return e.includes("Content Security Policy")||e.includes("requires 'TrustedScriptURL'")}const KQ=30*lr;function _M(e){return new Worker(e.workerUrl||URL.createObjectURL(new Blob(['(()=>{function t(t){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;)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)}(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);i.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.19.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)}}()})();'])))}let un={status:0};function wM(e,t,n,o=_M){switch(un.status===0&&ZQ(e,t,o),un.status){case 1:return un.initializationFailureCallbacks.push(n),un.worker;case 3:return un.worker}}function cO(){return un.status}function ZQ(e,t,n=_M){try{const o=n(e),{stop:r}=Wt(e,o,"error",d=>{Fx(e,t,d)}),{stop:i}=Wt(e,o,"message",({data:d})=>{d.type==="errored"?Fx(e,t,d.error,d.streamId):d.type==="initialized"&&XQ(d.version)});o.postMessage({action:"init"}),sr(()=>YQ(t),KQ),un={status:1,worker:o,stop:()=>{r(),i()},initializationFailureCallbacks:[]}}catch(o){Fx(e,t,o)}}function YQ(e){un.status===1&&(pt.error(`${e} failed to start: a timeout occurred while initializing the Worker`),un.initializationFailureCallbacks.forEach(t=>t()),un={status:2})}function XQ(e){un.status===1&&(un={status:3,worker:un.worker,stop:un.stop,version:e})}function Fx(e,t,n,o){un.status===1||un.status===0?(DS({configuredUrl:e.workerUrl,error:n,source:t,scriptType:"worker"}),un.status===1&&un.initializationFailureCallbacks.forEach(r=>r()),un={status:2}):CS(n,{worker_version:un.status===3&&un.version,stream_id:o})}function SM(){return typeof Array.from=="function"&&typeof CSSSupportsRule=="function"&&typeof URL.createObjectURL=="function"&&"forEach"in NodeList.prototype}function WQ(e,t,n,o){const r=t.findTrackedSession(),i=QQ(r,o),l=n.findView();return LQ(e,{viewContext:l,errorType:i,session:r})}function QQ(e,t){if(!SM())return"browser-not-supported";if(!e)return"rum-not-tracked";if(e.sessionReplay===0)return"incorrect-session-plan";if(!t)return"replay-not-started"}const JQ="Recorder init metrics";function eJ(e,t,n){if(!(t.enabled&&es(e.replayTelemetrySampleRate)))return{stop:Ot};let r,i,l;const{unsubscribe:d}=n.subscribe(f=>{switch(f.type){case"start":r={forced:f.forced,timestamp:Bn()},i=void 0,l=void 0;break;case"document-ready":r&&(i=Qt(r.timestamp,Bn()));break;case"recorder-settled":r&&(l=Qt(r.timestamp,Bn()));break;case"aborted":case"deflate-encoder-load-failed":case"recorder-load-failed":case"succeeded":d(),r&&ES(JQ,{metrics:tJ(r.forced,l,Qt(r.timestamp,Bn()),f.type,i)});break}});return{stop:d}}function tJ(e,t,n,o,r){return{forced:e,loadRecorderModuleDuration:t,recorderInitDuration:n,result:o,waitForDocReadyDuration:r}}function nJ(e,t,n,o,r,i,l){let d=0,f;t.subscribe(9,()=>{(d===2||d===3)&&(v(),d=1)}),t.subscribe(10,()=>{d===1&&g()});const m=new _t;eJ(e,l,m);const p=async b=>{m.notify({type:"start",forced:b});const[x]=await Promise.all([uO(m,{type:"recorder-settled"},r()),uO(m,{type:"document-ready"},eZ(e,"interactive"))]);if(d!==2){m.notify({type:"aborted"});return}if(!x){d=0,m.notify({type:"recorder-load-failed"});return}const S=i();if(!S){d=0,m.notify({type:"deflate-encoder-load-failed"});return}({stop:f}=x(t,e,n,o,S,l)),d=3,m.notify({type:"succeeded"})};function g(b){const x=n.findTrackedSession();if(rJ(x,b)){d=1;return}if(oJ(d))return;d=2;const S=iJ(x,b)||!1;p(S).catch(Lc),S&&n.setForcedReplay()}function v(){d===3&&f?.(),d=0}return{start:g,stop:v,getSessionReplayLink(){return WQ(e,n,o,d!==0)},isRecording:()=>d===3}}function rJ(e,t){return!e||e.sessionReplay===0&&(!t||!t.force)}function oJ(e){return e===2||e===3}function iJ(e,t){return t&&t.force&&e.sessionReplay===0}async function uO(e,t,n){try{return await n}finally{e.notify(t)}}function sJ(){let e=0;return{strategy:{start(){e=1},stop(){e=2},isRecording:()=>!1,getSessionReplayLink:Ot},shouldStartImmediately(t){return e===1||e===0&&!t.startSessionReplayRecordingManually}}}function aJ(e,t){if(Bc()&&!m$("records")||!SM())return{start:Ot,stop:Ot,getReplayStats:()=>{},onRumStart:Ot,isRecording:()=>!1,getSessionReplayLink:()=>{}};let{strategy:n,shouldStartImmediately:o}=sJ();return{start:i=>n.start(i),stop:()=>n.stop(),getSessionReplayLink:()=>n.getSessionReplayLink(),onRumStart:r,isRecording:()=>cO()===3&&n.isRecording(),getReplayStats:i=>cO()===3?HQ(i):void 0};function r(i,l,d,f,m,p){let g;function v(){return g||(m??(m=wM(l,"Datadog Session Replay",()=>{n.stop()},t)),m&&(g=xM(l,m,1))),g}n=nJ(l,i,d,f,e,v,p),o(l)&&n.start()}}const lJ="modulepreload",cJ=function(e){return"/"+e},dO={},zS=function(t,n,o){let r=Promise.resolve();if(n&&n.length>0){let f=function(m){return Promise.all(m.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),d=l?.nonce||l?.getAttribute("nonce");r=f(n.map(m=>{if(m=cJ(m),m in dO)return;dO[m]=!0;const p=m.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${g}`))return;const v=document.createElement("link");if(v.rel=p?"stylesheet":lJ,p||(v.as="script"),v.crossOrigin="",v.href=m,d&&v.setAttribute("nonce",d),document.head.appendChild(v),p)return new Promise((b,x)=>{v.addEventListener("load",b),v.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${m}`)))})}))}function i(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return r.then(l=>{for(const d of l||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};async function uJ(e=dJ){try{return await e()}catch(t){DS({error:t,source:"Recorder",scriptType:"module"})}}async function dJ(){return(await zS(()=>import("./startRecording-CUmQoMAV.js"),[])).startRecording}function fJ(){return Xo().Profiler!==void 0}const mJ=e=>{let t={status:"starting"};return e.register(0,({eventType:n})=>n!==it.VIEW&&n!==it.LONG_TASK?oo:{type:n,_dd:{profiling:t}}),{get:()=>t,set:n=>{t=n}}};async function hJ(e=pJ){try{return await e()}catch(t){DS({error:t,source:"Profiler",scriptType:"module"})}}async function pJ(){return(await zS(()=>import("./profiler-5Asl8DN7.js"),[])).createRumProfiler}function gJ(){let e;function t(n,o,r,i,l){const d=i.findTrackedSession();if(!d||!D$(d.id,r.profilingSampleRate))return;const f=mJ(o);if(!fJ()){f.set({status:"error",error_reason:"not-supported-by-browser"});return}hJ().then(m=>{if(!m){na("[DD_RUM] Failed to lazy load the RUM Profiler"),f.set({status:"error",error_reason:"failed-to-lazy-load"});return}e=m(r,n,i,f),e.start(l.findView())}).catch(Lc)}return{onRumStart:t,stop:()=>{e?.stop().catch(Lc)}}}const vJ=aJ(uJ),yJ=gJ(),bJ=aY(zQ,vJ,yJ,{startDeflateWorker:wM,createDeflateEncoder:xM,sdkName:"rum"});$K(Xo(),"DD_RUM",bJ);function dp(e,t){sf("react error"),Gn()}const fO={didCatch:!1,error:null};class rbe extends G.Component{constructor(t){super(t),this.resetError=()=>{this.setState(fO)},this.state=fO}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}componentDidCatch(t,n){dp()}render(){return this.state.didCatch?G.createElement(this.props.fallback,{error:this.state.error,resetError:this.resetError}):this.props.children}}let mO=!1;function xJ(){_.useEffect(()=>{mO||(mO=!0)},[])}function _J(){return c.jsx(c.Fragment,{children:c.jsx(ss,{})})}const Gg=m9()({component:_J});function wJ(e,t){const n=_.createContext(t),o=i=>{const{children:l,...d}=i,f=_.useMemo(()=>d,Object.values(d));return c.jsx(n.Provider,{value:f,children:l})};o.displayName=e+"Provider";function r(i){const l=_.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[o,r]}function Wo(e,t=[]){let n=[];function o(i,l){const d=_.createContext(l),f=n.length;n=[...n,l];const m=g=>{const{scope:v,children:b,...x}=g,S=v?.[e]?.[f]||d,C=_.useMemo(()=>x,Object.values(x));return c.jsx(S.Provider,{value:C,children:b})};m.displayName=i+"Provider";function p(g,v){const b=v?.[e]?.[f]||d,x=_.useContext(b);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${i}\``)}return[m,p]}const r=()=>{const i=n.map(l=>_.createContext(l));return function(d){const f=d?.[e]||i;return _.useMemo(()=>({[`__scope${e}`]:{...d,[e]:f}}),[d,f])}};return r.scopeName=e,[o,SJ(r,...t)]}function SJ(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const l=o.reduce((d,{useScope:f,scopeName:m})=>{const g=f(i)[`__scope${m}`];return{...d,...g}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function we(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var CJ=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Pe=CJ.reduce((e,t)=>{const n=Ba(`Primitive.${t}`),o=_.forwardRef((r,i)=>{const{asChild:l,...d}=r,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(f,{...d,ref:i})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function Mp(e,t){e&&au.flushSync(()=>e.dispatchEvent(t))}var Sn=globalThis?.document?_.useLayoutEffect:()=>{},EJ=cA[" useInsertionEffect ".trim().toString()]||Sn;function wi({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,i,l]=RJ({defaultProp:t,onChange:n}),d=e!==void 0,f=d?e:r;{const p=_.useRef(e!==void 0);_.useEffect(()=>{const g=p.current;g!==d&&console.warn(`${o} is changing from ${g?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=d},[d,o])}const m=_.useCallback(p=>{if(d){const g=jJ(p)?p(e):p;g!==e&&l.current?.(g)}else i(p)},[d,e,i,l]);return[f,m]}function RJ({defaultProp:e,onChange:t}){const[n,o]=_.useState(e),r=_.useRef(n),i=_.useRef(t);return EJ(()=>{i.current=t},[t]),_.useEffect(()=>{r.current!==n&&(i.current?.(n),r.current=n)},[n,r]),[n,o,i]}function jJ(e){return typeof e=="function"}var NJ=_.createContext(void 0);function pu(e){const t=_.useContext(NJ);return e||t||"ltr"}function TJ(e,t){return _.useReducer((n,o)=>t[n][o]??n,e)}var Pn=e=>{const{present:t,children:n}=e,o=OJ(t),r=typeof n=="function"?n({present:o.isPresent}):_.Children.only(n),i=st(o.ref,kJ(r));return typeof n=="function"||o.isPresent?_.cloneElement(r,{ref:i}):null};Pn.displayName="Presence";function OJ(e){const[t,n]=_.useState(),o=_.useRef(null),r=_.useRef(e),i=_.useRef("none"),l=e?"mounted":"unmounted",[d,f]=TJ(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const m=Ih(o.current);i.current=d==="mounted"?m:"none"},[d]),Sn(()=>{const m=o.current,p=r.current;if(p!==e){const v=i.current,b=Ih(m);e?f("MOUNT"):b==="none"||m?.display==="none"?f("UNMOUNT"):f(p&&v!==b?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,f]),Sn(()=>{if(t){let m;const p=t.ownerDocument.defaultView??window,g=b=>{const S=Ih(o.current).includes(CSS.escape(b.animationName));if(b.target===t&&S&&(f("ANIMATION_END"),!r.current)){const C=t.style.animationFillMode;t.style.animationFillMode="forwards",m=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=C)})}},v=b=>{b.target===t&&(i.current=Ih(o.current))};return t.addEventListener("animationstart",v),t.addEventListener("animationcancel",g),t.addEventListener("animationend",g),()=>{p.clearTimeout(m),t.removeEventListener("animationstart",v),t.removeEventListener("animationcancel",g),t.removeEventListener("animationend",g)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:_.useCallback(m=>{o.current=m?getComputedStyle(m):null,n(m)},[])}}function Ih(e){return e?.animationName||"none"}function kJ(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var AJ=cA[" useId ".trim().toString()]||(()=>{}),IJ=0;function Xr(e){const[t,n]=_.useState(AJ());return Sn(()=>{n(o=>o??String(IJ++))},[e]),t?`radix-${t}`:""}function $f(e){const t=e+"CollectionProvider",[n,o]=Wo(t),[r,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=S=>{const{scope:C,children:E}=S,N=G.useRef(null),j=G.useRef(new Map).current;return c.jsx(r,{scope:C,itemMap:j,collectionRef:N,children:E})};l.displayName=t;const d=e+"CollectionSlot",f=Ba(d),m=G.forwardRef((S,C)=>{const{scope:E,children:N}=S,j=i(d,E),T=st(C,j.collectionRef);return c.jsx(f,{ref:T,children:N})});m.displayName=d;const p=e+"CollectionItemSlot",g="data-radix-collection-item",v=Ba(p),b=G.forwardRef((S,C)=>{const{scope:E,children:N,...j}=S,T=G.useRef(null),O=st(C,T),A=i(p,E);return G.useEffect(()=>(A.itemMap.set(T,{ref:T,...j}),()=>void A.itemMap.delete(T))),c.jsx(v,{[g]:"",ref:O,children:N})});b.displayName=p;function x(S){const C=i(e+"CollectionConsumer",S);return G.useCallback(()=>{const N=C.collectionRef.current;if(!N)return[];const j=Array.from(N.querySelectorAll(`[${g}]`));return Array.from(C.itemMap.values()).sort((A,I)=>j.indexOf(A.ref.current)-j.indexOf(I.ref.current))},[C.collectionRef,C.itemMap])}return[{Provider:l,Slot:m,ItemSlot:b},x,o]}function Kt(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...n)=>t.current?.(...n),[])}function $J(e,t=globalThis?.document){const n=Kt(e);_.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var MJ="DismissableLayer",aw="dismissableLayer.update",PJ="dismissableLayer.pointerDownOutside",DJ="dismissableLayer.focusOutside",hO,CM=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),gu=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:l,onDismiss:d,...f}=e,m=_.useContext(CM),[p,g]=_.useState(null),v=p?.ownerDocument??globalThis?.document,[,b]=_.useState({}),x=st(t,I=>g(I)),S=Array.from(m.layers),[C]=[...m.layersWithOutsidePointerEventsDisabled].slice(-1),E=S.indexOf(C),N=p?S.indexOf(p):-1,j=m.layersWithOutsidePointerEventsDisabled.size>0,T=N>=E,O=LJ(I=>{const P=I.target,U=[...m.branches].some(V=>V.contains(P));!T||U||(r?.(I),l?.(I),I.defaultPrevented||d?.())},v),A=FJ(I=>{const P=I.target;[...m.branches].some(V=>V.contains(P))||(i?.(I),l?.(I),I.defaultPrevented||d?.())},v);return $J(I=>{N===m.layers.size-1&&(o?.(I),!I.defaultPrevented&&d&&(I.preventDefault(),d()))},v),_.useEffect(()=>{if(p)return n&&(m.layersWithOutsidePointerEventsDisabled.size===0&&(hO=v.body.style.pointerEvents,v.body.style.pointerEvents="none"),m.layersWithOutsidePointerEventsDisabled.add(p)),m.layers.add(p),pO(),()=>{n&&m.layersWithOutsidePointerEventsDisabled.size===1&&(v.body.style.pointerEvents=hO)}},[p,v,n,m]),_.useEffect(()=>()=>{p&&(m.layers.delete(p),m.layersWithOutsidePointerEventsDisabled.delete(p),pO())},[p,m]),_.useEffect(()=>{const I=()=>b({});return document.addEventListener(aw,I),()=>document.removeEventListener(aw,I)},[]),c.jsx(Pe.div,{...f,ref:x,style:{pointerEvents:j?T?"auto":"none":void 0,...e.style},onFocusCapture:we(e.onFocusCapture,A.onFocusCapture),onBlurCapture:we(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:we(e.onPointerDownCapture,O.onPointerDownCapture)})});gu.displayName=MJ;var zJ="DismissableLayerBranch",UJ=_.forwardRef((e,t)=>{const n=_.useContext(CM),o=_.useRef(null),r=st(t,o);return _.useEffect(()=>{const i=o.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),c.jsx(Pe.div,{...e,ref:r})});UJ.displayName=zJ;function LJ(e,t=globalThis?.document){const n=Kt(e),o=_.useRef(!1),r=_.useRef(()=>{});return _.useEffect(()=>{const i=d=>{if(d.target&&!o.current){let f=function(){EM(PJ,n,m,{discrete:!0})};const m={originalEvent:d};d.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=f,t.addEventListener("click",r.current,{once:!0})):f()}else t.removeEventListener("click",r.current);o.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",i),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function FJ(e,t=globalThis?.document){const n=Kt(e),o=_.useRef(!1);return _.useEffect(()=>{const r=i=>{i.target&&!o.current&&EM(DJ,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function pO(){const e=new CustomEvent(aw);document.dispatchEvent(e)}function EM(e,t,n,{discrete:o}){const r=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?Mp(r,i):r.dispatchEvent(i)}function RM(e){const t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var jM=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),VJ="VisuallyHidden",NM=_.forwardRef((e,t)=>c.jsx(Pe.span,{...e,ref:t,style:{...jM,...e.style}}));NM.displayName=VJ;var TM=NM,ml="NavigationMenu",[US,OM,BJ]=$f(ml),[lw,HJ,GJ]=$f(ml),[LS,obe]=Wo(ml,[BJ,GJ]),[qJ,ko]=LS(ml),[KJ,ZJ]=LS(ml),kM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:i,delayDuration:l=200,skipDelayDuration:d=300,orientation:f="horizontal",dir:m,...p}=e,[g,v]=_.useState(null),b=st(t,U=>v(U)),x=pu(m),S=_.useRef(0),C=_.useRef(0),E=_.useRef(0),[N,j]=_.useState(!0),[T,O]=wi({prop:o,onChange:U=>{const V=U!=="",oe=d>0;V?(window.clearTimeout(E.current),oe&&j(!1)):(window.clearTimeout(E.current),E.current=window.setTimeout(()=>j(!0),d)),r?.(U)},defaultProp:i??"",caller:ml}),A=_.useCallback(()=>{window.clearTimeout(C.current),C.current=window.setTimeout(()=>O(""),150)},[O]),I=_.useCallback(U=>{window.clearTimeout(C.current),O(U)},[O]),P=_.useCallback(U=>{T===U?window.clearTimeout(C.current):S.current=window.setTimeout(()=>{window.clearTimeout(C.current),O(U)},l)},[T,O,l]);return _.useEffect(()=>()=>{window.clearTimeout(S.current),window.clearTimeout(C.current),window.clearTimeout(E.current)},[]),c.jsx(AM,{scope:n,isRootMenu:!0,value:T,dir:x,orientation:f,rootNavigationMenu:g,onTriggerEnter:U=>{window.clearTimeout(S.current),N?P(U):I(U)},onTriggerLeave:()=>{window.clearTimeout(S.current),A()},onContentEnter:()=>window.clearTimeout(C.current),onContentLeave:A,onItemSelect:U=>{O(V=>V===U?"":U)},onItemDismiss:()=>O(""),children:c.jsx(Pe.nav,{"aria-label":"Main","data-orientation":f,dir:x,...p,ref:b})})});kM.displayName=ml;var cw="NavigationMenuSub",YJ=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,onValueChange:r,defaultValue:i,orientation:l="horizontal",...d}=e,f=ko(cw,n),[m,p]=wi({prop:o,onChange:r,defaultProp:i??"",caller:cw});return c.jsx(AM,{scope:n,isRootMenu:!1,value:m,dir:f.dir,orientation:l,rootNavigationMenu:f.rootNavigationMenu,onTriggerEnter:g=>p(g),onItemSelect:g=>p(g),onItemDismiss:()=>p(""),children:c.jsx(Pe.div,{"data-orientation":l,...d,ref:t})})});YJ.displayName=cw;var AM=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:o,dir:r,orientation:i,children:l,value:d,onItemSelect:f,onItemDismiss:m,onTriggerEnter:p,onTriggerLeave:g,onContentEnter:v,onContentLeave:b}=e,[x,S]=_.useState(null),[C,E]=_.useState(new Map),[N,j]=_.useState(null);return c.jsx(qJ,{scope:t,isRootMenu:n,rootNavigationMenu:o,value:d,previousValue:RM(d),baseId:Xr(),dir:r,orientation:i,viewport:x,onViewportChange:S,indicatorTrack:N,onIndicatorTrackChange:j,onTriggerEnter:Kt(p),onTriggerLeave:Kt(g),onContentEnter:Kt(v),onContentLeave:Kt(b),onItemSelect:Kt(f),onItemDismiss:Kt(m),onViewportContentChange:_.useCallback((T,O)=>{E(A=>(A.set(T,O),new Map(A)))},[]),onViewportContentRemove:_.useCallback(T=>{E(O=>O.has(T)?(O.delete(T),new Map(O)):O)},[]),children:c.jsx(US.Provider,{scope:t,children:c.jsx(KJ,{scope:t,items:C,children:l})})})},IM="NavigationMenuList",$M=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=ko(IM,n),i=c.jsx(Pe.ul,{"data-orientation":r.orientation,...o,ref:t});return c.jsx(Pe.div,{style:{position:"relative"},ref:r.onIndicatorTrackChange,children:c.jsx(US.Slot,{scope:n,children:r.isRootMenu?c.jsx(FM,{asChild:!0,children:i}):i})})});$M.displayName=IM;var MM="NavigationMenuItem",[XJ,PM]=LS(MM),DM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,...r}=e,i=Xr(),l=o||i||"LEGACY_REACT_AUTO_VALUE",d=_.useRef(null),f=_.useRef(null),m=_.useRef(null),p=_.useRef(()=>{}),g=_.useRef(!1),v=_.useCallback((x="start")=>{if(d.current){p.current();const S=dw(d.current);S.length&&BS(x==="start"?S:S.reverse())}},[]),b=_.useCallback(()=>{if(d.current){const x=dw(d.current);x.length&&(p.current=see(x))}},[]);return c.jsx(XJ,{scope:n,value:l,triggerRef:f,contentRef:d,focusProxyRef:m,wasEscapeCloseRef:g,onEntryKeyDown:v,onFocusProxyEnter:v,onRootContentClose:b,onContentFocusOutside:b,children:c.jsx(Pe.li,{...r,ref:t})})});DM.displayName=MM;var uw="NavigationMenuTrigger",WJ=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:o,...r}=e,i=ko(uw,e.__scopeNavigationMenu),l=PM(uw,e.__scopeNavigationMenu),d=_.useRef(null),f=st(d,l.triggerRef,t),m=BM(i.baseId,l.value),p=HM(i.baseId,l.value),g=_.useRef(!1),v=_.useRef(!1),b=l.value===i.value;return c.jsxs(c.Fragment,{children:[c.jsx(US.ItemSlot,{scope:n,value:l.value,children:c.jsx(VM,{asChild:!0,children:c.jsx(Pe.button,{id:m,disabled:o,"data-disabled":o?"":void 0,"data-state":HS(b),"aria-expanded":b,"aria-controls":p,...r,ref:f,onPointerEnter:we(e.onPointerEnter,()=>{v.current=!1,l.wasEscapeCloseRef.current=!1}),onPointerMove:we(e.onPointerMove,Pp(()=>{o||v.current||l.wasEscapeCloseRef.current||g.current||(i.onTriggerEnter(l.value),g.current=!0)})),onPointerLeave:we(e.onPointerLeave,Pp(()=>{o||(i.onTriggerLeave(),g.current=!1)})),onClick:we(e.onClick,()=>{i.onItemSelect(l.value),v.current=b}),onKeyDown:we(e.onKeyDown,x=>{const C={horizontal:"ArrowDown",vertical:i.dir==="rtl"?"ArrowLeft":"ArrowRight"}[i.orientation];b&&x.key===C&&(l.onEntryKeyDown(),x.preventDefault())})})})}),b&&c.jsxs(c.Fragment,{children:[c.jsx(TM,{"aria-hidden":!0,tabIndex:0,ref:l.focusProxyRef,onFocus:x=>{const S=l.contentRef.current,C=x.relatedTarget,E=C===d.current,N=S?.contains(C);(E||!N)&&l.onFocusProxyEnter(E?"start":"end")}}),i.viewport&&c.jsx("span",{"aria-owns":p})]})]})});WJ.displayName=uw;var QJ="NavigationMenuLink",gO="navigationMenu.linkSelect",zM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:o,onSelect:r,...i}=e;return c.jsx(VM,{asChild:!0,children:c.jsx(Pe.a,{"data-active":o?"":void 0,"aria-current":o?"page":void 0,...i,ref:t,onClick:we(e.onClick,l=>{const d=l.target,f=new CustomEvent(gO,{bubbles:!0,cancelable:!0});if(d.addEventListener(gO,m=>r?.(m),{once:!0}),Mp(d,f),!f.defaultPrevented&&!l.metaKey){const m=new CustomEvent(fp,{bubbles:!0,cancelable:!0});Mp(d,m)}},{checkForDefaultPrevented:!1})})})});zM.displayName=QJ;var FS="NavigationMenuIndicator",JJ=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=ko(FS,e.__scopeNavigationMenu),i=!!r.value;return r.indicatorTrack?hS.createPortal(c.jsx(Pn,{present:n||i,children:c.jsx(eee,{...o,ref:t})}),r.indicatorTrack):null});JJ.displayName=FS;var eee=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=ko(FS,n),i=OM(n),[l,d]=_.useState(null),[f,m]=_.useState(null),p=r.orientation==="horizontal",g=!!r.value;_.useEffect(()=>{const x=i().find(S=>S.value===r.value)?.ref.current;x&&d(x)},[i,r.value]);const v=()=>{l&&m({size:p?l.offsetWidth:l.offsetHeight,offset:p?l.offsetLeft:l.offsetTop})};return fw(l,v),fw(r.indicatorTrack,v),f?c.jsx(Pe.div,{"aria-hidden":!0,"data-state":g?"visible":"hidden","data-orientation":r.orientation,...o,ref:t,style:{position:"absolute",...p?{left:0,width:f.size+"px",transform:`translateX(${f.offset}px)`}:{top:0,height:f.size+"px",transform:`translateY(${f.offset}px)`},...o.style}}):null}),Hc="NavigationMenuContent",tee=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,r=ko(Hc,e.__scopeNavigationMenu),i=PM(Hc,e.__scopeNavigationMenu),l=st(i.contentRef,t),d=i.value===r.value,f={value:i.value,triggerRef:i.triggerRef,focusProxyRef:i.focusProxyRef,wasEscapeCloseRef:i.wasEscapeCloseRef,onContentFocusOutside:i.onContentFocusOutside,onRootContentClose:i.onRootContentClose,...o};return r.viewport?c.jsx(nee,{forceMount:n,...f,ref:l}):c.jsx(Pn,{present:n||d,children:c.jsx(UM,{"data-state":HS(d),...f,ref:l,onPointerEnter:we(e.onPointerEnter,r.onContentEnter),onPointerLeave:we(e.onPointerLeave,Pp(r.onContentLeave)),style:{pointerEvents:!d&&r.isRootMenu?"none":void 0,...f.style}})})});tee.displayName=Hc;var nee=_.forwardRef((e,t)=>{const n=ko(Hc,e.__scopeNavigationMenu),{onViewportContentChange:o,onViewportContentRemove:r}=n;return Sn(()=>{o(e.value,{ref:t,...e})},[e,t,o]),Sn(()=>()=>r(e.value),[e.value,r]),null}),fp="navigationMenu.rootContentDismiss",UM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:o,triggerRef:r,focusProxyRef:i,wasEscapeCloseRef:l,onRootContentClose:d,onContentFocusOutside:f,...m}=e,p=ko(Hc,n),g=_.useRef(null),v=st(g,t),b=BM(p.baseId,o),x=HM(p.baseId,o),S=OM(n),C=_.useRef(null),{onItemDismiss:E}=p;_.useEffect(()=>{const j=g.current;if(p.isRootMenu&&j){const T=()=>{E(),d(),j.contains(document.activeElement)&&r.current?.focus()};return j.addEventListener(fp,T),()=>j.removeEventListener(fp,T)}},[p.isRootMenu,e.value,r,E,d]);const N=_.useMemo(()=>{const T=S().map(V=>V.value);p.dir==="rtl"&&T.reverse();const O=T.indexOf(p.value),A=T.indexOf(p.previousValue),I=o===p.value,P=A===T.indexOf(o);if(!I&&!P)return C.current;const U=(()=>{if(O!==A){if(I&&A!==-1)return O>A?"from-end":"from-start";if(P&&O!==-1)return O>A?"to-start":"to-end"}return null})();return C.current=U,U},[p.previousValue,p.value,p.dir,S,o]);return c.jsx(FM,{asChild:!0,children:c.jsx(gu,{id:x,"aria-labelledby":b,"data-motion":N,"data-orientation":p.orientation,...m,ref:v,disableOutsidePointerEvents:!1,onDismiss:()=>{const j=new Event(fp,{bubbles:!0,cancelable:!0});g.current?.dispatchEvent(j)},onFocusOutside:we(e.onFocusOutside,j=>{f();const T=j.target;p.rootNavigationMenu?.contains(T)&&j.preventDefault()}),onPointerDownOutside:we(e.onPointerDownOutside,j=>{const T=j.target,O=S().some(I=>I.ref.current?.contains(T)),A=p.isRootMenu&&p.viewport?.contains(T);(O||A||!p.isRootMenu)&&j.preventDefault()}),onKeyDown:we(e.onKeyDown,j=>{const T=j.altKey||j.ctrlKey||j.metaKey;if(j.key==="Tab"&&!T){const A=dw(j.currentTarget),I=document.activeElement,P=A.findIndex(oe=>oe===I),V=j.shiftKey?A.slice(0,P).reverse():A.slice(P+1,A.length);BS(V)?j.preventDefault():i.current?.focus()}}),onEscapeKeyDown:we(e.onEscapeKeyDown,j=>{l.current=!0})})})}),VS="NavigationMenuViewport",LM=_.forwardRef((e,t)=>{const{forceMount:n,...o}=e,i=!!ko(VS,e.__scopeNavigationMenu).value;return c.jsx(Pn,{present:n||i,children:c.jsx(ree,{...o,ref:t})})});LM.displayName=VS;var ree=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:o,...r}=e,i=ko(VS,n),l=st(t,i.onViewportChange),d=ZJ(Hc,e.__scopeNavigationMenu),[f,m]=_.useState(null),[p,g]=_.useState(null),v=f?f?.width+"px":void 0,b=f?f?.height+"px":void 0,x=!!i.value,S=x?i.value:i.previousValue;return fw(p,()=>{p&&m({width:p.offsetWidth,height:p.offsetHeight})}),c.jsx(Pe.div,{"data-state":HS(x),"data-orientation":i.orientation,...r,ref:l,style:{pointerEvents:!x&&i.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":v,"--radix-navigation-menu-viewport-height":b,...r.style},onPointerEnter:we(e.onPointerEnter,i.onContentEnter),onPointerLeave:we(e.onPointerLeave,Pp(i.onContentLeave)),children:Array.from(d.items).map(([E,{ref:N,forceMount:j,...T}])=>{const O=S===E;return c.jsx(Pn,{present:j||O,children:c.jsx(UM,{...T,ref:yf(N,A=>{O&&A&&g(A)})})},E)})})}),oee="FocusGroup",FM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=ko(oee,n);return c.jsx(lw.Provider,{scope:n,children:c.jsx(lw.Slot,{scope:n,children:c.jsx(Pe.div,{dir:r.dir,...o,ref:t})})})}),vO=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],iee="FocusGroupItem",VM=_.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...o}=e,r=HJ(n),i=ko(iee,n);return c.jsx(lw.ItemSlot,{scope:n,children:c.jsx(Pe.button,{...o,ref:t,onKeyDown:we(e.onKeyDown,l=>{if(["Home","End",...vO].includes(l.key)){let f=r().map(g=>g.ref.current);if([i.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(l.key)&&f.reverse(),vO.includes(l.key)){const g=f.indexOf(l.currentTarget);f=f.slice(g+1)}setTimeout(()=>BS(f)),l.preventDefault()}})})})});function dw(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function BS(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function see(e){return e.forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")}),()=>{e.forEach(t=>{const n=t.dataset.tabindex;t.setAttribute("tabindex",n)})}}function fw(e,t){const n=Kt(t);Sn(()=>{let o=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(o),o=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(o),r.unobserve(e)}}},[e,n])}function HS(e){return e?"open":"closed"}function BM(e,t){return`${e}-trigger-${t}`}function HM(e,t){return`${e}-content-${t}`}function Pp(e){return t=>t.pointerType==="mouse"?e(t):void 0}var aee=kM,lee=$M,cee=DM,uee=zM,dee=LM;function fee({className:e,...t}){return c.jsx("div",{className:De("absolute top-full left-0 isolate z-50 flex justify-center"),children:c.jsx(dee,{"data-slot":"navigation-menu-viewport",className:De("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",e),...t})})}function GM({className:e,children:t,viewport:n=!0,...o}){return c.jsxs(aee,{"data-slot":"navigation-menu","data-viewport":n,className:De("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",e),...o,children:[t,n&&c.jsx(fee,{})]})}function Dp({className:e,...t}){return c.jsx(cee,{"data-slot":"navigation-menu-item",className:De("relative",e),...t})}function zp({className:e,...t}){return c.jsx(uee,{"data-slot":"navigation-menu-link",className:De("hover:text-white ring-ring/10 dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-[color,box-shadow] focus-visible:ring-4 focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",e),...t})}function qM({className:e,...t}){return c.jsx(lee,{"data-slot":"navigation-menu-list",className:De("group flex flex-1 list-none items-center justify-center gap-1",e),...t})}function Mf(e){const{instanceId:t,clusterId:n}=Ze({strict:!1});return Us({id:wn,operationsUrl:e})}function Pf(e){const{instanceId:t,clusterId:n}=Ze({strict:!1});return{instanceClient:Us({id:wn,operationsUrl:e}),entityType:"instance"}}function ur(e){const{instanceId:t,clusterId:n}=Ze({strict:!1}),o=wn;return{instanceClient:Us({id:o,operationsUrl:e}),entityId:o,entityType:"instance"}}async function mee(){Hn.setUserForEntity(wn,null),ef.getQueryCache().clear(),await ef.invalidateQueries({refetchType:"none"})}async function hee(e){await Hn.signOutFromPotentiallyAuthenticatedInstances(),await Ef(e)}function pee(){const e=Mf();return at({mutationFn:()=>hee({instanceClient:e}),onSuccess:mee})}function Df(e){const{user:t}=Rf(),{organizationId:n}=Ze({strict:!1}),o=t?.roles?.[e??n];return!o?.permission&&!o?.organization?{update:!1,remove:!1}:o.permission?.super_user?{update:!0,remove:!0}:{update:o.organization.update,remove:o.organization.delete}}function vu(e){const{user:t}=Rf(),{organizationId:n}=Ze({strict:!1}),o=t?.roles?.[e??n];if(!o?.permission&&!o?.organization?.roles)return{create:!1,remove:!1,update:!1,view:!1};if(o.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const r=o.organization.roles;return{create:r.create,remove:r.delete,update:r.update,view:r.view}}function GS(e,t){const{user:n}=Rf(),{organizationId:o,clusterId:r}=Ze({strict:!1}),i=t??r,l=n?.roles?.[e??o];if(!l?.permission&&!l?.organization?.clusters)return{create:!1,remove:!1,update:!1,view:!1};if(l.permission?.super_user)return{create:!0,remove:!0,update:!0,view:!0};const d=l.organization.clusters.resources?.find(m=>m.id===i),f=l.organization.clusters;return{create:f.create,remove:d?d.delete:f.delete,update:d?d.update:f.update,view:d?d.view:f.view}}function KM(e){const{clusterId:t,instanceId:n}=Ze({strict:!1}),{user:o}=ta(n??t),r=o?.role?.permission;return r?r.super_user===!0:!1}function qS(e){const{clusterId:t,instanceId:n}=Ze({strict:!1}),{user:o}=ta(n??t),r=o?.role?.permission;return r?r.super_user===!0||r.structure_user===!0:!1}function Vx(e,t,n,o){const{clusterId:r,instanceId:i}=Ze({strict:!1}),{user:l}=ta(e??i??r),d=l?.role?.permission;return d?d.super_user===!0||d.structure_user===!0?!0:d[t]?.tables?.[n][o]===!0:!1}const gee={className:"text-white"};function vee({signOut:e}){const{user:t}=al();lu(t);const{organizationId:n}=Ze({strict:!1}),{update:o}=Df(n),{view:r}=vu(n),[i,l]=_.useState(!1);return c.jsxs("div",{className:"md:hidden",id:"mobile-menu",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs(Ue,{to:ea,children:[c.jsx(KS,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-alpha.8"})]}),c.jsxs("button",{type:"button",className:"shadow-xs text-grey-400 hover:text-white hover:bg-black-dark",onClick:()=>{l(!i)},children:[c.jsx("span",{className:"sr-only",children:i?"Close menu":"Open menu"}),i?c.jsx(jI,{}):c.jsx(CI,{})]})]}),c.jsxs("div",{className:`${i?"block":"hidden"} md:hidden space-y-1 pb-3 bg-black-dark absolute left-0 top-full w-full rounded-b-md`,children:[!Ic,!Ic,c.jsxs(Ue,{to:"/docs",className:"flex flex-row px-3 py-2 text-base font-medium text-gray-300 rounded-md hover:bg-gray-700 hover:text-white",children:[c.jsx(pS,{className:"mr-4"})," Docs"]}),c.jsxs(Ue,{to:void 0,onClick:e,className:"flex flex-row px-3 py-2 text-base font-medium text-gray-300 rounded-md hover:bg-gray-700 hover:text-white",children:[c.jsx(SI,{className:"mr-4"})," Sign Out"]})]})]})}function yee({signOut:e}){const{user:t}=al();lu(t);const{organizationId:n}=Ze({strict:!1}),{update:o}=Df(n),{view:r}=vu(n);return c.jsx("div",{className:"hidden md:block",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"inline-block",children:c.jsxs(Ue,{to:ea,children:[c.jsx(KS,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-alpha.8"})]})}),c.jsx(GM,{children:c.jsxs(qM,{className:"text-grey-400",children:[!Ic,!Ic,c.jsx(Dp,{children:c.jsx(zp,{asChild:!0,children:c.jsxs(Ue,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[c.jsx(pS,{})," ",c.jsx("span",{className:"hidden lg:inline-block",children:"Docs"})]})})}),c.jsx(Dp,{children:c.jsx(zp,{asChild:!0,children:c.jsxs(Ue,{to:void 0,onClick:e,className:"flex-row items-center",children:[c.jsx(SI,{})," ",c.jsx("span",{className:"hidden lg:inline-block",children:"Sign Out"})]})})})]})})]})})}function bee(){return c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{className:"inline-block",children:c.jsxs(Ue,{to:"/",children:[c.jsx(KS,{}),c.jsx("span",{className:"text-grey text-xs inline-block pl-2",children:"v4.7.0-alpha.8"})]})}),c.jsx(GM,{children:c.jsxs(qM,{className:"text-grey-400",children:[c.jsx(Dp,{children:c.jsx(zp,{asChild:!0,children:c.jsxs(Ue,{to:"https://docs.harperdb.io/docs",target:"_blank",rel:"noreferrer noopener",className:"flex-row items-center",children:[c.jsx(pS,{})," ",c.jsx("span",{className:"hidden md:inline-block",children:"Docs"})]})})}),c.jsx(Dp,{children:c.jsx(zp,{asChild:!0,children:c.jsxs(Ue,{to:"/",className:"flex-row items-center",activeProps:gee,children:[c.jsx(hG,{})," Sign In"]})})})]})})]})}function KS(){return c.jsxs(c.Fragment,{children:[c.jsx("img",{src:"/logo_harper_db_studio.png",alt:"logo",className:"w-64 hidden md:inline-block"}),c.jsx("img",{src:"/HDBDogOnly.svg",width:"50px",height:"44px",alt:"Harper",className:"inline-block md:hidden"})]})}function ZM(){const{mutate:e}=pee(),t=hn(),{user:n}=al(),o=Cn(),r=_.useCallback(()=>{e(void 0,{onSuccess:async()=>{Ee.success("Success",{description:"You have been signed out successfully.",action:{label:"Dismiss",onClick:()=>Ee.dismiss()}}),t({to:"/sign-in"}),o.invalidate()}})},[e,o,t]);return n?c.jsxs(c.Fragment,{children:[c.jsx(vee,{signOut:r}),c.jsx(yee,{signOut:r})]}):c.jsx(bee,{})}function $h({title:e,children:t}){return c.jsxs("li",{className:"list-image-(--checkmark-icon) mt-4",children:[c.jsx("h3",{className:"text-xl font-bold",children:e}),t]})}function xee(){return c.jsxs(c.Fragment,{children:[c.jsx("header",{className:"fixed top-0 z-40 w-full h-20 p-4 bg-black-dark dark:bg-black-dark dark:border-b dark:border-black md:px-12",children:c.jsx(ZM,{})}),c.jsxs("div",{className:"pt-20 grid h-screen grid-cols-1 md:grid-cols-2",children:[c.jsx("section",{className:"items-center justify-center hidden text-white md:flex bg-linear-(--blue-pink-gradient) px-6",children:c.jsxs("div",{children:[c.jsx("h1",{className:"text-4xl font-bold",children:"Harper Studio"}),c.jsx("span",{children:"Manage all your Harper instances."}),c.jsxs("ul",{className:"ps-5",children:[c.jsx($h,{title:"Manage All Instances",children:c.jsx("span",{children:"View, create, and delete instances from one location."})}),c.jsx($h,{title:"Embedded API Server",children:c.jsx("span",{children:"Harper components give you unlimited application flexibility"})}),c.jsx($h,{title:"Fully Managed Cloud & 5G Instances",children:c.jsx("span",{children:"Go from zero to code in minutes."})}),c.jsx($h,{title:"Deploy Anywhere",children:c.jsxs("div",{className:"mt-6",children:[c.jsx("a",{href:"https://hub.docker.com/r/harperdb/harperdb",target:"_blank",rel:"noreferrer noopener",className:"p-2 mr-2 border-2 border-blue-100 rounded-md",children:"Docker"}),c.jsx("a",{href:"https://www.npmjs.com/package/harperdb",target:"_blank",rel:"noreferrer noopener",className:"p-2 mr-2 border-2 border-blue-100 rounded-md",children:"npm"}),c.jsx("a",{href:"https://docs.harperdb.io/docs/deployments/install-harperdb",target:"_blank",rel:"noreferrer noopener",className:"p-2 border-2 border-blue-100 rounded-md",children:"all options"})]})})]})]})}),c.jsx("section",{className:"flex items-center justify-center px-6 bg-linear-(--purple-gradient) dark:bg-linear-(--black-dark-gradient)",children:c.jsx(ss,{})})]})]})}function _ee(e){if(!e)return"";const t=e.replace(/[-_]+/g," ").replace(/\s+/g," ").trim();if(!t)return"";const n=t.match(/([A-Z]+(?=[A-Z][a-z])|[A-Z]?[a-z]+|[A-Z]+|[0-9]+)/g);if(!n)return"";const o=[];for(let i=0;i<n.length;i++){const l=n[i],d=i+1<n.length?n[i+1]:void 0;/^[A-Z]{2,}$/.test(l)&&d==="s"?(o.push(l+"s"),i++):/^[A-Z]$/.test(l)&&d!==void 0&&/^[A-Z]s$/.test(d)?(o.push(l+d),i++):o.push(l)}return o.map(i=>/^[A-Z]{2,}s?$/.test(i)||/^[0-9]+$/.test(i)?i:i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join(" ")}function qg(){const e=O9(),t=T9({strict:!1}),n=_.useMemo(()=>{const o=e.pathname.split("/").filter(i=>i&&i.length>0),r=[c.jsxs(Ue,{to:"/",children:[c.jsx(cG,{"aria-hidden":"true",className:"size-5 shrink-0"}),c.jsx("span",{className:"sr-only",children:"Home"})]})];for(let i=0;i<o.length;i++){const l=o[i];if(l==="instance")continue;const d=`/${o.slice(0,i+1).join("/")}`;let f=_ee(l),m;f.startsWith("Org ")?(m=l.split("org-").pop(),f=t?.organization?.name||"Org"):f.startsWith("Clu ")?(m=l.split("clu-").pop(),f=t?.cluster?.name||"Cluster"):f.startsWith("Ins ")&&(m=l.split("ins-").pop(),f="Instance"),r.push(c.jsx("svg",{fill:"currentColor",viewBox:"0 0 20 20","aria-hidden":"true",className:"size-5 shrink-0 text-grey",children:c.jsx("path",{d:"M5.555 17.776l8-16 .894.448-8 16-.894-.448z"})}),c.jsxs(Ue,{to:d,className:"text-xs md:text-sm font-medium hover:text-grey",children:[f,m&&c.jsx("div",{className:"text-gray-500 text-xs",children:m})]}))}return r},[e.pathname,t?.cluster?.name,t?.organization?.name]);return c.jsxs("div",{role:"list",className:"flex items-center space-x-0 lg:space-x-2 xl:space-x-4 overflow-x-auto",children:[...n]})}var zf=e=>e.type==="checkbox",$a=e=>e instanceof Date,br=e=>e==null;const YM=e=>typeof e=="object";var fn=e=>!br(e)&&!Array.isArray(e)&&YM(e)&&!$a(e),XM=e=>fn(e)&&e.target?zf(e.target)?e.target.checked:e.target.value:e,wee=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,WM=(e,t)=>e.has(wee(t)),See=e=>{const t=e.constructor&&e.constructor.prototype;return fn(t)&&t.hasOwnProperty("isPrototypeOf")},ZS=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Lt(e){let t;const n=Array.isArray(e),o=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(ZS&&(e instanceof Blob||o))&&(n||fn(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!See(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Lt(e[r]));else return e;return t}var Kg=e=>/^\w*$/.test(e),Vt=e=>e===void 0,Zg=e=>Array.isArray(e)?e.filter(Boolean):[],YS=e=>Zg(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ce=(e,t,n)=>{if(!t||!fn(e))return n;const o=(Kg(t)?[t]:YS(t)).reduce((r,i)=>br(r)?r:r[i],e);return Vt(o)||o===e?Vt(e[t])?n:e[t]:o},Gr=e=>typeof e=="boolean",Et=(e,t,n)=>{let o=-1;const r=Kg(t)?[t]:YS(t),i=r.length,l=i-1;for(;++o<i;){const d=r[o];let f=n;if(o!==l){const m=e[d];f=fn(m)||Array.isArray(m)?m:isNaN(+r[o+1])?{}:[]}if(d==="__proto__"||d==="constructor"||d==="prototype")return;e[d]=f,e=e[d]}};const Up={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Eo={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Gi={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},XS=G.createContext(null);XS.displayName="HookFormContext";const Uf=()=>G.useContext(XS),Cee=e=>{const{children:t,...n}=e;return G.createElement(XS.Provider,{value:n},t)};var QM=(e,t,n,o=!0)=>{const r={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(r,i,{get:()=>{const l=i;return t._proxyFormState[l]!==Eo.all&&(t._proxyFormState[l]=!o||Eo.all),n&&(n[l]=!0),e[l]}});return r};const Yg=typeof window<"u"?G.useLayoutEffect:G.useEffect;function WS(e){const t=Uf(),{control:n=t.control,disabled:o,name:r,exact:i}=e||{},[l,d]=G.useState(n._formState),f=G.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return Yg(()=>n._subscribe({name:r,formState:f.current,exact:i,callback:m=>{!o&&d({...n._formState,...m})}}),[r,o,i]),G.useEffect(()=>{f.current.isValid&&n._setValid(!0)},[n]),G.useMemo(()=>QM(l,n,f.current,!1),[l,n])}var hi=e=>typeof e=="string",JM=(e,t,n,o,r)=>hi(e)?(o&&t.watch.add(e),Ce(n,e,r)):Array.isArray(e)?e.map(i=>(o&&t.watch.add(i),Ce(n,i))):(o&&(t.watchAll=!0),n),mw=e=>br(e)||!YM(e);function Xi(e,t,n=new WeakSet){if(mw(e)||mw(t))return e===t;if($a(e)&&$a(t))return e.getTime()===t.getTime();const o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const i of o){const l=e[i];if(!r.includes(i))return!1;if(i!=="ref"){const d=t[i];if($a(l)&&$a(d)||fn(l)&&fn(d)||Array.isArray(l)&&Array.isArray(d)?!Xi(l,d,n):l!==d)return!1}}return!0}function Eee(e){const t=Uf(),{control:n=t.control,name:o,defaultValue:r,disabled:i,exact:l,compute:d}=e||{},f=G.useRef(r),m=G.useRef(d),p=G.useRef(void 0);m.current=d;const g=G.useMemo(()=>n._getWatch(o,f.current),[n,o]),[v,b]=G.useState(m.current?m.current(g):g);return Yg(()=>n._subscribe({name:o,formState:{values:!0},exact:l,callback:x=>{if(!i){const S=JM(o,n._names,x.values||n._formValues,!1,f.current);if(m.current){const C=m.current(S);Xi(C,p.current)||(b(C),p.current=C)}else b(S)}}}),[n,i,o,l]),G.useEffect(()=>n._removeUnmounted()),v}function Ree(e){const t=Uf(),{name:n,disabled:o,control:r=t.control,shouldUnregister:i,defaultValue:l}=e,d=WM(r._names.array,n),f=G.useMemo(()=>Ce(r._formValues,n,Ce(r._defaultValues,n,l)),[r,n,l]),m=Eee({control:r,name:n,defaultValue:f,exact:!0}),p=WS({control:r,name:n,exact:!0}),g=G.useRef(e),v=G.useRef(r.register(n,{...e.rules,value:m,...Gr(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const b=G.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Ce(p.errors,n)},isDirty:{enumerable:!0,get:()=>!!Ce(p.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Ce(p.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Ce(p.validatingFields,n)},error:{enumerable:!0,get:()=>Ce(p.errors,n)}}),[p,n]),x=G.useCallback(N=>v.current.onChange({target:{value:XM(N),name:n},type:Up.CHANGE}),[n]),S=G.useCallback(()=>v.current.onBlur({target:{value:Ce(r._formValues,n),name:n},type:Up.BLUR}),[n,r._formValues]),C=G.useCallback(N=>{const j=Ce(r._fields,n);j&&N&&(j._f.ref={focus:()=>N.focus&&N.focus(),select:()=>N.select&&N.select(),setCustomValidity:T=>N.setCustomValidity(T),reportValidity:()=>N.reportValidity()})},[r._fields,n]),E=G.useMemo(()=>({name:n,value:m,...Gr(o)||p.disabled?{disabled:p.disabled||o}:{},onChange:x,onBlur:S,ref:C}),[n,o,p.disabled,x,S,C,m]);return G.useEffect(()=>{const N=r._options.shouldUnregister||i;r.register(n,{...g.current.rules,...Gr(g.current.disabled)?{disabled:g.current.disabled}:{}});const j=(T,O)=>{const A=Ce(r._fields,T);A&&A._f&&(A._f.mount=O)};if(j(n,!0),N){const T=Lt(Ce(r._options.defaultValues,n));Et(r._defaultValues,n,T),Vt(Ce(r._formValues,n))&&Et(r._formValues,n,T)}return!d&&r.register(n),()=>{(d?N&&!r._state.action:N)?r.unregister(n):j(n,!1)}},[n,r,d,i]),G.useEffect(()=>{r._setDisabledField({disabled:o,name:n})},[o,n,r]),G.useMemo(()=>({field:E,formState:p,fieldState:b}),[E,p,b])}const jee=e=>e.render(Ree(e));var QS=(e,t,n,o,r)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[o]:r||!0}}:{},Tr=e=>Array.isArray(e)?e:[e],yO=()=>{let e=[];return{get observers(){return e},next:r=>{for(const i of e)i.next&&i.next(r)},subscribe:r=>(e.push(r),{unsubscribe:()=>{e=e.filter(i=>i!==r)}}),unsubscribe:()=>{e=[]}}},gr=e=>fn(e)&&!Object.keys(e).length,JS=e=>e.type==="file",Lo=e=>typeof e=="function",Lp=e=>{if(!ZS)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},eP=e=>e.type==="select-multiple",e0=e=>e.type==="radio",Nee=e=>e0(e)||zf(e),Bx=e=>Lp(e)&&e.isConnected;function Tee(e,t){const n=t.slice(0,-1).length;let o=0;for(;o<n;)e=Vt(e)?o++:e[t[o++]];return e}function Oee(e){for(const t in e)if(e.hasOwnProperty(t)&&!Vt(e[t]))return!1;return!0}function ln(e,t){const n=Array.isArray(t)?t:Kg(t)?[t]:YS(t),o=n.length===1?e:Tee(e,n),r=n.length-1,i=n[r];return o&&delete o[i],r!==0&&(fn(o)&&gr(o)||Array.isArray(o)&&Oee(o))&&ln(e,n.slice(0,-1)),e}var tP=e=>{for(const t in e)if(Lo(e[t]))return!0;return!1};function Fp(e,t={}){const n=Array.isArray(e);if(fn(e)||n)for(const o in e)Array.isArray(e[o])||fn(e[o])&&!tP(e[o])?(t[o]=Array.isArray(e[o])?[]:{},Fp(e[o],t[o])):br(e[o])||(t[o]=!0);return t}function nP(e,t,n){const o=Array.isArray(e);if(fn(e)||o)for(const r in e)Array.isArray(e[r])||fn(e[r])&&!tP(e[r])?Vt(t)||mw(n[r])?n[r]=Array.isArray(e[r])?Fp(e[r],[]):{...Fp(e[r])}:nP(e[r],br(t)?{}:t[r],n[r]):n[r]=!Xi(e[r],t[r]);return n}var Od=(e,t)=>nP(e,t,Fp(t));const bO={value:!1,isValid:!1},xO={value:!0,isValid:!0};var rP=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Vt(e[0].attributes.value)?Vt(e[0].value)||e[0].value===""?xO:{value:e[0].value,isValid:!0}:xO:bO}return bO},oP=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:o})=>Vt(e)?e:t?e===""?NaN:e&&+e:n&&hi(e)?new Date(e):o?o(e):e;const _O={isValid:!1,value:null};var iP=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,_O):_O;function wO(e){const t=e.ref;return JS(t)?t.files:e0(t)?iP(e.refs).value:eP(t)?[...t.selectedOptions].map(({value:n})=>n):zf(t)?rP(e.refs).value:oP(Vt(t.value)?e.ref.value:t.value,e)}var kee=(e,t,n,o)=>{const r={};for(const i of e){const l=Ce(t,i);l&&Et(r,i,l._f)}return{criteriaMode:n,names:[...e],fields:r,shouldUseNativeValidation:o}},Vp=e=>e instanceof RegExp,kd=e=>Vt(e)?e:Vp(e)?e.source:fn(e)?Vp(e.value)?e.value.source:e.value:e,xc=e=>({isOnSubmit:!e||e===Eo.onSubmit,isOnBlur:e===Eo.onBlur,isOnChange:e===Eo.onChange,isOnAll:e===Eo.all,isOnTouch:e===Eo.onTouched});const SO="AsyncFunction";var Aee=e=>!!e&&!!e.validate&&!!(Lo(e.validate)&&e.validate.constructor.name===SO||fn(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===SO)),Iee=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),hw=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(o=>e.startsWith(o)&&/^\.\w+/.test(e.slice(o.length))));const jc=(e,t,n,o)=>{for(const r of n||Object.keys(e)){const i=Ce(e,r);if(i){const{_f:l,...d}=i;if(l){if(l.refs&&l.refs[0]&&t(l.refs[0],r)&&!o)return!0;if(l.ref&&t(l.ref,l.name)&&!o)return!0;if(jc(d,t))break}else if(fn(d)&&jc(d,t))break}}};function CO(e,t,n){const o=Ce(e,n);if(o||Kg(n))return{error:o,name:n};const r=n.split(".");for(;r.length;){const i=r.join("."),l=Ce(t,i),d=Ce(e,i);if(l&&!Array.isArray(l)&&n!==i)return{name:n};if(d&&d.type)return{name:i,error:d};if(d&&d.root&&d.root.type)return{name:`${i}.root`,error:d.root};r.pop()}return{name:n}}var $ee=(e,t,n,o)=>{n(e);const{name:r,...i}=e;return gr(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(l=>t[l]===(!o||Eo.all))},Mee=(e,t,n)=>!e||!t||e===t||Tr(e).some(o=>o&&(n?o===t:o.startsWith(t)||t.startsWith(o))),Pee=(e,t,n,o,r)=>r.isOnAll?!1:!n&&r.isOnTouch?!(t||e):(n?o.isOnBlur:r.isOnBlur)?!e:(n?o.isOnChange:r.isOnChange)?e:!0,Dee=(e,t)=>!Zg(Ce(e,t)).length&&ln(e,t),sP=(e,t,n)=>{const o=Tr(Ce(e,n));return Et(o,"root",t[n]),Et(e,n,o),e},mp=e=>hi(e);function EO(e,t,n="validate"){if(mp(e)||Array.isArray(e)&&e.every(mp)||Gr(e)&&!e)return{type:n,message:mp(e)?e:"",ref:t}}var dc=e=>fn(e)&&!Vp(e)?e:{value:e,message:""},pw=async(e,t,n,o,r,i)=>{const{ref:l,refs:d,required:f,maxLength:m,minLength:p,min:g,max:v,pattern:b,validate:x,name:S,valueAsNumber:C,mount:E}=e._f,N=Ce(n,S);if(!E||t.has(S))return{};const j=d?d[0]:l,T=ae=>{r&&j.reportValidity&&(j.setCustomValidity(Gr(ae)?"":ae||""),j.reportValidity())},O={},A=e0(l),I=zf(l),P=A||I,U=(C||JS(l))&&Vt(l.value)&&Vt(N)||Lp(l)&&l.value===""||N===""||Array.isArray(N)&&!N.length,V=QS.bind(null,S,o,O),oe=(ae,de,ce,le=Gi.maxLength,M=Gi.minLength)=>{const Z=ae?de:ce;O[S]={type:ae?le:M,message:Z,ref:l,...V(ae?le:M,Z)}};if(i?!Array.isArray(N)||!N.length:f&&(!P&&(U||br(N))||Gr(N)&&!N||I&&!rP(d).isValid||A&&!iP(d).isValid)){const{value:ae,message:de}=mp(f)?{value:!!f,message:f}:dc(f);if(ae&&(O[S]={type:Gi.required,message:de,ref:j,...V(Gi.required,de)},!o))return T(de),O}if(!U&&(!br(g)||!br(v))){let ae,de;const ce=dc(v),le=dc(g);if(!br(N)&&!isNaN(N)){const M=l.valueAsNumber||N&&+N;br(ce.value)||(ae=M>ce.value),br(le.value)||(de=M<le.value)}else{const M=l.valueAsDate||new Date(N),Z=$=>new Date(new Date().toDateString()+" "+$),F=l.type=="time",se=l.type=="week";hi(ce.value)&&N&&(ae=F?Z(N)>Z(ce.value):se?N>ce.value:M>new Date(ce.value)),hi(le.value)&&N&&(de=F?Z(N)<Z(le.value):se?N<le.value:M<new Date(le.value))}if((ae||de)&&(oe(!!ae,ce.message,le.message,Gi.max,Gi.min),!o))return T(O[S].message),O}if((m||p)&&!U&&(hi(N)||i&&Array.isArray(N))){const ae=dc(m),de=dc(p),ce=!br(ae.value)&&N.length>+ae.value,le=!br(de.value)&&N.length<+de.value;if((ce||le)&&(oe(ce,ae.message,de.message),!o))return T(O[S].message),O}if(b&&!U&&hi(N)){const{value:ae,message:de}=dc(b);if(Vp(ae)&&!N.match(ae)&&(O[S]={type:Gi.pattern,message:de,ref:l,...V(Gi.pattern,de)},!o))return T(de),O}if(x){if(Lo(x)){const ae=await x(N,n),de=EO(ae,j);if(de&&(O[S]={...de,...V(Gi.validate,de.message)},!o))return T(de.message),O}else if(fn(x)){let ae={};for(const de in x){if(!gr(ae)&&!o)break;const ce=EO(await x[de](N,n),j,de);ce&&(ae={...ce,...V(de,ce.message)},T(ce.message),o&&(O[S]=ae))}if(!gr(ae)&&(O[S]={ref:j,...ae},!o))return O}}return T(!0),O};const zee={mode:Eo.onSubmit,reValidateMode:Eo.onChange,shouldFocusError:!0};function Uee(e={}){let t={...zee,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:Lo(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},o={},r=fn(t.defaultValues)||fn(t.values)?Lt(t.defaultValues||t.values)||{}:{},i=t.shouldUnregister?{}:Lt(r),l={action:!1,mount:!1,watch:!1},d={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},f,m=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...p};const v={array:yO(),state:yO()},b=t.criteriaMode===Eo.all,x=z=>X=>{clearTimeout(m),m=setTimeout(z,X)},S=async z=>{if(!t.disabled&&(p.isValid||g.isValid||z)){const X=t.resolver?gr((await I()).errors):await U(o,!0);X!==n.isValid&&v.state.next({isValid:X})}},C=(z,X)=>{!t.disabled&&(p.isValidating||p.validatingFields||g.isValidating||g.validatingFields)&&((z||Array.from(d.mount)).forEach(ne=>{ne&&(X?Et(n.validatingFields,ne,X):ln(n.validatingFields,ne))}),v.state.next({validatingFields:n.validatingFields,isValidating:!gr(n.validatingFields)}))},E=(z,X=[],ne,ve,xe=!0,ye=!0)=>{if(ve&&ne&&!t.disabled){if(l.action=!0,ye&&Array.isArray(Ce(o,z))){const Re=ne(Ce(o,z),ve.argA,ve.argB);xe&&Et(o,z,Re)}if(ye&&Array.isArray(Ce(n.errors,z))){const Re=ne(Ce(n.errors,z),ve.argA,ve.argB);xe&&Et(n.errors,z,Re),Dee(n.errors,z)}if((p.touchedFields||g.touchedFields)&&ye&&Array.isArray(Ce(n.touchedFields,z))){const Re=ne(Ce(n.touchedFields,z),ve.argA,ve.argB);xe&&Et(n.touchedFields,z,Re)}(p.dirtyFields||g.dirtyFields)&&(n.dirtyFields=Od(r,i)),v.state.next({name:z,isDirty:oe(z,X),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Et(i,z,X)},N=(z,X)=>{Et(n.errors,z,X),v.state.next({errors:n.errors})},j=z=>{n.errors=z,v.state.next({errors:n.errors,isValid:!1})},T=(z,X,ne,ve)=>{const xe=Ce(o,z);if(xe){const ye=Ce(i,z,Vt(ne)?Ce(r,z):ne);Vt(ye)||ve&&ve.defaultChecked||X?Et(i,z,X?ye:wO(xe._f)):ce(z,ye),l.mount&&S()}},O=(z,X,ne,ve,xe)=>{let ye=!1,Re=!1;const Xe={name:z};if(!t.disabled){if(!ne||ve){(p.isDirty||g.isDirty)&&(Re=n.isDirty,n.isDirty=Xe.isDirty=oe(),ye=Re!==Xe.isDirty);const mt=Xi(Ce(r,z),X);Re=!!Ce(n.dirtyFields,z),mt?ln(n.dirtyFields,z):Et(n.dirtyFields,z,!0),Xe.dirtyFields=n.dirtyFields,ye=ye||(p.dirtyFields||g.dirtyFields)&&Re!==!mt}if(ne){const mt=Ce(n.touchedFields,z);mt||(Et(n.touchedFields,z,ne),Xe.touchedFields=n.touchedFields,ye=ye||(p.touchedFields||g.touchedFields)&&mt!==ne)}ye&&xe&&v.state.next(Xe)}return ye?Xe:{}},A=(z,X,ne,ve)=>{const xe=Ce(n.errors,z),ye=(p.isValid||g.isValid)&&Gr(X)&&n.isValid!==X;if(t.delayError&&ne?(f=x(()=>N(z,ne)),f(t.delayError)):(clearTimeout(m),f=null,ne?Et(n.errors,z,ne):ln(n.errors,z)),(ne?!Xi(xe,ne):xe)||!gr(ve)||ye){const Re={...ve,...ye&&Gr(X)?{isValid:X}:{},errors:n.errors,name:z};n={...n,...Re},v.state.next(Re)}},I=async z=>{C(z,!0);const X=await t.resolver(i,t.context,kee(z||d.mount,o,t.criteriaMode,t.shouldUseNativeValidation));return C(z),X},P=async z=>{const{errors:X}=await I(z);if(z)for(const ne of z){const ve=Ce(X,ne);ve?Et(n.errors,ne,ve):ln(n.errors,ne)}else n.errors=X;return X},U=async(z,X,ne={valid:!0})=>{for(const ve in z){const xe=z[ve];if(xe){const{_f:ye,...Re}=xe;if(ye){const Xe=d.array.has(ye.name),mt=xe._f&&Aee(xe._f);mt&&p.validatingFields&&C([ve],!0);const jt=await pw(xe,d.disabled,i,b,t.shouldUseNativeValidation&&!X,Xe);if(mt&&p.validatingFields&&C([ve]),jt[ye.name]&&(ne.valid=!1,X))break;!X&&(Ce(jt,ye.name)?Xe?sP(n.errors,jt,ye.name):Et(n.errors,ye.name,jt[ye.name]):ln(n.errors,ye.name))}!gr(Re)&&await U(Re,X,ne)}}return ne.valid},V=()=>{for(const z of d.unMount){const X=Ce(o,z);X&&(X._f.refs?X._f.refs.every(ne=>!Bx(ne)):!Bx(X._f.ref))&&ie(z)}d.unMount=new Set},oe=(z,X)=>!t.disabled&&(z&&X&&Et(i,z,X),!Xi($(),r)),ae=(z,X,ne)=>JM(z,d,{...l.mount?i:Vt(X)?r:hi(z)?{[z]:X}:X},ne,X),de=z=>Zg(Ce(l.mount?i:r,z,t.shouldUnregister?Ce(r,z,[]):[])),ce=(z,X,ne={})=>{const ve=Ce(o,z);let xe=X;if(ve){const ye=ve._f;ye&&(!ye.disabled&&Et(i,z,oP(X,ye)),xe=Lp(ye.ref)&&br(X)?"":X,eP(ye.ref)?[...ye.ref.options].forEach(Re=>Re.selected=xe.includes(Re.value)):ye.refs?zf(ye.ref)?ye.refs.forEach(Re=>{(!Re.defaultChecked||!Re.disabled)&&(Array.isArray(xe)?Re.checked=!!xe.find(Xe=>Xe===Re.value):Re.checked=xe===Re.value||!!xe)}):ye.refs.forEach(Re=>Re.checked=Re.value===xe):JS(ye.ref)?ye.ref.value="":(ye.ref.value=xe,ye.ref.type||v.state.next({name:z,values:Lt(i)})))}(ne.shouldDirty||ne.shouldTouch)&&O(z,xe,ne.shouldTouch,ne.shouldDirty,!0),ne.shouldValidate&&se(z)},le=(z,X,ne)=>{for(const ve in X){if(!X.hasOwnProperty(ve))return;const xe=X[ve],ye=z+"."+ve,Re=Ce(o,ye);(d.array.has(z)||fn(xe)||Re&&!Re._f)&&!$a(xe)?le(ye,xe,ne):ce(ye,xe,ne)}},M=(z,X,ne={})=>{const ve=Ce(o,z),xe=d.array.has(z),ye=Lt(X);Et(i,z,ye),xe?(v.array.next({name:z,values:Lt(i)}),(p.isDirty||p.dirtyFields||g.isDirty||g.dirtyFields)&&ne.shouldDirty&&v.state.next({name:z,dirtyFields:Od(r,i),isDirty:oe(z,ye)})):ve&&!ve._f&&!br(ye)?le(z,ye,ne):ce(z,ye,ne),hw(z,d)&&v.state.next({...n,name:z}),v.state.next({name:l.mount?z:void 0,values:Lt(i)})},Z=async z=>{l.mount=!0;const X=z.target;let ne=X.name,ve=!0;const xe=Ce(o,ne),ye=mt=>{ve=Number.isNaN(mt)||$a(mt)&&isNaN(mt.getTime())||Xi(mt,Ce(i,ne,mt))},Re=xc(t.mode),Xe=xc(t.reValidateMode);if(xe){let mt,jt;const Pr=X.type?wO(xe._f):XM(z),Dr=z.type===Up.BLUR||z.type===Up.FOCUS_OUT,ei=!Iee(xe._f)&&!t.resolver&&!Ce(n.errors,ne)&&!xe._f.deps||Pee(Dr,Ce(n.touchedFields,ne),n.isSubmitted,Xe,Re),ti=hw(ne,d,Dr);Et(i,ne,Pr),Dr?(!X||!X.readOnly)&&(xe._f.onBlur&&xe._f.onBlur(z),f&&f(0)):xe._f.onChange&&xe._f.onChange(z);const ni=O(ne,Pr,Dr),lo=!gr(ni)||ti;if(!Dr&&v.state.next({name:ne,type:z.type,values:Lt(i)}),ei)return(p.isValid||g.isValid)&&(t.mode==="onBlur"?Dr&&S():Dr||S()),lo&&v.state.next({name:ne,...ti?{}:ni});if(!Dr&&ti&&v.state.next({...n}),t.resolver){const{errors:ri}=await I([ne]);if(ye(Pr),ve){const ji=CO(n.errors,o,ne),cs=CO(ri,o,ji.name||ne);mt=cs.error,ne=cs.name,jt=gr(ri)}}else C([ne],!0),mt=(await pw(xe,d.disabled,i,b,t.shouldUseNativeValidation))[ne],C([ne]),ye(Pr),ve&&(mt?jt=!1:(p.isValid||g.isValid)&&(jt=await U(o,!0)));ve&&(xe._f.deps&&se(xe._f.deps),A(ne,jt,mt,ni))}},F=(z,X)=>{if(Ce(n.errors,X)&&z.focus)return z.focus(),1},se=async(z,X={})=>{let ne,ve;const xe=Tr(z);if(t.resolver){const ye=await P(Vt(z)?z:xe);ne=gr(ye),ve=z?!xe.some(Re=>Ce(ye,Re)):ne}else z?(ve=(await Promise.all(xe.map(async ye=>{const Re=Ce(o,ye);return await U(Re&&Re._f?{[ye]:Re}:Re)}))).every(Boolean),!(!ve&&!n.isValid)&&S()):ve=ne=await U(o);return v.state.next({...!hi(z)||(p.isValid||g.isValid)&&ne!==n.isValid?{}:{name:z},...t.resolver||!z?{isValid:ne}:{},errors:n.errors}),X.shouldFocus&&!ve&&jc(o,F,z?xe:d.mount),ve},$=z=>{const X={...l.mount?i:r};return Vt(z)?X:hi(z)?Ce(X,z):z.map(ne=>Ce(X,ne))},q=(z,X)=>({invalid:!!Ce((X||n).errors,z),isDirty:!!Ce((X||n).dirtyFields,z),error:Ce((X||n).errors,z),isValidating:!!Ce(n.validatingFields,z),isTouched:!!Ce((X||n).touchedFields,z)}),te=z=>{z&&Tr(z).forEach(X=>ln(n.errors,X)),v.state.next({errors:z?n.errors:{}})},B=(z,X,ne)=>{const ve=(Ce(o,z,{_f:{}})._f||{}).ref,xe=Ce(n.errors,z)||{},{ref:ye,message:Re,type:Xe,...mt}=xe;Et(n.errors,z,{...mt,...X,ref:ve}),v.state.next({name:z,errors:n.errors,isValid:!1}),ne&&ne.shouldFocus&&ve&&ve.focus&&ve.focus()},J=(z,X)=>Lo(z)?v.state.subscribe({next:ne=>"values"in ne&&z(ae(void 0,X),ne)}):ae(z,X,!0),be=z=>v.state.subscribe({next:X=>{Mee(z.name,X.name,z.exact)&&$ee(X,z.formState||p,ft,z.reRenderRoot)&&z.callback({values:{...i},...n,...X,defaultValues:r})}}).unsubscribe,ge=z=>(l.mount=!0,g={...g,...z.formState},be({...z,formState:g})),ie=(z,X={})=>{for(const ne of z?Tr(z):d.mount)d.mount.delete(ne),d.array.delete(ne),X.keepValue||(ln(o,ne),ln(i,ne)),!X.keepError&&ln(n.errors,ne),!X.keepDirty&&ln(n.dirtyFields,ne),!X.keepTouched&&ln(n.touchedFields,ne),!X.keepIsValidating&&ln(n.validatingFields,ne),!t.shouldUnregister&&!X.keepDefaultValue&&ln(r,ne);v.state.next({values:Lt(i)}),v.state.next({...n,...X.keepDirty?{isDirty:oe()}:{}}),!X.keepIsValid&&S()},me=({disabled:z,name:X})=>{(Gr(z)&&l.mount||z||d.disabled.has(X))&&(z?d.disabled.add(X):d.disabled.delete(X))},ze=(z,X={})=>{let ne=Ce(o,z);const ve=Gr(X.disabled)||Gr(t.disabled);return Et(o,z,{...ne||{},_f:{...ne&&ne._f?ne._f:{ref:{name:z}},name:z,mount:!0,...X}}),d.mount.add(z),ne?me({disabled:Gr(X.disabled)?X.disabled:t.disabled,name:z}):T(z,!0,X.value),{...ve?{disabled:X.disabled||t.disabled}:{},...t.progressive?{required:!!X.required,min:kd(X.min),max:kd(X.max),minLength:kd(X.minLength),maxLength:kd(X.maxLength),pattern:kd(X.pattern)}:{},name:z,onChange:Z,onBlur:Z,ref:xe=>{if(xe){ze(z,X),ne=Ce(o,z);const ye=Vt(xe.value)&&xe.querySelectorAll&&xe.querySelectorAll("input,select,textarea")[0]||xe,Re=Nee(ye),Xe=ne._f.refs||[];if(Re?Xe.find(mt=>mt===ye):ye===ne._f.ref)return;Et(o,z,{_f:{...ne._f,...Re?{refs:[...Xe.filter(Bx),ye,...Array.isArray(Ce(r,z))?[{}]:[]],ref:{type:ye.type,name:z}}:{ref:ye}}}),T(z,!1,void 0,ye)}else ne=Ce(o,z,{}),ne._f&&(ne._f.mount=!1),(t.shouldUnregister||X.shouldUnregister)&&!(WM(d.array,z)&&l.action)&&d.unMount.add(z)}}},Ve=()=>t.shouldFocusError&&jc(o,F,d.mount),Ye=z=>{Gr(z)&&(v.state.next({disabled:z}),jc(o,(X,ne)=>{const ve=Ce(o,ne);ve&&(X.disabled=ve._f.disabled||z,Array.isArray(ve._f.refs)&&ve._f.refs.forEach(xe=>{xe.disabled=ve._f.disabled||z}))},0,!1))},He=(z,X)=>async ne=>{let ve;ne&&(ne.preventDefault&&ne.preventDefault(),ne.persist&&ne.persist());let xe=Lt(i);if(v.state.next({isSubmitting:!0}),t.resolver){const{errors:ye,values:Re}=await I();n.errors=ye,xe=Lt(Re)}else await U(o);if(d.disabled.size)for(const ye of d.disabled)ln(xe,ye);if(ln(n.errors,"root"),gr(n.errors)){v.state.next({errors:{}});try{await z(xe,ne)}catch(ye){ve=ye}}else X&&await X({...n.errors},ne),Ve(),setTimeout(Ve);if(v.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:gr(n.errors)&&!ve,submitCount:n.submitCount+1,errors:n.errors}),ve)throw ve},Ht=(z,X={})=>{Ce(o,z)&&(Vt(X.defaultValue)?M(z,Lt(Ce(r,z))):(M(z,X.defaultValue),Et(r,z,Lt(X.defaultValue))),X.keepTouched||ln(n.touchedFields,z),X.keepDirty||(ln(n.dirtyFields,z),n.isDirty=X.defaultValue?oe(z,Lt(Ce(r,z))):oe()),X.keepError||(ln(n.errors,z),p.isValid&&S()),v.state.next({...n}))},Gt=(z,X={})=>{const ne=z?Lt(z):r,ve=Lt(ne),xe=gr(z),ye=xe?r:ve;if(X.keepDefaultValues||(r=ne),!X.keepValues){if(X.keepDirtyValues){const Re=new Set([...d.mount,...Object.keys(Od(r,i))]);for(const Xe of Array.from(Re))Ce(n.dirtyFields,Xe)?Et(ye,Xe,Ce(i,Xe)):M(Xe,Ce(ye,Xe))}else{if(ZS&&Vt(z))for(const Re of d.mount){const Xe=Ce(o,Re);if(Xe&&Xe._f){const mt=Array.isArray(Xe._f.refs)?Xe._f.refs[0]:Xe._f.ref;if(Lp(mt)){const jt=mt.closest("form");if(jt){jt.reset();break}}}}if(X.keepFieldsRef)for(const Re of d.mount)M(Re,Ce(ye,Re));else o={}}i=t.shouldUnregister?X.keepDefaultValues?Lt(r):{}:Lt(ye),v.array.next({values:{...ye}}),v.state.next({values:{...ye}})}d={mount:X.keepDirtyValues?d.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},l.mount=!p.isValid||!!X.keepIsValid||!!X.keepDirtyValues,l.watch=!!t.shouldUnregister,v.state.next({submitCount:X.keepSubmitCount?n.submitCount:0,isDirty:xe?!1:X.keepDirty?n.isDirty:!!(X.keepDefaultValues&&!Xi(z,r)),isSubmitted:X.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:xe?{}:X.keepDirtyValues?X.keepDefaultValues&&i?Od(r,i):n.dirtyFields:X.keepDefaultValues&&z?Od(r,z):X.keepDirty?n.dirtyFields:{},touchedFields:X.keepTouched?n.touchedFields:{},errors:X.keepErrors?n.errors:{},isSubmitSuccessful:X.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:r})},er=(z,X)=>Gt(Lo(z)?z(i):z,X),Sr=(z,X={})=>{const ne=Ce(o,z),ve=ne&&ne._f;if(ve){const xe=ve.refs?ve.refs[0]:ve.ref;xe.focus&&(xe.focus(),X.shouldSelect&&Lo(xe.select)&&xe.select())}},ft=z=>{n={...n,...z}},yn={control:{register:ze,unregister:ie,getFieldState:q,handleSubmit:He,setError:B,_subscribe:be,_runSchema:I,_focusError:Ve,_getWatch:ae,_getDirty:oe,_setValid:S,_setFieldArray:E,_setDisabledField:me,_setErrors:j,_getFieldArray:de,_reset:Gt,_resetDefaultValues:()=>Lo(t.defaultValues)&&t.defaultValues().then(z=>{er(z,t.resetOptions),v.state.next({isLoading:!1})}),_removeUnmounted:V,_disableForm:Ye,_subjects:v,_proxyFormState:p,get _fields(){return o},get _formValues(){return i},get _state(){return l},set _state(z){l=z},get _defaultValues(){return r},get _names(){return d},set _names(z){d=z},get _formState(){return n},get _options(){return t},set _options(z){t={...t,...z}}},subscribe:ge,trigger:se,register:ze,handleSubmit:He,watch:J,setValue:M,getValues:$,reset:er,resetField:Ht,clearErrors:te,unregister:ie,setError:B,setFocus:Sr,getFieldState:q};return{...yn,formControl:yn}}var $s=()=>{if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},Hx=(e,t,n={})=>n.shouldFocus||Vt(n.shouldFocus)?n.focusName||`${e}.${Vt(n.focusIndex)?t:n.focusIndex}.`:"",Gx=(e,t)=>[...e,...Tr(t)],qx=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Kx(e,t,n){return[...e.slice(0,t),...Tr(n),...e.slice(t)]}var Zx=(e,t,n)=>Array.isArray(e)?(Vt(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],Yx=(e,t)=>[...Tr(t),...Tr(e)];function Lee(e,t){let n=0;const o=[...e];for(const r of t)o.splice(r-n,1),n++;return Zg(o).length?o:[]}var Xx=(e,t)=>Vt(t)?[]:Lee(e,Tr(t).sort((n,o)=>n-o)),Wx=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]},RO=(e,t,n)=>(e[t]=n,e);function aP(e){const t=Uf(),{control:n=t.control,name:o,keyName:r="id",shouldUnregister:i,rules:l}=e,[d,f]=G.useState(n._getFieldArray(o)),m=G.useRef(n._getFieldArray(o).map($s)),p=G.useRef(d),g=G.useRef(!1);p.current=d,n._names.array.add(o),G.useMemo(()=>l&&n.register(o,l),[n,l,o]),Yg(()=>n._subjects.array.subscribe({next:({values:O,name:A})=>{if(A===o||!A){const I=Ce(O,o);Array.isArray(I)&&(f(I),m.current=I.map($s))}}}).unsubscribe,[n,o]);const v=G.useCallback(O=>{g.current=!0,n._setFieldArray(o,O)},[n,o]),b=(O,A)=>{const I=Tr(Lt(O)),P=Gx(n._getFieldArray(o),I);n._names.focus=Hx(o,P.length-1,A),m.current=Gx(m.current,I.map($s)),v(P),f(P),n._setFieldArray(o,P,Gx,{argA:qx(O)})},x=(O,A)=>{const I=Tr(Lt(O)),P=Yx(n._getFieldArray(o),I);n._names.focus=Hx(o,0,A),m.current=Yx(m.current,I.map($s)),v(P),f(P),n._setFieldArray(o,P,Yx,{argA:qx(O)})},S=O=>{const A=Xx(n._getFieldArray(o),O);m.current=Xx(m.current,O),v(A),f(A),!Array.isArray(Ce(n._fields,o))&&Et(n._fields,o,void 0),n._setFieldArray(o,A,Xx,{argA:O})},C=(O,A,I)=>{const P=Tr(Lt(A)),U=Kx(n._getFieldArray(o),O,P);n._names.focus=Hx(o,O,I),m.current=Kx(m.current,O,P.map($s)),v(U),f(U),n._setFieldArray(o,U,Kx,{argA:O,argB:qx(A)})},E=(O,A)=>{const I=n._getFieldArray(o);Wx(I,O,A),Wx(m.current,O,A),v(I),f(I),n._setFieldArray(o,I,Wx,{argA:O,argB:A},!1)},N=(O,A)=>{const I=n._getFieldArray(o);Zx(I,O,A),Zx(m.current,O,A),v(I),f(I),n._setFieldArray(o,I,Zx,{argA:O,argB:A},!1)},j=(O,A)=>{const I=Lt(A),P=RO(n._getFieldArray(o),O,I);m.current=[...P].map((U,V)=>!U||V===O?$s():m.current[V]),v(P),f([...P]),n._setFieldArray(o,P,RO,{argA:O,argB:I},!0,!1)},T=O=>{const A=Tr(Lt(O));m.current=A.map($s),v([...A]),f([...A]),n._setFieldArray(o,[...A],I=>I,{},!0,!1)};return G.useEffect(()=>{if(n._state.action=!1,hw(o,n._names)&&n._subjects.state.next({...n._formState}),g.current&&(!xc(n._options.mode).isOnSubmit||n._formState.isSubmitted)&&!xc(n._options.reValidateMode).isOnSubmit)if(n._options.resolver)n._runSchema([o]).then(O=>{const A=Ce(O.errors,o),I=Ce(n._formState.errors,o);(I?!A&&I.type||A&&(I.type!==A.type||I.message!==A.message):A&&A.type)&&(A?Et(n._formState.errors,o,A):ln(n._formState.errors,o),n._subjects.state.next({errors:n._formState.errors}))});else{const O=Ce(n._fields,o);O&&O._f&&!(xc(n._options.reValidateMode).isOnSubmit&&xc(n._options.mode).isOnSubmit)&&pw(O,n._names.disabled,n._formValues,n._options.criteriaMode===Eo.all,n._options.shouldUseNativeValidation,!0).then(A=>!gr(A)&&n._subjects.state.next({errors:sP(n._formState.errors,A,o)}))}n._subjects.state.next({name:o,values:Lt(n._formValues)}),n._names.focus&&jc(n._fields,(O,A)=>{if(n._names.focus&&A.startsWith(n._names.focus)&&O.focus)return O.focus(),1}),n._names.focus="",n._setValid(),g.current=!1},[d,o,n]),G.useEffect(()=>(!Ce(n._formValues,o)&&n._setFieldArray(o),()=>{const O=(A,I)=>{const P=Ce(n._fields,A);P&&P._f&&(P._f.mount=I)};n._options.shouldUnregister||i?n.unregister(o):O(o,!1)}),[o,n,r,i]),{swap:G.useCallback(E,[v,o,n]),move:G.useCallback(N,[v,o,n]),prepend:G.useCallback(x,[v,o,n]),append:G.useCallback(b,[v,o,n]),remove:G.useCallback(S,[v,o,n]),insert:G.useCallback(C,[v,o,n]),update:G.useCallback(j,[v,o,n]),replace:G.useCallback(T,[v,o,n]),fields:G.useMemo(()=>d.map((O,A)=>({...O,[r]:m.current[A]||$s()})),[d,r])}}function pn(e={}){const t=G.useRef(void 0),n=G.useRef(void 0),[o,r]=G.useState({isDirty:!1,isValidating:!1,isLoading:Lo(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Lo(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:o},e.defaultValues&&!Lo(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:l,...d}=Uee(e);t.current={...d,formState:o}}const i=t.current.control;return i._options=e,Yg(()=>{const l=i._subscribe({formState:i._proxyFormState,callback:()=>r({...i._formState}),reRenderRoot:!0});return r(d=>({...d,isReady:!0})),i._formState.isReady=!0,l},[i]),G.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),G.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),G.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),G.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),G.useEffect(()=>{if(i._proxyFormState.isDirty){const l=i._getDirty();l!==o.isDirty&&i._subjects.state.next({isDirty:l})}},[i,o.isDirty]),G.useEffect(()=>{e.values&&!Xi(e.values,n.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),n.current=e.values,r(l=>({...l}))):i._resetDefaultValues()},[i,e.values]),G.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=QM(o,i),t.current}const gn=Cee,lP=_.createContext({}),cP=_.createContext({});function t0(){const e=_.useContext(lP),t=_.useContext(cP),{getFieldState:n}=Uf(),o=WS({name:e.name}),r=n(e.name,o);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:i}=t;return{id:i,name:e.name,formItemId:`${i}-form-item`,formDescriptionId:`${i}-form-item-description`,formMessageId:`${i}-form-item-message`,...r}}function Ie({...e}){const{error:t,formItemId:n,formDescriptionId:o,formMessageId:r}=t0();return c.jsx(Ww,{"data-slot":"form-control",id:n,"aria-describedby":t?`${o} ${r}`:`${o}`,"aria-invalid":!!t,...e})}function $e({...e}){return c.jsx(lP,{value:{name:e.name},children:c.jsx(jee,{...e})})}function Oe({className:e,...t}){const n=_.useId();return c.jsx(cP,{value:{id:n},children:c.jsx("div",{"data-slot":"form-item",className:De("grid gap-2",e),...t})})}var Fee="Label",uP=_.forwardRef((e,t)=>c.jsx(Pe.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));uP.displayName=Fee;var Vee=uP;function n0({className:e,...t}){return c.jsx(Vee,{"data-slot":"label",className:De("text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}function ke({className:e,...t}){const{error:n,formItemId:o}=t0();return c.jsx(n0,{"data-slot":"form-label","data-error":!!n,className:De("data-[error=true]:text-destructive",e),htmlFor:o,...t})}function Ae({className:e,...t}){const{error:n,formMessageId:o}=t0(),r=n?String(n?.message):t.children;return r?c.jsx("p",{"data-slot":"form-message",id:o,className:De("text-destructive text-sm",e),...t,children:r}):null}function Le({className:e,type:t,...n}){return c.jsx("input",{type:t,"data-slot":"input",className:De(`border-input file:text-foreground placeholder:text-muted-foreground selection:bg-purple
289
289
  selection:text-primary-foreground
290
290
  dark:aria-invalid:outline-destructive dark:aria-invalid:ring-destructive/50 ring-ring/10
291
291
  dark:ring-ring/20 dark:outline-ring/40 outline-ring/50 aria-invalid:outline-destructive/60
@@ -410,7 +410,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
410
410
  focus-visible:ring-1
411
411
  focus-visible:outline-1
412
412
  focus-visible:ring-purple-200
413
- aria-invalid:focus-visible:ring-0`,{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",outline:"border bg-default border-primary border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});var I6="Toggle",$6=_.forwardRef((e,t)=>{const{pressed:n,defaultPressed:o,onPressedChange:r,...i}=e,[l,d]=wi({prop:n,onChange:r,defaultProp:o??!1,caller:I6});return c.jsx(Pe.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:we(e.onClick,()=>{e.disabled||d(!l)})})});$6.displayName=I6;var iye=$6;function sye({className:e,variant:t,size:n,...o}){return c.jsx(iye,{"data-slot":"toggle",className:De(oye({variant:t,size:n,className:e})),...o})}const qk={limit:"100",level:"undefined",from:"",until:"",order:"asc"},aye=[{accessorKey:"level",header:"Status",cell:({row:e})=>{const{level:t}=e.original;return c.jsx(No,{variant:O6(t),children:k6(t)})}},{accessorKey:"timestamp",header:"Date",cell:({row:e})=>{const{timestamp:t}=e.original;return c.jsx("span",{children:new Date(t).toLocaleDateString()})}},{accessorKey:"time",header:"Time",cell:({row:e})=>{const{timestamp:t}=e.original;return c.jsx("span",{children:new Date(t).toLocaleTimeString()})}},{accessorKey:"thread",header:"Thread"},{accessorKey:"node",header:"Node",cell:({row:e})=>{const{node:t}=e.original,n=A6(t);return c.jsx(c.Fragment,{children:t?c.jsxs(q4,{children:[c.jsx(K4,{asChild:!0,children:c.jsxs(No,{variant:n,children:[t.split(".")[0],"..."]})}),c.jsx(Z4,{className:"bg-grey-700",arrowClassName:"bg-grey-700 fill-grey-700",children:t})]}):null})}},{accessorKey:"tags",header:"Tags"},{accessorKey:"message",header:"Message",cell:({row:e})=>{const{message:t}=e.original;return e.getIsSelected(),c.jsx("pre",{children:c.jsx("code",{children:t})})}}],lye=(e,t)=>{if(!e&&!t||!e||!t)return!0;const n=new Date(e),o=new Date(t);return n<=o};function cye(){const[e,t]=_.useState({limit:"100",level:"undefined",from:"",until:"",order:"asc"}),[n,o]=_.useState(!1),[r,i]=_.useState(),[l,d]=_.useState(!1),f=ur(),{data:m,isLoading:p,refetch:g,isFetching:v}=In(tye({logFilters:e,...f,replicated:f.entityType==="cluster",isAutoRefreshEnabled:l})),b=pn({resolver:vn(nye),defaultValues:qk,mode:"onChange"}),x=N=>{i(N.original),o(!0)},S=async N=>{if(!lye(N.from,N.until)){b.setError("from",{type:"onChange",message:"Start date must be before end date"}),b.setError("until",{type:"onChange",message:"End date must be after start date"});return}t(N)},C=async()=>{b.reset(),t(qk)},E=gl(g);return c.jsxs("div",{className:"grid grid-cols-1 gap-4 text-white md:grid-cols-12",children:[c.jsxs("section",{className:"col-span-1 md:col-span-4 lg:col-span-3",children:[c.jsx("h2",{className:"pb-6 text-2xl",children:"Log Filters"}),c.jsx(rye,{form:b,resetFilters:C,submitFilters:S})]}),c.jsx("section",{className:"col-span-1 md:col-span-8 lg:col-span-9",children:p?c.jsx("div",{children:"Loading..."}):c.jsxs("div",{className:"h-32",children:[c.jsxs("div",{className:"flex items-center justify-between md:justify-normal md:space-x-2",children:[c.jsx(_e,{variant:"defaultOutline",onClick:E,disabled:v||p||l,children:c.jsx(Hs,{})}),c.jsxs(sye,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:d,children:[c.jsx(Hs,{}),"Auto Refresh ",l?"On":"Off"]})]}),c.jsx(Qve,{columns:aye,data:m||[],onRowClick:x})]})}),c.jsx(eye,{isModalOpen:n,setIsModalOpen:o,data:r})]})}function uye(e){return et({getParentRoute:()=>e,path:"logs",component:cye})}function dye({entityId:e,instanceClient:t}){return{queryKey:[e,"system_information"],queryFn:async()=>{const{data:n}=await t.post("/",{operation:"system_information",attributes:["network","disk","cpu","memory","system"]});return n}}}function fye(){return c.jsx(mye,{})}function mye(){const e=ur(),{data:t}=$n(dye(e));return c.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-12 min-h-[calc(100vh-theme(spacing.36))]",children:c.jsx(_.Suspense,{fallback:c.jsx(Qr,{}),children:c.jsx("pre",{children:JSON.stringify(t,null," ")})})})}function hye(e){return et({getParentRoute:()=>e,path:"status",component:fye})}function pye(e){const t=Xve(),n=[uye(t),...Iue(t),hye(t),Bfe(t),Wme(t)];return t.addChildren(n)}et({getParentRoute:()=>hv,path:"profile",component:g9(async()=>zS(()=>import("./index-DH061bXP.js"),[]),"ProfileIndex")});const gye=Gg.addChildren([...Hie,hv.addChildren([pye()])]);function vye(){const e=k9(),t=YH(),n=E9({routeTree:gye,history:t,defaultNotFoundComponent:VG,defaultErrorComponent:gS,defaultPreload:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient:ef,authentication:e}});return c.jsxs(c.Fragment,{children:[c.jsx(N9,{router:n,context:{authentication:e}}),!1]})}const yye=({...e})=>c.jsx(pq,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground font-medium",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground font-medium"}},...e});var bye=function(){return null};function xye(){return wie(),xJ(),c.jsxs(c.Fragment,{children:[c.jsxs(OH,{client:ef,children:[c.jsx(vye,{}),c.jsx(bye,{buttonPosition:"bottom-right"})]}),c.jsx(yye,{richColors:!0})]})}var R_={exports:{}},Md={},j_={exports:{}},N_={};/**
413
+ aria-invalid:focus-visible:ring-0`,{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",outline:"border bg-default border-primary border-2 text-white shadow-xs hover:-translate-y-1 transition duration-200 hover:bg-grey-700/40"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});var I6="Toggle",$6=_.forwardRef((e,t)=>{const{pressed:n,defaultPressed:o,onPressedChange:r,...i}=e,[l,d]=wi({prop:n,onChange:r,defaultProp:o??!1,caller:I6});return c.jsx(Pe.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...i,ref:t,onClick:we(e.onClick,()=>{e.disabled||d(!l)})})});$6.displayName=I6;var iye=$6;function sye({className:e,variant:t,size:n,...o}){return c.jsx(iye,{"data-slot":"toggle",className:De(oye({variant:t,size:n,className:e})),...o})}const qk={limit:"100",level:"undefined",from:"",until:"",order:"asc"},aye=[{accessorKey:"level",header:"Status",cell:({row:e})=>{const{level:t}=e.original;return c.jsx(No,{variant:O6(t),children:k6(t)})}},{accessorKey:"timestamp",header:"Date",cell:({row:e})=>{const{timestamp:t}=e.original;return c.jsx("span",{children:new Date(t).toLocaleDateString()})}},{accessorKey:"time",header:"Time",cell:({row:e})=>{const{timestamp:t}=e.original;return c.jsx("span",{children:new Date(t).toLocaleTimeString()})}},{accessorKey:"thread",header:"Thread"},{accessorKey:"node",header:"Node",cell:({row:e})=>{const{node:t}=e.original,n=A6(t);return c.jsx(c.Fragment,{children:t?c.jsxs(q4,{children:[c.jsx(K4,{asChild:!0,children:c.jsxs(No,{variant:n,children:[t.split(".")[0],"..."]})}),c.jsx(Z4,{className:"bg-grey-700",arrowClassName:"bg-grey-700 fill-grey-700",children:t})]}):null})}},{accessorKey:"tags",header:"Tags"},{accessorKey:"message",header:"Message",cell:({row:e})=>{const{message:t}=e.original;return e.getIsSelected(),c.jsx("pre",{children:c.jsx("code",{children:t})})}}],lye=(e,t)=>{if(!e&&!t||!e||!t)return!0;const n=new Date(e),o=new Date(t);return n<=o};function cye(){const[e,t]=_.useState({limit:"100",level:"undefined",from:"",until:"",order:"asc"}),[n,o]=_.useState(!1),[r,i]=_.useState(),[l,d]=_.useState(!1),f=ur(),{data:m,isLoading:p,refetch:g,isFetching:v}=In(tye({logFilters:e,...f,replicated:f.entityType==="cluster",isAutoRefreshEnabled:l})),b=pn({resolver:vn(nye),defaultValues:qk,mode:"onChange"}),x=N=>{i(N.original),o(!0)},S=async N=>{if(!lye(N.from,N.until)){b.setError("from",{type:"onChange",message:"Start date must be before end date"}),b.setError("until",{type:"onChange",message:"End date must be after start date"});return}t(N)},C=async()=>{b.reset(),t(qk)},E=gl(g);return c.jsxs("div",{className:"grid grid-cols-1 gap-4 text-white md:grid-cols-12",children:[c.jsxs("section",{className:"col-span-1 md:col-span-4 lg:col-span-3",children:[c.jsx("h2",{className:"pb-6 text-2xl",children:"Log Filters"}),c.jsx(rye,{form:b,resetFilters:C,submitFilters:S})]}),c.jsx("section",{className:"col-span-1 md:col-span-8 lg:col-span-9",children:p?c.jsx("div",{children:"Loading..."}):c.jsxs("div",{className:"h-32",children:[c.jsxs("div",{className:"flex items-center justify-between md:justify-normal md:space-x-2",children:[c.jsx(_e,{variant:"defaultOutline",onClick:E,disabled:v||p||l,children:c.jsx(Hs,{})}),c.jsxs(sye,{variant:"outline","aria-label":"Toggle Auto Refresh",onPressedChange:d,children:[c.jsx(Hs,{}),"Auto Refresh ",l?"On":"Off"]})]}),c.jsx(Qve,{columns:aye,data:m||[],onRowClick:x})]})}),c.jsx(eye,{isModalOpen:n,setIsModalOpen:o,data:r})]})}function uye(e){return et({getParentRoute:()=>e,path:"logs",component:cye})}function dye({entityId:e,instanceClient:t}){return{queryKey:[e,"system_information"],queryFn:async()=>{const{data:n}=await t.post("/",{operation:"system_information",attributes:["network","disk","cpu","memory","system"]});return n}}}function fye(){return c.jsx(mye,{})}function mye(){const e=ur(),{data:t}=$n(dye(e));return c.jsx("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-12 min-h-[calc(100vh-theme(spacing.36))]",children:c.jsx(_.Suspense,{fallback:c.jsx(Qr,{}),children:c.jsx("pre",{children:JSON.stringify(t,null," ")})})})}function hye(e){return et({getParentRoute:()=>e,path:"status",component:fye})}function pye(e){const t=Xve(),n=[uye(t),...Iue(t),hye(t),Bfe(t),Wme(t)];return t.addChildren(n)}et({getParentRoute:()=>hv,path:"profile",component:g9(async()=>zS(()=>import("./index-CkCHnYs5.js"),[]),"ProfileIndex")});const gye=Gg.addChildren([...Hie,hv.addChildren([pye()])]);function vye(){const e=k9(),t=YH(),n=E9({routeTree:gye,history:t,defaultNotFoundComponent:VG,defaultErrorComponent:gS,defaultPreload:"intent",trailingSlash:"never",defaultPreloadStaleTime:0,scrollRestoration:!0,context:{queryClient:ef,authentication:e}});return c.jsxs(c.Fragment,{children:[c.jsx(N9,{router:n,context:{authentication:e}}),!1]})}const yye=({...e})=>c.jsx(pq,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground font-medium",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground font-medium"}},...e});var bye=function(){return null};function xye(){return wie(),xJ(),c.jsxs(c.Fragment,{children:[c.jsxs(OH,{client:ef,children:[c.jsx(vye,{}),c.jsx(bye,{buttonPosition:"bottom-right"})]}),c.jsx(yye,{richColors:!0})]})}var R_={exports:{}},Md={},j_={exports:{}},N_={};/**
414
414
  * @license React
415
415
  * scheduler.production.js
416
416
  *