@syncular/console 0.0.6-246 → 0.0.6-247

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.
@@ -0,0 +1,30 @@
1
+ var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,d=globalThis,f=`10.47.0`;function p(){return m(d),d}function m(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||`10.47.0`,t[f]=t[`10.47.0`]||{}}function h(e,t,n=d){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[f]=r[`10.47.0`]||{};return i[e]||(i[e]=t())}var g=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],_=`Sentry Logger `,v={};function y(e){if(!(`console`in d))return e();let t=d.console,n={},r=Object.keys(v);r.forEach(e=>{let r=v[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function b(){D().enabled=!0}function x(){D().enabled=!1}function S(){return D().enabled}function C(...e){E(`log`,...e)}function w(...e){E(`warn`,...e)}function T(...e){E(`error`,...e)}function E(e,...t){u&&S()&&y(()=>{d.console[e](`${_}[${e}]:`,...t)})}function D(){return u?h(`loggerSettings`,()=>({enabled:!1})):{enabled:!1}}var O={enable:b,disable:x,isEnabled:S,log:C,warn:w,error:T},k=50,A=/\(error: (.*)\)/,j=/captureMessage|captureException/;function M(...e){let t=e.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return(e,n=0,r=0)=>{let i=[],a=e.split(`
2
+ `);for(let e=n;e<a.length;e++){let n=a[e];n.length>1024&&(n=n.slice(0,1024));let o=A.test(n)?n.replace(A,`$1`):n;if(!o.match(/\S*Error: /)){for(let e of t){let t=e(o);if(t){i.push(t);break}}if(i.length>=k+r)break}}return P(i.slice(r))}}function N(e){return Array.isArray(e)?M(...e):e}function P(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(F(t).function||``)&&t.pop(),t.reverse(),j.test(F(t).function||``)&&(t.pop(),j.test(F(t).function||``)&&t.pop()),t.slice(0,k).map(e=>({...e,filename:e.filename||F(t).filename,function:e.function||`?`}))}function F(e){return e[e.length-1]||{}}var I=`<anonymous>`;function L(e){try{return!e||typeof e!=`function`?I:e.name||I}catch{return I}}function ee(e){let t=e.exception;if(t){let e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}function R(e){return`__v_isVNode`in e&&e.__v_isVNode?`[VueVNode]`:`[VueViewModel]`}var z={},B={};function V(e,t){z[e]=z[e]||[],z[e].push(t)}function H(e,t){if(!B[e]){B[e]=!0;try{t()}catch(t){u&&O.error(`Error while instrumenting ${e}`,t)}}}function U(e,t){let n=e&&z[e];if(n)for(let r of n)try{r(t)}catch(t){u&&O.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${L(r)}\nError:`,t)}}var W=null;function te(e){let t=`error`;V(t,e),H(t,ne)}function ne(){W=d.onerror,d.onerror=function(e,t,n,r,i){return U(`error`,{column:r,error:i,line:n,msg:e,url:t}),W?W.apply(this,arguments):!1},d.onerror.__SENTRY_INSTRUMENTED__=!0}var re=null;function ie(e){let t=`unhandledrejection`;V(t,e),H(t,ae)}function ae(){re=d.onunhandledrejection,d.onunhandledrejection=function(e){return U(`unhandledrejection`,e),re?re.apply(this,arguments):!0},d.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var oe=Object.prototype.toString;function se(e){switch(oe.call(e)){case`[object Error]`:case`[object Exception]`:case`[object DOMException]`:case`[object WebAssembly.Exception]`:return!0;default:return xe(e,Error)}}function ce(e,t){return oe.call(e)===`[object ${t}]`}function le(e){return ce(e,`ErrorEvent`)}function ue(e){return ce(e,`DOMError`)}function de(e){return ce(e,`DOMException`)}function fe(e){return ce(e,`String`)}function pe(e){return typeof e==`object`&&!!e&&`__sentry_template_string__`in e&&`__sentry_template_values__`in e}function me(e){return e===null||pe(e)||typeof e!=`object`&&typeof e!=`function`}function he(e){return ce(e,`Object`)}function ge(e){return typeof Event<`u`&&xe(e,Event)}function _e(e){return typeof Element<`u`&&xe(e,Element)}function ve(e){return ce(e,`RegExp`)}function ye(e){return!!(e?.then&&typeof e.then==`function`)}function be(e){return he(e)&&`nativeEvent`in e&&`preventDefault`in e&&`stopPropagation`in e}function xe(e,t){try{return e instanceof t}catch{return!1}}function Se(e){return!!(typeof e==`object`&&e&&(e.__isVue||e._isVue||e.__v_isVNode))}function Ce(e){return typeof Request<`u`&&xe(e,Request)}var we=d,Te=80;function Ee(e,t={}){if(!e)return`<unknown>`;try{let n=e,r=[],i=0,a=0,o,s=Array.isArray(t)?t:t.keyAttrs,c=!Array.isArray(t)&&t.maxStringLength||Te;for(;n&&i++<5&&(o=De(n,s),!(o===`html`||i>1&&a+r.length*3+o.length>=c));)r.push(o),a+=o.length,n=n.parentNode;return r.reverse().join(` > `)}catch{return`<unknown>`}}function De(e,t){let n=e,r=[];if(!n?.tagName)return``;if(we.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let i=t?.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;if(i?.length)i.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let e=n.className;if(e&&fe(e)){let t=e.split(/\s+/);for(let e of t)r.push(`.${e}`)}}for(let e of[`aria-label`,`type`,`name`,`title`,`alt`]){let t=n.getAttribute(e);t&&r.push(`[${e}="${t}"]`)}return r.join(``)}function Oe(){try{return we.document.location.href}catch{return``}}function ke(e){if(!we.HTMLElement)return null;let t=e;for(let e=0;e<5;e++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function Ae(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!=`function`)return;let i=n(r);typeof i==`function`&&Me(i,r);try{e[t]=i}catch{u&&O.log(`Failed to replace method "${t}" in object`,e)}}function je(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{u&&O.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Me(e,t){try{e.prototype=t.prototype=t.prototype||{},je(e,`__sentry_original__`,t)}catch{}}function Ne(e){return e.__sentry_original__}function Pe(e){if(se(e))return{message:e.message,name:e.name,stack:e.stack,...Ie(e)};if(ge(e)){let t={type:e.type,target:Fe(e.target),currentTarget:Fe(e.currentTarget),...Ie(e)};return typeof CustomEvent<`u`&&xe(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Fe(e){try{return _e(e)?Ee(e):Object.prototype.toString.call(e)}catch{return`<unknown>`}}function Ie(e){return typeof e==`object`&&e?Object.fromEntries(Object.entries(e)):{}}function Le(e){let t=Object.keys(Pe(e));return t.sort(),t[0]?t.join(`, `):`[object has no keys]`}var Re;function ze(e){if(Re!==void 0)return Re?Re(e):e();let t=Symbol.for(`__SENTRY_SAFE_RANDOM_ID_WRAPPER__`),n=d;return t in n&&typeof n[t]==`function`?(Re=n[t],Re(e)):(Re=null,e())}function Be(){return ze(()=>Math.random())}function Ve(){return ze(()=>Date.now())}function He(e,t=0){return typeof e!=`string`||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Ue(e,t){if(!Array.isArray(e))return``;let n=[];for(let t=0;t<e.length;t++){let r=e[t];try{Se(r)?n.push(R(r)):n.push(String(r))}catch{n.push(`[value cannot be serialized]`)}}return n.join(t)}function We(e,t,n=!1){return fe(e)?ve(t)?t.test(e):fe(t)?n?e===t:e.includes(t):!1:!1}function Ge(e,t=[],n=!1){return t.some(t=>We(e,t,n))}function Ke(){let e=d;return e.crypto||e.msCrypto}var qe;function Je(){return Be()*16}function Ye(e=Ke()){try{if(e?.randomUUID)return ze(()=>e.randomUUID()).replace(/-/g,``)}catch{}return qe||=`10000000100040008000100000000000`,qe.replace(/[018]/g,e=>(e^(Je()&15)>>e/4).toString(16))}function Xe(e){return e.exception?.values?.[0]}function Ze(e){let{message:t,event_id:n}=e;if(t)return t;let r=Xe(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||`<unknown>`:n||`<unknown>`}function Qe(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],a=i[0]=i[0]||{};a.value||=t||``,a.type||=n||`Error`}function $e(e,t){let n=Xe(e);if(!n)return;let r={type:`generic`,handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...t},t&&`data`in t){let e={...i?.data,...t.data};n.mechanism.data=e}}function et(e){if(tt(e))return!0;try{je(e,`__sentry_captured__`,!0)}catch{}return!1}function tt(e){try{return e.__sentry_captured__}catch{}}var nt=1e3;function rt(){return Ve()/nt}function it(){let{performance:e}=d;if(!e?.now||!e.timeOrigin)return rt;let t=e.timeOrigin;return()=>(t+ze(()=>e.now()))/nt}var at;function ot(){return(at??=it())()}var st=null;function ct(){let{performance:e}=d;if(!e?.now)return;let t=3e5,n=ze(()=>e.now()),r=Ve(),i=e.timeOrigin;if(typeof i==`number`&&Math.abs(i+n-r)<t)return i;let a=e.timing?.navigationStart;return typeof a==`number`&&Math.abs(a+n-r)<t?a:r-n}function lt(){return st===null&&(st=ct()),st}function ut(e){let t=ot(),n={sid:Ye(),init:!0,timestamp:t,started:t,duration:0,status:`ok`,errors:0,ignoreDuration:!1,toJSON:()=>pt(n)};return e&&dt(n,e),n}function dt(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||ot(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:Ye()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started==`number`&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration==`number`)e.duration=t.duration;else{let t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors==`number`&&(e.errors=t.errors),t.status&&(e.status=t.status)}function ft(e,t){let n={};t?n={status:t}:e.status===`ok`&&(n={status:`exited`}),dt(e,n)}function pt(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did==`number`||typeof e.did==`string`?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function mt(e,t,n=2){if(!t||typeof t!=`object`||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=mt(r[e],t[e],n-1));return r}function ht(){return Ye()}function gt(){return Ye().substring(16)}var _t=`_sentrySpan`;function vt(e,t){t?je(e,_t,t):delete e[_t]}function yt(e){return e[_t]}var bt=100,xt=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:ht(),sampleRand:Be()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,vt(t,yt(this)),t}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&dt(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return t===null?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t==`function`?t(this):t,{tags:r,attributes:i,extra:a,user:o,contexts:s,level:c,fingerprint:l=[],propagationContext:u,conversationId:d}=(n instanceof e?n.getScopeData():he(n)?t:void 0)||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,vt(this,void 0),this._attachments=[],this.setPropagationContext({traceId:ht(),sampleRand:Be()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){let n=typeof t==`number`?t:bt;if(n<=0)return this;let r={timestamp:rt(),...e,message:e.message?He(e.message,2048):e.message};return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent(`buffer_overflow`,`log_item`)),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:yt(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=mt(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){let n=t?.event_id||Ye();if(!this._client)return u&&O.warn(`No client configured on scope - will not capture exception!`),n;let r=Error(`Sentry syntheticException`);return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){let r=n?.event_id||Ye();if(!this._client)return u&&O.warn(`No client configured on scope - will not capture message!`),r;let i=n?.syntheticException??Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...n,event_id:r},this),r}captureEvent(e,t){let n=e.event_id||t?.event_id||Ye();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(u&&O.warn(`No client configured on scope - will not capture event!`),n)}_notifyScopeListeners(){this._notifyingListeners||=(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),!1)}};function St(){return h(`defaultCurrentScope`,()=>new xt)}function Ct(){return h(`defaultIsolationScope`,()=>new xt)}var wt=e=>e instanceof Promise&&!e[Tt],Tt=Symbol(`chained PromiseLike`),Et=(e,t,n)=>{let r=e.then(e=>(t(e),e),e=>{throw n(e),e});return wt(r)&&wt(e)?r:Dt(e,r)},Dt=(e,t)=>{let n=!1;for(let r in e){if(r in t)continue;n=!0;let i=e[r];typeof i==`function`?Object.defineProperty(t,r,{value:(...t)=>i.apply(e,t),enumerable:!0,configurable:!0,writable:!0}):t[r]=i}return n&&Object.assign(t,{[Tt]:!0}),t},Ot=class{constructor(e,t){let n;n=e||new xt;let r;r=t||new xt,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){let t=this._pushScope(),n;try{n=e(t)}catch(e){throw this._popScope(),e}return ye(n)?Et(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function kt(){let e=m(p());return e.stack=e.stack||new Ot(St(),Ct())}function At(e){return kt().withScope(e)}function jt(e,t){let n=kt();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Mt(e){return kt().withScope(()=>e(kt().getIsolationScope()))}function Nt(){return{withIsolationScope:Mt,withScope:At,withSetScope:jt,withSetIsolationScope:(e,t)=>Mt(t),getCurrentScope:()=>kt().getScope(),getIsolationScope:()=>kt().getIsolationScope()}}function Pt(e){let t=m(e);return t.acs?t.acs:Nt()}var Ft;function It(){return Ft?.()}function Lt(){return Ft!==void 0}function Rt(){return Pt(p()).getCurrentScope()}function zt(){return Pt(p()).getIsolationScope()}function Bt(){return h(`globalScope`,()=>new xt)}function Vt(...e){let t=Pt(p());if(e.length===2){let[n,r]=e;return n?t.withSetScope(n,r):t.withScope(r)}return t.withScope(e[0])}function Ht(){return Rt().getClient()}function Ut(e){let t=It();if(t)return{trace_id:t.traceId,span_id:t.spanId};let{traceId:n,parentSpanId:r,propagationSpanId:i}=e.getPropagationContext(),a={trace_id:n,span_id:i||gt()};return r&&(a.parent_span_id=r),a}var Wt=`sentry.source`,Gt=`sentry.sample_rate`,Kt=`sentry.previous_trace_sample_rate`,qt=`sentry.op`,Jt=`sentry.origin`,Yt=`sentry.idle_span_finish_reason`,Xt=`sentry.measurement_unit`,Zt=`sentry.measurement_value`,Qt=`sentry.custom_span_name`,$t=`sentry.profile_id`,en=`sentry.exclusive_time`,tn=`sentry.link.type`,nn=`gen_ai.conversation.id`;function rn(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:`unauthenticated`};case 403:return{code:2,message:`permission_denied`};case 404:return{code:2,message:`not_found`};case 409:return{code:2,message:`already_exists`};case 413:return{code:2,message:`failed_precondition`};case 429:return{code:2,message:`resource_exhausted`};case 499:return{code:2,message:`cancelled`};default:return{code:2,message:`invalid_argument`}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:`unimplemented`};case 503:return{code:2,message:`unavailable`};case 504:return{code:2,message:`deadline_exceeded`};default:return{code:2,message:`internal_error`}}return{code:2,message:`internal_error`}}function an(e,t){e.setAttribute(`http.response.status_code`,t);let n=rn(t);n.message!==`unknown_error`&&e.setStatus(n)}var on=`_sentryScope`,sn=`_sentryIsolationScope`;function cn(e){try{let t=d.WeakRef;if(typeof t==`function`)return new t(e)}catch{}return e}function ln(e){if(e){if(typeof e==`object`&&`deref`in e&&typeof e.deref==`function`)try{return e.deref()}catch{return}return e}}function un(e,t,n){e&&(je(e,sn,cn(n)),je(e,on,t))}function dn(e){let t=e;return{scope:t[on],isolationScope:ln(t[sn])}}var fn=`sentry-`;function pn(e){let t=hn(e);if(!t)return;let n=Object.entries(t).reduce((e,[t,n])=>{if(t.startsWith(`sentry-`)){let r=t.slice(7);e[r]=n}return e},{});if(Object.keys(n).length>0)return n}function mn(e){if(e)return _n(Object.entries(e).reduce((e,[t,n])=>(n&&(e[`${fn}${t}`]=n),e),{}))}function hn(e){if(!(!e||!fe(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{let n=gn(t);return Object.entries(n).forEach(([t,n])=>{e[t]=n}),e},{}):gn(e)}function gn(e){return e.split(`,`).map(e=>{let t=e.indexOf(`=`);return t===-1?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,[t,n])=>(t&&n&&(e[t]=n),e),{})}function _n(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((e,[t,n],r)=>{let i=`${encodeURIComponent(t)}=${encodeURIComponent(n)}`,a=r===0?i:`${e},${i}`;return a.length>8192?(u&&O.warn(`Not adding key: ${t} with val: ${n} to baggage header due to exceeding baggage size limits.`),e):a},``)}var vn=/^o(\d+)\./,yn=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function bn(e){return e===`http`||e===`https`}function xn(e,t=!1){let{host:n,path:r,pass:i,port:a,projectId:o,protocol:s,publicKey:c}=e;return`${s}://${c}${t&&i?`:${i}`:``}@${n}${a?`:${a}`:``}/${r&&`${r}/`}${o}`}function Sn(e){let t=yn.exec(e);if(!t){y(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i=``,a=``,o=``,s=``]=t.slice(1),c=``,l=s,u=l.split(`/`);if(u.length>1&&(c=u.slice(0,-1).join(`/`),l=u.pop()),l){let e=l.match(/^\d+/);e&&(l=e[0])}return Cn({host:a,pass:i,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function Cn(e){return{protocol:e.protocol,publicKey:e.publicKey||``,pass:e.pass||``,host:e.host,port:e.port||``,path:e.path||``,projectId:e.projectId}}function wn(e){if(!u)return!0;let{port:t,projectId:n,protocol:r}=e;return[`protocol`,`publicKey`,`host`,`projectId`].find(t=>e[t]?!1:(O.error(`Invalid Sentry Dsn: ${t} missing`),!0))?!1:n.match(/^\d+$/)?bn(r)?t&&isNaN(parseInt(t,10))?(O.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(O.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(O.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Tn(e){return e.match(vn)?.[1]}function En(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=Tn(n)),r}function Dn(e){let t=typeof e==`string`?Sn(e):Cn(e);if(!(!t||!wn(t)))return t}function On(e){if(typeof e==`boolean`)return Number(e);let t=typeof e==`string`?parseFloat(e):e;if(!(typeof t!=`number`||isNaN(t)||t<0||t>1))return t}var kn=RegExp(`^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$`);function An(e){if(!e)return;let t=e.match(kn);if(!t)return;let n;return t[3]===`1`?n=!0:t[3]===`0`&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function jn(e,t){let n=An(e),r=pn(t);if(!n?.traceId)return{traceId:ht(),sampleRand:Be()};let i=Pn(n,r);r&&(r.sample_rand=i.toString());let{traceId:a,parentSpanId:o,parentSampled:s}=n;return{traceId:a,parentSpanId:o,sampled:s,dsc:r||{},sampleRand:i}}function Mn(e=ht(),t=gt(),n){let r=``;return n!==void 0&&(r=n?`-1`:`-0`),`${e}-${t}${r}`}function Nn(e=ht(),t=gt(),n){return`00-${e}-${t}-${n?`01`:`00`}`}function Pn(e,t){let n=On(t?.sample_rand);if(n!==void 0)return n;let r=On(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?Be()*r:r+Be()*(1-r):Be()}var Fn=!1;function In(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:a,status:o,origin:s,links:c}=Un(e);return{parent_span_id:a,span_id:t,trace_id:n,data:r,op:i,status:o,origin:s,links:c}}function Ln(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),i=r?t:Un(e).parent_span_id,a=dn(e).scope;return{parent_span_id:i,span_id:r?a?.getPropagationContext().propagationSpanId||gt():t,trace_id:n}}function Rn(e){let{traceId:t,spanId:n}=e.spanContext();return Mn(t,n,Kn(e))}function zn(e){let{traceId:t,spanId:n}=e.spanContext();return Nn(t,n,Kn(e))}function Bn(e){if(e&&e.length>0)return e.map(({context:{spanId:e,traceId:t,traceFlags:n,...r},attributes:i})=>({span_id:e,trace_id:t,sampled:n===1,attributes:i,...r}))}function Vn(e){return typeof e==`number`?Hn(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Hn(e.getTime()):ot()}function Hn(e){return e>9999999999?e/1e3:e}function Un(e){if(Gn(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(Wn(e)){let{attributes:r,startTime:i,name:a,endTime:o,status:s,links:c}=e;return{span_id:t,trace_id:n,data:r,description:a,parent_span_id:`parentSpanId`in e?e.parentSpanId:`parentSpanContext`in e?e.parentSpanContext?.spanId:void 0,start_timestamp:Vn(i),timestamp:Vn(o)||void 0,status:qn(s),op:r[qt],origin:r[Jt],links:Bn(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Wn(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Gn(e){return typeof e.getSpanJSON==`function`}function Kn(e){let{traceFlags:t}=e.spanContext();return t===1}function qn(e){if(!(!e||e.code===0))return e.code===1?`ok`:e.message||`internal_error`}var Jn=`_sentryChildSpans`,Yn=`_sentryRootSpan`;function Xn(e,t){je(t,Yn,e[Yn]||e),e[Jn]?e[Jn].add(t):je(e,Jn,new Set([t]))}function Zn(e,t){e[Jn]&&e[Jn].delete(t)}function Qn(e){let t=new Set;function n(e){if(!t.has(e)&&Kn(e)){t.add(e);let r=e[Jn]?Array.from(e[Jn]):[];for(let e of r)n(e)}}return n(e),Array.from(t)}function $n(e){return e[Yn]||e}function er(){let e=Pt(p());return e.getActiveSpan?e.getActiveSpan():yt(Rt())}function tr(){Fn||=(y(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),!0)}var nr=!1;function rr(){if(nr)return;function e(){let e=er(),t=e&&$n(e);if(t){let e=`internal_error`;u&&O.log(`[Tracing] Root span: ${e} -> Global error occurred`),t.setStatus({code:2,message:e})}}e.tag=`sentry_tracingErrorCallback`,nr=!0,te(e),ie(e)}function ir(e){if(typeof __SENTRY_TRACING__==`boolean`&&!__SENTRY_TRACING__)return!1;let t=e||Ht()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function ar(e){O.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function or(e,t){if(!t?.length||!e.description)return!1;for(let n of t){if(cr(n)){if(We(e.description,n))return u&&ar(e),!0;continue}if(!n.name&&!n.op)continue;let t=n.name?We(e.description,n.name):!0,r=n.op?e.op&&We(e.op,n.op):!0;if(t&&r)return u&&ar(e),!0}return!1}function sr(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function cr(e){return typeof e==`string`||e instanceof RegExp}var lr=`production`,ur=`_frozenDsc`;function dr(e,t){je(e,ur,t)}function fr(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i={environment:n.environment||`production`,release:n.release,public_key:r,trace_id:e,org_id:En(t)};return t.emit(`createDsc`,i),i}function pr(e,t){let n=t.getPropagationContext();return n.dsc||fr(n.traceId,e)}function mr(e){let t=Ht();if(!t)return{};let n=$n(e),r=Un(n),i=r.data,a=n.spanContext().traceState,o=a?.get(`sentry.sample_rate`)??i[`sentry.sample_rate`]??i[`sentry.previous_trace_sample_rate`];function s(e){return(typeof o==`number`||typeof o==`string`)&&(e.sample_rate=`${o}`),e}let c=n[ur];if(c)return s(c);let l=a?.get(`sentry.dsc`),u=l&&pn(l);if(u)return s(u);let d=fr(e.spanContext().traceId,t),f=i[Wt],p=r.description;return f!==`url`&&p&&(d.transaction=p),ir()&&(d.sampled=String(Kn(n)),d.sample_rand=a?.get(`sentry.sample_rand`)??dn(n).scope?.getPropagationContext().sampleRand.toString()),s(d),t.emit(`createDsc`,d,n),d}var hr=class{constructor(e={}){this._traceId=e.traceId||ht(),this._spanId=e.spanId||gt()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}};function gr(e,t=100,n=1/0){try{return vr(``,e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function _r(e,t=3,n=100*1024){let r=gr(e,t);return Sr(r)>n?_r(e,t-1,n):r}function vr(e,t,n=1/0,r=1/0,i=Cr()){let[a,o]=i;if(t==null||[`boolean`,`string`].includes(typeof t)||typeof t==`number`&&Number.isFinite(t))return t;let s=yr(e,t);if(!s.startsWith(`[object `))return s;if(t.__sentry_skip_normalization__)return t;let c=typeof t.__sentry_override_normalization_depth__==`number`?t.__sentry_override_normalization_depth__:n;if(c===0)return s.replace(`object `,``);if(a(t))return`[Circular ~]`;let l=t;if(l&&typeof l.toJSON==`function`)try{return vr(``,l.toJSON(),c-1,r,i)}catch{}let u=Array.isArray(t)?[]:{},d=0,f=Pe(t);for(let e in f){if(!Object.prototype.hasOwnProperty.call(f,e))continue;if(d>=r){u[e]=`[MaxProperties ~]`;break}let t=f[e];u[e]=vr(e,t,c-1,r,i),d++}return o(t),u}function yr(e,t){try{if(e===`domain`&&t&&typeof t==`object`&&t._events)return`[Domain]`;if(e===`domainEmitter`)return`[DomainEmitter]`;if(typeof global<`u`&&t===global)return`[Global]`;if(typeof window<`u`&&t===window)return`[Window]`;if(typeof document<`u`&&t===document)return`[Document]`;if(Se(t))return R(t);if(be(t))return`[SyntheticEvent]`;if(typeof t==`number`&&!Number.isFinite(t))return`[${t}]`;if(typeof t==`function`)return`[Function: ${L(t)}]`;if(typeof t==`symbol`)return`[${String(t)}]`;if(typeof t==`bigint`)return`[BigInt: ${String(t)}]`;let n=br(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(e){return`**non-serializable** (${e})`}}function br(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:`null prototype`}function xr(e){return~-encodeURI(e).split(/%..|./).length}function Sr(e){return xr(JSON.stringify(e))}function Cr(){let e=new WeakSet;function t(t){return e.has(t)?!0:(e.add(t),!1)}function n(t){e.delete(t)}return[t,n]}function wr(e,t=[]){return[e,t]}function Tr(e,t){let[n,r]=e;return[n,[...r,t]]}function Er(e,t){let n=e[1];for(let e of n){let n=e[0].type;if(t(e,n))return!0}return!1}function Dr(e,t){return Er(e,(e,n)=>t.includes(n))}function Or(e){let t=m(d);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function kr(e){let[t,n]=e,r=JSON.stringify(t);function i(e){typeof r==`string`?r=typeof e==`string`?r+e:[Or(r),e]:r.push(typeof e==`string`?Or(e):e)}for(let e of n){let[t,n]=e;if(i(`\n${JSON.stringify(t)}\n`),typeof n==`string`||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(gr(n))}i(e)}}return typeof r==`string`?r:Ar(r)}function Ar(e){let t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function jr(e){return[{type:`span`},e]}function Mr(e){let t=typeof e.data==`string`?Or(e.data):e.data;return[{type:`attachment`,length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var Nr={sessions:`session`,event:`error`,client_report:`internal`,user_report:`default`,profile_chunk:`profile`,replay_event:`replay`,replay_recording:`replay`,check_in:`monitor`,raw_security:`security`,log:`log_item`,trace_metric:`metric`};function Pr(e){return e in Nr}function Fr(e){return Pr(e)?Nr[e]:e}function Ir(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Lr(e,t,n,r){let i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:xn(r)},...i&&{trace:i}}}function Rr(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function zr(e,t,n,r){let i=Ir(n);return wr({sent_at:new Date().toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:xn(t)}},[`aggregates`in e?[{type:`sessions`},e]:[{type:`session`},e.toJSON()]])}function Br(e,t,n,r){let i=Ir(n),a=e.type&&e.type!==`replay_event`?e.type:`event`;Rr(e,n?.sdk);let o=Lr(e,i,r,t);return delete e.sdkProcessingMetadata,wr(o,[[{type:a},e]])}function Vr(e,t){function n(e){return!!e.trace_id&&!!e.public_key}let r=mr(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,o={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!a&&i&&{dsn:xn(i)}},{beforeSendSpan:s,ignoreSpans:c}=t?.getOptions()||{},l=c?.length?e.filter(e=>!or(Un(e),c)):e,u=e.length-l.length;u&&t?.recordDroppedEvent(`before_send`,`span`,u);let d=s?e=>{let t=Un(e);return s(t)||(tr(),t)}:Un,f=[];for(let e of l){let t=d(e);t&&f.push(jr(t))}return wr(o,f)}function Hr(e){if(!u)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`,parent_span_id:r}=Un(e),{spanId:i}=e.spanContext(),a=Kn(e),o=$n(e),s=o===e,c=`[Tracing] Starting ${a?`sampled`:`unsampled`} ${s?`root `:``}span`,l=[`op: ${n}`,`name: ${t}`,`ID: ${i}`];if(r&&l.push(`parent ID: ${r}`),!s){let{op:e,description:t}=Un(o);l.push(`root ID: ${o.spanContext().spanId}`),e&&l.push(`root op: ${e}`),t&&l.push(`root description: ${t}`)}O.log(`${c}
3
+ ${l.join(`
4
+ `)}`)}function Ur(e){if(!u)return;let{description:t=`< unknown name >`,op:n=`< unknown op >`}=Un(e),{spanId:r}=e.spanContext(),i=`[Tracing] Finishing "${n}" ${$n(e)===e?`root `:``}span "${t}" with ID ${r}`;O.log(i)}function Wr(e,t,n,r=er()){let i=r&&$n(r);i&&(u&&O.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[Zt]:t,[Xt]:n}))}function Gr(e){if(!e||e.length===0)return;let t={};return e.forEach(e=>{let n=e.attributes||{},r=n[Xt],i=n[Zt];typeof r==`string`&&typeof i==`number`&&(t[e.name]={value:i,unit:r})}),t}var Kr=1e3,qr=class{constructor(e={}){this._traceId=e.traceId||ht(),this._spanId=e.spanId||gt(),this._startTime=e.startTimestamp||ot(),this._links=e.links,this._attributes={},this.setAttributes({[Jt]:`manual`,[qt]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),`sampled`in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,t){}spanContext(){let{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:+!!n}}setAttribute(e,t){return t===void 0?delete this._attributes[e]:this._attributes[e]=t,this}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._startTime=Vn(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(Wt,`custom`),this}end(e){this._endTime||(this._endTime=Vn(e),Ur(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[qt],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:qn(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[Jt],profile_id:this._attributes[$t],exclusive_time:this._attributes[en],measurements:Gr(this._events),is_segment:this._isStandaloneSpan&&$n(this)===this||void 0,segment_id:this._isStandaloneSpan?$n(this).spanContext().spanId:void 0,links:Bn(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,n){u&&O.log(`[Tracing] Adding an event to span:`,e);let r=Jr(t)?t:n||ot(),i=Jr(t)?{}:t||{},a={name:e,time:Vn(r),attributes:i};return this._events.push(a),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=Ht();if(e&&e.emit(`spanEnd`,this),!(this._isStandaloneSpan||this===$n(this)))return;if(this._isStandaloneSpan){this._sampled?Zr(Vr([this],e)):(u&&O.log(`[Tracing] Discarding standalone span because its trace was not chosen to be sampled.`),e&&e.recordDroppedEvent(`sample_rate`,`span`));return}let t=this._convertSpanToTransaction();t&&(dn(this).scope||Rt()).captureEvent(t)}_convertSpanToTransaction(){if(!Yr(Un(this)))return;this._name||=(u&&O.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),`<unlabeled transaction>`);let{scope:e,isolationScope:t}=dn(this),n=e?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let r=Qn(this).filter(e=>e!==this&&!Xr(e)).map(e=>Un(e)).filter(Yr),i=this._attributes[Wt];delete this._attributes[Qt],r.forEach(e=>{delete e.data[Qt]});let a={contexts:{trace:In(this)},spans:r.length>Kr?r.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,Kr):r,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:`transaction`,sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:t,dynamicSamplingContext:mr(this)},request:n,...i&&{transaction_info:{source:i}}},o=Gr(this._events);return o&&Object.keys(o).length&&(u&&O.log(`[Measurements] Adding measurements to transaction event`,JSON.stringify(o,void 0,2)),a.measurements=o),a}};function Jr(e){return e&&typeof e==`number`||e instanceof Date||Array.isArray(e)}function Yr(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function Xr(e){return e instanceof qr&&e.isStandaloneSpan()}function Zr(e){let t=Ht();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent(`before_send`,`span`);return}t.sendEnvelope(e)}function Qr(e,t,n=()=>{},r=()=>{}){let i;try{i=e()}catch(e){throw t(e),n(),e}return $r(i,t,n,r)}function $r(e,t,n,r){return ye(e)?Et(e,e=>{n(),r(e)},e=>{t(e),n()}):(n(),r(e),e)}function ei(e,t,n){if(!ir(e))return[!1];let r,i;typeof e.tracesSampler==`function`?(i=e.tracesSampler({...t,inheritOrSampleWith:e=>typeof t.parentSampleRate==`number`?t.parentSampleRate:typeof t.parentSampled==`boolean`?Number(t.parentSampled):e}),r=!0):t.parentSampled===void 0?e.tracesSampleRate!==void 0&&(i=e.tracesSampleRate,r=!0):i=t.parentSampled;let a=On(i);if(a===void 0)return u&&O.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(i)} of type ${JSON.stringify(typeof i)}.`),[!1];if(!a)return u&&O.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler==`function`?`tracesSampler returned 0 or false`:`a negative sampling decision was inherited or tracesSampleRate is set to 0`}`),[!1,a,r];let o=n<a;return o||u&&O.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[o,a,r]}var ti=`__SENTRY_SUPPRESS_TRACING__`;function ni(e,t){let n=si();if(n.startSpan)return n.startSpan(e,t);let r=oi(e),{forceTransaction:i,parentSpan:a,scope:o}=e,s=o?.clone();return Vt(s,()=>di(a)(()=>{let n=Rt(),o=ui(n,a),s=e.onlyIfParent&&!o?new hr:ai({parentSpan:o,spanArguments:r,forceTransaction:i,scope:n});return vt(n,s),Qr(()=>t(s),()=>{let{status:e}=Un(s);s.isRecording()&&(!e||e===`ok`)&&s.setStatus({code:2,message:`internal_error`})},()=>{s.end()})}))}function ri(e){let t=si();if(t.startInactiveSpan)return t.startInactiveSpan(e);let n=oi(e),{forceTransaction:r,parentSpan:i}=e;return(e.scope?t=>Vt(e.scope,t):i===void 0?e=>e():e=>ii(i,e))(()=>{let t=Rt(),a=ui(t,i);return e.onlyIfParent&&!a?new hr:ai({parentSpan:a,spanArguments:n,forceTransaction:r,scope:t})})}function ii(e,t){let n=si();return n.withActiveSpan?n.withActiveSpan(e,t):Vt(n=>(vt(n,e||void 0),t(n)))}function ai({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!ir()){let r=new hr;return(n||!e)&&dr(r,{sampled:`false`,sample_rate:`0`,transaction:t.name,...mr(r)}),r}let i=zt(),a;if(e&&!n)a=li(e,r,t),Xn(e,a);else if(e){let n=mr(e),{traceId:i,spanId:o}=e.spanContext(),s=Kn(e);a=ci({traceId:i,parentSpanId:o,...t},r,s),dr(a,n)}else{let{traceId:e,dsc:n,parentSpanId:o,sampled:s}={...i.getPropagationContext(),...r.getPropagationContext()};a=ci({traceId:e,parentSpanId:o,...t},r,s),n&&dr(a,n)}return Hr(a),un(a,r,i),a}function oi(e){let t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let n={...t};return n.startTimestamp=Vn(e.startTime),delete n.startTime,n}return t}function si(){return Pt(p())}function ci(e,t,n){let r=Ht(),i=r?.getOptions()||{},{name:a=``}=e,o={spanAttributes:{...e.attributes},spanName:a,parentSampled:n};r?.emit(`beforeSampling`,o,{decision:!1});let s=o.parentSampled??n,c=o.spanAttributes,l=t.getPropagationContext(),[d,f,p]=t.getScopeData().sdkProcessingMetadata[ti]?[!1]:ei(i,{name:a,parentSampled:s,attributes:c,parentSampleRate:On(l.dsc?.sample_rate)},l.sampleRand),m=new qr({...e,attributes:{[Wt]:`custom`,[Gt]:f!==void 0&&p?f:void 0,...c},sampled:d});return!d&&r&&(u&&O.log(`[Tracing] Discarding root span because its trace was not chosen to be sampled.`),r.recordDroppedEvent(`sample_rate`,`transaction`)),r&&r.emit(`spanStart`,m),m}function li(e,t,n){let{spanId:r,traceId:i}=e.spanContext(),a=t.getScopeData().sdkProcessingMetadata[ti]?!1:Kn(e),o=a?new qr({...n,parentSpanId:r,traceId:i,sampled:a}):new hr({traceId:i});Xn(e,o);let s=Ht();return s&&(s.emit(`spanStart`,o),n.endTimestamp&&s.emit(`spanEnd`,o)),o}function ui(e,t){if(t)return t;if(t===null)return;let n=yt(e);if(!n)return;let r=Ht();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?$n(n):n}function di(e){return e===void 0?e=>e():t=>ii(e,t)}var fi={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},pi=`heartbeatFailed`,mi=`idleTimeout`,hi=`finalTimeout`,gi=`externalFinish`;function _i(e,t={}){let n=new Map,r=!1,i,a=gi,o=!t.disableAutoFinish,s=[],{idleTimeout:c=fi.idleTimeout,finalTimeout:l=fi.finalTimeout,childSpanTimeout:d=fi.childSpanTimeout,beforeSpanEnd:f,trimIdleSpanEndTimestamp:p=!0}=t,m=Ht();if(!m||!ir()){let e=new hr;return dr(e,{sample_rate:`0`,sampled:`false`,...mr(e)}),e}let h=Rt(),g=er(),_=vi(e);_.end=new Proxy(_.end,{apply(e,t,n){if(f&&f(_),t instanceof hr)return;let[r,...i]=n,a=Vn(r||ot()),o=Qn(_).filter(e=>e!==_),s=Un(_);if(!o.length||!p)return C(a),Reflect.apply(e,t,[a,...i]);let c=m.getOptions().ignoreSpans,u=o?.reduce((e,t)=>{let n=Un(t);return!n.timestamp||c&&or(n,c)?e:e?Math.max(e,n.timestamp):n.timestamp},void 0),d=s.start_timestamp,h=Math.min(d?d+l/1e3:1/0,Math.max(d||-1/0,Math.min(a,u||1/0)));return C(h),Reflect.apply(e,t,[h,...i])}});function v(){i&&=(clearTimeout(i),void 0)}function y(e){v(),i=setTimeout(()=>{!r&&n.size===0&&o&&(a=mi,_.end(e))},c)}function b(e){i=setTimeout(()=>{!r&&o&&(a=pi,_.end(e))},d)}function x(e){v(),n.set(e,!0),b(ot()+d/1e3)}function S(e){n.has(e)&&n.delete(e),n.size===0&&y(ot()+c/1e3)}function C(e){r=!0,n.clear(),s.forEach(e=>e()),vt(h,g);let t=Un(_),{start_timestamp:i}=t;if(!i)return;t.data[`sentry.idle_span_finish_reason`]||_.setAttribute(Yt,a);let o=t.status;(!o||o===`unknown`)&&_.setStatus({code:1}),O.log(`[Tracing] Idle span "${t.op}" finished`);let d=Qn(_).filter(e=>e!==_),f=0;d.forEach(t=>{t.isRecording()&&(t.setStatus({code:2,message:`cancelled`}),t.end(e),u&&O.log(`[Tracing] Cancelling span since span ended early`,JSON.stringify(t,void 0,2)));let{timestamp:n=0,start_timestamp:r=0}=Un(t),i=r<=e,a=(l+c)/1e3,o=n-r<=a;if(u){let e=JSON.stringify(t,void 0,2);i?o||O.log(`[Tracing] Discarding span since it finished after idle span final timeout`,e):O.log(`[Tracing] Discarding span since it happened after idle span was finished`,e)}(!o||!i)&&(Zn(_,t),f++)}),f>0&&_.setAttribute(`sentry.idle_span_discarded_spans`,f)}return s.push(m.on(`spanStart`,e=>{r||e===_||Un(e).timestamp||e instanceof qr&&e.isStandaloneSpan()||Qn(_).includes(e)&&x(e.spanContext().spanId)})),s.push(m.on(`spanEnd`,e=>{r||S(e.spanContext().spanId)})),s.push(m.on(`idleSpanEnableAutoFinish`,e=>{e===_&&(o=!0,y(),n.size&&b())})),t.disableAutoFinish||y(),setTimeout(()=>{r||(_.setStatus({code:2,message:`deadline_exceeded`}),a=hi,_.end())},l),_}function vi(e){let t=ri(e);return vt(Rt(),t),u&&O.log(`[Tracing] Started span is an idle span`),t}var yi=0,bi=1,xi=2;function Si(e){return new wi(t=>{t(e)})}function Ci(e){return new wi((t,n)=>{n(e)})}var wi=class e{constructor(e){this._state=yi,this._handlers=[],this._runExecutor(e)}then(t,n){return new e((e,r)=>{this._handlers.push([!1,n=>{if(!t)e(n);else try{e(t(n))}catch(e){r(e)}},t=>{if(!n)r(t);else try{e(n(t))}catch(e){r(e)}}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(t){return new e((e,n)=>{let r,i;return this.then(e=>{i=!1,r=e,t&&t()},e=>{i=!0,r=e,t&&t()}).then(()=>{if(i){n(r);return}e(r)})})}_executeHandlers(){if(this._state===yi)return;let e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||=(this._state===bi&&e[1](this._value),this._state===xi&&e[2](this._value),!0)})}_runExecutor(e){let t=(e,t)=>{if(this._state===yi){if(ye(t)){t.then(n,r);return}this._state=e,this._value=t,this._executeHandlers()}},n=e=>{t(bi,e)},r=e=>{t(xi,e)};try{e(n,r)}catch(e){r(e)}}};function Ti(e,t,n,r=0){try{let i=Ei(t,n,e,r);return ye(i)?i:Si(i)}catch(e){return Ci(e)}}function Ei(e,t,n,r){let i=n[r];if(!e||!i)return e;let a=i({...e},t);return u&&a===null&&O.log(`Event processor "${i.id||`?`}" dropped event`),ye(a)?a.then(e=>Ei(e,t,n,r+1)):Ei(a,t,n,r+1)}var Di,Oi,ki,Ai;function ji(e){let t=d._sentryDebugIds,n=d._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],i=n?Object.keys(n):[];if(Ai&&r.length===Oi&&i.length===ki)return Ai;Oi=r.length,ki=i.length,Ai={},Di||={};let a=(t,n)=>{for(let r of t){let t=n[r],i=Di?.[r];if(i&&Ai&&t)Ai[i[0]]=t,Di&&(Di[r]=[i[0],t]);else if(t){let n=e(r);for(let e=n.length-1;e>=0;e--){let i=n[e]?.filename;if(i&&Ai&&Di){Ai[i]=t,Di[r]=[i,t];break}}}}};return t&&a(r,t),n&&a(i,n),Ai}function Mi(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:a}=t;Ii(e,t),r&&zi(e,r),Bi(e,n),Li(e,i),Ri(e,a)}function Ni(e,t){let{extra:n,tags:r,attributes:i,user:a,contexts:o,level:s,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:u,eventProcessors:d,attachments:f,propagationContext:p,transactionName:m,span:h}=t;Pi(e,`extra`,n),Pi(e,`tags`,r),Pi(e,`attributes`,i),Pi(e,`user`,a),Pi(e,`contexts`,o),e.sdkProcessingMetadata=mt(e.sdkProcessingMetadata,c,2),s&&(e.level=s),m&&(e.transactionName=m),h&&(e.span=h),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function Pi(e,t,n){e[t]=mt(e[t],n,1)}function Fi(e,t){let n=Bt().getScopeData();return e&&Ni(n,e.getScopeData()),t&&Ni(n,t.getScopeData()),n}function Ii(e,t){let{extra:n,tags:r,user:i,contexts:a,level:o,transactionName:s}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),o&&(e.level=o),s&&e.type!==`transaction`&&(e.transaction=s)}function Li(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Ri(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function zi(e,t){e.contexts={trace:Ln(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:mr(t),...e.sdkProcessingMetadata};let n=Un($n(t)).description;n&&!e.transaction&&e.type===`transaction`&&(e.transaction=n)}function Bi(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function Vi(e,t,n,r,i,a){let{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,c={...t,event_id:t.event_id||n.event_id||Ye(),timestamp:t.timestamp||rt()},l=n.integrations||e.integrations.map(e=>e.name);Hi(c,e),Gi(c,l),i&&i.emit(`applyFrameMetadata`,t),t.type===void 0&&Ui(c,e.stackParser);let u=qi(r,n.captureContext);n.mechanism&&$e(c,n.mechanism);let d=i?i.getEventProcessors():[],f=Fi(a,u),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),Mi(c,f);let m=[...d,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?Si(c):Ti(m,c,n)).then(e=>(e&&Wi(e),typeof o==`number`&&o>0?Ki(e,o,s):e))}function Hi(e,t){let{environment:n,release:r,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||`production`,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i);let o=e.request;o?.url&&a&&(o.url=He(o.url,a)),a&&e.exception?.values?.forEach(e=>{e.value&&=He(e.value,a)})}function Ui(e,t){let n=ji(t);e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.filename&&(e.debug_id=n[e.filename])})})}function Wi(e){let t={};if(e.exception?.values?.forEach(e=>{e.stacktrace?.frames?.forEach(e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([e,t])=>{n.push({type:`sourcemap`,code_file:e,debug_id:t})})}function Gi(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Ki(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:gr(e.data,t,n)}}))},...e.user&&{user:gr(e.user,t,n)},...e.contexts&&{contexts:gr(e.contexts,t,n)},...e.extra&&{extra:gr(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=gr(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(e=>({...e,...e.data&&{data:gr(e.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=gr(e.contexts.flags,3,n)),r}function qi(e,t){if(!t)return e;let n=e?e.clone():new xt;return n.update(t),n}function Ji(e){if(e)return Yi(e)||Zi(e)?{captureContext:e}:e}function Yi(e){return e instanceof xt||typeof e==`function`}var Xi=[`user`,`level`,`extra`,`contexts`,`tags`,`fingerprint`,`propagationContext`];function Zi(e){return Object.keys(e).some(e=>Xi.includes(e))}function Qi(e,t){return Rt().captureException(e,Ji(t))}function $i(e,t){return Rt().captureEvent(e,t)}function ea(e,t){zt().setContext(e,t)}function ta(){let e=Ht();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function na(e){let t=zt(),{user:n}=Fi(t,Rt()),{userAgent:r}=d.navigator||{},i=ut({user:n,...r&&{userAgent:r},...e}),a=t.getSession();return a?.status===`ok`&&dt(a,{status:`exited`}),ra(),t.setSession(i),i}function ra(){let e=zt(),t=Rt().getSession()||e.getSession();t&&ft(t),ia(),e.setSession()}function ia(){let e=zt(),t=Ht(),n=e.getSession();n&&t&&t.captureSession(n)}function aa(e=!1){if(e){ra();return}ia()}function oa(e){let t=e.protocol?`${e.protocol}:`:``,n=e.port?`:${e.port}`:``;return`${t}//${e.host}${n}${e.path?`/${e.path}`:``}/api/`}function sa(e){return`${oa(e)}${e.projectId}/envelope/`}function ca(e,t){let n={sentry_version:`7`};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function la(e,t,n){return t||`${sa(e)}?${ca(e,n)}`}var ua=[];function da(e){let t={};return e.forEach(e=>{let{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}function fa(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(e=>{e.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n==`function`){let e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return da(r)}function pa(e,t){let n={};return t.forEach(t=>{t&&ha(e,t,n)}),n}function ma(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function ha(e,t,n){if(n[t.name]){u&&O.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!ua.includes(t.name)&&typeof t.setupOnce==`function`&&(t.setupOnce(),ua.push(t.name)),t.setup&&typeof t.setup==`function`&&t.setup(e),typeof t.preprocessEvent==`function`){let n=t.preprocessEvent.bind(t);e.on(`preprocessEvent`,(t,r)=>n(t,r,e))}if(typeof t.processEvent==`function`){let n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}u&&O.log(`Integration installed: ${t.name}`)}function ga(e){return e}function _a(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.keys(e).includes(`value`)}function va(e,t){let{value:n,unit:r}=_a(e)?e:{value:e,unit:void 0},i=ba(n),a=r&&typeof r==`string`?{unit:r}:{};if(i)return{...i,...a};if(!t||t===`skip-undefined`&&n===void 0)return;let o=``;try{o=JSON.stringify(n)??``}catch{}return{value:o,type:`string`,...a}}function ya(e,t=!1){let n={};for(let[r,i]of Object.entries(e??{})){let e=va(i,t);e&&(n[r]=e)}return n}function ba(e){let t=typeof e==`string`?`string`:typeof e==`boolean`?`boolean`:typeof e==`number`&&!Number.isNaN(e)?Number.isInteger(e)?`integer`:`double`:null;if(t)return{value:e,type:t}}var xa=`sentry.timestamp.sequence`,Sa=0,Ca;function wa(e){let t=Math.floor(e*1e3);Ca!==void 0&&t!==Ca&&(Sa=0);let n=Sa;return Sa++,Ca=t,{key:xa,value:{value:n,type:`integer`}}}function Ta(e,t){return t?Vt(t,()=>{let n=er(),r=n?Ln(n):Ut(t);return[n?mr(n):pr(e,t),r]}):[void 0,void 0]}var Ea={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function Da(e){return[{type:`log`,item_count:e.length,content_type:`application/vnd.sentry.items.log+json`},{items:e}]}function Oa(e,t,n,r){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=xn(r)),wr(i,[Da(e)])}var ka=100;function Aa(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function ja(e,t){let n=Fa(),r=Pa(e);r===void 0?n.set(e,[t]):r.length>=ka?(Na(e,r),n.set(e,[t])):n.set(e,[...r,t])}function Ma(e,t=Rt(),n=ja){let r=t?.getClient()??Ht();if(!r){u&&O.warn(`No client available to capture log.`);return}let{release:i,environment:a,enableLogs:o=!1,beforeSendLog:s}=r.getOptions();if(!o){u&&O.warn(`logging option not enabled, log will not be captured.`);return}let[,c]=Ta(r,t),l={...e.attributes},{user:{id:d,email:f,username:p},attributes:m={}}=Fi(zt(),t);Aa(l,`user.id`,d,!1),Aa(l,`user.email`,f,!1),Aa(l,`user.name`,p,!1),Aa(l,`sentry.release`,i),Aa(l,`sentry.environment`,a);let{name:h,version:g}=r.getSdkMetadata()?.sdk??{};Aa(l,`sentry.sdk.name`,h),Aa(l,`sentry.sdk.version`,g);let _=r.getIntegrationByName(`Replay`),v=_?.getReplayId(!0);Aa(l,`sentry.replay_id`,v),v&&_?.getRecordingMode()===`buffer`&&Aa(l,`sentry._internal.replay_is_buffering`,!0);let b=e.message;if(pe(b)){let{__sentry_template_string__:e,__sentry_template_values__:t=[]}=b;t?.length&&(l[`sentry.message.template`]=e),t.forEach((e,t)=>{l[`sentry.message.parameter.${t}`]=e})}Aa(l,`sentry.trace.parent_span_id`,yt(t)?.spanContext().spanId);let x={...e,attributes:l};r.emit(`beforeCaptureLog`,x);let S=s?y(()=>s(x)):x;if(!S){r.recordDroppedEvent(`before_send`,`log_item`,1),u&&O.warn(`beforeSendLog returned null, log will not be captured.`);return}let{level:C,message:w,attributes:T={},severityNumber:E}=S,D=ot(),k=wa(D);n(r,{timestamp:D,level:C,body:w,trace_id:c?.trace_id,severity_number:E??Ea[C],attributes:{...ya(m),...ya(T,!0),[k.key]:k.value}}),r.emit(`afterCaptureLog`,S)}function Na(e,t){let n=t??Pa(e)??[];if(n.length===0)return;let r=e.getOptions(),i=Oa(n,r._metadata,r.tunnel,e.getDsn());Fa().set(e,[]),e.emit(`flushLogs`),e.sendEnvelope(i)}function Pa(e){return Fa().get(e)}function Fa(){return h(`clientToLogBufferMap`,()=>new WeakMap)}function Ia(e){return[{type:`trace_metric`,item_count:e.length,content_type:`application/vnd.sentry.items.trace-metric+json`},{items:e}]}function La(e,t,n,r){let i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(i.dsn=xn(r)),wr(i,[Ia(e)])}var Ra=1e3;function za(e,t,n,r=!0){n&&(r||!(t in e))&&(e[t]=n)}function Ba(e,t){let n=Ka(),r=Ga(e);r===void 0?n.set(e,[t]):r.length>=Ra?(Wa(e,r),n.set(e,[t])):n.set(e,[...r,t])}function Va(e,t,n){let{release:r,environment:i}=t.getOptions(),a={...e.attributes};za(a,`user.id`,n.id,!1),za(a,`user.email`,n.email,!1),za(a,`user.name`,n.username,!1),za(a,`sentry.release`,r),za(a,`sentry.environment`,i);let{name:o,version:s}=t.getSdkMetadata()?.sdk??{};za(a,`sentry.sdk.name`,o),za(a,`sentry.sdk.version`,s);let c=t.getIntegrationByName(`Replay`),l=c?.getReplayId(!0);return za(a,`sentry.replay_id`,l),l&&c?.getRecordingMode()===`buffer`&&za(a,`sentry._internal.replay_is_buffering`,!0),{...e,attributes:a}}function Ha(e,t,n,r){let[,i]=Ta(t,n),a=yt(n),o=a?a.spanContext().traceId:i?.trace_id,s=a?a.spanContext().spanId:void 0,c=ot(),l=wa(c);return{timestamp:c,trace_id:o??``,span_id:s,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...ya(r),...ya(e.attributes,`skip-undefined`),[l.key]:l.value}}}function Ua(e,t){let n=t?.scope??Rt(),r=t?.captureSerializedMetric??Ba,i=n?.getClient()??Ht();if(!i){u&&O.warn(`No client available to capture metric.`);return}let{_experiments:a,enableMetrics:o,beforeSendMetric:s}=i.getOptions();if(!(o??a?.enableMetrics??!0)){u&&O.warn(`metrics option not enabled, metric will not be captured.`);return}let{user:c,attributes:l}=Fi(zt(),n),d=Va(e,i,c);i.emit(`processMetric`,d);let f=s||a?.beforeSendMetric,p=f?f(d):d;if(!p){u&&O.log("`beforeSendMetric` returned `null`, will not send metric.");return}let m=Ha(p,i,n,l);u&&O.log(`[Metric]`,m),r(i,m),i.emit(`afterCaptureMetric`,p)}function Wa(e,t){let n=t??Ga(e)??[];if(n.length===0)return;let r=e.getOptions(),i=La(n,r._metadata,r.tunnel,e.getDsn());Ka().set(e,[]),e.emit(`flushMetrics`),e.sendEnvelope(i)}function Ga(e){return Ka().get(e)}function Ka(){return h(`clientToMetricBufferMap`,()=>new WeakMap)}function qa(e){return typeof e==`object`&&typeof e.unref==`function`&&e.unref(),e}var Ja=Symbol.for(`SentryBufferFullError`);function Ya(e=100){let t=new Set;function n(){return t.size<e}function r(e){t.delete(e)}function i(e){if(!n())return Ci(Ja);let i=e();return t.add(i),i.then(()=>r(i),()=>r(i)),i}function a(e){if(!t.size)return Si(!0);let n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;let r=[n,new Promise(t=>qa(setTimeout(()=>t(!1),e)))];return Promise.race(r)}return{get $(){return Array.from(t)},add:i,drain:a}}var Xa=60*1e3;function Za(e,t=Ve()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?Xa:r-t}function Qa(e,t){return e[t]||e.all||0}function $a(e,t,n=Ve()){return Qa(e,t)>n}function eo(e,{statusCode:t,headers:n},r=Ve()){let i={...e},a=n?.[`x-sentry-rate-limits`],o=n?.[`retry-after`];if(a)for(let e of a.trim().split(`,`)){let[t,n,,,a]=e.split(`:`,5),o=parseInt(t,10),s=(isNaN(o)?60:o)*1e3;if(!n)i.all=r+s;else for(let e of n.split(`;`))e===`metric_bucket`?(!a||a.split(`;`).includes(`custom`))&&(i[e]=r+s):i[e]=r+s}else o?i.all=r+Za(o,r):t===429&&(i.all=r+60*1e3);return i}function to(e,t,n=Ya(e.bufferSize||64)){let r={},i=e=>n.drain(e);function a(i){let a=[];if(Er(i,(t,n)=>{let i=Fr(n);$a(r,i)?e.recordDroppedEvent(`ratelimit_backoff`,i):a.push(t)}),a.length===0)return Promise.resolve({});let o=wr(i[0],a),s=t=>{if(Dr(o,[`client_report`])){u&&O.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`);return}Er(o,(n,r)=>{e.recordDroppedEvent(t,Fr(r))})};return n.add(()=>t({body:kr(o)}).then(e=>e.statusCode===413?(u&&O.error(`Sentry responded with status code 413. Envelope was discarded due to exceeding size limits.`),s(`send_error`),e):(u&&e.statusCode!==void 0&&(e.statusCode<200||e.statusCode>=300)&&O.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=eo(r,e),e),e=>{throw s(`network_error`),u&&O.error(`Encountered error running transport request:`,e),e})).then(e=>e,e=>{if(e===Ja)return u&&O.error(`Skipped sending event because buffer is full.`),s(`queue_overflow`),Promise.resolve({});throw e})}return{send:a,flush:i}}function no(e,t,n){let r=[{type:`client_report`},{timestamp:n||rt(),discarded_events:e}];return wr(t?{dsn:t}:{},[r])}function ro(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function io(e){let{trace_id:t,parent_span_id:n,span_id:r,status:i,origin:a,data:o,op:s}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:s,parent_span_id:n,span_id:r??``,start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??``,origin:a,profile_id:o?.[$t],exclusive_time:o?.[en],measurements:e.measurements,is_segment:!0}}function ao(e){return{type:`transaction`,timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{"sentry.profile_id":e.profile_id},...e.exclusive_time&&{"sentry.exclusive_time":e.exclusive_time}}}},measurements:e.measurements}}var oo=`Not capturing exception because it's already been captured.`,so=`Discarded session because of missing or non-string release`,co=Symbol.for(`SentryInternalError`),lo=Symbol.for(`SentryDoNotSendEventError`),uo=5e3;function fo(e){return{message:e,[co]:!0}}function po(e){return{message:e,[lo]:!0}}function mo(e){return!!e&&typeof e==`object`&&co in e}function ho(e){return!!e&&typeof e==`object`&&lo in e}function go(e,t,n,r,i){let a=0,o,s=!1;e.on(n,()=>{a=0,clearTimeout(o),s=!1}),e.on(t,t=>{a+=r(t),a>=8e5?i(e):s||(s=!0,o=qa(setTimeout(()=>{i(e)},uo)))}),e.on(`flush`,()=>{i(e)})}var _o=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Ya(e.transportOptions?.bufferSize??64),e.dsn?this._dsn=Dn(e.dsn):u&&O.warn(`No DSN provided, client will not send events.`),this._dsn){let t=la(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&go(this,`afterCaptureLog`,`flushLogs`,wo,Na),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&go(this,`afterCaptureMetric`,`flushMetrics`,Co,Wa)}captureException(e,t,n){let r=Ye();if(et(e))return u&&O.log(oo),r;let i={event_id:r,...t};return this._process(()=>this.eventFromException(e,i).then(e=>this._captureEvent(e,i,n)).then(e=>e),`error`),i.event_id}captureMessage(e,t,n,r){let i={event_id:Ye(),...n},a=pe(e)?e:String(e),o=me(e),s=o?this.eventFromMessage(a,t,i):this.eventFromException(e,i);return this._process(()=>s.then(e=>this._captureEvent(e,i,r)),o?`unknown`:`error`),i.event_id}captureEvent(e,t,n){let r=Ye();if(t?.originalException&&et(t.originalException))return u&&O.log(oo),r;let i={event_id:r,...t},a=e.sdkProcessingMetadata||{},o=a.capturedSpanScope,s=a.capturedSpanIsolationScope,c=vo(e.type);return this._process(()=>this._captureEvent(e,i,o||n,s),c),i.event_id}captureSession(e){this.sendSession(e),dt(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){let t=this._transport;if(!t)return!0;this.emit(`flush`);let n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){Na(this);let t=await this.flush(e);return this.getOptions().enabled=!1,this.emit(`close`),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith(`Spotlight`)))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let t=this._integrations[e.name];ha(this,e,this._integrations),t||ma(this,[e])}sendEvent(e,t={}){this.emit(`beforeSendEvent`,e,t);let n=Br(e,this._dsn,this._options._metadata,this._options.tunnel);for(let e of t.attachments||[])n=Tr(n,Mr(e));this.sendEnvelope(n).then(t=>this.emit(`afterSendEvent`,e,t))}sendSession(e){let{release:t,environment:n=lr}=this._options;if(`aggregates`in e){let r=e.attrs||{};if(!r.release&&!t){u&&O.warn(so);return}r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t){u&&O.warn(so);return}e.release=e.release||t,e.environment=e.environment||n}this.emit(`beforeSendSession`,e);let r=zr(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t,n=1){if(this._options.sendClientReports){let r=`${e}:${t}`;u&&O.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:``}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){let n=this._hooks[e]=this._hooks[e]||new Set,r=(...e)=>t(...e);return n.add(r),()=>{n.delete(r)}}emit(e,...t){let n=this._hooks[e];n&&n.forEach(e=>e(...t))}async sendEnvelope(e){if(this.emit(`beforeEnvelope`,e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return u&&O.error(`Error while sending envelope:`,e),{}}return u&&O.error(`Transport disabled`),{}}dispose(){}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=pa(this,e),ma(this,e)}_updateSessionFromEvent(e,t){let n=t.level===`fatal`,r=!1,i=t.exception?.values;if(i){r=!0,n=!1;for(let e of i)if(e.mechanism?.handled===!1){n=!0;break}}let a=e.status===`ok`;(a&&e.errors===0||a&&n)&&(dt(e,{...n&&{status:`crashed`},errors:e.errors||Number(r||n)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,t,n,r){let i=this.getOptions(),a=Object.keys(this._integrations);return!t.integrations&&a?.length&&(t.integrations=a),this.emit(`preprocessEvent`,e,t),e.type||r.setLastEventId(e.event_id||t.event_id),Vi(i,e,t,n,this,r).then(e=>e===null?e:(this.emit(`postprocessEvent`,e,t),e.contexts={trace:{...e.contexts?.trace,...Ut(n)},...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:pr(this,n),...e.sdkProcessingMetadata},e))}_captureEvent(e,t={},n=Rt(),r=zt()){return u&&xo(e)&&O.log(`Captured error event \`${ro(e)[0]||`<unknown>`}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>{u&&(ho(e)?O.log(e.message):mo(e)?O.warn(e.message):O.warn(e))})}_processEvent(e,t,n,r){let i=this.getOptions(),{sampleRate:a}=i,o=So(e),s=xo(e),c=`before send for type \`${e.type||`error`}\``,l=a===void 0?void 0:On(a);if(s&&typeof l==`number`&&Be()>l)return this.recordDroppedEvent(`sample_rate`,`error`),Ci(po(`Discarding event because it's not included in the random sample (sampling rate = ${a})`));let u=vo(e.type);return this._prepareEvent(e,t,n,r).then(e=>{if(e===null)throw this.recordDroppedEvent(`event_processor`,u),po("An event processor returned `null`, will not send event.");return t.data?.__sentry__===!0?e:yo(bo(this,i,e,t),c)}).then(i=>{if(i===null){if(this.recordDroppedEvent(`before_send`,u),o){let t=1+(e.spans||[]).length;this.recordDroppedEvent(`before_send`,`span`,t)}throw po(`${c} returned \`null\`, will not send event.`)}let a=n.getSession()||r.getSession();if(s&&a&&this._updateSessionFromEvent(a,i),o){let e=(i.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(i.spans?i.spans.length:0);e>0&&this.recordDroppedEvent(`before_send`,`span`,e)}let l=i.transaction_info;return o&&l&&i.transaction!==e.transaction&&(i.transaction_info={...l,source:`custom`}),this.sendEvent(i,t),i}).then(null,e=>{throw ho(e)||mo(e)?e:(this.captureException(e,{mechanism:{handled:!1,type:`internal`},data:{__sentry__:!0},originalException:e}),fo(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`))})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===Ja&&this.recordDroppedEvent(`queue_overflow`,t),e))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([e,t])=>{let[n,r]=e.split(`:`);return{reason:n,category:r,quantity:t}})}_flushOutcomes(){u&&O.log(`Flushing outcomes...`);let e=this._clearOutcomes();if(e.length===0){u&&O.log(`No outcomes to send`);return}if(!this._dsn){u&&O.log(`No dsn provided, will not send outcomes`);return}u&&O.log(`Sending outcomes:`,e);let t=no(e,this._options.tunnel&&xn(this._dsn));this.sendEnvelope(t)}};function vo(e){return e===`replay_event`?`replay`:e||`error`}function yo(e,t){let n=`${t} must return \`null\` or a valid event.`;if(ye(e))return e.then(e=>{if(!he(e)&&e!==null)throw fo(n);return e},e=>{throw fo(`${t} rejected with ${e}`)});if(!he(e)&&e!==null)throw fo(n);return e}function bo(e,t,n,r){let{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:o,ignoreSpans:s}=t,c=n;if(xo(c)&&i)return i(c,r);if(So(c)){if(o||s){let t=io(c);if(s?.length&&or(t,s))return null;if(o){let e=o(t);e?c=mt(n,ao(e)):tr()}if(c.spans){let t=[],n=c.spans;for(let e of n){if(s?.length&&or(e,s)){sr(n,e);continue}if(o){let n=o(e);n?t.push(n):(tr(),t.push(e))}else t.push(e)}let r=c.spans.length-t.length;r&&e.recordDroppedEvent(`before_send`,`span`,r),c.spans=t}}if(a){if(c.spans){let e=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return a(c,r)}}return c}function xo(e){return e.type===void 0}function So(e){return e.type===`transaction`}function Co(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+To(e.attributes)}function wo(e){let t=0;return e.message&&(t+=e.message.length*2),t+To(e.attributes)}function To(e){if(!e)return 0;let t=0;return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*Eo(e[0]):me(e)?t+=Eo(e):t+=100}),t}function Eo(e){return typeof e==`string`?e.length*2:typeof e==`number`?8:typeof e==`boolean`?4:0}function Do(e){return se(e)&&`__sentry_fetch_url_host__`in e&&typeof e.__sentry_fetch_url_host__==`string`}function Oo(e){return Do(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function ko(e,t){t.debug===!0&&(u?O.enable():y(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Rt().update(t.initialScope);let n=new e(t);return Ao(n),n.init(),n}function Ao(e){Rt().setClient(e)}var jo=`thismessage:/`;function Mo(e){return`isRelative`in e}function No(e,t){let n=e.indexOf(`://`)<=0&&e.indexOf(`//`)!==0,r=t??(n?jo:void 0);try{if(`canParse`in URL&&!URL.canParse(e,r))return;let t=new URL(e,r);return n?{isRelative:n,pathname:t.pathname,search:t.search,hash:t.hash}:t}catch{}}function Po(e){if(Mo(e))return e.pathname;let t=new URL(e);return t.search=``,t.hash=``,[`80`,`443`].includes(t.port)&&(t.port=``),t.password&&=`%filtered%`,t.username&&=`%filtered%`,t.toString()}function Fo(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||``,r=t[8]||``;return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Io(e){return e.split(/[?#]/,1)[0]}function Lo(e,t=!0){if(e.startsWith(`data:`)){let n=e.match(/^data:([^;,]+)/),r=n?n[1]:`text/plain`,i=e.includes(`;base64,`),a=e.indexOf(`,`),o=``;if(t&&a!==-1){let t=e.slice(a+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${i?`,base64`:``}${o?`,${o}`:``}`}return e}function Ro(e,...t){let n=new String(String.raw(e,...t));return n.__sentry_template_string__=e.join(`\0`).replace(/%/g,`%%`).replace(/\0/g,`%s`),n.__sentry_template_values__=t,n}var zo=Ro;function Bo(e){`aggregates`in e?e.attrs?.ip_address===void 0&&(e.attrs={...e.attrs,ip_address:`{{auto}}`}):e.ipAddress===void 0&&(e.ipAddress=`{{auto}}`)}function Vo(e,t,n=[t],r=`npm`){let i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:f})),i.version=f)}function Ho(e={}){let t=e.client||Ht();if(!ta()||!t)return{};let n=Pt(p());if(n.getTraceData)return n.getTraceData(e);let r=e.scope||Rt(),i=e.span||er();if(!i&&Lt())return{};let a=i?Rn(i):Uo(r),o=mn(i?mr(i):pr(t,r));if(!kn.test(a))return O.warn(`Invalid sentry-trace data. Cannot generate trace data`),{};let s={"sentry-trace":a,baggage:o};return e.propagateTraceparent&&(s.traceparent=i?zn(i):Wo(r)),s}function Uo(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Mn(t,r,n)}function Wo(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Nn(t,r,n)}var Go=100;function Ko(e,t){let n=Ht(),r=zt();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:a=Go}=n.getOptions();if(a<=0)return;let o={timestamp:rt(),...e},s=i?y(()=>i(o,t)):o;s!==null&&(n.emit&&n.emit(`beforeAddBreadcrumb`,s,t),r.addBreadcrumb(s,a))}var qo,Jo=`FunctionToString`,Yo=new WeakMap,Xo=ga((()=>({name:Jo,setupOnce(){qo=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=Ne(this),n=Yo.has(Ht())&&t!==void 0?t:this;return qo.apply(n,e)}}catch{}},setup(e){Yo.set(e,!0)}}))),Zo=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],Qo=`EventFilters`,$o=ga((e={})=>{let t;return{name:Qo,setup(n){t=ts(e,n.getOptions())},processEvent(n,r,i){return t||=ts(e,i.getOptions()),ns(n,t)?null:n}}}),es=ga(((e={})=>({...$o(e),name:`InboundFilters`})));function ts(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Zo],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function ns(e,t){if(!e.type){if(rs(e,t.ignoreErrors))return u&&O.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${Ze(e)}`),!0;if(ls(e))return u&&O.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${Ze(e)}`),!0;if(as(e,t.denyUrls))return u&&O.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${Ze(e)}.\nUrl: ${cs(e)}`),!0;if(!os(e,t.allowUrls))return u&&O.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${Ze(e)}.\nUrl: ${cs(e)}`),!0}else if(e.type===`transaction`&&is(e,t.ignoreTransactions))return u&&O.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${Ze(e)}`),!0;return!1}function rs(e,t){return t?.length?ro(e).some(e=>Ge(e,t)):!1}function is(e,t){if(!t?.length)return!1;let n=e.transaction;return n?Ge(n,t):!1}function as(e,t){if(!t?.length)return!1;let n=cs(e);return n?Ge(n,t):!1}function os(e,t){if(!t?.length)return!0;let n=cs(e);return n?Ge(n,t):!0}function ss(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!==`<anonymous>`&&n.filename!==`[native code]`)return n.filename||null}return null}function cs(e){try{let t=[...e.exception?.values??[]].reverse().find(e=>e.mechanism?.parent_id===void 0&&e.stacktrace?.frames?.length)?.stacktrace?.frames;return t?ss(t):null}catch{return u&&O.error(`Cannot extract url for event ${Ze(e)}`),null}}function ls(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&e.type!==`Error`||e.value):!1}function us(e,t,n,r,i,a){if(!i.exception?.values||!a||!xe(a.originalException,Error))return;let o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=ds(e,t,r,a.originalException,n,i.exception.values,o,0))}function ds(e,t,n,r,i,a,o,s){if(a.length>=n+1)return a;let c=[...a];if(xe(r[i],Error)){ps(o,s,r);let a=e(t,r[i]),l=c.length;ms(a,i,l,s),c=ds(e,t,n,r[i],i,[a,...c],a,l)}return fs(r)&&r.errors.forEach((a,l)=>{if(xe(a,Error)){ps(o,s,r);let u=e(t,a),d=c.length;ms(u,`errors[${l}]`,d,s),c=ds(e,t,n,a,i,[u,...c],u,d)}}),c}function fs(e){return Array.isArray(e.errors)}function ps(e,t,n){e.mechanism={handled:!0,type:`auto.core.linked_errors`,...fs(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function ms(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:`chained`,source:t,exception_id:n,parent_id:r}}function hs(e){let t=`console`;V(t,e),H(t,gs)}function gs(){`console`in d&&g.forEach(function(e){e in d.console&&Ae(d.console,e,function(t){return v[e]=t,function(...t){U(`console`,{args:t,level:e}),v[e]?.apply(d.console,t)}})})}function _s(e){return e===`warn`?`warning`:[`fatal`,`error`,`warning`,`log`,`info`,`debug`].includes(e)?e:`log`}var vs=`Dedupe`,ys=ga((()=>{let e;return{name:vs,processEvent(t){if(t.type)return t;try{if(bs(t,e))return u&&O.warn(`Event dropped due to being a duplicate of previously captured event.`),null}catch{}return e=t}}}));function bs(e,t){return t?!!(xs(e,t)||Ss(e,t)):!1}function xs(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!ws(e,t)||!Cs(e,t))}function Ss(e,t){let n=Ts(t),r=Ts(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!ws(e,t)||!Cs(e,t))}function Cs(e,t){let n=ee(e),r=ee(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let e=0;e<r.length;e++){let t=r[e],i=n[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function ws(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join(``)===r.join(``)}catch{return!1}}function Ts(e){return e.exception?.values?.[0]}var Es=`ConversationId`,Ds=ga((()=>({name:Es,setup(e){e.on(`spanStart`,e=>{let t=Rt().getScopeData(),n=zt().getScopeData(),r=t.conversationId||n.conversationId;r&&e.setAttribute(nn,r)})}})));function Os(e,t,n,r,i){if(!e.fetchData)return;let{method:a,url:o}=e.fetchData,s=ir()&&t(o);if(e.endTimestamp){let t=e.fetchData.__span;if(!t)return;let n=r[t];n&&(s&&(js(n,e),ks(n,e,i)),delete r[t]);return}let{spanOrigin:c=`auto.http.browser`,propagateTraceparent:l=!1}=typeof i==`object`?i:{spanOrigin:i},u=!!er(),d=s&&u?ri(Ps(o,a,c)):new hr;if(e.fetchData.__span=d.spanContext().spanId,r[d.spanContext().spanId]=d,n(e.fetchData.url)){let t=e.args[0],n={...e.args[1]||{}},r=As(t,n,ir()&&u?d:void 0,l);r&&(e.args[1]=n,n.headers=r)}let f=Ht();if(f){let t={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};f.emit(`beforeOutgoingRequestSpan`,d,t)}return d}function ks(e,t,n){(typeof n==`object`&&n?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function As(e,t,n,r){let i=Ho({span:n,propagateTraceparent:r}),a=i[`sentry-trace`],o=i.baggage,s=i.traceparent;if(!a)return;let c=t.headers||(Ce(e)?e.headers:void 0);if(!c)return{...i};if(Ns(c)){let e=new Headers(c);if(e.get(`sentry-trace`)||e.set(`sentry-trace`,a),r&&s&&!e.get(`traceparent`)&&e.set(`traceparent`,s),o){let t=e.get(`baggage`);t?Ms(t)||e.set(`baggage`,`${t},${o}`):e.set(`baggage`,o)}return e}else if(Array.isArray(c)){let e=[...c];c.find(e=>e[0]===`sentry-trace`)||e.push([`sentry-trace`,a]),r&&s&&!c.find(e=>e[0]===`traceparent`)&&e.push([`traceparent`,s]);let t=c.find(e=>e[0]===`baggage`&&Ms(e[1]));return o&&!t&&e.push([`baggage`,o]),e}else{let e=`sentry-trace`in c?c[`sentry-trace`]:void 0,t=`traceparent`in c?c.traceparent:void 0,n=`baggage`in c?c.baggage:void 0,i=n?Array.isArray(n)?[...n]:[n]:[],l=n&&(Array.isArray(n)?n.find(e=>Ms(e)):Ms(n));o&&!l&&i.push(o);let u={...c,"sentry-trace":e??a,baggage:i.length>0?i.join(`,`):void 0};return r&&s&&!t&&(u.traceparent=s),u}}function js(e,t){if(t.response){an(e,t.response.status);let n=t.response?.headers?.get(`content-length`);if(n){let t=parseInt(n);t>0&&e.setAttribute(`http.response_content_length`,t)}}else t.error&&e.setStatus({code:2,message:`internal_error`});e.end()}function Ms(e){return e.split(`,`).some(e=>e.trim().startsWith(fn))}function Ns(e){return typeof Headers<`u`&&xe(e,Headers)}function Ps(e,t,n){if(e.startsWith(`data:`))return{name:`${t} ${Lo(e)}`,attributes:Fs(e,void 0,t,n)};let r=No(e);return{name:`${t} ${r?Po(r):e}`,attributes:Fs(e,r,t,n)}}function Fs(e,t,n,r){let i={url:Lo(e),type:`fetch`,"http.method":n,[Jt]:r,[qt]:`http.client`};return t&&(Mo(t)||(i[`http.url`]=Lo(t.href),i[`server.address`]=t.host),t.search&&(i[`http.query`]=t.search),t.hash&&(i[`http.fragment`]=t.hash)),i}var Is=s({debug:()=>zs,error:()=>Hs,fatal:()=>Us,fmt:()=>zo,info:()=>Bs,trace:()=>Rs,warn:()=>Vs});function Ls(e,t,n,r,i){Ma({level:e,message:t,attributes:n,severityNumber:i},r)}function Rs(e,t,{scope:n}={}){Ls(`trace`,e,t,n)}function zs(e,t,{scope:n}={}){Ls(`debug`,e,t,n)}function Bs(e,t,{scope:n}={}){Ls(`info`,e,t,n)}function Vs(e,t,{scope:n}={}){Ls(`warn`,e,t,n)}function Hs(e,t,{scope:n}={}){Ls(`error`,e,t,n)}function Us(e,t,{scope:n}={}){Ls(`fatal`,e,t,n)}function Ws(e,t,n,r){Ua({type:e,name:t,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope})}function Gs(e,t=1,n){Ws(`counter`,e,t,n)}function Ks(e,t,n){Ws(`gauge`,e,t,n)}function qs(e,t,n){Ws(`distribution`,e,t,n)}function Js(e){if(e!==void 0){if(e>=400&&e<500)return`warning`;if(e>=500)return`error`}}var Ys=d;function Xs(){return`history`in Ys&&!!Ys.history}function Zs(){if(!(`fetch`in Ys))return!1;try{return new Headers,new Request(`data:,`),new Response,!0}catch{return!1}}function Qs(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function $s(){if(typeof EdgeRuntime==`string`)return!0;if(!Zs())return!1;if(Qs(Ys.fetch))return!0;let e=!1,t=Ys.document;if(t&&typeof t.createElement==`function`)try{let n=t.createElement(`iframe`);n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=Qs(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){u&&O.warn(`Could not create sandbox iframe for pure fetch check, bailing to window.fetch: `,e)}return e}function ec(e,t){let n=`fetch`;V(n,e),H(n,()=>nc(void 0,t))}function tc(e){let t=`fetch-body-resolved`;V(t,e),H(t,()=>nc(ic))}function nc(e,t=!1){t&&!$s()||Ae(d,`fetch`,function(t){return function(...n){let r=Error(),{method:i,url:a}=sc(n),o={args:n,fetchData:{method:i,url:a},startTimestamp:ot()*1e3,virtualError:r,headers:cc(n)};return e||U(`fetch`,{...o}),t.apply(d,n).then(async t=>(e?e(t):U(`fetch`,{...o,endTimestamp:ot()*1e3,response:t}),t),e=>{U(`fetch`,{...o,endTimestamp:ot()*1e3,error:e}),se(e)&&e.stack===void 0&&(e.stack=r.stack,je(e,`framesToPop`,1));let t=Ht()?.getOptions().enhanceFetchErrorMessages??`always`;if(t!==!1&&e instanceof TypeError&&(e.message===`Failed to fetch`||e.message===`Load failed`||e.message===`NetworkError when attempting to fetch resource.`))try{let n=new URL(o.fetchData.url).host;t===`always`?e.message=`${e.message} (${n})`:je(e,`__sentry_fetch_url_host__`,n)}catch{}throw e})}})}async function rc(e,t){if(e?.body){let n=e.body,r=n.getReader(),i=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3),a=!0;for(;a;){let e;try{e=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);let{done:i}=await r.read();clearTimeout(e),i&&(t(),a=!1)}catch{a=!1}finally{clearTimeout(e)}}clearTimeout(i),r.releaseLock(),n.cancel().then(null,()=>{})}}function ic(e){let t;try{t=e.clone()}catch{return}rc(t,()=>{U(`fetch-body-resolved`,{endTimestamp:ot()*1e3,response:e})})}function ac(e,t){return!!e&&typeof e==`object`&&!!e[t]}function oc(e){return typeof e==`string`?e:e?ac(e,`url`)?e.url:e.toString?e.toString():``:``}function sc(e){if(e.length===0)return{method:`GET`,url:``};if(e.length===2){let[t,n]=e;return{url:oc(t),method:ac(n,`method`)?String(n.method).toUpperCase():Ce(t)&&ac(t,`method`)?String(t.method).toUpperCase():`GET`}}let t=e[0];return{url:oc(t),method:ac(t,`method`)?String(t.method).toUpperCase():`GET`}}function cc(e){let[t,n]=e;try{if(typeof n==`object`&&n&&`headers`in n&&n.headers)return new Headers(n.headers);if(Ce(t))return new Headers(t.headers)}catch{}}function lc(){return typeof __SENTRY_BROWSER_BUNDLE__<`u`&&!!__SENTRY_BROWSER_BUNDLE__}function uc(){return`npm`}function dc(){return!lc()&&Object.prototype.toString.call(typeof process<`u`?process:0)===`[object process]`}function fc(){return typeof window<`u`&&(!dc()||pc())}function pc(){return d.process?.type===`renderer`}var mc=d,hc=0;function gc(){return hc>0}function _c(){hc++,setTimeout(()=>{hc--})}function vc(e,t={}){function n(e){return typeof e==`function`}if(!n(e))return e;try{let t=e.__sentry_wrapped__;if(t)return typeof t==`function`?t:e;if(Ne(e))return e}catch{return e}let r=function(...n){try{let r=n.map(e=>vc(e,t));return e.apply(this,r)}catch(e){throw _c(),Vt(r=>{r.addEventProcessor(e=>(t.mechanism&&(Qe(e,void 0,void 0),$e(e,t.mechanism)),e.extra={...e.extra,arguments:n},e)),Qi(e)}),e}};try{for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}Me(r,e),je(e,`__sentry_wrapped__`,r);try{Object.getOwnPropertyDescriptor(r,`name`).configurable&&Object.defineProperty(r,`name`,{get(){return e.name}})}catch{}return r}function yc(){let e=Oe(),{referrer:t}=mc.document||{},{userAgent:n}=mc.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}function bc(e,t){let n=Cc(e,t),r={type:Oc(t),value:kc(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===``&&(r.value=`Unrecoverable error caught`),r}function xc(e,t,n,r){let i=Ht()?.getOptions().normalizeDepth,a=Ic(t),o={__serialized__:_r(t,i)};if(a)return{exception:{values:[bc(e,a)]},extra:o};let s={exception:{values:[{type:ge(t)?t.constructor.name:r?`UnhandledRejection`:`Error`,value:Pc(t,{isUnhandledRejection:r})}]},extra:o};if(n){let t=Cc(e,n);t.length&&(s.exception.values[0].stacktrace={frames:t})}return s}function Sc(e,t){return{exception:{values:[bc(e,t)]}}}function Cc(e,t){let n=t.stacktrace||t.stack||``,r=Tc(t),i=Ec(t);try{return e(n,r,i)}catch{}return[]}var wc=/Minified React error #\d+;/i;function Tc(e){return e&&wc.test(e.message)?1:0}function Ec(e){return typeof e.framesToPop==`number`?e.framesToPop:0}function Dc(e){return typeof WebAssembly<`u`&&WebAssembly.Exception!==void 0?e instanceof WebAssembly.Exception:!1}function Oc(e){let t=e?.name;return!t&&Dc(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:`WebAssembly.Exception`:t}function kc(e){let t=e?.message;return Dc(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:`wasm exception`:t?t.error&&typeof t.error.message==`string`?Oo(t.error):Oo(e):`No error message`}function Ac(e,t,n,r){let i=Mc(e,t,n?.syntheticException||void 0,r);return $e(i),i.level=`error`,n?.event_id&&(i.event_id=n.event_id),Si(i)}function jc(e,t,n=`info`,r,i){let a=Nc(e,t,r?.syntheticException||void 0,i);return a.level=n,r?.event_id&&(a.event_id=r.event_id),Si(a)}function Mc(e,t,n,r,i){let a;if(le(t)&&t.error)return Sc(e,t.error);if(ue(t)||de(t)){let i=t;if(`stack`in t)a=Sc(e,t);else{let t=i.name||(ue(i)?`DOMError`:`DOMException`),o=i.message?`${t}: ${i.message}`:t;a=Nc(e,o,n,r),Qe(a,o)}return`code`in i&&(a.tags={...a.tags,"DOMException.code":`${i.code}`}),a}return se(t)?Sc(e,t):he(t)||ge(t)?(a=xc(e,t,n,i),$e(a,{synthetic:!0}),a):(a=Nc(e,t,n,r),Qe(a,`${t}`,void 0),$e(a,{synthetic:!0}),a)}function Nc(e,t,n,r){let i={};if(r&&n){let r=Cc(e,n);r.length&&(i.exception={values:[{value:t,stacktrace:{frames:r}}]}),$e(i,{synthetic:!0})}if(pe(t)){let{__sentry_template_string__:e,__sentry_template_values__:n}=t;return i.logentry={message:e,params:n},i}return i.message=t,i}function Pc(e,{isUnhandledRejection:t}){let n=Le(e),r=t?`promise rejection`:`exception`;return le(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:ge(e)?`Event \`${Fc(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Fc(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Ic(e){return Object.values(e).find(e=>e instanceof Error)}var Lc=class extends _o{constructor(e){let t=Rc(e);Vo(t,`browser`,[`browser`],mc.SENTRY_SDK_SOURCE||uc()),t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:t.sendDefaultPii?`auto`:`never`,...t._metadata.sdk.settings}),super(t);let{sendDefaultPii:n,sendClientReports:r,enableLogs:i,_experiments:a,enableMetrics:o}=this._options,s=o??a?.enableMetrics??!0;mc.document&&(r||i||s)&&mc.document.addEventListener(`visibilitychange`,()=>{mc.document.visibilityState===`hidden`&&(r&&this._flushOutcomes(),i&&Na(this),s&&Wa(this))}),n&&this.on(`beforeSendSession`,Bo)}eventFromException(e,t){return Ac(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t=`info`,n){return jc(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||`javascript`,super._prepareEvent(e,t,n,r)}};function Rc(e){return{release:typeof __SENTRY_RELEASE__==`string`?__SENTRY_RELEASE__:mc.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}var zc=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,Bc=d,Vc=(e,t)=>e>t[1]?`poor`:e>t[0]?`needs-improvement`:`good`,Hc=(e,t,n,r)=>{let i,a;return o=>{t.value>=0&&(o||r)&&(a=t.value-(i??0),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=Vc(t.value,n),e(t)))}},Uc=(e=!0)=>{let t=Bc.performance?.getEntriesByType?.(`navigation`)[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Wc=()=>Uc()?.activationStart??0;function Gc(e,t,n){Bc.document&&Bc.addEventListener(e,t,n)}function Kc(e,t,n){Bc.document&&Bc.removeEventListener(e,t,n)}var qc=-1,Jc=new Set,Yc=()=>Bc.document?.visibilityState===`hidden`&&!Bc.document?.prerendering?0:1/0,Xc=e=>{if(Qc(e)&&qc>-1){if(e.type===`visibilitychange`||e.type===`pagehide`)for(let e of Jc)e();isFinite(qc)||(qc=e.type===`visibilitychange`?e.timeStamp:0,Kc(`prerenderingchange`,Xc,!0))}},Zc=()=>{if(Bc.document&&qc<0){let e=Wc();qc=(Bc.document.prerendering?void 0:globalThis.performance.getEntriesByType(`visibility-state`).filter(t=>t.name===`hidden`&&t.startTime>e)[0]?.startTime)??Yc(),Gc(`visibilitychange`,Xc,!0),Gc(`pagehide`,Xc,!0),Gc(`prerenderingchange`,Xc,!0)}return{get firstHiddenTime(){return qc},onHidden(e){Jc.add(e)}}};function Qc(e){return e.type===`pagehide`||Bc.document?.visibilityState===`hidden`}var $c=()=>`v5-${Date.now()}-${Math.floor(Math.random()*8999999999999)+0xe8d4a51000}`,el=(e,t=-1)=>{let n=Uc(),r=`navigate`;return n&&(Bc.document?.prerendering||Wc()>0?r=`prerender`:Bc.document?.wasDiscarded?r=`restore`:n.type&&(r=n.type.replace(/_/g,`-`))),{name:e,value:t,rating:`good`,delta:0,entries:[],id:$c(),navigationType:r}},tl=new WeakMap;function nl(e,t){try{return tl.get(e)||tl.set(e,new t),tl.get(e)}catch{return new t}}var rl=class e{constructor(){e.prototype.__init.call(this),e.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(e){if(e.hadRecentInput)return;let t=this._sessionEntries[0],n=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this._sessionValue+=e.value,this._sessionEntries.push(e)):(this._sessionValue=e.value,this._sessionEntries=[e]),this._onAfterProcessingUnexpectedShift?.(e)}},il=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){let r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},al=e=>{let t=!1;return()=>{t||=(e(),!0)}},ol=e=>{Bc.document?.prerendering?addEventListener(`prerenderingchange`,()=>e(),!0):e()},sl=[1800,3e3],cl=(e,t={})=>{ol(()=>{let n=Zc(),r=el(`FCP`),i,a=il(`paint`,e=>{for(let t of e)t.name===`first-contentful-paint`&&(a.disconnect(),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-Wc(),0),r.entries.push(t),i(!0)))});a&&(i=Hc(e,r,sl,t.reportAllChanges))})},ll=[.1,.25],ul=(e,t={})=>{cl(al(()=>{let n=el(`CLS`,0),r,i=Zc(),a=nl(t,rl),o=e=>{for(let t of e)a._processEntry(t);a._sessionValue>n.value&&(n.value=a._sessionValue,n.entries=a._sessionEntries,r())},s=il(`layout-shift`,o);s&&(r=Hc(e,n,ll,t.reportAllChanges),i.onHidden(()=>{o(s.takeRecords()),r(!0)}),Bc?.setTimeout?.(r))}))},dl=0,fl=1/0,pl=0,ml=e=>{e.forEach(e=>{e.interactionId&&(fl=Math.min(fl,e.interactionId),pl=Math.max(pl,e.interactionId),dl=pl?(pl-fl)/7+1:0)})},hl,gl=()=>hl?dl:performance.interactionCount||0,_l=()=>{`interactionCount`in performance||hl||(hl=il(`event`,ml,{type:`event`,buffered:!0,durationThreshold:0}))},vl=10,yl=0,bl=()=>gl()-yl,xl=class e{constructor(){e.prototype.__init.call(this),e.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){yl=gl(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){let e=Math.min(this._longestInteractionList.length-1,Math.floor(bl()/50));return this._longestInteractionList[e]}_processEntry(e){if(this._onBeforeProcessingEntry?.(e),!(e.interactionId||e.entryType===`first-input`))return;let t=this._longestInteractionList.at(-1),n=this._longestInteractionMap.get(e.interactionId);if(n||this._longestInteractionList.length<vl||e.duration>t._latency){if(n?e.duration>n._latency?(n.entries=[e],n._latency=e.duration):e.duration===n._latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],_latency:e.duration},this._longestInteractionMap.set(n.id,n),this._longestInteractionList.push(n)),this._longestInteractionList.sort((e,t)=>t._latency-e._latency),this._longestInteractionList.length>vl){let e=this._longestInteractionList.splice(vl);for(let t of e)this._longestInteractionMap.delete(t.id)}this._onAfterProcessingINPCandidate?.(n)}}},Sl=e=>{let t=Bc.requestIdleCallback||Bc.setTimeout;Bc.document?.visibilityState===`hidden`?e():(e=al(e),Gc(`visibilitychange`,e,{once:!0,capture:!0}),Gc(`pagehide`,e,{once:!0,capture:!0}),t(()=>{e(),Kc(`visibilitychange`,e,{capture:!0}),Kc(`pagehide`,e,{capture:!0})}))},Cl=[200,500],wl=40,Tl=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&`interactionId`in PerformanceEventTiming.prototype))return;let n=Zc();ol(()=>{_l();let r=el(`INP`),i,a=nl(t,xl),o=e=>{Sl(()=>{for(let t of e)a._processEntry(t);let t=a._estimateP98LongestInteraction();t&&t._latency!==r.value&&(r.value=t._latency,r.entries=t.entries,i())})},s=il(`event`,o,{durationThreshold:t.durationThreshold??wl});i=Hc(e,r,Cl,t.reportAllChanges),s&&(s.observe({type:`first-input`,buffered:!0}),n.onHidden(()=>{o(s.takeRecords()),i(!0)}))})},El=class{_processEntry(e){this._onBeforeProcessingEntry?.(e)}},Dl=[2500,4e3],Ol=(e,t={})=>{ol(()=>{let n=Zc(),r=el(`LCP`),i,a=nl(t,El),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(let t of e)a._processEntry(t),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-Wc(),0),r.entries=[t],i())},s=il(`largest-contentful-paint`,o);if(s){i=Hc(e,r,Dl,t.reportAllChanges);let n=al(()=>{o(s.takeRecords()),s.disconnect(),i(!0)}),a=e=>{e.isTrusted&&(Sl(n),Kc(e.type,a,{capture:!0}))};for(let e of[`keydown`,`click`,`visibilitychange`])Gc(e,a,{capture:!0})}})},kl=[800,1800],Al=e=>{Bc.document?.prerendering?ol(()=>Al(e)):Bc.document?.readyState===`complete`?setTimeout(e):addEventListener(`load`,()=>Al(e),!0)},jl=(e,t={})=>{let n=el(`TTFB`),r=Hc(e,n,kl,t.reportAllChanges);Al(()=>{let e=Uc();e&&(n.value=Math.max(e.responseStart-Wc(),0),n.entries=[e],r(!0))})},Ml={},Nl={},Pl,Fl,Il,Ll;function Rl(e,t=!1){return Jl(`cls`,e,Wl,Pl,t)}function zl(e,t=!1){return Jl(`lcp`,e,Gl,Fl,t)}function Bl(e){return Jl(`ttfb`,e,Kl,Il)}function Vl(e){return Jl(`inp`,e,ql,Ll)}function Hl(e,t){return Xl(e,t),Nl[e]||(Yl(e),Nl[e]=!0),Zl(e,t)}function Ul(e,t){let n=Ml[e];if(n?.length)for(let r of n)try{r(t)}catch(t){zc&&O.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${L(r)}\nError:`,t)}}function Wl(){return ul(e=>{Ul(`cls`,{metric:e}),Pl=e},{reportAllChanges:!0})}function Gl(){return Ol(e=>{Ul(`lcp`,{metric:e}),Fl=e},{reportAllChanges:!0})}function Kl(){return jl(e=>{Ul(`ttfb`,{metric:e}),Il=e})}function ql(){return Tl(e=>{Ul(`inp`,{metric:e}),Ll=e})}function Jl(e,t,n,r,i=!1){Xl(e,t);let a;return Nl[e]||(a=n(),Nl[e]=!0),r&&t({metric:r}),Zl(e,t,i?a:void 0)}function Yl(e){let t={};e===`event`&&(t.durationThreshold=0),il(e,t=>{Ul(e,{entries:t})},t)}function Xl(e,t){Ml[e]=Ml[e]||[],Ml[e].push(t)}function Zl(e,t,n){return()=>{n&&n();let r=Ml[e];if(!r)return;let i=r.indexOf(t);i!==-1&&r.splice(i,1)}}function Ql(e){return`duration`in e}var $l=e=>{let t=t=>{(t.type===`pagehide`||Bc.document?.visibilityState===`hidden`)&&e(t)};Gc(`visibilitychange`,t,{capture:!0,once:!0}),Gc(`pagehide`,t,{capture:!0,once:!0})};function eu(e){return typeof e==`number`&&isFinite(e)}function tu(e,t,n,{...r}){let i=Un(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime==`function`&&e.updateStartTime(t),ii(e,()=>{let e=ri({startTime:t,...r});return e&&e.end(n),e})}function nu(e){let t=Ht();if(!t)return;let{name:n,transaction:r,attributes:i,startTime:a}=e,{release:o,environment:s,sendDefaultPii:c}=t.getOptions(),l=t.getIntegrationByName(`Replay`)?.getReplayId(),u=Rt(),d=u.getUser(),f=d===void 0?void 0:d.email||d.id||d.ip_address,p;try{p=u.getScopeData().contexts.profile.profile_id}catch{}return ri({name:n,attributes:{release:o,environment:s,user:f||void 0,profile_id:p||void 0,replay_id:l||void 0,transaction:r,"user_agent.original":Bc.navigator?.userAgent,"client.address":c?`{{auto}}`:void 0,...i},startTime:a,experimental:{standalone:!0}})}function ru(){return Bc.addEventListener&&Bc.performance}function iu(e){return e/1e3}function au(e){let t=`unknown`,n=`unknown`,r=``;for(let i of e){if(i===`/`){[t,n]=e.split(`/`);break}if(!isNaN(Number(i))){t=r===`h`?`http`:r,n=e.split(r)[1];break}r+=i}return r===e&&(t=r),{name:t,version:n}}function ou(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function su(e,t){let n,r=!1;function i(e){!r&&n&&t(e,n),r=!0}$l(()=>{i(`pagehide`)});let a=e.on(`beforeStartNavigationSpan`,(e,t)=>{t?.isRedirect||(i(`navigation`),a(),o())}),o=e.on(`afterStartPageLoadSpan`,e=>{n=e.spanContext().spanId,o()})}function cu(e){let t=0,n;if(!ou(`layout-shift`))return;let r=Rl(({metric:e})=>{let r=e.entries[e.entries.length-1];r&&(t=e.value,n=r)},!0);su(e,(e,i)=>{lu(t,n,i,e),r()})}function lu(e,t,n,r){zc&&O.log(`Sending CLS span (${e})`);let i=t?iu((lt()||0)+t.startTime):ot(),a=Rt().getScopeData().transactionName,o=t?Ee(t.sources[0]?.node):`Layout shift`,s={[Jt]:`auto.http.browser.cls`,[qt]:`ui.webvital.cls`,[en]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((e,t)=>{s[`cls.source.${t+1}`]=Ee(e.node)});let c=nu({name:o,transaction:a,attributes:s,startTime:i});c&&(c.addEvent(`cls`,{[Xt]:``,[Zt]:e}),c.end(i))}function uu(e){let t=0,n;if(!ou(`largest-contentful-paint`))return;let r=zl(({metric:e})=>{let r=e.entries[e.entries.length-1];r&&(t=e.value,n=r)},!0);su(e,(e,i)=>{du(t,n,i,e),r()})}function du(e,t,n,r){zc&&O.log(`Sending LCP span (${e})`);let i=iu((lt()||0)+(t?.startTime||0)),a=Rt().getScopeData().transactionName,o=t?Ee(t.element):`Largest contentful paint`,s={[Jt]:`auto.http.browser.lcp`,[qt]:`ui.webvital.lcp`,[en]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(s[`lcp.element`]=Ee(t.element)),t.id&&(s[`lcp.id`]=t.id),t.url&&(s[`lcp.url`]=t.url),t.loadTime!=null&&(s[`lcp.loadTime`]=t.loadTime),t.renderTime!=null&&(s[`lcp.renderTime`]=t.renderTime),t.size!=null&&(s[`lcp.size`]=t.size));let c=nu({name:o,transaction:a,attributes:s,startTime:i});c&&(c.addEvent(`lcp`,{[Xt]:`millisecond`,[Zt]:e}),c.end(i))}function fu(e){return e&&((lt()||performance.timeOrigin)+e)/1e3}function pu(e){let t={};if(e.nextHopProtocol!=null){let{name:n,version:r}=au(e.nextHopProtocol);t[`network.protocol.version`]=r,t[`network.protocol.name`]=n}return lt()||ru()?.timeOrigin?mu({...t,"http.request.redirect_start":fu(e.redirectStart),"http.request.redirect_end":fu(e.redirectEnd),"http.request.worker_start":fu(e.workerStart),"http.request.fetch_start":fu(e.fetchStart),"http.request.domain_lookup_start":fu(e.domainLookupStart),"http.request.domain_lookup_end":fu(e.domainLookupEnd),"http.request.connect_start":fu(e.connectStart),"http.request.secure_connection_start":fu(e.secureConnectionStart),"http.request.connection_end":fu(e.connectEnd),"http.request.request_start":fu(e.requestStart),"http.request.response_start":fu(e.responseStart),"http.request.response_end":fu(e.responseEnd),"http.request.time_to_first_byte":e.responseStart==null?void 0:e.responseStart/1e3}):t}function mu(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!=null))}var hu=2147483647,gu=0,_u={},vu,yu;function bu({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){let r=ru();if(r&&lt()){r.mark&&Bc.performance.mark(`sentry-tracing-init`);let i=t?uu(n):Tu(),a=Eu(),o=e?cu(n):wu();return()=>{i?.(),a(),o?.()}}return()=>void 0}function xu(){Hl(`longtask`,({entries:e})=>{let t=er();if(!t)return;let{op:n,start_timestamp:r}=Un(t);for(let i of e){let e=iu(lt()+i.startTime),a=iu(i.duration);n===`navigation`&&r&&e<r||tu(t,e,e+a,{name:`Main UI thread blocked`,op:`ui.long-task`,attributes:{[Jt]:`auto.ui.browser.metrics`}})}})}function Su(){new PerformanceObserver(e=>{let t=er();if(t)for(let n of e.getEntries()){if(!n.scripts[0])continue;let e=iu(lt()+n.startTime),{start_timestamp:r,op:i}=Un(t);if(i===`navigation`&&r&&e<r)continue;let a=iu(n.duration),o={[Jt]:`auto.ui.browser.metrics`},{invoker:s,invokerType:c,sourceURL:l,sourceFunctionName:u,sourceCharPosition:d}=n.scripts[0];o[`browser.script.invoker`]=s,o[`browser.script.invoker_type`]=c,l&&(o[`code.filepath`]=l),u&&(o[`code.function`]=u),d!==-1&&(o[`browser.script.source_char_position`]=d),tu(t,e,e+a,{name:`Main UI thread blocked`,op:`ui.long-animation-frame`,attributes:o})}}).observe({type:`long-animation-frame`,buffered:!0})}function Cu(){Hl(`event`,({entries:e})=>{let t=er();if(t){for(let n of e)if(n.name===`click`){let e=iu(lt()+n.startTime),r=iu(n.duration),i={name:Ee(n.target),op:`ui.interaction.${n.name}`,startTime:e,attributes:{[Jt]:`auto.ui.browser.metrics`}},a=ke(n.target);a&&(i.attributes[`ui.component_name`]=a),tu(t,e,e+r,i)}}})}function wu(){return Rl(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(_u.cls={value:e.value,unit:``},yu=t)},!0)}function Tu(){return zl(({metric:e})=>{let t=e.entries[e.entries.length-1];t&&(_u.lcp={value:e.value,unit:`millisecond`},vu=t)},!0)}function Eu(){return Bl(({metric:e})=>{e.entries[e.entries.length-1]&&(_u.ttfb={value:e.value,unit:`millisecond`})})}function Du(e,t){let n=ru(),r=lt();if(!n?.getEntries||!r)return;let i=iu(r),a=n.getEntries(),{op:o,start_timestamp:s}=Un(e);a.slice(gu).forEach(n=>{let r=iu(n.startTime),a=iu(Math.max(0,n.duration));if(!(o===`navigation`&&s&&i+r<s))switch(n.entryType){case`navigation`:ju(e,n,i);break;case`mark`:case`paint`:case`measure`:{ku(e,n,r,a,i,t.ignorePerformanceApiSpans);let o=Zc(),s=n.startTime<o.firstHiddenTime;n.name===`first-paint`&&s&&(_u.fp={value:n.startTime,unit:`millisecond`}),n.name===`first-contentful-paint`&&s&&(_u.fcp={value:n.startTime,unit:`millisecond`});break}case`resource`:Fu(e,n,n.name,r,a,i,t.ignoreResourceSpans);break}}),gu=Math.max(a.length-1,0),Iu(e),o===`pageload`&&(zu(_u),t.recordClsOnPageloadSpan||delete _u.cls,t.recordLcpOnPageloadSpan||delete _u.lcp,Object.entries(_u).forEach(([e,t])=>{Wr(e,t.value,t.unit)}),e.setAttribute(`performance.timeOrigin`,i),e.setAttribute(`performance.activationStart`,Wc()),Lu(e,t)),vu=void 0,yu=void 0,_u={}}function Ou(e){if(e?.entryType===`measure`)try{return e.detail.devtools.track===`Components ⚛`}catch{return}}function ku(e,t,n,r,i,a){if(Ou(t)||[`mark`,`measure`].includes(t.entryType)&&Ge(t.name,a))return;let o=Uc(!1),s=iu(o?o.requestStart:0),c=i+Math.max(n,s),l=i+n,u=l+r,d={[Jt]:`auto.resource.browser.metrics`};c!==l&&(d[`sentry.browser.measure_happened_before_request`]=!0,d[`sentry.browser.measure_start_time`]=c),Au(d,t),c<=u&&tu(e,c,u,{name:t.name,op:t.entryType,attributes:d})}function Au(e,t){try{let n=t.detail;if(!n)return;if(typeof n==`object`){for(let[t,r]of Object.entries(n))if(r&&me(r))e[`sentry.browser.measure.detail.${t}`]=r;else if(r!==void 0)try{e[`sentry.browser.measure.detail.${t}`]=JSON.stringify(r)}catch{}return}if(me(n)){e[`sentry.browser.measure.detail`]=n;return}try{e[`sentry.browser.measure.detail`]=JSON.stringify(n)}catch{}}catch{}}function ju(e,t,n){[`unloadEvent`,`redirect`,`domContentLoadedEvent`,`loadEvent`,`connect`].forEach(r=>{Mu(e,t,r,n)}),Mu(e,t,`secureConnection`,n,`TLS/SSL`),Mu(e,t,`fetch`,n,`cache`),Mu(e,t,`domainLookup`,n,`DNS`),Pu(e,t,n)}function Mu(e,t,n,r,i=n){let a=t[Nu(n)],o=t[`${n}Start`];!o||!a||tu(e,r+iu(o),r+iu(a),{op:`browser.${i}`,name:t.name,attributes:{[Jt]:`auto.ui.browser.metrics`,...n===`redirect`&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function Nu(e){return e===`secureConnection`?`connectEnd`:e===`fetch`?`domainLookupStart`:`${e}End`}function Pu(e,t,n){let r=n+iu(t.requestStart),i=n+iu(t.responseEnd),a=n+iu(t.responseStart);t.responseEnd&&(tu(e,r,i,{op:`browser.request`,name:t.name,attributes:{[Jt]:`auto.ui.browser.metrics`}}),tu(e,a,i,{op:`browser.response`,name:t.name,attributes:{[Jt]:`auto.ui.browser.metrics`}}))}function Fu(e,t,n,r,i,a,o){if(t.initiatorType===`xmlhttprequest`||t.initiatorType===`fetch`)return;let s=t.initiatorType?`resource.${t.initiatorType}`:`resource.other`;if(o?.includes(s))return;let c={[Jt]:`auto.resource.browser.metrics`},l=Fo(n);l.protocol&&(c[`url.scheme`]=l.protocol.split(`:`).pop()),l.host&&(c[`server.address`]=l.host),c[`url.same_origin`]=n.includes(Bc.location.origin),Ru(t,c,[[`responseStatus`,`http.response.status_code`],[`transferSize`,`http.response_transfer_size`],[`encodedBodySize`,`http.response_content_length`],[`decodedBodySize`,`http.decoded_response_content_length`],[`renderBlockingStatus`,`resource.render_blocking_status`],[`deliveryType`,`http.response_delivery_type`]]);let u={...c,...pu(t)},d=a+r;tu(e,d,d+i,{name:n.replace(Bc.location.origin,``),op:s,attributes:u})}function Iu(e){let t=Bc.navigator;if(!t)return;let n=t.connection;n&&(n.effectiveType&&e.setAttribute(`effectiveConnectionType`,n.effectiveType),n.type&&e.setAttribute(`connectionType`,n.type),eu(n.rtt)&&(_u[`connection.rtt`]={value:n.rtt,unit:`millisecond`})),eu(t.deviceMemory)&&e.setAttribute(`deviceMemory`,`${t.deviceMemory} GB`),eu(t.hardwareConcurrency)&&e.setAttribute(`hardwareConcurrency`,String(t.hardwareConcurrency))}function Lu(e,t){vu&&t.recordLcpOnPageloadSpan&&(vu.element&&e.setAttribute(`lcp.element`,Ee(vu.element)),vu.id&&e.setAttribute(`lcp.id`,vu.id),vu.url&&e.setAttribute(`lcp.url`,vu.url.trim().slice(0,200)),vu.loadTime!=null&&e.setAttribute(`lcp.loadTime`,vu.loadTime),vu.renderTime!=null&&e.setAttribute(`lcp.renderTime`,vu.renderTime),e.setAttribute(`lcp.size`,vu.size)),yu?.sources&&t.recordClsOnPageloadSpan&&yu.sources.forEach((t,n)=>e.setAttribute(`cls.source.${n+1}`,Ee(t.node)))}function Ru(e,t,n){n.forEach(([n,r])=>{let i=e[n];i!=null&&(typeof i==`number`&&i<hu||typeof i==`string`)&&(t[r]=i)})}function zu(e){let t=Uc(!1);if(!t)return;let{responseStart:n,requestStart:r}=t;r<=n&&(e[`ttfb.requestTime`]={value:n-r,unit:`millisecond`})}var Bu=1e3,Vu,Hu,Uu;function Wu(e){V(`dom`,e),H(`dom`,Gu)}function Gu(){if(!Bc.document)return;let e=U.bind(null,`dom`),t=Ju(e,!0);Bc.document.addEventListener(`click`,t,!1),Bc.document.addEventListener(`keypress`,t,!1),[`EventTarget`,`Node`].forEach(t=>{let n=Bc[t]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(Ae(n,`addEventListener`,function(t){return function(n,r,i){if(n===`click`||n==`keypress`)try{let r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=r[n]=r[n]||{refCount:0};if(!a.handler){let r=Ju(e);a.handler=r,t.call(this,n,r,i)}a.refCount++}catch{}return t.call(this,n,r,i)}}),Ae(n,`removeEventListener`,function(e){return function(t,n,r){if(t===`click`||t==`keypress`)try{let n=this.__sentry_instrumentation_handlers__||{},i=n[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete n[t]),Object.keys(n).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function Ku(e){if(e.type!==Hu)return!1;try{if(!e.target||e.target._sentryId!==Uu)return!1}catch{}return!0}function qu(e,t){return e===`keypress`?t?.tagName?!(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable):!0:!1}function Ju(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;let r=Yu(n);if(qu(n.type,r))return;je(n,`_sentryCaptured`,!0),r&&!r._sentryId&&je(r,`_sentryId`,Ye());let i=n.type===`keypress`?`input`:n.type;Ku(n)||(e({event:n,name:i,global:t}),Hu=n.type,Uu=r?r._sentryId:void 0),clearTimeout(Vu),Vu=Bc.setTimeout(()=>{Uu=void 0,Hu=void 0},Bu)}}function Yu(e){try{return e.target}catch{return null}}var Xu;function Zu(e){let t=`history`;V(t,e),H(t,Qu)}function Qu(){if(Bc.addEventListener(`popstate`,()=>{let e=Bc.location.href,t=Xu;Xu=e,t!==e&&U(`history`,{from:t,to:e})}),!Xs())return;function e(e){return function(...t){let n=t.length>2?t[2]:void 0;if(n){let r=Xu,i=$u(String(n));if(Xu=i,r===i)return e.apply(this,t);U(`history`,{from:r,to:i})}return e.apply(this,t)}}Ae(Bc.history,`pushState`,e),Ae(Bc.history,`replaceState`,e)}function $u(e){try{return new URL(e,Bc.location.origin).toString()}catch{return e}}var ed={};function td(e){let t=ed[e];if(t)return t;let n=Bc[e];if(Qs(n))return ed[e]=n.bind(Bc);let r=Bc.document;if(r&&typeof r.createElement==`function`)try{let t=r.createElement(`iframe`);t.hidden=!0,r.head.appendChild(t);let i=t.contentWindow;i?.[e]&&(n=i[e]),r.head.removeChild(t)}catch(t){zc&&O.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n&&(ed[e]=n.bind(Bc))}function nd(e){ed[e]=void 0}var rd=`__sentry_xhr_v3__`;function id(e){V(`xhr`,e),H(`xhr`,ad)}function ad(){if(!Bc.XMLHttpRequest)return;let e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){let r=Error(),i=ot()*1e3,a=fe(n[0])?n[0].toUpperCase():void 0,o=od(n[1]);if(!a||!o)return e.apply(t,n);t[rd]={method:a,url:o,request_headers:{}},a===`POST`&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);let s=()=>{let e=t[rd];if(e&&t.readyState===4){try{e.status_code=t.status}catch{}U(`xhr`,{endTimestamp:ot()*1e3,startTimestamp:i,xhr:t,virtualError:r})}};return`onreadystatechange`in t&&typeof t.onreadystatechange==`function`?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply(e,t,n){return s(),e.apply(t,n)}}):t.addEventListener(`readystatechange`,s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){let[r,i]=n,a=t[rd];return a&&fe(r)&&fe(i)&&(a.request_headers[r.toLowerCase()]=i),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){let r=t[rd];return r?(n[0]!==void 0&&(r.body=n[0]),U(`xhr`,{startTimestamp:ot()*1e3,xhr:t}),e.apply(t,n)):e.apply(t,n)}})}function od(e){if(fe(e))return e;try{return e.toString()}catch{}}function sd(e){let t;try{t=e.getAllResponseHeaders()}catch(t){return zc&&O.error(t,`Failed to get xhr response headers`,e),{}}return t?t.split(`\r
5
+ `).reduce((e,t)=>{let[n,r]=t.split(`: `);return r&&(e[n.toLowerCase()]=r),e},{}):{}}var cd=[],ld=new Map,ud=new Map,dd=60;function fd(){if(ru()&&lt()){let e=md();return()=>{e()}}return()=>void 0}var pd={click:`click`,pointerdown:`click`,pointerup:`click`,mousedown:`click`,mouseup:`click`,touchstart:`click`,touchend:`click`,mouseover:`hover`,mouseout:`hover`,mouseenter:`hover`,mouseleave:`hover`,pointerover:`hover`,pointerout:`hover`,pointerenter:`hover`,pointerleave:`hover`,dragstart:`drag`,dragend:`drag`,drag:`drag`,dragenter:`drag`,dragleave:`drag`,dragover:`drag`,drop:`drag`,keydown:`press`,keyup:`press`,keypress:`press`,input:`press`};function md(){return Vl(hd)}var hd=({metric:e})=>{if(e.value==null)return;let t=iu(e.value);if(t>dd)return;let n=e.entries.find(t=>t.duration===e.value&&pd[t.name]);if(!n)return;let{interactionId:r}=n,i=pd[n.name],a=iu(lt()+n.startTime),o=er(),s=o?$n(o):void 0,c=r==null?void 0:ld.get(r),l=c?.span||s,u=l?Un(l).description:Rt().getScopeData().transactionName,d=nu({name:c?.elementName||Ee(n.target),transaction:u,attributes:{[Jt]:`auto.http.browser.inp`,[qt]:`ui.interaction.${i}`,[en]:n.duration},startTime:a});d&&(d.addEvent(`inp`,{[Xt]:`millisecond`,[Zt]:e.value}),d.end(a+t))};function gd(){let e=Object.keys(pd);fc()&&e.forEach(e=>{Bc.addEventListener(e,t,{capture:!0,passive:!0})});function t(e){let t=e.target;if(!t)return;let n=Ee(t),r=Math.round(e.timeStamp);if(ud.set(r,n),ud.size>50){let e=ud.keys().next().value;e!==void 0&&ud.delete(e)}}function n(e){let t=Math.round(e.startTime),n=ud.get(t);if(!n)for(let e=-5;e<=5;e++){let r=ud.get(t+e);if(r){n=r;break}}return n||`<unknown>`}let r=({entries:e})=>{let t=er(),r=t&&$n(t);e.forEach(e=>{if(!Ql(e))return;let t=e.interactionId;if(t==null||ld.has(t))return;let i=e.target?Ee(e.target):n(e);if(cd.length>10){let e=cd.shift();ld.delete(e)}cd.push(t),ld.set(t,{span:r,elementName:i})})};Hl(`event`,r),Hl(`first-input`,r)}var _d=40;function vd(e,t=td(`fetch`)){let n=0,r=0;async function i(i){let a=i.body.length;n+=a,r++;let o={body:i.body,method:`POST`,referrerPolicy:`strict-origin`,headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{let n=await t(e.url,o);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get(`X-Sentry-Rate-Limits`),"retry-after":n.headers.get(`Retry-After`)}}}catch(e){throw nd(`fetch`),e}finally{n-=a,r--}}return to(e,i,Ya(e.bufferSize||_d))}var yd=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__,bd=30,xd=50;function Sd(e,t,n,r){let i={filename:e,function:t===`<anonymous>`?`?`:t,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var Cd=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,wd=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Td=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ed=/at (.+?) ?\(data:(.+?),/,Dd=[bd,e=>{let t=e.match(Ed);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};let n=Cd.exec(e);if(n){let[,e,t,r]=n;return Sd(e,`?`,+t,+r)}let r=wd.exec(e);if(r){if(r[2]?.indexOf(`eval`)===0){let e=Td.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}let[e,t]=jd(r[1]||`?`,r[2]);return Sd(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],Od=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,kd=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Ad=M(Dd,[xd,e=>{let t=Od.exec(e);if(t){if(t[3]&&t[3].indexOf(` > eval`)>-1){let e=kd.exec(t[3]);e&&(t[1]=t[1]||`eval`,t[3]=e[1],t[4]=e[2],t[5]=``)}let e=t[3],n=t[1]||`?`;return[n,e]=jd(n,e),Sd(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}]),jd=(e,t)=>{let n=e.indexOf(`safari-extension`)!==-1,r=e.indexOf(`safari-web-extension`)!==-1;return n||r?[e.indexOf(`@`)===-1?`?`:e.split(`@`)[0],n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Md=1024,Nd=`Breadcrumbs`,Pd=ga(((e={})=>{let t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:Nd,setup(e){t.console&&hs(Ld(e)),t.dom&&Wu(Id(e,t.dom)),t.xhr&&id(Rd(e)),t.fetch&&ec(zd(e)),t.history&&Zu(Bd(e)),t.sentry&&e.on(`beforeSendEvent`,Fd(e))}}}));function Fd(e){return function(t){Ht()===e&&Ko({category:`sentry.${t.type===`transaction`?`transaction`:`event`}`,event_id:t.event_id,level:t.level,message:Ze(t)},{event:t})}}function Id(e,t){return function(n){if(Ht()!==e)return;let r,i,a=typeof t==`object`?t.serializeAttribute:void 0,o=typeof t==`object`&&typeof t.maxStringLength==`number`?t.maxStringLength:void 0;o&&o>Md&&(yd&&O.warn(`\`dom.maxStringLength\` cannot exceed ${Md}, but a value of ${o} was configured. Sentry will use ${Md} instead.`),o=Md),typeof a==`string`&&(a=[a]);try{let e=n.event,t=Vd(e)?e.target:e;r=Ee(t,{keyAttrs:a,maxStringLength:o}),i=ke(t)}catch{r=`<unknown>`}if(r.length===0)return;let s={category:`ui.${n.name}`,message:r};i&&(s.data={"ui.component_name":i}),Ko(s,{event:n.event,name:n.name,global:n.global})}}function Ld(e){return function(t){if(Ht()!==e)return;let n={category:`console`,data:{arguments:t.args,logger:`console`},level:_s(t.level),message:Ue(t.args,` `)};if(t.level===`assert`)if(t.args[0]===!1)n.message=`Assertion failed: ${Ue(t.args.slice(1),` `)||`console.assert`}`,n.data.arguments=t.args.slice(1);else return;Ko(n,{input:t.args,level:t.level})}}function Rd(e){return function(t){if(Ht()!==e)return;let{startTimestamp:n,endTimestamp:r}=t,i=t.xhr[rd];if(!n||!r||!i)return;let{method:a,url:o,status_code:s,body:c}=i,l={method:a,url:o,status_code:s},u={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},d={category:`xhr`,data:l,type:`http`,level:Js(s)};e.emit(`beforeOutgoingRequestBreadcrumb`,d,u),Ko(d,u)}}function zd(e){return function(t){if(Ht()!==e)return;let{startTimestamp:n,endTimestamp:r}=t;if(r&&!(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method===`POST`))if(t.error){let i={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},a={category:`fetch`,data:t.fetchData,level:`error`,type:`http`};e.emit(`beforeOutgoingRequestBreadcrumb`,a,i),Ko(a,i)}else{let i=t.response,a={...t.fetchData,status_code:i?.status},o={input:t.args,response:i,startTimestamp:n,endTimestamp:r},s={category:`fetch`,data:a,type:`http`,level:Js(a.status_code)};e.emit(`beforeOutgoingRequestBreadcrumb`,s,o),Ko(s,o)}}}function Bd(e){return function(t){if(Ht()!==e)return;let n=t.from,r=t.to,i=Fo(mc.location.href),a=n?Fo(n):void 0,o=Fo(r);a?.path||(a=i),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),i.protocol===a.protocol&&i.host===a.host&&(n=a.relative),Ko({category:`navigation`,data:{from:n,to:r}})}}function Vd(e){return!!e&&!!e.target}var Hd=`EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload`.split(`,`),Ud=`BrowserApiErrors`,Wd=ga(((e={})=>{let t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:Ud,setupOnce(){t.setTimeout&&Ae(mc,`setTimeout`,Gd),t.setInterval&&Ae(mc,`setInterval`,Gd),t.requestAnimationFrame&&Ae(mc,`requestAnimationFrame`,Kd),t.XMLHttpRequest&&`XMLHttpRequest`in mc&&Ae(XMLHttpRequest.prototype,`send`,qd);let e=t.eventTarget;e&&(Array.isArray(e)?e:Hd).forEach(e=>Jd(e,t))}}}));function Gd(e){return function(...t){let n=t[0];return t[0]=vc(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${L(e)}`}}),e.apply(this,t)}}function Kd(e){return function(t){return e.apply(this,[vc(t,{mechanism:{data:{handler:L(e)},handled:!1,type:`auto.browser.browserapierrors.requestAnimationFrame`}})])}}function qd(e){return function(...t){let n=this;return[`onload`,`onerror`,`onprogress`,`onreadystatechange`].forEach(e=>{e in n&&typeof n[e]==`function`&&Ae(n,e,function(t){let n={mechanism:{data:{handler:L(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=Ne(t);return r&&(n.mechanism.data.handler=L(r)),vc(t,n)})}),e.apply(this,t)}}function Jd(e,t){let n=mc[e]?.prototype;n?.hasOwnProperty?.(`addEventListener`)&&(Ae(n,`addEventListener`,function(n){return function(r,i,a){try{Yd(i)&&(i.handleEvent=vc(i.handleEvent,{mechanism:{data:{handler:L(i),target:e},handled:!1,type:`auto.browser.browserapierrors.handleEvent`}}))}catch{}return t.unregisterOriginalCallbacks&&Xd(this,r,i),n.apply(this,[r,vc(i,{mechanism:{data:{handler:L(i),target:e},handled:!1,type:`auto.browser.browserapierrors.addEventListener`}}),a])}}),Ae(n,`removeEventListener`,function(e){return function(t,n,r){try{let i=n.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch{}return e.call(this,t,n,r)}}))}function Yd(e){return typeof e.handleEvent==`function`}function Xd(e,t,n){e&&typeof e==`object`&&`removeEventListener`in e&&typeof e.removeEventListener==`function`&&e.removeEventListener(t,n)}var Zd=ga((e={})=>{let t=e.lifecycle??`route`;return{name:`BrowserSession`,setupOnce(){if(mc.document===void 0){yd&&O.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}na({ignoreDuration:!0}),aa();let e=zt(),n=e.getUser();e.addScopeListener(e=>{let t=e.getUser();(n?.id!==t?.id||n?.ip_address!==t?.ip_address)&&(aa(),n=t)}),t===`route`&&Zu(({from:e,to:t})=>{e!==t&&(na({ignoreDuration:!0}),aa())})}}}),Qd=`CultureContext`,$d=ga((()=>({name:Qd,preprocessEvent(e){let t=ef();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})}})));function ef(){try{let e=mc.Intl;if(!e)return;let t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}var tf=`GlobalHandlers`,nf=ga(((e={})=>{let t={onerror:!0,onunhandledrejection:!0,...e};return{name:tf,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(rf(e),lf(`onerror`)),t.onunhandledrejection&&(af(e),lf(`onunhandledrejection`))}}}));function rf(e){te(t=>{let{stackParser:n,attachStacktrace:r}=uf();if(Ht()!==e||gc())return;let{msg:i,url:a,line:o,column:s,error:c}=t,l=cf(Mc(n,c||i,void 0,r,!1),a,o,s);l.level=`error`,$i(l,{originalException:c,mechanism:{handled:!1,type:`auto.browser.global_handlers.onerror`}})})}function af(e){ie(t=>{let{stackParser:n,attachStacktrace:r}=uf();if(Ht()!==e||gc())return;let i=of(t),a=me(i)?sf(i):Mc(n,i,void 0,r,!0);a.level=`error`,$i(a,{originalException:i,mechanism:{handled:!1,type:`auto.browser.global_handlers.onunhandledrejection`}})})}function of(e){if(me(e))return e;try{if(`reason`in e)return e.reason;if(`detail`in e&&`reason`in e.detail)return e.detail.reason}catch{}return e}function sf(e){return{exception:{values:[{type:`UnhandledRejection`,value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function cf(e,t,n,r){let i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},c=s.frames=s.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:df(t)??Oe(),function:`?`,in_app:!0}),e}function lf(e){yd&&O.log(`Global Handler attached: ${e}`)}function uf(){return Ht()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function df(e){if(!(!fe(e)||e.length===0))return e.startsWith(`data:`)?`<${Lo(e,!1)}>`:e}var ff=ga(()=>({name:`HttpContext`,preprocessEvent(e){if(!mc.navigator&&!mc.location&&!mc.document)return;let t=yc(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}})),pf=`cause`,mf=5,hf=`LinkedErrors`,gf=ga(((e={})=>{let t=e.limit||mf,n=e.key||pf;return{name:hf,preprocessEvent(e,r,i){us(bc,i.getOptions().stackParser,n,t,e,r)}}}));function _f(){return vf()?(yd&&y(()=>{console.error(`[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/`)}),!0):!1}function vf(){if(mc.window===void 0)return!1;let e=mc;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;let t=Oe();return!(mc===mc.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(t))}function yf(e){return[es(),Xo(),Ds(),Wd(),Pd(),nf(),gf(),ys(),ff(),$d(),Zd()]}function bf(e={}){let t=!e.skipBrowserExtensionCheck&&_f(),n=e.defaultIntegrations==null?yf():e.defaultIntegrations;return ko(Lc,{...e,enabled:t?!1:e.enabled,stackParser:N(e.stackParser||Ad),integrations:fa({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||vd})}function xf(e){return e.split(`,`).some(e=>e.trim().startsWith(`sentry-`))}function Sf(e){try{return new URL(e,mc.location.origin).href}catch{return}}function Cf(e){return e.entryType===`resource`&&`initiatorType`in e&&typeof e.nextHopProtocol==`string`&&(e.initiatorType===`fetch`||e.initiatorType===`xmlhttprequest`)}function wf(e){try{return new Headers(e)}catch{return}}var Tf=new WeakMap,Ef=new Map,Df={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function Of(e,t){let{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:i,shouldCreateSpanForRequest:a,enableHTTPTimings:o,tracePropagationTargets:s,onRequestSpanStart:c,onRequestSpanEnd:l}={...Df,...t},u=typeof a==`function`?a:e=>!0,d=e=>Af(e,s),f={},p=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(e=>(e.type===`transaction`&&e.spans&&e.spans.forEach(e=>{if(e.op===`http.client`){let t=Ef.get(e.span_id);t&&(e.timestamp=t/1e3,Ef.delete(e.span_id))}}),e)),i&&tc(e=>{if(e.response){let t=Tf.get(e.response);t&&e.endTimestamp&&Ef.set(t,e.endTimestamp)}}),ec(e=>{let t=Os(e,u,d,f,{propagateTraceparent:p,onRequestSpanEnd:l});if(e.response&&e.fetchData.__span&&Tf.set(e.response,e.fetchData.__span),t){let n=Sf(e.fetchData.url),r=n?Fo(n).host:void 0;t.setAttributes({"http.url":n?Lo(n):void 0,"server.address":r}),o&&kf(t),c?.(t,{headers:e.headers})}})),r&&id(e=>{let t=jf(e,u,d,f,p,l);t&&(o&&kf(t),c?.(t,{headers:wf(e.xhr.__sentry_xhr_v3__?.request_headers)}))})}function kf(e){let{url:t}=Un(e).data;if(!t||typeof t!=`string`)return;let n=Hl(`resource`,({entries:r})=>{r.forEach(r=>{Cf(r)&&r.name.endsWith(t)&&(e.setAttributes(pu(r)),setTimeout(n))})})}function Af(e,t){let n=Oe();if(n){let r,i;try{r=new URL(e,n),i=new URL(n).origin}catch{return!1}let a=r.origin===i;return t?Ge(r.toString(),t)||a&&Ge(r.pathname,t):a}else{let n=!!e.match(/^\/(?!\/)/);return t?Ge(e,t):n}}function jf(e,t,n,r,i,a){let o=e.xhr,s=o?.[rd];if(!o||o.__sentry_own_request__||!s)return;let{url:c,method:l}=s,u=ir()&&t(c);if(e.endTimestamp){let t=o.__sentry_xhr_span_id__;if(!t)return;let n=r[t];n&&(u&&s.status_code!==void 0&&(an(n,s.status_code),n.end(),a?.(n,{headers:wf(sd(o)),error:e.error})),delete r[t]);return}let d=Sf(c),f=Fo(d||c),p=Lo(Io(c)),m=!!er(),h=u&&m?ri({name:`${l} ${p}`,attributes:{url:Lo(c),type:`xhr`,"http.method":l,"http.url":d?Lo(d):void 0,"server.address":f?.host,[Jt]:`auto.http.browser`,[qt]:`http.client`,...f?.search&&{"http.query":f?.search},...f?.hash&&{"http.fragment":f?.hash}}}):new hr;o.__sentry_xhr_span_id__=h.spanContext().spanId,r[o.__sentry_xhr_span_id__]=h,n(c)&&Mf(o,ir()&&m?h:void 0,i);let g=Ht();return g&&g.emit(`beforeOutgoingRequestSpan`,h,e),h}function Mf(e,t,n){let{"sentry-trace":r,baggage:i,traceparent:a}=Ho({span:t,propagateTraceparent:n});r&&Nf(e,r,i,a)}function Nf(e,t,n,r){let i=e.__sentry_xhr_v3__?.request_headers;if(!(i?.[`sentry-trace`]||!e.setRequestHeader))try{if(e.setRequestHeader(`sentry-trace`,t),r&&!i?.traceparent&&e.setRequestHeader(`traceparent`,r),n){let t=i?.baggage;(!t||!xf(t))&&e.setRequestHeader(`baggage`,n)}}catch{}}function Pf(){mc.document?mc.document.addEventListener(`visibilitychange`,()=>{let e=er();if(!e)return;let t=$n(e);if(mc.document.hidden&&t){let e=`cancelled`,{op:n,status:r}=Un(t);yd&&O.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus({code:2,message:e}),t.setAttribute(`sentry.cancellation_reason`,`document.hidden`),t.end()}}):yd&&O.warn(`[Tracing] Could not set up background tab detection due to lack of global document`)}var Ff=`sentry_previous_trace`,If=`sentry.previous_trace`;function Lf(e,{linkPreviousTrace:t,consistentTraceSampling:n}){let r=t===`session-storage`,i=r?Bf():void 0;e.on(`spanStart`,e=>{if($n(e)!==e)return;let t=Rt().getPropagationContext();i=Rf(i,e,t),r&&zf(i)});let a=!0;n&&e.on(`beforeSampling`,e=>{if(!i)return;let t=Rt(),n=t.getPropagationContext();if(a&&n.parentSpanId){a=!1;return}t.setPropagationContext({...n,dsc:{...n.dsc,sample_rate:String(i.sampleRate),sampled:String(Vf(i.spanContext))},sampleRand:i.sampleRand}),e.parentSampled=Vf(i.spanContext),e.parentSampleRate=i.sampleRate,e.spanAttributes={...e.spanAttributes,[Kt]:i.sampleRate}})}function Rf(e,t,n){let r=Un(t);function i(){try{return Number(n.dsc?.sample_rate)??Number(r.data?.[`sentry.sample_rate`])}catch{return 0}}let a={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:i(),sampleRand:n.sampleRand};if(!e)return a;let o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=3600&&(yd&&O.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[tn]:`previous_trace`}}),t.setAttribute(If,`${o.traceId}-${o.spanId}-${+!!Vf(o)}`)),a)}function zf(e){try{mc.sessionStorage.setItem(Ff,JSON.stringify(e))}catch(e){yd&&O.warn(`Could not store previous trace in sessionStorage`,e)}}function Bf(){try{let e=mc.sessionStorage?.getItem(Ff);return JSON.parse(e)}catch{return}}function Vf(e){return e.traceFlags===1}var Hf=`BrowserTracing`,Uf=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function Wf(){let e=mc.navigator;return e?.userAgent?Uf.test(e.userAgent):!1}var Gf={...fi,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:`in-memory`,consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...Df},Kf=((e={})=>{`enableElementTiming`in e&&y(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});let t={name:void 0,source:void 0},n=mc.document,{enableInp:r,enableLongTask:i,enableLongAnimationFrame:a,_experiments:{enableInteractions:o,enableStandaloneClsSpans:s,enableStandaloneLcpSpans:c},beforeStartSpan:l,idleTimeout:u,finalTimeout:f,childSpanTimeout:p,markBackgroundSpan:m,traceFetch:h,traceXHR:g,trackFetchStreamPerformance:_,shouldCreateSpanForRequest:v,enableHTTPTimings:b,ignoreResourceSpans:x,ignorePerformanceApiSpans:S,instrumentPageLoad:C,instrumentNavigation:w,detectRedirects:T,linkPreviousTrace:E,consistentTraceSampling:D,enableReportPageLoaded:k,onRequestSpanStart:A,onRequestSpanEnd:j}={...Gf,...e},M=Wf(),N,P,F;function I(e,r,i=!0){let a=r.op===`pageload`,o=r.name,d=l?l(r):r,m=d.attributes||{};if(o!==d.name&&(m[Wt]=`custom`,d.attributes=m),!i){let e=rt();ri({...d,startTime:e}).end(e);return}t.name=d.name,t.source=m[Wt];let h=_i(d,{idleTimeout:u,finalTimeout:f,childSpanTimeout:p,disableAutoFinish:a,beforeSpanEnd:t=>{N?.(),Du(t,{recordClsOnPageloadSpan:!s,recordLcpOnPageloadSpan:!c,ignoreResourceSpans:x,ignorePerformanceApiSpans:S}),ep(e,void 0);let n=Rt(),r=n.getPropagationContext();n.setPropagationContext({...r,traceId:h.spanContext().traceId,sampled:Kn(h),dsc:mr(t)}),a&&(F=void 0)},trimIdleSpanEndTimestamp:!k});a&&k&&(F=h),ep(e,h);function g(){n&&[`interactive`,`complete`].includes(n.readyState)&&e.emit(`idleSpanEnableAutoFinish`,h)}a&&!k&&n&&(n.addEventListener(`readystatechange`,()=>{g()}),g())}return{name:Hf,setup(e){if(M){yd&&O.log(`[Tracing] Skipping browserTracingIntegration setup for bot user agent.`);return}if(rr(),N=bu({recordClsStandaloneSpans:s||!1,recordLcpStandaloneSpans:c||!1,client:e}),r&&fd(),a&&d.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes(`long-animation-frame`)?Su():i&&xu(),o&&Cu(),T&&n){let e=()=>{P=ot()};addEventListener(`click`,e,{capture:!0}),addEventListener(`keydown`,e,{capture:!0,passive:!0})}function t(){let t=$f(e);t&&!Un(t).timestamp&&(yd&&O.log(`[Tracing] Finishing current active span with op: ${Un(t).op}`),t.setAttribute(Yt,`cancelled`),t.end())}e.on(`startNavigationSpan`,(n,r)=>{if(Ht()!==e)return;if(r?.isRedirect){yd&&O.warn(`[Tracing] Detected redirect, navigation span will not be the root span, but a child span.`),I(e,{op:`navigation.redirect`,...n},!1);return}P=void 0,t(),zt().setPropagationContext({traceId:ht(),sampleRand:Math.random(),propagationSpanId:ir()?void 0:gt()});let i=Rt();i.setPropagationContext({traceId:ht(),sampleRand:Math.random(),propagationSpanId:ir()?void 0:gt()}),i.setSDKProcessingMetadata({normalizedRequest:void 0}),I(e,{op:`navigation`,...n,parentSpan:null,forceTransaction:!0})}),e.on(`startPageLoadSpan`,(n,r={})=>{if(Ht()!==e)return;t();let i=jn(r.sentryTrace||Yf(`sentry-trace`)||Xf(`sentry-trace`),r.baggage||Yf(`baggage`)||Xf(`baggage`)),a=Rt();a.setPropagationContext(i),ir()||(a.getPropagationContext().propagationSpanId=gt()),a.setSDKProcessingMetadata({normalizedRequest:yc()}),I(e,{op:`pageload`,...n})}),e.on(`endPageloadSpan`,()=>{k&&F&&(F.setAttribute(Yt,`reportPageLoaded`),F.end())})},afterAllSetup(e){if(M)return;let n=Oe();if(E!==`off`&&Lf(e,{linkPreviousTrace:E,consistentTraceSampling:D}),mc.location){if(C){let t=lt();qf(e,{name:mc.location.pathname,startTime:t?t/1e3:void 0,attributes:{[Wt]:`url`,[Jt]:`auto.pageload.browser`}})}w&&Zu(({to:t,from:r})=>{if(r===void 0&&n?.indexOf(t)!==-1){n=void 0;return}n=void 0;let i=No(t),a=$f(e),o=a&&T&&np(a,P);Jf(e,{name:i?.pathname||mc.location.pathname,attributes:{[Wt]:`url`,[Jt]:`auto.navigation.browser`}},{url:t,isRedirect:o})})}m&&Pf(),o&&Zf(e,u,f,p,t),r&&gd(),Of(e,{traceFetch:h,traceXHR:g,trackFetchStreamPerformance:_,tracePropagationTargets:e.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:v,enableHTTPTimings:b,onRequestSpanStart:A,onRequestSpanEnd:j})}}});function qf(e,t,n){e.emit(`startPageLoadSpan`,t,n),Rt().setTransactionName(t.name);let r=$f(e);return r&&e.emit(`afterStartPageLoadSpan`,r),r}function Jf(e,t,n){let{url:r,isRedirect:i}=n||{};e.emit(`beforeStartNavigationSpan`,t,{isRedirect:i}),e.emit(`startNavigationSpan`,t,{isRedirect:i});let a=Rt();return a.setTransactionName(t.name),r&&!i&&a.setSDKProcessingMetadata({normalizedRequest:{...yc(),url:r}}),$f(e)}function Yf(e){return(mc.document?.querySelector(`meta[name=${e}]`))?.getAttribute(`content`)||void 0}function Xf(e){return(mc.performance?.getEntriesByType?.(`navigation`)[0])?.serverTiming?.find(t=>t.name===e)?.description}function Zf(e,t,n,r,i){let a=mc.document,o;a&&addEventListener(`click`,()=>{let a=`ui.action.click`,s=$f(e);if(s){let e=Un(s).op;if([`navigation`,`pageload`].includes(e)){yd&&O.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&=(o.setAttribute(Yt,`interactionInterrupted`),o.end(),void 0),!i.name){yd&&O.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=_i({name:i.name,op:a,attributes:{[Wt]:i.source||`url`}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})},{capture:!0})}var Qf=`_sentry_idleSpan`;function $f(e){return e[Qf]}function ep(e,t){je(e,Qf,t)}var tp=1.5;function np(e,t){let n=Un(e),r=rt();return!(r-n.start_timestamp>tp||t&&r-t<=tp)}var rp=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.4`})),ip=o(((e,t)=>{t.exports=rp()})),G=l(ip());function ap(e){let t={...e};return Vo(t,`react`),ea(`react`,{version:G.version}),bf(t)}var op={setAttribute(){},setAttributes(){},setStatus(){}},sp={startSpan(e,t){return t(op)}},cp={count(){},gauge(){},distribution(){}};function lp(){let e=globalThis,t=typeof globalThis<`u`&&typeof e.setImmediate==`function`?t=>e.setImmediate?.(t):e=>setTimeout(e,0);return e=>{t(()=>{let t=e.level??(e.error?`error`:`info`),n={timestamp:new Date().toISOString(),level:t,...e};console.log(JSON.stringify(n))})}}function up(){let e=lp();return{log(t){e(t)},tracer:sp,metrics:cp,captureException(t,n){e({event:`sync.exception`,level:`error`,error:t instanceof Error?t.message:`Unknown error: ${String(t)}`,...n??{}})}}}up();var dp={setAttribute(){},setAttributes(){},setStatus(){}};function fp(e){return e.level?e.level:e.error?`error`:`info`}function pp(e,t){if(!e)return null;switch(t){case`trace`:return e.trace??e.debug??e.info??null;case`debug`:return e.debug??e.info??null;case`info`:return e.info??null;case`warn`:return e.warn??e.info??null;case`error`:return e.error??e.warn??e.info??null;case`fatal`:return e.fatal??e.error??e.warn??e.info??null;default:return e.info??null}}function mp(e){return{setAttribute(t,n){e.setAttribute?.(t,n)},setAttributes(t){if(e.setAttributes){e.setAttributes(t);return}for(let[n,r]of Object.entries(t))e.setAttribute?.(n,r)},setStatus(t){e.setStatus?.(t)}}}function hp(e){if(typeof e==`string`)return e;if(typeof e==`number`)return Number.isFinite(e)?e:void 0;if(typeof e==`boolean`)return e;if(typeof e==`bigint`){let t=Number(e);return Number.isFinite(t)?t:e.toString()}if(e instanceof Date)return e.toISOString();if(e!=null){if(Array.isArray(e)||typeof e==`object`)try{return JSON.stringify(e)}catch{return String(e)}return String(e)}}function gp(e){let t={};for(let[n,r]of Object.entries(e)){let e=hp(r);e!==void 0&&(t[n]=e)}return Object.keys(t).length>0?t:null}function _p(e){return{startSpan(t,n){return e.startSpan?e.startSpan(t,e=>n(mp(e))):n(dp)}}}function vp(e){return{count(t,n,r){e.metrics?.count?.(t,n??1,r)},gauge(t,n,r){e.metrics?.gauge?.(t,n,r)},distribution(t,n,r){e.metrics?.distribution?.(t,n,r)}}}function yp(e){return{log(t){let n=fp(t),{event:r,...i}=t,a=pp(e.logger,n);if(!a)return;let o=gp(i);if(!o){a(r);return}a(r,o)},tracer:_p(e),metrics:vp(e),captureException(t,n){if(e.captureException?.(t),!n)return;let r=pp(e.logger,`error`)??pp(e.logger,`info`);if(!r)return;let i=gp(n);if(!i){r(`sync.exception.context`);return}r(`sync.exception.context`,i)}}}function bp(e){if(e?.attributes)return{attributes:e.attributes}}function xp(e){if(!e)return;let t=!!e.attributes,n=!!e.unit;if(!(!t&&!n))return{attributes:e.attributes,unit:e.unit}}function Sp(){return yp({logger:Is,startSpan(e,t){return ni(e,e=>t({setAttribute(t,n){e.setAttribute(t,n)},setAttributes(t){e.setAttributes(t)},setStatus(t){e.setStatus({code:t===`ok`?1:2})}}))},metrics:{count(e,t,n){let r=bp(n);if(r){Gs(e,t,r);return}Gs(e,t)},gauge(e,t,n){let r=xp(n);if(r){Ks(e,t,r);return}Ks(e,t)},distribution(e,t,n){let r=xp(n);if(r){qs(e,t,r);return}qs(e,t)}},captureException(e){Qi(e)}})}function Cp(){return Sp()}function wp(e){return ap(Tp(e)),Cp()}function Tp(e){let t=e.integrations;if(typeof t==`function`)return e;let n=t??[];return n.some(e=>e.name===`BrowserTracing`)?e:{...e,integrations:[Kf(),...n]}}var Ep=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Dp=o(((e,t)=>{t.exports=Ep()})),Op=o((e=>{var t=ip();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.4`})),kp=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Op()})),Ap=o((e=>{var t=Dp(),n=ip(),r=kp();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function d(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=d(e),t!==null)return t;e=e.sibling}return null}var f=Object.assign,p=Symbol.for(`react.element`),m=Symbol.for(`react.transitional.element`),h=Symbol.for(`react.portal`),g=Symbol.for(`react.fragment`),_=Symbol.for(`react.strict_mode`),v=Symbol.for(`react.profiler`),y=Symbol.for(`react.consumer`),b=Symbol.for(`react.context`),x=Symbol.for(`react.forward_ref`),S=Symbol.for(`react.suspense`),C=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),T=Symbol.for(`react.lazy`),E=Symbol.for(`react.activity`),D=Symbol.for(`react.memo_cache_sentinel`),O=Symbol.iterator;function k(e){return typeof e!=`object`||!e?null:(e=O&&e[O]||e[`@@iterator`],typeof e==`function`?e:null)}var A=Symbol.for(`react.client.reference`);function j(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===A?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case g:return`Fragment`;case v:return`Profiler`;case _:return`StrictMode`;case S:return`Suspense`;case C:return`SuspenseList`;case E:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case h:return`Portal`;case b:return e.displayName||`Context`;case y:return(e._context.displayName||`Context`)+`.Consumer`;case x:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?j(e.type)||`Memo`:t;case T:t=e._payload,e=e._init;try{return j(e(t))}catch{}}return null}var M=Array.isArray,N=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},I=[],L=-1;function ee(e){return{current:e}}function R(e){0>L||(e.current=I[L],I[L]=null,L--)}function z(e,t){L++,I[L]=e.current,e.current=t}var B=ee(null),V=ee(null),H=ee(null),U=ee(null);function W(e,t){switch(z(H,t),z(V,e),z(B,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qd(t),e=Jd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}R(B),z(B,e)}function te(){R(B),R(V),R(H)}function ne(e){e.memoizedState!==null&&z(U,e);var t=B.current,n=Jd(t,e.type);t!==n&&(z(V,e),z(B,n))}function re(e){V.current===e&&(R(B),R(V)),U.current===e&&(R(U),G._currentValue=F)}var ie,ae;function oe(e){if(ie===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ie=t&&t[1]||``,ae=-1<e.stack.indexOf(`
6
+ at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
7
+ `+ie+e+ae}var se=!1;function ce(e,t){if(!e||se)return``;se=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
8
+ `),l=s.split(`
9
+ `);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
10
+ `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{se=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?oe(n):``}function le(e,t){switch(e.tag){case 26:case 27:case 5:return oe(e.type);case 16:return oe(`Lazy`);case 13:return e.child!==t&&t!==null?oe(`Suspense Fallback`):oe(`Suspense`);case 19:return oe(`SuspenseList`);case 0:case 15:return ce(e.type,!1);case 11:return ce(e.type.render,!1);case 1:return ce(e.type,!0);case 31:return oe(`Activity`);default:return``}}function ue(e){try{var t=``,n=null;do t+=le(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
11
+ Error generating stack: `+e.message+`
12
+ `+e.stack}}var de=Object.prototype.hasOwnProperty,fe=t.unstable_scheduleCallback,pe=t.unstable_cancelCallback,me=t.unstable_shouldYield,he=t.unstable_requestPaint,ge=t.unstable_now,_e=t.unstable_getCurrentPriorityLevel,ve=t.unstable_ImmediatePriority,ye=t.unstable_UserBlockingPriority,be=t.unstable_NormalPriority,xe=t.unstable_LowPriority,Se=t.unstable_IdlePriority,Ce=t.log,we=t.unstable_setDisableYieldValue,Te=null,Ee=null;function De(e){if(typeof Ce==`function`&&we(e),Ee&&typeof Ee.setStrictMode==`function`)try{Ee.setStrictMode(Te,e)}catch{}}var Oe=Math.clz32?Math.clz32:je,ke=Math.log,Ae=Math.LN2;function je(e){return e>>>=0,e===0?32:31-(ke(e)/Ae|0)|0}var Me=256,Ne=262144,Pe=4194304;function Fe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ie(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Fe(n))):i=Fe(o):i=Fe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Fe(n))):i=Fe(o)):i=Fe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Le(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Re(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ze(){var e=Pe;return Pe<<=1,!(Pe&62914560)&&(Pe=4194304),e}function Be(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ve(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function He(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Oe(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ue(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ue(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Oe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function We(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Oe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ge(e,t){var n=t&-t;return n=n&42?1:Ke(n),(n&(e.suspendedLanes|t))===0?n:0}function Ke(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function qe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Je(){var e=P.p;return e===0?(e=window.event,e===void 0?32:bp(e.type)):e}function Ye(e,t){var n=P.p;try{return P.p=e,t()}finally{P.p=n}}var Xe=Math.random().toString(36).slice(2),Ze=`__reactFiber$`+Xe,Qe=`__reactProps$`+Xe,$e=`__reactContainer$`+Xe,et=`__reactEvents$`+Xe,tt=`__reactListeners$`+Xe,nt=`__reactHandles$`+Xe,rt=`__reactResources$`+Xe,it=`__reactMarker$`+Xe;function at(e){delete e[Ze],delete e[Qe],delete e[et],delete e[tt],delete e[nt]}function ot(e){var t=e[Ze];if(t)return t;for(var n=e.parentNode;n;){if(t=n[$e]||n[Ze]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=_f(e);e!==null;){if(n=e[Ze])return n;e=_f(e)}return t}e=n,n=e.parentNode}return null}function st(e){if(e=e[Ze]||e[$e]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ct(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function lt(e){var t=e[rt];return t||=e[rt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ut(e){e[it]=!0}var dt=new Set,ft={};function pt(e,t){mt(e,t),mt(e+`Capture`,t)}function mt(e,t){for(ft[e]=t,e=0;e<t.length;e++)dt.add(t[e])}var ht=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),gt={},_t={};function vt(e){return de.call(_t,e)?!0:de.call(gt,e)?!1:ht.test(e)?_t[e]=!0:(gt[e]=!0,!1)}function yt(e,t,n){if(vt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function bt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function xt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function St(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ct(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function wt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Tt(e){if(!e._valueTracker){var t=Ct(e)?`checked`:`value`;e._valueTracker=wt(e,t,``+e[t])}}function Et(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ct(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Dt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Ot=/[\n"\\]/g;function kt(e){return e.replace(Ot,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function At(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+St(t)):e.value!==``+St(t)&&(e.value=``+St(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Mt(e,o,St(n)):Mt(e,o,St(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+St(s):e.removeAttribute(`name`)}function jt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Tt(e);return}n=n==null?``:``+St(n),t=t==null?n:``+St(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Tt(e)}function Mt(e,t,n){t===`number`&&Dt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Nt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+St(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Pt(e,t,n){if(t!=null&&(t=``+St(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+St(n)}function Ft(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(M(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=St(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Tt(e)}function It(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Lt=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Rt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Lt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function zt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Rt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Rt(e,o,t[o])}function Bt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Vt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Ht=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ut(e){return Ht.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Wt(){}var Gt=null;function Kt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var qt=null,Jt=null;function Yt(e){var t=st(e);if(t&&(e=t.stateNode)){var n=e[Qe]||null;a:switch(e=t.stateNode,t.type){case`input`:if(At(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+kt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[Qe]||null;if(!a)throw Error(i(90));At(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Et(r)}break a;case`textarea`:Pt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Nt(e,!!n.multiple,t,!1)}}}var Xt=!1;function Zt(e,t,n){if(Xt)return e(t,n);Xt=!0;try{return e(t)}finally{if(Xt=!1,(qt!==null||Jt!==null)&&(Cu(),qt&&(t=qt,e=Jt,Jt=qt=null,Yt(t),e)))for(t=0;t<e.length;t++)Yt(e[t])}}function Qt(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Qe]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var $t=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),en=!1;if($t)try{var tn={};Object.defineProperty(tn,`passive`,{get:function(){en=!0}}),window.addEventListener(`test`,tn,tn),window.removeEventListener(`test`,tn,tn)}catch{en=!1}var nn=null,rn=null,an=null;function on(){if(an)return an;var e,t=rn,n=t.length,r,i=`value`in nn?nn.value:nn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return an=i.slice(e,1<r?1-r:void 0)}function sn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function cn(){return!0}function ln(){return!1}function un(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?cn:ln,this.isPropagationStopped=ln,this}return f(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=cn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=cn)},persist:function(){},isPersistent:cn}),t}var dn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fn=un(dn),pn=f({},dn,{view:0,detail:0}),mn=un(pn),hn,gn,_n,vn=f({},pn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==_n&&(_n&&e.type===`mousemove`?(hn=e.screenX-_n.screenX,gn=e.screenY-_n.screenY):gn=hn=0,_n=e),hn)},movementY:function(e){return`movementY`in e?e.movementY:gn}}),yn=un(vn),bn=un(f({},vn,{dataTransfer:0})),xn=un(f({},pn,{relatedTarget:0})),Sn=un(f({},dn,{animationName:0,elapsedTime:0,pseudoElement:0})),Cn=un(f({},dn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),wn=un(f({},dn,{data:0})),Tn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},En={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Dn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function On(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Dn[e])?!!t[e]:!1}function kn(){return On}var An=un(f({},pn,{key:function(e){if(e.key){var t=Tn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=sn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?En[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kn,charCode:function(e){return e.type===`keypress`?sn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?sn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),jn=un(f({},vn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Mn=un(f({},pn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kn})),Nn=un(f({},dn,{propertyName:0,elapsedTime:0,pseudoElement:0})),Pn=un(f({},vn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Fn=un(f({},dn,{newState:0,oldState:0})),In=[9,13,27,32],Ln=$t&&`CompositionEvent`in window,Rn=null;$t&&`documentMode`in document&&(Rn=document.documentMode);var zn=$t&&`TextEvent`in window&&!Rn,Bn=$t&&(!Ln||Rn&&8<Rn&&11>=Rn),Vn=` `,Hn=!1;function Un(e,t){switch(e){case`keyup`:return In.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Wn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Gn=!1;function Kn(e,t){switch(e){case`compositionend`:return Wn(t);case`keypress`:return t.which===32?(Hn=!0,Vn):null;case`textInput`:return e=t.data,e===Vn&&Hn?null:e;default:return null}}function qn(e,t){if(Gn)return e===`compositionend`||!Ln&&Un(e,t)?(e=on(),an=rn=nn=null,Gn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Bn&&t.locale!==`ko`?null:t.data;default:return null}}var Jn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Yn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Jn[e.type]:t===`textarea`}function Xn(e,t,n,r){qt?Jt?Jt.push(r):Jt=[r]:qt=r,t=jd(t,`onChange`),0<t.length&&(n=new fn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Zn=null,Qn=null;function $n(e){Cd(e,0)}function er(e){if(Et(ct(e)))return e}function tr(e,t){if(e===`change`)return t}var nr=!1;if($t){var rr;if($t){var ir=`oninput`in document;if(!ir){var ar=document.createElement(`div`);ar.setAttribute(`oninput`,`return;`),ir=typeof ar.oninput==`function`}rr=ir}else rr=!1;nr=rr&&(!document.documentMode||9<document.documentMode)}function or(){Zn&&(Zn.detachEvent(`onpropertychange`,sr),Qn=Zn=null)}function sr(e){if(e.propertyName===`value`&&er(Qn)){var t=[];Xn(t,Qn,e,Kt(e)),Zt($n,t)}}function cr(e,t,n){e===`focusin`?(or(),Zn=t,Qn=n,Zn.attachEvent(`onpropertychange`,sr)):e===`focusout`&&or()}function lr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return er(Qn)}function ur(e,t){if(e===`click`)return er(t)}function dr(e,t){if(e===`input`||e===`change`)return er(t)}function fr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var pr=typeof Object.is==`function`?Object.is:fr;function mr(e,t){if(pr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!de.call(t,i)||!pr(e[i],t[i]))return!1}return!0}function hr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function gr(e,t){var n=hr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=hr(n)}}function _r(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?_r(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function vr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Dt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Dt(e.document)}return t}function yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var br=$t&&`documentMode`in document&&11>=document.documentMode,xr=null,Sr=null,Cr=null,wr=!1;function Tr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wr||xr==null||xr!==Dt(r)||(r=xr,`selectionStart`in r&&yr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Cr&&mr(Cr,r)||(Cr=r,r=jd(Sr,`onSelect`),0<r.length&&(t=new fn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=xr)))}function Er(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Dr={animationend:Er(`Animation`,`AnimationEnd`),animationiteration:Er(`Animation`,`AnimationIteration`),animationstart:Er(`Animation`,`AnimationStart`),transitionrun:Er(`Transition`,`TransitionRun`),transitionstart:Er(`Transition`,`TransitionStart`),transitioncancel:Er(`Transition`,`TransitionCancel`),transitionend:Er(`Transition`,`TransitionEnd`)},Or={},kr={};$t&&(kr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Dr.animationend.animation,delete Dr.animationiteration.animation,delete Dr.animationstart.animation),`TransitionEvent`in window||delete Dr.transitionend.transition);function Ar(e){if(Or[e])return Or[e];if(!Dr[e])return e;var t=Dr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in kr)return Or[e]=t[n];return e}var jr=Ar(`animationend`),Mr=Ar(`animationiteration`),Nr=Ar(`animationstart`),Pr=Ar(`transitionrun`),Fr=Ar(`transitionstart`),Ir=Ar(`transitioncancel`),Lr=Ar(`transitionend`),Rr=new Map,zr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);zr.push(`scrollEnd`);function Br(e,t){Rr.set(e,t),pt(t,[e])}var Vr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Hr=[],Ur=0,Wr=0;function Gr(){for(var e=Ur,t=Wr=Ur=0;t<e;){var n=Hr[t];Hr[t++]=null;var r=Hr[t];Hr[t++]=null;var i=Hr[t];Hr[t++]=null;var a=Hr[t];if(Hr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Yr(n,i,a)}}function Kr(e,t,n,r){Hr[Ur++]=e,Hr[Ur++]=t,Hr[Ur++]=n,Hr[Ur++]=r,Wr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function qr(e,t,n,r){return Kr(e,t,n,r),Xr(e)}function Jr(e,t){return Kr(e,null,null,t),Xr(e)}function Yr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Oe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Xr(e){if(50<mu)throw mu=0,hu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Zr={};function Qr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $r(e,t,n,r){return new Qr(e,t,n,r)}function ei(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ti(e,t){var n=e.alternate;return n===null?(n=$r(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ni(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ri(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ei(e)&&(s=1);else if(typeof e==`string`)s=Yf(e,n,B.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case E:return e=$r(31,n,t,a),e.elementType=E,e.lanes=o,e;case g:return ii(n.children,a,o,t);case _:s=8,a|=24;break;case v:return e=$r(12,n,t,a|2),e.elementType=v,e.lanes=o,e;case S:return e=$r(13,n,t,a),e.elementType=S,e.lanes=o,e;case C:return e=$r(19,n,t,a),e.elementType=C,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case b:s=10;break a;case y:s=9;break a;case x:s=11;break a;case w:s=14;break a;case T:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=$r(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ii(e,t,n,r){return e=$r(7,e,r,t),e.lanes=n,e}function ai(e,t,n){return e=$r(6,e,null,t),e.lanes=n,e}function oi(e){var t=$r(18,null,null,0);return t.stateNode=e,t}function si(e,t,n){return t=$r(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ci=new WeakMap;function li(e,t){if(typeof e==`object`&&e){var n=ci.get(e);return n===void 0?(t={value:e,source:t,stack:ue(t)},ci.set(e,t),t):n}return{value:e,source:t,stack:ue(t)}}var ui=[],di=0,fi=null,pi=0,mi=[],hi=0,gi=null,_i=1,vi=``;function yi(e,t){ui[di++]=pi,ui[di++]=fi,fi=e,pi=t}function bi(e,t,n){mi[hi++]=_i,mi[hi++]=vi,mi[hi++]=gi,gi=e;var r=_i;e=vi;var i=32-Oe(r)-1;r&=~(1<<i),n+=1;var a=32-Oe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,_i=1<<32-Oe(t)+i|n<<i|r,vi=a+e}else _i=1<<a|n<<i|r,vi=e}function xi(e){e.return!==null&&(yi(e,1),bi(e,1,0))}function Si(e){for(;e===fi;)fi=ui[--di],ui[di]=null,pi=ui[--di],ui[di]=null;for(;e===gi;)gi=mi[--hi],mi[hi]=null,vi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null}function Ci(e,t){mi[hi++]=_i,mi[hi++]=vi,mi[hi++]=gi,_i=t.id,vi=t.overflow,gi=e}var wi=null,Ti=null,Ei=!1,Di=null,Oi=!1,ki=Error(i(519));function Ai(e){throw Ii(li(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),ki}function ji(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ze]=e,t[Qe]=r,n){case`dialog`:wd(`cancel`,t),wd(`close`,t);break;case`iframe`:case`object`:case`embed`:wd(`load`,t);break;case`video`:case`audio`:for(n=0;n<xd.length;n++)wd(xd[n],t);break;case`source`:wd(`error`,t);break;case`img`:case`image`:case`link`:wd(`error`,t),wd(`load`,t);break;case`details`:wd(`toggle`,t);break;case`input`:wd(`invalid`,t),jt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:wd(`invalid`,t);break;case`textarea`:wd(`invalid`,t),Ft(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Ld(t.textContent,n)?(r.popover!=null&&(wd(`beforetoggle`,t),wd(`toggle`,t)),r.onScroll!=null&&wd(`scroll`,t),r.onScrollEnd!=null&&wd(`scrollend`,t),r.onClick!=null&&(t.onclick=Wt),t=!0):t=!1,t||Ai(e,!0)}function Mi(e){for(wi=e.return;wi;)switch(wi.tag){case 5:case 31:case 13:Oi=!1;return;case 27:case 3:Oi=!0;return;default:wi=wi.return}}function Ni(e){if(e!==wi)return!1;if(!Ei)return Mi(e),Ei=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Yd(e.type,e.memoizedProps)),n=!n),n&&Ti&&Ai(e),Mi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ti=gf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Ti=gf(e)}else t===27?(t=Ti,rf(e.type)?(e=hf,hf=null,Ti=e):Ti=t):Ti=wi?mf(e.stateNode.nextSibling):null;return!0}function Pi(){Ti=wi=null,Ei=!1}function Fi(){var e=Di;return e!==null&&(eu===null?eu=e:eu.push.apply(eu,e),Di=null),e}function Ii(e){Di===null?Di=[e]:Di.push(e)}var Li=ee(null),Ri=null,zi=null;function Bi(e,t,n){z(Li,t._currentValue),t._currentValue=n}function Vi(e){e._currentValue=Li.current,R(Li)}function Hi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Ui(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Hi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Hi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Wi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;pr(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===U.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[G]:e.push(G))}a=a.return}e!==null&&Ui(t,e,n,r),t.flags|=262144}function Gi(e){for(e=e.firstContext;e!==null;){if(!pr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ki(e){Ri=e,zi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function qi(e){return Yi(Ri,e)}function Ji(e,t){return Ri===null&&Ki(e),Yi(e,t)}function Yi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},zi===null){if(e===null)throw Error(i(308));zi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else zi=zi.next=t;return n}var Xi=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},Zi=t.unstable_scheduleCallback,Qi=t.unstable_NormalPriority,$i={$$typeof:b,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ea(){return{controller:new Xi,data:new Map,refCount:0}}function ta(e){e.refCount--,e.refCount===0&&Zi(Qi,function(){e.controller.abort()})}var na=null,ra=0,ia=0,aa=null;function oa(e,t){if(na===null){var n=na=[];ra=0,ia=hd(),aa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return ra++,t.then(sa,sa),t}function sa(){if(--ra===0&&na!==null){aa!==null&&(aa.status=`fulfilled`);var e=na;na=null,ia=0,aa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ca(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var la=N.S;N.S=function(e,t){ru=ge(),typeof t==`object`&&t&&typeof t.then==`function`&&oa(e,t),la!==null&&la(e,t)};var ua=ee(null);function da(){var e=ua.current;return e===null?Rl.pooledCache:e}function fa(e,t){t===null?z(ua,ua.current):z(ua,t.pool)}function pa(){var e=da();return e===null?null:{parent:$i._currentValue,pool:e}}var ma=Error(i(460)),ha=Error(i(474)),ga=Error(i(542)),_a={then:function(){}};function va(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ya(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Wt,Wt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ca(e),e;default:if(typeof t.status==`string`)t.then(Wt,Wt);else{if(e=Rl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Ca(e),e}throw xa=t,ma}}function ba(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(xa=e,ma):e}}var xa=null;function Sa(){if(xa===null)throw Error(i(459));var e=xa;return xa=null,e}function Ca(e){if(e===ma||e===ga)throw Error(i(483))}var wa=null,Ta=0;function Ea(e){var t=Ta;return Ta+=1,wa===null&&(wa=[]),ya(wa,e,t)}function Da(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Oa(e,t){throw t.$$typeof===p?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function ka(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ti(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ai(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===g?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===T&&ba(i)===t.type)?(t=a(t,n.props),Da(t,n),t.return=e,t):(t=ri(n.type,n.key,n.props,null,e.mode,r),Da(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=si(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ii(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ai(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case m:return n=ri(t.type,t.key,t.props,null,e.mode,n),Da(n,t),n.return=e,n;case h:return t=si(t,e.mode,n),t.return=e,t;case T:return t=ba(t),f(e,t,n)}if(M(t)||k(t))return t=ii(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ea(t),n);if(t.$$typeof===b)return f(e,Ji(e,t),n);Oa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case m:return n.key===i?l(e,t,n,r):null;case h:return n.key===i?u(e,t,n,r):null;case T:return n=ba(n),p(e,t,n,r)}if(M(n)||k(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ea(n),r);if(n.$$typeof===b)return p(e,t,Ji(e,n),r);Oa(e,n)}return null}function _(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case m:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case h:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case T:return r=ba(r),_(e,t,n,r,i)}if(M(r)||k(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return _(e,t,n,Ea(r),i);if(r.$$typeof===b)return _(e,t,n,Ji(t,r),i);Oa(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,m=a=0,h=null;d!==null&&m<s.length;m++){d.index>m?(h=d,d=null):h=d.sibling;var g=p(i,d,s[m],c);if(g===null){d===null&&(d=h);break}e&&d&&g.alternate===null&&t(i,d),a=o(g,a,m),u===null?l=g:u.sibling=g,u=g,d=h}if(m===s.length)return n(i,d),Ei&&yi(i,m),l;if(d===null){for(;m<s.length;m++)d=f(i,s[m],c),d!==null&&(a=o(d,a,m),u===null?l=d:u.sibling=d,u=d);return Ei&&yi(i,m),l}for(d=r(d);m<s.length;m++)h=_(d,i,m,s[m],c),h!==null&&(e&&h.alternate!==null&&d.delete(h.key===null?m:h.key),a=o(h,a,m),u===null?l=h:u.sibling=h,u=h);return e&&d.forEach(function(e){return t(i,e)}),Ei&&yi(i,m),l}function y(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,m=s,h=s=0,g=null,v=c.next();m!==null&&!v.done;h++,v=c.next()){m.index>h?(g=m,m=null):g=m.sibling;var y=p(a,m,v.value,l);if(y===null){m===null&&(m=g);break}e&&m&&y.alternate===null&&t(a,m),s=o(y,s,h),d===null?u=y:d.sibling=y,d=y,m=g}if(v.done)return n(a,m),Ei&&yi(a,h),u;if(m===null){for(;!v.done;h++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return Ei&&yi(a,h),u}for(m=r(m);!v.done;h++,v=c.next())v=_(m,a,h,v.value,l),v!==null&&(e&&v.alternate!==null&&m.delete(v.key===null?h:v.key),s=o(v,s,h),d===null?u=v:d.sibling=v,d=v);return e&&m.forEach(function(e){return t(a,e)}),Ei&&yi(a,h),u}function x(e,r,o,c){if(typeof o==`object`&&o&&o.type===g&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case m:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===g){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&ba(l)===r.type){n(e,r.sibling),c=a(r,o.props),Da(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===g?(c=ii(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ri(o.type,o.key,o.props,null,e.mode,c),Da(c,o),c.return=e,e=c)}return s(e);case h:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=si(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=ba(o),x(e,r,o,c)}if(M(o))return v(e,r,o,c);if(k(o)){if(l=k(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return x(e,r,Ea(o),c);if(o.$$typeof===b)return x(e,r,Ji(e,o),c);Oa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=ai(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Ta=0;var i=x(e,t,n,r);return wa=null,i}catch(t){if(t===ma||t===ga)throw t;var a=$r(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Aa=ka(!0),ja=ka(!1),Ma=!1;function Na(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Fa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ia(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ll&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Xr(e),Yr(e,null,n),t}return Kr(e,r,t,n),Xr(e)}function La(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,We(e,n)}}function Ra(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var za=!1;function Ba(){if(za){var e=aa;if(e!==null)throw e}}function Va(e,t,n,r){za=!1;var i=e.updateQueue;Ma=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var p=s.lane&-536870913,m=p!==s.lane;if(m?(Bl&p)===p:(r&p)===p){p!==0&&p===ia&&(za=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;p=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,p);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,p=typeof h==`function`?h.call(_,d,p):h,p==null)break a;d=f({},d,p);break a;case 2:Ma=!0}}p=s.callback,p!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[p]:m.push(p))}else m={lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=p;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Jl|=o,e.lanes=o,e.memoizedState=d}}function Ha(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Ua(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ha(n[e],t)}var Wa=ee(null),Ga=ee(0);function Ka(e,t){e=Kl,z(Ga,e),z(Wa,t),Kl=e|t.baseLanes}function qa(){z(Ga,Kl),z(Wa,Wa.current)}function Ja(){Kl=Ga.current,R(Wa),R(Ga)}var Ya=ee(null),Xa=null;function Za(e){var t=e.alternate;z(no,no.current&1),z(Ya,e),Xa===null&&(t===null||Wa.current!==null||t.memoizedState!==null)&&(Xa=e)}function Qa(e){z(no,no.current),z(Ya,e),Xa===null&&(Xa=e)}function $a(e){e.tag===22?(z(no,no.current),z(Ya,e),Xa===null&&(Xa=e)):eo(e)}function eo(){z(no,no.current),z(Ya,Ya.current)}function to(e){R(Ya),Xa===e&&(Xa=null),R(no)}var no=ee(0);function ro(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||df(n)||ff(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var io=0,ao=null,oo=null,so=null,co=!1,lo=!1,uo=!1,fo=0,po=0,mo=null,ho=0;function go(){throw Error(i(321))}function _o(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!pr(e[n],t[n]))return!1;return!0}function vo(e,t,n,r,i,a){return io=a,ao=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Fs:Is,uo=!1,a=n(r,i),uo=!1,lo&&(a=bo(t,n,r,i)),yo(e),a}function yo(e){N.H=Ps;var t=oo!==null&&oo.next!==null;if(io=0,so=oo=ao=null,co=!1,po=0,mo=null,t)throw Error(i(300));e===null||$s||(e=e.dependencies,e!==null&&Gi(e)&&($s=!0))}function bo(e,t,n,r){ao=e;var a=0;do{if(lo&&(mo=null),po=0,lo=!1,25<=a)throw Error(i(301));if(a+=1,so=oo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}N.H=Ls,o=t(n,r)}while(lo);return o}function xo(){var e=N.H,t=e.useState()[0];return t=typeof t.then==`function`?Oo(t):t,e=e.useState()[0],(oo===null?null:oo.memoizedState)!==e&&(ao.flags|=1024),t}function So(){var e=fo!==0;return fo=0,e}function Co(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function wo(e){if(co){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}co=!1}io=0,so=oo=ao=null,lo=!1,po=fo=0,mo=null}function To(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return so===null?ao.memoizedState=so=e:so=so.next=e,so}function Eo(){if(oo===null){var e=ao.alternate;e=e===null?null:e.memoizedState}else e=oo.next;var t=so===null?ao.memoizedState:so.next;if(t!==null)so=t,oo=e;else{if(e===null)throw ao.alternate===null?Error(i(467)):Error(i(310));oo=e,e={memoizedState:oo.memoizedState,baseState:oo.baseState,baseQueue:oo.baseQueue,queue:oo.queue,next:null},so===null?ao.memoizedState=so=e:so=so.next=e}return so}function Do(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Oo(e){var t=po;return po+=1,mo===null&&(mo=[]),e=ya(mo,e,t),t=ao,(so===null?t.memoizedState:so.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Fs:Is),e}function ko(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Oo(e);if(e.$$typeof===b)return qi(e)}throw Error(i(438,String(e)))}function Ao(e){var t=null,n=ao.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=ao.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Do(),ao.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=D;return t.index++,n}function jo(e,t){return typeof t==`function`?t(e):t}function Mo(e){return No(Eo(),oo,e)}function No(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(io&f)===f:(Bl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ia&&(d=!0);else if((io&p)===p){u=u.next,p===ia&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,ao.lanes|=p,Jl|=p;f=u.action,uo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,ao.lanes|=f,Jl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!pr(o,e.memoizedState)&&($s=!0,d&&(n=aa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Po(e){var t=Eo(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);pr(o,t.memoizedState)||($s=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Fo(e,t,n){var r=ao,a=Eo(),o=Ei;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!pr((oo||a).memoizedState,n);if(s&&(a.memoizedState=n,$s=!0),a=a.queue,os(Ro.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||so!==null&&so.memoizedState.tag&1){if(r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,a,n,t),null),Rl===null)throw Error(i(349));o||io&127||Io(r,t,n)}return n}function Io(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ao.updateQueue,t===null?(t=Do(),ao.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Lo(e,t,n,r){t.value=n,t.getSnapshot=r,zo(t)&&Bo(e)}function Ro(e,t,n){return n(function(){zo(t)&&Bo(e)})}function zo(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!pr(e,n)}catch{return!0}}function Bo(e){var t=Jr(e,2);t!==null&&vu(t,e,2)}function Vo(e){var t=To();if(typeof e==`function`){var n=e;if(e=n(),uo){De(!0);try{n()}finally{De(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:e},t}function Ho(e,t,n,r){return e.baseState=n,No(e,oo,typeof r==`function`?r:jo)}function Uo(e,t,n,r,a){if(js(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};N.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Wo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Wo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=N.T,o={};N.T=o;try{var s=n(i,r),c=N.S;c!==null&&c(o,s),Go(e,t,s)}catch(n){qo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),N.T=a}}else try{a=n(i,r),Go(e,t,a)}catch(n){qo(e,t,n)}}function Go(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Ko(e,t,n)},function(n){return qo(e,t,n)}):Ko(e,t,n)}function Ko(e,t,n){t.status=`fulfilled`,t.value=n,Jo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Wo(e,n)))}function qo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Jo(t),t=t.next;while(t!==r)}e.action=null}function Jo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Yo(e,t){return t}function Xo(e,t){if(Ei){var n=Rl.formState;if(n!==null){a:{var r=ao;if(Ei){if(Ti){b:{for(var i=Ti,a=Oi;i.nodeType!==8;){if(!a){i=null;break b}if(i=mf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Ti=mf(i.nextSibling),r=i.data===`F!`;break a}}Ai(r)}r=!1}r&&(t=n[0])}}return n=To(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yo,lastRenderedState:t},n.queue=r,n=Os.bind(null,ao,r),r.dispatch=n,r=Vo(!1),a=As.bind(null,ao,!1,r.queue),r=To(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Uo.bind(null,ao,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Zo(e){return Qo(Eo(),oo,e)}function Qo(e,t,n){if(t=No(e,t,Yo)[0],e=Mo(jo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Oo(t)}catch(e){throw e===ma?ga:e}else r=t;t=Eo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(ao.flags|=2048,ts(9,{destroy:void 0},$o.bind(null,i,n),null)),[r,a,e]}function $o(e,t){e.action=t}function es(e){var t=Eo(),n=oo;if(n!==null)return Qo(t,n,e);Eo(),t=t.memoizedState,n=Eo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ts(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=ao.updateQueue,t===null&&(t=Do(),ao.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ns(){return Eo().memoizedState}function rs(e,t,n,r){var i=To();ao.flags|=e,i.memoizedState=ts(1|t,{destroy:void 0},n,r===void 0?null:r)}function is(e,t,n,r){var i=Eo();r=r===void 0?null:r;var a=i.memoizedState.inst;oo!==null&&r!==null&&_o(r,oo.memoizedState.deps)?i.memoizedState=ts(t,a,n,r):(ao.flags|=e,i.memoizedState=ts(1|t,a,n,r))}function as(e,t){rs(8390656,8,e,t)}function os(e,t){is(2048,8,e,t)}function ss(e){ao.flags|=4;var t=ao.updateQueue;if(t===null)t=Do(),ao.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function cs(e){var t=Eo().memoizedState;return ss({ref:t,nextImpl:e}),function(){if(Ll&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ls(e,t){return is(4,2,e,t)}function us(e,t){return is(4,4,e,t)}function ds(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function fs(e,t,n){n=n==null?null:n.concat([e]),is(4,4,ds.bind(null,t,e),n)}function ps(){}function ms(e,t){var n=Eo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&_o(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function hs(e,t){var n=Eo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&_o(t,r[1]))return r[0];if(r=e(),uo){De(!0);try{e()}finally{De(!1)}}return n.memoizedState=[r,t],r}function gs(e,t,n){return n===void 0||io&1073741824&&!(Bl&261930)?e.memoizedState=t:(e.memoizedState=n,e=_u(),ao.lanes|=e,Jl|=e,n)}function _s(e,t,n,r){return pr(n,t)?n:Wa.current===null?!(io&42)||io&1073741824&&!(Bl&261930)?($s=!0,e.memoizedState=n):(e=_u(),ao.lanes|=e,Jl|=e,t):(e=gs(e,n,r),pr(e,t)||($s=!0),e)}function vs(e,t,n,r,i){var a=P.p;P.p=a!==0&&8>a?a:8;var o=N.T,s={};N.T=s,As(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?ks(e,t,ca(c,r),gu(e)):ks(e,t,r,gu(e))}catch(n){ks(e,t,{then:function(){},status:`rejected`,reason:n},gu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function ys(){}function bs(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=xs(e).queue;vs(e,a,t,F,n===null?ys:function(){return Ss(e),n(r)})}function xs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:F},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:jo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ss(e){var t=xs(e);t.next===null&&(t=e.alternate.memoizedState),ks(e,t.next.queue,{},gu())}function Cs(){return qi(G)}function ws(){return Eo().memoizedState}function Ts(){return Eo().memoizedState}function Es(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=gu();e=Fa(n);var r=Ia(t,e,n);r!==null&&(vu(r,t,n),La(r,t,n)),t={cache:ea()},e.payload=t;return}t=t.return}}function Ds(e,t,n){var r=gu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},js(e)?Ms(t,n):(n=qr(e,t,n,r),n!==null&&(vu(n,e,r),Ns(n,t,r)))}function Os(e,t,n){ks(e,t,n,gu())}function ks(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(js(e))Ms(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,pr(s,o))return Kr(e,t,i,0),Rl===null&&Gr(),!1}catch{}if(n=qr(e,t,i,r),n!==null)return vu(n,e,r),Ns(n,t,r),!0}return!1}function As(e,t,n,r){if(r={lane:2,revertLane:hd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},js(e)){if(t)throw Error(i(479))}else t=qr(e,n,r,2),t!==null&&vu(t,e,2)}function js(e){var t=e.alternate;return e===ao||t!==null&&t===ao}function Ms(e,t){lo=co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ns(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,We(e,n)}}var Ps={readContext:qi,use:ko,useCallback:go,useContext:go,useEffect:go,useImperativeHandle:go,useLayoutEffect:go,useInsertionEffect:go,useMemo:go,useReducer:go,useRef:go,useState:go,useDebugValue:go,useDeferredValue:go,useTransition:go,useSyncExternalStore:go,useId:go,useHostTransitionStatus:go,useFormState:go,useActionState:go,useOptimistic:go,useMemoCache:go,useCacheRefresh:go};Ps.useEffectEvent=go;var Fs={readContext:qi,use:ko,useCallback:function(e,t){return To().memoizedState=[e,t===void 0?null:t],e},useContext:qi,useEffect:as,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),rs(4194308,4,ds.bind(null,t,e),n)},useLayoutEffect:function(e,t){return rs(4194308,4,e,t)},useInsertionEffect:function(e,t){rs(4,2,e,t)},useMemo:function(e,t){var n=To();t=t===void 0?null:t;var r=e();if(uo){De(!0);try{e()}finally{De(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=To();if(n!==void 0){var i=n(t);if(uo){De(!0);try{n(t)}finally{De(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ds.bind(null,ao,e),[r.memoizedState,e]},useRef:function(e){var t=To();return e={current:e},t.memoizedState=e},useState:function(e){e=Vo(e);var t=e.queue,n=Os.bind(null,ao,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ps,useDeferredValue:function(e,t){return gs(To(),e,t)},useTransition:function(){var e=Vo(!1);return e=vs.bind(null,ao,e.queue,!0,!1),To().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=ao,a=To();if(Ei){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Rl===null)throw Error(i(349));Bl&127||Io(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,as(Ro.bind(null,r,o,e),[e]),r.flags|=2048,ts(9,{destroy:void 0},Lo.bind(null,r,o,n,t),null),n},useId:function(){var e=To(),t=Rl.identifierPrefix;if(Ei){var n=vi,r=_i;n=(r&~(1<<32-Oe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=fo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=ho++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Cs,useFormState:Xo,useActionState:Xo,useOptimistic:function(e){var t=To();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=As.bind(null,ao,!0,n),n.dispatch=t,[e,t]},useMemoCache:Ao,useCacheRefresh:function(){return To().memoizedState=Es.bind(null,ao)},useEffectEvent:function(e){var t=To(),n={impl:e};return t.memoizedState=n,function(){if(Ll&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Is={readContext:qi,use:ko,useCallback:ms,useContext:qi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Mo,useRef:ns,useState:function(){return Mo(jo)},useDebugValue:ps,useDeferredValue:function(e,t){return _s(Eo(),oo.memoizedState,e,t)},useTransition:function(){var e=Mo(jo)[0],t=Eo().memoizedState;return[typeof e==`boolean`?e:Oo(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:Zo,useActionState:Zo,useOptimistic:function(e,t){return Ho(Eo(),oo,e,t)},useMemoCache:Ao,useCacheRefresh:Ts};Is.useEffectEvent=cs;var Ls={readContext:qi,use:ko,useCallback:ms,useContext:qi,useEffect:os,useImperativeHandle:fs,useInsertionEffect:ls,useLayoutEffect:us,useMemo:hs,useReducer:Po,useRef:ns,useState:function(){return Po(jo)},useDebugValue:ps,useDeferredValue:function(e,t){var n=Eo();return oo===null?gs(n,e,t):_s(n,oo.memoizedState,e,t)},useTransition:function(){var e=Po(jo)[0],t=Eo().memoizedState;return[typeof e==`boolean`?e:Oo(e),t]},useSyncExternalStore:Fo,useId:ws,useHostTransitionStatus:Cs,useFormState:es,useActionState:es,useOptimistic:function(e,t){var n=Eo();return oo===null?(n.baseState=e,[e,n.queue.dispatch]):Ho(n,oo,e,t)},useMemoCache:Ao,useCacheRefresh:Ts};Ls.useEffectEvent=cs;function Rs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:f({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var zs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=gu(),i=Fa(r);i.payload=t,n!=null&&(i.callback=n),t=Ia(e,i,r),t!==null&&(vu(t,e,r),La(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=gu(),i=Fa(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ia(e,i,r),t!==null&&(vu(t,e,r),La(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=gu(),r=Fa(n);r.tag=2,t!=null&&(r.callback=t),t=Ia(e,r,n),t!==null&&(vu(t,e,n),La(t,e,n))}};function Bs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!mr(n,r)||!mr(i,a):!0}function Vs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&zs.enqueueReplaceState(t,t.state,null)}function Hs(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=f({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Us(e){Vr(e)}function Ws(e){console.error(e)}function Gs(e){Vr(e)}function Ks(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function qs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Js(e,t,n){return n=Fa(n),n.tag=3,n.payload={element:null},n.callback=function(){Ks(e,t)},n}function Ys(e){return e=Fa(e),e.tag=3,e}function Xs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){qs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){qs(t,n,r),typeof i!=`function`&&(ou===null?ou=new Set([this]):ou.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Zs(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Wi(t,n,a,!0),n=Ya.current,n!==null){switch(n.tag){case 31:case 13:return Xa===null?Au():n.alternate===null&&ql===0&&(ql=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===_a?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Yu(e,r,a)),!1;case 22:return n.flags|=65536,r===_a?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Yu(e,r,a)),!1}throw Error(i(435,n.tag))}return Yu(e,r,a),Au(),!1}if(Ei)return t=Ya.current,t===null?(r!==ki&&(t=Error(i(423),{cause:r}),Ii(li(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=li(r,n),a=Js(e.stateNode,r,a),Ra(e,a),ql!==4&&(ql=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==ki&&(e=Error(i(422),{cause:r}),Ii(li(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=li(o,n),$l===null?$l=[o]:$l.push(o),ql!==4&&(ql=2),t===null)return!0;r=li(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Js(n.stateNode,r,e),Ra(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(ou===null||!ou.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Ys(a),Xs(a,e,n,r),Ra(n,a),!1}n=n.return}while(n!==null);return!1}var Qs=Error(i(461)),$s=!1;function ec(e,t,n,r){t.child=e===null?ja(t,null,n,r):Aa(t,e.child,n,r)}function tc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Ki(t),r=vo(e,t,n,o,a,i),s=So(),e!==null&&!$s?(Co(e,t,i),Tc(e,t,i)):(Ei&&s&&xi(t),t.flags|=1,ec(e,t,r,i),t.child)}function nc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ei(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,rc(e,t,a,r,i)):(e=ri(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Ec(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?mr:n,n(o,r)&&e.ref===t.ref)return Tc(e,t,i)}return t.flags|=1,e=ti(a,r),e.ref=t.ref,e.return=t,t.child=e}function rc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(mr(a,r)&&e.ref===t.ref)if($s=!1,t.pendingProps=r=a,Ec(e,i))e.flags&131072&&($s=!0);else return t.lanes=e.lanes,Tc(e,t,i)}return dc(e,t,n,r,i)}function ic(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return oc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&fa(t,a===null?null:a.cachePool),a===null?qa():Ka(t,a),$a(t);else return r=t.lanes=536870912,oc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&fa(t,null),qa(),eo(t)):(fa(t,a.cachePool),Ka(t,a),eo(t),t.memoizedState=null);return ec(e,t,i,n),t.child}function ac(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function oc(e,t,n,r,i){var a=da();return a=a===null?null:{parent:$i._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&fa(t,null),qa(),$a(t),e!==null&&Wi(e,t,r,!0),t.childLanes=i,null}function sc(e,t){return t=bc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cc(e,t,n){return Aa(t,e.child,null,n),e=sc(t,t.pendingProps),e.flags|=2,to(t),t.memoizedState=null,e}function lc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Ei){if(r.mode===`hidden`)return e=sc(t,r),t.lanes=536870912,ac(null,e);if(Qa(t),(e=Ti)?(e=uf(e,Oi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gi===null?null:{id:_i,overflow:vi},retryLane:536870912,hydrationErrors:null},n=oi(e),n.return=t,t.child=n,wi=t,Ti=null)):e=null,e===null)throw Ai(t);return t.lanes=536870912,null}return sc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Qa(t),a)if(t.flags&256)t.flags&=-257,t=cc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if($s||Wi(e,t,n,!1),a=(n&e.childLanes)!==0,$s||a){if(r=Rl,r!==null&&(s=Ge(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Jr(e,s),vu(r,e,s),Qs;Au(),t=cc(e,t,n)}else e=o.treeContext,Ti=mf(s.nextSibling),wi=t,Ei=!0,Di=null,Oi=!1,e!==null&&Ci(t,e),t=sc(t,r),t.flags|=4096;return t}return e=ti(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function uc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function dc(e,t,n,r,i){return Ki(t),n=vo(e,t,n,r,void 0,i),r=So(),e!==null&&!$s?(Co(e,t,i),Tc(e,t,i)):(Ei&&r&&xi(t),t.flags|=1,ec(e,t,n,i),t.child)}function fc(e,t,n,r,i,a){return Ki(t),t.updateQueue=null,n=bo(t,r,n,i),yo(e),r=So(),e!==null&&!$s?(Co(e,t,a),Tc(e,t,a)):(Ei&&r&&xi(t),t.flags|=1,ec(e,t,n,a),t.child)}function pc(e,t,n,r,i){if(Ki(t),t.stateNode===null){var a=Zr,o=n.contextType;typeof o==`object`&&o&&(a=qi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=zs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Na(t),o=n.contextType,a.context=typeof o==`object`&&o?qi(o):Zr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Rs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&zs.enqueueReplaceState(a,a.state,null),Va(t,r,a,i),Ba(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Hs(n,s);a.props=c;var l=a.context,u=n.contextType;o=Zr,typeof u==`object`&&u&&(o=qi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Vs(t,a,r,o),Ma=!1;var f=t.memoizedState;a.state=f,Va(t,r,a,i),Ba(),l=t.memoizedState,s||f!==l||Ma?(typeof d==`function`&&(Rs(t,n,d,r),l=t.memoizedState),(c=Ma||Bs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Pa(e,t),o=t.memoizedProps,u=Hs(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Zr,typeof l==`object`&&l&&(c=qi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Vs(t,a,r,c),Ma=!1,f=t.memoizedState,a.state=f,Va(t,r,a,i),Ba();var p=t.memoizedState;o!==d||f!==p||Ma||e!==null&&e.dependencies!==null&&Gi(e.dependencies)?(typeof s==`function`&&(Rs(t,n,s,r),p=t.memoizedState),(u=Ma||Bs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Gi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,uc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Aa(t,e.child,null,i),t.child=Aa(t,null,n,i)):ec(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Tc(e,t,i),e}function mc(e,t,n,r){return Pi(),t.flags|=256,ec(e,t,n,r),t.child}var hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gc(e){return{baseLanes:e,cachePool:pa()}}function _c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Zl),e}function vc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(no.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Ei){if(a?Za(t):eo(t),(e=Ti)?(e=uf(e,Oi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gi===null?null:{id:_i,overflow:vi},retryLane:536870912,hydrationErrors:null},n=oi(e),n.return=t,t.child=n,wi=t,Ti=null)):e=null,e===null)throw Ai(t);return ff(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(eo(t),a=t.mode,c=bc({mode:`hidden`,children:c},a),r=ii(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(null,r)):(Za(t),yc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Za(t),t.flags&=-257,t=xc(e,t,n)):t.memoizedState===null?(eo(t),c=r.fallback,a=t.mode,r=bc({mode:`visible`,children:r.children},a),c=ii(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Aa(t,e.child,null,n),r=t.child,r.memoizedState=gc(n),r.childLanes=_c(e,s,n),t.memoizedState=hc,t=ac(null,r)):(eo(t),t.child=e.child,t.flags|=128,t=null);else if(Za(t),ff(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Ii({value:r,source:null,stack:null}),t=xc(e,t,n)}else if($s||Wi(e,t,n,!1),s=(n&e.childLanes)!==0,$s||s){if(s=Rl,s!==null&&(r=Ge(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Jr(e,r),vu(s,e,r),Qs;df(c)||Au(),t=xc(e,t,n)}else df(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Ti=mf(c.nextSibling),wi=t,Ei=!0,Di=null,Oi=!1,e!==null&&Ci(t,e),t=yc(t,r.children),t.flags|=4096);return t}return a?(eo(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ti(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ii(c,a,n,null),c.flags|=2):c=ti(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,ac(null,r),r=t.child,c=e.child.memoizedState,c===null?c=gc(n):(a=c.cachePool,a===null?a=pa():(l=$i._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=_c(e,s,n),t.memoizedState=hc,ac(e.child,r)):(Za(t),n=e.child,e=n.sibling,n=ti(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function yc(e,t){return t=bc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function bc(e,t){return e=$r(22,e,null,t),e.lanes=0,e}function xc(e,t,n){return Aa(t,e.child,null,n),e=yc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Hi(e.return,t,n)}function Cc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function wc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=no.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,z(no,o),ec(e,t,r,n),r=Ei?pi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Sc(e,n,t);else if(e.tag===19)Sc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&ro(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Cc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ro(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Cc(t,!0,n,null,a,r);break;case`together`:Cc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Tc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Jl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Wi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ti(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ti(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Ec(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Gi(e))):!0}function Dc(e,t,n){switch(t.tag){case 3:W(t,t.stateNode.containerInfo),Bi(t,$i,e.memoizedState.cache),Pi();break;case 27:case 5:ne(t);break;case 4:W(t,t.stateNode.containerInfo);break;case 10:Bi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Qa(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Za(t),e=Tc(e,t,n),e===null?null:e.sibling):vc(e,t,n):(Za(t),t.flags|=128,null);Za(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Wi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return wc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),z(no,no.current),r)break;return null;case 22:return t.lanes=0,ic(e,t,n,t.pendingProps);case 24:Bi(t,$i,e.memoizedState.cache)}return Tc(e,t,n)}function Oc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)$s=!0;else{if(!Ec(e,n)&&!(t.flags&128))return $s=!1,Dc(e,t,n);$s=!!(e.flags&131072)}else $s=!1,Ei&&t.flags&1048576&&bi(t,pi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=ba(t.elementType),t.type=e,typeof e==`function`)ei(e)?(r=Hs(e,r),t.tag=1,t=pc(null,t,e,r,n)):(t.tag=0,t=dc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===x){t.tag=11,t=tc(null,t,e,r,n);break a}else if(a===w){t.tag=14,t=nc(null,t,e,r,n);break a}}throw t=j(e)||e,Error(i(306,t,``))}}return t;case 0:return dc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Hs(r,t.pendingProps),pc(e,t,r,a,n);case 3:a:{if(W(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Pa(e,t),Va(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Bi(t,$i,r),r!==o.cache&&Ui(t,[$i],n,!0),Ba(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=mc(e,t,r,n);break a}else if(r!==a){a=li(Error(i(424)),t),Ii(a),t=mc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Ti=mf(e.firstChild),wi=t,Ei=!0,Di=null,Oi=!0,n=ja(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Pi(),r===a){t=Tc(e,t,n);break a}ec(e,t,r,n)}t=t.child}return t;case 26:return uc(e,t),e===null?(n=Ff(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ei||(n=t.type,e=t.pendingProps,r=Kd(H.current).createElement(n),r[Ze]=t,r[Qe]=e,Bd(r,n,e),ut(r),t.stateNode=r):t.memoizedState=Ff(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ne(t),e===null&&Ei&&(r=t.stateNode=vf(t.type,t.pendingProps,H.current),wi=t,Oi=!0,a=Ti,rf(t.type)?(hf=a,Ti=mf(r.firstChild)):Ti=a),ec(e,t,t.pendingProps.children,n),uc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ei&&((a=r=Ti)&&(r=cf(r,t.type,t.pendingProps,Oi),r===null?a=!1:(t.stateNode=r,wi=t,Ti=mf(r.firstChild),Oi=!1,a=!0)),a||Ai(t)),ne(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Yd(a,o)?r=null:s!==null&&Yd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=vo(e,t,xo,null,null,n),G._currentValue=a),uc(e,t),ec(e,t,r,n),t.child;case 6:return e===null&&Ei&&((e=n=Ti)&&(n=lf(n,t.pendingProps,Oi),n===null?e=!1:(t.stateNode=n,wi=t,Ti=null,e=!0)),e||Ai(t)),null;case 13:return vc(e,t,n);case 4:return W(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Aa(t,null,r,n):ec(e,t,r,n),t.child;case 11:return tc(e,t,t.type,t.pendingProps,n);case 7:return ec(e,t,t.pendingProps,n),t.child;case 8:return ec(e,t,t.pendingProps.children,n),t.child;case 12:return ec(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Bi(t,t.type,r.value),ec(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Ki(t),a=qi(a),r=r(a),t.flags|=1,ec(e,t,r,n),t.child;case 14:return nc(e,t,t.type,t.pendingProps,n);case 15:return rc(e,t,t.type,t.pendingProps,n);case 19:return wc(e,t,n);case 31:return lc(e,t,n);case 22:return ic(e,t,n,t.pendingProps);case 24:return Ki(t),r=qi($i),e===null?(a=da(),a===null&&(a=Rl,o=ea(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Na(t),Bi(t,$i,a)):((e.lanes&n)!==0&&(Pa(e,t),Va(t,null,null,n),Ba()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Bi(t,$i,r),r!==a.cache&&Ui(t,[$i],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Bi(t,$i,r))),ec(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function kc(e){e.flags|=4}function Ac(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Du())e.flags|=8192;else throw xa=_a,ha}else e.flags&=-16777217}function jc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Xf(t))if(Du())e.flags|=8192;else throw xa=_a,ha}function Mc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ze(),e.lanes|=t,Ql|=t)}function Nc(e,t){if(!Ei)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Fc(e,t,n){var r=t.pendingProps;switch(Si(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pc(t),null;case 1:return Pc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Vi($i),te(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ni(t)?kc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Fi())),Pc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(kc(t),o===null?(Pc(t),Ac(t,a,null,r,n)):(Pc(t),jc(t,o))):o?o===e.memoizedState?(Pc(t),t.flags&=-16777217):(kc(t),Pc(t),jc(t,o)):(e=e.memoizedProps,e!==r&&kc(t),Pc(t),Ac(t,a,e,r,n)),null;case 27:if(re(t),n=H.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}e=B.current,Ni(t)?ji(t,e):(e=vf(a,r,n),t.stateNode=e,kc(t))}return Pc(t),null;case 5:if(re(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Pc(t),null}if(o=B.current,Ni(t))ji(t,o);else{var s=Kd(H.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[Ze]=t,o[Qe]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Bd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&kc(t)}}return Pc(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&kc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=H.current,Ni(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=wi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[Ze]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Ld(e.nodeValue,n)),e||Ai(t,!0)}else e=Kd(e).createTextNode(r),e[Ze]=t,t.stateNode=e}return Pc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Ni(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[Ze]=t}else Pi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),e=!1}else n=Fi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(to(t),t):(to(t),null);if(t.flags&128)throw Error(i(558))}return Pc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Ni(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[Ze]=t}else Pi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),a=!1}else a=Fi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(to(t),t):(to(t),null)}return to(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Mc(t,t.updateQueue),Pc(t),null);case 4:return te(),e===null&&Dd(t.stateNode.containerInfo),Pc(t),null;case 10:return Vi(t.type),Pc(t),null;case 19:if(R(no),r=t.memoizedState,r===null)return Pc(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Nc(r,!1);else{if(ql!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=ro(e),o!==null){for(t.flags|=128,Nc(r,!1),e=o.updateQueue,t.updateQueue=e,Mc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ni(n,e),n=n.sibling;return z(no,no.current&1|2),Ei&&yi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&ge()>iu&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304)}else{if(!a)if(e=ro(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Mc(t,e),Nc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Ei)return Pc(t),null}else 2*ge()-r.renderingStartTime>iu&&n!==536870912&&(t.flags|=128,a=!0,Nc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Pc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=ge(),e.sibling=null,n=no.current,z(no,a?n&1|2:n&1),Ei&&yi(t,r.treeForkCount),e);case 22:case 23:return to(t),Ja(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Pc(t),t.subtreeFlags&6&&(t.flags|=8192)):Pc(t),n=t.updateQueue,n!==null&&Mc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&R(ua),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Vi($i),Pc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Ic(e,t){switch(Si(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Vi($i),te(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return re(t),null;case 31:if(t.memoizedState!==null){if(to(t),t.alternate===null)throw Error(i(340));Pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(to(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Pi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return R(no),null;case 4:return te(),null;case 10:return Vi(t.type),null;case 22:case 23:return to(t),Ja(),e!==null&&R(ua),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Vi($i),null;case 25:return null;default:return null}}function Lc(e,t){switch(Si(t),t.tag){case 3:Vi($i),te();break;case 26:case 27:case 5:re(t);break;case 4:te();break;case 31:t.memoizedState!==null&&to(t);break;case 13:to(t);break;case 19:R(no);break;case 10:Vi(t.type);break;case 22:case 23:to(t),Ja(),e!==null&&R(ua);break;case 24:Vi($i)}}function Rc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Ju(t,t.return,e)}}function zc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Ju(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Ju(t,t.return,e)}}function Bc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ua(t,n)}catch(t){Ju(e,e.return,t)}}}function Vc(e,t,n){n.props=Hs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Ju(e,t,n)}}function Hc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Ju(e,t,n)}}function Uc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Ju(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Ju(e,t,n)}else n.current=null}function Wc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Ju(e,e.return,t)}}function Gc(e,t,n){try{var r=e.stateNode;Vd(r,e.type,n,t),r[Qe]=t}catch(t){Ju(e,e.return,t)}}function Kc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&rf(e.type)||e.tag===4}function qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Kc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&rf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Wt));else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Bd(t,r,n),t[Ze]=e,t[Qe]=n}catch(t){Ju(e,e.return,t)}}var Zc=!1,Qc=!1,$c=!1,el=typeof WeakSet==`function`?WeakSet:Set,tl=null;function nl(e,t){if(e=e.containerInfo,Wd=pp,e=vr(e),yr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Gd={focusedElem:e,selectionRange:n},pp=!1,tl=t;tl!==null;)if(t=tl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,tl=e;else for(;tl!==null;){switch(t=tl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Hs(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Ju(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)sf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:sf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,tl=e;break}tl=t.return}}function rl(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:vl(e,n),r&4&&Rc(5,n);break;case 1:if(vl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Ju(n,n.return,e)}else{var i=Hs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Ju(n,n.return,e)}}r&64&&Bc(n),r&512&&Hc(n,n.return);break;case 3:if(vl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ua(e,t)}catch(e){Ju(n,n.return,e)}}break;case 27:t===null&&r&4&&Xc(n);case 26:case 5:vl(e,n),t===null&&r&4&&Wc(n),r&512&&Hc(n,n.return);break;case 12:vl(e,n);break;case 31:vl(e,n),r&4&&ll(e,n);break;case 13:vl(e,n),r&4&&ul(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Qu.bind(null,n),pf(e,n))));break;case 22:if(r=n.memoizedState!==null||Zc,!r){t=t!==null&&t.memoizedState!==null||Qc,i=Zc;var a=Qc;Zc=r,(Qc=t)&&!a?bl(e,n,(n.subtreeFlags&8772)!=0):vl(e,n),Zc=i,Qc=a}break;case 30:break;default:vl(e,n)}}function il(e){var t=e.alternate;t!==null&&(e.alternate=null,il(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&at(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var al=null,ol=!1;function sl(e,t,n){for(n=n.child;n!==null;)cl(e,t,n),n=n.sibling}function cl(e,t,n){if(Ee&&typeof Ee.onCommitFiberUnmount==`function`)try{Ee.onCommitFiberUnmount(Te,n)}catch{}switch(n.tag){case 26:Qc||Uc(n,t),sl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Qc||Uc(n,t);var r=al,i=ol;rf(n.type)&&(al=n.stateNode,ol=!1),sl(e,t,n),yf(n.stateNode),al=r,ol=i;break;case 5:Qc||Uc(n,t);case 6:if(r=al,i=ol,al=null,sl(e,t,n),al=r,ol=i,al!==null)if(ol)try{(al.nodeType===9?al.body:al.nodeName===`HTML`?al.ownerDocument.body:al).removeChild(n.stateNode)}catch(e){Ju(n,t,e)}else try{al.removeChild(n.stateNode)}catch(e){Ju(n,t,e)}break;case 18:al!==null&&(ol?(e=al,af(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Vp(e)):af(al,n.stateNode));break;case 4:r=al,i=ol,al=n.stateNode.containerInfo,ol=!0,sl(e,t,n),al=r,ol=i;break;case 0:case 11:case 14:case 15:zc(2,n,t),Qc||zc(4,n,t),sl(e,t,n);break;case 1:Qc||(Uc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Vc(n,t,r)),sl(e,t,n);break;case 21:sl(e,t,n);break;case 22:Qc=(r=Qc)||n.memoizedState!==null,sl(e,t,n),Qc=r;break;default:sl(e,t,n)}}function ll(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Vp(e)}catch(e){Ju(t,t.return,e)}}}function ul(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vp(e)}catch(e){Ju(t,t.return,e)}}function dl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new el),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new el),t;default:throw Error(i(435,e.tag))}}function fl(e,t){var n=dl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=$u.bind(null,e,t);t.then(r,r)}})}function pl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(rf(c.type)){al=c.stateNode,ol=!1;break a}break;case 5:al=c.stateNode,ol=!1;break a;case 3:case 4:al=c.stateNode.containerInfo,ol=!0;break a}c=c.return}if(al===null)throw Error(i(160));cl(o,s,a),al=null,ol=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hl(t,e),t=t.sibling}var ml=null;function hl(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:pl(t,e),gl(e),r&4&&(zc(3,e,e.return),Rc(3,e),zc(5,e,e.return));break;case 1:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&64&&Zc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=ml;if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[it]||o[Ze]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Bd(o,r,n),o[Ze]=e,ut(o),r=o;break a;case`link`:var s=qf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=qf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[Ze]=e,ut(o),r=o}e.stateNode=r}else Jf(a,e.type,e.stateNode);else e.stateNode=Hf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&Gc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Jf(a,e.type,e.stateNode):Hf(a,r,e.memoizedProps))}break;case 27:pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),n!==null&&r&4&&Gc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(pl(t,e),gl(e),r&512&&(Qc||n===null||Uc(n,n.return)),e.flags&32){a=e.stateNode;try{It(a,``)}catch(t){Ju(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Gc(e,a,n===null?a:n.memoizedProps)),r&1024&&($c=!0);break;case 6:if(pl(t,e),gl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Ju(e,e.return,t)}}break;case 3:if(Kf=null,a=ml,ml=Sf(t.containerInfo),pl(t,e),ml=a,gl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Vp(t.containerInfo)}catch(t){Ju(e,e.return,t)}$c&&($c=!1,_l(e));break;case 4:r=ml,ml=Sf(e.stateNode.containerInfo),pl(t,e),gl(e),ml=r;break;case 12:pl(t,e),gl(e);break;case 31:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 13:pl(t,e),gl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(nu=ge()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Zc,d=Qc;if(Zc=u||a,Qc=d||l,pl(t,e),Qc=d,Zc=u,gl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||Zc||Qc||yl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Ju(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Ju(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?of(m,!0):of(l.stateNode,!1)}catch(e){Ju(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,fl(e,n))));break;case 19:pl(t,e),gl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,fl(e,r)));break;case 30:break;case 21:break;default:pl(t,e),gl(e)}}function gl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Kc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Yc(e,qc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(It(o,``),n.flags&=-33),Yc(e,qc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Jc(e,qc(e),s);break;default:throw Error(i(161))}}catch(t){Ju(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _l(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_l(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function vl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)rl(e,t.alternate,t),t=t.sibling}function yl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:zc(4,t,t.return),yl(t);break;case 1:Uc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Vc(t,t.return,n),yl(t);break;case 27:yf(t.stateNode);case 26:case 5:Uc(t,t.return),yl(t);break;case 22:t.memoizedState===null&&yl(t);break;case 30:yl(t);break;default:yl(t)}e=e.sibling}}function bl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:bl(i,a,n),Rc(4,a);break;case 1:if(bl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Ju(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ha(c[i],s)}catch(e){Ju(r,r.return,e)}}n&&o&64&&Bc(a),Hc(a,a.return);break;case 27:Xc(a);case 26:case 5:bl(i,a,n),n&&r===null&&o&4&&Wc(a),Hc(a,a.return);break;case 12:bl(i,a,n);break;case 31:bl(i,a,n),n&&o&4&&ll(i,a);break;case 13:bl(i,a,n),n&&o&4&&ul(i,a);break;case 22:a.memoizedState===null&&bl(i,a,n),Hc(a,a.return);break;case 30:break;default:bl(i,a,n)}t=t.sibling}}function xl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ta(n))}function Sl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ta(e))}function Cl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wl(e,t,n,r),t=t.sibling}function wl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Cl(e,t,n,r),i&2048&&Rc(9,t);break;case 1:Cl(e,t,n,r);break;case 3:Cl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ta(e)));break;case 12:if(i&2048){Cl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Ju(t,t.return,e)}}else Cl(e,t,n,r);break;case 31:Cl(e,t,n,r);break;case 13:Cl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Cl(e,t,n,r):(a._visibility|=2,Tl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Cl(e,t,n,r):El(e,t),i&2048&&xl(o,t);break;case 24:Cl(e,t,n,r),i&2048&&Sl(t.alternate,t);break;default:Cl(e,t,n,r)}}function Tl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Tl(a,o,s,c,i),Rc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Tl(a,o,s,c,i)):u._visibility&2?Tl(a,o,s,c,i):El(a,o),i&&l&2048&&xl(o.alternate,o);break;case 24:Tl(a,o,s,c,i),i&&l&2048&&Sl(o.alternate,o);break;default:Tl(a,o,s,c,i)}t=t.sibling}}function El(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:El(n,r),i&2048&&xl(r.alternate,r);break;case 24:El(n,r),i&2048&&Sl(r.alternate,r);break;default:El(n,r)}t=t.sibling}}var Dl=8192;function Ol(e,t,n){if(e.subtreeFlags&Dl)for(e=e.child;e!==null;)kl(e,t,n),e=e.sibling}function kl(e,t,n){switch(e.tag){case 26:Ol(e,t,n),e.flags&Dl&&e.memoizedState!==null&&Zf(n,ml,e.memoizedState,e.memoizedProps);break;case 5:Ol(e,t,n);break;case 3:case 4:var r=ml;ml=Sf(e.stateNode.containerInfo),Ol(e,t,n),ml=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Dl,Dl=16777216,Ol(e,t,n),Dl=r):Ol(e,t,n));break;default:Ol(e,t,n)}}function Al(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function jl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ml(e),e=e.sibling}function Ml(e){switch(e.tag){case 0:case 11:case 15:jl(e),e.flags&2048&&zc(9,e,e.return);break;case 3:jl(e);break;case 12:jl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Nl(e)):jl(e);break;default:jl(e)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];tl=r,Pl(r,e)}Al(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:zc(8,t,t.return),Nl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Nl(t));break;default:Nl(t)}e=e.sibling}}function Pl(e,t){for(;tl!==null;){var n=tl;switch(n.tag){case 0:case 11:case 15:zc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ta(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,tl=r;else a:for(n=e;tl!==null;){r=tl;var i=r.sibling,a=r.return;if(il(r),r===n){tl=null;break a}if(i!==null){i.return=a,tl=i;break a}tl=a}}}var Fl={getCacheForType:function(e){var t=qi($i),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return qi($i).controller.signal}},Il=typeof WeakMap==`function`?WeakMap:Map,Ll=0,Rl=null,zl=null,Bl=0,Vl=0,Hl=null,Ul=!1,Wl=!1,Gl=!1,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=null,eu=null,tu=!1,nu=0,ru=0,iu=1/0,au=null,ou=null,su=0,cu=null,lu=null,uu=0,du=0,fu=null,pu=null,mu=0,hu=null;function gu(){return Ll&2&&Bl!==0?Bl&-Bl:N.T===null?Je():hd()}function _u(){if(Zl===0)if(!(Bl&536870912)||Ei){var e=Ne;Ne<<=1,!(Ne&3932160)&&(Ne=262144),Zl=e}else Zl=536870912;return e=Ya.current,e!==null&&(e.flags|=32),Zl}function vu(e,t,n){(e===Rl&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)&&(Tu(e,0),Su(e,Bl,Zl,!1)),Ve(e,n),(!(Ll&2)||e!==Rl)&&(e===Rl&&(!(Ll&2)&&(Yl|=n),ql===4&&Su(e,Bl,Zl,!1)),sd(e))}function yu(e,t,n){if(Ll&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Le(e,t),a=r?Nu(e,t):ju(e,t,!0),o=r;do{if(a===0){Wl&&!r&&Su(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!xu(n)){a=ju(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=$l;var l=c.current.memoizedState.isDehydrated;if(l&&(Tu(c,s).flags|=256),s=ju(c,s,!1),s!==2){if(Gl&&!l){c.errorRecoveryDisabledLanes|=o,Yl|=o,a=4;break a}o=eu,eu=a,o!==null&&(eu===null?eu=o:eu.push.apply(eu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Tu(e,0),Su(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:Su(r,t,Zl,!Ul);break a;case 2:eu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=nu+300-ge(),10<a)){if(Su(r,t,Zl,!Ul),Ie(r,0,!0)!==0)break a;uu=t,r.timeoutHandle=Qd(bu.bind(null,r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,`Throttled`,-0,0),a);break a}bu(r,n,eu,au,tu,t,Zl,Yl,Ql,Ul,o,null,-0,0)}}break}while(1);sd(e)}function bu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wt},kl(t,a,d);var m=(a&62914560)===a?nu-ge():(a&4194048)===a?ru-ge():0;if(m=$f(d,m),m!==null){uu=a,e.cancelPendingCommit=m(Bu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Su(e,a,o,!l);return}}Bu(e,t,a,n,r,i,o,s,c)}function xu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!pr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Su(e,t,n,r){t&=~Xl,t&=~Yl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Oe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ue(e,n,t)}function Cu(){return Ll&6?!0:(cd(0,!1),!1)}function wu(){if(zl!==null){if(Vl===0)var e=zl.return;else e=zl,zi=Ri=null,wo(e),wa=null,Ta=0,e=zl;for(;e!==null;)Lc(e.alternate,e),e=e.return;zl=null}}function Tu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,$d(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),uu=0,wu(),Rl=e,zl=n=ti(e.current,null),Bl=t,Vl=0,Hl=null,Ul=!1,Wl=Le(e,t),Gl=!1,Ql=Zl=Xl=Yl=Jl=ql=0,eu=$l=null,tu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Oe(r),a=1<<i;t|=e[i],r&=~a}return Kl=t,Gr(),n}function Eu(e,t){ao=null,N.H=Ps,t===ma||t===ga?(t=Sa(),Vl=3):t===ha?(t=Sa(),Vl=4):Vl=t===Qs?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Hl=t,zl===null&&(ql=1,Ks(e,li(t,e.current)))}function Du(){var e=Ya.current;return e===null?!0:(Bl&4194048)===Bl?Xa===null:(Bl&62914560)===Bl||Bl&536870912?e===Xa:!1}function Ou(){var e=N.H;return N.H=Ps,e===null?Ps:e}function ku(){var e=N.A;return N.A=Fl,e}function Au(){ql=4,Ul||(Bl&4194048)!==Bl&&Ya.current!==null||(Wl=!0),!(Jl&134217727)&&!(Yl&134217727)||Rl===null||Su(Rl,Bl,Zl,!1)}function ju(e,t,n){var r=Ll;Ll|=2;var i=Ou(),a=ku();(Rl!==e||Bl!==t)&&(au=null,Tu(e,t)),t=!1;var o=ql;a:do try{if(Vl!==0&&zl!==null){var s=zl,c=Hl;switch(Vl){case 8:wu(),o=6;break a;case 3:case 2:case 9:case 6:Ya.current===null&&(t=!0);var l=Vl;if(Vl=0,Hl=null,Lu(e,s,c,l),n&&Wl){o=0;break a}break;default:l=Vl,Vl=0,Hl=null,Lu(e,s,c,l)}}Mu(),o=ql;break}catch(t){Eu(e,t)}while(1);return t&&e.shellSuspendCounter++,zi=Ri=null,Ll=r,N.H=i,N.A=a,zl===null&&(Rl=null,Bl=0,Gr()),o}function Mu(){for(;zl!==null;)Fu(zl)}function Nu(e,t){var n=Ll;Ll|=2;var r=Ou(),a=ku();Rl!==e||Bl!==t?(au=null,iu=ge()+500,Tu(e,t)):Wl=Le(e,t);a:do try{if(Vl!==0&&zl!==null){t=zl;var o=Hl;b:switch(Vl){case 1:Vl=0,Hl=null,Lu(e,t,o,1);break;case 2:case 9:if(va(o)){Vl=0,Hl=null,Iu(t);break}t=function(){Vl!==2&&Vl!==9||Rl!==e||(Vl=7),sd(e)},o.then(t,t);break a;case 3:Vl=7;break a;case 4:Vl=5;break a;case 7:va(o)?(Vl=0,Hl=null,Iu(t)):(Vl=0,Hl=null,Lu(e,t,o,7));break;case 5:var s=null;switch(zl.tag){case 26:s=zl.memoizedState;case 5:case 27:var c=zl;if(s?Xf(s):c.stateNode.complete){Vl=0,Hl=null;var l=c.sibling;if(l!==null)zl=l;else{var u=c.return;u===null?zl=null:(zl=u,Ru(u))}break b}}Vl=0,Hl=null,Lu(e,t,o,5);break;case 6:Vl=0,Hl=null,Lu(e,t,o,6);break;case 8:wu(),ql=6;break a;default:throw Error(i(462))}}Pu();break}catch(t){Eu(e,t)}while(1);return zi=Ri=null,N.H=r,N.A=a,Ll=n,zl===null?(Rl=null,Bl=0,Gr(),ql):0}function Pu(){for(;zl!==null&&!me();)Fu(zl)}function Fu(e){var t=Oc(e.alternate,e,Kl);e.memoizedProps=e.pendingProps,t===null?Ru(e):zl=t}function Iu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=fc(n,t,t.pendingProps,t.type,void 0,Bl);break;case 11:t=fc(n,t,t.pendingProps,t.type.render,t.ref,Bl);break;case 5:wo(t);default:Lc(n,t),t=zl=ni(t,Kl),t=Oc(n,t,Kl)}e.memoizedProps=e.pendingProps,t===null?Ru(e):zl=t}function Lu(e,t,n,r){zi=Ri=null,wo(t),wa=null,Ta=0;var i=t.return;try{if(Zs(e,i,t,n,Bl)){ql=1,Ks(e,li(n,e.current)),zl=null;return}}catch(t){if(i!==null)throw zl=i,t;ql=1,Ks(e,li(n,e.current)),zl=null;return}t.flags&32768?(Ei||r===1?e=!0:Wl||Bl&536870912?e=!1:(Ul=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ya.current,r!==null&&r.tag===13&&(r.flags|=16384))),zu(t,e)):Ru(t)}function Ru(e){var t=e;do{if(t.flags&32768){zu(t,Ul);return}e=t.return;var n=Fc(t.alternate,t,Kl);if(n!==null){zl=n;return}if(t=t.sibling,t!==null){zl=t;return}zl=t=e}while(t!==null);ql===0&&(ql=5)}function zu(e,t){do{var n=Ic(e.alternate,e);if(n!==null){n.flags&=32767,zl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){zl=e;return}zl=e=n}while(e!==null);ql=6,zl=null}function Bu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Gu();while(su!==0);if(Ll&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Wr,He(e,n,o,s,c,l),e===Rl&&(zl=Rl=null,Bl=0),lu=t,cu=e,uu=n,du=o,fu=a,pu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,ed(be,function(){return Ku(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=N.T,N.T=null,a=P.p,P.p=2,s=Ll,Ll|=4;try{nl(e,t,n)}finally{Ll=s,P.p=a,N.T=r}}su=1,Vu(),Hu(),Uu()}}function Vu(){if(su===1){su=0;var e=cu,t=lu,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Ll;Ll|=4;try{hl(t,e);var a=Gd,o=vr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&_r(s.ownerDocument.documentElement,s)){if(c!==null&&yr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=gr(s,h),v=gr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}pp=!!Wd,Gd=Wd=null}finally{Ll=i,P.p=r,N.T=n}}e.current=t,su=2}}function Hu(){if(su===2){su=0;var e=cu,t=lu,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=N.T,N.T=null;var r=P.p;P.p=2;var i=Ll;Ll|=4;try{rl(e,t.alternate,t)}finally{Ll=i,P.p=r,N.T=n}}su=3}}function Uu(){if(su===4||su===3){su=0,he();var e=cu,t=lu,n=uu,r=pu;t.subtreeFlags&10256||t.flags&10256?su=5:(su=0,lu=cu=null,Wu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(ou=null),qe(n),t=t.stateNode,Ee&&typeof Ee.onCommitFiberRoot==`function`)try{Ee.onCommitFiberRoot(Te,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=N.T,i=P.p,P.p=2,N.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{N.T=t,P.p=i}}uu&3&&Gu(),sd(e),i=e.pendingLanes,n&261930&&i&42?e===hu?mu++:(mu=0,hu=e):mu=0,cd(0,!1)}}function Wu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ta(t)))}function Gu(){return Vu(),Hu(),Uu(),Ku()}function Ku(){if(su!==5)return!1;var e=cu,t=du;du=0;var n=qe(uu),r=N.T,a=P.p;try{P.p=32>n?32:n,N.T=null,n=fu,fu=null;var o=cu,s=uu;if(su=0,lu=cu=null,uu=0,Ll&6)throw Error(i(331));var c=Ll;if(Ll|=4,Ml(o.current),wl(o,o.current,s,n),Ll=c,cd(0,!1),Ee&&typeof Ee.onPostCommitFiberRoot==`function`)try{Ee.onPostCommitFiberRoot(Te,o)}catch{}return!0}finally{P.p=a,N.T=r,Wu(e,t)}}function qu(e,t,n){t=li(n,t),t=Js(e.stateNode,t,2),e=Ia(e,t,2),e!==null&&(Ve(e,2),sd(e))}function Ju(e,t,n){if(e.tag===3)qu(e,e,n);else for(;t!==null;){if(t.tag===3){qu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(ou===null||!ou.has(r))){e=li(n,e),n=Ys(2),r=Ia(t,n,2),r!==null&&(Xs(n,r,t,e),Ve(r,2),sd(r));break}}t=t.return}}function Yu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Il;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Gl=!0,i.add(n),e=Xu.bind(null,e,t,n),t.then(e,e))}function Xu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Rl===e&&(Bl&n)===n&&(ql===4||ql===3&&(Bl&62914560)===Bl&&300>ge()-nu?!(Ll&2)&&Tu(e,0):Xl|=n,Ql===Bl&&(Ql=0)),sd(e)}function Zu(e,t){t===0&&(t=ze()),e=Jr(e,t),e!==null&&(Ve(e,t),sd(e))}function Qu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Zu(e,n)}function $u(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Zu(e,n)}function ed(e,t){return fe(e,t)}var td=null,nd=null,rd=!1,id=!1,ad=!1,od=0;function sd(e){e!==nd&&e.next===null&&(nd===null?td=nd=e:nd=nd.next=e),id=!0,rd||(rd=!0,md())}function cd(e,t){if(!ad&&id){ad=!0;do for(var n=!1,r=td;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Oe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,pd(r,a))}else a=Bl,a=Ie(r,r===Rl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Le(r,a)||(n=!0,pd(r,a));r=r.next}while(n);ad=!1}}function ld(){ud()}function ud(){id=rd=!1;var e=0;od!==0&&Zd()&&(e=od);for(var t=ge(),n=null,r=td;r!==null;){var i=r.next,a=dd(r,t);a===0?(r.next=null,n===null?td=i:n.next=i,i===null&&(nd=n)):(n=r,(e!==0||a&3)&&(id=!0)),r=i}su!==0&&su!==5||cd(e,!1),od!==0&&(od=0)}function dd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Oe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Re(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Rl,n=Bl,n=Ie(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Vl===2||Vl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&pe(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Le(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&pe(r),qe(n)){case 2:case 8:n=ye;break;case 32:n=be;break;case 268435456:n=Se;break;default:n=be}return r=fd.bind(null,e),n=fe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&pe(r),e.callbackPriority=2,e.callbackNode=null,2}function fd(e,t){if(su!==0&&su!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Gu()&&e.callbackNode!==n)return null;var r=Bl;return r=Ie(e,e===Rl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(yu(e,r,t),dd(e,ge()),e.callbackNode!=null&&e.callbackNode===n?fd.bind(null,e):null)}function pd(e,t){if(Gu())return null;yu(e,t,!0)}function md(){tf(function(){Ll&6?fe(ve,ld):ud()})}function hd(){if(od===0){var e=ia;e===0&&(e=Me,Me<<=1,!(Me&261888)&&(Me=256)),od=e}return od}function gd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Ut(``+e)}function _d(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function vd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=gd((i[Qe]||null).action),o=r.submitter;o&&(t=(t=o[Qe]||null)?gd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new fn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(od!==0){var e=o?_d(i,o):new FormData(i);bs(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?_d(i,o):new FormData(i),bs(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var yd=0;yd<zr.length;yd++){var bd=zr[yd];Br(bd.toLowerCase(),`on`+(bd[0].toUpperCase()+bd.slice(1)))}Br(jr,`onAnimationEnd`),Br(Mr,`onAnimationIteration`),Br(Nr,`onAnimationStart`),Br(`dblclick`,`onDoubleClick`),Br(`focusin`,`onFocus`),Br(`focusout`,`onBlur`),Br(Pr,`onTransitionRun`),Br(Fr,`onTransitionStart`),Br(Ir,`onTransitionCancel`),Br(Lr,`onTransitionEnd`),mt(`onMouseEnter`,[`mouseout`,`mouseover`]),mt(`onMouseLeave`,[`mouseout`,`mouseover`]),mt(`onPointerEnter`,[`pointerout`,`pointerover`]),mt(`onPointerLeave`,[`pointerout`,`pointerover`]),pt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),pt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),pt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),pt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),pt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),pt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var xd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Sd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(xd));function Cd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Vr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Vr(e)}i.currentTarget=null,a=c}}}}function wd(e,t){var n=t[et];n===void 0&&(n=t[et]=new Set);var r=e+`__bubble`;n.has(r)||(Od(t,e,2,!1),n.add(r))}function Td(e,t,n){var r=0;t&&(r|=4),Od(n,e,r,t)}var Ed=`_reactListening`+Math.random().toString(36).slice(2);function Dd(e){if(!e[Ed]){e[Ed]=!0,dt.forEach(function(t){t!==`selectionchange`&&(Sd.has(t)||Td(t,!1,e),Td(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ed]||(t[Ed]=!0,Td(`selectionchange`,!1,t))}}function Od(e,t,n,r){switch(bp(t)){case 2:var i=mp;break;case 8:i=hp;break;default:i=gp}n=i.bind(null,t,n,e),i=void 0,!en||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function kd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=ot(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}Zt(function(){var r=a,i=Kt(n),s=[];a:{var c=Rr.get(e);if(c!==void 0){var l=fn,u=e;switch(e){case`keypress`:if(sn(n)===0)break a;case`keydown`:case`keyup`:l=An;break;case`focusin`:u=`focus`,l=xn;break;case`focusout`:u=`blur`,l=xn;break;case`beforeblur`:case`afterblur`:l=xn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=yn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=bn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Mn;break;case jr:case Mr:case Nr:l=Sn;break;case Lr:l=Nn;break;case`scroll`:case`scrollend`:l=mn;break;case`wheel`:l=Pn;break;case`copy`:case`cut`:case`paste`:l=Cn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=jn;break;case`toggle`:case`beforetoggle`:l=Fn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Qt(m,p),g!=null&&d.push(Ad(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Gt&&(u=n.relatedTarget||n.fromElement)&&(ot(u)||u[$e]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?ot(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=yn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=jn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ct(l),h=u==null?c:ct(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,ot(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Md,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Nd(s,c,l,d,!1),u!==null&&f!==null&&Nd(s,f,u,d,!0)}}a:{if(c=r?ct(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=tr;else if(Yn(c))if(nr)v=dr;else{v=lr;var y=cr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Bt(r.elementType)&&(v=tr):v=ur;if(v&&=v(e,r)){Xn(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Mt(c,`number`,c.value)}switch(y=r?ct(r):window,e){case`focusin`:(Yn(y)||y.contentEditable===`true`)&&(xr=y,Sr=r,Cr=null);break;case`focusout`:Cr=Sr=xr=null;break;case`mousedown`:wr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:wr=!1,Tr(s,n,i);break;case`selectionchange`:if(br)break;case`keydown`:case`keyup`:Tr(s,n,i)}var b;if(Ln)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Gn?Un(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Bn&&n.locale!==`ko`&&(Gn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Gn&&(b=on()):(nn=i,rn=`value`in nn?nn.value:nn.textContent,Gn=!0)),y=jd(r,x),0<y.length&&(x=new wn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Wn(n),b!==null&&(x.data=b)))),(b=zn?Kn(e,n):qn(e,n))&&(x=jd(r,`onBeforeInput`),0<x.length&&(y=new wn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),vd(s,e,r,n,i)}Cd(s,t)})}function Ad(e,t,n){return{instance:e,listener:t,currentTarget:n}}function jd(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Qt(e,n),i!=null&&r.unshift(Ad(e,i,a)),i=Qt(e,t),i!=null&&r.push(Ad(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Md(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Nd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Qt(n,a),l!=null&&o.unshift(Ad(n,l,c))):i||(l=Qt(n,a),l!=null&&o.push(Ad(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Pd=/\r\n?/g,Fd=/\u0000|\uFFFD/g;function Id(e){return(typeof e==`string`?e:``+e).replace(Pd,`
13
+ `).replace(Fd,``)}function Ld(e,t){return t=Id(t),Id(e)===t}function Rd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||It(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&It(e,``+r);break;case`className`:bt(e,`class`,r);break;case`tabIndex`:bt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:bt(e,n,r);break;case`style`:zt(e,r,o);break;case`data`:if(t!==`object`){bt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Ut(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&Rd(e,t,`name`,a.name,a,null),Rd(e,t,`formEncType`,a.formEncType,a,null),Rd(e,t,`formMethod`,a.formMethod,a,null),Rd(e,t,`formTarget`,a.formTarget,a,null)):(Rd(e,t,`encType`,a.encType,a,null),Rd(e,t,`method`,a.method,a,null),Rd(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Ut(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Wt);break;case`onScroll`:r!=null&&wd(`scroll`,e);break;case`onScrollEnd`:r!=null&&wd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Ut(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:wd(`beforetoggle`,e),wd(`toggle`,e),yt(e,`popover`,r);break;case`xlinkActuate`:xt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:xt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:xt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:xt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:xt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:xt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:yt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Vt.get(n)||n,yt(e,n,r))}}function zd(e,t,n,r,a,o){switch(n){case`style`:zt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?It(e,r):(typeof r==`number`||typeof r==`bigint`)&&It(e,``+r);break;case`onScroll`:r!=null&&wd(`scroll`,e);break;case`onScrollEnd`:r!=null&&wd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Wt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!ft.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[Qe]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):yt(e,n,r)}}}function Bd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:wd(`error`,e),wd(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Rd(e,t,o,s,n,null)}}a&&Rd(e,t,`srcSet`,n.srcSet,n,null),r&&Rd(e,t,`src`,n.src,n,null);return;case`input`:wd(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Rd(e,t,r,d,n,null)}}jt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in wd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Rd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Nt(e,!!r,n,!0):Nt(e,!!r,t,!1);return;case`textarea`:for(s in wd(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Rd(e,t,s,c,n,null)}Ft(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Rd(e,t,l,r,n,null)}return;case`dialog`:wd(`beforetoggle`,e),wd(`toggle`,e),wd(`cancel`,e),wd(`close`,e);break;case`iframe`:case`object`:wd(`load`,e);break;case`video`:case`audio`:for(r=0;r<xd.length;r++)wd(xd[r],e);break;case`image`:wd(`error`,e),wd(`load`,e);break;case`details`:wd(`toggle`,e);break;case`embed`:case`source`:case`link`:wd(`error`,e),wd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Rd(e,t,u,r,n,null)}return;default:if(Bt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&zd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Rd(e,t,c,r,n,null))}function Vd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Rd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Rd(e,t,p,m,r,f)}}At(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Rd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Rd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Nt(e,!!n,n?[]:``,!1):Nt(e,!!n,t,!0)):Nt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Rd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Rd(e,t,s,a,r,o)}Pt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Rd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Rd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Rd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Rd(e,t,u,p,r,m)}return;default:if(Bt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&zd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||zd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Rd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Rd(e,t,f,p,r,m)}function Hd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ud(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Hd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Hd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Wd=null,Gd=null;function Kd(e){return e.nodeType===9?e:e.ownerDocument}function qd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Jd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Yd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xd=null;function Zd(){var e=window.event;return e&&e.type===`popstate`?e===Xd?!1:(Xd=e,!0):(Xd=null,!1)}var Qd=typeof setTimeout==`function`?setTimeout:void 0,$d=typeof clearTimeout==`function`?clearTimeout:void 0,ef=typeof Promise==`function`?Promise:void 0,tf=typeof queueMicrotask==`function`?queueMicrotask:ef===void 0?Qd:function(e){return ef.resolve(null).then(e).catch(nf)};function nf(e){setTimeout(function(){throw e})}function rf(e){return e===`head`}function af(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Vp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)yf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,yf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[it]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&yf(e.ownerDocument.body);n=i}while(n);Vp(t)}function of(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function sf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:sf(n),at(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function cf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[it])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=mf(e.nextSibling),e===null)break}return null}function lf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=mf(e.nextSibling),e===null))return null;return e}function uf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=mf(e.nextSibling),e===null))return null;return e}function df(e){return e.data===`$?`||e.data===`$~`}function ff(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function pf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function mf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var hf=null;function gf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return mf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function _f(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function vf(e,t,n){switch(t=Kd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function yf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);at(e)}var bf=new Map,xf=new Set;function Sf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Cf=P.d;P.d={f:wf,r:Tf,D:Of,C:kf,L:Af,m:jf,X:Nf,S:Mf,M:Pf};function wf(){var e=Cf.f(),t=Cu();return e||t}function Tf(e){var t=st(e);t!==null&&t.tag===5&&t.type===`form`?Ss(t):Cf.r(e)}var Ef=typeof document>`u`?null:document;function Df(e,t,n){var r=Ef;if(r&&typeof t==`string`&&t){var i=kt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),xf.has(i)||(xf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Bd(t,`link`,e),ut(t),r.head.appendChild(t)))}}function Of(e){Cf.D(e),Df(`dns-prefetch`,e,null)}function kf(e,t){Cf.C(e,t),Df(`preconnect`,e,t)}function Af(e,t,n){Cf.L(e,t,n);var r=Ef;if(r&&e&&t){var i=`link[rel="preload"][as="`+kt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+kt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+kt(n.imageSizes)+`"]`)):i+=`[href="`+kt(e)+`"]`;var a=i;switch(t){case`style`:a=If(e);break;case`script`:a=Bf(e)}bf.has(a)||(e=f({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),bf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Lf(a))||t===`script`&&r.querySelector(Vf(a))||(t=r.createElement(`link`),Bd(t,`link`,e),ut(t),r.head.appendChild(t)))}}function jf(e,t){Cf.m(e,t);var n=Ef;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+kt(r)+`"][href="`+kt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Bf(e)}if(!bf.has(a)&&(e=f({rel:`modulepreload`,href:e},t),bf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Vf(a)))return}r=n.createElement(`link`),Bd(r,`link`,e),ut(r),n.head.appendChild(r)}}}function Mf(e,t,n){Cf.S(e,t,n);var r=Ef;if(r&&e){var i=lt(r).hoistableStyles,a=If(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Lf(a)))s.loading=5;else{e=f({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=bf.get(a))&&Wf(e,n);var c=o=r.createElement(`link`);ut(c),Bd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Uf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Nf(e,t){Cf.X(e,t);var n=Ef;if(n&&e){var r=lt(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=f({src:e,async:!0},t),(t=bf.get(i))&&Gf(e,t),a=n.createElement(`script`),ut(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t){Cf.M(e,t);var n=Ef;if(n&&e){var r=lt(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=f({src:e,async:!0,type:`module`},t),(t=bf.get(i))&&Gf(e,t),a=n.createElement(`script`),ut(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ff(e,t,n,r){var a=(a=H.current)?Sf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=If(n.href),n=lt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=If(n.href);var o=lt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Lf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),bf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},bf.set(e,n),o||zf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Bf(n),n=lt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function If(e){return`href="`+kt(e)+`"`}function Lf(e){return`link[rel="stylesheet"][`+e+`]`}function Rf(e){return f({},e,{"data-precedence":e.precedence,precedence:null})}function zf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Bd(t,`link`,n),ut(t),e.head.appendChild(t))}function Bf(e){return`[src="`+kt(e)+`"]`}function Vf(e){return`script[async]`+e}function Hf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+kt(n.href)+`"]`);if(r)return t.instance=r,ut(r),r;var a=f({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ut(r),Bd(r,`style`,a),Uf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=If(n.href);var o=e.querySelector(Lf(a));if(o)return t.state.loading|=4,t.instance=o,ut(o),o;r=Rf(n),(a=bf.get(a))&&Wf(r,a),o=(e.ownerDocument||e).createElement(`link`),ut(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Bd(o,`link`,r),t.state.loading|=4,Uf(o,n.precedence,e),t.instance=o;case`script`:return o=Bf(n.src),(a=e.querySelector(Vf(o)))?(t.instance=a,ut(a),a):(r=n,(a=bf.get(o))&&(r=f({},n),Gf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ut(a),Bd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Uf(r,n.precedence,e));return t.instance}function Uf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Wf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Gf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Kf=null;function qf(e,t,n){if(Kf===null){var r=new Map,i=Kf=new Map;i.set(n,r)}else i=Kf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[it]||a[Ze]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Jf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Yf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Xf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=If(r.href),a=t.querySelector(Lf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ep.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ut(a);return}a=t.ownerDocument||t,r=Rf(r),(i=bf.get(i))&&Wf(r,i),a=a.createElement(`link`),ut(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Bd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ep.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Qf=0;function $f(e,t){return e.stylesheets&&e.count===0&&np(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&np(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Qf===0&&(Qf=62500*Ud());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&np(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ep(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)np(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var tp=null;function np(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,tp=new Map,t.forEach(rp,e),tp=null,ep.call(e))}function rp(e,t){if(!(t.state.loading&4)){var n=tp.get(e);if(n)var r=n.get(null);else{n=new Map,tp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ep.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var G={$$typeof:b,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function ap(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Be(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Be(0),this.hiddenUpdates=Be(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function op(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ap(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=$r(3,null,null,t),e.current=a,a.stateNode=e,t=ea(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Na(a),e}function sp(e){return e?(e=Zr,e):Zr}function cp(e,t,n,r,i,a){i=sp(i),r.context===null?r.context=i:r.pendingContext=i,r=Fa(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ia(e,r,t),n!==null&&(vu(n,e,t),La(n,e,t))}function lp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function up(e,t){lp(e,t),(e=e.alternate)&&lp(e,t)}function dp(e){if(e.tag===13||e.tag===31){var t=Jr(e,67108864);t!==null&&vu(t,e,67108864),up(e,67108864)}}function fp(e){if(e.tag===13||e.tag===31){var t=gu();t=Ke(t);var n=Jr(e,t);n!==null&&vu(n,e,t),up(e,t)}}var pp=!0;function mp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=2,gp(e,t,n,r)}finally{P.p=a,N.T=i}}function hp(e,t,n,r){var i=N.T;N.T=null;var a=P.p;try{P.p=8,gp(e,t,n,r)}finally{P.p=a,N.T=i}}function gp(e,t,n,r){if(pp){var i=_p(r);if(i===null)kd(e,t,r,vp,n),jp(e,r);else if(Np(i,e,t,n,r))r.stopPropagation();else if(jp(e,r),t&4&&-1<Ap.indexOf(e)){for(;i!==null;){var a=st(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Fe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Oe(o);s.entanglements[1]|=c,o&=~c}sd(a),!(Ll&6)&&(iu=ge()+500,cd(0,!1))}}break;case 31:case 13:s=Jr(a,2),s!==null&&vu(s,a,2),Cu(),up(a,2)}if(a=_p(r),a===null&&kd(e,t,r,vp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else kd(e,t,r,null,n)}}function _p(e){return e=Kt(e),yp(e)}var vp=null;function yp(e){if(vp=null,e=ot(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return vp=e,null}function bp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(_e()){case ve:return 2;case ye:return 8;case be:case xe:return 32;case Se:return 268435456;default:return 32}default:return 32}}var xp=!1,Sp=null,Cp=null,wp=null,Tp=new Map,Ep=new Map,Op=[],Ap=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function jp(e,t){switch(e){case`focusin`:case`focusout`:Sp=null;break;case`dragenter`:case`dragleave`:Cp=null;break;case`mouseover`:case`mouseout`:wp=null;break;case`pointerover`:case`pointerout`:Tp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ep.delete(t.pointerId)}}function Mp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=st(t),t!==null&&dp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Np(e,t,n,r,i){switch(t){case`focusin`:return Sp=Mp(Sp,e,t,n,r,i),!0;case`dragenter`:return Cp=Mp(Cp,e,t,n,r,i),!0;case`mouseover`:return wp=Mp(wp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Tp.set(a,Mp(Tp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ep.set(a,Mp(Ep.get(a)||null,e,t,n,r,i)),!0}return!1}function Pp(e){var t=ot(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,Ye(e.priority,function(){fp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,Ye(e.priority,function(){fp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Fp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_p(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Gt=r,n.target.dispatchEvent(r),Gt=null}else return t=st(n),t!==null&&dp(t),e.blockedOn=n,!1;t.shift()}return!0}function Ip(e,t,n){Fp(e)&&n.delete(t)}function Lp(){xp=!1,Sp!==null&&Fp(Sp)&&(Sp=null),Cp!==null&&Fp(Cp)&&(Cp=null),wp!==null&&Fp(wp)&&(wp=null),Tp.forEach(Ip),Ep.forEach(Ip)}function Rp(e,n){e.blockedOn===n&&(e.blockedOn=null,xp||(xp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Lp)))}var zp=null;function Bp(e){zp!==e&&(zp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){zp===e&&(zp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(yp(r||n)===null)continue;break}var a=st(n);a!==null&&(e.splice(t,3),t-=3,bs(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Vp(e){function t(t){return Rp(t,e)}Sp!==null&&Rp(Sp,e),Cp!==null&&Rp(Cp,e),wp!==null&&Rp(wp,e),Tp.forEach(t),Ep.forEach(t);for(var n=0;n<Op.length;n++){var r=Op[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Op.length&&(n=Op[0],n.blockedOn===null);)Pp(n),n.blockedOn===null&&Op.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Qe]||null;if(typeof a==`function`)o||Bp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Qe]||null)s=o.formAction;else if(yp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Bp(n)}}}function Hp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Up(e){this._internalRoot=e}Wp.prototype.render=Up.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;cp(n,gu(),e,t,null,null)},Wp.prototype.unmount=Up.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cp(e.current,2,null,e,null,null),Cu(),t[$e]=null}};function Wp(e){this._internalRoot=e}Wp.prototype.unstable_scheduleHydration=function(e){if(e){var t=Je();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Op.length&&t!==0&&t<Op[n].priority;n++);Op.splice(n,0,e),n===0&&Pp(e)}};var Gp=n.version;if(Gp!==`19.2.4`)throw Error(i(527,Gp,`19.2.4`));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:d(e),e=e===null?null:e.stateNode,e};var Kp={bundleType:0,version:`19.2.4`,rendererPackageName:`react-dom`,currentDispatcherRef:N,reconcilerVersion:`19.2.4`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var qp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qp.isDisabled&&qp.supportsFiber)try{Te=qp.inject(Kp),Ee=qp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Us,s=Ws,c=Gs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=op(e,1,!1,null,null,n,r,null,o,s,c,Hp),e[$e]=t.current,Dd(e),new Up(t)}})),jp=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ap()})),Mp=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Np=new class extends Mp{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Pp={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Fp=new class{#e=Pp;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Ip(e){setTimeout(e,0)}var Lp=typeof window>`u`||`Deno`in globalThis;function Rp(){}function zp(e,t){return typeof e==`function`?e(t):e}function Bp(e){return typeof e==`number`&&e>=0&&e!==1/0}function Vp(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Hp(e,t){return typeof e==`function`?e(t):e}function Up(e,t){return typeof e==`function`?e(t):e}function Wp(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Kp(o,t.options))return!1}else if(!Jp(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Gp(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(qp(t.options.mutationKey)!==qp(a))return!1}else if(!Jp(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Kp(e,t){return(t?.queryKeyHashFn||qp)(e)}function qp(e){return JSON.stringify(e,(e,t)=>$p(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Jp(e,t){return e===t?!0:typeof e==typeof t&&e&&t&&typeof e==`object`&&typeof t==`object`?Object.keys(t).every(n=>Jp(e[n],t[n])):!1}var Yp=Object.prototype.hasOwnProperty;function Xp(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=Qp(e)&&Qp(t);if(!r&&!($p(e)&&$p(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Yp.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=Xp(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Zp(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function Qp(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function $p(e){if(!em(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!em(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function em(e){return Object.prototype.toString.call(e)===`[object Object]`}function tm(e){return new Promise(t=>{Fp.setTimeout(t,e)})}function nm(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:Xp(e,t)}function rm(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function im(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var am=Symbol();function om(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===am?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function sm(e,t){return typeof e==`function`?e(...t):!!e}function cm(e,t,n){let r=!1,i;return Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var lm=(()=>{let e=()=>Lp;return{isServer(){return e()},setIsServer(t){e=t}}})();function um(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var dm=Ip;function fm(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=dm,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var pm=fm(),mm=new class extends Mp{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function hm(e){return Math.min(1e3*2**e,3e4)}function gm(e){return(e??`online`)===`online`?mm.isOnline():!0}var _m=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function vm(e){let t=!1,n=0,r,i=um(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new _m(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Np.isFocused()&&(e.networkMode===`always`||mm.isOnline())&&e.canRun(),u=()=>gm(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(lm.isServer()?0:3),o=e.retryDelay??hm,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),tm(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var ym=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Bp(this.gcTime)&&(this.#e=Fp.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(lm.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e&&=(Fp.clearTimeout(this.#e),void 0)}},bm=class extends ym{#e;#t;#n;#r;#i;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#r=e.client,this.#n=this.#r.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Cm(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Cm(this.options);e.data!==void 0&&(this.setState(Sm(e.data,e.dataUpdatedAt)),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#n.remove(this)}setData(e,t){let n=nm(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#c({type:`setState`,state:e,setStateOptions:t})}cancel(e){let t=this.#i?.promise;return this.#i?.cancel(e),t?t.then(Rp).catch(Rp):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Up(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===am||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Hp(e.options.staleTime,this)===`static`):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Vp(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#i&&(this.#o||this.#s()?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#s(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#i?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,`signal`,{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{let e=om(this.options,t),n=(()=>{let e={client:this.#r,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#o=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#r,state:this.state,fetchFn:i};return r(e),e})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta}),this.#i=vm({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof _m&&e.revert&&this.setState({...this.#t,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#i.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#n.config.onSuccess?.(e,this),this.#n.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof _m){if(e.silent)return this.#i.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#n.config.onError?.(e,this),this.#n.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...xm(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Sm(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),pm.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#n.notify({query:this,type:`updated`,action:e})})}};function xm(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:gm(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Sm(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Cm(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var wm=class extends Mp{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=um(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Em(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Dm(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Dm(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Up(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Zp(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Om(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Up(this.options.enabled,this.#t)!==Up(t.enabled,this.#t)||Hp(this.options.staleTime,this.#t)!==Hp(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Up(this.options.enabled,this.#t)!==Up(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Am(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Rp)),t}#g(){this.#b();let e=Hp(this.options.staleTime,this.#t);if(lm.isServer()||this.#r.isStale||!Bp(e))return;let t=Vp(this.#r.dataUpdatedAt,e)+1;this.#d=Fp.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(lm.isServer()||Up(this.options.enabled,this.#t)===!1||!Bp(this.#p)||this.#p===0)&&(this.#f=Fp.setInterval(()=>{(this.options.refetchIntervalInBackground||Np.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(Fp.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(Fp.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Em(e,t),o=i&&Om(e,n,t,r);(a||o)&&(l={...l,...xm(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=nm(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h)if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=nm(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:km(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Up(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{i(this.#o=x.promise=um())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a();break}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!Zp(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){pm.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Tm(e,t){return Up(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function Em(e,t){return Tm(e,t)||e.state.data!==void 0&&Dm(e,t,t.refetchOnMount)}function Dm(e,t,n){if(Up(t.enabled,e)!==!1&&Hp(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&km(e,t)}return!1}function Om(e,t,n,r){return(e!==t||Up(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&km(e,n)}function km(e,t){return Up(t.enabled,e)!==!1&&e.isStaleByTime(Hp(t.staleTime,e))}function Am(e,t){return!Zp(e.getCurrentResult(),t)}function jm(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{cm(e,()=>t.signal,()=>n=!0)},u=om(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?im:rm;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?Nm:Mm,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Mm(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Mm(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Nm(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Pm=class extends ym{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Fm(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=vm({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),pm.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Fm(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Im=class extends Mp{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Pm({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Lm(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Lm(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Lm(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=Lm(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){pm.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Gp(t,e))}findAll(e={}){return this.getAll().filter(t=>Gp(e,t))}notify(e){pm.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return pm.batch(()=>Promise.all(e.map(e=>e.continue().catch(Rp))))}};function Lm(e){return e.options.scope?.id}var Rm=class extends Mp{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Zp(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&qp(t.mutationKey)!==qp(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Fm();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){pm.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},zm=class extends Mp{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Kp(r,t),a=this.get(i);return a||(a=new bm({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){pm.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Wp(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Wp(e,t)):t}notify(e){pm.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){pm.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){pm.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Bm=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new zm,this.#t=e.mutationCache||new Im,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Np.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=mm.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Hp(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=zp(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return pm.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;pm.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return pm.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=pm.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Rp).catch(Rp)}invalidateQueries(e,t={}){return pm.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=pm.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Rp)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Rp)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Hp(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Rp).catch(Rp)}fetchInfiniteQuery(e){return e.behavior=jm(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Rp).catch(Rp)}ensureInfiniteQueryData(e){return e.behavior=jm(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return mm.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(qp(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Jp(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(qp(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Jp(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Kp(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===am&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Vm=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),K=o(((e,t)=>{t.exports=Vm()}))(),Hm=G.createContext(void 0),Um=e=>{let t=G.useContext(Hm);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Wm=({client:e,children:t})=>(G.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,K.jsx)(Hm.Provider,{value:e,children:t})),Gm=G.createContext(!1),Km=()=>G.useContext(Gm);Gm.Provider;function qm(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Jm=G.createContext(qm()),Ym=()=>G.useContext(Jm),Xm=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?sm(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Zm=e=>{G.useEffect(()=>{e.clearReset()},[e])},Qm=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||sm(n,[e.error,r])),$m=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},eh=(e,t)=>e.isLoading&&e.isFetching&&!t,th=(e,t)=>e?.suspense&&t.isPending,nh=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function rh(e,t,n){let r=Km(),i=Ym(),a=Um(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,$m(o),Xm(o,i,s),Zm(i);let c=!a.getQueryCache().get(o.queryHash),[l]=G.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&e.subscribed!==!1;if(G.useSyncExternalStore(G.useCallback(e=>{let t=d?l.subscribe(pm.batchCalls(e)):Rp;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),G.useEffect(()=>{l.setOptions(o)},[o,l]),th(o,u))throw nh(o,l,i);if(Qm({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,u),o.experimental_prefetchInRender&&!lm.isServer()&&eh(u,r)&&(c?nh(o,l,i):s?.promise)?.catch(Rp).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?u:l.trackResult(u)}function ih(e,t){return rh(e,wm,t)}function ah(e,t){let n=Um(t),[r]=G.useState(()=>new Rm(n,e));G.useEffect(()=>{r.setOptions(e)},[r,e]);let i=G.useSyncExternalStore(G.useCallback(e=>r.subscribe(pm.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=G.useCallback((e,t)=>{r.mutate(e,t).catch(Rp)},[r]);if(i.error&&sm(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var oh=typeof window<`u`?G.useLayoutEffect:G.useEffect;function sh(e){let t=G.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function ch(e,t,n={},r={}){G.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function lh(e){let t=G.useRef(null);return G.useImperativeHandle(e,()=>t.current,[]),t}function uh(e){return e[e.length-1]}function dh(e){return typeof e==`function`}function fh(e,t){return dh(e)?e(t):e}var ph=Object.prototype.hasOwnProperty,mh=Object.prototype.propertyIsEnumerable,hh=()=>Object.create(null),gh=(e,t)=>_h(e,t,hh);function _h(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=xh(e)&&xh(i);if(!a&&!(yh(e)&&yh(i)))return i;let o=a?e:vh(e);if(!o)return i;let s=a?i:vh(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;t<l;t++){let o=a?t:s[t],l=e[o],f=i[o];if(l===f){u[o]=l,(a?t<c:ph.call(e,o))&&d++;continue}if(l===null||f===null||typeof l!=`object`||typeof f!=`object`){u[o]=f;continue}let p=_h(l,f,n,r+1);u[o]=p,p===l&&d++}return c===l&&d===c?e:u}function vh(e){let t=Object.getOwnPropertyNames(e);for(let n of t)if(!mh.call(e,n))return!1;let n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;let r=t;for(let t of n){if(!mh.call(e,t))return!1;r.push(t)}return r}function yh(e){if(!bh(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!bh(n)||!n.hasOwnProperty(`isPrototypeOf`))}function bh(e){return Object.prototype.toString.call(e)===`[object Object]`}function xh(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Sh(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!Sh(e[r],t[r],n))return!1;return!0}if(yh(e)&&yh(t)){let r=n?.ignoreUndefined??!0;if(n?.partial){for(let i in t)if((!r||t[i]!==void 0)&&!Sh(e[i],t[i],n))return!1;return!0}let i=0;if(!r)i=Object.keys(e).length;else for(let t in e)e[t]!==void 0&&i++;let a=0;for(let o in t)if((!r||t[o]!==void 0)&&(a++,a>i||!Sh(e[o],t[o],n)))return!1;return i===a}return!1}function Ch(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function wh(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}function Th(e){return e.replace(/[\x00-\x1f\x7f]/g,``)}function Eh(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return Th(t)}var Dh=[`http:`,`https:`,`mailto:`,`tel:`];function Oh(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function kh(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=Eh(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=Eh(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function Ah(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function jh(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Mh(){throw Error(`Invariant failed`)}function Nh(e){let t=new Map,n,r,i=e=>{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var Ph=4,Fh=5;function Ih(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function Lh(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=Ih(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2<a.length&&a.charCodeAt(r+2)===36){let e=r+3,a=s;if(e<a)return n[0]=3,n[1]=t+r,n[2]=t+e,n[3]=t+a,n[4]=t+s+1,n[5]=i,n}}else if(c===36){let a=r+1,o=r+2;return o===s?(n[0]=2,n[1]=t+r,n[2]=t+a,n[3]=t+o,n[4]=t+s+1,n[5]=e.length,n):(n[0]=1,n[1]=t+r,n[2]=t+o,n[3]=t+s,n[4]=t+s+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Rh(e,t,n,r,i,a,o){o?.(n);let s=r;{let r=n.fullPath??n.from,o=r.length,c=n.options?.caseSensitive??e,l=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;s<o;){let e=Lh(r,s,t),o,u=s,d=e[5];switch(s=d+1,a++,e[0]){case 0:{let t=r.substring(e[2],e[3]);if(c){let e=i.static?.get(t);if(e)o=e;else{i.static??=new Map;let e=Vh(n.fullPath??n.from);e.parent=i,e.depth=a,o=e,i.static.set(t,e)}}else{let e=t.toLowerCase(),r=i.staticInsensitive?.get(e);if(r)o=r;else{i.staticInsensitive??=new Map;let t=Vh(n.fullPath??n.from);t.parent=i,t.depth=a,o=t,i.staticInsensitive.set(e,t)}}break}case 1:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.dynamic?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Hh(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.skipOnParamError&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=Hh(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=Hh(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=Vh(n.fullPath??n.from);e.kind=Fh,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=Vh(n.fullPath??n.from);e.kind=Ph,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=n.options?.params?.parse??null,i.skipOnParamError=l,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)Rh(e,t,r,s,i,a,o)}function zh(e,t){if(e.skipOnParamError&&!t.skipOnParamError)return-1;if(!e.skipOnParamError&&t.skipOnParamError)return 1;if(e.skipOnParamError&&t.skipOnParamError&&(e.parsingPriority||t.parsingPriority))return t.parsingPriority-e.parsingPriority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Bh(e){if(e.pathless)for(let t of e.pathless)Bh(t);if(e.static)for(let t of e.static.values())Bh(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())Bh(t);if(e.dynamic?.length){e.dynamic.sort(zh);for(let t of e.dynamic)Bh(t)}if(e.optional?.length){e.optional.sort(zh);for(let t of e.optional)Bh(t)}if(e.wildcard?.length){e.wildcard.sort(zh);for(let t of e.wildcard)Bh(t)}}function Vh(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0}}function Hh(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:r,suffix:i}}function Uh(e,t){let n=Vh(`/`),r=new Uint16Array(6);for(let t of e)Rh(!1,r,t,1,n,0);Bh(n),t.masksTree=n,t.flatCache=Nh(1e3)}function Wh(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Yh(e,t.masksTree);return t.flatCache.set(e,r),r}function Gh(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Vh(`/`),Rh(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Yh(r,o,n)}function Kh(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Yh(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Zh(a.route)),t.matchCache.set(r,a),a}function qh(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Jh(e,t=!1,n){let r=Vh(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return Rh(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&Mh(),a[e.id]=e,s!==0&&e.path){let t=qh(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),Bh(r),{processedTree:{segmentTree:r,singleCache:Nh(1e3),matchCache:Nh(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Yh(e,t,n=!1){let r=e.split(`/`),i=$h(e,r,t,n);if(!i)return null;let[a]=Xh(e,r,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function Xh(e,t,n){let r=Qh(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s<r.length;o++,s++,c++,l++){let u=r[s];if(u.kind===Ph)break;if(u.kind===Fh){l--,o--,c--;continue}let d=t[o],f=c;if(d&&(c+=d.length),u.kind===1){i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0;if(e.charCodeAt(t)===123){let n=u.suffix?.length??0,r=e.substring(t+2,e.length-n-1),i=d.substring(t,d.length-n);a[r]=decodeURIComponent(i)}else{let t=e.substring(1);a[t]=decodeURIComponent(d)}}else if(u.kind===3){if(n.skipped&1<<s){o--,c=f-1;continue}i??=n.node.fullPath.split(`/`);let e=i[l],t=u.prefix?.length??0,r=u.suffix?.length??0,p=e.substring(t+3,e.length-r-1),m=u.suffix||u.prefix?d.substring(t,d.length-r):d;m&&(a[p]=decodeURIComponent(m))}else if(u.kind===2){let t=u,n=e.substring(f+(t.prefix?.length??0),e.length-(t.suffix?.length??0)),r=decodeURIComponent(n);a[`*`]=r,a._splat=r;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:o,node:s,path:c,segment:l}]}function Zh(e){let t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Qh(e){let t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function $h(e,t,n,r){if(e===`/`&&n.index)return{node:n.index,skipped:0};let i=!uh(t),a=i&&e!==`/`,o=t.length-+!!i,s=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}],c=null,l=null,u=null;for(;s.length;){let n=s.pop(),{node:i,index:d,skipped:f,depth:p,statics:m,dynamics:h,optionals:g}=n,{extract:_,rawParams:v,parsedParams:y}=n;if(i.skipOnParamError){if(!eg(e,t,n))continue;v=n.rawParams,_=n.extract,y=n.parsedParams}r&&i.route&&i.kind!==Ph&&tg(l,n)&&(l=n);let b=d===o;if(b&&(i.route&&!a&&tg(u,n)&&(u=n),!i.optional&&!i.wildcard&&!i.index&&!i.pathless))continue;let x=b?void 0:t[d],S;if(b&&i.index){let n={node:i.index,index:d,skipped:f,depth:p+1,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y},r=!0;if(i.index.skipOnParamError&&(eg(e,t,n)||(r=!1)),r){if(m===o&&!h&&!g&&!f)return n;tg(u,n)&&(u=n)}}if(i.wildcard&&tg(c,n))for(let n of i.wildcard){let{prefix:r,suffix:i}=n;if(r&&(b||!(n.caseSensitive?x:S??=x.toLowerCase()).startsWith(r)))continue;if(i){if(b)continue;let e=t.slice(d).join(`/`).slice(-i.length);if((n.caseSensitive?e:e.toLowerCase())!==i)continue}let a={node:n,index:o,skipped:f,depth:p,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y};if(!(n.skipOnParamError&&!eg(e,t,a))){c=a;break}}if(i.optional){let e=f|1<<p,t=p+1;for(let n=i.optional.length-1;n>=0;n--){let r=i.optional[n];s.push({node:r,index:d,skipped:e,depth:t,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?x:S??=x.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:d+1,skipped:f,depth:t,statics:m,dynamics:h,optionals:g+1,extract:_,rawParams:v,parsedParams:y})}}if(!b&&i.dynamic&&x)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?x:S??=x.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:d+1,skipped:f,depth:p+1,statics:m,dynamics:h+1,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.staticInsensitive){let e=i.staticInsensitive.get(S??=x.toLowerCase());e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(!b&&i.static){let e=i.static.get(x);e&&s.push({node:e,index:d+1,skipped:f,depth:p+1,statics:m+1,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}if(i.pathless){let e=p+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:d,skipped:f,depth:e,statics:m,dynamics:h,optionals:g,extract:_,rawParams:v,parsedParams:y})}}}if(u&&c)return tg(c,u)?u:c;if(u)return u;if(c)return c;if(r&&l){let n=l.index;for(let e=0;e<l.index;e++)n+=t[e].length;let r=n===e.length?`/`:e.slice(n);return l.rawParams??=Object.create(null),l.rawParams[`**`]=decodeURIComponent(r),l}return null}function eg(e,t,n){try{let[r,i]=Xh(e,t,n);n.rawParams=r,n.extract=i;let a=n.node.parse(r);return n.parsedParams=Object.assign(Object.create(null),n.parsedParams,a),!0}catch{return null}}function tg(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Ph)>(e.node.kind===Ph)||t.node.kind===Ph==(e.node.kind===Ph)&&t.depth>e.depth))):!0}function ng(e){return rg(e.filter(e=>e!==void 0).join(`/`))}function rg(e){return e.replace(/\/{2,}/g,`/`)}function ig(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function ag(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function og(e){return ag(ig(e))}function sg(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function cg(e,t,n){return sg(e,n)===sg(t,n)}function lg({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&uh(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e<t;e++){let r=n[e];r===``?e?e===t-1&&s.push(r):s=[r]:r===`..`?s.pop():r===`.`||s.push(r)}}s.length>1&&(uh(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c,l=``;for(let e=0;e<s.length;e++){e>0&&(l+=`/`);let t=s[e];if(!t)continue;c=Lh(t,0,c);let n=c[0];if(n===0){l+=t;continue}let r=c[5],i=t.substring(0,c[1]),a=t.substring(c[4],r),o=t.substring(c[2],c[3]);n===1?l+=i||a?`${i}{$${o}}${a}`:`$${o}`:n===2?l+=i||a?`${i}{$}${a}`:`$`:l+=`${i}{-$${o}}${a}`}l=rg(l);let u=l||`/`;return o&&r&&r.set(o,u),u}function ug(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function dg(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>pg(e,n)).join(`/`):pg(r,n):r}function fg({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;s<o;){let r=s;c=Lh(e,r,c);let o=c[5];if(s=o+1,r===o)continue;let u=c[0];if(u===0){l+=`/`+e.substring(r,o);continue}if(u===2){let s=t._splat;a._splat=s,a[`*`]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o);if(!s){i=!0,(u||d)&&(l+=`/`+u+d);continue}let f=dg(`_splat`,t,n);l+=`/`+u+f+d;continue}if(u===1){let s=e.substring(c[2],c[3]);!i&&!(s in t)&&(i=!0),a[s]=t[s];let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=dg(s,t,n)??`undefined`;l+=`/`+u+f+d;continue}if(u===3){let i=e.substring(c[2],c[3]),s=t[i];if(s==null)continue;a[i]=s;let u=e.substring(r,c[1]),d=e.substring(c[4],o),f=dg(i,t,n)??``;l+=`/`+u+f+d;continue}}return e.endsWith(`/`)&&(l+=`/`),{usedParams:a,interpolatedPath:l||`/`,isMissingParams:i}}function pg(e,t){let n=encodeURIComponent(e);return t?.(n)??n}function mg(e){return!!e?.isNotFound}function hg(){try{return typeof window<`u`&&typeof window.sessionStorage==`object`?window.sessionStorage:void 0}catch{return}}var gg=`tsr-scroll-restoration-v1_3`;function _g(){let e=hg();if(!e)return null;let t={};try{let n=JSON.parse(e.getItem(`tsr-scroll-restoration-v1_3`)||`{}`);yh(n)&&(t=n)}catch{}return{get state(){return t},set:e=>{t=fh(e,t)||t},persist:()=>{try{e.setItem(gg,JSON.stringify(t))}catch{}}}}var vg=_g(),yg=e=>e.state.__TSR_key||e.href;function bg(e){let t=[],n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(` > `)}`.toLowerCase()}var xg=!1,Sg=`window`,Cg=`data-scroll-restoration-id`;function wg(e,t){if(!vg)return;let n=vg;if((t??e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!n)return;e.isScrollRestorationSetup=!0,xg=!1;let r=e.options.getScrollRestorationKey||yg,i=new Map;window.history.scrollRestoration=`manual`;let a=t=>{if(!(xg||!e.isScrollRestoring))if(t.target===document||t.target===window)i.set(Sg,{scrollX:window.scrollX||0,scrollY:window.scrollY||0});else{let e=t.target;i.set(e,{scrollX:e.scrollLeft||0,scrollY:e.scrollTop||0})}},o=t=>{if(!e.isScrollRestoring||!t||i.size===0||!n)return;let r=n.state[t]||={};for(let[e,t]of i){let n;if(e===Sg)n=Sg;else if(e.isConnected){let t=e.getAttribute(Cg);n=t?`[${Cg}="${t}"]`:bg(e)}n&&(r[n]=t)}};document.addEventListener(`scroll`,a,!0),e.subscribe(`onBeforeLoad`,e=>{o(e.fromLocation?r(e.fromLocation):void 0),i.clear()}),window.addEventListener(`pagehide`,()=>{o(r(e.stores.resolvedLocation.state??e.stores.location.state)),n.persist()}),e.subscribe(`onRendered`,t=>{let a=r(t.toLocation),o=e.options.scrollRestorationBehavior,s=e.options.scrollToTopSelectors;if(i.clear(),!e.resetNextScroll){e.resetNextScroll=!0;return}if(!(typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))){xg=!0;try{let t=e.isScrollRestoring?n.state[a]:void 0,r=!1;if(t)for(let e in t){let n=t[e];if(!yh(n))continue;let{scrollX:i,scrollY:a}=n;if(!(!Number.isFinite(i)||!Number.isFinite(a))){if(e===Sg)window.scrollTo({top:a,left:i,behavior:o}),r=!0;else if(e){let t;try{t=document.querySelector(e)}catch{continue}t&&(t.scrollLeft=i,t.scrollTop=a,r=!0)}}}if(!r){let t=e.history.location.hash.slice(1);if(t){let e=window.history.state?.__hashScrollIntoViewOptions??!0;if(e){let n=document.getElementById(t);n&&n.scrollIntoView(e)}}else{let e={top:0,left:0,behavior:o};if(window.scrollTo(e),s)for(let t of s){if(t===Sg)continue;let n=typeof t==`function`?t():document.querySelector(t);n&&n.scrollTo(e)}}}}finally{xg=!1}e.isScrollRestoring&&n.set(e=>(e[a]||={},e))}})}function Tg(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function Eg(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Dg(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Eg(r):Array.isArray(t)?t.push(Eg(r)):n[e]=[t,Eg(r)]}return n}var Og=Ag(JSON.parse),kg=jg(JSON.stringify,JSON.parse);function Ag(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=Dg(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function jg(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=Tg(e,r);return t?`?${t}`:``}}var Mg=`__root__`;function Ng(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Pg(e){return e instanceof Response&&!!e.options}function Fg(e){return{input:({url:t})=>{for(let n of e)t=Lg(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Rg(e[n],t);return t}}}function Ig(e){let t=og(e.basepath),n=`/${t}`,r=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?r:r.toLowerCase();return{input:({url:t})=>{let r=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return r===i?t.pathname=`/`:r.startsWith(a)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=ng([`/`,t,e.pathname]),e)}}function Lg(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function Rg(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function zg(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>Bg(o,_.state)),x=r(()=>Bg(s,v.state)),S=r(()=>Bg(c,y.state)),C=r(()=>_.state[0]),w=r(()=>_.state.some(e=>o.get(e)?.state.status===`pending`)),T=r(()=>({locationHref:p.state.href,resolvedLocationHref:m.state?.href,status:l.state})),E=r(()=>({status:l.state,loadedAt:u.state,isLoading:d.state,isTransitioning:f.state,matches:b.state,location:p.state,resolvedLocation:m.state,statusCode:h.state,redirect:g.state})),D=Nh(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.state;for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.state}}),D.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingMatchesId:v,cachedMatchesId:y,activeMatchesSnapshot:b,pendingMatchesSnapshot:x,cachedMatchesSnapshot:S,firstMatchId:C,hasPendingMatches:w,matchRouteReactivity:T,activeMatchStoresById:o,pendingMatchStoresById:s,cachedMatchStoresById:c,__store:E,getMatchStoreByRouteId:O,setActiveMatches:A,setPendingMatches:j,setCachedMatches:M};A(e.matches),a?.(k);function A(e){Vg(e,o,_,n,i)}function j(e){Vg(e,s,v,n,i)}function M(e){Vg(e,c,y,n,i)}return k}function Bg(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.state)}return n}function Vg(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.state!==n&&e.setState(()=>n)}jh(n.state,a)||n.setState(()=>a)})}var Hg=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Ug=e=>e.stores.matchesId.state.some(t=>e.stores.activeMatchStoresById.get(t)?.state._forcePending),Wg=(e,t)=>!!(e.preload&&!e.router.stores.activeMatchStoresById.has(t)),Gg=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},Kg=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},qg=(e,t,n)=>{if(!(!Pg(n)&&!mg(n)))throw Pg(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:Pg(n)?`redirected`:r.status===`pending`?`success`:r.status,context:Gg(e,t.index),isFetching:!1,error:n})),mg(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),Pg(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},Jg=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Yg=(e,t,n)=>{let r=Gg(e,n);e.updateMatch(t,e=>({...e,context:r}))},Xg=(e,t,n,r)=>{let{id:i,routeId:a}=e.matches[t],o=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,qg(e,e.router.getMatch(i),n);try{o.options.onError?.(n)}catch(t){n=t,qg(e,e.router.getMatch(i),n)}e.updateMatch(i,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!Pg(n)&&!mg(n)&&(e.serialError??=n)},Zg=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Wg(e,t)&&(n.options.loader||n.options.beforeLoad||c_(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Hg(e)},i);r._nonReactive.pendingTimeout=t}},Qg=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Zg(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&qg(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},$g=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Ch(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&Xg(e,n,o,`PARSE_PARAMS`),s&&Xg(e,n,s,`VALIDATE_SEARCH`),Zg(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=Ch();let f={...Gg(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=Wg(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(Pg(r)||mg(r))&&(u(),Xg(e,n,r,`BEFORE_LOAD`)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),wh(y))return u(),y.catch(t=>{Xg(e,n,t,`BEFORE_LOAD`)}).then(v)}catch(t){u(),Xg(e,n,t,`BEFORE_LOAD`)}v(y)},e_=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>$g(e,n,t,i),s=()=>{if(Jg(e,n))return;let t=Qg(e,n,i);return wh(t)?t.then(o):o()};return a()},t_=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},n_=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=Gg(e,r),d=Wg(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},r_=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{s_(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(n_(e,t,n,r,i)),l=!!s&&wh(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;qg(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:Gg(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:Gg(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,mg(t)&&await i.options.notFoundComponent?.preload?.(),qg(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,qg(e,e.router.getMatch(n),t)}!Pg(o)&&!mg(o)&&await s_(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:Gg(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),qg(e,r,t)}},i_=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(n_(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await r_(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){Pg(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await r_(e,t,i,n,d):Yg(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(Jg(e,i)){if(!e.router.getMatch(i))return e.matches[n];Yg(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.state[n],s=(o&&e.router.stores.activeMatchStoresById.get(o)||null)?.routeId===a?o:e.router.stores.activeMatchesSnapshot.state.find(e=>e.routeId===a)?.id,l=Wg(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&qg(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.activeMatchStoresById.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=Ch(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function a_(e){let t=e,n=[];Ug(t.router)&&Hg(t);let r;for(let e=0;e<t.matches.length;e++){try{let n=e_(t,e);wh(n)&&await n}catch(e){if(Pg(e))throw e;if(mg(e))r=e;else if(!t.preload)throw e;break}if(t.serialError||t.firstBadMatchIndex!=null)break}let i=t.firstBadMatchIndex??t.matches.length,a=r&&!t.preload?Kg(t,r):void 0,o=r&&t.preload?0:a===void 0?i:Math.min(a+1,i),s,c;for(let e=0;e<o;e++)n.push(i_(t,n,e));try{await Promise.all(n)}catch{let e=await Promise.allSettled(n);for(let t of e){if(t.status!==`rejected`)continue;let e=t.reason;if(Pg(e))throw e;mg(e)?s??=e:c??=e}if(c!==void 0)throw c}let l=s??(r&&!t.preload?r:void 0),u=t.firstBadMatchIndex===void 0?t.matches.length-1:t.firstBadMatchIndex;if(!l&&r&&t.preload)return t.matches;if(l){let e=Kg(t,l);e===void 0&&Mh();let n=t.matches[e],r=t.router.looseRoutesById[n.routeId],i=t.router.options?.defaultNotFoundComponent;!r.options.notFoundComponent&&i&&(r.options.notFoundComponent=i),l.routeId=n.routeId;let a=n.routeId===t.router.routeTree.id;t.updateMatch(n.id,e=>({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await s_(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await s_(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=t_(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=Hg(t);if(wh(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function o_(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function s_(e,t=l_){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===l_?(()=>{if(e._componentsPromise===void 0){let t=o_(e,l_);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():o_(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function c_(e){for(let t of l_)if(e.options[t]?.preload)return!0;return!1}var l_=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],u_=`__TSR_index`,d_=`popstate`,f_=`beforeunload`;function p_(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=__(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[u_];i=m_(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[u_];i=m_(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[u_]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function m_(e,t){t||={};let n=v_();return{...t,key:n,__TSR_key:n,[u_]:e}}function h_(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>__(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=v_();t.history.replaceState({[u_]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=__(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[u_]-l.state[u_],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=p_({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(f_,S,{capture:!0}),t.removeEventListener(d_,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(f_,S,{capture:!0}),t.addEventListener(d_,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function g_(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function __(e,t){let n=g_(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=v_();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[u_]:0,key:a,__TSR_key:a}}}function v_(){return(Math.random()+1).toString(36).substring(7)}function y_(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var b_=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=ug(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=h_()),this.origin=this.options.origin,this.origin||(window?.origin&&window.origin!==`null`?this.origin=window.origin:this.origin=`http://localhost`),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=Nh(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=zg(C_(this.latestLocation),e),wg(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=og(o);t&&t!==`/`&&e.push(Ig({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Fg(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.setState(()=>this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a)`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Jh(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&Uh(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:kh(e).path,external:!1,searchStr:o,search:gh(t?.search,i),hash:kh(r.slice(1)).path,state:_h(t?.state,a)}}let o=new URL(i,this.origin),s=Lg(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:kh(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:gh(t?.search,c),hash:kh(s.hash.slice(1)).path,state:_h(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>lg({base:e,to:rg(t),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>T_({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingMatchesId.state.forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.state.forEach(e=>{if(this.stores.pendingMatchStoresById.has(e))return;let t=this.stores.activeMatchStoresById.get(e)?.state;t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=this.resolvePathWithBase(i,`.`),o=r.search,s=Object.assign(Object.create(null),r.params),c=t.to?this.resolvePathWithBase(a,`${t.to}`):this.resolvePathWithBase(a,`.`),l=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,fh(t.params,s)),u=this.getMatchedRoutes(c),d=u.matchedRoutes;if((!u.foundRoute||u.foundRoute.path!==`/`&&u.routeParams[`**`])&&this.options.notFoundRoute&&(d=[...d,this.options.notFoundRoute]),Object.keys(l).length>0)for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(l,t(l))}catch{}}let f=e.leaveParams?c:kh(fg({path:c,params:l,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,p=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,w_(t.options.validateSearch,{...e,...p}))}catch{}}),p=e}p=E_({search:p,dest:t,destRoutes:d,_includeValidateSearch:e._includeValidateSearch}),p=gh(o,p);let m=this.options.stringifySearch(p),h=t.hash===!0?n.hash:t.hash?fh(t.hash,n.hash):void 0,g=h?`#${h}`:``,_=t.state===!0?n.state:t.state?fh(t.state,n.state):{};_=_h(n.state,_);let v=`${f}${m}${g}`,y,b,x=!1;if(this.rewrite){let e=new URL(v,this.origin),t=Rg(this.rewrite,e);y=e.href.replace(e.origin,``),t.origin===this.origin?b=t.pathname+t.search+t.hash:(b=t.href,x=!0)}else y=Ah(v),b=y;return{publicHref:b,href:y,pathname:f,search:p,searchStr:m,state:_,hash:h??``,external:x,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=Wh(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,fh(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=Sh(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},i=ag(this.latestLocation.href)===ag(n.href),a=this.commitLocationPromise;if(this.commitLocationPromise=Ch(()=>{a?.resolve(),a=void 0}),i&&r())this.load();else{let{maskedLocation:r,hashScrollIntoView:i,...a}=n;r&&(a={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...a,search:a.searchStr,state:{...a.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(a.unmaskOnReload??this.options.unmaskOnReload??!1)&&(a.state.__tempKey=this.tempLocationKey)),a.state.__hashScrollIntoViewOptions=i??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,this.history[n.replace?`replace`:`push`](a.publicHref,a.state,{ignoreBlocker:t})}return this.resetNextScroll=n.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=__(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=Lg(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return Promise.resolve().then(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(Oh(t,this.protocolAllowlist))return Promise.resolve();if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return Promise.resolve()}return i.replace?window.location.replace(t):window.location.href=t,Promise.resolve()}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatchesSnapshot.state.filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.setState(()=>`pending`),this.stores.statusCode.setState(()=>200),this.stores.isLoading.setState(()=>!0),this.stores.location.setState(()=>this.latestLocation),this.stores.setPendingMatches(e),this.stores.setCachedMatches(t)})},this.load=async e=>{let t,n,r,i=this.stores.resolvedLocation.state??this.stores.location.state;for(r=new Promise(a=>{this.startTransition(async()=>{try{this.beforeLoad();let t=this.latestLocation,n=this.stores.resolvedLocation.state,r=y_(t,n);this.stores.redirect.state||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await a_({router:this,sync:e?.sync,forceStaleReload:i.href===t.href,matches:this.stores.pendingMatchesSnapshot.state,location:t,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatchesSnapshot.state,a=i.length,o=this.stores.activeMatchesSnapshot.state;e=a?o.filter(e=>!this.stores.pendingMatchStoresById.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStoresById.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.activeMatchStoresById.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.setState(()=>!1),this.stores.loadedAt.setState(()=>Date.now()),a&&(this.stores.setActiveMatches(i),this.stores.setPendingMatches([]),this.stores.setCachedMatches([...this.stores.cachedMatchesSnapshot.state,...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){Pg(e)?(t=e,this.navigate({...t.options,replace:!0,ignoreBlocker:!0})):mg(e)&&(n=e);let r=t?t.status:n?404:this.stores.activeMatchesSnapshot.state.some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.setState(()=>r),this.stores.redirect.setState(()=>t)})}this.latestLoadPromise===r&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),a()})}),this.latestLoadPromise=r,await r;this.latestLoadPromise&&r!==this.latestLoadPromise;)await this.latestLoadPromise;let a;this.hasNotFoundMatch()?a=404:this.stores.activeMatchesSnapshot.state.some(e=>e.status===`error`)&&(a=500),a!==void 0&&this.stores.statusCode.setState(()=>a)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.state,a=typeof t.types==`function`?t.types(y_(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStoresById.get(e);if(n){n.setState(t);return}let r=this.stores.activeMatchStoresById.get(e);if(r){r.setState(t);return}let i=this.stores.cachedMatchStoresById.get(e);if(i){let n=t(i.state);n.status===`redirected`?this.stores.cachedMatchStoresById.delete(e)&&this.stores.cachedMatchesId.setState(t=>t.filter(t=>t!==e)):i.setState(()=>n)}})},this.getMatch=e=>this.stores.cachedMatchStoresById.get(e)?.state??this.stores.pendingMatchStoresById.get(e)?.state??this.stores.activeMatchStoresById.get(e)?.state,this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setActiveMatches(this.stores.activeMatchesSnapshot.state.map(t)),this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.map(t)),this.stores.setPendingMatches(this.stores.pendingMatchesSnapshot.state.map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&Oh(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCachedMatches([]):this.stores.setCachedMatches(this.stores.cachedMatchesSnapshot.state.filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??300*1e3;return t.status===`error`?!0:e-t.updatedAt>=r}})},this.loadRouteChunk=s_,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.state,...this.stores.pendingMatchesId.state]),i=new Set([...r,...this.stores.cachedMatchesId.state]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatchesSnapshot.state;this.stores.setCachedMatches([...e,...a])}try{return n=await a_({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(Pg(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});mg(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.state!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.state:t.pending)?this.latestLocation:this.stores.resolvedLocation.state||this.stores.location.state,a=Gh(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!Sh(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?Sh(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.activeMatchesSnapshot.state.some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??kg,parseSearch:e.parseSearch??Og,protocolAllowlist:e.protocolAllowlist??Dh}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.state}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i,parsedParams:a}=n,{matchedRoutes:o}=n,s=!1;(r?r.path!==`/`&&i[`**`]:ag(e.pathname))&&(this.options.notFoundRoute?o=[...o,this.options.notFoundRoute]:s=!0);let c=s?O_(this.options.notFoundMode,o):void 0,l=Array(o.length),u=new Map;for(let e of this.stores.activeMatchStoresById.values())e.routeId&&u.set(e.routeId,e.state);for(let n=0;n<o.length;n++){let r=o[n],s=l[n-1],d,f,p;{let n=s?.search??e.search,i=s?._strictSearch??void 0;try{let e=w_(r.options.validateSearch,{...n})??void 0;d={...n,...e},f={...i,...e},p=void 0}catch(e){let r=e;if(e instanceof x_||(r=new x_(e.message,{cause:e})),t?.throwOnError)throw r;d=n,f={},p=r}}let m=r.options.loaderDeps?.({search:d})??``,h=m?JSON.stringify(m):``,{interpolatedPath:g,usedParams:_}=fg({path:r.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),v=r.id+g+h,y=this.getMatch(v),b=u.get(r.id),x=y?._strictParams??_,S;if(!y)try{k_(r,_,a,x)}catch(e){if(S=mg(e)||Pg(e)?e:new S_(e.message,{cause:e}),t?.throwOnError)throw S}Object.assign(i,x);let C=b?`stay`:`enter`,w;if(y)w={...y,cause:C,params:b?.params??i,_strictParams:x,search:gh(b?b.search:y.search,d),_strictSearch:f};else{let e=r.options.loader||r.options.beforeLoad||r.lazyFn||c_(r)?`pending`:`success`;w={id:v,ssr:r.options.ssr,index:n,routeId:r.id,params:b?.params??i,_strictParams:x,pathname:g,updatedAt:Date.now(),search:b?gh(b.search,d):d,_strictSearch:f,searchError:void 0,status:e,isFetching:!1,error:void 0,paramsError:S,__routeContext:void 0,_nonReactive:{loadPromise:Ch()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:C,loaderDeps:b?_h(b.loaderDeps,m):m,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:r.options.staticData||{},fullPath:r.fullPath}}t?.preload||(w.globalNotFound=c===r.id),w.searchError=p;let T=this.getParentContext(s);w.context={...T,...w.__routeContext,...w.__beforeLoadContext},l[n]=w}for(let t=0;t<l.length;t++){let n=l[t],r=this.looseRoutesById[n.routeId],a=this.getMatch(n.id),o=u.get(n.routeId);if(n.params=o?gh(o.params,i):i,!a){let i=l[t-1],a=this.getParentContext(i);if(r.options.context){let t={deps:n.loaderDeps,params:n.params,context:a??{},location:e,navigate:t=>this.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:l,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return l}matchRoutesLightweight(e){let{matchedRoutes:t,routeParams:n,parsedParams:r}=this.getMatchedRoutes(e.pathname),i=uh(t),a={...e.search};for(let e of t)try{Object.assign(a,w_(e.options.validateSearch,a))}catch{}let o=uh(this.stores.matchesId.state),s=o&&this.stores.activeMatchStoresById.get(o)?.state,c=s&&s.routeId===i.id&&s.pathname===e.pathname,l;if(c)l=s.params;else{let e=Object.assign(Object.create(null),n);for(let i of t)try{k_(i,n,r??{},e)}catch{}l=e}return{matchedRoutes:t,fullPath:i.fullPath,search:a,params:l}}},x_=class extends Error{},S_=class extends Error{};function C_(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function w_(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new x_(`Async validation not supported`);if(n.issues)throw new x_(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function T_({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=ag(e),a,o,s=Kh(i,n,!0);return s&&(a=s.route,Object.assign(r,s.rawParams),o=Object.assign(Object.create(null),s.parsedParams)),{matchedRoutes:s?.branch||[t.__root__],routeParams:r,foundRoute:a,parsedParams:o}}function E_({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return D_(n)(e,t,r??!1)}function D_(e){let t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(let n of e)`search`in n.options?n.options.search?.middlewares&&t.middlewares.push(...n.options.search.middlewares):(n.options.preSearchFilters||n.options.postSearchFilters)&&t.middlewares.push(({search:e,next:t})=>{let r=e;`preSearchFilters`in n.options&&n.options.preSearchFilters&&(r=n.options.preSearchFilters.reduce((e,t)=>t(e),e));let i=t(r);return`postSearchFilters`in n.options&&n.options.postSearchFilters?n.options.postSearchFilters.reduce((e,t)=>t(e),i):i}),n.options.validateSearch&&t.middlewares.push(({search:e,next:r})=>{let i=r(e);if(!t._includeValidateSearch)return i;try{return{...i,...w_(n.options.validateSearch,i)??void 0}}catch{return i}});t.middlewares.push(({search:e})=>{let n=t.dest;return n.search?n.search===!0?e:fh(n.search,e):{}});let n=(e,t,r)=>{if(e>=r.length)return t;let i=r[e];return i({search:t,next:t=>n(e+1,t,r)})};return function(e,r,i){return t.dest=r,t._includeValidateSearch=i,n(0,e,t.middlewares)}}function O_(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return Mg}function k_(e,t,n,r){let i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(let e in t)e in n&&(r[e]=n[e]);else{let e=i(r);Object.assign(r,e)}}var A_=`Error preloading route! ☝️`,j_=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Mg:this.parentRoute||Mh();let r=n?Mg:t?.path;r&&r!==`/`&&(r=ig(r));let i=t?.id||r,a=n?Mg:ng([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=ng([`/`,a]));let o=a===`__root__`?`/`:ng([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=ag(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Ng({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},M_=class extends j_{constructor(e){super(e)}};function N_(e){if(typeof document<`u`&&document.querySelector){let t=e.stores.location.state,n=t.state.__hashScrollIntoViewOptions??!0;if(n&&t.hash!==``){let e=document.getElementById(t.hash);e&&e.scrollIntoView(n)}}}function P_(e){let t=e.errorComponent??I_;return(0,K.jsx)(F_,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?G.createElement(t,{error:n,reset:r}):e.children})}var F_=class extends G.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e){return{resetKey:e.getResetKey()}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidUpdate(e,t){t.error&&t.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.resetKey===this.props.getResetKey()?this.state.error:null,reset:()=>{this.reset()}})}};function I_({error:e}){let[t,n]=G.useState(!1);return(0,K.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,K.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,K.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,K.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,K.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,K.jsx)(`div`,{children:(0,K.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,K.jsx)(`code`,{children:e.message}):null})}):null]})}function L_({children:e,fallback:t=null}){return R_()?(0,K.jsx)(G.Fragment,{children:e}):(0,K.jsx)(G.Fragment,{children:t})}function R_(){return G.useSyncExternalStore(z_,()=>!0,()=>!1)}function z_(){return()=>{}}var B_=G.createContext(null);function V_(e){return G.useContext(B_)}var H_=G.createContext(void 0),U_=G.createContext(void 0),W_=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(W_||{});function G_({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function K_(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var q_=[],J_=0,{link:Y_,unlink:X_,propagate:Z_,checkDirty:Q_,shallowPropagate:$_}=G_({update(e){return e._update()},notify(e){q_[tv++]=e,e.flags&=~W_.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=W_.Mutable|W_.Dirty,av(e))}}),ev=0,tv=0,nv,rv=0;function iv(e){try{++rv,e()}finally{--rv||ov()}}function av(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=X_(n,e)}function ov(){if(!(rv>0)){for(;ev<tv;){let e=q_[ev];q_[ev++]=void 0,e.notify()}ev=0,tv=0}}function sv(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?W_.None:W_.Mutable,get(){return nv!==void 0&&Y_(i,nv,J_),i._snapshot},subscribe(e){let t=K_(e),n={current:!1},r=cv(()=>{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=nv,o=t?.compare??Object.is;if(n)nv=i,++J_,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=W_.Mutable|W_.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{nv=a,n&&(i.flags&=~W_.RecursedCheck),av(i)}}};return n?(i.flags=W_.Mutable|W_.Dirty,i.get=function(){let e=i.flags;if(e&W_.Dirty||e&W_.Pending&&Q_(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&$_(e)}}else e&W_.Pending&&(i.flags=e&~W_.Pending);return nv!==void 0&&Y_(i,nv,J_),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Z_(e),$_(e),ov())}},i}function cv(e){let t=()=>{let t=nv;nv=n,++J_,n.depsTail=void 0,n.flags=W_.Watching|W_.RecursedCheck;try{return e()}finally{nv=t,n.flags&=~W_.RecursedCheck,av(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:W_.Watching|W_.RecursedCheck,notify(){let e=this.flags;e&W_.Dirty||e&W_.Pending&&Q_(this.deps,this)?t():this.flags=W_.Watching},stop(){this.flags=W_.None,this.depsTail=void 0,av(this)}};return t(),n}var lv=class{constructor(e){this.atom=sv(e)}setState(e){this.atom.set(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(K_(e))}},uv=class{constructor(e){this.atom=sv(e)}get state(){return this.atom.get()}get(){return this.state}subscribe(e){return this.atom.subscribe(K_(e))}};function dv(e){return typeof e==`function`?new uv(e):new lv(e)}var fv=o((e=>{var t=ip();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),pv=o(((e,t)=>{t.exports=fv()})),mv=o((e=>{var t=ip(),n=pv();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),hv=o(((e,t)=>{t.exports=mv()}))();function gv(e,t){return e===t}function _v(e,t,n=gv){let r=(0,G.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,G.useCallback)(()=>e?.get(),[e]);return(0,hv.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var vv={state:void 0,get:()=>void 0,subscribe:()=>()=>{}};function yv(e){let t=V_(),n=G.useContext(e.from?U_:H_),r=e.from??n,i=r?e.from?t.stores.getMatchStoreByRouteId(r):t.stores.activeMatchStoresById.get(r):void 0,a=G.useRef(void 0);return _v(i??vv,n=>{if((e.shouldThrow??!0)&&!n&&Mh(),n===void 0)return;let r=e.select?e.select(n):n;if(e.structuralSharing??t.options.defaultStructuralSharing){let e=_h(a.current,r);return a.current=e,e}return r})}function bv(e){return yv({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function xv(e){let{select:t,...n}=e;return yv({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Sv(e){return yv({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Cv(e){return yv({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function wv(e){let t=V_();return G.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function Tv(e){return yv({...e,select:t=>e.select?e.select(t.context):t.context})}var Ev=l(kp(),1);function Dv(e,t){let n=V_(),r=lh(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,hashScrollIntoView:u,replace:d,startTransition:f,resetScroll:p,viewTransition:m,children:h,target:g,disabled:_,style:v,className:y,onClick:b,onBlur:x,onFocus:S,onMouseEnter:C,onMouseLeave:w,onTouchStart:T,ignoreBlocker:E,params:D,search:O,hash:k,state:A,mask:j,reloadDocument:M,unsafeRelative:N,from:P,_fromLocation:F,...I}=e,L=R_(),ee=G.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),R=_v(n.stores.location,e=>e,(e,t)=>e.href===t.href),z=G.useMemo(()=>{let e={_fromLocation:R,...ee};return n.buildLocation(e)},[n,R,ee]),B=z.maskedLocation?z.maskedLocation.publicHref:z.publicHref,V=z.maskedLocation?z.maskedLocation.external:z.external,H=G.useMemo(()=>Iv(B,V,n.history,_),[_,V,B,n.history]),U=G.useMemo(()=>{if(H?.external)return Oh(H.href,n.protocolAllowlist)?void 0:H.href;if(!Lv(s)&&!(typeof s!=`string`||s.indexOf(`:`)===-1))try{return new URL(s),Oh(s,n.protocolAllowlist)?void 0:s}catch{}},[s,H,n.protocolAllowlist]),W=G.useMemo(()=>{if(U)return!1;if(o?.exact){if(!cg(R.pathname,z.pathname,n.basepath))return!1}else{let e=sg(R.pathname,n.basepath),t=sg(z.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!Sh(R.search,z.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:o?.includeHash?L&&R.hash===z.hash:!0},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,R,U,L,z.hash,z.pathname,z.search,n.basepath]),te=W?fh(i,{})??kv:Ov,ne=W?Ov:fh(a,{})??Ov,re=[y,te.className,ne.className].filter(Boolean).join(` `),ie=(v||te.style||ne.style)&&{...v,...te.style,...ne.style},[ae,oe]=G.useState(!1),se=G.useRef(!1),ce=e.reloadDocument||U?!1:c??n.options.defaultPreload,le=l??n.options.defaultPreloadDelay??0,ue=G.useCallback(()=>{n.preloadRoute({...ee,_builtLocation:z}).catch(e=>{console.warn(e),console.warn(A_)})},[n,ee,z]);ch(r,G.useCallback(e=>{e?.isIntersecting&&ue()},[ue]),Pv,{disabled:!!_||ce!==`viewport`}),G.useEffect(()=>{se.current||!_&&ce===`render`&&(ue(),se.current=!0)},[_,ue,ce]);let de=e=>{let t=e.currentTarget.getAttribute(`target`),r=g===void 0?t:g;if(!_&&!zv(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,Ev.flushSync)(()=>{oe(!0)});let t=n.subscribe(`onResolved`,()=>{t(),oe(!1)});n.navigate({...ee,replace:d,resetScroll:p,hashScrollIntoView:u,startTransition:f,viewTransition:m,ignoreBlocker:E})}};if(U)return{...I,ref:r,href:U,...h&&{children:h},...g&&{target:g},..._&&{disabled:_},...v&&{style:v},...y&&{className:y},...b&&{onClick:b},...x&&{onBlur:x},...S&&{onFocus:S},...C&&{onMouseEnter:C},...w&&{onMouseLeave:w},...T&&{onTouchStart:T}};let fe=e=>{if(_||ce!==`intent`)return;if(!le){ue();return}let t=e.currentTarget;if(Nv.has(t))return;let n=setTimeout(()=>{Nv.delete(t),ue()},le);Nv.set(t,n)},pe=e=>{_||ce!==`intent`||ue()},me=e=>{if(_||!ce||!le)return;let t=e.currentTarget,n=Nv.get(t);n&&(clearTimeout(n),Nv.delete(t))};return{...I,...te,...ne,href:H?.href,ref:r,onClick:Fv([b,de]),onBlur:Fv([x,me]),onFocus:Fv([S,fe]),onMouseEnter:Fv([C,fe]),onMouseLeave:Fv([w,me]),onTouchStart:Fv([T,pe]),disabled:!!_,target:g,...ie&&{style:ie},...re&&{className:re},..._&&Av,...W&&jv,...L&&ae&&Mv}}var Ov={},kv={className:`active`},Av={role:`link`,"aria-disabled":!0},jv={"data-status":`active`,"aria-current":`page`},Mv={"data-transitioning":`transitioning`},Nv=new WeakMap,Pv={rootMargin:`100px`},Fv=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Iv(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Lv(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Rv=G.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Dv(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return G.createElement(`a`,t,o)}return G.createElement(n,a,o)});function zv(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Bv=class extends j_{constructor(e){super(e),this.useMatch=e=>yv({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Tv({...e,from:this.id}),this.useSearch=e=>Cv({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Sv({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>xv({...e,from:this.id}),this.useLoaderData=e=>bv({...e,from:this.id}),this.useNavigate=()=>wv({from:this.fullPath}),this.Link=G.forwardRef((e,t)=>(0,K.jsx)(Rv,{ref:t,from:this.fullPath,...e}))}};function Vv(e){return new Bv(e)}var Hv=class extends M_{constructor(e){super(e),this.useMatch=e=>yv({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Tv({...e,from:this.id}),this.useSearch=e=>Cv({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Sv({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>xv({...e,from:this.id}),this.useLoaderData=e=>bv({...e,from:this.id}),this.useNavigate=()=>wv({from:this.fullPath}),this.Link=G.forwardRef((e,t)=>(0,K.jsx)(Rv,{ref:t,from:this.fullPath,...e}))}};function Uv(e){return new Hv(e)}function Wv(e){let t=V_(),n=`not-found-${_v(t.stores.location,e=>e.pathname)}-${_v(t.stores.status,e=>e)}`;return(0,K.jsx)(P_,{getResetKey:()=>n,onCatch:(t,n)=>{if(mg(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(mg(t))return e.fallback?.(t);throw t},children:e.children})}function Gv(){return(0,K.jsx)(`p`,{children:`Not Found`})}function Kv(e){return(0,K.jsx)(K.Fragment,{children:e.children})}function qv(e,t,n){return t.options.notFoundComponent?(0,K.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,K.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,K.jsx)(Gv,{})}var Jv=G.memo(function({matchId:e}){let t=V_(),n=t.stores.activeMatchStoresById.get(e);n||Mh();let r=_v(t.stores.loadedAt,e=>e),i=_v(n,e=>e);return(0,K.jsx)(Yv,{router:t,matchId:e,resetKey:r,matchState:G.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function Yv({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,K.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?G.Suspense:Kv,f=s?P_:Kv,p=l?Wv:Kv;return(0,K.jsxs)(i.isRoot?i.options.shellComponent??Kv:Kv,{children:[(0,K.jsx)(H_.Provider,{value:t,children:(0,K.jsx)(d,{fallback:o,children:(0,K.jsx)(f,{getResetKey:()=>n,errorComponent:s||I_,onCatch:(e,t)=>{if(mg(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,K.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return G.createElement(l,e)},children:u||r._displayPending?(0,K.jsx)(L_,{fallback:o,children:(0,K.jsx)(Zv,{matchId:t})}):(0,K.jsx)(Zv,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Xv,{resetKey:n}),(e.options.scrollRestoration,null)]}):null]})}function Xv({resetKey:e}){let t=V_(),n=G.useRef(void 0);return oh(()=>{let e=t.latestLocation.href;(n.current===void 0||n.current!==e)&&(t.emit({type:`onRendered`,...y_(t.stores.location.state,t.stores.resolvedLocation.state)}),n.current=e)},[t.latestLocation.state.__TSR_key,e,t]),null}var Zv=G.memo(function({matchId:e}){let t=V_(),n=t.stores.activeMatchStoresById.get(e);n||Mh();let r=_v(n,e=>e),i=r.routeId,a=t.routesById[i],o=G.useMemo(()=>{let e=(t.routesById[i].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:i,loaderDeps:r.loaderDeps,params:r._strictParams,search:r._strictSearch});return e?JSON.stringify(e):void 0},[i,r.loaderDeps,r._strictParams,r._strictSearch,t.options.defaultRemountDeps,t.routesById]),s=G.useMemo(()=>{let e=a.options.component??t.options.defaultComponent;return e?(0,K.jsx)(e,{},o):(0,K.jsx)(Qv,{})},[o,a.options.component,t.options.defaultComponent]);if(r._displayPending)throw t.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw t.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status===`pending`){let e=a.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(r.id);if(n&&!n._nonReactive.minPendingPromise){let t=Ch();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw t.getMatch(r.id)?._nonReactive.loadPromise}if(r.status===`notFound`)return mg(r.error)||Mh(),qv(t,a,r.error);if(r.status===`redirected`)throw Pg(r.error)||Mh(),t.getMatch(r.id)?._nonReactive.loadPromise;if(r.status===`error`)throw r.error;return s}),Qv=G.memo(function(){let e=V_(),t=G.useContext(H_),n,r=!1,i;{let a=t?e.stores.activeMatchStoresById.get(t):void 0;[n,r]=_v(a,e=>[e?.routeId,e?.globalNotFound??!1]),i=_v(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,K.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||Mh(),qv(e,a,void 0);if(!i)return null;let s=(0,K.jsx)(Jv,{matchId:i});return n===`__root__`?(0,K.jsx)(G.Suspense,{fallback:o,children:s}):s});function $v(){let e=V_(),t=G.useRef({router:e,mounted:!1}),[n,r]=G.useState(!1),i=_v(e.stores.isLoading,e=>e),a=_v(e.stores.hasPendingMatches,e=>e),o=sh(i),s=i||n||a,c=sh(s),l=i||a,u=sh(l);return e.startTransition=e=>{r(!0),G.startTransition(()=>{e(),r(!1)})},G.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return ag(e.latestLocation.publicHref)!==ag(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),oh(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),oh(()=>{o&&!i&&e.emit({type:`onLoad`,...y_(e.stores.location.state,e.stores.resolvedLocation.state)})},[o,e,i]),oh(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...y_(e.stores.location.state,e.stores.resolvedLocation.state)})},[l,u,e]),oh(()=>{if(c&&!s){let t=y_(e.stores.location.state,e.stores.resolvedLocation.state);e.emit({type:`onResolved`,...t}),iv(()=>{e.stores.status.setState(()=>`idle`),e.stores.resolvedLocation.setState(()=>e.stores.location.state)}),t.hrefChanged&&N_(e)}},[s,c,e]),null}function ey(){let e=V_(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,K.jsx)(t,{}):null,r=(0,K.jsxs)(typeof document<`u`&&e.ssr?Kv:G.Suspense,{fallback:n,children:[(0,K.jsx)($v,{}),(0,K.jsx)(ty,{})]});return e.options.InnerWrap?(0,K.jsx)(e.options.InnerWrap,{children:r}):r}function ty(){let e=V_(),t=_v(e.stores.firstMatchId,e=>e),n=_v(e.stores.loadedAt,e=>e),r=t?(0,K.jsx)(Jv,{matchId:t}):null;return(0,K.jsx)(H_.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,K.jsx)(P_,{getResetKey:()=>n,errorComponent:I_,onCatch:void 0,children:r})})}var ny=e=>({createMutableStore:dv,createReadonlyStore:dv,batch:iv}),ry=e=>new iy(e),iy=class extends b_{constructor(e){super(e,ny)}};function ay({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,K.jsx)(B_.Provider,{value:e,children:t});return e.options.Wrap?(0,K.jsx)(e.options.Wrap,{children:r}):r}function oy({router:e,...t}){return(0,K.jsx)(ay,{router:e,...t,children:(0,K.jsx)(ey,{})})}function sy(e){let t=V_({warn:e?.router===void 0}),n=e?.router||t,r=(0,G.useRef)(void 0);return _v(n.stores.__store,t=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){let n=_h(r.current,e.select(t));return r.current=n,n}return e.select(t)}return t})}var cy=/\{[^{}]+\}/g,ly=()=>typeof process==`object`&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function uy(){return Math.random().toString(36).slice(2,11)}function dy(e){let{baseUrl:t=``,Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:a,pathSerializer:o,headers:s,requestInitExt:c=void 0,...l}={...e};c=ly()?c:void 0,t=by(t);let u=[];async function d(e,d){let{baseUrl:f,fetch:p=r,Request:m=n,headers:h,params:g={},parseAs:_=`json`,querySerializer:v,bodySerializer:y=a??_y,pathSerializer:b,body:x,middleware:S=[],...C}=d||{},w=t;f&&(w=by(f)??t);let T=typeof i==`function`?i:hy(i);v&&(T=typeof v==`function`?v:hy({...typeof i==`object`?i:{},...v}));let E=b||o||gy,D=x===void 0?void 0:y(x,yy(s,h,g.header)),O=yy(D===void 0||D instanceof FormData?{}:{"Content-Type":`application/json`},s,h,g.header),k=[...u,...S],A={redirect:`follow`,...l,...C,body:D,headers:O},j,M,N=new m(vy(e,{baseUrl:w,params:g,querySerializer:T,pathSerializer:E}),A),P;for(let e in C)e in N||(N[e]=C[e]);if(k.length){j=uy(),M=Object.freeze({baseUrl:w,fetch:p,parseAs:_,querySerializer:T,bodySerializer:y,pathSerializer:E});for(let t of k)if(t&&typeof t==`object`&&typeof t.onRequest==`function`){let n=await t.onRequest({request:N,schemaPath:e,params:g,options:M,id:j});if(n)if(n instanceof m)N=n;else if(n instanceof Response){P=n;break}else throw Error(`onRequest: must return new Request() or Response() when modifying the request`)}}if(!P){try{P=await p(N,c)}catch(t){let n=t;if(k.length)for(let t=k.length-1;t>=0;t--){let r=k[t];if(r&&typeof r==`object`&&typeof r.onError==`function`){let t=await r.onError({request:N,error:n,schemaPath:e,params:g,options:M,id:j});if(t){if(t instanceof Response){n=void 0,P=t;break}if(t instanceof Error){n=t;continue}throw Error(`onError: must return new Response() or instance of Error`)}}}if(n)throw n}if(k.length)for(let t=k.length-1;t>=0;t--){let n=k[t];if(n&&typeof n==`object`&&typeof n.onResponse==`function`){let t=await n.onResponse({request:N,response:P,schemaPath:e,params:g,options:M,id:j});if(t){if(!(t instanceof Response))throw Error(`onResponse: must return new Response() when modifying the response`);P=t}}}}let F=P.headers.get(`Content-Length`);if(P.status===204||N.method===`HEAD`||F===`0`&&!P.headers.get(`Transfer-Encoding`)?.includes(`chunked`))return P.ok?{data:void 0,response:P}:{error:void 0,response:P};if(P.ok)return{data:await(async()=>{if(_===`stream`)return P.body;if(_===`json`&&!F){let e=await P.text();return e?JSON.parse(e):void 0}return await P[_]()})(),response:P};let I=await P.text();try{I=JSON.parse(I)}catch{}return{error:I,response:P}}return{request(e,t,n){return d(t,{...n,method:e.toUpperCase()})},GET(e,t){return d(e,{...t,method:`GET`})},PUT(e,t){return d(e,{...t,method:`PUT`})},POST(e,t){return d(e,{...t,method:`POST`})},DELETE(e,t){return d(e,{...t,method:`DELETE`})},OPTIONS(e,t){return d(e,{...t,method:`OPTIONS`})},HEAD(e,t){return d(e,{...t,method:`HEAD`})},PATCH(e,t){return d(e,{...t,method:`PATCH`})},TRACE(e,t){return d(e,{...t,method:`TRACE`})},use(...e){for(let t of e)if(t){if(typeof t!=`object`||!(`onRequest`in t||`onResponse`in t||`onError`in t))throw Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");u.push(t)}},eject(...e){for(let t of e){let e=u.indexOf(t);e!==-1&&u.splice(e,1)}}}}function fy(e,t,n){if(t==null)return``;if(typeof t==`object`)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?.allowReserved===!0?t:encodeURIComponent(t)}`}function py(e,t,n){if(!t||typeof t!=`object`)return``;let r=[],i={simple:`,`,label:`.`,matrix:`;`}[n.style]||`&`;if(n.style!==`deepObject`&&n.explode===!1){for(let e in t)r.push(e,n.allowReserved===!0?t[e]:encodeURIComponent(t[e]));let i=r.join(`,`);switch(n.style){case`form`:return`${e}=${i}`;case`label`:return`.${i}`;case`matrix`:return`;${e}=${i}`;default:return i}}for(let i in t){let a=n.style===`deepObject`?`${e}[${i}]`:i;r.push(fy(a,t[i],n))}let a=r.join(i);return n.style===`label`||n.style===`matrix`?`${i}${a}`:a}function my(e,t,n){if(!Array.isArray(t))return``;if(n.explode===!1){let r={form:`,`,spaceDelimited:`%20`,pipeDelimited:`|`}[n.style]||`,`,i=(n.allowReserved===!0?t:t.map(e=>encodeURIComponent(e))).join(r);switch(n.style){case`simple`:return i;case`label`:return`.${i}`;case`matrix`:return`;${e}=${i}`;default:return`${e}=${i}`}}let r={simple:`,`,label:`.`,matrix:`;`}[n.style]||`&`,i=[];for(let r of t)n.style===`simple`||n.style===`label`?i.push(n.allowReserved===!0?r:encodeURIComponent(r)):i.push(fy(e,r,n));return n.style===`label`||n.style===`matrix`?`${r}${i.join(r)}`:i.join(r)}function hy(e){return function(t){let n=[];if(t&&typeof t==`object`)for(let r in t){let i=t[r];if(i!=null){if(Array.isArray(i)){if(i.length===0)continue;n.push(my(r,i,{style:`form`,explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof i==`object`){n.push(py(r,i,{style:`deepObject`,explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}n.push(fy(r,i,e))}}return n.join(`&`)}}function gy(e,t){let n=e;for(let r of e.match(cy)??[]){let e=r.substring(1,r.length-1),i=!1,a=`simple`;if(e.endsWith(`*`)&&(i=!0,e=e.substring(0,e.length-1)),e.startsWith(`.`)?(a=`label`,e=e.substring(1)):e.startsWith(`;`)&&(a=`matrix`,e=e.substring(1)),!t||t[e]===void 0||t[e]===null)continue;let o=t[e];if(Array.isArray(o)){n=n.replace(r,my(e,o,{style:a,explode:i}));continue}if(typeof o==`object`){n=n.replace(r,py(e,o,{style:a,explode:i}));continue}if(a===`matrix`){n=n.replace(r,`;${fy(e,o)}`);continue}n=n.replace(r,a===`label`?`.${encodeURIComponent(o)}`:encodeURIComponent(o))}return n}function _y(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get(`Content-Type`)??t.get(`content-type`):t[`Content-Type`]??t[`content-type`])===`application/x-www-form-urlencoded`?new URLSearchParams(e).toString():JSON.stringify(e)}function vy(e,t){let n=`${t.baseUrl}${e}`;t.params?.path&&(n=t.pathSerializer(n,t.params.path));let r=t.querySerializer(t.params.query??{});return r.startsWith(`?`)&&(r=r.substring(1)),r&&(n+=`?${r}`),n}function yy(...e){let t=new Headers;for(let n of e){if(!n||typeof n!=`object`)continue;let e=n instanceof Headers?n.entries():Object.entries(n);for(let[n,r]of e)if(r===null)t.delete(n);else if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,r)}return t}function by(e){return e.endsWith(`/`)?e.substring(0,e.length-1):e}function xy(e){let t=dy({baseUrl:e.baseUrl,...e.fetch&&{fetch:e.fetch}}),n=e.getHeaders,r=e.transportPath??`direct`;return t.use({async onRequest({request:e}){if(n){let t=await n();for(let[n,r]of Object.entries(t))e.headers.set(n,r)}return e.headers.has(`x-syncular-transport-path`)||e.headers.set(`x-syncular-transport-path`,r),e}}),t}var Sy=jp();function Cy(e){return xy({baseUrl:e.serverUrl,getHeaders:()=>({Authorization:`Bearer ${e.token}`})})}async function wy(e){try{let{error:t,response:n}=await e.GET(`/console/stats`);if(!t)return;let r=n.status,i=null;if(typeof t==`string`)i=t;else if(t&&typeof t==`object`){let e=t,n=e.error,r=e.message;if(typeof n==`string`&&n.length>0)i=n;else if(typeof r==`string`&&r.length>0)i=r;else try{i=JSON.stringify(e)}catch{i=null}}throw Error(i&&i.length>0?`Console API /console/stats returned ${r}: ${i}`:`Console API /console/stats returned ${r}`)}catch(e){throw e instanceof Error?e:Error(`Failed to connect to console API`)}}var Ty=`sync-console-connection`;function Ey(e){if(!e)return null;let t=e.serverUrl?.trim()??``,n=e.token?.trim()??``;return!t||!n?null:{serverUrl:t,token:n}}function Dy(e){return typeof window>`u`?null:e===`local`?window.localStorage:e===`session`?window.sessionStorage:null}function Oy(e){let t=Dy(e);if(!t)return null;try{let e=t.getItem(Ty);return e?Ey(JSON.parse(e)):null}catch{return null}}function ky(e,t){let n=Dy(e);if(n)try{if(!t){n.removeItem(Ty);return}n.setItem(Ty,JSON.stringify(t))}catch{}}var Ay=(0,G.createContext)(null);function jy({children:e,defaultConfig:t=null,autoConnect:n=!1,storageMode:r=`session`}){let[i,a]=(0,G.useState)(()=>Oy(r));(0,G.useEffect)(()=>{a(Oy(r))},[r]),(0,G.useEffect)(()=>{typeof window>`u`||(r!==`local`&&window.localStorage.removeItem(Ty),r===`memory`&&window.sessionStorage.removeItem(Ty))},[r]);let o=(0,G.useCallback)(e=>{let t=Ey(e);a(t),ky(r,t)},[r]),[s,c]=(0,G.useState)({isConnected:!1,isConnecting:!1,error:null,client:null}),l=(0,G.useRef)(null);(0,G.useEffect)(()=>{if(!(i?.serverUrl?.trim()&&i.token?.trim())&&t?.serverUrl?.trim()&&t.token?.trim()){o({serverUrl:t.serverUrl.trim(),token:t.token.trim()});return}},[o,i,t]);let u=(0,G.useCallback)(async(e,t)=>{let n=e??i;if(!n)return c(e=>({...e,error:`No connection configured`})),!1;let r=Ey(n);if(!r){let e=(n.serverUrl?.trim()??``).length>0;return c(t=>({...t,error:e?`Token is required`:`Server URL is required`})),!1}e&&(t?.persistOverride??!0)&&o(r),c(e=>({...e,isConnecting:!0,error:null}));try{let e=Cy(r);return await wy(e),c({isConnected:!0,isConnecting:!1,client:e,error:null}),!0}catch(e){return c({isConnected:!1,isConnecting:!1,client:null,error:e instanceof Error?e.message:`Connection failed`}),!1}},[i,o]),d=(0,G.useCallback)(e=>{e?.clearSavedConfig&&o(null),c({isConnected:!1,isConnecting:!1,client:null,error:null})},[o]),f=(0,G.useCallback)(()=>{c(e=>({...e,error:null}))},[]),p=(0,G.useCallback)(e=>{o(e),c({isConnected:!1,isConnecting:!1,client:null,error:null})},[o]),m=(0,G.useMemo)(()=>({config:i,setConfig:p,isConnected:s.isConnected,isConnecting:s.isConnecting,error:s.error,client:s.client,connect:u,disconnect:d,clearError:f}),[i,p,s,u,d,f]);return(0,G.useEffect)(()=>{if(!n||s.isConnected||s.isConnecting)return;let e=i??t,r=My(e);!e||!r||l.current!==r&&(l.current=r,u(e,{persistOverride:!0}))},[n,i,t,s.isConnected,s.isConnecting,u]),(0,K.jsx)(Ay.Provider,{value:m,children:e})}function My(e){if(!e)return null;let t=e.serverUrl?.trim()??``,n=e.token?.trim()??``;return!t||!n?null:`${t}\u0000${n}`}function Ny(){let e=(0,G.useContext)(Ay);if(!e)throw Error(`useConnection must be used within a ConnectionProvider`);return e}function Py(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Py(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Fy(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Py(e))&&(r&&(r+=` `),r+=t);return r}var Iy=e=>typeof e==`number`&&e!=+e,Ly=e=>typeof e==`string`&&e.indexOf(`%`)===e.length-1,Ry=e=>(typeof e==`number`||e instanceof Number)&&!Iy(e);function zy(){}var By=Symbol(`NOT_FOUND`);function Vy(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!=`function`)throw TypeError(t)}function Hy(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!=`object`)throw TypeError(t)}function Uy(e,t=`expected all items to be functions, instead received the following types: `){if(!e.every(e=>typeof e==`function`)){let n=e.map(e=>typeof e==`function`?`function ${e.name||`unnamed`}()`:typeof e).join(`, `);throw TypeError(`${t}[${n}]`)}}var Wy=e=>Array.isArray(e)?e:[e];function Gy(e){let t=Array.isArray(e[0])?e[0]:e;return Uy(t,`createSelector expects all input-selectors to be functions, but received the following types: `),t}function Ky(e,t){let n=[],{length:r}=e;for(let i=0;i<r;i++)n.push(e[i].apply(null,t));return n}function qy(e){let t;return{get(n){return t&&e(t.key,n)?t.value:By},put(e,n){t={key:e,value:n}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function Jy(e,t){let n=[];function r(e){let r=n.findIndex(n=>t(e,n.key));if(r>-1){let e=n[r];return r>0&&(n.splice(r,1),n.unshift(e)),e.value}return By}function i(t,i){r(t)===By&&(n.unshift({key:t,value:i}),n.length>e&&n.pop())}function a(){return n}function o(){n=[]}return{get:r,put:i,getEntries:a,clear:o}}var Yy=(e,t)=>e===t;function Xy(e){return function(t,n){if(t===null||n===null||t.length!==n.length)return!1;let{length:r}=t;for(let i=0;i<r;i++)if(!e(t[i],n[i]))return!1;return!0}}function Zy(e,t){let{equalityCheck:n=Yy,maxSize:r=1,resultEqualityCheck:i}=typeof t==`object`?t:{equalityCheck:t},a=Xy(n),o=0,s=r<=1?qy(a):Jy(r,a);function c(){let t=s.get(arguments);if(t===By){if(t=e.apply(null,arguments),o++,i){let e=s.getEntries().find(e=>i(e.value,t));e&&(t=e.value,o!==0&&o--)}s.put(arguments,t)}return t}return c.clearCache=()=>{s.clear(),c.resetResultsCount()},c.resultsCount=()=>o,c.resetResultsCount=()=>{o=0},c}var Qy=class{constructor(e){this.value=e}deref(){return this.value}},$y=typeof WeakRef<`u`?WeakRef:Qy,eb=0,tb=1;function nb(){return{s:eb,v:void 0,o:null,p:null}}function rb(e,t={}){let n=nb(),{resultEqualityCheck:r}=t,i,a=0;function o(){let t=n,{length:o}=arguments;for(let e=0,n=o;e<n;e++){let n=arguments[e];if(typeof n==`function`||typeof n==`object`&&n){let e=t.o;e===null&&(t.o=e=new WeakMap);let r=e.get(n);r===void 0?(t=nb(),e.set(n,t)):t=r}else{let e=t.p;e===null&&(t.p=e=new Map);let r=e.get(n);r===void 0?(t=nb(),e.set(n,t)):t=r}}let s=t,c;if(t.s===tb)c=t.v;else if(c=e.apply(null,arguments),a++,r){let e=i?.deref?.()??i;e!=null&&r(e,c)&&(c=e,a!==0&&a--),i=typeof c==`object`&&c||typeof c==`function`?new $y(c):c}return s.s=tb,s.v=c,c}return o.clearCache=()=>{n=nb(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function ib(e,...t){let n=typeof e==`function`?{memoize:e,memoizeOptions:t}:e,r=(...e)=>{let t=0,r=0,i,a={},o=e.pop();typeof o==`object`&&(a=o,o=e.pop()),Vy(o,`createSelector expects an output function after the inputs, but received: [${typeof o}]`);let{memoize:s,memoizeOptions:c=[],argsMemoize:l=rb,argsMemoizeOptions:u=[],devModeChecks:d={}}={...n,...a},f=Wy(c),p=Wy(u),m=Gy(e),h=s(function(){return t++,o.apply(null,arguments)},...f),g=l(function(){r++;let e=Ky(m,arguments);return i=h.apply(null,e),i},...p);return Object.assign(g,{resultFunc:o,memoizedResultFunc:h,dependencies:m,dependencyRecomputations:()=>r,resetDependencyRecomputations:()=>{r=0},lastResult:()=>i,recomputations:()=>t,resetRecomputations:()=>{t=0},memoize:s,argsMemoize:l})};return Object.assign(r,{withTypes:()=>r}),r}var ab=ib(rb),ob=Object.assign((e,t=ab)=>{Hy(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);let n=Object.keys(e);return t(n.map(t=>e[t]),(...e)=>e.reduce((e,t,r)=>(e[n[r]]=t,e),{}))},{withTypes:()=>ob});function sb(e){return typeof e==`number`&&e>0&&Number.isFinite(e)}var cb=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(e,t,{signal:n,edges:r}={}){let i,a=null,o=r!=null&&r.includes(`leading`),s=r==null||r.includes(`trailing`),c=()=>{a!==null&&(e.apply(i,a),i=void 0,a=null)},l=()=>{s&&c(),p()},u=null,d=()=>{u!=null&&clearTimeout(u),u=setTimeout(()=>{u=null,l()},t)},f=()=>{u!==null&&(clearTimeout(u),u=null)},p=()=>{f(),i=void 0,a=null},m=()=>{c()},h=function(...e){if(n?.aborted)return;i=this,a=e;let t=u==null;d(),o&&t&&c()};return h.schedule=d,h.cancel=p,h.flush=m,n?.addEventListener(`abort`,p,{once:!0}),h}e.debounce=t})),lb=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=cb();function n(e,n=0,r={}){typeof r!=`object`&&(r={});let{leading:i=!1,trailing:a=!0,maxWait:o}=r,s=[,,];i&&(s[0]=`leading`),a&&(s[1]=`trailing`);let c,l=null,u=t.debounce(function(...t){c=e.apply(this,t),l=null},n,{edges:s}),d=function(...t){return o!=null&&(l===null&&(l=Date.now()),Date.now()-l>=o)?(c=e.apply(this,t),l=Date.now(),u.cancel(),u.schedule(),c):(u.apply(this,t),c)};return d.cancel=u.cancel,d.flush=()=>(u.flush(),c),d}e.debounce=n})),ub=o((e=>{Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=lb();function n(e,n=0,r={}){let{leading:i=!0,trailing:a=!0}=r;return t.debounce(e,n,{leading:i,maxWait:n,trailing:a})}e.throttle=n})),db=o(((e,t)=>{t.exports=ub().throttle})),fb=!0,pb=function(e,t){var n=[...arguments].slice(2);if(fb&&typeof console<`u`&&console.warn&&(t===void 0&&console.warn(`LogUtils requires an error message argument`),!e))if(t===void 0)console.warn(`Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.`);else{var r=0;console.warn(t.replace(/%s/g,()=>n[r++]))}},mb={width:`100%`,height:`100%`,debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},hb=(e,t,n)=>{var{width:r=mb.width,height:i=mb.height,aspect:a,maxHeight:o}=n,s=Ly(r)?e:Number(r),c=Ly(i)?t:Number(i);return a&&a>0&&(s?c=s/a:c&&(s=c*a),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:s,calculatedHeight:c}},gb={width:0,height:0,overflow:`visible`},_b={width:0,overflowX:`visible`},vb={height:0,overflowY:`visible`},yb={},bb=e=>{var{width:t,height:n}=e,r=Ly(t),i=Ly(n);return r&&i?gb:r?_b:i?vb:yb};function xb(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=mb.width,a=mb.height):i===void 0?i=r&&r>0?void 0:mb.width:a===void 0&&(a=r&&r>0?void 0:mb.height),{width:i,height:a}}var Sb=l(db());function Cb(){return Cb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cb.apply(null,arguments)}function wb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Tb(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?wb(Object(n),!0).forEach(function(t){Eb(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wb(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Eb(e,t,n){return(t=Db(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Db(e){var t=Ob(e,`string`);return typeof t==`symbol`?t:t+``}function Ob(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}var kb=(0,G.createContext)(mb.initialDimension);function Ab(e){return sb(e.width)&&sb(e.height)}function jb(e){var{children:t,width:n,height:r}=e,i=(0,G.useMemo)(()=>({width:n,height:r}),[n,r]);return Ab(i)?G.createElement(kb.Provider,{value:i},t):null}var Mb=()=>(0,G.useContext)(kb),Nb=(0,G.forwardRef)((e,t)=>{var{aspect:n,initialDimension:r=mb.initialDimension,width:i,height:a,minWidth:o=mb.minWidth,minHeight:s,maxHeight:c,children:l,debounce:u=mb.debounce,id:d,className:f,onResize:p,style:m={}}=e,h=(0,G.useRef)(null),g=(0,G.useRef)();g.current=p,(0,G.useImperativeHandle)(t,()=>h.current);var[_,v]=(0,G.useState)({containerWidth:r.width,containerHeight:r.height}),y=(0,G.useCallback)((e,t)=>{v(n=>{var r=Math.round(e),i=Math.round(t);return n.containerWidth===r&&n.containerHeight===i?n:{containerWidth:r,containerHeight:i}})},[]);(0,G.useEffect)(()=>{if(h.current==null||typeof ResizeObserver>`u`)return zy;var e=e=>{var t,n=e[0];if(n!=null){var{width:r,height:i}=n.contentRect;y(r,i),(t=g.current)==null||t.call(g,r,i)}};u>0&&(e=(0,Sb.default)(e,u,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),{width:n,height:r}=h.current.getBoundingClientRect();return y(n,r),t.observe(h.current),()=>{t.disconnect()}},[y,u]);var{containerWidth:b,containerHeight:x}=_;pb(!n||n>0,`The aspect(%s) must be greater than zero.`,n);var{calculatedWidth:S,calculatedHeight:C}=hb(b,x,{width:i,height:a,aspect:n,maxHeight:c});return pb(S!=null&&S>0||C!=null&&C>0,`The width(%s) and height(%s) of chart should be greater than 0,
14
+ please check the style of container, or the props width(%s) and height(%s),
15
+ or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
16
+ height and width.`,S,C,i,a,o,s,n),G.createElement(`div`,{id:d?`${d}`:void 0,className:Fy(`recharts-responsive-container`,f),style:Tb(Tb({},m),{},{width:i,height:a,minWidth:o,minHeight:s,maxHeight:c}),ref:h},G.createElement(`div`,{style:bb({width:i,height:a})},G.createElement(jb,{width:S,height:C},l)))}),Pb=(0,G.forwardRef)((e,t)=>{var n=Mb();if(sb(n.width)&&sb(n.height))return e.children;var{width:r,height:i}=xb({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=hb(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return Ry(a)&&Ry(o)?G.createElement(jb,{width:a,height:o},e.children):G.createElement(Nb,Cb({},e,{width:r,height:i,ref:t}))}),Fb=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},Ib=(e,t)=>({classGroupId:e,validator:t}),Lb=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Rb=`-`,zb=[],Bb=`arbitrary..`,Vb=e=>{let t=Wb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Ub(e);let n=e.split(Rb);return Hb(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Fb(i,t):t:i||zb}return n[e]||zb}}},Hb=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Hb(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Rb):e.slice(t).join(Rb),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},Ub=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Bb+r:void 0})(),Wb=e=>{let{theme:t,classGroups:n}=e;return Gb(n,t)},Gb=(e,t)=>{let n=Lb();for(let r in e){let i=e[r];Kb(i,n,r,t)}return n},Kb=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];qb(i,t,n,r)}},qb=(e,t,n,r)=>{if(typeof e==`string`){Jb(e,t,n);return}if(typeof e==`function`){Yb(e,t,n,r);return}Xb(e,t,n,r)},Jb=(e,t,n)=>{let r=e===``?t:Zb(t,e);r.classGroupId=n},Yb=(e,t,n,r)=>{if(Qb(e)){Kb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Ib(n,e))},Xb=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Kb(o,Zb(t,a),n,r)}},Zb=(e,t)=>{let n=e,r=t.split(Rb),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Lb(),n.nextPart.set(t,i)),n=i}return n},Qb=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,$b=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},ex=`!`,tx=`:`,nx=[],rx=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ix=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===tx){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(ex)?(c=s.slice(0,-1),l=!0):s.startsWith(ex)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return rx(t,l,c,u)};if(t){let e=t+tx,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):rx(nx,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ax=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},ox=e=>({cache:$b(e.cacheSize),parseClassName:ix(e),sortModifiers:ax(e),...Vb(e)}),sx=/\s+/,cx=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=t,o=[],s=e.trim().split(sx),c=``;for(let e=s.length-1;e>=0;--e){let t=s[e],{isExternal:l,modifiers:u,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=n(t);if(l){c=t+(c.length>0?` `+c:c);continue}let m=!!p,h=r(m?f.substring(0,p):f);if(!h){if(!m){c=t+(c.length>0?` `+c:c);continue}if(h=r(f),!h){c=t+(c.length>0?` `+c:c);continue}m=!1}let g=u.length===0?``:u.length===1?u[0]:a(u).join(`:`),_=d?g+ex:g,v=_+h;if(o.indexOf(v)>-1)continue;o.push(v);let y=i(h,m);for(let e=0;e<y.length;++e){let t=y[e];o.push(_+t)}c=t+(c.length>0?` `+c:c)}return c},lx=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=ux(n))&&(i&&(i+=` `),i+=r);return i},ux=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=ux(e[r]))&&(n&&(n+=` `),n+=t);return n},dx=(e,...t)=>{let n,r,i,a,o=o=>(n=ox(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=cx(e,n);return i(e,a),a};return a=o,(...e)=>a(lx(...e))},fx=[],px=e=>{let t=t=>t[e]||fx;return t.isThemeGetter=!0,t},mx=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,hx=/^\((?:(\w[\w-]*):)?(.+)\)$/i,gx=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,_x=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,vx=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,yx=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,bx=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xx=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Sx=e=>gx.test(e),Cx=e=>!!e&&!Number.isNaN(Number(e)),wx=e=>!!e&&Number.isInteger(Number(e)),Tx=e=>e.endsWith(`%`)&&Cx(e.slice(0,-1)),Ex=e=>_x.test(e),Dx=()=>!0,Ox=e=>vx.test(e)&&!yx.test(e),kx=()=>!1,Ax=e=>bx.test(e),jx=e=>xx.test(e),Mx=e=>!q(e)&&!J(e),Nx=e=>Jx(e,Qx,kx),q=e=>mx.test(e),Px=e=>Jx(e,$x,Ox),Fx=e=>Jx(e,eS,Cx),Ix=e=>Jx(e,nS,Dx),Lx=e=>Jx(e,tS,kx),Rx=e=>Jx(e,Xx,kx),zx=e=>Jx(e,Zx,jx),Bx=e=>Jx(e,rS,Ax),J=e=>hx.test(e),Vx=e=>Yx(e,$x),Hx=e=>Yx(e,tS),Ux=e=>Yx(e,Xx),Wx=e=>Yx(e,Qx),Gx=e=>Yx(e,Zx),Kx=e=>Yx(e,rS,!0),qx=e=>Yx(e,nS,!0),Jx=(e,t,n)=>{let r=mx.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Yx=(e,t,n=!1)=>{let r=hx.exec(e);return r?r[1]?t(r[1]):n:!1},Xx=e=>e===`position`||e===`percentage`,Zx=e=>e===`image`||e===`url`,Qx=e=>e===`length`||e===`size`||e===`bg-size`,$x=e=>e===`length`,eS=e=>e===`number`,tS=e=>e===`family-name`,nS=e=>e===`number`||e===`weight`,rS=e=>e===`shadow`,iS=dx(()=>{let e=px(`color`),t=px(`font`),n=px(`text`),r=px(`font-weight`),i=px(`tracking`),a=px(`leading`),o=px(`breakpoint`),s=px(`container`),c=px(`spacing`),l=px(`radius`),u=px(`shadow`),d=px(`inset-shadow`),f=px(`text-shadow`),p=px(`drop-shadow`),m=px(`blur`),h=px(`perspective`),g=px(`aspect`),_=px(`ease`),v=px(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),J,q],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[J,q,c],T=()=>[Sx,`full`,`auto`,...w()],E=()=>[wx,`none`,`subgrid`,J,q],D=()=>[`auto`,{span:[`full`,wx,J,q]},wx,J,q],O=()=>[wx,`auto`,J,q],k=()=>[`auto`,`min`,`max`,`fr`,J,q],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Sx,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Sx,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Sx,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,J,q],L=()=>[...b(),Ux,Rx,{position:[J,q]}],ee=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],R=()=>[`auto`,`cover`,`contain`,Wx,Nx,{size:[J,q]}],z=()=>[Tx,Vx,Px],B=()=>[``,`none`,`full`,l,J,q],V=()=>[``,Cx,Vx,Px],H=()=>[`solid`,`dashed`,`dotted`,`double`],U=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],W=()=>[Cx,Tx,Ux,Rx],te=()=>[``,`none`,m,J,q],ne=()=>[`none`,Cx,J,q],re=()=>[`none`,Cx,J,q],ie=()=>[Cx,J,q],ae=()=>[Sx,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Ex],breakpoint:[Ex],color:[Dx],container:[Ex],"drop-shadow":[Ex],ease:[`in`,`out`,`in-out`],font:[Mx],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Ex],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Ex],shadow:[Ex],spacing:[`px`,Cx],text:[Ex],"text-shadow":[Ex],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Sx,q,J,g]}],container:[`container`],columns:[{columns:[Cx,q,J,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[wx,`auto`,J,q]}],basis:[{basis:[Sx,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Cx,Sx,`auto`,`initial`,`none`,q]}],grow:[{grow:[``,Cx,J,q]}],shrink:[{shrink:[``,Cx,J,q]}],order:[{order:[wx,`first`,`last`,`none`,J,q]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,Vx,Px]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,qx,Ix]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Tx,q]}],"font-family":[{font:[Hx,Lx,t]}],"font-features":[{"font-features":[q]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,J,q]}],"line-clamp":[{"line-clamp":[Cx,`none`,J,Fx]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,J,q]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,J,q]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...H(),`wavy`]}],"text-decoration-thickness":[{decoration:[Cx,`from-font`,`auto`,J,Px]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Cx,`auto`,J,q]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,J,q]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,J,q]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:R()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},wx,J,q],radial:[``,J,q],conic:[wx,J,q]},Gx,zx]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:B()}],"rounded-s":[{"rounded-s":B()}],"rounded-e":[{"rounded-e":B()}],"rounded-t":[{"rounded-t":B()}],"rounded-r":[{"rounded-r":B()}],"rounded-b":[{"rounded-b":B()}],"rounded-l":[{"rounded-l":B()}],"rounded-ss":[{"rounded-ss":B()}],"rounded-se":[{"rounded-se":B()}],"rounded-ee":[{"rounded-ee":B()}],"rounded-es":[{"rounded-es":B()}],"rounded-tl":[{"rounded-tl":B()}],"rounded-tr":[{"rounded-tr":B()}],"rounded-br":[{"rounded-br":B()}],"rounded-bl":[{"rounded-bl":B()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-bs":[{"border-bs":V()}],"border-w-be":[{"border-be":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":V()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...H(),`hidden`,`none`]}],"divide-style":[{divide:[...H(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...H(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Cx,J,q]}],"outline-w":[{outline:[``,Cx,Vx,Px]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,Kx,Bx]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Kx,Bx]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:V()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Cx,Px]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Kx,Bx]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Cx,J,q]}],"mix-blend":[{"mix-blend":[...U(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":U()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Cx]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[J,q]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Cx]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:R()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,J,q]}],filter:[{filter:[``,`none`,J,q]}],blur:[{blur:te()}],brightness:[{brightness:[Cx,J,q]}],contrast:[{contrast:[Cx,J,q]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Kx,Bx]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,Cx,J,q]}],"hue-rotate":[{"hue-rotate":[Cx,J,q]}],invert:[{invert:[``,Cx,J,q]}],saturate:[{saturate:[Cx,J,q]}],sepia:[{sepia:[``,Cx,J,q]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,J,q]}],"backdrop-blur":[{"backdrop-blur":te()}],"backdrop-brightness":[{"backdrop-brightness":[Cx,J,q]}],"backdrop-contrast":[{"backdrop-contrast":[Cx,J,q]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Cx,J,q]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Cx,J,q]}],"backdrop-invert":[{"backdrop-invert":[``,Cx,J,q]}],"backdrop-opacity":[{"backdrop-opacity":[Cx,J,q]}],"backdrop-saturate":[{"backdrop-saturate":[Cx,J,q]}],"backdrop-sepia":[{"backdrop-sepia":[``,Cx,J,q]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,J,q]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Cx,`initial`,J,q]}],ease:[{ease:[`linear`,`initial`,_,J,q]}],delay:[{delay:[Cx,J,q]}],animate:[{animate:[`none`,v,J,q]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,J,q]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ne()}],"rotate-x":[{"rotate-x":ne()}],"rotate-y":[{"rotate-y":ne()}],"rotate-z":[{"rotate-z":ne()}],scale:[{scale:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":[`scale-3d`],skew:[{skew:ie()}],"skew-x":[{"skew-x":ie()}],"skew-y":[{"skew-y":ie()}],transform:[{transform:[J,q,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ae()}],"translate-x":[{"translate-x":ae()}],"translate-y":[{"translate-y":ae()}],"translate-z":[{"translate-z":ae()}],"translate-none":[`translate-none`],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,J,q]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,J,q]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[Cx,Vx,Px,Fx]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Y(...e){return iS(Fy(e))}var aS={light:``,dark:`.dark`},oS=G.createContext(null);function sS(){let e=G.useContext(oS);if(!e)throw Error(`useChart must be used within a <ChartContainer />`);return e}var cS=G.forwardRef(({id:e,className:t,children:n,config:r,...i},a)=>{let o=G.useId(),s=`chart-${e||o.replace(/:/g,``)}`;return(0,K.jsx)(oS.Provider,{value:{config:r},children:(0,K.jsxs)(`div`,{className:Y(`flex justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-neutral-500 [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-panel [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-panel [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none`,t),"data-chart":s,ref:a,...i,children:[(0,K.jsx)(lS,{config:r,id:s}),(0,K.jsx)(Pb,{initialDimension:{width:1,height:1},children:n})]})})});cS.displayName=`ChartContainer`;function lS({config:e,id:t}){let n=Object.entries(e).filter(([,e])=>e.theme||e.color);return n.length<1?null:(0,K.jsx)(`style`,{dangerouslySetInnerHTML:{__html:Object.entries(aS).map(([e,r])=>`${r} [data-chart='${t}'] {\n${n.map(([t,n])=>{let r=n.theme?.[e]??n.color;return r?` --color-${t}: ${r};`:null}).filter(Boolean).join(`
17
+ `)}\n}`).join(`
18
+ `)}})}var uS=G.forwardRef(({active:e,className:t,color:n,formatter:r,hideIndicator:i=!1,hideLabel:a=!1,indicator:o=`dot`,label:s,labelClassName:c,labelFormatter:l,labelKey:u,nameKey:d,payload:f},p)=>{let{config:m}=sS(),h=G.useMemo(()=>{if(a||!f?.length)return null;let e=f[0];if(!e)return null;let t=dS(m,e,`${u||e.dataKey||e.name||`value`}`),n=!u&&typeof s==`string`?m[s]?.label??s:t?.label;return l?(0,K.jsx)(`div`,{className:Y(`font-medium`,c),children:l(n??``,f)}):n?(0,K.jsx)(`div`,{className:Y(`font-medium`,c),children:n}):null},[m,a,s,c,l,u,f]);if(!e||!f?.length)return null;let g=f.length===1&&o!==`dot`;return(0,K.jsxs)(`div`,{className:Y(`grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-surface px-2.5 py-1.5 text-xs shadow-xl`,t),ref:p,children:[g?null:h,(0,K.jsx)(`div`,{className:`grid gap-1.5`,children:f.map((e,t)=>{let a=`${d||e.name||e.dataKey||`value`}`,s=dS(m,e,a),c=n||e.payload?.fill||e.color;return(0,K.jsx)(`div`,{className:Y(`flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-neutral-500`,o===`dot`?`items-center`:null),children:r&&e.value!==void 0&&e.name?r(e.value,e.name,e,t,e.payload??{}):(0,K.jsxs)(K.Fragment,{children:[s?.icon?(0,K.jsx)(s.icon,{}):i?null:(0,K.jsx)(`div`,{className:Y(`shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]`,o===`dot`?`h-2.5 w-2.5`:null,o===`line`?`w-1`:null,o===`dashed`?`w-0 border-[1.5px] border-dashed bg-transparent`:null,g&&o===`dashed`?`my-0.5`:null),style:{"--color-bg":c,"--color-border":c}}),(0,K.jsxs)(`div`,{className:Y(`flex flex-1 justify-between leading-none`,g?`items-end`:`items-center`),children:[(0,K.jsxs)(`div`,{className:`grid gap-1.5`,children:[g?h:null,(0,K.jsx)(`span`,{className:`text-neutral-500`,children:s?.label||e.name})]}),e.value===void 0?null:(0,K.jsx)(`span`,{className:`font-mono font-medium tabular-nums text-foreground`,children:typeof e.value==`number`?e.value.toLocaleString():e.value})]})]})},a)})})]})});uS.displayName=`ChartTooltipContent`;function dS(e,t,n){let r=t.payload?.[n],i=typeof r==`string`?r:null,a=typeof t.dataKey==`string`?t.dataKey:null,o=typeof t.name==`string`?t.name:null;return e[i??a??o??n]}var fS=[`1h`,`6h`,`24h`,`7d`],pS=(0,G.forwardRef)(({className:e,bars:t,activeRange:n=`1h`,onRangeChange:r,startLabel:i=`-1h`,midLabel:a=`-30m`,endLabel:o=`now`,...s},c)=>(0,K.jsxs)(`div`,{ref:c,className:Y(`px-5 pt-4 pb-3 border-b border-border`,e),...s,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-3`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-500 uppercase tracking-widest`,children:`Activity`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`w-2 h-2 rounded-sm bg-healthy/70`}),(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-neutral-500`,children:`Push`})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`w-2 h-2 rounded-sm bg-flow/70`}),(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-neutral-500`,children:`Pull`})]}),(0,K.jsx)(`div`,{className:`flex gap-0.5 ml-2`,children:fS.map(e=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>r?.(e),className:Y(`font-mono text-[9px] border rounded-sm px-1.5 py-0.5 cursor-pointer transition-all`,e===n?`text-white border-border-bright bg-white/[0.03]`:`text-neutral-500 border-transparent hover:text-neutral-300`),children:e},e))})]})]}),(0,K.jsx)(`div`,{className:`flex items-end gap-[2px] h-16`,children:t.map((e,t)=>(0,K.jsxs)(`div`,{className:`flex-1 flex flex-col gap-[1px] h-16 justify-end`,children:[(0,K.jsx)(`div`,{className:`bg-flow/60 rounded-t-sm min-h-[2px]`,style:{height:`${e.pullPercent}%`}}),(0,K.jsx)(`div`,{className:`bg-healthy/60 rounded-t-sm min-h-[2px]`,style:{height:`${e.pushPercent}%`}})]},t))}),(0,K.jsxs)(`div`,{className:`flex justify-between mt-1.5`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[8px] text-neutral-600`,children:i}),(0,K.jsx)(`span`,{className:`font-mono text-[8px] text-neutral-600`,children:a}),(0,K.jsx)(`span`,{className:`font-mono text-[8px] text-neutral-600`,children:o})]})]}));pS.displayName=`ActivityBars`;var mS=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,hS=Fy,gS=(e,t)=>n=>{if(t?.variants==null)return hS(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=mS(t)||mS(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return hS(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},_S=gS(`bg-surface border border-border rounded-md px-3 py-1.5 text-foreground outline-none w-full transition focus:border-flow placeholder:text-neutral-600`,{variants:{variant:{default:`font-sans text-[13px]`,mono:`font-mono text-[12px]`}},defaultVariants:{variant:`default`}}),vS=(0,G.forwardRef)(({className:e,variant:t,...n},r)=>(0,K.jsx)(`input`,{ref:r,className:Y(_S({variant:t,className:e})),...n}));vS.displayName=`Input`;function yS({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=G.useRef(e!==void 0),[a,o]=G.useState(t);return[i?e:a,G.useCallback(e=>{i||o(e)},[])]}var bS={};function xS(e,t){let n=G.useRef(bS);return n.current===bS&&(n.current=e(t)),n}var SS=G[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],CS=SS&&SS!==G.useLayoutEffect?SS:e=>e();function X(e){let t=xS(wS).current;return t.next=e,CS(t.effect),t.trampoline}function wS(){let e={next:void 0,callback:TS,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function TS(){}function ES(e,t,n,r){let i=xS(OS).current;return kS(i,e,t,n,r)&&jS(i,[e,t,n,r]),i.callback}function DS(e){let t=xS(OS).current;return AS(t,e)&&jS(t,e),t.callback}function OS(){return{callback:null,cleanup:null,refs:[]}}function kS(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function AS(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function jS(e,t){if(e.refs=t,t.every(e=>e==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n;break;default:}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null;break;default:}}}}}}var Z=typeof document<`u`?G.useLayoutEffect:()=>{},MS={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},NS={...MS,position:`fixed`,top:0,left:0},PS={...MS,position:`absolute`};function FS(){}var IS=Object.freeze([]),LS=Object.freeze({});function RS(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var zS=RS(`https://base-ui.com/production-error`,`Base UI`),BS=19;function VS(e){return BS>=e}function HS(e){if(!G.isValidElement(e))return null;let t=e,n=t.props;return(VS(19)?n?.ref:t.ref)??null}function US(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function WS(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e);continue}i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function GS(e,t){return typeof e==`function`?e(t):e}function KS(e,t){return typeof e==`function`?e(t):e}var qS={};function JS(e,t,n,r,i){let a={...eC(e,qS)};return t&&(a=XS(a,t)),n&&(a=XS(a,n)),r&&(a=XS(a,r)),i&&(a=XS(a,i)),a}function YS(e){if(e.length===0)return qS;if(e.length===1)return eC(e[0],qS);let t={...eC(e[0],qS)};for(let n=1;n<e.length;n+=1)t=XS(t,e[n]);return t}function XS(e,t){return $S(t)?t(e):ZS(e,t)}function ZS(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=US(e.style,r);break;case`className`:e[n]=rC(e.className,r);break;default:QS(n,r)?e[n]=tC(e[n],r):e[n]=r}}return e}function QS(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function $S(e){return typeof e==`function`}function eC(e,t){return $S(e)?e(t):e??qS}function tC(e,t){return t?e?n=>{if(iC(n)){let r=n;nC(r);let i=t(r);return r.baseUIHandlerPrevented||e?.(r),i}let r=t(n);return e?.(n),r}:t:e}function nC(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function rC(e,t){return t?e?t+` `+e:t:e}function iC(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}var aC={style:{transition:`none`}},oC={fallbackAxisSide:`none`},sC={fallbackAxisSide:`end`},cC={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0};function lC(e,t,n={}){let r=t.render,i=uC(t,n);return n.enabled===!1?null:fC(e,r,i,n.state??LS)}function uC(e,t={}){let{className:n,style:r,render:i}=e,{state:a=LS,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?GS(n,a):void 0,d=l?KS(r,a):void 0,f=l?WS(a,c):LS,p=l?US(f,Array.isArray(s)?YS(s):s)??LS:LS;return typeof document<`u`&&(l?Array.isArray(o)?p.ref=DS([p.ref,HS(i),...o]):p.ref=ES(p.ref,HS(i),o):ES(null,null)),l?(u!==void 0&&(p.className=rC(p.className,u)),d!==void 0&&(p.style=US(p.style,d)),p):LS}var dC=Symbol.for(`react.lazy`);function fC(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=JS(n,t.props);e.ref=n.ref;let i=t;return i?.$$typeof===dC&&(i=G.Children.toArray(t)[0]),G.cloneElement(i,e)}if(e&&typeof e==`string`)return pC(e,n);throw Error(zS(8))}function pC(e,t){return e===`button`?(0,G.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,G.createElement)(`img`,{alt:``,...t,key:t.key}):G.createElement(e,t)}var mC={...G},hC=0;function gC(e,t=`mui`){let[n,r]=G.useState(e),i=e||n;return G.useEffect(()=>{n??(hC+=1,r(`${t}-${hC}`))},[n,t]),i}var _C=mC.useId;function vC(e,t){if(_C!==void 0){let n=_C();return e??(t?`${t}-${n}`:n)}return gC(e,t)}function yC(e){return vC(e,`base-ui`)}function bC(){return typeof window<`u`}function xC(e){return wC(e)?(e.nodeName||``).toLowerCase():`#document`}function SC(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function CC(e){return((wC(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function wC(e){return bC()?e instanceof Node||e instanceof SC(e).Node:!1}function TC(e){return bC()?e instanceof Element||e instanceof SC(e).Element:!1}function EC(e){return bC()?e instanceof HTMLElement||e instanceof SC(e).HTMLElement:!1}function DC(e){return!bC()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof SC(e).ShadowRoot}function OC(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=zC(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function kC(e){return/^(table|td|th)$/.test(xC(e))}function AC(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var jC=/transform|translate|scale|rotate|perspective|filter/,MC=/paint|layout|strict|content/,NC=e=>!!e&&e!==`none`,PC;function FC(e){let t=TC(e)?zC(e):e;return NC(t.transform)||NC(t.translate)||NC(t.scale)||NC(t.rotate)||NC(t.perspective)||!LC()&&(NC(t.backdropFilter)||NC(t.filter))||jC.test(t.willChange||``)||MC.test(t.contain||``)}function IC(e){let t=VC(e);for(;EC(t)&&!RC(t);){if(FC(t))return t;if(AC(t))return null;t=VC(t)}return null}function LC(){return PC??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),PC}function RC(e){return/^(html|body|#document)$/.test(xC(e))}function zC(e){return SC(e).getComputedStyle(e)}function BC(e){return TC(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function VC(e){if(xC(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||DC(e)&&e.host||CC(e);return DC(t)?t.host:t}function HC(e){let t=VC(e);return RC(t)?e.ownerDocument?e.ownerDocument.body:e.body:EC(t)&&OC(t)?t:HC(t)}function UC(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=HC(e),i=r===e.ownerDocument?.body,a=SC(r);if(i){let e=WC(a);return t.concat(a,a.visualViewport||[],OC(r)?r:[],e&&n?UC(e):[])}else return t.concat(r,UC(r,[],n))}function WC(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var GC=G.createContext(void 0);function KC(e=!1){let t=G.useContext(GC);if(t===void 0&&!e)throw Error(zS(16));return t}function qC(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=e,o=r&&t!==!1,s=r&&t===!1;return{props:G.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=i,!a&&n&&(e.tabIndex=t?i:-1)),(a&&(t||o)||!a&&n)&&(e[`aria-disabled`]=n),a&&(!t||s)&&(e.disabled=n),e},[r,n,t,o,s,a,i])}}function JC(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=e,o=G.useRef(null),s=KC(!0),c=a??s!==void 0,{props:l}=qC({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:r,isNativeButton:i}),u=G.useCallback(()=>{let e=o.current;YC(e)&&c&&t&&l.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,l.disabled,c]);return Z(u,[u]),{getButtonProps:G.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:a,onKeyDown:o,onPointerDown:s,...u}=e;return JS({type:i?`button`:void 0,onClick(e){if(t){e.preventDefault();return}n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(nC(e),o?.(e),e.baseUIHandlerPrevented))return;let r=e.target===e.currentTarget,a=e.currentTarget,s=YC(a),l=!i&&XC(a),u=r&&(i?s:!l),d=e.key===`Enter`,f=e.key===` `,p=a.getAttribute(`role`),m=p?.startsWith(`menuitem`)||p===`option`||p===`gridcell`;if(r&&c&&f){if(e.defaultPrevented&&m)return;e.preventDefault(),l||i&&s?(a.click(),e.preventBaseUIHandler()):u&&(n?.(e),e.preventBaseUIHandler());return}u&&(!i&&(f||d)&&e.preventDefault(),!i&&d&&n?.(e))},onKeyUp(e){if(!t){if(nC(e),a?.(e),e.target===e.currentTarget&&i&&c&&YC(e.currentTarget)&&e.key===` `){e.preventDefault();return}e.baseUIHandlerPrevented||e.target===e.currentTarget&&!i&&!c&&e.key===` `&&n?.(e)}},onPointerDown(e){if(t){e.preventDefault();return}s?.(e)}},i?void 0:{role:`button`},l,u)},[t,l,c,i]),buttonRef:X(e=>{o.current=e,u()})}}function YC(e){return EC(e)&&e.tagName===`BUTTON`}function XC(e){return!!(e?.tagName===`A`&&e?.href)}var ZC=G.createContext(void 0);function QC(){let e=G.useContext(ZC);if(e===void 0)throw Error(zS(63));return e}var $C=function(e){return e.disabled=`data-disabled`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),ew={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},tw={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},nw={disabled:!1,...tw},rw={valid(e){return e===null?null:e?{[$C.valid]:``}:{[$C.invalid]:``}}},iw=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({}),aw={...rw,checked(e){return e?{[iw.checked]:``}:{[iw.unchecked]:``}}};function ow(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}var sw=G.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:FS,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function cw(){return G.useContext(sw)}var lw=G.createContext({invalid:void 0,name:void 0,validityData:{state:ew,errors:[],error:``,value:``,initialValue:null},setValidityData:FS,disabled:void 0,touched:tw.touched,setTouched:FS,dirty:tw.dirty,setDirty:FS,filled:tw.filled,setFilled:FS,focused:tw.focused,setFocused:FS,validate:()=>null,validationMode:`onSubmit`,validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:nw,markedDirtyRef:{current:!1},validation:{getValidationProps:(e=LS)=>e,getInputValidationProps:(e=LS)=>e,inputRef:{current:null},commit:async()=>{}}});function uw(e=!0){let t=G.useContext(lw);if(t.setValidityData===FS&&!e)throw Error(zS(28));return t}function dw(e){let{enabled:t=!0,value:n,id:r,name:i,controlRef:a,commit:o}=e,{formRef:s}=cw(),{invalid:c,markedDirtyRef:l,validityData:u,setValidityData:d}=uw(),f=X(e.getValue);Z(()=>{if(!t)return;let e=n;e===void 0&&(e=f()),u.initialValue===null&&e!==null&&d(t=>({...t,initialValue:e}))},[t,d,n,u.initialValue,f]),Z(()=>{!t||!r||s.current.fields.set(r,{getValue:f,name:i,controlRef:a,validityData:ow(u,c),validate(e=!0){let t=n;t===void 0&&(t=f()),l.current=!0,e?Ev.flushSync(()=>o(t)):o(t)}})},[o,a,t,s,f,r,c,l,i,u,n]),Z(()=>{let e=s.current.fields;return()=>{r&&e.delete(r)}},[s,r])}var fw=G.createContext({controlId:void 0,registerControlId:FS,labelId:void 0,setLabelId:FS,messageIds:[],setMessageIds:FS,getDescriptionProps:e=>e});function pw(){return G.useContext(fw)}function mw(e,t,n,r=!0,i){let[a,o]=G.useState(),s=yC(i?`${i}-label`:void 0),c=e??t??a;return Z(()=>{let i=e||t||!r?void 0:hw(n.current,s);a!==i&&o(i)}),c}function hw(e,t){let n=gw(e);if(n)return!n.id&&t&&(n.id=t),n.id||void 0}function gw(e){if(!e)return;let t=e.parentElement;if(t&&t.tagName===`LABEL`)return t;let n=e.id;if(n){let t=e.nextElementSibling;if(t&&t.htmlFor===n)return t}let r=e.labels;return r&&r[0]}function _w(e={}){let{id:t,implicit:n=!1,controlRef:r}=e,{controlId:i,registerControlId:a}=pw(),o=yC(t),s=n?i:void 0,c=xS(()=>Symbol(`labelable-control`)),l=G.useRef(!1),u=G.useRef(t!=null),d=X(()=>{!l.current||a===FS||(l.current=!1,a(c.current,void 0))});return Z(()=>{if(a===FS)return;let e;if(n){let n=r?.current;e=TC(n)&&n.closest(`label`)!=null?t??null:s??o}else if(t!=null)u.current=!0,e=t;else if(u.current)e=o;else{d();return}if(e===void 0){d();return}l.current=!0,a(c.current,e)},[t,r,s,a,n,o,c,d]),G.useEffect(()=>d,[d]),i??o}var vw=`none`,yw=`trigger-press`,bw=`trigger-hover`,xw=`trigger-focus`,Sw=`outside-press`,Cw=`item-press`,ww=`focus-out`,Tw=`escape-key`,Ew=`cancel-open`,Dw=`disabled`,Ow=`imperative-action`,kw=`window-resize`;function Aw(e,t,n,r){let i=!1,a=!1,o=r??LS;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function jw(e,t){let n=G.useRef(e),r=X(t);Z(()=>{n.current!==e&&r(n.current)},[e,r]),Z(()=>{n.current=e},[e])}var Mw=G.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i,"aria-labelledby":a,id:o,inputRef:s,name:c,nativeButton:l=!1,onCheckedChange:u,readOnly:d=!1,required:f=!1,disabled:p=!1,render:m,uncheckedValue:h,value:g,..._}=e,{clearErrors:v}=cw(),{state:y,setTouched:b,setDirty:x,validityData:S,setFilled:C,setFocused:w,shouldValidateOnChange:T,validationMode:E,disabled:D,name:O,validation:k}=uw(),{labelId:A}=pw(),j=D||p,M=O??c,N=X(u),P=G.useRef(null),F=ES(P,s,k.inputRef),I=G.useRef(null),L=yC(),ee=_w({id:o,implicit:!1,controlRef:I}),R=l?void 0:ee,[z,B]=yS({controlled:n,default:!!i,name:`Switch`,state:`checked`});dw({id:L,commit:k.commit,value:z,controlRef:I,name:M,getValue:()=>z}),Z(()=>{P.current&&C(P.current.checked)},[P,C]),jw(z,()=>{v(M),x(z!==S.initialValue),C(z),T()?k.commit(z):k.commit(z,!0)});let{getButtonProps:V,buttonRef:H}=JC({disabled:j,native:l}),U=mw(a,A,P,!l,R),W={id:l?ee:L,role:`switch`,"aria-checked":z,"aria-readonly":d||void 0,"aria-required":f||void 0,"aria-labelledby":U,onFocus(){j||w(!0)},onBlur(){let e=P.current;!e||j||(b(!0),w(!1),E===`onBlur`&&k.commit(e.checked))},onClick(e){d||j||(e.preventDefault(),P.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},te=G.useMemo(()=>JS({checked:z,disabled:j,id:R,name:M,required:f,style:M?PS:NS,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,ref:F,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=Aw(vw,e.nativeEvent);N?.(t,n),!n.isCanceled&&B(t)},onFocus(){I.current?.focus()}},k.getInputValidationProps,g===void 0?LS:{value:g}),[z,j,F,R,M,N,f,B,k,g]),ne=G.useMemo(()=>({...y,checked:z,disabled:j,readOnly:d,required:f}),[y,z,j,d,f]),re=lC(`span`,e,{state:ne,ref:[t,I,H],props:[W,k.getValidationProps,_,V],stateAttributesMapping:aw});return(0,K.jsxs)(ZC.Provider,{value:ne,children:[re,!z&&M&&h!==void 0&&(0,K.jsx)(`input`,{type:`hidden`,name:M,value:h}),(0,K.jsx)(`input`,{...te})]})}),Nw=G.forwardRef(function(e,t){let{render:n,className:r,...i}=e,{state:a}=uw(),o=QC();return lC(`span`,e,{state:{...a,...o},ref:t,stateAttributesMapping:aw,props:i})}),Pw=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(Mw,{ref:n,className:Y(`relative w-[34px] h-[18px] bg-border-bright rounded-full cursor-pointer transition data-[checked]:bg-healthy`,e),...t,children:(0,K.jsx)(Nw,{className:`block w-[14px] h-[14px] bg-white rounded-full transition-transform data-[checked]:translate-x-4 absolute top-0.5 left-0.5`})}));Pw.displayName=`Switch`;var Fw=(0,G.forwardRef)(({className:e,enabled:t=!0,onEnabledChange:n,thresholds:r,onThresholdsChange:i,...a},o)=>{function s(e,t){let n=Number(t);Number.isFinite(n)&&i?.({...r,[e]:n})}return(0,K.jsxs)(`div`,{ref:o,className:Y(`bg-panel border border-border rounded-lg hover:border-border-bright transition`,e),...a,children:[(0,K.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-border flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-offline`}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-500 uppercase tracking-widest`,children:`Alerts`})]}),(0,K.jsx)(Pw,{checked:t,onCheckedChange:e=>n?.(e)})]}),(0,K.jsxs)(`div`,{className:`p-4 space-y-3`,children:[(0,K.jsx)(Iw,{label:`P90 latency threshold`,value:r.p90Latency,onChange:e=>s(`p90Latency`,e)}),(0,K.jsx)(Iw,{label:`Error rate threshold`,value:r.errorRate,onChange:e=>s(`errorRate`,e)}),(0,K.jsx)(Iw,{label:`Client lag threshold`,value:r.clientLag,onChange:e=>s(`clientLag`,e)})]})]})});Fw.displayName=`AlertsConfig`;function Iw({label:e,value:t,onChange:n}){return(0,K.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-500`,children:e}),(0,K.jsx)(vS,{variant:`mono`,type:`number`,value:t,onChange:e=>n(e.target.value),className:`w-[100px] text-[11px] px-2 py-1 text-right`})]})}var Lw=gS(`inline-flex items-center gap-1 px-2 py-0.5 rounded-sm font-mono text-[9px] leading-normal uppercase tracking-wider`,{variants:{variant:{default:`bg-white/[0.05] text-neutral-300 border border-border-bright`,destructive:`bg-offline/10 text-offline border border-offline/20`,ghost:`bg-transparent text-neutral-500 border border-border-bright`,outline:`bg-transparent text-neutral-400 border border-border-bright`,secondary:`bg-panel text-neutral-400 border border-border`,healthy:`bg-healthy/10 text-healthy border border-healthy/20`,syncing:`bg-syncing/10 text-syncing border border-syncing/20`,offline:`bg-offline/10 text-offline border border-offline/20`,flow:`bg-flow/10 text-flow border border-flow/20`,relay:`bg-relay/10 text-relay border border-relay/20`}},defaultVariants:{variant:`default`}}),Rw=(0,G.forwardRef)(({className:e,variant:t,style:n,...r},i)=>(0,K.jsx)(`span`,{ref:i,className:Y(Lw({variant:t,className:e})),style:{lineHeight:1,...n},...r}));Rw.displayName=`Badge`;var zw=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`div`,{ref:n,role:`table`,className:Y(`w-full`,e),...t}));zw.displayName=`Table`;var Bw=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`div`,{ref:n,role:`rowgroup`,className:Y(e),...t}));Bw.displayName=`TableHeader`;var Vw=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`div`,{ref:n,role:`rowgroup`,className:Y(e),...t}));Vw.displayName=`TableBody`;var Hw=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`div`,{ref:n,role:`row`,className:Y(`font-mono text-[11px] leading-6 px-4 flex items-center gap-4 border-b border-[#141414] hover:bg-white/[0.015] transition-colors cursor-default`,e),...t}));Hw.displayName=`TableRow`;var Uw=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`div`,{ref:n,role:`columnheader`,className:Y(`min-w-0 font-mono text-[9px] text-neutral-600 uppercase tracking-wider leading-6 bg-white/[0.01] text-left truncate`,e),...t}));Uw.displayName=`TableHead`;var Ww=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`div`,{ref:n,role:`cell`,className:Y(`min-w-0 whitespace-nowrap overflow-hidden text-ellipsis`,e),...t}));Ww.displayName=`TableCell`;var Gw={relay:`relay`,admin:`flow`,proxy:`ghost`},Kw=(0,G.forwardRef)(({className:e,keys:t,onCreateKey:n,onRotateKey:r,onRevokeKey:i,...a},o)=>(0,K.jsx)(`div`,{ref:o,className:Y(`w-full`,e),...a,children:(0,K.jsxs)(zw,{children:[(0,K.jsx)(Bw,{children:(0,K.jsxs)(Hw,{children:[(0,K.jsx)(Uw,{children:`Name`}),(0,K.jsx)(Uw,{children:`Type`}),(0,K.jsx)(Uw,{children:`Prefix`}),(0,K.jsx)(Uw,{children:`Created`})]})}),(0,K.jsx)(Vw,{children:t.map((e,t)=>(0,K.jsxs)(Hw,{className:`group relative`,children:[(0,K.jsx)(Ww,{children:(0,K.jsx)(`span`,{className:`text-white truncate`,children:e.name})}),(0,K.jsx)(Ww,{children:(0,K.jsx)(Rw,{variant:Gw[e.type]??`ghost`,children:e.type})}),(0,K.jsx)(Ww,{children:(0,K.jsx)(`span`,{className:`text-neutral-500 truncate`,children:e.prefix})}),(0,K.jsx)(Ww,{children:(0,K.jsx)(`span`,{className:`text-neutral-600 truncate`,children:e.created})}),(r||i)&&(0,K.jsxs)(`div`,{className:`absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity`,children:[r&&(0,K.jsx)(`button`,{type:`button`,onClick:()=>r(e.name),className:`flex items-center gap-1 px-1.5 py-0.5 rounded text-[9px] text-neutral-600 hover:text-white hover:bg-white/[0.05] cursor-pointer transition-colors`,children:`rotate`}),i&&(0,K.jsx)(`button`,{type:`button`,onClick:()=>i(e.name),className:`flex items-center gap-1 px-1.5 py-0.5 rounded text-[9px] text-neutral-600 hover:text-offline hover:bg-offline/10 cursor-pointer transition-colors`,children:`revoke`})]})]},`${e.name}:${e.prefix}:${t}`))})]})}));Kw.displayName=`ApiKeysTable`;var qw=(0,G.forwardRef)(({className:e,metrics:t=[],uptime:n,isLive:r=!0,...i},a)=>(0,K.jsxs)(`div`,{ref:a,className:Y(`fixed bottom-0 left-0 right-0 z-100 h-8 border-t border-border bg-surface/92 backdrop-blur-lg flex items-center justify-between px-5`,e),...i,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,K.jsx)(`div`,{className:`flex items-center gap-[2px]`,children:[0,.1,.2,.3,.4].map(e=>(0,K.jsx)(`div`,{className:`w-0.5 h-1.5 bg-healthy rounded-sm animate-[heartbeat_1.2s_ease-in-out_infinite]`,style:{animationDelay:`${e}s`}},e))}),r&&(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-healthy uppercase tracking-widest`,children:`Live`})]}),(0,K.jsx)(`div`,{className:`flex items-center gap-6`,children:t.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-neutral-600`,children:e.label}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-300`,children:e.value})]},e.label))}),n!=null&&(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-neutral-600`,children:`UPTIME`}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-400`,children:n})]})]}));qw.displayName=`BottomBar`;var Jw=(0,G.forwardRef)(({className:e,commits:t,onViewAll:n,...r},i)=>(0,K.jsxs)(`div`,{ref:i,className:Y(`px-5 pt-3 pb-2`,e),...r,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-500 uppercase tracking-widest`,children:`Recent Commits`}),n&&(0,K.jsx)(`button`,{type:`button`,onClick:n,className:`inline-flex items-center gap-1.5 rounded-md font-mono text-[9px] px-2 py-0.5 border border-border-bright bg-transparent text-neutral-400 hover:text-white hover:bg-white/[0.03] cursor-pointer transition-all`,children:`View all →`})]}),(0,K.jsxs)(`div`,{className:`font-mono text-[9px] tracking-wider uppercase text-neutral-600 flex items-center gap-4 px-4 leading-[22px] border-b border-border`,children:[(0,K.jsx)(`span`,{className:`w-[60px] truncate`,children:`Seq`}),(0,K.jsx)(`span`,{className:`w-[100px] truncate`,children:`Actor`}),(0,K.jsx)(`span`,{className:`w-[50px] truncate`,children:`Chg`}),(0,K.jsx)(`span`,{className:`flex-1 truncate`,children:`Tables`}),(0,K.jsx)(`span`,{className:`w-[70px] text-right truncate`,children:`Time`})]}),t.map(e=>(0,K.jsxs)(`div`,{className:`font-mono text-[11px] leading-7 px-4 flex items-center gap-4 border-b border-[#141414] hover:bg-white/[0.015] transition-colors cursor-default`,children:[(0,K.jsxs)(`span`,{className:`w-[60px] text-flow font-medium truncate`,children:[`#`,e.seq]}),(0,K.jsx)(`span`,{className:`w-[100px] text-neutral-400 truncate`,children:e.actor}),(0,K.jsx)(`span`,{className:`w-[50px] text-white truncate`,children:e.changes}),(0,K.jsx)(`span`,{className:`flex-1 truncate`,children:(0,K.jsx)(`span`,{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-sm font-mono text-[9px] uppercase tracking-wider bg-transparent text-neutral-500 border border-border-bright`,children:e.tables})}),(0,K.jsx)(`span`,{className:`w-[70px] text-right text-neutral-600 truncate`,children:e.time})]},e.seq))]}));Jw.displayName=`CommitTable`;var Yw=gS(`inline-flex items-center justify-center gap-1.5 rounded-md font-mono transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{default:`border border-border-bright bg-transparent text-neutral-400 hover:text-white hover:bg-white/[0.03]`,primary:`border border-flow bg-flow/10 text-flow hover:bg-flow/20`,destructive:`border border-offline bg-offline/10 text-offline hover:bg-offline/20`,ghost:`border border-transparent bg-transparent text-neutral-400 hover:text-white hover:bg-white/[0.03]`,link:`border border-transparent bg-transparent text-neutral-400 underline underline-offset-4 hover:text-white`,secondary:`border border-border bg-panel text-neutral-400 hover:text-white hover:bg-white/[0.03]`},size:{sm:`text-[10px] px-2.5 py-1`,md:`text-[11px] px-3.5 py-1.5`,icon:`h-8 w-8`}},defaultVariants:{variant:`default`,size:`md`}}),Q=(0,G.forwardRef)(({className:e,variant:t,size:n,...r},i)=>(0,K.jsx)(`button`,{ref:i,className:Y(Yw({variant:t,size:n,className:e})),...r}));Q.displayName=`Button`;var Xw=(0,G.forwardRef)(({className:e,isConnected:t=!1,isConnecting:n=!1,isTestingConnection:r=!1,serverUrl:i,onServerUrlChange:a,consoleToken:o,onConsoleTokenChange:s,onSaveAndConnect:c,onDisconnect:l,onTestConnection:u,statusMessage:d,...f},p)=>(0,K.jsxs)(`div`,{ref:p,className:Y(`bg-panel border border-border rounded-lg hover:border-border-bright transition`,e),...f,children:[(0,K.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-border flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:Y(`w-1.5 h-1.5 rounded-full`,t?`bg-healthy`:`bg-offline`),style:t?{boxShadow:`0 0 4px #22c55e`}:void 0}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-500 uppercase tracking-widest`,children:`Connection`})]}),(0,K.jsx)(Rw,{variant:t?`healthy`:`offline`,children:t?`Connected`:`Disconnected`})]}),(0,K.jsxs)(`div`,{className:`p-5 space-y-4`,children:[(0,K.jsx)(`p`,{className:`font-mono text-[10px] text-neutral-500`,children:`Configure the server endpoint and authentication token.`}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`console-server-url`,className:`font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5`,children:`Server URL`}),(0,K.jsx)(vS,{id:`console-server-url`,variant:`mono`,value:i,onChange:e=>a?.(e.target.value)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`label`,{htmlFor:`console-token`,className:`font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5`,children:`Console Token`}),(0,K.jsx)(vS,{id:`console-token`,variant:`mono`,type:`password`,value:o,onChange:e=>s?.(e.target.value)})]}),(0,K.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,K.jsx)(Q,{variant:`primary`,size:`md`,onClick:c,disabled:n,children:n?`Connecting...`:`Save + Connect`}),(0,K.jsx)(Q,{variant:`default`,size:`md`,onClick:u,disabled:n||r,children:r?`Testing...`:`Test Connection`}),(0,K.jsx)(Q,{variant:`destructive`,size:`md`,onClick:l,disabled:!t,children:`Disconnect`})]}),d&&(0,K.jsx)(`div`,{className:Y(`font-mono text-[10px]`,t?`text-healthy`:`text-offline`),children:d})]})]}));Xw.displayName=`ConnectionForm`;var Zw=gS(`animate-spin text-neutral-500`,{variants:{size:{sm:`h-3 w-3`,md:`h-5 w-5`,lg:`h-8 w-8`}},defaultVariants:{size:`md`}}),Qw=(0,G.forwardRef)(({className:e,size:t,...n},r)=>(0,K.jsxs)(`svg`,{ref:r,className:Y(Zw({size:t,className:e})),xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 24 24`,...n,children:[(0,K.jsx)(`circle`,{className:`opacity-25`,cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`4`}),(0,K.jsx)(`path`,{className:`opacity-75`,fill:`currentColor`,d:`M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z`})]}));Qw.displayName=`Spinner`;function $w({className:e,state:t}){switch(t){case`connected`:return(0,K.jsx)(Rw,{variant:`healthy`,className:e,children:`Connected`});case`disconnected`:return(0,K.jsx)(Rw,{variant:`destructive`,className:e,children:`Disconnected`});case`connecting`:return(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs text-neutral-400`,children:[(0,K.jsx)(Qw,{size:`sm`}),`Connecting`]});case`not-configured`:return(0,K.jsx)(Rw,{variant:`ghost`,className:e,children:`Not configured`})}}var eT=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`div`,{ref:n,className:Y(`bg-panel border border-border rounded-lg hover:border-border-bright transition`,e),...t}));eT.displayName=`Card`;var tT=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`div`,{ref:n,className:Y(`px-4 py-2.5 border-b border-border flex items-center justify-between`,e),...t}));tT.displayName=`CardHeader`;var nT=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`h3`,{ref:n,className:Y(`font-mono text-[10px] text-neutral-500 uppercase tracking-widest`,e),...t}));nT.displayName=`CardTitle`;var rT=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`div`,{ref:n,className:Y(`p-4`,e),...t}));rT.displayName=`CardContent`;var iT=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`div`,{ref:n,className:Y(`px-4 py-2.5 border-t border-border`,e),...t}));iT.displayName=`CardFooter`;function aT({action:e,className:t,icon:n,message:r}){return(0,K.jsxs)(`div`,{className:Y(`flex flex-col items-center justify-center gap-3 py-12`,t),children:[n?(0,K.jsx)(`div`,{className:`text-neutral-500`,children:n}):null,(0,K.jsx)(`p`,{className:`font-mono text-[10px] text-neutral-500`,children:r}),e?(0,K.jsx)(`div`,{children:e}):null]})}var oT=(0,G.forwardRef)(({className:e,groups:t,searchValue:n,searchPlaceholder:r=`Filter by client or actor...`,onSearchChange:i,actions:a,...o},s)=>(0,K.jsxs)(`div`,{ref:s,className:Y(`px-5 py-3 border-b border-border flex items-center gap-4 flex-wrap`,e),...o,children:[t.map((e,t)=>(0,K.jsx)(sT,{group:e,showDivider:t>0},t)),i!==void 0&&(0,K.jsx)(`input`,{className:`bg-surface border border-border rounded-md font-mono text-[10px] text-foreground outline-none transition focus:border-flow placeholder:text-neutral-600 max-w-[200px] px-2.5 py-1`,placeholder:r,value:n,onChange:e=>i(e.target.value)}),a&&(0,K.jsx)(`div`,{className:`ml-auto flex items-center gap-2`,children:a})]}));oT.displayName=`FilterBar`;function sT({group:e,showDivider:t}){return(0,K.jsxs)(K.Fragment,{children:[t&&(0,K.jsx)(`div`,{className:`w-px h-4 bg-border`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[e.label&&(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-neutral-500 mr-1`,children:e.label}),e.options.map(t=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>e.onActiveChange(t.id),className:Y(`font-mono text-[10px] border rounded-sm px-2.5 py-0.5 cursor-pointer transition-all`,t.id===e.activeId?`text-white border-border-bright bg-white/[0.03]`:`text-neutral-500 border-transparent hover:text-neutral-300`),children:t.label},t.id))]})]})}function cT(e){return e===0?`#22c55e`:e<10?`#f59e0b`:e<50?`#f97316`:`#ef4444`}var lT={online:`healthy`,syncing:`syncing`,offline:`offline`},uT={realtime:`flow`,polling:`ghost`},dT=(0,G.forwardRef)(({className:e,client:t,headSeq:n,onEvict:r,...i},a)=>{let o=Math.max(0,n-t.cursor),s=Math.min(100,t.cursor/n*100),c=cT(o);return(0,K.jsxs)(`div`,{ref:a,className:Y(`bg-panel border border-border rounded-lg hover:border-border-bright transition`,e),style:{borderLeft:`3px solid ${c}`},...i,children:[(0,K.jsxs)(`div`,{className:`px-3.5 py-2 border-b border-border flex items-center justify-between`,children:[(0,K.jsx)(`div`,{className:`flex items-center gap-2 min-w-0`,children:(0,K.jsx)(`span`,{className:`font-mono text-[11px] text-white truncate`,title:t.id,children:t.id.length>14?`${t.id.substring(0,14)}\u2026`:t.id})}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5 flex-shrink-0`,children:[(0,K.jsx)(Rw,{variant:lT[t.status],children:t.status}),(0,K.jsx)(Rw,{variant:uT[t.mode],children:t.mode})]})]}),(0,K.jsxs)(`div`,{className:`p-3 space-y-3`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between mb-1`,children:[(0,K.jsxs)(`span`,{className:`font-mono text-[9px] text-neutral-600`,children:[`#`,t.cursor.toLocaleString()]}),(0,K.jsxs)(`span`,{className:`font-mono text-[9px] text-neutral-600`,children:[`#`,n.toLocaleString()]})]}),(0,K.jsx)(`div`,{className:`h-1 rounded-full bg-surface`,children:(0,K.jsx)(`div`,{className:`h-full rounded-full transition-all`,style:{width:`${s}%`,background:c}})}),(0,K.jsx)(`div`,{className:`font-mono text-[9px] mt-1`,style:{color:c},children:o===0?`Caught up`:`${o} behind`})]}),(0,K.jsxs)(`div`,{className:`space-y-1`,children:[(0,K.jsx)(fT,{label:`Actor`,value:t.actor}),(0,K.jsx)(fT,{label:`Dialect`,value:t.dialect}),(0,K.jsx)(fT,{label:`Last seen`,value:t.lastSeen}),(0,K.jsxs)(`div`,{className:`flex justify-between items-start`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-neutral-600`,children:`Scopes`}),(0,K.jsxs)(`div`,{className:`flex gap-1 flex-wrap justify-end`,children:[t.scopes.slice(0,2).map(e=>(0,K.jsx)(Rw,{variant:`ghost`,children:e},e)),t.scopes.length>2&&(0,K.jsxs)(`span`,{className:`font-mono text-[9px] text-neutral-600`,children:[`+`,t.scopes.length-2]})]})]})]}),r&&(0,K.jsxs)(`button`,{type:`button`,onClick:r,className:`w-full inline-flex items-center justify-center gap-1.5 rounded-md font-mono text-[9px] px-2 py-1 border border-offline/25 bg-offline/[0.04] text-offline hover:border-offline hover:bg-offline/[0.08] cursor-pointer transition-all`,children:[(0,K.jsxs)(`svg`,{className:`w-3 h-3`,fill:`none`,stroke:`currentColor`,strokeWidth:2,viewBox:`0 0 24 24`,children:[(0,K.jsx)(`path`,{d:`M18.36 6.64a9 9 0 11-12.73 0`}),(0,K.jsx)(`line`,{x1:`12`,y1:`2`,x2:`12`,y2:`12`})]}),`Evict`]})]})]})});dT.displayName=`FleetCard`;function fT({label:e,value:t}){return(0,K.jsxs)(`div`,{className:`flex justify-between`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-neutral-600`,children:e}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-400`,children:t})]})}var pT=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),mT=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),hT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),gT=e=>{let t=hT(e);return t.charAt(0).toUpperCase()+t.slice(1)},_T={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},vT=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},yT=(0,G.createContext)({}),bT=()=>(0,G.useContext)(yT),xT=(0,G.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=bT()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,G.createElement)(`svg`,{ref:c,..._T,width:t??l??_T.width,height:t??l??_T.height,stroke:e??f,strokeWidth:m,className:pT(`lucide`,p,i),...!a&&!vT(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,G.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),ST=(e,t)=>{let n=(0,G.forwardRef)(({className:n,...r},i)=>(0,G.createElement)(xT,{ref:i,iconNode:t,className:pT(`lucide-${mT(gT(e))}`,`lucide-${e}`,n),...r}));return n.displayName=gT(e),n},CT=ST(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),wT=ST(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),TT=ST(`user-x`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`17`,x2:`22`,y1:`8`,y2:`13`,key:`3nzzx3`}],[`line`,{x1:`22`,x2:`17`,y1:`8`,y2:`13`,key:`1swrse`}]]);function ET(e){return e===0?`#22c55e`:e<10?`#f59e0b`:e<50?`#f97316`:`#ef4444`}var DT={online:`healthy`,syncing:`syncing`,offline:`offline`},OT=(0,G.forwardRef)(({className:e,clients:t,headSeq:n,onEvict:r,...i},a)=>(0,K.jsx)(`div`,{ref:a,className:Y(`w-full`,e),...i,children:(0,K.jsxs)(zw,{children:[(0,K.jsx)(Bw,{children:(0,K.jsxs)(Hw,{children:[(0,K.jsx)(Uw,{className:`w-[160px]`,children:`Client`}),(0,K.jsx)(Uw,{className:`w-[70px]`,children:`Status`}),(0,K.jsx)(Uw,{className:`w-[60px]`,children:`Type`}),(0,K.jsx)(Uw,{className:`w-[80px]`,children:`Cursor`}),(0,K.jsx)(Uw,{className:`w-[110px]`,children:`Lag`}),(0,K.jsx)(Uw,{className:`w-[60px]`,children:`Dialect`}),(0,K.jsx)(Uw,{className:`flex-1`,children:`Mode`})]})}),(0,K.jsx)(Vw,{children:t.map(e=>{let t=Math.max(0,n-e.cursor),i=n>0?Math.min(100,e.cursor/n*100):100,a=ET(t);return(0,K.jsxs)(Hw,{className:`group relative`,children:[(0,K.jsx)(Ww,{className:`w-[160px]`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full flex-shrink-0`,style:{background:a,boxShadow:`0 0 4px ${a}`}}),(0,K.jsx)(`span`,{className:`font-mono text-[11px] text-white truncate`,title:e.id,children:e.id.length>18?`${e.id.substring(0,18)}\u2026`:e.id})]})}),(0,K.jsx)(Ww,{className:`w-[70px]`,children:(0,K.jsx)(Rw,{variant:DT[e.status],children:e.status})}),(0,K.jsx)(Ww,{className:`w-[60px]`,children:(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-400`,children:e.type})}),(0,K.jsx)(Ww,{className:`w-[80px]`,children:(0,K.jsxs)(`span`,{className:`font-mono text-[11px] text-white font-medium`,children:[`#`,e.cursor.toLocaleString()]})}),(0,K.jsx)(Ww,{className:`w-[110px]`,children:(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`div`,{className:`w-[60px] h-[3px] rounded-full bg-surface overflow-hidden`,children:(0,K.jsx)(`div`,{className:`h-full rounded-full transition-all`,style:{width:`${i}%`,background:a}})}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] font-medium`,style:{color:a},children:t===0?`0`:`${t}`})]})}),(0,K.jsx)(Ww,{className:`w-[60px]`,children:(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-400`,children:e.dialect})}),(0,K.jsx)(Ww,{className:`flex-1`,children:(0,K.jsx)(Rw,{variant:e.mode===`realtime`?`flow`:`ghost`,children:e.mode})}),r&&(0,K.jsxs)(`button`,{type:`button`,title:`Evict client`,onClick:()=>r(e.id),className:`absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1 px-1.5 py-0.5 rounded text-[9px] text-neutral-600 hover:text-offline hover:bg-offline/10 cursor-pointer transition-colors opacity-0 group-hover:opacity-100`,children:[(0,K.jsx)(TT,{size:10}),`evict`]})]},e.id)})})]})}));OT.displayName=`FleetTable`;var kT=(0,G.forwardRef)(({className:e,handlers:t,tableCount:n,...r},i)=>{let a=n??t.length;return(0,K.jsxs)(`div`,{ref:i,className:Y(`bg-panel border border-border rounded-lg hover:border-border-bright transition`,e),...r,children:[(0,K.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-border flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-flow`}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-500 uppercase tracking-widest`,children:`Handlers`})]}),(0,K.jsxs)(`span`,{className:`font-mono text-[10px] text-neutral-600`,children:[a,` tables`]})]}),(0,K.jsxs)(`div`,{className:`font-mono text-[9px] tracking-wider uppercase text-neutral-600 flex items-center gap-4 px-4 leading-6 border-b border-border`,children:[(0,K.jsx)(`span`,{className:`flex-1`,children:`Table`}),(0,K.jsx)(`span`,{className:`w-[100px]`,children:`Depends On`}),(0,K.jsx)(`span`,{className:`w-[70px] text-right`,children:`Chunk TTL`})]}),t.map((e,n)=>(0,K.jsxs)(`div`,{className:Y(`font-mono text-[11px] leading-7 px-4 flex items-center gap-4 hover:bg-white/[0.015] transition-colors cursor-default`,n<t.length-1&&`border-b border-[#141414]`),children:[(0,K.jsx)(`span`,{className:`flex-1 text-white truncate`,children:e.table}),(0,K.jsx)(`span`,{className:`w-[100px] truncate`,children:e.dependsOn?(0,K.jsx)(Rw,{variant:`ghost`,children:e.dependsOn}):(0,K.jsx)(`span`,{className:`text-neutral-600`,children:`—`})}),(0,K.jsx)(`span`,{className:`w-[70px] text-right text-neutral-500 truncate`,children:e.chunkTtl})]},`${e.table}:${n}`))]})});kT.displayName=`HandlersTable`;var AT={flow:`bg-flow`,healthy:`bg-healthy`,syncing:`bg-syncing`,offline:`bg-offline`,relay:`bg-relay`,muted:`bg-neutral-500`},jT=(0,G.forwardRef)(({className:e,items:t,...n},r)=>(0,K.jsx)(`div`,{ref:r,className:Y(`border-b border-border px-6 py-3 flex items-center justify-between flex-wrap gap-4`,`bg-[linear-gradient(to_bottom,rgba(17,17,17,0.8),#0c0c0c)]`,e),...n,children:t.map((e,t)=>(0,K.jsx)(MT,{item:e,showDivider:t>0},e.label))}));jT.displayName=`KpiStrip`;function MT({item:e,showDivider:t}){let n=AT[e.color??`muted`]??`bg-neutral-500`;return(0,K.jsxs)(K.Fragment,{children:[t&&(0,K.jsx)(`div`,{className:`w-px h-4 bg-border`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:Y(`w-1.5 h-1.5 rounded-full`,n)}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-500 uppercase`,children:e.label}),(0,K.jsxs)(`span`,{className:`font-mono text-sm text-white font-semibold`,children:[e.value,e.unit&&(0,K.jsx)(`span`,{className:`text-xs text-neutral-600`,children:e.unit})]}),e.trend&&(0,K.jsx)(`span`,{className:Y(`font-mono text-[10px]`,e.trend.startsWith(`+`)?`text-healthy`:`text-offline`),children:e.trend})]})]})}var NT=(0,G.forwardRef)(({className:e,buckets:t,successRate:n=99.6,successLabel:r=`success`,...i},a)=>{let o=n/100*88,s=88-o;return(0,K.jsxs)(`div`,{ref:a,className:Y(`px-5 py-3 border-b border-border flex items-center gap-8`,e),...i,children:[(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-500 uppercase tracking-widest`,children:`Latency`}),(0,K.jsx)(`div`,{className:`flex items-center gap-6`,children:t.map(e=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-neutral-500`,children:e.label}),(0,K.jsxs)(`div`,{className:`flex gap-1 items-end h-5`,children:[(0,K.jsx)(`div`,{className:`w-3 rounded-t bg-healthy/60`,style:{height:`${e.pushBarPercent}%`}}),(0,K.jsx)(`div`,{className:`w-3 rounded-t bg-flow/60`,style:{height:`${e.pullBarPercent}%`}})]}),(0,K.jsxs)(`span`,{className:`font-mono text-[10px] text-neutral-400`,children:[e.pushMs,` / `,e.pullMs,`ms`]})]},e.label))}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2 ml-auto`,children:[(0,K.jsxs)(`svg`,{viewBox:`0 0 36 36`,className:`w-7 h-7`,children:[(0,K.jsx)(`circle`,{cx:18,cy:18,r:14,fill:`none`,stroke:`#1e1e1e`,strokeWidth:4}),(0,K.jsx)(`circle`,{cx:18,cy:18,r:14,fill:`none`,stroke:`#22c55e`,strokeWidth:4,strokeDasharray:`${o} ${s}`,transform:`rotate(-90 18 18)`,strokeLinecap:`round`})]}),(0,K.jsxs)(`span`,{className:`font-mono text-[10px] text-neutral-400`,children:[n,`%`,` `,(0,K.jsx)(`span`,{className:`text-neutral-600`,children:r})]})]})]})});NT.displayName=`LatencyPercentilesBar`;var PT={PUSH:`syncing`,PULL:`healthy`,ACK:`flow`},FT=(0,G.forwardRef)(({className:e,entries:t,isConnected:n=!0,maxVisible:r=20,maxHeight:i,...a},o)=>{let s=t.slice(0,r);return(0,K.jsxs)(`div`,{ref:o,className:Y(`flex-shrink-0`,e),style:{width:360},...a,children:[(0,K.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-border flex items-center justify-between`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-500 uppercase tracking-widest`,children:`Live Feed`}),(0,K.jsx)(`span`,{className:Y(`w-1.5 h-1.5 rounded-full`,n?`bg-healthy animate-[dotPulse_1.5s_ease-in-out_infinite]`:`bg-neutral-600`)})]}),(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-neutral-600`,children:n?`WebSocket`:`Disconnected`})]}),(0,K.jsx)(`div`,{className:`px-3 py-2 space-y-0.5 overflow-y-auto`,style:i?{maxHeight:i}:void 0,children:s.length===0?(0,K.jsx)(`div`,{className:`flex items-center justify-center h-[200px]`,children:(0,K.jsx)(`p`,{className:`text-neutral-500 text-sm font-mono`,children:n?`Waiting for activity...`:`Connect to see live activity`})}):s.map((e,t)=>(0,K.jsxs)(`div`,{className:`flex items-center gap-2 py-1 animate-[streamSlide_0.35s_ease-out]`,children:[(0,K.jsx)(Rw,{variant:PT[e.type]??`ghost`,className:`text-[8px] px-1.5 py-0`,children:e.type}),(0,K.jsxs)(`span`,{className:`font-mono text-[10px] text-neutral-400 truncate flex-1`,children:[e.actor,` · `,e.table]}),(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-neutral-600`,children:e.time})]},`${e.time}-${t}`))})]})});FT.displayName=`LiveActivityFeed`;var IT={syncing:`bg-syncing`,flow:`bg-flow`,healthy:`bg-healthy`,offline:`bg-offline`},LT=(0,G.forwardRef)(({className:e,title:t,description:n,dotColor:r=`syncing`,stats:i,actionLabel:a,actionVariant:o=`default`,actionIcon:s,onAction:c,...l},u)=>(0,K.jsxs)(`div`,{ref:u,className:Y(`bg-panel border border-border rounded-lg hover:border-border-bright transition`,e),...l,children:[(0,K.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-border flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:Y(`w-1.5 h-1.5 rounded-full`,IT[r])}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-500 uppercase tracking-widest`,children:t})]}),(0,K.jsxs)(`div`,{className:`p-4`,children:[(0,K.jsx)(`p`,{className:`font-mono text-[10px] text-neutral-500 leading-relaxed mb-4`,children:n}),(0,K.jsx)(`div`,{className:Y(`grid gap-3 mb-4`,i.length<=2?`grid-cols-2`:`grid-cols-3`),children:i.map(e=>(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`div`,{className:`font-mono text-[9px] text-neutral-600 uppercase tracking-wider mb-1`,children:e.label}),(0,K.jsx)(`div`,{className:Y(`font-mono font-semibold`,e.tone===`syncing`?`text-sm text-syncing`:`text-lg text-white`),children:e.value})]},e.label))}),(0,K.jsxs)(Q,{variant:o,size:`md`,onClick:c,children:[s,a]})]})]}));LT.displayName=`MaintenanceCard`;function RT({actions:e,children:t,className:n,contentClassName:r,description:i,title:a}){return(0,K.jsxs)(eT,{className:Y(`border-border`,n),children:[a||e?(0,K.jsxs)(`div`,{className:`flex items-start justify-between px-4 pt-4`,children:[(0,K.jsxs)(`div`,{children:[a?(0,K.jsx)(`h3`,{className:`font-mono text-[10px] text-neutral-500 uppercase tracking-widest`,children:a}):null,i?(0,K.jsx)(`p`,{className:`mt-1 font-mono text-[10px] text-neutral-500`,children:i}):null]}),e?(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:e}):null]}):null,(0,K.jsx)(rT,{className:r,children:t})]})}var zT=(0,G.forwardRef)(({className:e,rows:t,onResetDefaults:n,...r},i)=>(0,K.jsxs)(`div`,{ref:i,className:Y(`bg-panel border border-border rounded-lg hover:border-border-bright transition`,e),...r,children:[(0,K.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-border flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-500 uppercase tracking-widest`,children:`Preferences`}),n&&(0,K.jsx)(Q,{variant:`default`,size:`sm`,onClick:n,children:`Reset defaults`})]}),(0,K.jsx)(`div`,{className:`p-4 space-y-4`,children:t.map((e,t)=>(0,K.jsx)(BT,{row:e,showDivider:t>0},e.label))})]}));zT.displayName=`PreferencesPanel`;function BT({row:e,showDivider:t}){return(0,K.jsxs)(K.Fragment,{children:[t&&(0,K.jsx)(`div`,{className:`border-t border-border`}),(0,K.jsx)(`div`,{className:`flex items-center justify-between`,children:e.type===`filter`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`font-mono text-[11px] text-neutral-400`,children:e.label}),(0,K.jsx)(`div`,{className:`flex gap-0.5`,children:e.options.map(t=>(0,K.jsx)(`button`,{type:`button`,onClick:()=>e.onActiveChange(t.id),className:Y(`font-mono text-[10px] border rounded-sm px-2.5 py-0.5 cursor-pointer transition-all`,t.id===e.activeId?`text-white border-border-bright bg-white/[0.03]`:`text-neutral-500 border-transparent hover:text-neutral-300`),children:t.label},t.id))})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`font-mono text-[11px] text-neutral-400`,children:e.label}),e.description&&(0,K.jsx)(`p`,{className:`font-mono text-[9px] text-neutral-600 mt-0.5`,children:e.description})]}),(0,K.jsx)(Pw,{checked:e.checked,onCheckedChange:t=>e.onCheckedChange(t)})]})})]})}function VT({actions:e,children:t,className:n,contentClassName:r,description:i,title:a}){return(0,K.jsxs)(eT,{className:n,children:[a||e?(0,K.jsxs)(`div`,{className:`flex items-start justify-between px-4 pt-4`,children:[(0,K.jsxs)(`div`,{children:[a?(0,K.jsx)(`h3`,{className:`font-mono text-[10px] text-neutral-500 uppercase tracking-widest`,children:a}):null,i?(0,K.jsx)(`p`,{className:`mt-1 font-mono text-[10px] text-neutral-500`,children:i}):null]}),e?(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:e}):null]}):null,(0,K.jsx)(rT,{className:r,children:t})]})}var HT={commit:`text-flow`,push:`text-syncing`,pull:`text-healthy`},UT={applied:`text-healthy`,error:`text-offline`,cached:`text-syncing`},WT=(0,G.forwardRef)(({className:e,entries:t,filterBar:n,pagination:r,onEntryClick:i,selectedEntryId:a,...o},s)=>(0,K.jsxs)(`div`,{ref:s,className:Y(`h-full flex flex-col`,e),...o,children:[n,(0,K.jsxs)(`div`,{className:`font-mono text-[9px] tracking-wider uppercase text-neutral-600 flex items-center gap-4 px-4 leading-6 border-b border-border bg-white/[0.01]`,children:[(0,K.jsx)(`span`,{className:`w-[50px] truncate`,children:`Time`}),(0,K.jsx)(`span`,{className:`w-[65px] truncate`,children:`Type`}),(0,K.jsx)(`span`,{className:`w-[55px] truncate`,children:`ID`}),(0,K.jsx)(`span`,{className:`w-[65px] truncate`,children:`Outcome`}),(0,K.jsx)(`span`,{className:`w-[50px] truncate`,children:`Dur`}),(0,K.jsx)(`span`,{className:`w-[100px] truncate`,children:`Actor`}),(0,K.jsx)(`span`,{className:`w-[120px] truncate`,children:`Client`}),(0,K.jsx)(`span`,{className:`flex-1 truncate`,children:`Detail`})]}),(0,K.jsx)(`div`,{className:`flex-1 overflow-y-auto`,children:t.map((e,t)=>(0,K.jsx)(GT,{entry:e,isSelected:a===e.id,onClick:i},`${e.id}-${t}`))}),r]}));WT.displayName=`StreamLog`;function GT({entry:e,isSelected:t,onClick:n}){let r=HT[e.type]??`text-neutral-500`,i=UT[e.outcome]??`text-neutral-600`,a=Y(`font-mono text-[11px] leading-7 px-4 flex items-center gap-4 border-b border-[#141414] hover:bg-white/[0.015] transition-colors`,n?`cursor-pointer`:`cursor-default`,t&&`bg-white/[0.05]`),o=(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`w-[50px] text-neutral-600 truncate`,children:e.time}),(0,K.jsx)(`span`,{className:Y(`w-[65px] font-medium truncate`,r),children:e.type.toUpperCase()}),(0,K.jsx)(`span`,{className:`w-[55px] text-flow truncate`,children:e.id}),(0,K.jsx)(`span`,{className:Y(`w-[65px] truncate`,i),children:e.outcome}),(0,K.jsx)(`span`,{className:`w-[50px] text-neutral-500 truncate`,children:e.duration}),(0,K.jsx)(`span`,{className:`w-[100px] text-neutral-400 truncate`,children:e.actor}),(0,K.jsx)(`span`,{className:`w-[120px] text-neutral-600 truncate`,title:e.client,children:e.client.length>14?`${e.client.substring(0,14)}\u2026`:e.client}),(0,K.jsx)(`span`,{className:`flex-1 text-neutral-500 truncate`,children:e.detail})]});return n?(0,K.jsx)(`button`,{type:`button`,className:Y(a,`w-full bg-transparent text-left`),onClick:()=>n(e),children:o}):(0,K.jsx)(`div`,{className:a,children:o})}function KT(e){return e===`online`?`#22c55e`:e===`syncing`?`#f59e0b`:`#ef4444`}var qT=(0,G.forwardRef)(({className:e,clients:t,headSeq:n,maxLag:r,minSeq:i,...a},o)=>{let s=t.map(e=>e.cursor),c=i??Math.min(...s,n)-10,l=r??Math.max(...t.map(e=>n-e.cursor),0),u=n-c,d=[c,Math.round(c+u*.33),Math.round(c+u*.66),n];return(0,K.jsxs)(`div`,{ref:o,className:Y(`bg-panel border border-border rounded-lg hover:border-border-bright transition`,e),...a,children:[(0,K.jsxs)(`div`,{className:`px-4 py-2.5 border-b border-border flex items-center justify-between`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-500 uppercase tracking-widest`,children:`Sync Horizon`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-500`,children:`Head`}),(0,K.jsxs)(`span`,{className:`font-mono text-xs text-white font-semibold`,children:[`#`,n.toLocaleString()]})]}),(0,K.jsx)(`div`,{className:`w-px h-3 bg-border`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-500`,children:`Max lag`}),(0,K.jsx)(`span`,{className:`font-mono text-xs text-syncing font-semibold`,children:l})]})]})]}),(0,K.jsxs)(`div`,{className:`p-4`,children:[(0,K.jsxs)(`div`,{className:`relative h-8 mb-3 rounded bg-surface`,children:[(0,K.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-between px-2`,children:d.map(e=>(0,K.jsxs)(`span`,{className:`font-mono text-[8px] text-neutral-700`,children:[`#`,e.toLocaleString()]},e))}),(0,K.jsx)(`div`,{className:`absolute top-0 bottom-0 w-px bg-flow/40`,style:{right:`2%`}}),t.map(e=>{let t=u>0?(e.cursor-c)/u*96+2:50,n=KT(e.status),r=e.status===`offline`?.4:1;return(0,K.jsx)(`div`,{className:`absolute`,style:{left:`${t}%`,top:`50%`,transform:`translate(-50%,-50%)`,opacity:r},title:`${e.id} \u2192 #${e.cursor}`,children:(0,K.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-full`,style:{background:n,boxShadow:`0 0 4px ${n}`}})},e.id)})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-healthy`}),(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-neutral-500`,children:`Caught up`})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-syncing`}),(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-neutral-500`,children:`Behind`})]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,K.jsx)(`span`,{className:`w-2 h-2 rounded-full bg-offline opacity-50`}),(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-neutral-500`,children:`Offline`})]})]})]})]})});qT.displayName=`SyncHorizon`;var JT=[],YT=void 0;function XT(){return YT}function ZT(e){JT.push(e)}function QT(e){let t=(t,n)=>{let r=xS(eE).current,i;try{YT=r;for(let e of JT)e.before(r);i=e(t,n);for(let e of JT)e.after(r);r.didInitialize=!0}finally{YT=void 0}return i};return t.displayName=e.displayName||e.name,t}function $T(e){return G.forwardRef(QT(e))}function eE(){return{didInitialize:!1}}function tE(e){let t=G.useRef(!0);t.current&&(t.current=!1,e())}var nE=G.createContext(void 0);function rE(e){let t=G.useContext(nE);if(t===void 0&&!e)throw Error(zS(72));return t}var iE=[];function aE(e){G.useEffect(e,iE)}var oE=0,sE=class e{static create(){return new e}currentId=oE;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=oE,t()},e)}isStarted(){return this.currentId!==oE}clear=()=>{this.currentId!==oE&&(clearTimeout(this.currentId),this.currentId=oE)};disposeEffect=()=>this.clear};function cE(){let e=xS(sE.create).current;return aE(e.disposeEffect),e}var lE=typeof navigator<`u`,uE=yE(),dE=xE(),fE=bE(),pE=typeof CSS>`u`||!CSS.supports?!1:CSS.supports(`-webkit-backdrop-filter:none`),mE=uE.platform===`MacIntel`&&uE.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(uE.platform);lE&&/firefox/i.test(fE);var hE=lE&&/apple/i.test(navigator.vendor);lE&&/Edg/i.test(fE);var gE=lE&&/android/i.test(dE)||/android/i.test(fE),_E=lE&&dE.toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints,vE=fE.includes(`jsdom/`);function yE(){if(!lE)return{platform:``,maxTouchPoints:-1};let e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??-1}}function bE(){if(!lE)return``;let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(` `):navigator.userAgent}function xE(){if(!lE)return``;let e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??``}var SE=`data-base-ui-focusable`,CE=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function wE(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function TE(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&DC(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function EE(e,t){if(!TC(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(`data-trigger-disabled`);for(let[,e]of t.entries())if(TE(e,n))return!e.hasAttribute(`data-trigger-disabled`);return!1}function DE(e){return`composedPath`in e?e.composedPath()[0]:e.target}function OE(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function kE(e){return e.matches(`html,body`)}function AE(e){return EC(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function jE(e){return e?e.getAttribute(`role`)===`combobox`&&AE(e):!1}function ME(e){if(!e||vE)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function NE(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function PE(e,t,n=!0){return e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...PE(e,t.id,n)])}function FE(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function IE(e){e.preventDefault(),e.stopPropagation()}function LE(e){return`nativeEvent`in e}function RE(e){return e.pointerType===``&&e.isTrusted?!0:gE&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function zE(e){return vE?!1:!gE&&e.width===0&&e.height===0||gE&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function BE(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function VE(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var HE=[`top`,`right`,`bottom`,`left`],UE=Math.min,WE=Math.max,GE=Math.round,KE=Math.floor,qE=e=>({x:e,y:e}),JE={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function YE(e,t,n){return WE(e,UE(t,n))}function XE(e,t){return typeof e==`function`?e(t):e}function ZE(e){return e.split(`-`)[0]}function QE(e){return e.split(`-`)[1]}function $E(e){return e===`x`?`y`:`x`}function eD(e){return e===`y`?`height`:`width`}function tD(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function nD(e){return $E(tD(e))}function rD(e,t,n){n===void 0&&(n=!1);let r=QE(e),i=nD(e),a=eD(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=fD(o)),[o,fD(o)]}function iD(e){let t=fD(e);return[aD(e),t,aD(t)]}function aD(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var oD=[`left`,`right`],sD=[`right`,`left`],cD=[`top`,`bottom`],lD=[`bottom`,`top`];function uD(e,t,n){switch(e){case`top`:case`bottom`:return n?t?sD:oD:t?oD:sD;case`left`:case`right`:return t?cD:lD;default:return[]}}function dD(e,t,n,r){let i=QE(e),a=uD(ZE(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(aD)))),a}function fD(e){let t=ZE(e);return JE[t]+e.slice(t.length)}function pD(e){return{top:0,right:0,bottom:0,left:0,...e}}function mD(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:pD(e)}function hD(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function gD(e,t,n){return Math.floor(e/t)!==n}function _D(e,t){return t<0||t>=e.current.length}function vD(e,t){return bD(e,{disabledIndices:t})}function yD(e,t){return bD(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function bD(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.current.length-1&&TD(e,a,r));return a}function xD(e,{event:t,orientation:n,loopFocus:r,rtl:i,cols:a,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:l,stopEvent:u=!1}){let d=l,f;if(t.key===`ArrowUp`?f=`up`:t.key===`ArrowDown`&&(f=`down`),f){let n=[],i=[],p=!1,m=0;{let t=null,r=-1;e.current.forEach((e,a)=>{if(e==null)return;m+=1;let o=e.closest(`[role="row"]`);o&&(p=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(a),i[a]=r})}let h=!1,g=0;if(p)for(let e of n){let t=e.length;t>g&&(g=t),t!==a&&(h=!0)}let _=h&&m<e.current.length,v=g||a,y=t=>{if(!h||l===-1)return;let a=i[l];if(a==null)return;let s=n[a].indexOf(l),c=t===`up`?-1:1;for(let t=a+c,i=0;i<n.length;i+=1,t+=c){if(t<0||t>=n.length){if(!r||_)return;t=t<0?n.length-1:0}let i=n[t];for(let t=Math.min(s,i.length-1);t>=0;--t){let n=i[t];if(!TD(e,n,o))return n}}},b=t=>{if(!_||l===-1)return;let n=l%v,i=t===`up`?-v:v,a=c-c%v,s=KE(c/v)+1;for(let t=l-n+i,u=0;u<s;u+=1,t+=i){if(t<0||t>c){if(!r)return;t=t<0?a:0}let i=Math.min(t+v-1,c);for(let r=Math.min(t+n,i);r>=t;--r)if(!TD(e,r,o))return r}};u&&IE(t);let x=y(f)??b(f);if(x!==void 0)d=x;else if(l===-1)d=f===`up`?c:s;else if(d=bD(e,{startingIndex:l,amount:v,decrement:f===`up`,disabledIndices:o}),r){if(f===`up`&&(l-v<s||d<0)){let e=l%v,t=c%v,n=c-(t-e);d=t===e?c:t>e?n:n-v}f===`down`&&l+v>c&&(d=bD(e,{startingIndex:l%v-v,amount:v,disabledIndices:o}))}_D(e,d)&&(d=l)}if(n===`both`){let n=KE(l/a);t.key===(i?`ArrowLeft`:`ArrowRight`)&&(u&&IE(t),l%a===a-1?r&&(d=bD(e,{startingIndex:l-l%a-1,disabledIndices:o})):(d=bD(e,{startingIndex:l,disabledIndices:o}),r&&gD(d,a,n)&&(d=bD(e,{startingIndex:l-l%a-1,disabledIndices:o}))),gD(d,a,n)&&(d=l)),t.key===(i?`ArrowRight`:`ArrowLeft`)&&(u&&IE(t),l%a===0?r&&(d=bD(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o})):(d=bD(e,{startingIndex:l,decrement:!0,disabledIndices:o}),r&&gD(d,a,n)&&(d=bD(e,{startingIndex:l+(a-l%a),decrement:!0,disabledIndices:o}))),gD(d,a,n)&&(d=l));let s=KE(c/a)===n;_D(e,d)&&(d=r&&s?t.key===(i?`ArrowRight`:`ArrowLeft`)?c:bD(e,{startingIndex:l-l%a-1,disabledIndices:o}):l)}return d}function SD(e,t,n){let r=[],i=0;return e.forEach(({width:e,height:a},o)=>{let s=!1;for(n&&(i=0);!s;){let n=[];for(let r=0;r<e;r+=1)for(let e=0;e<a;e+=1)n.push(i+r+e*t);i%t+e<=t&&n.every(e=>r[e]==null)?(n.forEach(e=>{r[e]=o}),s=!0):i+=1}}),[...r]}function CD(e,t,n,r,i){if(e===-1)return-1;let a=n.indexOf(e),o=t[e];switch(i){case`tl`:return a;case`tr`:return o?a+o.width-1:a;case`bl`:return o?a+(o.height-1)*r:a;case`br`:return n.lastIndexOf(e);default:return-1}}function wD(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function TD(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e.current[t];return r?ED(r)?!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!0:!1}function ED(e){return zC(e).display!==`none`}var DD=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`].join(`,`),OD=typeof Element>`u`,kD=OD?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,AD=!OD&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},jD=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):jD(e.parentNode))},MD=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},ND=function(e,t,n){if(jD(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(DD));return t&&kD.call(e,DD)&&r.unshift(e),r=r.filter(n),r},PD=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!jD(a,!1))if(a.tagName===`SLOT`){var o=a.assignedElements(),s=PD(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{kD.call(a,DD)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!jD(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=PD(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}return r},FD=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},ID=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||MD(e))&&!FD(e)?0:e.tabIndex},LD=function(e,t){var n=ID(e);return n<0&&t&&!FD(e)?0:n},RD=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},zD=function(e){return e.tagName===`INPUT`},BD=function(e){return zD(e)&&e.type===`hidden`},VD=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},HD=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},UD=function(e){if(!e.name)return!0;var t=e.form||AD(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=HD(r,e.form);return!i||i===e},WD=function(e){return zD(e)&&e.type===`radio`},GD=function(e){return WD(e)&&!UD(e)},KD=function(e){var t=e&&AD(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=AD(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},qD=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},JD=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if(getComputedStyle(e).visibility===`hidden`)return!0;var i=kD.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(kD.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=AD(e);if(o&&!o.shadowRoot&&r(o)===!0)return qD(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(KD(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return qD(e);return!1},YD=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return kD.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},XD=function(e,t){return!(t.disabled||BD(t)||JD(t,e)||VD(t)||YD(t))},ZD=function(e,t){return!(GD(t)||ID(t)<0||!XD(e,t))},QD=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},$D=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=LD(a,i),s=i?$D(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(RD).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},eO=function(e,t){return t||={},$D(t.getShadowRoot?PD([e],t.includeContainer,{filter:ZD.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:QD}):ND(e,t.includeContainer,ZD.bind(null,t)))},tO=function(e,t){return t||={},t.getShadowRoot?PD([e],t.includeContainer,{filter:XD.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):ND(e,t.includeContainer,XD.bind(null,t))},nO=function(e,t){if(t||={},!e)throw Error(`No node provided`);return kD.call(e,DD)===!1?!1:ZD(t,e)};function rO(e){return e?.ownerDocument||document}var iO=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function aO(e,t){let n=eO(e,iO()),r=n.length;if(r===0)return;let i=wE(rO(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function oO(e){return aO(rO(e).body,1)||e}function sO(e){return aO(rO(e).body,-1)||e}function cO(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!TE(n,r)}function lO(e){eO(e,iO()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function uO(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function dO(e,t){return t!=null&&!BE(t)?0:typeof e==`function`?e():e}function fO(e,t,n){let r=dO(e,n);return typeof r==`number`?r:r?.[t]}function pO(e){return typeof e==`function`?e():e}function mO(e,t){return t||e===`click`||e===`mousedown`}var hO=G.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new sE,currentIdRef:{current:null},currentContextRef:{current:null}});function gO(e,t={open:!1}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`floatingId`),{open:i}=t,{currentIdRef:a,delayRef:o,timeoutMs:s,initialDelayRef:c,currentContextRef:l,hasProvider:u,timeout:d}=G.useContext(hO),[f,p]=G.useState(!1);return Z(()=>{function e(){p(!1),l.current?.setIsInstantPhase(!1),a.current=null,l.current=null,o.current=c.current}if(a.current&&!i&&a.current===r){if(p(!1),s){let t=r;return d.start(s,()=>{n.select(`open`)||a.current&&a.current!==t||e()}),()=>{d.clear()}}e()}},[i,r,a,o,s,c,l,d,n]),Z(()=>{if(!i)return;let e=l.current,t=a.current;d.clear(),l.current={onOpenChange:n.setOpen,setIsInstantPhase:p},a.current=r,o.current={open:0,close:fO(c.current,`close`)},t!==null&&t!==r?(p(!0),e?.setIsInstantPhase(!0),e?.onOpenChange(!1,Aw(vw))):(p(!1),e?.setIsInstantPhase(!1))},[i,r,n,a,o,s,c,l,d]),Z(()=>()=>{l.current=null},[l]),G.useMemo(()=>({hasProvider:u,delayRef:o,isInstantPhase:f}),[u,o,f])}function _O(e){let t=xS(vO,e).current;return t.next=e,Z(t.effect),t}function vO(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var yO=null;globalThis.requestAnimationFrame;var bO=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,--this.callbacksCount)}},xO=class e{static create(){return new e}static request(e){return bO.request(e)}static cancel(e){return bO.cancel(e)}currentId=yO;request(e){this.cancel(),this.currentId=bO.request(()=>{this.currentId=yO,e()})}cancel=()=>{this.currentId!==yO&&(bO.cancel(this.currentId),this.currentId=yO)};disposeEffect=()=>this.cancel};function SO(){let e=xS(xO.create).current;return aE(e.disposeEffect),e}var CO=G.forwardRef(function(e,t){let[n,r]=G.useState();Z(()=>{hE&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,K.jsx)(`span`,{...e,ref:t,style:NS,"aria-hidden":n?void 0:!0,...i,"data-base-ui-focus-guard":``})});function wO(e){return`data-base-ui-${e}`}var TO=0;function EO(e,t={}){let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(TO);let a=()=>e?.focus({preventScroll:n});i?a():TO=requestAnimationFrame(a)}var DO={inert:new WeakMap,"aria-hidden":new WeakMap},OO=`data-base-ui-inert`,kO={inert:new WeakSet,"aria-hidden":new WeakSet},AO=new WeakMap,jO=0;function MO(e){return kO[e]}function NO(e){return e?DC(e)?e.host:NO(e.parentNode):null}var PO=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=NO(t);return e.contains(n)?n:null}).filter(e=>e!=null),FO=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},IO=(e,t,n)=>{let r=[],i=e=>{!e||n.has(e)||Array.from(e.children).forEach(e=>{xC(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function LO(e,t,n,r,{mark:i=!0,markerIgnoreElements:a=[]}){let o=r?`inert`:n?`aria-hidden`:null,s=null,c=null,l=PO(t,e),u=i?PO(t,a):[],d=new Set(u),f=i?IO(t,FO(l),new Set(l)).filter(e=>!d.has(e)):[],p=[],m=[];if(o){let e=DO[o],n=MO(o);c=n,s=e;let r=PO(t,Array.from(t.querySelectorAll(`[aria-live]`))),i=l.concat(r);IO(t,FO(i),new Set(i)).forEach(t=>{let r=t.getAttribute(o),i=r!==null&&r!==`false`,a=(e.get(t)||0)+1;e.set(t,a),p.push(t),a===1&&i&&n.add(t),i||t.setAttribute(o,o===`inert`?``:`true`)})}return i&&f.forEach(e=>{let t=(AO.get(e)||0)+1;AO.set(e,t),m.push(e),t===1&&e.setAttribute(OO,``)}),jO+=1,()=>{s&&p.forEach(e=>{let t=(s.get(e)||0)-1;s.set(e,t),t||(!c?.has(e)&&o&&e.removeAttribute(o),c?.delete(e))}),i&&m.forEach(e=>{let t=(AO.get(e)||0)-1;AO.set(e,t),t||e.removeAttribute(OO)}),--jO,jO||(DO.inert=new WeakMap,DO[`aria-hidden`]=new WeakMap,kO.inert=new WeakSet,kO[`aria-hidden`]=new WeakSet,AO=new WeakMap)}}function RO(e,t={}){let{ariaHidden:n=!1,inert:r=!1,mark:i=!0,markerIgnoreElements:a=[]}=t,o=rO(e[0]).body;return LO(e,o,n,r,{mark:i,markerIgnoreElements:a})}var zO=G.createContext(null),BO=()=>G.useContext(zO),VO=wO(`portal`);function HO(e={}){let{ref:t,container:n,componentProps:r=LS,elementProps:i}=e,a=vC(),o=BO()?.portalNode,[s,c]=G.useState(null),[l,u]=G.useState(null),d=X(e=>{e!==null&&u(e)}),f=G.useRef(null);Z(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}if(a==null)return;let e=(n&&(wC(n)?n:n.current))??o??document.body;if(e==null){f.current&&(f.current=null,u(null),c(null));return}f.current!==e&&(f.current=e,u(null),c(e))},[n,o,a]);let p=lC(`div`,r,{ref:[t,d],props:[{id:a,[VO]:``},i]});return{portalNode:l,portalSubtree:s&&p?Ev.createPortal(p,s):null}}var UO=G.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,renderGuards:o,...s}=e,{portalNode:c,portalSubtree:l}=HO({container:r,ref:t,componentProps:e,elementProps:s}),u=G.useRef(null),d=G.useRef(null),f=G.useRef(null),p=G.useRef(null),[m,h]=G.useState(null),g=m?.modal,_=m?.open,v=typeof o==`boolean`?o:!!m&&!m.modal&&m.open&&!!c;G.useEffect(()=>{if(!c||g)return;function e(e){c&&e.relatedTarget&&cO(e)&&(e.type===`focusin`?uO:lO)(c)}return c.addEventListener(`focusin`,e,!0),c.addEventListener(`focusout`,e,!0),()=>{c.removeEventListener(`focusin`,e,!0),c.removeEventListener(`focusout`,e,!0)}},[c,g]),G.useEffect(()=>{!c||_||uO(c)},[_,c]);let y=G.useMemo(()=>({beforeOutsideRef:u,afterOutsideRef:d,beforeInsideRef:f,afterInsideRef:p,portalNode:c,setFocusManagerState:h}),[c]);return(0,K.jsxs)(G.Fragment,{children:[l,(0,K.jsxs)(zO.Provider,{value:y,children:[v&&c&&(0,K.jsx)(CO,{"data-type":`outside`,ref:u,onFocus:e=>{cO(e,c)?f.current?.focus():sO(m?m.domReference:null)?.focus()}}),v&&c&&(0,K.jsx)(`span`,{"aria-owns":c.id,style:cC}),c&&Ev.createPortal(n,c),v&&c&&(0,K.jsx)(CO,{"data-type":`outside`,ref:d,onFocus:e=>{cO(e,c)?p.current?.focus():(oO(m?m.domReference:null)?.focus(),m?.closeOnFocusOut&&m?.onOpenChange(!1,Aw(`focus-out`,e.nativeEvent)))}})]})]})});function WO(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}var GO=G.createContext(null),KO=G.createContext(null),qO=()=>G.useContext(GO)?.id||null,JO=e=>{let t=G.useContext(KO);return e??t};function YO(e){return e==null?e:`current`in e?e.current:e}function XO(e,t){let n=SC(e.target);return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||`keyboard`:`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var ZO=20,QO=[];function $O(){QO=QO.filter(e=>e.deref()?.isConnected)}function ek(e){$O(),e&&xC(e)!==`body`&&(QO.push(new WeakRef(e)),QO.length>ZO&&(QO=QO.slice(-ZO)))}function tk(){return $O(),QO[QO.length-1]?.deref()}function nk(e){if(!e)return null;let t=iO();return nO(e,t)?e:eO(e,t)[0]||e}function rk(e){return!e||!e.isConnected?!1:typeof e.checkVisibility==`function`?e.checkVisibility():ED(e)}function ik(e,t){if(!t.current.includes(`floating`)&&!e.getAttribute(`role`)?.includes(`dialog`))return;let n=iO(),r=tO(e,n).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return nO(e,n)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),i=e.getAttribute(`tabindex`);t.current.includes(`floating`)||r.length===0?i!==`0`&&e.setAttribute(`tabindex`,`0`):(i!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function ak(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:o=!1,modal:s=!0,closeOnFocusOut:c=!0,openInteractionType:l=``,nextFocusableElement:u,previousFocusableElement:d,beforeContentFocusGuardRef:f,externalTree:p,getInsideElements:m}=e,h=`rootStore`in t?t.rootStore:t,g=h.useState(`open`),_=h.useState(`domReferenceElement`),v=h.useState(`floatingElement`),{events:y,dataRef:b}=h.context,x=X(()=>b.current.floatingContext?.nodeId),S=i===!1,C=jE(_)&&S,w=G.useRef([`content`]),T=_O(i),E=_O(a),D=_O(l),O=JO(p),k=BO(),A=G.useRef(!1),j=G.useRef(!1),M=G.useRef(!1),N=G.useRef(-1),P=G.useRef(``),F=G.useRef(``),I=G.useRef(null),L=G.useRef(null),ee=ES(I,f,k?.beforeInsideRef),R=ES(L,k?.afterInsideRef),z=cE(),B=cE(),V=SO(),H=k!=null,U=NE(v),W=X((e=U)=>e?eO(e,iO()):[]),te=X(()=>m?.().filter(e=>e!=null)??[]),ne=X(e=>{let t=W(e);return w.current.map(()=>t).filter(Boolean).flat()});G.useEffect(()=>{if(r||!s)return;function e(e){e.key===`Tab`&&TE(U,wE(rO(U)))&&W().length===0&&!C&&IE(e)}let t=rO(U);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,_,U,s,w,C,W,ne]),G.useEffect(()=>{if(r||!g)return;let e=rO(U);function t(){M.current=!1}function n(e){let t=DE(e),n=te();M.current=!(TE(v,t)||TE(_,t)||TE(k?.portalNode,t)||n.some(e=>e===t||TE(e,t))),F.current=e.pointerType||`keyboard`,t?.closest(`[data-base-ui-click-trigger]`)&&(j.current=!0)}function i(){F.current=`keyboard`}return e.addEventListener(`pointerdown`,n,!0),e.addEventListener(`pointerup`,t,!0),e.addEventListener(`pointercancel`,t,!0),e.addEventListener(`keydown`,i,!0),()=>{e.removeEventListener(`pointerdown`,n,!0),e.removeEventListener(`pointerup`,t,!0),e.removeEventListener(`pointercancel`,t,!0),e.removeEventListener(`keydown`,i,!0)}},[r,v,_,U,g,k,te]),G.useEffect(()=>{if(r||!c)return;let e=rO(U);function t(){j.current=!0,B.start(0,()=>{j.current=!1})}function n(e){let t=DE(e),n=W().indexOf(t);n!==-1&&(N.current=n)}function i(t){let n=t.relatedTarget,r=t.currentTarget,i=DE(t);queueMicrotask(()=>{let a=x(),c=h.context.triggerElements,l=te(),f=n?.hasAttribute(wO(`focus-guard`))&&[I.current,L.current,k?.beforeInsideRef.current,k?.afterInsideRef.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,YO(d),YO(u)].includes(n),p=!(TE(_,n)||TE(v,n)||TE(n,v)||TE(k?.portalNode,n)||l.some(e=>e===n||TE(e,n))||n!=null&&c.hasElement(n)||c.hasMatchingElement(e=>TE(e,n))||f||O&&(PE(O.nodesRef.current,a).find(e=>TE(e.context?.elements.floating,n)||TE(e.context?.elements.domReference,n))||FE(O.nodesRef.current,a).find(e=>[e.context?.elements.floating,NE(e.context?.elements.floating)].includes(n)||e.context?.elements.domReference===n)));if(r===_&&U&&ik(U,w),o&&r!==_&&!rk(i)&&wE(e)===e.body){if(EC(U)&&(U.focus(),o===`popup`)){V.request(()=>{U.focus()});return}let e=N.current,t=W(),n=t[e]||t[t.length-1]||U;EC(n)&&n.focus()}if(b.current.insideReactTree){b.current.insideReactTree=!1;return}(C||!s)&&n&&p&&!j.current&&(C||n!==tk())&&(A.current=!0,h.setOpen(!1,Aw(ww,t)))})}function a(){M.current||(b.current.insideReactTree=!0,z.start(0,()=>{b.current.insideReactTree=!1}))}let l=EC(_)?_:null,f=[];if(!(!v&&!l))return l&&(l.addEventListener(`focusout`,i),l.addEventListener(`pointerdown`,t),f.push(()=>{l.removeEventListener(`focusout`,i),l.removeEventListener(`pointerdown`,t)})),v&&(v.addEventListener(`focusin`,n),v.addEventListener(`focusout`,i),k&&(v.addEventListener(`focusout`,a,!0),f.push(()=>{v.removeEventListener(`focusout`,a,!0)})),f.push(()=>{v.removeEventListener(`focusin`,n),v.removeEventListener(`focusout`,i)})),()=>{f.forEach(e=>{e()})}},[r,_,v,U,s,O,k,h,c,o,W,C,x,w,b,z,B,V,u,d,te]),G.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(k?.portalNode?.querySelectorAll(`[${wO(`portal`)}]`)||[]),t=(O?FE(O.nodesRef.current,x()):[]).find(e=>jE(e.context?.elements.domReference||null))?.context?.elements.domReference,n=RO([...[v,...e,I.current,L.current,k?.beforeOutsideRef.current,k?.afterOutsideRef.current,...te()],t,YO(d),YO(u),C?_:null].filter(e=>e!=null),{ariaHidden:s||C,mark:!1}),i=RO([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,s,w,k,C,O,x,u,d,te]),Z(()=>{if(!g||r||!EC(U))return;let e=wE(rO(U));queueMicrotask(()=>{let t=ne(U),n=T.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1)return;let i;i=r===!0||r===null?t[0]||U:YO(r),i=i||t[0]||U,!TE(U,e)&&EO(i,{preventScroll:i===U})})},[r,g,U,S,ne,T,D]),Z(()=>{if(r||!U)return;let e=rO(U);ek(wE(e));function t(e){if(e.open||(P.current=XO(e.nativeEvent,F.current)),e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`&&(A.current=!0),e.reason===`outside-press`)if(e.nested)A.current=!1;else if(RE(e.nativeEvent)||zE(e.nativeEvent))A.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?A.current=!1:A.current=!0}}y.on(`openchange`,t);function n(){let e=E.current,t=typeof e==`function`?e(P.current):e;if(t===void 0||t===!1)return null;if(t===null&&(t=!0),typeof t==`boolean`){let e=_||tk();return e&&e.isConnected?e:null}let n=_||tk();return YO(t)||n||null}return()=>{y.off(`openchange`,t);let r=wE(e),i=te(),a=TE(v,r)||i.some(e=>e===r||TE(e,r))||O&&PE(O.nodesRef.current,x(),!1).some(e=>TE(e.context?.elements.floating,r)),o=n();queueMicrotask(()=>{let t=nk(o),n=typeof E.current!=`boolean`;E.current&&!A.current&&EC(t)&&(!(!n&&t!==r&&r!==e.body)||a)&&t.focus({preventScroll:!0}),A.current=!1})}},[r,v,U,E,b,y,O,_,x,te]),Z(()=>{if(!pE||g||!v)return;let e=wE(rO(v));!EC(e)||!AE(e)||TE(v,e)&&e.blur()},[g,v]),Z(()=>{if(!(r||!k))return k.setFocusManagerState({modal:s,closeOnFocusOut:c,open:g,onOpenChange:h.setOpen,domReference:_}),()=>{k.setFocusManagerState(null)}},[r,k,s,g,h,c,_]),Z(()=>{if(!(r||!U))return ik(U,w),()=>{queueMicrotask($O)}},[r,U,w]);let re=!r&&(s?!C:!0)&&(H||s);return(0,K.jsxs)(G.Fragment,{children:[re&&(0,K.jsx)(CO,{"data-type":`inside`,ref:ee,onFocus:e=>{if(s){let e=ne();EO(e[e.length-1])}else k?.portalNode&&(A.current=!1,cO(e,k.portalNode)?oO(_)?.focus():YO(d??k.beforeOutsideRef)?.focus())}}),n,re&&(0,K.jsx)(CO,{"data-type":`inside`,ref:R,onFocus:e=>{s?EO(ne()[0]):k?.portalNode&&(c&&(A.current=!0),cO(e,k.portalNode)?sO(_)?.focus():YO(u??k.afterOutsideRef)?.focus())}})]})}function ok(e,t){let n=null,r=null,i=!1;return{contextElement:e||void 0,getBoundingClientRect(){let a=e?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},o=t.axis===`x`||t.axis===`both`,s=t.axis===`y`||t.axis===`both`,c=[`mouseenter`,`mousemove`].includes(t.dataRef.current.openEvent?.type||``)&&t.pointerType!==`touch`,l=a.width,u=a.height,d=a.x,f=a.y;return n==null&&t.x&&o&&(n=a.x-t.x),r==null&&t.y&&s&&(r=a.y-t.y),d-=n||0,f-=r||0,l=0,u=0,!i||c?(l=t.axis===`y`?a.width:0,u=t.axis===`x`?a.height:0,d=o&&t.x!=null?t.x:d,f=s&&t.y!=null?t.y:f):i&&!c&&(u=t.axis===`x`?a.height:u,l=t.axis===`y`?a.width:l),i=!0,{width:l,height:u,x:d,y:f,top:f,right:d+l,bottom:f+u,left:d}}}}function sk(e){return e!=null&&e.clientX!=null}function ck(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),o=n.context.dataRef,{enabled:s=!0,axis:c=`both`}=t,l=G.useRef(!1),u=G.useRef(null),[d,f]=G.useState(),[p,m]=G.useState([]),h=X((e,t,r)=>{l.current||o.current.openEvent&&!sk(o.current.openEvent)||n.set(`positionReference`,ok(r??a,{x:e,y:t,axis:c,dataRef:o,pointerType:d}))}),g=X(e=>{r?u.current||m([]):h(e.clientX,e.clientY,e.currentTarget)}),_=BE(d)?i:r,v=G.useCallback(()=>{if(!_||!s)return;let e=SC(i);function t(n){TE(i,DE(n))?(e.removeEventListener(`mousemove`,t),u.current=null):h(n.clientX,n.clientY)}if(!o.current.openEvent||sk(o.current.openEvent)){e.addEventListener(`mousemove`,t);let n=()=>{e.removeEventListener(`mousemove`,t),u.current=null};return u.current=n,n}n.set(`positionReference`,a)},[_,s,i,o,a,n,h]);G.useEffect(()=>v(),[v,p]),G.useEffect(()=>{s&&!i&&(l.current=!1)},[s,i]),G.useEffect(()=>{!s&&r&&(l.current=!0)},[s,r]);let y=G.useMemo(()=>{function e(e){f(e.pointerType)}return{onPointerDown:e,onPointerEnter:e,onMouseMove:g,onMouseEnter:g}},[g]);return G.useMemo(()=>s?{reference:y,trigger:y}:{},[s,y])}var lk={intentional:`onClick`,sloppy:`onPointerDown`};function uk(){return!1}function dk(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function fk(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),{dataRef:a}=n.context,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`sloppy`,referencePress:u=uk,referencePressEvent:d=`sloppy`,bubbles:f,externalTree:p}=t,m=JO(p),h=X(typeof c==`function`?c:()=>!1),g=typeof c==`function`?h:c,_=g!==!1,v=X(()=>l),y=G.useRef(!1),b=G.useRef(!1),x=G.useRef(!1),{escapeKey:S,outsidePress:C}=dk(f),w=G.useRef(null),T=cE(),E=cE(),D=X(()=>{E.clear(),a.current.insideReactTree=!1}),O=G.useRef(!1),k=G.useRef(``),A=X(u),j=X(e=>{if(!r||!o||!s||e.key!==`Escape`||O.current)return;let t=a.current.floatingContext?.nodeId,i=m?PE(m.nodesRef.current,t):[];if(!S&&i.length>0){let e=!0;if(i.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__escapeKeyBubbles&&(e=!1)}),!e)return}let c=Aw(Tw,LE(e)?e.nativeEvent:e);n.setOpen(!1,c),!S&&!c.isPropagationAllowed&&e.stopPropagation()}),M=X(()=>{a.current.insideReactTree=!0,E.start(0,D)});G.useEffect(()=>{if(!r||!o)return;a.current.__escapeKeyBubbles=S,a.current.__outsidePressBubbles=C;let e=new sE,t=new sE;function c(){e.clear(),O.current=!0}function l(){e.start(LC()?5:0,()=>{O.current=!1})}function u(){x.current=!0,t.start(0,()=>{x.current=!1})}function d(){y.current=!1,b.current=!1}function f(){let e=k.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=a.current.floatingContext?.nodeId,r=m&&PE(m.nodesRef.current,t).some(t=>OE(e,t.context?.elements.floating));return OE(e,n.select(`floatingElement`))||OE(e,n.select(`domReferenceElement`))||r}function E(e){if(p(e)){D();return}if(a.current.insideReactTree){D();return}let r=DE(e),i=`[${wO(`inert`)}]`,o=Array.from(rO(n.select(`floatingElement`)).querySelectorAll(i)),s=TC(r)?r.getRootNode():null;DC(s)&&(o=o.concat(Array.from(s.querySelectorAll(i))));let c=n.context.triggerElements;if(r&&(c.hasElement(r)||c.hasMatchingElement(e=>TE(e,r))))return;let l=TC(r)?r:null;for(;l&&!RC(l);){let e=VC(l);if(RC(e)||!TC(e))break;l=e}if(o.length&&TC(r)&&!kE(r)&&!TE(r,n.select(`floatingElement`))&&o.every(e=>!TE(l,e)))return;if(EC(r)&&!(`touches`in e)){let t=RC(r),n=zC(r),i=/auto|scroll/,a=t||i.test(n.overflowX),o=t||i.test(n.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=r.offsetWidth-r.clientWidth:e.offsetX>r.clientWidth),d=s&&e.offsetY>r.clientHeight;if(u||d)return}if(h(e))return;if(f()===`intentional`&&x.current){t.clear(),x.current=!1;return}if(typeof g==`function`&&!g(e))return;let u=a.current.floatingContext?.nodeId,d=m?PE(m.nodesRef.current,u):[];if(d.length>0){let e=!0;if(d.forEach(t=>{t.context?.open&&!t.context.dataRef.current.__outsidePressBubbles&&(e=!1)}),!e)return}n.setOpen(!1,Aw(Sw,e)),D()}function A(e){f()!==`sloppy`||e.pointerType===`touch`||!n.select(`open`)||!o||OE(e,n.select(`floatingElement`))||OE(e,n.select(`domReferenceElement`))||E(e)}function M(e){if(f()!==`sloppy`||!n.select(`open`)||!o||OE(e,n.select(`floatingElement`))||OE(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];t&&(w.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},T.start(1e3,()=>{w.current&&(w.current.dismissOnTouchEnd=!1,w.current.dismissOnMouseDown=!1)}))}function N(e){k.current=`touch`;let t=DE(e);function n(){M(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}function P(e){if(T.clear(),e.type===`pointerdown`&&(k.current=e.pointerType),e.type===`mousedown`&&w.current&&!w.current.dismissOnMouseDown)return;let t=DE(e);function n(){e.type===`pointerdown`?A(e):E(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}function F(e){if(!y.current)return;let n=b.current;if(d(),f()===`intentional`){if(e.type===`pointercancel`){n&&u();return}if(!h(e)){if(n){u();return}typeof g==`function`&&!g(e)||(t.clear(),x.current=!0,D())}}}function I(e){if(f()!==`sloppy`||!w.current||OE(e,n.select(`floatingElement`))||OE(e,n.select(`domReferenceElement`)))return;let t=e.touches[0];if(!t)return;let r=Math.abs(t.clientX-w.current.startX),i=Math.abs(t.clientY-w.current.startY),a=Math.sqrt(r*r+i*i);a>5&&(w.current.dismissOnTouchEnd=!0),a>10&&(E(e),T.clear(),w.current=null)}function L(e){let t=DE(e);function n(){I(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}function ee(e){f()!==`sloppy`||!w.current||OE(e,n.select(`floatingElement`))||OE(e,n.select(`domReferenceElement`))||(w.current.dismissOnTouchEnd&&E(e),T.clear(),w.current=null)}function R(e){let t=DE(e);function n(){ee(e),t?.removeEventListener(e.type,n)}t?.addEventListener(e.type,n)}let z=rO(i);return s&&(z.addEventListener(`keydown`,j),z.addEventListener(`compositionstart`,c),z.addEventListener(`compositionend`,l)),_&&(z.addEventListener(`click`,P,!0),z.addEventListener(`pointerdown`,P,!0),z.addEventListener(`pointerup`,F,!0),z.addEventListener(`pointercancel`,F,!0),z.addEventListener(`mousedown`,P,!0),z.addEventListener(`mouseup`,F,!0),z.addEventListener(`touchstart`,N,!0),z.addEventListener(`touchmove`,L,!0),z.addEventListener(`touchend`,R,!0)),()=>{s&&(z.removeEventListener(`keydown`,j),z.removeEventListener(`compositionstart`,c),z.removeEventListener(`compositionend`,l)),_&&(z.removeEventListener(`click`,P,!0),z.removeEventListener(`pointerdown`,P,!0),z.removeEventListener(`pointerup`,F,!0),z.removeEventListener(`pointercancel`,F,!0),z.removeEventListener(`mousedown`,P,!0),z.removeEventListener(`mouseup`,F,!0),z.removeEventListener(`touchstart`,N,!0),z.removeEventListener(`touchmove`,L,!0),z.removeEventListener(`touchend`,R,!0)),e.clear(),t.clear(),d(),x.current=!1}},[a,i,s,_,g,r,o,S,C,j,D,v,m,n,T]),G.useEffect(D,[g,D]);let N=G.useMemo(()=>({onKeyDown:j,[lk[d]]:e=>{A()&&n.setOpen(!1,Aw(yw,e.nativeEvent))},...d!==`intentional`&&{onClick(e){A()&&n.setOpen(!1,Aw(`trigger-press`,e.nativeEvent))}}}),[j,n,d,A]),P=X(e=>{if(!r||!o||e.button!==0)return;let t=DE(e.nativeEvent);TE(n.select(`floatingElement`),t)&&(y.current||(y.current=!0,b.current=!1))}),F=X(e=>{!r||!o||(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&y.current&&(b.current=!0)}),I=G.useMemo(()=>({onKeyDown:j,onPointerDown:F,onMouseDown:F,onClickCapture:M,onMouseDownCapture(e){M(),P(e)},onPointerDownCapture(e){M(),P(e)},onMouseUpCapture:M,onTouchEndCapture:M,onTouchMoveCapture:M}),[j,M,P,F]);return G.useMemo(()=>o?{reference:N,floating:I,trigger:N}:{},[o,N,I])}function pk(e,t,n){let{reference:r,floating:i}=e,a=tD(t),o=nD(t),s=eD(o),c=ZE(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(QE(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function mk(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=XE(t,e),p=mD(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=hD(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=hD(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var hk=50,gk=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:mk},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=pk(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<hk&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=pk(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},_k=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=XE(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ZE(r),_=tD(o),v=ZE(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[fD(o)]:iD(o)),x=p!==`none`;!d&&x&&b.push(...dD(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=rD(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==tD(t))||T.every(e=>tD(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=tD(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function vk(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function yk(e){return HE.some(t=>e[t]>=0)}var bk=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=XE(e,t);switch(i){case`referenceHidden`:{let e=vk(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:yk(e)}}}case`escaped`:{let e=vk(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:yk(e)}}}default:return{}}}}},xk=new Set([`left`,`top`]);async function Sk(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ZE(n),s=QE(n),c=tD(n)===`y`,l=xk.has(o)?-1:1,u=a&&c?-1:1,d=XE(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Ck=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Sk(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},wk=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=XE(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=tD(ZE(i)),p=$E(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=YE(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=YE(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Tk=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=XE(e,t),u={x:n,y:r},d=tD(i),f=$E(d),p=u[f],m=u[d],h=XE(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=xk.has(ZE(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Ek=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=XE(e,t),u=await o.detectOverflow(t,l),d=ZE(i),f=QE(i),p=tD(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=UE(h-u[g],v),x=UE(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=WE(u.left,0),t=WE(u.right,0),n=WE(u.top,0),r=WE(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:WE(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:WE(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Dk(e){let t=zC(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=EC(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=GE(n)!==a||GE(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ok(e){return TC(e)?e:e.contextElement}function kk(e){let t=Ok(e);if(!EC(t))return qE(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Dk(t),o=(a?GE(n.width):n.width)/r,s=(a?GE(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Ak=qE(0);function jk(e){let t=SC(e);return!LC()||!t.visualViewport?Ak:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Mk(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==SC(e)?!1:t}function Nk(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ok(e),o=qE(1);t&&(r?TC(r)&&(o=kk(r)):o=kk(e));let s=Mk(a,n,r)?jk(a):qE(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=SC(a),t=r&&TC(r)?SC(r):r,n=e,i=WC(n);for(;i&&r&&t!==n;){let e=kk(i),t=i.getBoundingClientRect(),r=zC(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=SC(i),i=WC(n)}}return hD({width:u,height:d,x:c,y:l})}function Pk(e,t){let n=BC(e).scrollLeft;return t?t.left+n:Nk(CC(e)).left+n}function Fk(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Pk(e,n),y:n.top+t.scrollTop}}function Ik(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=CC(r),s=t?AC(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=qE(1),u=qE(0),d=EC(r);if((d||!d&&!a)&&((xC(r)!==`body`||OC(o))&&(c=BC(r)),d)){let e=Nk(r);l=kk(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Fk(o,c):qE(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Lk(e){return Array.from(e.getClientRects())}function Rk(e){let t=CC(e),n=BC(e),r=e.ownerDocument.body,i=WE(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=WE(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Pk(e),s=-n.scrollTop;return zC(r).direction===`rtl`&&(o+=WE(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var zk=25;function Bk(e,t){let n=SC(e),r=CC(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=LC();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=Pk(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=zk&&(a-=o)}else l<=zk&&(a+=l);return{width:a,height:o,x:s,y:c}}function Vk(e,t){let n=Nk(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=EC(e)?kk(e):qE(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Hk(e,t,n){let r;if(t===`viewport`)r=Bk(e,n);else if(t===`document`)r=Rk(CC(e));else if(TC(t))r=Vk(t,n);else{let n=jk(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return hD(r)}function Uk(e,t){let n=VC(e);return n===t||!TC(n)||RC(n)?!1:zC(n).position===`fixed`||Uk(n,t)}function Wk(e,t){let n=t.get(e);if(n)return n;let r=UC(e,[],!1).filter(e=>TC(e)&&xC(e)!==`body`),i=null,a=zC(e).position===`fixed`,o=a?VC(e):e;for(;TC(o)&&!RC(o);){let t=zC(o),n=FC(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||OC(o)&&!n&&Uk(e,o))?r=r.filter(e=>e!==o):i=t,o=VC(o)}return t.set(e,r),r}function Gk(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?AC(t)?[]:Wk(t,this._c):[].concat(n),r],o=Hk(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Hk(t,a[e],i);s=WE(n.top,s),c=UE(n.right,c),l=UE(n.bottom,l),u=WE(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Kk(e){let{width:t,height:n}=Dk(e);return{width:t,height:n}}function qk(e,t,n){let r=EC(t),i=CC(t),a=n===`fixed`,o=Nk(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=qE(0);function l(){c.x=Pk(i)}if(r||!r&&!a)if((xC(t)!==`body`||OC(i))&&(s=BC(t)),r){let e=Nk(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Fk(i,s):qE(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Jk(e){return zC(e).position===`static`}function Yk(e,t){if(!EC(e)||zC(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return CC(e)===n&&(n=n.ownerDocument.body),n}function Xk(e,t){let n=SC(e);if(AC(e))return n;if(!EC(e)){let t=VC(e);for(;t&&!RC(t);){if(TC(t)&&!Jk(t))return t;t=VC(t)}return n}let r=Yk(e,t);for(;r&&kC(r)&&Jk(r);)r=Yk(r,t);return r&&RC(r)&&Jk(r)&&!FC(r)?n:r||IC(e)||n}var Zk=async function(e){let t=this.getOffsetParent||Xk,n=this.getDimensions,r=await n(e.floating);return{reference:qk(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Qk(e){return zC(e).direction===`rtl`}var $k={convertOffsetParentRelativeRectToViewportRelativeRect:Ik,getDocumentElement:CC,getClippingRect:Gk,getOffsetParent:Xk,getElementRects:Zk,getClientRects:Lk,getDimensions:Kk,getScale:kk,isElement:TC,isRTL:Qk};function eA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function tA(e,t){let n=null,r,i=CC(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=KE(d),h=KE(i.clientWidth-(u+f)),g=KE(i.clientHeight-(d+p)),_=KE(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:WE(0,UE(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!eA(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function nA(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Ok(e),u=i||a?[...l?UC(l):[],...t?UC(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?tA(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Nk(e):null;c&&g();function g(){let t=Nk(e);h&&!eA(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var rA=Ck,iA=wk,aA=_k,oA=Ek,sA=bk,cA=Tk,lA=(e,t,n)=>{let r=new Map,i={platform:$k,...n},a={...i.platform,_c:r};return gk(e,t,{...i,platform:a})},uA=typeof document<`u`?G.useLayoutEffect:function(){};function dA(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!dA(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!dA(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function fA(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pA(e,t){let n=fA(e);return Math.round(t*n)/n}function mA(e){let t=G.useRef(e);return uA(()=>{t.current=e}),t}function hA(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=G.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=G.useState(r);dA(f,r)||p(r);let[m,h]=G.useState(null),[g,_]=G.useState(null),v=G.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=G.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=G.useRef(null),C=G.useRef(null),w=G.useRef(u),T=c!=null,E=mA(c),D=mA(i),O=mA(l),k=G.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),lA(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!dA(w.current,t)&&(w.current=t,Ev.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);uA(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=G.useRef(!1);uA(()=>(A.current=!0,()=>{A.current=!1}),[]),uA(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=G.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=G.useMemo(()=>({reference:b,floating:x}),[b,x]),N=G.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=pA(M.floating,u.x),r=pA(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...fA(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return G.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var gA=(e,t)=>{let n=rA(e);return{name:n.name,fn:n.fn,options:[e,t]}},_A=(e,t)=>{let n=iA(e);return{name:n.name,fn:n.fn,options:[e,t]}},vA=(e,t)=>({fn:cA(e).fn,options:[e,t]}),yA=(e,t)=>{let n=aA(e);return{name:n.name,fn:n.fn,options:[e,t]}},bA=(e,t)=>{let n=oA(e);return{name:n.name,fn:n.fn,options:[e,t]}},xA=(e,t)=>{let n=sA(e);return{name:n.name,fn:n.fn,options:[e,t]}};ib({memoize:Zy,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});var $=(e,t,n,r,i,a,...o)=>{if(o.length>0)throw Error(zS(1));let s;if(e&&t&&n&&r&&i&&a)s=(o,s,c,l)=>a(e(o,s,c,l),t(o,s,c,l),n(o,s,c,l),r(o,s,c,l),i(o,s,c,l),s,c,l);else if(e&&t&&n&&r&&i)s=(a,o,s,c)=>i(e(a,o,s,c),t(a,o,s,c),n(a,o,s,c),r(a,o,s,c),o,s,c);else if(e&&t&&n&&r)s=(i,a,o,s)=>r(e(i,a,o,s),t(i,a,o,s),n(i,a,o,s),a,o,s);else if(e&&t&&n)s=(r,i,a,o)=>n(e(r,i,a,o),t(r,i,a,o),i,a,o);else if(e&&t)s=(n,r,i,a)=>t(e(n,r,i,a),r,i,a);else if(e)s=e;else throw Error(`Missing arguments`);return s},SA=pv(),CA=VS(19)?EA:DA;function wA(e,t,n,r,i){return CA(e,t,n,r,i)}function TA(e,t,n,r,i){let a=G.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,SA.useSyncExternalStore)(e.subscribe,a,a)}ZT({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,i))&&(t=!0,r.value=i,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,SA.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function EA(e,t,n,r,i){let a=XT();if(!a)return TA(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],(s.store!==e||s.selector!==t||!Object.is(s.a1,n)||!Object.is(s.a2,r)||!Object.is(s.a3,i))&&(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.didChange=!0)):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i),didChange:!1},a.syncHooks.push(s)),s.value}function DA(e,t,n,r,i){return(0,hv.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var OA=class{constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return wA(this,e,t,n,r)}},kA=class extends OA{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){G.useDebugValue(e),Z(()=>{this.state[e]!==t&&this.set(e,t)},[e,t])}useSyncedValueWithCleanup(e,t){let n=this;Z(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;Z(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){G.useDebugValue(e);let n=t!==void 0;Z(()=>{n&&!Object.is(this.state[e],t)&&super.setState({...this.state,[e]:t})},[e,t,n])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return G.useDebugValue(e),wA(this,this.selectors[e],t,n,r)}useContextCallback(e,t){G.useDebugValue(e);let n=X(t??FS);this.context[e]=n}useStateSetter(e){let t=G.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}},AA={open:$(e=>e.open),domReferenceElement:$(e=>e.domReferenceElement),referenceElement:$(e=>e.positionReference??e.referenceElement),floatingElement:$(e=>e.floatingElement),floatingId:$(e=>e.floatingId)},jA=class extends kA{constructor(e){let{nested:t,noEmit:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:WO(),nested:t,noEmit:n,triggerElements:i},AA)}setOpen=(e,t)=>{if((!e||!this.state.open||VE(t.event))&&(this.context.dataRef.current.openEvent=e?t.event:void 0),!this.context.noEmit){let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)}this.context.onOpenChange?.(e,t)}};function MA(e,t=!1,n=!1){let[r,i]=G.useState(e&&t?`idle`:void 0),[a,o]=G.useState(e);return e&&!a&&(o(!0),i(`starting`)),!e&&a&&r!==`ending`&&!n&&i(`ending`),!e&&!a&&r===`ending`&&i(void 0),Z(()=>{if(!e&&a&&r!==`ending`&&n){let e=xO.request(()=>{i(`ending`)});return()=>{xO.cancel(e)}}},[e,a,r,n]),Z(()=>{if(!e||t)return;let n=xO.request(()=>{i(void 0)});return()=>{xO.cancel(n)}},[t,e]),Z(()=>{if(!e||!t)return;e&&a&&r!==`idle`&&i(`starting`);let n=xO.request(()=>{i(`idle`)});return()=>{xO.cancel(n)}},[t,e,a,i,r]),G.useMemo(()=>({mounted:a,setMounted:o,transitionStatus:r}),[a,r])}var NA=function(e){return e.startingStyle=`data-starting-style`,e.endingStyle=`data-ending-style`,e}({}),PA={[NA.startingStyle]:``},FA={[NA.endingStyle]:``},IA={transitionStatus(e){return e===`starting`?PA:e===`ending`?FA:null}};function LA(e,t=!1,n=!0){let r=SO();return X((i,a=null)=>{r.cancel();function o(){Ev.flushSync(i)}let s=YO(e);if(s==null)return;let c=s;if(typeof c.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{function e(){let e=NA.startingStyle;if(!c.hasAttribute(e)){r.request(i);return}let t=new MutationObserver(()=>{c.hasAttribute(e)||(t.disconnect(),i())});t.observe(c,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}function i(){Promise.all(c.getAnimations().map(e=>e.finished)).then(()=>{a?.aborted||o()}).catch(()=>{let e=c.getAnimations();if(n){if(a?.aborted)return;o()}else e.length>0&&e.some(e=>e.pending||e.playState!==`finished`)&&i()})}if(t){e();return}r.request(i)}})}function RA(e){let{enabled:t=!0,open:n,ref:r,onComplete:i}=e,a=X(i),o=LA(r,n,!1);G.useEffect(()=>{if(!t)return;let e=new AbortController;return o(a,e.signal),()=>{e.abort()}},[t,n,a,o])}function zA(e,t){let n=G.useRef(null),r=G.useRef(null);return G.useCallback(i=>{if(e!==void 0){if(n.current!==null){let e=n.current,i=r.current,a=t.context.triggerElements.getById(e);i&&a===i&&t.context.triggerElements.delete(e),n.current=null,r.current=null}i!==null&&(n.current=e,r.current=i,t.context.triggerElements.add(e,i))}},[t,e])}function BA(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=zA(e,n),o=X(t=>{if(a(t),!t||!n.select(`open`))return;let i=n.select(`activeTriggerId`);if(i===e){n.update({activeTriggerElement:t,...r});return}i??n.update({activeTriggerId:e,activeTriggerElement:t,...r})});return Z(()=>{i&&n.update({activeTriggerElement:t.current,...r})},[i,n,t,...Object.values(r)]),{registerTrigger:o,isMountedByThisTrigger:i}}function VA(e){let t=e.useState(`open`);Z(()=>{if(t&&!e.select(`activeTriggerId`)&&e.context.triggerElements.size===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[n,r]=t.value;e.update({activeTriggerId:n,activeTriggerElement:r})}}},[t,e])}function HA(e,t,n){let{mounted:r,setMounted:i,transitionStatus:a}=MA(e);t.useSyncedValues({mounted:r,transitionStatus:a});let o=X(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return RA({enabled:!t.useState(`preventUnmountingOnClose`),open:e,ref:t.context.popupRef,onComplete(){e||o()}}),{forceUnmount:o,transitionStatus:a}}var UA=class{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(e,t){let n=this.idMap.get(e);n!==t&&(n!==void 0&&this.elementsSet.delete(n),this.elementsSet.add(t),this.idMap.set(e,t))}delete(e){let t=this.idMap.get(e);t&&(this.elementsSet.delete(t),this.idMap.delete(e))}hasElement(e){return this.elementsSet.has(e)}hasMatchingElement(e){for(let t of this.elementsSet)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}};function WA(){return new jA({open:!1,floatingElement:null,referenceElement:null,triggerElements:new UA,floatingId:``,nested:!1,noEmit:!1,onOpenChange:void 0})}function GA(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:`idle`,floatingRootContext:WA(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:LS,inactiveTriggerProps:LS,popupProps:LS}}var KA=$(e=>e.triggerIdProp??e.activeTriggerId),qA={open:$(e=>e.openProp??e.open),mounted:$(e=>e.mounted),transitionStatus:$(e=>e.transitionStatus),floatingRootContext:$(e=>e.floatingRootContext),preventUnmountingOnClose:$(e=>e.preventUnmountingOnClose),payload:$(e=>e.payload),activeTriggerId:KA,activeTriggerElement:$(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:$((e,t)=>t!==void 0&&KA(e)===t),isOpenedByTrigger:$((e,t)=>t!==void 0&&KA(e)===t&&e.open),isMountedByTrigger:$((e,t)=>t!==void 0&&KA(e)===t&&e.mounted),triggerProps:$((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:$(e=>e.popupProps),popupElement:$(e=>e.popupElement),positionerElement:$(e=>e.positionerElement)};function JA(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=vC(),a=qO()!=null,o=xS(()=>new jA({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new UA,floatingId:i,nested:a,noEmit:!1})).current;return Z(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=TC(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o.context.noEmit=!1,o}function YA(e={}){let{nodeId:t,externalTree:n}=e,r=JA(e),i=e.rootContext||r,a={reference:i.useState(`referenceElement`),floating:i.useState(`floatingElement`),domReference:i.useState(`domReferenceElement`)},[o,s]=G.useState(null),c=G.useRef(null),l=JO(n);Z(()=>{a.domReference&&(c.current=a.domReference)},[a.domReference]);let u=hA({...e,elements:{...a,...o&&{reference:o}}}),d=G.useCallback(e=>{let t=TC(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;s(t),u.refs.setReference(t)},[u.refs]),[f,p]=G.useState(null),[m,h]=G.useState(null);i.useSyncedValue(`referenceElement`,f),i.useSyncedValue(`domReferenceElement`,TC(f)?f:null),i.useSyncedValue(`floatingElement`,m);let g=G.useCallback(e=>{(TC(e)||e===null)&&(c.current=e,p(e)),(TC(u.refs.reference.current)||u.refs.reference.current===null||e!==null&&!TC(e))&&u.refs.setReference(e)},[u.refs,p]),_=G.useCallback(e=>{h(e),u.refs.setFloating(e)},[u.refs]),v=G.useMemo(()=>({...u.refs,setReference:g,setFloating:_,setPositionReference:d,domReference:c}),[u.refs,g,_,d]),y=G.useMemo(()=>({...u.elements,domReference:a.domReference}),[u.elements,a.domReference]),b=i.useState(`open`),x=i.useState(`floatingId`),S=G.useMemo(()=>({...u,dataRef:i.context.dataRef,open:b,onOpenChange:i.setOpen,events:i.context.events,floatingId:x,refs:v,elements:y,nodeId:t,rootStore:i}),[u,v,y,t,i,b,x]);return Z(()=>{i.context.dataRef.current.floatingContext=S;let e=l?.nodesRef.current.find(e=>e.id===t);e&&(e.context=S)}),G.useMemo(()=>({...u,context:S,refs:v,elements:y,rootStore:i}),[u,v,y,S,i])}function XA(e){let{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:i}=e,a=vC(),o=qO()!=null,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(r?`popupElement`:`positionerElement`),u=t.context.triggerElements,d=xS(()=>new jA({open:s,referenceElement:c,floatingElement:l,triggerElements:u,onOpenChange:i,floatingId:a,nested:o,noEmit:n})).current;return Z(()=>{let e={open:s,floatingId:a,referenceElement:c,floatingElement:l};TC(c)&&(e.domReferenceElement=c),d.state.positionReference===d.state.referenceElement&&(e.positionReference=c),d.update(e)},[s,a,c,l,d]),d.context.onOpenChange=i,d.context.nested=o,d.context.noEmit=n,d}var ZA=_E&&hE;function QA(e,t={}){let n=`rootStore`in e?e.rootStore:e,{events:r,dataRef:i}=n.context,{enabled:a=!0,delay:o}=t,s=G.useRef(!1),c=G.useRef(null),l=cE(),u=G.useRef(!0);G.useEffect(()=>{let e=n.select(`domReferenceElement`);if(!a)return;let t=SC(e);function r(){let e=n.select(`domReferenceElement`);!n.select(`open`)&&EC(e)&&e===wE(rO(e))&&(s.current=!0)}function i(){u.current=!0}function o(){u.current=!1}return t.addEventListener(`blur`,r),ZA&&(t.addEventListener(`keydown`,i,!0),t.addEventListener(`pointerdown`,o,!0)),()=>{t.removeEventListener(`blur`,r),ZA&&(t.removeEventListener(`keydown`,i,!0),t.removeEventListener(`pointerdown`,o,!0))}},[n,a]),G.useEffect(()=>{if(!a)return;function e(e){if(e.reason===`trigger-press`||e.reason===`escape-key`){let e=n.select(`domReferenceElement`);TC(e)&&(c.current=e,s.current=!0)}}return r.on(`openchange`,e),()=>{r.off(`openchange`,e)}},[r,a,n]);let d=G.useMemo(()=>({onMouseLeave(){s.current=!1,c.current=null},onFocus(e){let t=e.currentTarget;if(s.current){if(c.current===t)return;s.current=!1,c.current=null}let r=DE(e.nativeEvent);if(TC(r)){if(ZA&&!e.relatedTarget){if(!u.current&&!AE(r))return}else if(!ME(r))return}let i=EE(e.relatedTarget,n.context.triggerElements),{nativeEvent:a,currentTarget:d}=e,f=typeof o==`function`?o():o;if(n.select(`open`)&&i||f===0||f===void 0){n.setOpen(!0,Aw(xw,a,d));return}l.start(f,()=>{s.current||n.setOpen(!0,Aw(xw,a,d))})},onBlur(e){s.current=!1,c.current=null;let t=e.relatedTarget,r=e.nativeEvent,a=TC(t)&&t.hasAttribute(wO(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let e=n.select(`domReferenceElement`),o=wE(e?e.ownerDocument:document);!t&&o===e||TE(i.current.floatingContext?.refs.floating.current,o)||TE(e,o)||a||EE(t??o,n.context.triggerElements)||n.setOpen(!1,Aw(xw,r))})}}),[i,n,l,o]);return G.useMemo(()=>a?{reference:d,trigger:d}:{},[a,d])}var $A=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${CE}`;function ej(e){return e?!!e.closest($A):!1}var tj=class e{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new sE,this.restTimeout=new sE,this.handleCloseOptions=void 0}static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose};function nj(e){e.performedPointerEventsMutation&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null)}function rj(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t;nj(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function ij(e){let t=xS(tj.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||=t,aE(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}function aj(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingElement`),a=n.useState(`domReferenceElement`),{dataRef:o}=n.context,{enabled:s=!0,closeDelay:c=0}=t,l=ij(n),u=JO(),d=qO(),f=X(()=>mO(o.current.openEvent?.type,l.interactedInside)),p=X(()=>{let e=o.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`}),m=X(e=>EE(e,n.context.triggerElements)),h=G.useCallback(e=>{let t=fO(c,`close`,l.pointerType),r=()=>{n.setOpen(!1,Aw(bw,e)),u?.events.emit(`floating.closed`,e)};t?l.openChangeTimeout.start(t,r):(l.openChangeTimeout.clear(),r())},[c,n,l,u]),g=X(()=>{nj(l)}),_=X(e=>{let t=DE(e);if(!ej(t)){l.interactedInside=!1;return}l.interactedInside=t?.closest(`[aria-haspopup]`)!=null});Z(()=>{r||(l.pointerType=void 0,l.restTimeoutPending=!1,l.interactedInside=!1,g())},[r,l,g]),G.useEffect(()=>g,[g]),Z(()=>{if(s&&r&&l.handleCloseOptions?.blockPointerEvents&&p()&&TC(a)&&i){let e=a,t=i,n=rO(i),r=u?.nodesRef.current.find(e=>e.id===d)?.context?.elements.floating;return r&&(r.style.pointerEvents=``),rj(l,{scopeElement:l.handleCloseOptions?.getScope?.()??l.pointerEventsScopeElement??r??e.closest(`[data-rootownerid]`)??n.body,referenceElement:e,floatingElement:t}),()=>{g()}}},[s,r,a,i,l,p,u,d,g]);let v=cE();G.useEffect(()=>{if(!s)return;function e(){l.openChangeTimeout.clear(),v.clear(),u?.events.off(`floating.closed`,r),g()}function t(e){if(u&&d&&PE(u.nodesRef.current,d).length>0){u.events.on(`floating.closed`,r);return}if(!m(e.relatedTarget)){if(l.handler){l.handler(e);return}g(),f()||h(e)}}function r(e){!u||!d||PE(u.nodesRef.current,d).length>0||v.start(0,()=>{u.events.off(`floating.closed`,r),n.setOpen(!1,Aw(bw,e)),u.events.emit(`floating.closed`,e)})}let a=i;return a&&(a.addEventListener(`mouseenter`,e),a.addEventListener(`mouseleave`,t),a.addEventListener(`pointerdown`,_,!0)),()=>{a&&(a.removeEventListener(`mouseenter`,e),a.removeEventListener(`mouseleave`,t),a.removeEventListener(`pointerdown`,_,!0)),u?.events.off(`floating.closed`,r)}},[s,i,n,o,f,m,h,g,_,l,u,d,v])}var oj={current:null};function sj(e,t={}){let n=`rootStore`in e?e.rootStore:e,{dataRef:r,events:i}=n.context,{enabled:a=!0,delay:o=0,handleClose:s=null,mouseOnly:c=!1,restMs:l=0,move:u=!0,triggerElementRef:d=oj,externalTree:f,isActiveTrigger:p=!0,getHandleCloseContext:m}=t,h=JO(f),g=ij(n),_=_O(s),v=_O(o),y=_O(l),b=_O(a);p&&(g.handleCloseOptions=_.current?.__options);let x=X(()=>mO(r.current.openEvent?.type,g.interactedInside)),S=X(e=>EE(e,n.context.triggerElements)),C=X((e,t,r)=>{let i=n.context.triggerElements;if(i.hasElement(t))return!e||!TE(e,t);if(!TC(r))return!1;let a=r;return i.hasMatchingElement(e=>TE(e,a))&&(!e||!TE(e,a))}),w=G.useCallback((e,t=!0)=>{let r=fO(v.current,`close`,g.pointerType);r?g.openChangeTimeout.start(r,()=>{n.setOpen(!1,Aw(bw,e)),h?.events.emit(`floating.closed`,e)}):t&&(g.openChangeTimeout.clear(),n.setOpen(!1,Aw(bw,e)),h?.events.emit(`floating.closed`,e))},[v,n,g,h]),T=X(()=>{g.handler&&=(rO(n.select(`domReferenceElement`)).removeEventListener(`mousemove`,g.handler),void 0)});G.useEffect(()=>T,[T]);let E=X(()=>{nj(g)});return G.useEffect(()=>{if(!a)return;function e(e){e.open||(T(),g.openChangeTimeout.clear(),g.restTimeout.clear(),g.blockMouseMove=!0,g.restTimeoutPending=!1)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[a,i,g,T]),G.useEffect(()=>{if(!a)return;let e=d.current??(p?n.select(`domReferenceElement`):null);if(!TC(e))return;function t(e){if(g.openChangeTimeout.clear(),g.blockMouseMove=!1,c&&!BE(g.pointerType)||pO(y.current)>0&&!fO(v.current,`open`))return;let t=fO(v.current,`open`,g.pointerType),r=e.currentTarget??null,i=n.select(`domReferenceElement`),a=r==null?!1:C(i,r,e.target),o=n.select(`open`),s=!o||a;a&&o?n.setOpen(!0,Aw(bw,e,r)):t?g.openChangeTimeout.start(t,()=>{s&&n.setOpen(!0,Aw(bw,e,r))}):s&&n.setOpen(!0,Aw(bw,e,r))}function i(e){if(x()){E();return}T();let t=rO(n.select(`domReferenceElement`));g.restTimeout.clear(),g.restTimeoutPending=!1;let i=r.current.floatingContext??m?.();if(!S(e.relatedTarget)){if(_.current&&i){n.select(`open`)||g.openChangeTimeout.clear();let r=d.current;g.handler=_.current({...i,tree:h,x:e.clientX,y:e.clientY,onClose(){E(),T(),b.current&&!x()&&r===n.select(`domReferenceElement`)&&w(e,!0)}}),t.addEventListener(`mousemove`,g.handler),g.handler(e);return}(g.pointerType!==`touch`||!TE(n.select(`floatingElement`),e.relatedTarget))&&w(e)}}return u&&e.addEventListener(`mousemove`,t,{once:!0}),e.addEventListener(`mouseenter`,t),e.addEventListener(`mouseleave`,i),()=>{u&&e.removeEventListener(`mousemove`,t),e.removeEventListener(`mouseenter`,t),e.removeEventListener(`mouseleave`,i)}},[T,E,r,v,w,n,a,_,g,p,C,x,S,c,u,y,d,h,b,m]),G.useMemo(()=>{if(!a)return;function e(e){g.pointerType=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e,r=e.currentTarget,i=n.select(`domReferenceElement`),a=n.select(`open`),o=C(i,r,e.target);if(c&&!BE(g.pointerType))return;let s=pO(y.current);if(a&&!o||s===0||!o&&g.restTimeoutPending&&e.movementX**2+e.movementY**2<2)return;g.restTimeout.clear();function l(){if(g.restTimeoutPending=!1,x())return;let e=n.select(`open`);!g.blockMouseMove&&(!e||o)&&n.setOpen(!0,Aw(bw,t,r))}g.pointerType===`touch`?Ev.flushSync(()=>{l()}):o&&a?l():(g.restTimeoutPending=!0,g.restTimeout.start(s,l))}}},[a,g,x,C,c,n,y])}function cj(e=[]){let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=e.map(e=>e?.trigger),a=G.useCallback(t=>lj(t,e,`reference`),t),o=G.useCallback(t=>lj(t,e,`floating`),n),s=G.useCallback(t=>lj(t,e,`item`),r),c=G.useCallback(t=>lj(t,e,`trigger`),i);return G.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s,getTriggerProps:c}),[a,o,s,c])}function lj(e,t,n){let r=new Map,i=n===`item`,a={};n===`floating`&&(a.tabIndex=-1,a[SE]=``);for(let t in e)i&&e&&(t===`active`||t===`selected`)||(a[t]=e[t]);for(let o=0;o<t.length;o+=1){let s,c=t[o]?.[n];s=typeof c==`function`?e?c(e):null:c,s&&uj(a,s,i,r)}return uj(a,e,i,r),a}function uj(e,t,n,r){for(let i in t){let a=t[i];n&&(i===`active`||i===`selected`)||(i.startsWith(`on`)?(r.has(i)||r.set(i,[]),typeof a==`function`&&(r.get(i)?.push(a),e[i]=(...e)=>r.get(i)?.map(t=>t(...e)).find(e=>e!==void 0))):e[i]=a)}}var dj=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function fj(e,t={}){let n=`rootStore`in e?e.rootStore:e,r=n.useState(`open`),i=n.useState(`floatingId`),a=n.useState(`domReferenceElement`),o=n.useState(`floatingElement`),{role:s=`dialog`}=t,c=vC(),l=a?.id||c,u=G.useMemo(()=>NE(o)?.id||i,[o,i]),d=dj.get(s)??s,f=qO()!=null,p=G.useMemo(()=>d===`tooltip`||s===`label`?LS:{"aria-haspopup":d===`alertdialog`?`dialog`:d,"aria-expanded":`false`,...d===`listbox`&&{role:`combobox`},...d===`menu`&&f&&{role:`menuitem`},...s===`select`&&{"aria-autocomplete":`none`},...s===`combobox`&&{"aria-autocomplete":`list`}},[d,f,s]),m=G.useMemo(()=>d===`tooltip`||s===`label`?{[`aria-${s===`label`?`labelledby`:`describedby`}`]:r?u:void 0}:{...p,"aria-expanded":r?`true`:`false`,"aria-controls":r?u:void 0,...d===`menu`&&{id:l}},[d,u,r,l,s,p]),h=G.useMemo(()=>{let e={id:u,...d&&{role:d}};return d===`tooltip`||s===`label`?e:{...e,...d===`menu`&&{"aria-labelledby":l}}},[d,u,l,s]),g=G.useCallback(({active:e,selected:t})=>{let n={role:`option`,...e&&{id:`${u}-fui-option`}};switch(s){case`select`:case`combobox`:return{...n,"aria-selected":t};default:}return{}},[u,s]);return G.useMemo(()=>({reference:m,floating:h,item:g,trigger:p}),[m,h,p,g])}var pj=.1,mj=pj*pj,hj=.5;function gj(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function _j(e,t,n,r,i,a,o,s,c,l){let u=!1;return gj(e,t,n,r,i,a)&&(u=!u),gj(e,t,i,a,o,s)&&(u=!u),gj(e,t,o,s,c,l)&&(u=!u),gj(e,t,c,l,n,r)&&(u=!u),u}function vj(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function yj(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function bj(e={}){let{blockPointerEvents:t=!1}=e,n=new sE,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*mj;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=DE(r),g=r.type===`mouseleave`,_=TE(u,h),v=TE(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&TC(r.relatedTarget)&&TE(u,r.relatedTarget))return;function y(){return!!(s&&PE(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=yj(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=yj(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=yj(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=yj(d,f,x.right-1,A,S.left+1,k);break;default:}if(j)return;if(l&&!vj(d,f,x)){b();return}if(!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?hj/2:hj*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+hj+1,o=C||T?S.bottom-hj:S.top,s=C?T?S.bottom-hj:S.top:S.bottom-hj;M=_j(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?hj/2:hj*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-hj,o=C||T?S.top+hj:S.bottom,s=C?T?S.top+hj:S.bottom:S.top+hj;M=_j(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?hj/2:hj*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+hj+1,o=w||E?S.right-hj:S.left,s=w?E?S.right-hj:S.left:S.right-hj;M=_j(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?hj/2:hj*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-hj,o=w||E?S.left+hj:S.right,s=w?E?S.left+hj:S.right:S.left+hj;M=_j(d,f,a,r,a,i,o,S.top,s,S.bottom);break}default:}M?l||n.start(40,b):b()}};return r.__options={blockPointerEvents:t},r}var xj={...qA,disabled:$(e=>e.disabled),instantType:$(e=>e.instantType),isInstantPhase:$(e=>e.isInstantPhase),trackCursorAxis:$(e=>e.trackCursorAxis),disableHoverablePopup:$(e=>e.disableHoverablePopup),lastOpenChangeReason:$(e=>e.openChangeReason),closeOnClick:$(e=>e.closeOnClick),closeDelay:$(e=>e.closeDelay),hasViewport:$(e=>e.hasViewport)},Sj=class e extends kA{constructor(e){super({...Cj(),...e},{popupRef:G.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new UA},xj)}setOpen=(e,t)=>{let n=t.reason,r=n===bw,i=e&&n===`trigger-focus`,a=!e&&(n===`trigger-press`||n===`escape-key`);if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},this.context.onOpenChange?.(e,t),t.isCanceled)return;let o=()=>{let r={open:e,openChangeReason:n};i?r.instantType=`focus`:a?r.instantType=`dismiss`:n===`trigger-hover`&&(r.instantType=void 0);let o=t.trigger?.id??null;(o||e)&&(r.activeTriggerId=o,r.activeTriggerElement=t.trigger??null),this.update(r)};r?Ev.flushSync(o):o()};static useStore(t,n){let r=xS(()=>new e(n)).current,i=t??r,a=XA({popupStore:i,onOpenChange:i.setOpen});return i.state.floatingRootContext=a,i}};function Cj(){return{...GA(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:`none`,disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,hasViewport:!1}}QT(function(e){let{disabled:t=!1,defaultOpen:n=!1,open:r,disableHoverablePopup:i=!1,trackCursorAxis:a=`none`,actionsRef:o,onOpenChange:s,onOpenChangeComplete:c,handle:l,triggerId:u,defaultTriggerId:d=null,children:f}=e,p=Sj.useStore(l?.store,{open:n,openProp:r,activeTriggerId:d,triggerIdProp:u});tE(()=>{r===void 0&&p.state.open===!1&&n===!0&&p.update({open:!0,activeTriggerId:d})}),p.useControlledProp(`openProp`,r),p.useControlledProp(`triggerIdProp`,u),p.useContextCallback(`onOpenChange`,s),p.useContextCallback(`onOpenChangeComplete`,c);let m=p.useState(`open`),h=!t&&m,g=p.useState(`activeTriggerId`),_=p.useState(`payload`);p.useSyncedValues({trackCursorAxis:a,disableHoverablePopup:i}),Z(()=>{m&&t&&p.setOpen(!1,Aw(Dw))},[m,t,p]),p.useSyncedValue(`disabled`,t),VA(p);let{forceUnmount:v,transitionStatus:y}=HA(h,p),b=p.useState(`isInstantPhase`),x=p.useState(`instantType`),S=p.useState(`lastOpenChangeReason`),C=G.useRef(null);Z(()=>{y===`ending`&&S===`none`||y!==`ending`&&b?(x!==`delay`&&(C.current=x),p.set(`instantType`,`delay`)):C.current!==null&&(p.set(`instantType`,C.current),C.current=null)},[y,b,S,x,p]),Z(()=>{h&&(g??p.set(`payload`,void 0))},[p,g,h]);let w=G.useCallback(()=>{p.setOpen(!1,wj(p,Ow))},[p]);G.useImperativeHandle(o,()=>({unmount:v,close:w}),[v,w]);let T=p.useState(`floatingRootContext`),{getReferenceProps:E,getFloatingProps:D,getTriggerProps:O}=cj([fk(T,{enabled:!t,referencePress:()=>p.select(`closeOnClick`)}),ck(T,{enabled:!t&&a!==`none`,axis:a===`none`?void 0:a})]),k=G.useMemo(()=>E(),[E]),A=G.useMemo(()=>O(),[O]),j=G.useMemo(()=>D(),[D]);return p.useSyncedValues({activeTriggerProps:k,inactiveTriggerProps:A,popupProps:j}),(0,K.jsx)(nE.Provider,{value:p,children:typeof f==`function`?f({payload:_}):f})});function wj(e,t){let n=Aw(t);return n.preventUnmountOnClose=()=>{e.set(`preventUnmountingOnClose`,!0)},n}var Tj=function(e){return e.open=`data-open`,e.closed=`data-closed`,e[e.startingStyle=NA.startingStyle]=`startingStyle`,e[e.endingStyle=NA.endingStyle]=`endingStyle`,e.anchorHidden=`data-anchor-hidden`,e.side=`data-side`,e.align=`data-align`,e}({}),Ej=function(e){return e.popupOpen=`data-popup-open`,e.pressed=`data-pressed`,e}({}),Dj={[Ej.popupOpen]:``},Oj={[Ej.popupOpen]:``,[Ej.pressed]:``},kj={[Tj.open]:``},Aj={[Tj.closed]:``},jj={[Tj.anchorHidden]:``},Mj={open(e){return e?Dj:null}},Nj={open(e){return e?Oj:null}},Pj={open(e){return e?kj:Aj},anchorHidden(e){return e?jj:null}},Fj=G.createContext(void 0);function Ij(){return G.useContext(Fj)}var Lj=function(e){return e[e.popupOpen=Ej.popupOpen]=`popupOpen`,e.triggerDisabled=`data-trigger-disabled`,e}({});$T(function(e,t){let{className:n,render:r,handle:i,payload:a,disabled:o,delay:s,closeOnClick:c=!0,closeDelay:l,id:u,...d}=e,f=rE(!0),p=i?.store??f;if(!p)throw Error(zS(82));let m=yC(u),h=p.useState(`isTriggerActive`,m),g=p.useState(`isOpenedByTrigger`,m),_=p.useState(`floatingRootContext`),v=G.useRef(null),y=s??600,b=l??0,{registerTrigger:x,isMountedByThisTrigger:S}=BA(m,v,p,{payload:a,closeOnClick:c,closeDelay:b}),C=Ij(),{delayRef:w,isInstantPhase:T,hasProvider:E}=gO(_,{open:g});p.useSyncedValue(`isInstantPhase`,T);let D=p.useState(`disabled`),O=o??D,k=p.useState(`trackCursorAxis`),A=p.useState(`disableHoverablePopup`),j=sj(_,{enabled:!O,mouseOnly:!0,move:!1,handleClose:!A&&k!==`both`?bj():null,restMs(){let e=C?.delay,t=typeof w.current==`object`?w.current.open:void 0,n=y;return E&&(n=t===0?0:s??e??y),n},delay(){let e=typeof w.current==`object`?w.current.close:void 0,t=b;return l==null&&E&&(t=e),{close:t}},triggerElementRef:v,isActiveTrigger:h}),M=QA(_,{enabled:!O}).reference,N={open:g},P=p.useState(`triggerProps`,S);return lC(`button`,e,{state:N,ref:[t,x,v],props:[j,M,P,{onPointerDown(){p.set(`closeOnClick`,c)},id:m,[Lj.triggerDisabled]:O?``:void 0},d],stateAttributesMapping:Mj})});var Rj=G.createContext(void 0);function zj(){let e=G.useContext(Rj);if(e===void 0)throw Error(zS(70));return e}var Bj=G.forwardRef(function(e,t){let{children:n,container:r,className:i,render:a,...o}=e,{portalNode:s,portalSubtree:c}=HO({container:r,ref:t,componentProps:e,elementProps:o});return!c&&!s?null:(0,K.jsxs)(G.Fragment,{children:[c,s&&Ev.createPortal(n,s)]})}),Vj=G.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return rE().useState(`mounted`)||n?(0,K.jsx)(Rj.Provider,{value:n,children:(0,K.jsx)(Bj,{ref:t,...r})}):null}),Hj=G.createContext(void 0);function Uj(){let e=G.useContext(Hj);if(e===void 0)throw Error(zS(71));return e}var Wj=G.createContext(void 0);function Gj(){return G.useContext(Wj)?.direction??`ltr`}var Kj=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0,offsetParent:d=`real`}=XE(e,t)||{};if(l==null)return{};let f=mD(u),p={x:n,y:r},m=nD(i),h=eD(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=YE(k,j,A),N=!c.arrow&&QE(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),qj=(e,t)=>({...Kj(e),options:[e,t]}),Jj={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0;return{data:{referenceHidden:(await xA().fn(e)).data?.referenceHidden||a}}}},Yj={sideX:`left`,sideY:`top`},Xj={name:`adaptiveOrigin`,async fn(e){let{x:t,y:n,rects:{floating:r},elements:{floating:i},platform:a,strategy:o,placement:s}=e,c=SC(i),l=c.getComputedStyle(i);if(!(l.transitionDuration!==`0s`&&l.transitionDuration!==``))return{x:t,y:n,data:Yj};let u=await a.getOffsetParent?.(i),d={width:0,height:0};if(o===`fixed`&&c?.visualViewport)d={width:c.visualViewport.width,height:c.visualViewport.height};else if(u===c){let e=rO(i);d={width:e.documentElement.clientWidth,height:e.documentElement.clientHeight}}else await a.isElement?.(u)&&(d=await a.getDimensions(u));let f=ZE(s),p=t,m=n;f===`left`&&(p=d.width-(t+r.width)),f===`top`&&(m=d.height-(n+r.height));let h=f===`left`?`right`:Yj.sideX,g=f===`top`?`bottom`:Yj.sideY;return{x:p,y:m,data:{sideX:h,sideY:g}}}};function Zj(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Qj(e,t,n){let{rects:r,placement:i}=e;return{side:Zj(t,ZE(i),n),align:QE(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function $j(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,collisionBoundary:s,collisionPadding:c=5,sticky:l=!1,arrowPadding:u=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:m,collisionAvoidance:h,shiftCrossAxis:g=!1,nodeId:_,adaptiveOrigin:v,lazyFlip:y=!1,externalTree:b}=e,[x,S]=G.useState(null);!m&&x!==null&&S(null);let C=h.side||`flip`,w=h.align||`flip`,T=h.fallbackAxisSide||`end`,E=typeof t==`function`?t:void 0,D=X(E),O=E?D:t,k=_O(t),A=Gj()===`rtl`,j=x||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":A?`left`:`right`,"inline-start":A?`right`:`left`}[r],M=a===`center`?j:`${j}-${a}`,N=c,P=+(r===`bottom`),F=+(r===`top`),I=+(r===`right`),L=+(r===`left`);typeof N==`number`?N={top:N+P,right:N+L,bottom:N+F,left:N+I}:N&&={top:(N.top||0)+P,right:(N.right||0)+L,bottom:(N.bottom||0)+F,left:(N.left||0)+I};let ee={boundary:s===`clipping-ancestors`?`clippingAncestors`:s,padding:N},R=G.useRef(null),z=_O(i),B=_O(o),V=[gA(e=>{let t=Qj(e,r,A),n=typeof z.current==`function`?z.current(t):z.current,i=typeof B.current==`function`?B.current(t):B.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[typeof i==`function`?0:i,typeof o==`function`?0:o,A,r])],H=w===`none`&&C!==`shift`,U=!H&&(l||g||C===`shift`),W=C===`none`?null:yA({...ee,padding:{top:N.top+1,right:N.right+1,bottom:N.bottom+1,left:N.left+1},mainAxis:!g&&C===`flip`,crossAxis:w===`flip`?`alignment`:!1,fallbackAxisSideDirection:T}),te=H?null:_A(e=>{let t=rO(e.elements.floating).documentElement;return{...ee,rootBoundary:g?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:w!==`none`,crossAxis:U,limiter:l||g?void 0:vA(e=>{if(!R.current)return{};let{width:t,height:n}=R.current.getBoundingClientRect(),r=tD(ZE(e.placement)),i=r===`y`?t:n,a=r===`y`?N.left+N.right:N.top+N.bottom;return{offset:i/2+a/2}})}},[ee,l,g,N,w]);C===`shift`||w===`shift`||a===`center`?V.push(te,W):V.push(W,te),V.push(bA({...ee,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){let i=e.style;i.setProperty(`--available-width`,`${t}px`),i.setProperty(`--available-height`,`${n}px`);let a=window.devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(`--anchor-width`,`${u}px`),i.setProperty(`--anchor-height`,`${d}px`)}}),qj(()=>({element:R.current||document.createElement(`div`),padding:u,offsetParent:`floating`}),[u]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:a,rects:o,y:s}=e,c=ZE(a),l=tD(c),u=R.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof i==`function`?i(Qj(e,r,A)):i,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,U&&l===`y`&&b?S:x),{}}},Jj,v),Z(()=>{!m&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[m,p]);let ne=G.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<`u`,layoutShift:!d&&typeof IntersectionObserver<`u`}),[d]),{refs:re,elements:ie,x:ae,y:oe,middlewareData:se,update:ce,placement:le,context:ue,isPositioned:de,floatingStyles:fe}=YA({rootContext:p,placement:M,middleware:V,strategy:n,whileElementsMounted:f?void 0:(...e)=>nA(...e,ne),nodeId:_,externalTree:b}),{sideX:pe,sideY:me}=se.adaptiveOrigin||Yj,he=de?n:`fixed`,ge=G.useMemo(()=>{let e=v?{position:he,[pe]:ae,[me]:oe}:{position:he,...fe};return de||(e.opacity=0),e},[v,he,pe,ae,me,oe,fe,de]),_e=G.useRef(null);Z(()=>{if(!m)return;let e=k.current,t=typeof e==`function`?e():e,n=(eM(t)?t.current:t)||null;n!==_e.current&&(re.setPositionReference(n),_e.current=n)},[m,re,O,k]),G.useEffect(()=>{if(!m)return;let e=k.current;typeof e!=`function`&&eM(e)&&e.current!==_e.current&&(re.setPositionReference(e.current),_e.current=e.current)},[m,re,O,k]),G.useEffect(()=>{if(f&&m&&ie.domReference&&ie.floating)return nA(ie.domReference,ie.floating,ce,ne)},[f,m,ie,ce,ne]);let ve=ZE(le),ye=Zj(r,ve,A),be=QE(le)||`center`,xe=!!se.hide?.referenceHidden;Z(()=>{y&&m&&de&&S(ve)},[y,m,de,ve]);let Se=G.useMemo(()=>({position:`absolute`,top:se.arrow?.y,left:se.arrow?.x}),[se.arrow]),Ce=se.arrow?.centerOffset!==0;return G.useMemo(()=>({positionerStyles:ge,arrowStyles:Se,arrowRef:R,arrowUncentered:Ce,side:ye,align:be,physicalSide:ve,anchorHidden:xe,refs:re,context:ue,isPositioned:de,update:ce}),[ge,Se,R,Ce,ye,be,ve,xe,re,ue,de,ce])}function eM(e){return e!=null&&`current`in e}function tM(e){return e===`starting`?aC:LS}var nM=G.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`top`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=sC,...g}=e,_=rE(),v=zj(),y=_.useState(`open`),b=_.useState(`mounted`),x=_.useState(`trackCursorAxis`),S=_.useState(`disableHoverablePopup`),C=_.useState(`floatingRootContext`),w=_.useState(`instantType`),T=_.useState(`transitionStatus`),E=$j({anchor:i,positionMethod:a,floatingRootContext:C,mounted:b,side:o,sideOffset:c,align:s,alignOffset:l,collisionBoundary:u,collisionPadding:d,sticky:p,arrowPadding:f,disableAnchorTracking:m,keepMounted:v,collisionAvoidance:h,adaptiveOrigin:_.useState(`hasViewport`)?Xj:void 0}),D=G.useMemo(()=>{let e={};return(!y||x===`both`||S)&&(e.pointerEvents=`none`),{role:`presentation`,hidden:!b,style:{...E.positionerStyles,...e}}},[y,x,S,b,E.positionerStyles]),O=G.useMemo(()=>({open:y,side:E.side,align:E.align,anchorHidden:E.anchorHidden,instant:x===`none`?w:`tracking-cursor`}),[y,E.side,E.align,E.anchorHidden,x,w]),k=G.useMemo(()=>({...O,arrowRef:E.arrowRef,arrowStyles:E.arrowStyles,arrowUncentered:E.arrowUncentered}),[O,E.arrowRef,E.arrowStyles,E.arrowUncentered]),A=lC(`div`,e,{state:O,props:[D,tM(T),g],ref:[t,_.useStateSetter(`positionerElement`)],stateAttributesMapping:Pj});return(0,K.jsx)(Hj.Provider,{value:k,children:A})}),rM={...Pj,...IA},iM=G.forwardRef(function(e,t){let{className:n,render:r,...i}=e,a=rE(),{side:o,align:s}=Uj(),c=a.useState(`open`),l=a.useState(`instantType`),u=a.useState(`transitionStatus`),d=a.useState(`popupProps`),f=a.useState(`floatingRootContext`);RA({open:c,ref:a.context.popupRef,onComplete(){c&&a.context.onOpenChangeComplete?.(!0)}});let p=a.useState(`disabled`),m=a.useState(`closeDelay`);return aj(f,{enabled:!p,closeDelay:m}),lC(`div`,e,{state:{open:c,side:o,align:s,instant:l,transitionStatus:u},ref:[t,a.context.popupRef,a.useStateSetter(`popupElement`)],props:[d,tM(u),i],stateAttributesMapping:rM})});function aM(e){return VS(19)?e:e?`true`:void 0}var oM=(0,G.forwardRef)(({className:e,sideOffset:t=4,children:n,...r},i)=>(0,K.jsx)(Vj,{children:(0,K.jsx)(nM,{sideOffset:t,children:(0,K.jsx)(iM,{ref:i,className:Y(`bg-[#1e1e1e] border border-neutral-700 rounded-md px-2.5 py-1.5 text-xs text-neutral-300 font-mono shadow-lg`,e),...r,children:n})})}));oM.displayName=`TooltipContent`;function sM(e){return e===`online`?`#22c55e`:e===`syncing`?`#f59e0b`:`#ef4444`}var cM=(0,G.forwardRef)(({className:e,clients:t,positions:n,relayClientIds:r=[],serverPosition:i={x:420,y:190},relayPosition:a={x:780,y:190},viewBox:o={width:1200,height:380},totalNodes:s,onlineCount:c,offlineCount:l,...u},d)=>{let f=i.x,p=i.y,m=a.x,h=a.y,g={},_=2*Math.PI/Math.max(t.length,1);t.forEach((e,t)=>{let n=r.includes(e.id),i=n?m:f,a=n?h:p,o=n?240:260,s=n?130:150,c=_*t-Math.PI/2;g[e.id]={x:i+o*Math.cos(c),y:a+s*Math.sin(c)}});let v={};if(n)for(let e of n)v[e.clientId]={x:e.x,y:e.y};function y(e){return v[e]??g[e]??{x:600,y:190}}let b=s??t.length+2,x=c??t.filter(e=>e.status!==`offline`).length,S=l??t.filter(e=>e.status===`offline`).length;return(0,K.jsxs)(`div`,{ref:d,className:Y(`relative overflow-hidden`,`bg-[radial-gradient(ellipse_at_35%_50%,rgba(59,130,246,0.06)_0%,transparent_50%),radial-gradient(ellipse_at_68%_50%,rgba(139,92,246,0.04)_0%,transparent_40%),#0c0c0c]`,`bg-[image:radial-gradient(circle_at_1px_1px,#1a1a1a_1px,transparent_0)] bg-[size:24px_24px]`,e),style:{height:420},...u,children:[(0,K.jsx)(`div`,{className:`absolute left-0 right-0 h-px bg-[linear-gradient(90deg,transparent,rgba(59,130,246,0.3),transparent)] animate-[scanSweep_6s_ease-in-out_infinite] pointer-events-none`}),(0,K.jsx)(`div`,{className:`absolute top-4 left-5 z-10`,children:(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-500 uppercase tracking-widest`,children:`Sync Topology`})}),(0,K.jsxs)(`div`,{className:`absolute top-4 right-5 z-10 flex items-center gap-3`,children:[(0,K.jsxs)(`span`,{className:`font-mono text-[10px] text-neutral-600`,children:[b,` nodes`]}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-600`,children:`·`}),(0,K.jsxs)(`span`,{className:`font-mono text-[10px] text-healthy`,children:[x,` online`]}),(0,K.jsx)(`span`,{className:`font-mono text-[10px] text-neutral-600`,children:`·`}),(0,K.jsxs)(`span`,{className:`font-mono text-[10px] text-offline`,children:[S,` offline`]})]}),(0,K.jsxs)(`svg`,{viewBox:`0 0 ${o.width} ${o.height}`,className:`w-full h-full`,preserveAspectRatio:`xMidYMid meet`,children:[(0,K.jsx)(`ellipse`,{cx:f,cy:p,rx:280,ry:160,fill:`none`,stroke:`#1a1a1a`,strokeWidth:.5,strokeDasharray:`6 10`}),(0,K.jsx)(`ellipse`,{cx:m,cy:h,rx:260,ry:140,fill:`none`,stroke:`#1a1a1a`,strokeWidth:.5,strokeDasharray:`6 10`}),(0,K.jsx)(`line`,{x1:f,y1:p,x2:m,y2:h,stroke:`#8b5cf6`,strokeWidth:2,opacity:.3}),(0,K.jsx)(`line`,{x1:f,y1:p,x2:m,y2:h,stroke:`#8b5cf6`,strokeWidth:1,strokeDasharray:`4 2`,opacity:.6,children:(0,K.jsx)(`animate`,{attributeName:`stroke-dashoffset`,from:`20`,to:`0`,dur:`1s`,repeatCount:`indefinite`})}),(0,K.jsxs)(`circle`,{r:3,fill:`#8b5cf6`,opacity:.8,children:[(0,K.jsx)(`animateMotion`,{dur:`2.5s`,repeatCount:`indefinite`,path:`M${f},${p} L${m},${h}`}),(0,K.jsx)(`animate`,{attributeName:`opacity`,values:`0;0.8;0.8;0`,dur:`2.5s`,repeatCount:`indefinite`})]}),(0,K.jsxs)(`circle`,{r:3,fill:`#8b5cf6`,opacity:.8,children:[(0,K.jsx)(`animateMotion`,{dur:`2.5s`,begin:`1.25s`,repeatCount:`indefinite`,path:`M${m},${h} L${f},${p}`}),(0,K.jsx)(`animate`,{attributeName:`opacity`,values:`0;0.8;0.8;0`,dur:`2.5s`,begin:`1.25s`,repeatCount:`indefinite`})]}),(0,K.jsx)(`text`,{x:(f+m)/2,y:p-20,textAnchor:`middle`,fill:`#8b5cf6`,fontFamily:`JetBrains Mono, monospace`,fontSize:8,opacity:.4,letterSpacing:2,children:`BACKBONE`}),t.map(e=>{let t=y(e.id),n=r.includes(e.id),i=n?m:f,a=n?h:p,o=sM(e.status),s=e.status===`syncing`?2.5:1.5;if(e.status===`offline`)return(0,K.jsx)(`line`,{x1:i,y1:a,x2:t.x,y2:t.y,stroke:o,strokeWidth:1,strokeDasharray:`3 6`,opacity:.2},`line-${e.id}`);let c=e.status===`syncing`?`1.2s`:`2.8s`,l=`${Number.parseFloat(c)/2}s`;return(0,K.jsxs)(`g`,{children:[(0,K.jsx)(`line`,{x1:i,y1:a,x2:t.x,y2:t.y,stroke:o,strokeWidth:s,strokeDasharray:`4 2`,children:(0,K.jsx)(`animate`,{attributeName:`stroke-dashoffset`,from:`20`,to:`0`,dur:`1s`,repeatCount:`indefinite`})}),(0,K.jsxs)(`circle`,{r:2.5,fill:o,opacity:.7,children:[(0,K.jsx)(`animateMotion`,{dur:c,repeatCount:`indefinite`,path:`M${i},${a} L${t.x},${t.y}`}),(0,K.jsx)(`animate`,{attributeName:`opacity`,values:`0;0.7;0.7;0`,dur:c,repeatCount:`indefinite`})]}),(0,K.jsxs)(`circle`,{r:2,fill:o,opacity:.5,children:[(0,K.jsx)(`animateMotion`,{dur:c,begin:l,repeatCount:`indefinite`,path:`M${t.x},${t.y} L${i},${a}`}),(0,K.jsx)(`animate`,{attributeName:`opacity`,values:`0;0.5;0.5;0`,dur:c,begin:l,repeatCount:`indefinite`})]})]},`line-${e.id}`)}),(0,K.jsxs)(`circle`,{cx:f,cy:p,r:50,fill:`none`,stroke:`#3b82f6`,strokeWidth:.5,opacity:.15,children:[(0,K.jsx)(`animate`,{attributeName:`r`,from:`32`,to:`60`,dur:`3s`,repeatCount:`indefinite`}),(0,K.jsx)(`animate`,{attributeName:`opacity`,from:`0.25`,to:`0`,dur:`3s`,repeatCount:`indefinite`})]}),(0,K.jsxs)(`circle`,{cx:f,cy:p,r:50,fill:`none`,stroke:`#3b82f6`,strokeWidth:.5,opacity:.15,children:[(0,K.jsx)(`animate`,{attributeName:`r`,from:`32`,to:`60`,dur:`3s`,begin:`1.5s`,repeatCount:`indefinite`}),(0,K.jsx)(`animate`,{attributeName:`opacity`,from:`0.25`,to:`0`,dur:`3s`,begin:`1.5s`,repeatCount:`indefinite`})]}),(0,K.jsx)(`circle`,{cx:f,cy:p,r:32,fill:`#0c0c0c`,stroke:`#3b82f6`,strokeWidth:2,style:{filter:`drop-shadow(0 0 12px rgba(59,130,246,0.4))`}}),(0,K.jsx)(`circle`,{cx:f,cy:p,r:16,fill:`rgba(59,130,246,0.12)`,stroke:`#3b82f6`,strokeWidth:.8}),(0,K.jsx)(`circle`,{cx:f,cy:p,r:6,fill:`#3b82f6`}),(0,K.jsx)(`text`,{x:f,y:p+48,textAnchor:`middle`,fill:`#444`,fontFamily:`JetBrains Mono, monospace`,fontSize:9,letterSpacing:2.5,children:`SERVER`}),(0,K.jsxs)(`circle`,{cx:m,cy:h,r:40,fill:`none`,stroke:`#8b5cf6`,strokeWidth:.5,opacity:.15,children:[(0,K.jsx)(`animate`,{attributeName:`r`,from:`26`,to:`48`,dur:`3.5s`,repeatCount:`indefinite`}),(0,K.jsx)(`animate`,{attributeName:`opacity`,from:`0.2`,to:`0`,dur:`3.5s`,repeatCount:`indefinite`})]}),(0,K.jsx)(`circle`,{cx:m,cy:h,r:26,fill:`#0c0c0c`,stroke:`#8b5cf6`,strokeWidth:2,style:{filter:`drop-shadow(0 0 10px rgba(139,92,246,0.35))`}}),(0,K.jsx)(`circle`,{cx:m,cy:h,r:13,fill:`rgba(139,92,246,0.12)`,stroke:`#8b5cf6`,strokeWidth:.8}),(0,K.jsx)(`circle`,{cx:m,cy:h,r:5,fill:`#8b5cf6`}),(0,K.jsx)(`text`,{x:m,y:h+42,textAnchor:`middle`,fill:`#444`,fontFamily:`JetBrains Mono, monospace`,fontSize:9,letterSpacing:2.5,children:`RELAY`}),t.map(e=>{let t=y(e.id),n=sM(e.status),i=e.status===`offline`?.25:1,a=e.actor.replace(`user-`,``).replace(`svc-`,``),o=r.includes(e.id);return(0,K.jsxs)(`g`,{opacity:i,children:[(0,K.jsx)(`circle`,{cx:t.x,cy:t.y,r:20,fill:`#0c0c0c`,stroke:n,strokeWidth:1.5}),(0,K.jsx)(`circle`,{cx:t.x,cy:t.y,r:5,fill:n}),(0,K.jsx)(`text`,{x:t.x,y:t.y+32,textAnchor:`middle`,fill:`#555`,fontFamily:`JetBrains Mono, monospace`,fontSize:9,children:a}),(0,K.jsxs)(`text`,{x:t.x,y:t.y+42,textAnchor:`middle`,fill:`#333`,fontFamily:`JetBrains Mono, monospace`,fontSize:7,children:[e.type,o?` · relay`:``]})]},`node-${e.id}`)})]})]})});cM.displayName=`TopologyHero`;var lM=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.indeterminate=`data-indeterminate`,e.disabled=`data-disabled`,e.readonly=`data-readonly`,e.required=`data-required`,e.valid=`data-valid`,e.invalid=`data-invalid`,e.touched=`data-touched`,e.dirty=`data-dirty`,e.filled=`data-filled`,e.focused=`data-focused`,e}({});function uM(e){return G.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[lM.checked]:``}:{[lM.unchecked]:``}},...rw}),[e.indeterminate])}var dM=G.createContext({disabled:!1});function fM(){return G.useContext(dM)}var pM=G.createContext(void 0);function mM(e=!0){let t=G.useContext(pM);if(t===void 0&&!e)throw Error(zS(3));return t}var hM=G.createContext(void 0);function gM(){let e=G.useContext(hM);if(e===void 0)throw Error(zS(14));return e}var _M=`data-parent`,vM=G.forwardRef(function(e,t){let{checked:n,className:r,defaultChecked:i=!1,"aria-labelledby":a,disabled:o=!1,id:s,indeterminate:c=!1,inputRef:l,name:u,onCheckedChange:d,parent:f=!1,readOnly:p=!1,render:m,required:h=!1,uncheckedValue:g,value:_,nativeButton:v=!1,...y}=e,{clearErrors:b}=cw(),{disabled:x,name:S,setDirty:C,setFilled:w,setFocused:T,setTouched:E,state:D,validationMode:O,validityData:k,shouldValidateOnChange:A,validation:j}=uw(),M=fM(),{labelId:N,controlId:P,registerControlId:F,getDescriptionProps:I}=pw(),L=mM(),ee=L?.parent,R=ee&&L.allValues,z=x||M.disabled||L?.disabled||o,B=S??u,V=_??B,H=yC(),U=yC(),W=P;R?W=f?U:`${ee.id}-${V}`:s&&(W=s);let te={};R&&(f?te=L.parent.getParentProps():V&&(te=L.parent.getChildProps(V)));let ne=X(d),{checked:re=n,indeterminate:ie=c,onCheckedChange:ae,...oe}=te,se=L?.value,ce=L?.setValue,le=L?.defaultValue,ue=G.useRef(null),de=xS(()=>Symbol(`checkbox-control`)),fe=G.useRef(!1),{getButtonProps:pe,buttonRef:me}=JC({disabled:z,native:v}),he=L?.validation??j,[ge,_e]=yS({controlled:V&&se&&!f?se.includes(V):re,default:V&&le&&!f?le.includes(V):i,name:`Checkbox`,state:`checked`});Z(()=>{F!==FS&&(fe.current=!0,F(de.current,W))},[W,L,F,f,de]),G.useEffect(()=>{let e=de.current;return()=>{!fe.current||F===FS||(fe.current=!1,F(e,void 0))}},[F,de]),dw({enabled:!L,id:H,commit:he.commit,value:ge,controlRef:ue,name:B,getValue:()=>ge});let ve=G.useRef(null),ye=ES(l,ve,he.inputRef),be=mw(a,N,ve,!v,W??void 0);Z(()=>{ve.current&&(ve.current.indeterminate=ie,ge&&w(!0))},[ge,ie,w]),jw(ge,()=>{L&&!f||(b(B),w(ge),C(ge!==k.initialValue),A()?he.commit(ge):he.commit(ge,!0))});let xe=JS({checked:ge,disabled:z,name:f?void 0:B,id:v?void 0:W??void 0,required:h,ref:ye,style:B?PS:NS,tabIndex:-1,type:`checkbox`,"aria-hidden":!0,onChange(e){if(e.nativeEvent.defaultPrevented)return;let t=e.target.checked,n=Aw(vw,e.nativeEvent);ae?.(t,n),ne(t,n),!n.isCanceled&&(_e(t),V&&se&&ce&&!f&&ce(t?[...se,V]:se.filter(e=>e!==V),n))},onFocus(){ue.current?.focus()}},_===void 0?LS:{value:(L?ge&&_:_)||``},I,L?he.getValidationProps:he.getInputValidationProps),Se=R?!!re:ge,Ce=R&&ie||c;G.useEffect(()=>{if(!ee||!V)return;let e=ee.disabledStatesRef.current;return e.set(V,z),()=>{e.delete(V)}},[ee,z,V]);let we=G.useMemo(()=>({...D,checked:Se,disabled:z,readOnly:p,required:h,indeterminate:Ce}),[D,Se,z,p,h,Ce]),Te=uM(we),Ee=lC(`span`,e,{state:we,ref:[me,ue,t,L?.registerControlRef],props:[{id:v?W??void 0:H,role:`checkbox`,"aria-checked":ie?`mixed`:ge,"aria-readonly":p||void 0,"aria-required":h||void 0,"aria-labelledby":be,[_M]:f?``:void 0,onFocus(){T(!0)},onBlur(){let e=ve.current;e&&(E(!0),T(!1),O===`onBlur`&&he.commit(L?se:e.checked))},onClick(e){p||z||(e.preventDefault(),ve.current?.dispatchEvent(new PointerEvent(`click`,{bubbles:!0,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey})))}},I,he.getValidationProps,y,oe,pe],stateAttributesMapping:Te});return(0,K.jsxs)(hM.Provider,{value:we,children:[Ee,!ge&&!L&&B&&!f&&g!==void 0&&(0,K.jsx)(`input`,{type:`hidden`,name:B,value:g}),(0,K.jsx)(`input`,{...xe})]})}),yM=G.forwardRef(function(e,t){let{render:n,className:r,keepMounted:i=!1,...a}=e,o=gM(),s=o.checked||o.indeterminate,{mounted:c,transitionStatus:l,setMounted:u}=MA(s),d=G.useRef(null),f={...o,transitionStatus:l};RA({open:s,ref:d,onComplete(){s||u(!1)}});let p=uM(o),m=G.useMemo(()=>({...p,...IA,...rw}),[p]),h=i||c,g=lC(`span`,e,{ref:[t,d],state:f,stateAttributesMapping:m,props:a});return h?g:null}),bM=(0,G.forwardRef)(({className:e,label:t,...n},r)=>{let i=(0,K.jsx)(vM,{ref:r,className:Y(`w-[15px] h-[15px] border-[1.5px] border-neutral-700 rounded-full flex items-center justify-center cursor-pointer transition-all duration-200`,`data-[checked]:bg-healthy data-[checked]:border-healthy data-[checked]:shadow-[0_0_6px_rgba(34,197,94,0.3)]`,e),...n,children:(0,K.jsx)(yM,{className:`flex items-center justify-center text-white`,children:(0,K.jsx)(`svg`,{width:`8`,height:`8`,viewBox:`0 0 8 8`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,K.jsx)(`path`,{d:`M1.5 4L3.25 5.75L6.5 2.25`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`})})})});return t?(0,K.jsxs)(`span`,{className:`inline-flex items-center gap-2 cursor-pointer font-mono text-[11px] text-neutral-400`,children:[i,(0,K.jsx)(`span`,{children:t})]}):i});bM.displayName=`Checkbox`;var xM=G.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function SM(e=!1){let t=G.useContext(xM);if(!t&&!e)throw Error(zS(86));return t}var CM=function(e){let t=yC(),n=e.controlId===void 0?t:e.controlId,[r,i]=G.useState(n),[a,o]=G.useState(e.labelId),[s,c]=G.useState([]),l=xS(()=>new Map),{messageIds:u}=pw(),d=X((e,t)=>{let n=l.current;if(t===void 0){n.delete(e);return}n.set(e,t),i(e=>{if(n.size===0)return;let t;for(let r of n.values()){if(e!==void 0&&r===e)return e;t===void 0&&(t=r)}return t})}),f=G.useCallback(e=>JS({"aria-describedby":u.concat(s).join(` `)||void 0},e),[u,s]),p=G.useMemo(()=>({controlId:r,registerControlId:d,labelId:a,setLabelId:o,messageIds:s,setMessageIds:c,getDescriptionProps:f}),[r,d,a,o,s,c,f]);return(0,K.jsx)(fw.Provider,{value:p,children:e.children})},wM=Object.keys(ew);function TM(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(let n of wM)n!==`valid`&&(n===`valueMissing`&&(t=e[n]),e[n]&&(t=!1));return t}function EM(e){let{formRef:t,clearErrors:n}=cw(),{setValidityData:r,validate:i,validityData:a,validationDebounceTime:o,invalid:s,markedDirtyRef:c,state:l,name:u,shouldValidateOnChange:d}=e,{controlId:f,getDescriptionProps:p}=pw(),m=cE(),h=G.useRef(null),g=X(async(e,n=!1)=>{let o=h.current;if(!o)return;if(n){if(l.valid!==!1)return;let n=o.validity;if(!n.valueMissing){let n={value:e,state:{...ew,valid:!0},error:``,errors:[],initialValue:a.initialValue};if(o.setCustomValidity(``),f){let e=t.current.fields.get(f);e&&t.current.fields.set(f,{...e,...ow(n,!1)})}r(n);return}let i=wM.reduce((e,t)=>(e[t]=n[t],e),{});if(!i.valid&&!TM(i))return}function u(e){let t=wM.reduce((t,n)=>(t[n]=e.validity[n],t),{}),n=!1;for(let e of wM)if(e!==`valid`){if(e===`valueMissing`&&t[e])n=!0;else if(t[e])return t}return n&&!c.current&&(t.valid=!0,t.valueMissing=!1),t}m.clear();let p=null,g=[],_=u(o),v,y=d();if(o.validationMessage&&!y)v=o.validationMessage,g=[o.validationMessage];else{let n=i(e,Array.from(t.current.fields.values()).reduce((e,t)=>(t.name&&(e[t.name]=t.getValue()),e),{}));p=typeof n==`object`&&n&&`then`in n?await n:n,p===null?y&&(o.setCustomValidity(``),_.customError=!1,o.validationMessage?(v=o.validationMessage,g=[o.validationMessage]):o.validity.valid&&!_.valid&&(_.valid=!0)):(_.valid=!1,_.customError=!0,Array.isArray(p)?(g=p,o.setCustomValidity(p.join(`
19
+ `))):p&&(g=[p],o.setCustomValidity(p)))}let b={value:e,state:_,error:v??(Array.isArray(p)?p[0]:p??``),errors:g,initialValue:a.initialValue};if(f){let e=t.current.fields.get(f);e&&t.current.fields.set(f,{...e,...ow(b,s)})}r(b)}),_=G.useCallback((e={})=>JS(p,l.valid===!1?{"aria-invalid":!0}:LS,e),[p,l.valid]),v=G.useCallback((e={})=>JS({onChange(e){if(e.nativeEvent.defaultPrevented)return;if(n(u),!d()){g(e.currentTarget.value,!0);return}let t=e.currentTarget;if(t.value===``){g(t.value);return}m.clear(),o?m.start(o,()=>{g(t.value)}):g(t.value)}},_(e)),[_,n,u,m,g,o,d]);return G.useMemo(()=>({getValidationProps:_,getInputValidationProps:v,inputRef:h,commit:g}),[_,v,g])}var DM=G.forwardRef(function(e,t){let{errors:n,validationMode:r,submitAttemptedRef:i}=cw(),{render:a,className:o,validate:s,validationDebounceTime:c=0,validationMode:l=r,name:u,disabled:d=!1,invalid:f,dirty:p,touched:m,actionsRef:h,...g}=e,{disabled:_}=SM(),v=X(s||(()=>null)),y=_||d,[b,x]=G.useState(!1),[S,C]=G.useState(!1),[w,T]=G.useState(!1),[E,D]=G.useState(!1),O=p??S,k=m??b,A=G.useRef(!1),j=X(e=>{p===void 0&&(e&&(A.current=!0),C(e))}),M=X(e=>{m===void 0&&x(e)}),N=X(()=>l===`onChange`||l===`onSubmit`&&i.current),P=!!u&&Object.hasOwn(n,u)&&n[u]!==void 0,F=f===!0||P,[I,L]=G.useState({state:ew,error:``,errors:[],value:null,initialValue:null}),ee=!F&&I.state.valid,R=G.useMemo(()=>({disabled:y,touched:k,dirty:O,valid:ee,filled:w,focused:E}),[y,k,O,ee,w,E]),z=EM({setValidityData:L,validate:v,validityData:I,validationDebounceTime:c,invalid:F,markedDirtyRef:A,state:R,name:u,shouldValidateOnChange:N}),B=G.useCallback(()=>{A.current=!0,z.commit(I.value)},[z,I]);G.useImperativeHandle(h,()=>({validate:B}),[B]);let V=G.useMemo(()=>({invalid:F,name:u,validityData:I,setValidityData:L,disabled:y,touched:k,setTouched:M,dirty:O,setDirty:j,filled:w,setFilled:T,focused:E,setFocused:D,validate:v,validationMode:l,validationDebounceTime:c,shouldValidateOnChange:N,state:R,markedDirtyRef:A,validation:z}),[F,u,I,y,k,M,O,j,w,T,E,D,v,l,c,N,R,z]),H=lC(`div`,e,{ref:t,state:R,props:g,stateAttributesMapping:rw});return(0,K.jsx)(lw.Provider,{value:V,children:H})}),OM=G.forwardRef(function(e,t){return(0,K.jsx)(CM,{children:(0,K.jsx)(DM,{...e,ref:t})})});function kM(e,t){let n=yC(e);return Z(()=>(t(n),()=>{t(void 0)}),[n,t]),n}function AM(e={}){let{id:t,fallbackControlId:n,native:r=!1,setLabelId:i,focusControl:a}=e,{controlId:o,setLabelId:s}=pw(),c=kM(t,X(e=>{s(e),i?.(e)})),l=o??n;function u(e){if(a){a(e,l);return}if(!l)return;let t=rO(e.currentTarget).getElementById(l);EC(t)&&jM(t)}function d(e){DE(e.nativeEvent)?.closest(`button,input,select,textarea`)||(!e.defaultPrevented&&e.detail>1&&e.preventDefault(),!r&&u(e))}return r?{id:c,htmlFor:l??void 0,onMouseDown:d}:{id:c,onClick:d,onPointerDown(e){e.preventDefault()}}}function jM(e){e.focus({focusVisible:!0})}var MM=G.forwardRef(function(e,t){let{render:n,className:r,id:i,nativeLabel:a=!0,...o}=e,s=uw(!1),{labelId:c}=pw(),l=G.useRef(null),u=AM({id:c??i,native:a});return lC(`label`,e,{ref:[t,l],state:s.state,props:[u,o],stateAttributesMapping:rw})}),NM={...rw,...IA},PM=G.forwardRef(function(e,t){let{render:n,id:r,className:i,match:a,...o}=e,s=yC(r),{validityData:c,state:l,name:u}=uw(!1),{setMessageIds:d}=pw(),{errors:f}=cw(),p=u?f[u]:null,m=!1;m=p||a===!0?!0:a?!!c.state[a]:c.state.valid===!1;let{mounted:h,transitionStatus:g,setMounted:_}=MA(m);Z(()=>{if(!(!m||!s))return d(e=>e.concat(s)),()=>{d(e=>e.filter(e=>e!==s))}},[m,s,d]);let v=G.useRef(null),[y,b]=G.useState(null),[x,S]=G.useState(null),C=p||(c.errors.length>1?(0,K.jsx)(`ul`,{children:c.errors.map(e=>(0,K.jsx)(`li`,{children:e},e))}):c.error),w=c.error;p==null?c.errors.length>1&&(w=JSON.stringify(c.errors)):w=Array.isArray(p)?JSON.stringify(p):p,m&&w!==x&&(S(w),b(C)),RA({open:m,ref:v,onComplete(){m||_(!1)}});let T={...l,transitionStatus:g},E=lC(`div`,e,{ref:[t,v],state:T,props:[{id:s,children:m?C:y},o],stateAttributesMapping:NM,enabled:h});return h?E:null}),FM=G.forwardRef(function(e,t){let{render:n,id:r,className:i,...a}=e,o=yC(r),s=uw(!1),{setMessageIds:c}=pw();return Z(()=>{if(o)return c(e=>e.concat(o)),()=>{c(e=>e.filter(e=>e!==o))}},[o,c]),lC(`p`,e,{ref:t,state:s.state,props:[{id:o},a],stateAttributesMapping:rw})}),IM=OM,LM=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(MM,{ref:n,className:Y(`font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5`,e),...t}));LM.displayName=`FieldLabel`;var RM=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(FM,{ref:n,className:Y(`font-mono text-[9px] text-neutral-600 mt-0.5`,e),...t}));RM.displayName=`FieldDescription`;var zM=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(PM,{ref:n,className:Y(`font-mono text-[10px] text-offline mt-1`,e),...t}));zM.displayName=`FieldError`;var BM=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`div`,{ref:n,className:Y(e),...t}));BM.displayName=`FieldContent`;var VM=G.createContext(null),HM=G.createContext(null);function UM(){let e=G.useContext(VM);if(e===null)throw Error(zS(60));return e}function WM(){let e=G.useContext(HM);if(e===null)throw Error(zS(61));return e}function GM(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function KM(e,t,n){return!e||e.length===0?!1:e.some(e=>e===void 0?!1:GM(t,e,n))}function qM(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e===void 0?!1:GM(e,t,n))}function JM(e,t,n){return e.filter(e=>!GM(t,e,n))}function YM(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function XM(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function ZM(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(XM(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function QM(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?YM(e.value):YM(e)}var $M={id:$(e=>e.id),labelId:$(e=>e.labelId),modal:$(e=>e.modal),multiple:$(e=>e.multiple),items:$(e=>e.items),itemToStringLabel:$(e=>e.itemToStringLabel),itemToStringValue:$(e=>e.itemToStringValue),isItemEqualToValue:$(e=>e.isItemEqualToValue),value:$(e=>e.value),hasSelectedValue:$(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:QM(t,r)!==``}),hasNullItemLabel:$((e,t)=>t?ZM(e.items):!1),open:$(e=>e.open),mounted:$(e=>e.mounted),forceMount:$(e=>e.forceMount),transitionStatus:$(e=>e.transitionStatus),openMethod:$(e=>e.openMethod),activeIndex:$(e=>e.activeIndex),selectedIndex:$(e=>e.selectedIndex),isActive:$((e,t)=>e.activeIndex===t),isSelected:$((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>GM(n,e,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:GM(n,i,r)}),isSelectedByFocus:$((e,t)=>e.selectedIndex===t),popupProps:$(e=>e.popupProps),triggerProps:$(e=>e.triggerProps),triggerElement:$(e=>e.triggerElement),positionerElement:$(e=>e.positionerElement),listElement:$(e=>e.listElement),scrollUpArrowVisible:$(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:$(e=>e.scrollDownArrowVisible),hasScrollArrows:$(e=>e.hasScrollArrows)};function eN(e){let t=G.useRef(``),n=G.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:G.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function tN(e){let[t,n]=G.useState(null),r=X((t,r)=>{e||n(r||(mE?`touch`:``))});jw(e,t=>{t&&!e&&n(null)});let{onClick:i,onPointerDown:a}=eN(r);return G.useMemo(()=>({openMethod:t,triggerProps:{onClick:i,onPointerDown:a}}),[t,i,a])}function nN(e,t){return e??t}function rN(e){let t=e.getBoundingClientRect(),n=window.getComputedStyle(e,`::before`),r=window.getComputedStyle(e,`::after`);if(!(n.content!==`none`||r.content!==`none`))return t;let i=parseFloat(n.width)||0,a=parseFloat(n.height)||0,o=parseFloat(r.width)||0,s=parseFloat(r.height)||0,c=Math.max(t.width,i,o),l=Math.max(t.height,a,s),u=c-t.width,d=l-t.height;return{left:t.left-u/2,right:t.right+u/2,top:t.top-d/2,bottom:t.bottom+d/2}}var iN=2,aN=400,oN=200,sN={...Nj,...rw,value:()=>null},cN=G.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,...s}=e,{setTouched:c,setFocused:l,validationMode:u,state:d,disabled:f}=uw(),{labelId:p}=pw(),{store:m,setOpen:h,selectionRef:g,validation:_,readOnly:v,required:y,alignItemWithTriggerActiveRef:b,disabled:x,keyboardActiveRef:S}=UM(),C=f||x||a,w=wA(m,$M.open),T=wA(m,$M.value),E=wA(m,$M.triggerProps),D=wA(m,$M.positionerElement),O=wA(m,$M.listElement),k=wA(m,$M.id),A=wA(m,$M.labelId),j=wA(m,$M.hasSelectedValue),M=!j&&w,N=wA(m,$M.hasNullItemLabel,M),P=i??k,F=nN(p,A);_w({id:P});let I=_O(D),L=G.useRef(null),{getButtonProps:ee,buttonRef:R}=JC({disabled:C,native:o}),z=ES(t,L,R,X(e=>{m.set(`triggerElement`,e)})),B=cE(),V=cE(),H=cE(),U=cE();G.useEffect(()=>{if(w)return j||N?U.start(oN,()=>{g.current.allowUnselectedMouseUp=!0,H.start(oN,()=>{g.current.allowSelectedMouseUp=!0})}):H.start(aN,()=>{g.current.allowUnselectedMouseUp=!0,g.current.allowSelectedMouseUp=!0}),()=>{H.clear(),U.clear()};g.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},V.clear()},[w,j,N,g,V,H,U]);let W=G.useMemo(()=>O?.id??NE(D)?.id,[O,D]),te=JS(E,{id:P,role:`combobox`,"aria-expanded":w?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":w?W:void 0,"aria-labelledby":F,"aria-readonly":v||void 0,"aria-required":y||void 0,tabIndex:C?-1:0,ref:z,onFocus(e){l(!0),w&&b.current&&h(!1,Aw(vw,e.nativeEvent)),B.start(0,()=>{m.set(`forceMount`,!0)})},onBlur(e){TE(D,e.relatedTarget)||(c(!0),l(!1),u===`onBlur`&&_.commit(T))},onPointerMove(){S.current=!1},onKeyDown(){S.current=!0},onMouseDown(e){if(w)return;let t=rO(e.currentTarget);function n(e){if(!L.current)return;let t=e.target;if(TE(L.current,t)||TE(I.current,t)||t===L.current)return;let n=rN(L.current);e.clientX>=n.left-iN&&e.clientX<=n.right+iN&&e.clientY>=n.top-iN&&e.clientY<=n.bottom+iN||h(!1,Aw(Ew,e))}V.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},_.getValidationProps,s,ee);te.role=`combobox`;let ne={...d,open:w,disabled:C,value:T,readOnly:v,placeholder:!j};return lC(`button`,e,{ref:[t,L],state:ne,stateAttributesMapping:sN,props:te})}),lN=G.createContext(void 0),uN=G.forwardRef(function(e,t){let{store:n}=UM(),r=wA(n,$M.mounted),i=wA(n,$M.forceMount);return r||i?(0,K.jsx)(lN.Provider,{value:!0,children:(0,K.jsx)(UO,{ref:t,...e})}):null}),dN={},fN={},pN=``;function mN(e){if(typeof document>`u`)return!1;let t=rO(e);return SC(t).innerWidth-t.documentElement.clientWidth>0}function hN(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=rO(e),n=t.documentElement,r=t.body,i=OC(n)?n:r,a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function gN(e){let t=rO(e),n=t.documentElement,r=t.body,i=OC(n)?n:r,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function _N(e){let t=rO(e),n=t.documentElement,r=t.body,i=SC(n),a=0,o=0,s=!1,c=xO.create();if(pE&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,dN={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},pN=n.style.scrollBehavior,fN={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=OC(n)?n:r;if(s=hN(e),s){n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`;return}Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflow:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`}function u(){Object.assign(n.style,dN),Object.assign(r.style,fN),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=pN)}function d(){u(),c.request(l)}return l(),i.addEventListener(`resize`,d),()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&i.removeEventListener(`resize`,d)}}var vN=new class{lockCount=0;restore=null;timeoutLock=sE.create();timeoutUnlock=sE.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=rO(e).documentElement,n=SC(t).getComputedStyle(t).overflowY;if(n===`hidden`||n===`clip`){this.restore=FS;return}let r=mE||!mN(e);this.restore=r?gN(e):_N(e)}};function yN(e=!0,t=null){Z(()=>{if(e)return vN.acquire(t)},[e,t])}var bN=G.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function xN(){return G.useContext(bN)}function SN(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=X(i),o=G.useRef(0),s=xS(wN).current,c=xS(CN).current,[l,u]=G.useState(0),d=G.useRef(l),f=X((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=X(e=>{c.delete(e),d.current+=1,u(d.current)}),m=G.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(TN).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);Z(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),Z(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),Z(()=>()=>{n.current=[]},[n]),Z(()=>()=>{r&&(r.current=[])},[r]);let h=X(e=>(s.add(e),()=>{s.delete(e)}));Z(()=>{s.forEach(e=>e(m))},[s,m]);let g=G.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,K.jsx)(bN.Provider,{value:g,children:t})}function CN(){return new Map}function wN(){return new Set}function TN(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var EN=G.createContext(void 0);function DN(){let e=G.useContext(EN);if(!e)throw Error(zS(59));return e}var ON=G.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n?.getBoundingClientRect();i=`polygon(
20
+ 0% 0%,
21
+ 100% 0%,
22
+ 100% 100%,
23
+ 0% 100%,
24
+ 0% 0%,
25
+ ${e.left}px ${e.top}px,
26
+ ${e.left}px ${e.bottom}px,
27
+ ${e.right}px ${e.bottom}px,
28
+ ${e.right}px ${e.top}px,
29
+ ${e.left}px ${e.top}px
30
+ )`}return(0,K.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function kN(e,t){e&&Object.assign(e.style,t)}var AN={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`},jN={position:`fixed`},MN=G.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=oC,..._}=e,{store:v,listRef:y,labelsRef:b,alignItemWithTriggerActiveRef:x,selectedItemTextRef:S,valuesRef:C,initialValueRef:w,popupRef:T,setValue:E}=UM(),D=WM(),O=wA(v,$M.open),k=wA(v,$M.mounted),A=wA(v,$M.modal),j=wA(v,$M.value),M=wA(v,$M.openMethod),N=wA(v,$M.positionerElement),P=wA(v,$M.triggerElement),F=wA(v,$M.isItemEqualToValue),I=wA(v,$M.transitionStatus),L=G.useRef(null),ee=G.useRef(null),[R,z]=G.useState(h),B=k&&R&&M!==`touch`;!k&&R!==h&&z(h),Z(()=>{k||($M.scrollUpArrowVisible(v.state)&&v.set(`scrollUpArrowVisible`,!1),$M.scrollDownArrowVisible(v.state)&&v.set(`scrollDownArrowVisible`,!1))},[v,k]),G.useImperativeHandle(x,()=>B),yN((B||A)&&O&&M!==`touch`,P);let V=$j({anchor:n,floatingRootContext:D,positionMethod:r,mounted:k,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??B,collisionAvoidance:g,keepMounted:!0}),H=B?`none`:V.side,U=B?jN:V.positionerStyles,W=G.useMemo(()=>{let e={};return O||(e.pointerEvents=`none`),{role:`presentation`,hidden:!k,style:{...U,...e}}},[O,k,U]),te={open:O,side:H,align:V.align,anchorHidden:V.anchorHidden},ne=lC(`div`,e,{ref:[t,X(e=>{v.set(`positionerElement`,e)})],state:te,stateAttributesMapping:Pj,props:[W,tM(I),_]}),re=G.useRef(0),ie=X(e=>{if(e.size===0&&re.current===0||C.current.length===0)return;let t=re.current;if(re.current=e.size,e.size===t)return;let n=Aw(vw);if(t!==0&&!v.state.multiple&&j!==null&&qM(C.current,j,F)===-1){let e=w.current,t=e!=null&&qM(C.current,e,F)!==-1?e:null;E(t,n),t===null&&(v.set(`selectedIndex`,null),S.current=null)}if(t!==0&&v.state.multiple&&Array.isArray(j)){let e=e=>qM(C.current,e,F)!==-1,t=j.filter(t=>e(t));(t.length!==j.length||t.some(e=>!KM(j,e,F)))&&(E(t,n),t.length===0&&(v.set(`selectedIndex`,null),S.current=null))}if(O&&B){v.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};kN(N,e),kN(T.current,e)}}),ae=G.useMemo(()=>({...V,side:H,alignItemWithTriggerActive:B,setControlledAlignItemWithTrigger:z,scrollUpArrowRef:L,scrollDownArrowRef:ee}),[V,H,B,z]);return(0,K.jsx)(SN,{elementsRef:y,labelsRef:b,onMapChange:ie,children:(0,K.jsxs)(EN.Provider,{value:ae,children:[k&&A&&(0,K.jsx)(ON,{inert:aM(!O),cutout:P}),ne]})})});function NN(e){let t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}var PN=`base-ui-disable-scrollbar`,FN={className:PN,getElement(e){return(0,K.jsx)(`style`,{nonce:e,href:PN,precedence:`base-ui:low`,children:`.${PN}{scrollbar-width:none}.${PN}::-webkit-scrollbar{display:none}`})}},IN=G.createContext(void 0);function LN(e){let t=G.useContext(IN);if(t===void 0&&!e)throw Error(zS(69));return t}var RN=`ArrowUp`,zN=`ArrowDown`,BN=`ArrowLeft`,VN=`ArrowRight`,HN=`Home`,UN=new Set([BN,VN]),WN=new Set([BN,VN,HN,`End`]),GN=new Set([RN,zN]),KN=new Set([RN,zN,HN,`End`]),qN=new Set([...UN,...GN]),JN=new Set([...qN,HN,`End`]),YN=new Set([RN,zN,BN,VN,HN,`End`]),XN=new Set([`Shift`,`Control`,`Alt`,`Meta`]);function ZN(e){return EC(e)&&e.tagName===`INPUT`}function QN(e){return!!(ZN(e)&&e.selectionStart!=null||EC(e)&&e.tagName===`TEXTAREA`)}function $N(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=eP(e,t,`left`),a=tP(e),o=tP(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginRight<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=eP(e,t,`top`),r=tP(e),i=tP(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function eP(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function tP(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function nP(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}var rP=G.createContext(void 0),iP={disableStyleElements:!1};function aP(){return G.useContext(rP)??iP}var oP=1,sP={...Pj,...IA},cP=G.forwardRef(function(e,t){let{render:n,className:r,finalFocus:i,...a}=e,{store:o,popupRef:s,onOpenChangeComplete:c,setOpen:l,valueRef:u,selectedItemTextRef:d,keyboardActiveRef:f,multiple:p,handleScrollArrowVisibility:m,scrollHandlerRef:h,highlightItemOnHover:g}=UM(),{side:_,align:v,alignItemWithTriggerActive:y,setControlledAlignItemWithTrigger:b,scrollDownArrowRef:x,scrollUpArrowRef:S}=DN(),C=LN(!0)!=null,w=WM(),{nonce:T,disableStyleElements:E}=aP(),D=cE(),O=wA(o,$M.id),k=wA(o,$M.open),A=wA(o,$M.mounted),j=wA(o,$M.popupProps),M=wA(o,$M.transitionStatus),N=wA(o,$M.triggerElement),P=wA(o,$M.positionerElement),F=wA(o,$M.listElement),I=G.useRef(0),L=G.useRef(!1),ee=G.useRef(0),R=G.useRef(!1),z=G.useRef({}),B=SO(),V=X(e=>{if(!P||!s.current||!R.current)return;if(L.current||!y){m();return}let t=P.style.top===`0px`,n=P.style.bottom===`0px`,r=P.getBoundingClientRect().height,i=rO(P),a=getComputedStyle(P),o=parseFloat(a.marginTop),c=parseFloat(a.marginBottom),l=lP(getComputedStyle(s.current)),u=Math.min(i.documentElement.clientHeight-o-c,l),d=e.scrollTop,f=uP(e),p=0,h=null,g=!1,_=!1,v=e=>{P.style.height=`${e}px`},b=(t,n)=>{let i=nP(t,0,u-r);i>0&&v(r+i),e.scrollTop=n,u-(r+i)<=oP&&(L.current=!0),m()};if(t){let e=f-d,t=r+e,n=Math.min(t,u);if(p=n,e<=oP){b(e,f);return}u-n>oP?_=!0:g=!0}else if(n){let e=d,t=r+e,n=Math.min(t,u),i=t-u;if(p=n,e<=oP){b(e,0);return}u-n>oP?h=0:(g=!0,d<f&&(h=d-(e-i)))}if(p=Math.ceil(p),p!==0&&v(p),_||h!=null){let t=uP(e),n=_?t:nP(h,0,t);Math.abs(e.scrollTop-n)>oP&&(e.scrollTop=n)}(g||p>=u-oP)&&(L.current=!0),m()});G.useImperativeHandle(h,()=>V,[V]),RA({open:k,ref:s,onComplete(){k&&c?.(!0)}});let H={open:k,transitionStatus:M,side:_,align:v};Z(()=>{!P||!s.current||Object.keys(z.current).length||(z.current={top:P.style.top||`0`,left:P.style.left||`0`,right:P.style.right,height:P.style.height,bottom:P.style.bottom,minHeight:P.style.minHeight,maxHeight:P.style.maxHeight,marginTop:P.style.marginTop,marginBottom:P.style.marginBottom})},[s,P]),Z(()=>{k||y||(R.current=!1,L.current=!1,I.current=0,ee.current=0,kN(P,z.current))},[k,y,P,s]),Z(()=>{let e=s.current;if(!(!k||!N||!P||!e||o.state.transitionStatus===`ending`)){if(!y){R.current=!0,B.request(m),e.style.removeProperty(`--transform-origin`);return}queueMicrotask(()=>{let t=mP(e);e.style.removeProperty(`--transform-origin`);try{let t=getComputedStyle(P),n=getComputedStyle(e),r=rO(N),i=SC(P),a=dP(N),o=fP(N.getBoundingClientRect(),a),s=fP(P.getBoundingClientRect(),a),c=o.left,l=o.height,f=F||e,p=f.scrollHeight,h=parseFloat(n.borderBottomWidth),g=parseFloat(t.marginTop)||10,_=parseFloat(t.marginBottom)||10,v=parseFloat(t.minHeight)||100,y=lP(n),x=r.documentElement.clientHeight-g-_,S=r.documentElement.clientWidth,C=x-o.bottom+l,w=d.current,T=u.current,E,D=0,O=0;if(w&&T){let e=fP(T.getBoundingClientRect(),a);E=fP(w.getBoundingClientRect(),a);let t=e.left-c,n=E.left-s.left,r=e.top-o.top+e.height/2,i=E.top-s.top+E.height/2;D=t-n,O=i-r}let k=C+O+_+h,A=Math.min(x,k),j=x-g-_,M=k-A,ee=Math.max(5,c+D),B=S-5,V=Math.max(0,ee+s.width-B);P.style.left=`${ee-V}px`,P.style.height=`${A}px`,P.style.maxHeight=`auto`,P.style.marginTop=`${g}px`,P.style.marginBottom=`${_}px`,e.style.height=`100%`;let H=uP(f),U=M>=H-oP;U&&(A=Math.min(x,s.height)-(M-H));let W=o.top<20||o.bottom>x-20||Math.ceil(A)+oP<Math.min(p,v),te=(i.visualViewport?.scale??1)!==1&&pE;if(W||te){R.current=!0,kN(P,z.current),Ev.flushSync(()=>b(!1));return}if(U){let e=Math.max(0,x-k);P.style.top=s.height>=j?`0`:`${e}px`,P.style.height=`${A}px`,f.scrollTop=uP(f),I.current=Math.max(v,A)}else P.style.bottom=`0`,I.current=Math.max(v,A),f.scrollTop=M;if(E){let t=s.top,n=s.height,r=E.top+E.height/2,i=nP(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(I.current===x||A>=y)&&(L.current=!0),m(),setTimeout(()=>{R.current=!0})}finally{t()}})}},[o,k,P,N,u,d,s,m,y,b,B,x,S,F]),G.useEffect(()=>{if(!y||!P||!k)return;let e=SC(P);function t(e){l(!1,Aw(kw,e))}return e.addEventListener(`resize`,t),()=>{e.removeEventListener(`resize`,t)}},[l,y,P,k]);let U={...F?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":p||void 0,id:`${O}-list`},onKeyDown(e){f.current=!0,C&&YN.has(e.key)&&e.stopPropagation()},onMouseMove(){f.current=!1},onPointerLeave(e){if(!g||NN(e)||e.pointerType===`touch`)return;let t=e.currentTarget;D.start(0,()=>{o.set(`activeIndex`,null),t.focus({preventScroll:!0})})},onScroll(e){F||V(e.currentTarget)},...y&&{style:F?{height:`100%`}:AN}},W=lC(`div`,e,{ref:[t,s],state:H,stateAttributesMapping:sP,props:[j,U,tM(M),{className:!F&&y?FN.className:void 0},a]});return(0,K.jsxs)(G.Fragment,{children:[!E&&FN.getElement(T),(0,K.jsx)(ak,{context:w,modal:!1,disabled:!A,returnFocus:i,restoreFocus:!0,children:W})]})});function lP(e){let t=e.maxHeight||``;return t.endsWith(`px`)&&parseFloat(t)||1/0}function uP(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function dP(e){return $k.getScale(e)}function fP(e,t){return hD({x:e.x/t.x,y:e.y/t.y,width:e.width/t.x,height:e.height/t.y})}var pP=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function mP(e){let{style:t}=e,n={};for(let[e,r]of pP)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of pP){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var hP=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function gP(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=xN(),f=G.useRef(-1),[p,m]=G.useState(a??(i===hP.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=G.useRef(null),g=G.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return Z(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),Z(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),G.useMemo(()=>({ref:g,index:p}),[p,g])}var _P=G.createContext(void 0),vP=G.memo(G.forwardRef(function(e,t){let{render:n,className:r,value:i=null,label:a,disabled:o=!1,nativeButton:s=!1,...c}=e,l=G.useRef(null),u=gP({label:a,textRef:l,indexGuessBehavior:hP.GuessFromOrder}),{store:d,getItemProps:f,setOpen:p,setValue:m,selectionRef:h,typingRef:g,valuesRef:_,keyboardActiveRef:v,multiple:y,highlightItemOnHover:b}=UM(),x=cE(),S=wA(d,$M.isActive,u.index),C=wA(d,$M.isSelected,u.index,i),w=wA(d,$M.isSelectedByFocus,u.index),T=wA(d,$M.isItemEqualToValue),E=u.index,D=E!==-1,O=G.useRef(null),k=_O(E);Z(()=>{if(!D)return;let e=_.current;return e[E]=i,()=>{delete e[E]}},[D,E,i,_]),Z(()=>{if(!D)return;let e=d.state.value,t=e;y&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&GM(i,t,T)&&d.set(`selectedIndex`,E)},[D,E,y,T,d,i]);let A={disabled:o,selected:C,highlighted:S},j=f({active:S,selected:C});j.onFocus=void 0,j.id=void 0;let M=G.useRef(null),N=G.useRef(`mouse`),P=G.useRef(!1),{getButtonProps:F,buttonRef:I}=JC({disabled:o,focusableWhenDisabled:!0,native:s,composite:!0});function L(e){let t=d.state.value;if(y){let n=Array.isArray(t)?t:[];m(C?JM(n,i,T):[...n,i],Aw(Cw,e))}else m(i,Aw(Cw,e)),p(!1,Aw(Cw,e))}let ee={role:`option`,"aria-selected":C,tabIndex:S?0:-1,onFocus(){d.set(`activeIndex`,E)},onMouseEnter(){!v.current&&d.state.selectedIndex===null&&b&&d.set(`activeIndex`,E)},onMouseMove(){b&&d.set(`activeIndex`,E)},onMouseLeave(e){!b||v.current||NN(e)||x.start(0,()=>{d.state.activeIndex===E&&d.set(`activeIndex`,null)})},onTouchStart(){h.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(e){M.current=e.key,d.set(`activeIndex`,E),e.key===` `&&g.current&&e.preventDefault()},onClick(e){P.current=!1,!(e.type===`keydown`&&M.current===null)&&(o||e.type===`keydown`&&M.current===` `&&g.current||N.current!==`touch`&&!S||(M.current=null,L(e.nativeEvent)))},onPointerEnter(e){N.current=e.pointerType},onPointerDown(e){N.current=e.pointerType,P.current=!0},onMouseUp(){if(o)return;if(P.current){P.current=!1;return}let e=!h.current.allowSelectedMouseUp&&C,t=!h.current.allowUnselectedMouseUp&&!C;e||t||N.current!==`touch`&&!S||O.current?.click()}},R=lC(`div`,e,{ref:[I,t,u.ref,O],state:A,props:[j,ee,c,F]}),z=G.useMemo(()=>({selected:C,indexRef:k,textRef:l,selectedByFocus:w,hasRegistered:D}),[C,k,l,w,D]);return(0,K.jsx)(_P.Provider,{value:z,children:R})})),yP=(0,G.forwardRef)(({className:e,children:t,...n},r)=>(0,K.jsx)(cN,{ref:r,className:Y(`inline-flex items-center justify-between bg-surface border border-border rounded-md px-3 py-1.5 font-mono text-[12px] text-foreground cursor-pointer hover:border-border-bright transition`,e),...n,children:t}));yP.displayName=`SelectTrigger`;var bP=(0,G.forwardRef)(({className:e,portalProps:t,positionerProps:n,...r},i)=>(0,K.jsx)(uN,{...t,children:(0,K.jsx)(MN,{...n,children:(0,K.jsx)(cP,{ref:i,className:Y(`bg-panel border border-border rounded-md py-1 shadow-lg z-50`,e),...r})})}));bP.displayName=`SelectContent`;var xP=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(vP,{ref:n,className:Y(`font-mono text-[11px] px-3 py-1.5 text-neutral-400 cursor-pointer hover:bg-white/[0.03] hover:text-white data-[highlighted]:bg-white/[0.03] data-[highlighted]:text-white outline-none`,e),...t}));xP.displayName=`SelectItem`;var SP=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`textarea`,{ref:n,className:Y(`bg-surface border border-border rounded-md px-3 py-2 font-mono text-[12px] text-foreground outline-none w-full transition focus:border-flow placeholder:text-neutral-600 resize-none min-h-[80px]`,e),...t}));SP.displayName=`Textarea`;var CP=G.createContext(void 0);function wP(e=!0){let t=G.useContext(CP);if(t===void 0&&!e)throw Error(zS(7));return t}function TP(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=KC(),{ref:i,index:a}=gP(e),o=n===a,s=G.useRef(null),c=ES(i,s);return{compositeProps:G.useMemo(()=>({tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}}),[o,r,a,t]),compositeRef:c,index:a}}function EP(e){let{render:t,className:n,state:r=LS,props:i=IS,refs:a=IS,metadata:o,stateAttributesMapping:s,tag:c=`div`,...l}=e,{compositeProps:u,compositeRef:d}=TP({metadata:o});return lC(c,e,{state:r,ref:[...a,d],props:[u,...i,l],stateAttributesMapping:s})}var DP=G.forwardRef(function(e,t){let{className:n,defaultPressed:r=!1,disabled:i=!1,form:a,onPressedChange:o,pressed:s,render:c,type:l,value:u,nativeButton:d=!0,...f}=e,p=yC(u||void 0),m=wP(),h=m?.value??[],g=m?void 0:r,_=(i||m?.disabled)??!1,[v,y]=yS({controlled:m?p!==void 0&&h.indexOf(p)>-1:s,default:g,name:`Toggle`,state:`pressed`}),b=X((e,t)=>{p&&m?.setGroupValue?.(p,e,t),o?.(e,t)}),{getButtonProps:x,buttonRef:S}=JC({disabled:_,native:d}),C={disabled:_,pressed:v},w=[S,t],T=[{"aria-pressed":v,onClick(e){let t=!v,n=Aw(vw,e.nativeEvent);b(t,n),!n.isCanceled&&y(t)}},f,x],E=lC(`button`,e,{enabled:!m,state:C,ref:w,props:T});return m?(0,K.jsx)(EP,{tag:`button`,render:c,className:n,state:C,refs:w,props:T}):E}),OP=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(DP,{ref:n,className:Y(`font-mono text-[10px] text-neutral-500 border border-transparent rounded-sm px-2.5 py-1 cursor-pointer transition-all hover:text-neutral-300 data-[pressed]:text-white data-[pressed]:border-border-bright data-[pressed]:bg-white/[0.03]`,e),...t}));OP.displayName=`Toggle`;function kP(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var AP=`data-composite-item-active`,jP=[];function MP(e){let{itemSizes:t,cols:n=1,loopFocus:r=!0,dense:i=!1,orientation:a=`both`,direction:o,highlightedIndex:s,onHighlightedIndexChange:c,rootRef:l,enableHomeAndEndKeys:u=!1,stopEventPropagation:d=!1,disabledIndices:f,modifierKeys:p=jP}=e,[m,h]=G.useState(0),g=n>1,_=G.useRef(null),v=ES(_,l),y=G.useRef([]),b=G.useRef(!1),x=s??m,S=X((e,t=!1)=>{if((c??h)(e),t){let t=y.current[e];$N(_.current,t,o,a)}}),C=X(e=>{if(e.size===0||b.current)return;b.current=!0;let t=Array.from(e.keys()),n=t.find(e=>e?.hasAttribute(`data-composite-item-active`))??null,r=n?t.indexOf(n):-1;r!==-1&&S(r),$N(_.current,n,o,a)}),w=G.useMemo(()=>({"aria-orientation":a===`both`?void 0:a,ref:v,onFocus(e){!_.current||!QN(e.target)||e.target.setSelectionRange(0,e.target.value.length??0)},onKeyDown(e){let s=u?JN:qN;if(!s.has(e.key)||NP(e,p)||!_.current)return;let c=o===`rtl`,l=c?BN:VN,m={horizontal:l,vertical:zN,both:l}[a],h=c?VN:BN,v={horizontal:h,vertical:RN,both:h}[a];if(QN(e.target)&&!kP(e.target)){let t=e.target.selectionStart,n=e.target.selectionEnd,r=e.target.value??``;if(t==null||e.shiftKey||t!==n||e.key!==v&&t<r.length||e.key!==m&&t>0)return}let b=x,C=vD(y,f),w=yD(y,f);if(g){let o=t||Array.from({length:y.current.length},()=>({width:1,height:1})),s=SD(o,n,i),l=s.findIndex(e=>e!=null&&!TD(y,e,f)),u=s.reduce((e,t,n)=>t!=null&&!TD(y,t,f)?n:e,-1);b=s[xD({current:s.map(e=>e?y.current[e]:null)},{event:e,orientation:a,loopFocus:r,cols:n,disabledIndices:wD([...f||y.current.map((e,t)=>TD(y,t)?t:void 0),void 0],s),minIndex:l,maxIndex:u,prevIndex:CD(x>w?C:x,o,s,n,e.key===`ArrowDown`?`bl`:e.key===`ArrowRight`?`tr`:`tl`),rtl:c})]}let T={horizontal:[l],vertical:[zN],both:[l,zN]}[a],E={horizontal:[h],vertical:[RN],both:[h,RN]}[a],D=g?s:{horizontal:u?WN:UN,vertical:u?KN:GN,both:s}[a];u&&(e.key===`Home`?b=C:e.key===`End`&&(b=w)),b===x&&(T.includes(e.key)||E.includes(e.key))&&(b=r&&b===w&&T.includes(e.key)?C:r&&b===C&&E.includes(e.key)?w:bD(y,{startingIndex:b,decrement:E.includes(e.key),disabledIndices:f})),b!==x&&!_D(y,b)&&(d&&e.stopPropagation(),D.has(e.key)&&e.preventDefault(),S(b,!0),queueMicrotask(()=>{y.current[b]?.focus()}))}}),[n,i,o,f,y,u,x,g,t,r,v,p,S,a,d]);return G.useMemo(()=>({props:w,highlightedIndex:x,onHighlightedIndexChange:S,elementsRef:y,disabledIndices:f,onMapChange:C,relayKeyboardEvent:w.onKeyDown}),[w,x,S,y,f,C])}function NP(e,t){for(let n of XN.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function PP(e){let{render:t,className:n,refs:r=IS,props:i=IS,state:a=LS,stateAttributesMapping:o,highlightedIndex:s,onHighlightedIndexChange:c,orientation:l,dense:u,itemSizes:d,loopFocus:f,cols:p,enableHomeAndEndKeys:m,onMapChange:h,stopEventPropagation:g=!0,rootRef:_,disabledIndices:v,modifierKeys:y,highlightItemOnHover:b=!1,tag:x=`div`,...S}=e,{props:C,highlightedIndex:w,onHighlightedIndexChange:T,elementsRef:E,onMapChange:D,relayKeyboardEvent:O}=MP({itemSizes:d,cols:p,loopFocus:f,dense:u,orientation:l,highlightedIndex:s,onHighlightedIndexChange:c,rootRef:_,stopEventPropagation:g,enableHomeAndEndKeys:m,direction:Gj(),disabledIndices:v,modifierKeys:y}),k=lC(x,e,{state:a,ref:r,props:[C,...i,S],stateAttributesMapping:o}),A=G.useMemo(()=>({highlightedIndex:w,onHighlightedIndexChange:T,highlightItemOnHover:b,relayKeyboardEvent:O}),[w,T,b,O]);return(0,K.jsx)(GC.Provider,{value:A,children:(0,K.jsx)(SN,{elementsRef:E,onMapChange:e=>{h?.(e),D(e)},children:k})})}var FP=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e.multiple=`data-multiple`,e}({}),IP={multiple(e){return e?{[FP.multiple]:``}:null}},LP=G.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:a,orientation:o=`horizontal`,multiple:s=!1,value:c,className:l,render:u,...d}=e,f=LN(!0),p=G.useMemo(()=>{if(c===void 0)return n??[]},[c,n]),m=G.useMemo(()=>c!==void 0||n!==void 0,[c,n]),h=(f?.disabled??!1)||r,[g,_]=yS({controlled:c,default:p,name:`ToggleGroup`,state:`value`}),v=X((e,t,n)=>{let r;if(s?(r=g.slice(),t?r.push(e):r.splice(g.indexOf(e),1)):r=t?[e]:[],Array.isArray(r)){if(a?.(r,n),n.isCanceled)return;_(r)}}),y={disabled:h,multiple:s,orientation:o},b=G.useMemo(()=>({disabled:h,orientation:o,setGroupValue:v,value:g,isValueInitialized:m}),[h,o,v,g,m]),x={role:`group`},S=lC(`div`,e,{enabled:!!f,state:y,ref:t,props:[x,d],stateAttributesMapping:IP});return(0,K.jsx)(CP.Provider,{value:b,children:f?S:(0,K.jsx)(PP,{render:u,className:l,state:y,refs:[t],props:[x,d],stateAttributesMapping:IP,loopFocus:i,enableHomeAndEndKeys:!0})})}),RP=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(LP,{ref:n,className:Y(`flex items-center gap-0.5`,e),...t}));RP.displayName=`ToggleGroup`;var zP=Y(Yw({variant:`secondary`,size:`sm`}),`h-7 whitespace-nowrap uppercase tracking-[0.08em] leading-none no-underline`);function BP({active:e,onClick:t,children:n,className:r}){return(0,K.jsxs)(`button`,{type:`button`,onClick:t,className:Y(`font-mono text-[10px] tracking-[1.5px] uppercase bg-transparent border-none px-3.5 py-1 cursor-pointer relative transition-colors`,e?`text-white`:`text-neutral-500 hover:text-neutral-300`,r),children:[n,e&&(0,K.jsx)(`span`,{className:`absolute -bottom-2.5 left-1/2 -translate-x-1/2 w-4 h-0.5 bg-flow rounded-sm shadow-[0_0_8px_rgba(59,130,246,0.5)]`})]})}function VP({items:e,activeId:t,onItemChange:n,renderItem:r,className:i}){return(0,K.jsx)(`div`,{className:Y(`flex items-center gap-0.5`,i),children:e.map(e=>{let i=e.id===t,a=()=>n?.(e.id);return r?(0,K.jsx)(`span`,{children:r(e,{active:i,onClick:a})},e.id):(0,K.jsx)(BP,{active:i,onClick:a,children:e.label},e.id)})})}var HP=gS(`rounded-full inline-block flex-shrink-0`,{variants:{color:{healthy:`bg-healthy`,syncing:`bg-syncing`,offline:`bg-offline`,flow:`bg-flow`,relay:`bg-relay`,encrypt:`bg-encrypt`,muted:`bg-neutral-500`},size:{sm:`w-1.5 h-1.5`,md:`w-2 h-2`,lg:`w-2.5 h-2.5`},glow:{true:``,false:``}},defaultVariants:{color:`healthy`,size:`sm`,glow:!1}}),UP={healthy:`0 0 6px #22c55e`,syncing:`0 0 6px #f59e0b`,offline:`0 0 6px #ef4444`,flow:`0 0 6px #3b82f6`,relay:`0 0 6px #8b5cf6`,encrypt:`0 0 6px #f472b6`,muted:`none`};function WP({color:e,size:t,glow:n,pulse:r,className:i}){return(0,K.jsx)(`span`,{className:Y(HP({color:e,size:t,glow:n}),r&&`dot-pulse`,i),style:n?{boxShadow:UP[e??`healthy`]}:void 0})}var GP={name:`@syncular/ui`,version:`0.0.6-247`,description:`Reusable Syncular UI components and styles`,license:`Apache-2.0`,author:`Benjamin Kniffler`,homepage:`https://syncular.dev`,repository:{type:`git`,url:`https://github.com/syncular/syncular.git`,directory:`packages/ui`},bugs:{url:`https://github.com/syncular/syncular/issues`},keywords:[`sync`,`offline-first`,`realtime`,`ui`,`react`],publishConfig:{access:`public`},type:`module`,exports:{".":{bun:`./src/index.ts`,browser:`./src/index.ts`,import:{types:`./dist/index.d.ts`,default:`./dist/index.js`}},"./charts":{bun:`./src/charts/index.ts`,browser:`./src/charts/index.ts`,import:{types:`./dist/charts/index.d.ts`,default:`./dist/charts/index.js`}},"./console":{bun:`./src/console/index.ts`,browser:`./src/console/index.ts`,import:{types:`./dist/console/index.d.ts`,default:`./dist/console/index.js`}},"./forms":{bun:`./src/forms/index.ts`,browser:`./src/forms/index.ts`,import:{types:`./dist/forms/index.d.ts`,default:`./dist/forms/index.js`}},"./primitives":{bun:`./src/primitives/index.ts`,browser:`./src/primitives/index.ts`,import:{types:`./dist/primitives/index.d.ts`,default:`./dist/primitives/index.js`}},"./observable-universe":{bun:`./src/observable-universe/index.ts`,browser:`./src/observable-universe/index.ts`,import:{types:`./dist/observable-universe/index.d.ts`,default:`./dist/observable-universe/index.js`}},"./demo":{bun:`./src/demo/index.ts`,browser:`./src/demo/index.ts`,import:{types:`./dist/demo/index.d.ts`,default:`./dist/demo/index.js`}},"./navigation":{bun:`./src/navigation/index.ts`,browser:`./src/navigation/index.ts`,import:{types:`./dist/navigation/index.d.ts`,default:`./dist/navigation/index.js`}},"./styles.css":`./dist/styles.css`,"./styles.source.css":`./src/styles/styles.css`,"./styles/tokens.css":`./src/styles/tokens.css`,"./package.json":`./package.json`},files:[`dist`,`src`],scripts:{tsgo:`tsgo --noEmit`,"build:css":`bunx @tailwindcss/cli -i src/styles/styles.css -o dist/styles.css`,build:`tsgo && bun run build:css`,release:`bunx syncular-publish`},peerDependencies:{react:`^19.0.0`,"react-dom":`^19.0.0`},dependencies:{"@base-ui/react":`^1.3.0`,"class-variance-authority":`^0.7.1`,clsx:`^2.1.1`,"lucide-react":`^1.7.0`,recharts:`^3.8.1`,"tailwind-merge":`^3.5.0`,tailwindcss:`^4.2.2`},devDependencies:{"@syncular/config":`workspace:*`,"@tailwindcss/cli":`^4.2.2`,"@types/react":`^19.2.14`}}.version;function KP({label:e,className:t}){return(0,K.jsxs)(`div`,{className:Y(`flex items-center gap-3`,t),children:[(0,K.jsx)(WP,{color:`healthy`,size:`md`,glow:!0}),(0,K.jsx)(`span`,{className:`font-display font-bold text-white text-sm tracking-tight`,children:`syncular`}),e&&(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-neutral-600 uppercase tracking-widest`,children:e}),(0,K.jsxs)(`span`,{className:`font-mono text-[9px] text-neutral-600 tracking-wider`,children:[`v`,GP]})]})}function qP({brand:e,center:t,right:n,className:r}){return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{"aria-hidden":`true`,className:`h-[42px] shrink-0`}),(0,K.jsxs)(`nav`,{className:Y(`fixed top-0 left-0 right-0 z-100 h-[42px] border-b border-border bg-surface/88 backdrop-blur-lg flex items-center justify-between px-5`,r),children:[(0,K.jsx)(`div`,{className:`flex items-center gap-3`,children:e}),(0,K.jsx)(`div`,{className:`flex items-center gap-0.5`,children:t}),(0,K.jsx)(`div`,{className:`flex items-center gap-2`,children:n})]})]})}var JP=gS(`border rounded-lg p-3 font-mono text-[11px]`,{variants:{variant:{default:`border-border bg-panel`,destructive:`border-offline/20 bg-offline/5 text-offline`}},defaultVariants:{variant:`default`}}),YP=(0,G.forwardRef)(({className:e,variant:t,...n},r)=>(0,K.jsx)(`div`,{ref:r,role:`alert`,className:Y(JP({variant:t,className:e})),...n}));YP.displayName=`Alert`;var XP=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`h5`,{ref:n,className:Y(`font-medium text-white mb-1`,e),...t}));XP.displayName=`AlertTitle`;var ZP=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`p`,{ref:n,className:Y(`text-neutral-400`,e),...t}));ZP.displayName=`AlertDescription`;var QP=G.createContext(void 0);function $P(e){let t=G.useContext(QP);if(e===!1&&t===void 0)throw Error(zS(27));return t}var eF={...Pj,...IA},tF=G.forwardRef(function(e,t){let{render:n,className:r,forceRender:i=!1,...a}=e,{store:o}=$P(),s=o.useState(`open`),c=o.useState(`nested`),l=o.useState(`mounted`);return lC(`div`,e,{state:{open:s,transitionStatus:o.useState(`transitionStatus`)},ref:[o.context.backdropRef,t],stateAttributesMapping:eF,props:[{role:`presentation`,hidden:!l,style:{userSelect:`none`,WebkitUserSelect:`none`}},a],enabled:i||!c})}),nF=G.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=$P(),s=yC(i);return o.useSyncedValueWithCleanup(`descriptionElementId`,s),lC(`p`,e,{ref:t,props:[{id:s},a]})}),rF=function(e){return e.nestedDialogs=`--nested-dialogs`,e}({}),iF=function(e){return e[e.open=Tj.open]=`open`,e[e.closed=Tj.closed]=`closed`,e[e.startingStyle=Tj.startingStyle]=`startingStyle`,e[e.endingStyle=Tj.endingStyle]=`endingStyle`,e.nested=`data-nested`,e.nestedDialogOpen=`data-nested-dialog-open`,e}({}),aF=G.createContext(void 0);function oF(){let e=G.useContext(aF);if(e===void 0)throw Error(zS(26));return e}var sF={...Pj,...IA,nestedDialogOpen(e){return e?{[iF.nestedDialogOpen]:``}:null}},cF=G.forwardRef(function(e,t){let{className:n,finalFocus:r,initialFocus:i,render:a,...o}=e,{store:s}=$P(),c=s.useState(`descriptionElementId`),l=s.useState(`disablePointerDismissal`),u=s.useState(`floatingRootContext`),d=s.useState(`popupProps`),f=s.useState(`modal`),p=s.useState(`mounted`),m=s.useState(`nested`),h=s.useState(`nestedOpenDialogCount`),g=s.useState(`open`),_=s.useState(`openMethod`),v=s.useState(`titleElementId`),y=s.useState(`transitionStatus`),b=s.useState(`role`);oF(),RA({open:g,ref:s.context.popupRef,onComplete(){g&&s.context.onOpenChangeComplete?.(!0)}});function x(e){return e===`touch`?s.context.popupRef.current:!0}let S=i===void 0?x:i,C=lC(`div`,e,{state:{open:g,nested:m,transitionStatus:y,nestedDialogOpen:h>0},props:[d,{"aria-labelledby":v??void 0,"aria-describedby":c??void 0,role:b,tabIndex:-1,hidden:!p,onKeyDown(e){YN.has(e.key)&&e.stopPropagation()},style:{[rF.nestedDialogs]:h}},o],ref:[t,s.context.popupRef,s.useStateSetter(`popupElement`)],stateAttributesMapping:sF});return(0,K.jsx)(ak,{context:u,openInteractionType:_,disabled:!p,closeOnFocusOut:!l,initialFocus:S,returnFocus:r,modal:f!==!1,restoreFocus:`popup`,children:C})}),lF=G.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i}=$P(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,K.jsx)(aF.Provider,{value:n,children:(0,K.jsxs)(UO,{ref:t,...r,children:[a&&o===!0&&(0,K.jsx)(ON,{ref:i.context.internalBackdropRef,inert:aM(!s)}),e.children]})}):null});function uF(e){let{store:t,parentContext:n,actionsRef:r}=e,i=t.useState(`open`),a=t.useState(`disablePointerDismissal`),o=t.useState(`modal`),s=t.useState(`popupElement`),{openMethod:c,triggerProps:l}=tN(i);VA(t);let{forceUnmount:u}=HA(i,t),d=X(e=>{let n=Aw(e);return n.preventUnmountOnClose=()=>{t.set(`preventUnmountingOnClose`,!0)},n}),f=G.useCallback(()=>{t.setOpen(!1,d(Ow))},[t,d]);G.useImperativeHandle(r,()=>({unmount:u,close:f}),[u,f]);let p=XA({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[m,h]=G.useState(0),g=m===0,_=fj(p),v=fk(p,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?`intentional`:{mouse:o===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(e){if(!t.context.outsidePressEnabledRef.current||`button`in e&&e.button!==0||`touches`in e&&e.touches.length!==1)return!1;let n=DE(e);if(g&&!a){let e=n;return o&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===e||t.context.backdropRef.current===e||TE(e,s)&&!e?.hasAttribute(`data-base-ui-portal`):!0}return!1},escapeKey:g});yN(i&&o===!0,s);let{getReferenceProps:y,getFloatingProps:b,getTriggerProps:x}=cj([_,v]);t.useContextCallback(`onNestedDialogOpen`,e=>{h(e+1)}),t.useContextCallback(`onNestedDialogClose`,()=>{h(0)}),G.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(m),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,m]);let S=G.useMemo(()=>y(l),[y,l]),C=G.useMemo(()=>x(l),[x,l]),w=G.useMemo(()=>b(),[b]);t.useSyncedValues({openMethod:c,activeTriggerProps:S,inactiveTriggerProps:C,popupProps:w,floatingRootContext:p,nestedOpenDialogCount:m})}var dF={...qA,modal:$(e=>e.modal),nested:$(e=>e.nested),nestedOpenDialogCount:$(e=>e.nestedOpenDialogCount),disablePointerDismissal:$(e=>e.disablePointerDismissal),openMethod:$(e=>e.openMethod),descriptionElementId:$(e=>e.descriptionElementId),titleElementId:$(e=>e.titleElementId),viewportElement:$(e=>e.viewportElement),role:$(e=>e.role)},fF=class extends kA{constructor(e){super(pF(e),{popupRef:G.createRef(),backdropRef:G.createRef(),internalBackdropRef:G.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new UA,onOpenChange:void 0,onOpenChangeComplete:void 0},dF)}setOpen=(e,t)=>{if(t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;let n={open:e,nativeEvent:t.event,reason:t.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit(`openchange`,n);let r={open:e},i=t.trigger?.id??null;(i||e)&&(r.activeTriggerId=i,r.activeTriggerElement=t.trigger??null),this.update(r)}};function pF(e={}){return{...GA(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:`dialog`,...e}}function mF(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=$P(!0),p=!!f,m=xS(()=>l?.store??new fF({open:r,openProp:n,activeTriggerId:d,triggerIdProp:u,modal:s,disablePointerDismissal:o,nested:p})).current;tE(()=>{n===void 0&&m.state.open===!1&&r===!0&&m.update({open:!0,activeTriggerId:d})}),m.useControlledProp(`openProp`,n),m.useControlledProp(`triggerIdProp`,u),m.useSyncedValues({disablePointerDismissal:o,nested:p,modal:s}),m.useContextCallback(`onOpenChange`,i),m.useContextCallback(`onOpenChangeComplete`,a);let h=m.useState(`payload`);uF({store:m,actionsRef:c,parentContext:f?.store.context,onOpenChange:i,triggerIdProp:u});let g=G.useMemo(()=>({store:m}),[m]);return(0,K.jsx)(QP.Provider,{value:g,children:typeof t==`function`?t({payload:h}):t})}var hF=G.forwardRef(function(e,t){let{render:n,className:r,id:i,...a}=e,{store:o}=$P(),s=yC(i);return o.useSyncedValueWithCleanup(`titleElementId`,s),lC(`h2`,e,{ref:t,props:[{id:s},a]})}),gF=mF,_F=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(tF,{ref:n,className:Y(`fixed inset-0 z-50 bg-black/60 backdrop-blur-sm`,e),...t}));_F.displayName=`DialogOverlay`;var vF=(0,G.forwardRef)(({className:e,children:t,...n},r)=>(0,K.jsxs)(lF,{children:[(0,K.jsx)(tF,{className:`fixed inset-0 z-50 bg-black/60 backdrop-blur-sm`}),(0,K.jsx)(cF,{ref:r,className:Y(`fixed z-50 top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-panel border border-border rounded-lg shadow-lg max-w-lg w-full p-0`,e),...n,children:t})]}));vF.displayName=`DialogContent`;var yF=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`div`,{ref:n,className:Y(`px-5 py-3 border-b border-border`,e),...t}));yF.displayName=`DialogHeader`;var bF=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`div`,{ref:n,className:Y(`px-5 py-3 border-t border-border flex justify-end gap-2`,e),...t}));bF.displayName=`DialogFooter`;var xF=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(hF,{ref:n,className:Y(`font-mono text-[10px] text-neutral-500 uppercase tracking-widest`,e),...t}));xF.displayName=`DialogTitle`;var SF=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(nF,{ref:n,className:Y(`font-mono text-[10px] text-neutral-500`,e),...t}));SF.displayName=`DialogDescription`;var CF=(0,G.forwardRef)(({className:e,page:t,totalPages:n,totalItems:r,onPageChange:i,...a},o)=>(0,K.jsxs)(`div`,{ref:o,className:Y(`px-5 py-2.5 border-t border-border flex items-center justify-between`,e),...a,children:[(0,K.jsxs)(`span`,{className:`font-mono text-[10px] text-neutral-600`,children:[r,` items · Page `,t,` of `,n]}),(0,K.jsxs)(`div`,{className:`flex gap-2`,children:[(0,K.jsx)(Q,{size:`sm`,variant:`default`,disabled:t<=1,onClick:()=>i(t-1),children:`Prev`}),(0,K.jsx)(Q,{size:`sm`,variant:`default`,disabled:t>=n,onClick:()=>i(t+1),children:`Next`})]})]}));CF.displayName=`Pagination`;var wF=(0,G.forwardRef)(({className:e,orientation:t=`horizontal`,...n},r)=>(0,K.jsx)(`hr`,{ref:r,"aria-orientation":t===`vertical`?`vertical`:void 0,className:Y(`border-none m-0`,t===`horizontal`?`h-px w-full bg-border`:`w-px h-4 bg-border`,e),...n}));wF.displayName=`Separator`;var TF=gS(`fixed z-50 bg-panel shadow-lg overflow-auto`,{variants:{side:{top:`top-0 left-0 w-full h-[400px] border-b border-border`,right:`right-0 top-0 h-full w-[400px] border-l border-border`,bottom:`bottom-0 left-0 w-full h-[400px] border-t border-border`,left:`left-0 top-0 h-full w-[400px] border-r border-border`}},defaultVariants:{side:`right`}}),EF=(0,G.forwardRef)(({className:e,side:t,children:n,...r},i)=>(0,K.jsxs)(lF,{children:[(0,K.jsx)(tF,{className:`fixed inset-0 z-50 bg-black/60 backdrop-blur-sm`}),(0,K.jsx)(cF,{ref:i,className:Y(TF({side:t,className:e})),...r,children:n})]}));EF.displayName=`SheetContent`;var DF=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`div`,{ref:n,className:Y(`px-5 py-3 border-b border-border`,e),...t}));DF.displayName=`SheetHeader`;var OF=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`div`,{ref:n,className:Y(`px-5 py-3 border-t border-border flex justify-end gap-2`,e),...t}));OF.displayName=`SheetFooter`;var kF=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(hF,{ref:n,className:Y(`font-mono text-[10px] text-neutral-500 uppercase tracking-widest`,e),...t}));kF.displayName=`SheetTitle`;var AF=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(nF,{ref:n,className:Y(`text-sm text-neutral-400`,e),...t}));AF.displayName=`SheetDescription`;var jF=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`div`,{ref:n,className:Y(`rounded-md bg-neutral-800 animate-pulse`,e),...t}));jF.displayName=`Skeleton`;var MF=G.createContext(void 0);function NF(){let e=G.useContext(MF);if(e===void 0)throw Error(zS(64));return e}var PF=function(e){return e.activationDirection=`data-activation-direction`,e.orientation=`data-orientation`,e}({}),FF={tabActivationDirection:e=>({[PF.activationDirection]:e})},IF=G.createContext(void 0);function LF(){let e=G.useContext(IF);if(e===void 0)throw Error(zS(65));return e}var RF=G.forwardRef(function(e,t){let{className:n,disabled:r=!1,render:i,value:a,id:o,nativeButton:s=!0,...c}=e,{value:l,getTabPanelIdByValue:u,orientation:d}=NF(),{activateOnFocus:f,highlightedTabIndex:p,onTabActivation:m,registerTabResizeObserverElement:h,setHighlightedTabIndex:g,tabsListElement:_}=LF(),v=yC(o),{compositeProps:y,compositeRef:b,index:x}=TP({metadata:G.useMemo(()=>({disabled:r,id:v,value:a}),[r,v,a])}),S=a===l,C=G.useRef(!1),w=G.useRef(null);G.useEffect(()=>{let e=w.current;if(e)return h(e)},[h]),Z(()=>{if(C.current){C.current=!1;return}if(!(S&&x>-1&&p!==x))return;let e=_;if(e!=null){let t=wE(rO(e));if(t&&TE(e,t))return}r||g(x)},[S,x,p,g,r,_]);let{getButtonProps:T,buttonRef:E}=JC({disabled:r,native:s,focusableWhenDisabled:!0}),D=u(a),O=G.useRef(!1),k=G.useRef(!1);function A(e){S||r||m(a,Aw(vw,e.nativeEvent,void 0,{activationDirection:`none`}))}function j(e){S||(x>-1&&!r&&g(x),!r&&f&&(!O.current||O.current&&k.current)&&m(a,Aw(vw,e.nativeEvent,void 0,{activationDirection:`none`})))}function M(e){if(S||r)return;O.current=!0;function t(){O.current=!1,k.current=!1}(!e.button||e.button===0)&&(k.current=!0,rO(e.currentTarget).addEventListener(`pointerup`,t,{once:!0}))}return lC(`button`,e,{state:{disabled:r,active:S,orientation:d},ref:[t,E,b,w],props:[y,{role:`tab`,"aria-controls":D,"aria-selected":S,id:v,onClick:A,onFocus:j,onPointerDown:M,[AP]:S?``:void 0,onKeyDownCapture(){C.current=!0}},c,T]})}),zF=function(e){return e.index=`data-index`,e.activationDirection=`data-activation-direction`,e.orientation=`data-orientation`,e.hidden=`data-hidden`,e[e.startingStyle=NA.startingStyle]=`startingStyle`,e[e.endingStyle=NA.endingStyle]=`endingStyle`,e}({}),BF={...FF,...IA},VF=G.forwardRef(function(e,t){let{className:n,value:r,render:i,keepMounted:a=!1,...o}=e,{value:s,getTabIdByPanelValue:c,orientation:l,tabActivationDirection:u,registerMountedTabPanel:d,unregisterMountedTabPanel:f}=NF(),p=yC(),{ref:m,index:h}=gP({metadata:G.useMemo(()=>({id:p,value:r}),[p,r])}),g=r===s,{mounted:_,transitionStatus:v,setMounted:y}=MA(g),b=!_,x=c(r),S={hidden:b,orientation:l,tabActivationDirection:u,transitionStatus:v},C=G.useRef(null),w=lC(`div`,e,{state:S,ref:[t,m,C],props:[{"aria-labelledby":x,hidden:b,id:p,role:`tabpanel`,tabIndex:g?0:-1,inert:aM(!g),[zF.index]:h},o],stateAttributesMapping:BF});return RA({open:g,ref:C,onComplete(){g||y(!1)}}),Z(()=>{if(!(b&&!a)&&p!=null)return d(r,p),()=>{f(r,p)}},[b,a,r,p,d,f]),a||_?w:null}),HF=G.forwardRef(function(e,t){let{activateOnFocus:n=!1,className:r,loopFocus:i=!0,render:a,...o}=e,{getTabElementBySelectedValue:s,onValueChange:c,orientation:l,value:u,setTabMap:d,tabActivationDirection:f}=NF(),[p,m]=G.useState(0),[h,g]=G.useState(null),_=G.useRef(new Set),v=G.useRef(new Set),y=G.useRef(null),b=X(()=>{_.current.forEach(e=>{e()})});G.useEffect(()=>{if(typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>{_.current.size&&b()});return y.current=e,h&&e.observe(h),v.current.forEach(t=>{e.observe(t)}),()=>{e.disconnect(),y.current=null}},[h,b]);let x=X(e=>(_.current.add(e),()=>{_.current.delete(e)})),S=X(e=>(v.current.add(e),y.current?.observe(e),()=>{v.current.delete(e),y.current?.unobserve(e)})),C=WF(u,l,h,s),w=X((e,t)=>{e!==u&&(t.activationDirection=C(e),c(e,t))}),T={orientation:l,tabActivationDirection:f},E={"aria-orientation":l===`vertical`?`vertical`:void 0,role:`tablist`},D=G.useMemo(()=>({activateOnFocus:n,highlightedTabIndex:p,registerIndicatorUpdateListener:x,registerTabResizeObserverElement:S,onTabActivation:w,setHighlightedTabIndex:m,tabsListElement:h}),[n,p,x,S,w,m,h]);return(0,K.jsx)(IF.Provider,{value:D,children:(0,K.jsx)(PP,{render:a,className:r,state:T,refs:[t,g],props:[E,o],stateAttributesMapping:FF,highlightedIndex:p,enableHomeAndEndKeys:!0,loopFocus:i,orientation:l,onHighlightedIndexChange:m,onMapChange:d,disabledIndices:IS})})});function UF(e,t){let{left:n,top:r}=e.getBoundingClientRect(),{left:i,top:a}=t.getBoundingClientRect();return{left:n-i,top:r-a}}function WF(e,t,n,r){let[i,a]=G.useState(null);return Z(()=>{if(e==null||n==null){a(null);return}let i=r(e);if(i==null){a(null);return}let{left:o,top:s}=UF(i,n);a(t===`horizontal`?o:s)},[t,r,n,e]),G.useCallback(o=>{if(o===e)return`none`;if(o==null)return a(null),`none`;if(o!=null&&n!=null){let e=r(o);if(e!=null){let{left:r,top:o}=UF(e,n);if(i==null)return a(t===`horizontal`?r:o),`none`;if(t===`horizontal`){if(r<i)return a(r),`left`;if(r>i)return a(r),`right`}else if(o<i)return a(o),`up`;else if(o>i)return a(o),`down`}}return`none`},[r,t,i,n,e])}var GF=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(HF,{ref:n,className:Y(`flex items-center gap-0.5`,e),...t}));GF.displayName=`TabsList`;var KF=gS(`inline-flex items-center justify-center cursor-pointer transition-all outline-none`,{variants:{variant:{default:`font-mono text-[10px] text-neutral-500 border border-transparent rounded-sm px-2.5 py-1 hover:text-neutral-300 data-[selected]:text-white data-[selected]:border-border-bright data-[selected]:bg-white/[0.03]`,pills:`font-mono text-[10px] text-neutral-500 border border-transparent rounded-full px-3 py-1 hover:text-neutral-300 data-[selected]:text-white data-[selected]:border-border-bright data-[selected]:bg-white/[0.03]`}},defaultVariants:{variant:`default`}}),qF=(0,G.forwardRef)(({className:e,variant:t,...n},r)=>(0,K.jsx)(RF,{ref:r,className:Y(KF({variant:t,className:e})),...n}));qF.displayName=`TabsTrigger`;var JF=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(VF,{ref:n,className:Y(`outline-none`,e),...t}));JF.displayName=`TabsContent`;var YF=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`p`,{ref:n,className:Y(`font-mono text-[11px] text-neutral-300`,e),...t}));YF.displayName=`Text`;var XF=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`p`,{ref:n,className:Y(`font-mono text-[10px] text-neutral-500`,e),...t}));XF.displayName=`TextMuted`;var ZF=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`code`,{ref:n,className:Y(`font-mono text-[11px] text-white`,e),...t}));ZF.displayName=`TextCode`;var QF=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`span`,{ref:n,className:Y(`font-mono text-[9px] uppercase tracking-wider text-neutral-500`,e),...t}));QF.displayName=`TextLabel`;var $F=(0,G.forwardRef)(({className:e,...t},n)=>(0,K.jsx)(`pre`,{ref:n,className:Y(`font-mono text-[11px] text-neutral-300 p-3 rounded border border-border bg-panel-alt overflow-x-auto`,e),...t}));$F.displayName=`CodeBlock`;function eI(e,t){let[n,r]=(0,G.useState)(()=>{if(typeof window>`u`)return t;try{let n=window.localStorage.getItem(e);return n===null?t:JSON.parse(n)}catch{return t}});return(0,G.useEffect)(()=>{try{n==null?window.localStorage.removeItem(e):window.localStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]),[n,(0,G.useCallback)(e=>{r(t=>typeof e==`function`?e(t):e)},[])]}var tI=`console:instance-id`;function nI(){let[e,t]=eI(tI,``),n=e.trim();return(0,G.useMemo)(()=>({instanceId:n.length>0?n:void 0,rawInstanceId:e,setInstanceId:t,clearInstanceId:()=>t(``)}),[n,e,t])}var rI={stats:e=>[`console`,`stats`,e],timeseries:e=>[`console`,`stats`,`timeseries`,e],latency:e=>[`console`,`stats`,`latency`,e],commits:e=>[`console`,`commits`,e],commitDetail:(e,t,n)=>[`console`,`commit-detail`,e,t,n],timeline:e=>[`console`,`timeline`,e],clients:e=>[`console`,`clients`,e],eventDetail:(e,t,n)=>[`console`,`event-detail`,e,t,n],eventPayload:(e,t,n)=>[`console`,`event-payload`,e,t,n],handlers:e=>[`console`,`handlers`,e],prunePreview:e=>[`console`,`prune`,`preview`,e],operations:e=>[`console`,`operations`,e],apiKeys:e=>[`console`,`api-keys`,e],storage:e=>[`console`,`storage`,e]};function iI(e,t){return e===0?!1:e??t}function aI(e){let t=new URLSearchParams;if(!e)return t;for(let[n,r]of Object.entries(e))r!=null&&t.set(n,String(r));return t}function oI(e,t,n){let r=e.endsWith(`/`)?e.slice(0,-1):e,i=aI(n)?.toString();return`${r}${t}${i?`?${i}`:``}`}function sI(e,t){if(!t||!e)throw Error(`Not connected`);return e}async function cI(e){let t={Authorization:`Bearer ${e.connectionConfig.token}`};e.body!==void 0&&(t[`Content-Type`]=`application/json`);let n=await fetch(oI(e.connectionConfig.serverUrl,e.path,e.query),{method:e.method??`GET`,headers:t,body:e.body===void 0?void 0:JSON.stringify(e.body)});if(!n.ok)throw Error(e.errorMessage);return n.json()}async function lI(e){let t=await fetch(oI(e.connectionConfig.serverUrl,e.path,e.query),{method:`GET`,headers:{Authorization:`Bearer ${e.connectionConfig.token}`}});if(!t.ok)throw Error(e.errorMessage);return t.blob()}function uI(e){let{config:t,isConnected:n}=Ny();return ih({queryKey:e.queryKey,queryFn:()=>cI({connectionConfig:sI(t,n),path:e.path,query:e.query,method:e.method,errorMessage:e.errorMessage}),enabled:(e.enabled??!0)&&n&&!!t,refetchInterval:e.refetchInterval})}function dI(e){let{config:t,isConnected:n}=Ny();return ih({queryKey:e.queryKey,queryFn:()=>{if(e.id===void 0)throw Error(e.requiredMessage);return cI({connectionConfig:sI(t,n),path:e.path(e.id),query:e.query,errorMessage:e.errorMessage})},enabled:(e.enabled??!0)&&e.id!==void 0&&n&&!!t})}function fI(e,t){for(let n of t)e.invalidateQueries({queryKey:n})}function pI(e){let{instanceId:t}=nI();return e??t}function mI(e){let{config:t,isConnected:n}=Ny(),{instanceId:r}=nI(),i=Um();return ah({mutationFn:i=>e.mutationFn({connectionConfig:sI(t,n),variables:i,selectedInstanceId:r}),onSuccess:()=>{e.invalidateQueryKeys&&fI(i,e.invalidateQueryKeys)}})}function hI(e={}){let t=pI(e.instanceId);return uI({queryKey:rI.stats({partitionId:e.partitionId,instanceId:t}),path:`/console/stats`,query:{partitionId:e.partitionId,instanceId:t},errorMessage:`Failed to fetch stats`,refetchInterval:iI(e.refetchIntervalMs,5e3)})}function gI(e={},t={}){let n=pI(e.instanceId);return uI({queryKey:rI.timeseries({...e,instanceId:n}),path:`/console/stats/timeseries`,query:{interval:e.interval,range:e.range,partitionId:e.partitionId,instanceId:n},errorMessage:`Failed to fetch timeseries stats`,enabled:t.enabled,refetchInterval:iI(t.refetchIntervalMs,3e4)})}function _I(e={},t={}){let n=pI(e.instanceId);return uI({queryKey:rI.latency({...e,instanceId:n}),path:`/console/stats/latency`,query:{range:e.range,partitionId:e.partitionId,instanceId:n},errorMessage:`Failed to fetch latency stats`,enabled:t.enabled,refetchInterval:iI(t.refetchIntervalMs,3e4)})}function vI(e={},t={}){let n=pI(e.instanceId);return uI({queryKey:rI.commits({...e,instanceId:n}),path:`/console/commits`,query:{limit:e.limit,offset:e.offset,partitionId:e.partitionId,instanceId:n},errorMessage:`Failed to fetch commits`,enabled:t.enabled,refetchInterval:iI(t.refetchIntervalMs,1e4)})}function yI(e,t={}){let n=pI(t.instanceId);return dI({queryKey:rI.commitDetail(e,t.partitionId,n),id:e,requiredMessage:`Commit sequence is required`,path:e=>`/console/commits/${encodeURIComponent(String(e))}`,query:{partitionId:t.partitionId,instanceId:n},errorMessage:`Failed to fetch commit detail`,enabled:t.enabled})}function bI(e={},t={}){let n=pI(e.instanceId);return uI({queryKey:rI.timeline({...e,instanceId:n}),path:`/console/timeline`,query:{limit:e.limit,offset:e.offset,partitionId:e.partitionId,view:e.view,eventType:e.eventType,actorId:e.actorId,clientId:e.clientId,requestId:e.requestId,traceId:e.traceId,table:e.table,outcome:e.outcome,search:e.search,from:e.from,to:e.to,instanceId:n},errorMessage:`Failed to fetch timeline`,enabled:t.enabled,refetchInterval:iI(t.refetchIntervalMs,1e4)})}function xI(e={},t={}){let n=pI(e.instanceId);return uI({queryKey:rI.clients({...e,instanceId:n}),path:`/console/clients`,query:{limit:e.limit,offset:e.offset,partitionId:e.partitionId,instanceId:n},errorMessage:`Failed to fetch clients`,enabled:t.enabled,refetchInterval:iI(t.refetchIntervalMs,1e4)})}function SI(e,t={}){let n=pI(t.instanceId);return dI({queryKey:rI.eventDetail(e,t.partitionId,n),id:e,requiredMessage:`Event id is required`,path:e=>`/console/events/${encodeURIComponent(String(e))}`,query:{partitionId:t.partitionId,instanceId:n},errorMessage:`Failed to fetch event detail`,enabled:t.enabled})}function CI(e,t={}){let n=pI(t.instanceId);return dI({queryKey:rI.eventPayload(e,t.partitionId,n),id:e,requiredMessage:`Event id is required`,path:e=>`/console/events/${encodeURIComponent(String(e))}/payload`,query:{partitionId:t.partitionId,instanceId:n},errorMessage:`Failed to fetch event payload`,enabled:t.enabled})}function wI(e={}){let t=pI(e.instanceId);return uI({queryKey:rI.handlers(t),path:`/console/handlers`,query:{instanceId:t},errorMessage:`Failed to fetch handlers`})}function TI(e={}){let t=pI(e.instanceId);return uI({queryKey:rI.prunePreview(t),path:`/console/prune/preview`,query:{instanceId:t},method:`POST`,errorMessage:`Failed to fetch prune preview`,enabled:e.enabled})}function EI(e={},t={}){let n=pI(e.instanceId);return uI({queryKey:rI.operations({...e,instanceId:n}),path:`/console/operations`,query:{limit:e.limit,offset:e.offset,operationType:e.operationType,partitionId:e.partitionId,instanceId:n},errorMessage:`Failed to fetch operations`,enabled:t.enabled,refetchInterval:iI(t.refetchIntervalMs,1e4)})}function DI(){return mI({mutationFn:async({connectionConfig:e,selectedInstanceId:t})=>cI({connectionConfig:e,path:`/console/events`,query:{instanceId:t},method:`DELETE`,errorMessage:`Failed to clear events`}),invalidateQueryKeys:[[`console`,`events`]]})}function OI(){return mI({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>{let r=t.instanceId??n;return cI({connectionConfig:e,path:`/console/clients/${encodeURIComponent(t.clientId)}`,query:{partitionId:t.partitionId,instanceId:r},method:`DELETE`,errorMessage:`Failed to evict client`})},invalidateQueryKeys:[[`console`,`clients`],[`console`,`stats`],[`console`,`operations`]]})}function kI(){return mI({mutationFn:async({connectionConfig:e,selectedInstanceId:t})=>cI({connectionConfig:e,path:`/console/prune`,query:{instanceId:t},method:`POST`,errorMessage:`Failed to prune`}),invalidateQueryKeys:[[`console`,`stats`],[`console`,`commits`],[`console`,`timeline`],[`console`,`prune`,`preview`],[`console`,`operations`]]})}function AI(){return mI({mutationFn:async({connectionConfig:e,selectedInstanceId:t})=>cI({connectionConfig:e,path:`/console/compact`,query:{instanceId:t},method:`POST`,errorMessage:`Failed to compact`}),invalidateQueryKeys:[[`console`,`stats`],[`console`,`operations`]]})}function jI(){return mI({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>cI({connectionConfig:e,path:`/console/notify-data-change`,query:{instanceId:t.instanceId??n},method:`POST`,body:{tables:t.tables,partitionId:t.partitionId},errorMessage:`Failed to notify data change`}),invalidateQueryKeys:[[`console`,`stats`],[`console`,`commits`],[`console`,`timeline`],[`console`,`operations`]]})}function MI(e={}){let t=pI(e.instanceId);return uI({queryKey:rI.apiKeys({...e,instanceId:t}),path:`/console/api-keys`,query:{limit:e.limit,offset:e.offset,type:e.type,status:e.status,expiresWithinDays:e.expiresWithinDays,instanceId:t},errorMessage:`Failed to fetch API keys`})}function NI(){return mI({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>cI({connectionConfig:e,path:`/console/api-keys`,query:{instanceId:n},method:`POST`,body:t,errorMessage:`Failed to create API key`}),invalidateQueryKeys:[[`console`,`api-keys`]]})}function PI(){return mI({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>cI({connectionConfig:e,path:`/console/api-keys/${encodeURIComponent(t)}`,query:{instanceId:n},method:`DELETE`,errorMessage:`Failed to revoke API key`}),invalidateQueryKeys:[[`console`,`api-keys`]]})}function FI(){return mI({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>cI({connectionConfig:e,path:`/console/api-keys/bulk-revoke`,query:{instanceId:n},method:`POST`,body:t,errorMessage:`Failed to bulk revoke API keys`}),invalidateQueryKeys:[[`console`,`api-keys`]]})}function II(){return mI({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>cI({connectionConfig:e,path:`/console/api-keys/${encodeURIComponent(t)}/rotate`,query:{instanceId:n},method:`POST`,errorMessage:`Failed to rotate API key`}),invalidateQueryKeys:[[`console`,`api-keys`]]})}function LI(){return mI({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>cI({connectionConfig:e,path:`/console/api-keys/${encodeURIComponent(t)}/rotate/stage`,query:{instanceId:n},method:`POST`,errorMessage:`Failed to stage-rotate API key`}),invalidateQueryKeys:[[`console`,`api-keys`]]})}function RI(e={}){return uI({queryKey:rI.storage({prefix:e.prefix,cursor:e.cursor,limit:e.limit}),path:`/console/storage`,query:{prefix:e.prefix,cursor:e.cursor,limit:e.limit},errorMessage:`Failed to list blobs`,refetchInterval:iI(e.refetchIntervalMs,3e4)})}function zI(){return mI({mutationFn:async({connectionConfig:e,variables:t})=>cI({connectionConfig:e,path:`/console/storage/${encodeURIComponent(t)}`,method:`DELETE`,errorMessage:`Failed to delete blob`}),invalidateQueryKeys:[[`console`,`storage`]]})}function BI(){let{config:e,isConnected:t}=Ny();return async n=>{let r=await lI({connectionConfig:sI(e,t),path:`/console/storage/${encodeURIComponent(n)}/download`,errorMessage:`Failed to download blob`}),i=URL.createObjectURL(r),a=document.createElement(`a`);a.href=i,a.download=n.split(`/`).pop()||n,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}}var VI=`console:partition-id`;function HI(){let[e,t]=eI(VI,``),n=e.trim();return(0,G.useMemo)(()=>({partitionId:n.length>0?n:void 0,rawPartitionId:e,setPartitionId:t,clearPartitionId:()=>t(``)}),[n,e,t])}var UI={refreshInterval:5,timeFormat:`relative`,showSparklines:!0,pageSize:20};function WI(){let[e,t]=eI(`console:preferences`,UI);return{preferences:e,setPreferences:t,updatePreference:(e,n)=>{t(t=>({...t,[e]:n}))},resetPreferences:()=>{t(UI)}}}var GI=[{value:5,label:`5 seconds`},{value:10,label:`10 seconds`},{value:30,label:`30 seconds`},{value:60,label:`1 minute`},{value:0,label:`Manual only`}],KI=[{value:10,label:`10`},{value:20,label:`20`},{value:50,label:`50`},{value:100,label:`100`}],qI=`syncular-console-root`;function JI(e){e.classList.add(qI)}var YI=[{suffix:``,label:`Command`},{suffix:`/stream`,label:`Stream`},{suffix:`/fleet`,label:`Fleet`},{suffix:`/ops`,label:`Ops`},{suffix:`/storage`,label:`Storage`},{suffix:`/config`,label:`Config`}];function XI(e){let t=e?.trim()??``;return!t||t===`/`?``:(t.startsWith(`/`)?t:`/${t}`).replace(/\/+$/g,``)}function ZI(e,t){return e?t?`${e}${t}`:e:t||`/`}function QI({basePath:e,appHref:t,modeBadge:n}){let{connect:r,config:i,isConnected:a,isConnecting:o}=Ny(),{preferences:s}=WI(),{instanceId:c,rawInstanceId:l,setInstanceId:u,clearInstanceId:d}=nI(),{partitionId:f,rawPartitionId:p,setPartitionId:m,clearPartitionId:h}=HI(),g=sy({select:e=>e.location.pathname}),{data:_}=hI({refetchIntervalMs:s.refreshInterval*1e3,partitionId:f,instanceId:c}),v=XI(e),y=(0,G.useMemo)(()=>YI.map(e=>({...e,id:ZI(v,e.suffix)})),[v]),b=ZI(v,``),x=ZI(v,`/config`),S=o?`connecting`:a?`connected`:i?`disconnected`:`not-configured`,C=y.find(e=>e.suffix===``?g===b||g===`${b}/`:g.startsWith(e.id))?.id??b,w=_?[{label:`HEAD`,value:`#${_.maxCommitSeq}`},{label:`COMMITS`,value:`${_.commitCount}`},{label:`CHANGES`,value:`${_.changeCount}`},{label:`CLIENTS`,value:`${_.activeClientCount}/${_.clientCount}`}]:[];return(0,K.jsxs)(`div`,{className:`${qI} h-screen bg-background text-foreground flex flex-col`,children:[(0,K.jsx)(qP,{brand:(0,K.jsx)(Rv,{to:b,children:(0,K.jsx)(KP,{label:`console`})}),center:(0,K.jsx)(VP,{items:y,activeId:C,renderItem:(e,{active:t})=>(0,K.jsx)(Rv,{to:e.id,children:(0,K.jsx)(BP,{active:t,children:e.label})},e.id)}),right:(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n?(0,K.jsx)(Rw,{variant:`flow`,className:`hidden md:inline-flex px-2 py-1 text-[10px]`,children:n}):null,(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-neutral-500 uppercase tracking-wide`,children:`Instance`}),(0,K.jsx)(vS,{variant:`mono`,value:l,onChange:e=>u(e.target.value),onBlur:e=>u(e.target.value.trim()),placeholder:`all`,className:`h-7 w-[110px] px-2 py-1`}),c?(0,K.jsx)(Q,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-[10px]`,onClick:d,children:`All`}):null]}),(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(`span`,{className:`font-mono text-[9px] text-neutral-500 uppercase tracking-wide`,children:`Partition`}),(0,K.jsx)(vS,{variant:`mono`,value:p,onChange:e=>m(e.target.value),onBlur:e=>m(e.target.value.trim()),placeholder:`all`,className:`h-7 w-[110px] px-2 py-1`}),f?(0,K.jsx)(Q,{variant:`ghost`,size:`sm`,className:`h-7 px-2 text-[10px]`,onClick:h,children:`All`}):null]}),(0,K.jsx)($w,{state:S}),(0,K.jsx)(Rv,{to:x,children:(0,K.jsx)(Q,{variant:g===x?`secondary`:`ghost`,size:`icon`,children:(0,K.jsx)(wT,{className:`h-3 w-3`})})}),t?(0,K.jsxs)(`a`,{href:t,className:zP,children:[(0,K.jsx)(CT,{className:`h-3 w-3`}),`Go to app`]}):null]})}),(0,K.jsx)(`main`,{className:`flex-1 overflow-auto pb-[32px]`,children:(0,K.jsx)(`div`,{className:`min-h-full`,children:a||g===x?(0,K.jsx)(`div`,{style:{animation:`pageIn 0.3s ease-out`},children:(0,K.jsx)(Qv,{})},g):(0,K.jsx)($I,{configPath:x,hasSavedConfig:!!i,isConnecting:o,onConnect:()=>{r()}})})}),a&&(0,K.jsx)(qw,{isLive:a,metrics:w,uptime:`--`})]})}function $I({configPath:e,hasSavedConfig:t,isConnecting:n,onConnect:r}){return(0,K.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16`,children:[(0,K.jsx)(`p`,{className:`mb-4 text-foreground-muted`,children:`Not connected to a @syncular server`}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t&&(0,K.jsx)(Q,{variant:`default`,onClick:r,disabled:n,children:n?`Connecting...`:`Connect`}),(0,K.jsx)(Rv,{to:e,children:(0,K.jsx)(Q,{variant:`link`,children:`Configure connection`})})]})]})}var eL=Uv({component:QI});function tL(e={}){let{maxEvents:t=100,enabled:n=!0,staleAfterMs:r=65e3,replayLimit:i=100,partitionId:a,instanceId:o}=e,{config:s,isConnected:c}=Ny(),{instanceId:l}=nI(),u=o??l,[d,f]=(0,G.useState)([]),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(`disconnected`),[_,v]=(0,G.useState)(null),y=(0,G.useRef)(null),b=(0,G.useRef)(null),x=(0,G.useRef)(null),S=(0,G.useRef)(0),C=(0,G.useRef)(0),w=(0,G.useRef)(null),T=(0,G.useCallback)(()=>{f([]),w.current=null},[]);return(0,G.useEffect)(()=>{if(!n||!c||!s?.serverUrl||!s?.token)return;let e=!1,o=Number.isFinite(i)?Math.max(1,Math.min(500,Math.floor(i))):100;if(typeof WebSocket>`u`)return;let l=()=>{b.current&&=(clearTimeout(b.current),null)},d=()=>{x.current&&=(clearInterval(x.current),null)},p=()=>{if(e||b.current)return;S.current+=1;let t=Math.min(3e4,1e3*2**Math.max(0,S.current-1)),n=t+Math.floor(t*.2*Math.random());b.current=setTimeout(()=>{b.current=null,e||_()},n)},h=()=>{C.current=Date.now(),m(!0),g(`connected`)},_=()=>{if(e)return;g(`connecting`),l();let n=(()=>{let e=new URL(s.serverUrl,window.location.origin);return e.protocol=e.protocol===`https:`?`wss:`:`ws:`,e.pathname=`${e.pathname.endsWith(`/`)?e.pathname.slice(0,-1):e.pathname}/console/events/live`,e.search=``,w.current&&e.searchParams.set(`since`,w.current),e.searchParams.set(`replayLimit`,String(o)),a&&e.searchParams.set(`partitionId`,a),u&&e.searchParams.set(`instanceId`,u),e.toString()})(),i=new WebSocket(n);y.current=i,i.onopen=()=>{if(e){i.close();return}S.current=0,v(null),g(`connecting`),m(!1);try{i.send(JSON.stringify({type:`auth`,token:s.token}))}catch{i.close();return}d(),x.current=setInterval(()=>{let e=y.current;if(!e||e.readyState!==WebSocket.OPEN)return;let t=C.current;t&&(Date.now()-t<=r||(m(!1),g(`stale`),e.close()))},1e3)},i.onclose=()=>{e||(m(!1),g(`disconnected`),d(),p())},i.onerror=()=>{e||v(Error(`WebSocket connection failed`))},i.onmessage=e=>{try{let n=JSON.parse(e.data),r=n.type;if(h(),r===`connected`||r===`heartbeat`||r===`auth_required`)return;if(r===`error`){let e=typeof n.message==`string`?n.message:`Live events authentication failed`;v(Error(e));return}let i={type:r,timestamp:n.timestamp||new Date().toISOString(),data:n};if(a&&i.data.partitionId!==a||u&&i.data.instanceId!==u)return;let o=Date.parse(w.current??``),s=Date.parse(i.timestamp);Number.isFinite(s)&&(!Number.isFinite(o)||s>o)&&(w.current=i.timestamp),f(e=>[i,...e].slice(0,t))}catch{}}};return _(),()=>{e=!0,l(),d(),y.current&&=(y.current.close(),null),m(!1),g(`disconnected`)}},[n,c,s?.serverUrl,s?.token,t,a,u,i,r]),{events:d,isConnected:p,connectionState:h,error:_,clearEvents:T}}var nL=(0,G.createContext)(null);function rL(){let[e,t]=eI(`console:time-range`,`24h`);return{range:e,setRange:t}}var iL=[{hint:`ios`,type:`mobile`},{hint:`android`,type:`mobile`},{hint:`mobile`,type:`mobile`},{hint:`tablet`,type:`tablet`},{hint:`desktop`,type:`desktop`},{hint:`mac`,type:`desktop`},{hint:`windows`,type:`desktop`},{hint:`linux`,type:`desktop`},{hint:`browser`,type:`browser`},{hint:`web`,type:`browser`},{hint:`server`,type:`server`},{hint:`api`,type:`server`},{hint:`iot`,type:`iot`},{hint:`sensor`,type:`iot`}];function aL(e){let t=e.toLowerCase();for(let e of iL)if(t.includes(e.hint))return e.type;return`client`}function oL(e){let t=e.toLowerCase();return t.includes(`pglite`)?`PGlite`:t.includes(`sqlite`)||t.includes(`wa-sqlite`)?`SQLite`:t.includes(`postgres`)||t.includes(`pg`)?`PostgreSQL`:`unknown`}function sL(e,t){return typeof e.lagCommitCount==`number`?Math.max(0,e.lagCommitCount):t?Math.max(0,t.maxCommitSeq-e.cursor):0}function cL(e,t){return e.activityState===`stale`?`offline`:t>0?`syncing`:`online`}function lL(e,t){return e.length<=16?e:`${e.slice(0,12)}-${t+1}`}function uL(e,t,n={}){let r=n.maxNodes??10;return e.slice(0,r).map((e,n)=>{let r=cL(e,sL(e,t));return{id:lL(e.clientId,n),type:aL(e.clientId),status:r,cursor:Math.max(0,e.cursor),actor:e.actorId,mode:e.connectionMode,dialect:oL(e.clientId),scopes:Object.keys(e.effectiveScopes||{}),lastSeen:e.updatedAt}})}var dL={enabled:!1,thresholds:{p90Latency:500,errorRate:5,clientLag:100}};function fL(e,t=`relative`){if(t===`absolute`)return new Date(e).toLocaleString();let n=new Date(e),r=new Date().getTime()-n.getTime(),i=Math.floor(r/1e3);return i<60?`${i}s ago`:i<3600?`${Math.floor(i/60)}m ago`:i<86400?`${Math.floor(i/3600)}h ago`:`${Math.floor(i/86400)}d ago`}function pL(e){let t=e.length>1&&e.endsWith(`/`)?e.slice(0,-1):e;return t===`/console`||t.startsWith(`/console/`)?`/console/stream`:`/stream`}function mL(){let e=wv(),t=(0,G.useMemo)(()=>typeof window>`u`?`/stream`:pL(window.location.pathname),[]),n=rL(),{range:r}=n,{preferences:i}=WI(),{partitionId:a}=HI(),o=i.refreshInterval*1e3,[s]=eI(`console:alert-config`,dL),[c,l]=(0,G.useState)(`1h`),{data:u}=hI({refetchIntervalMs:o,partitionId:a}),{data:d}=gI({range:r,partitionId:a},{refetchIntervalMs:o}),{data:f}=_I({range:r,partitionId:a},{refetchIntervalMs:o}),{data:p}=vI({limit:5,partitionId:a},{refetchIntervalMs:o}),{data:m}=xI({limit:12,offset:0,partitionId:a},{refetchIntervalMs:o}),{events:h,isConnected:g}=tL({maxEvents:8,partitionId:a}),_=(0,G.useMemo)(()=>{let e=d?.buckets??[],t=0,n=0;for(let r of e)t+=r.pushCount+r.pullCount,n+=r.errorCount;let r=t>0?n/t*100:0;return{totalEvents:t,errorRate:r}},[d?.buckets]),v=(0,G.useMemo)(()=>m?.items?uL(m.items,u,{maxNodes:12}):[],[m?.items,u]),y=v.filter(e=>e.status!==`offline`).length,b=v.filter(e=>e.status===`offline`).length,x=(0,G.useMemo)(()=>u?[{label:`Ops (Range)`,value:_.totalEvents,color:`flow`},{label:`P50 Latency`,value:f?.push?.p50??0,unit:`ms`,color:`healthy`},{label:`Error Rate`,value:`${_.errorRate.toFixed(1)}%`,color:_.errorRate>0?`offline`:`muted`},{label:`Active Clients`,value:u.activeClientCount,color:`syncing`},{label:`Pending`,value:u.maxActiveClientCursor!==null&&u.maxCommitSeq>0?u.maxCommitSeq-(u.minActiveClientCursor??0):0,color:`relay`}]:[],[u,f,_.errorRate,_.totalEvents]),S=(0,G.useMemo)(()=>h.map(e=>({type:e.type.toUpperCase(),actor:e.data?.actorId??``,table:(e.data?.tables??[])[0]??``,time:fL(e.timestamp,i.timeFormat)})),[h,i.timeFormat]),C=(0,G.useMemo)(()=>{let e=d?.buckets;if(!e?.length)return[];let t=Math.max(...e.map(e=>Math.max(e.pushCount,e.pullCount)),1);return e.map(e=>({pushPercent:t>0?e.pushCount/t*100:0,pullPercent:t>0?e.pullCount/t*100:0}))},[d?.buckets]),w=(0,G.useMemo)(()=>{if(!f)return[];let e=Math.max(f.push.p50,f.push.p90,f.push.p99,f.pull.p50,f.pull.p90,f.pull.p99,1);return[{label:`P50`,pushMs:f.push.p50,pullMs:f.pull.p50,pushBarPercent:f.push.p50/e*100,pullBarPercent:f.pull.p50/e*100},{label:`P90`,pushMs:f.push.p90,pullMs:f.pull.p90,pushBarPercent:f.push.p90/e*100,pullBarPercent:f.pull.p90/e*100},{label:`P99`,pushMs:f.push.p99,pullMs:f.pull.p99,pushBarPercent:f.push.p99/e*100,pullBarPercent:f.pull.p99/e*100}]},[f]),T=(0,G.useMemo)(()=>p?.items?p.items.map(e=>({seq:e.commitSeq,actor:e.actorId,changes:e.changeCount,tables:(e.affectedTables??[]).join(`, `),time:fL(e.createdAt,i.timeFormat)})):[],[p?.items,i.timeFormat]),E=(0,G.useMemo)(()=>Math.max(0,100-_.errorRate),[_.errorRate]),D=(0,G.useMemo)(()=>{if(!s.enabled||!u)return[];let e=[];return f?.push?.p90&&f.push.p90>s.thresholds.p90Latency&&e.push(`P90 push latency (${f.push.p90}ms) exceeds threshold (${s.thresholds.p90Latency}ms)`),u.minActiveClientCursor!==null&&u.maxCommitSeq-u.minActiveClientCursor>s.thresholds.clientLag&&e.push(`Client lag (${u.maxCommitSeq-u.minActiveClientCursor}) exceeds threshold (${s.thresholds.clientLag})`),_.errorRate>s.thresholds.errorRate&&e.push(`Error rate (${_.errorRate.toFixed(1)}%) exceeds threshold (${s.thresholds.errorRate}%)`),e},[s,u,f,_.errorRate]);return u?(0,K.jsx)(nL.Provider,{value:n,children:(0,K.jsxs)(`div`,{className:`flex flex-col`,children:[D.length>0&&(0,K.jsx)(`div`,{className:`px-6 pb-4`,children:(0,K.jsxs)(YP,{variant:`destructive`,children:[(0,K.jsx)(XP,{children:`Threshold Exceeded`}),(0,K.jsx)(ZP,{children:D.map((e,t)=>(0,K.jsx)(`span`,{className:`block`,children:e},t))})]})}),(0,K.jsx)(cM,{clients:v,totalNodes:v.length+2,onlineCount:y,offlineCount:b,relayClientIds:[]}),(0,K.jsx)(jT,{items:x}),(0,K.jsxs)(`div`,{className:`flex`,children:[(0,K.jsxs)(`div`,{className:`flex-1 min-w-0 flex flex-col`,children:[(0,K.jsx)(`div`,{className:`border-b border-border border-r border-border`,children:(0,K.jsx)(pS,{bars:C,activeRange:c,onRangeChange:l})}),(0,K.jsx)(`div`,{className:`border-b border-border border-r border-border`,children:(0,K.jsx)(NT,{buckets:w,successRate:E})}),(0,K.jsx)(`div`,{className:`border-r border-border`,children:(0,K.jsx)(Jw,{commits:T,onViewAll:()=>e({href:t})})})]}),(0,K.jsx)(FT,{entries:S,isConnected:g,maxVisible:20,maxHeight:`calc(100vh - 200px)`})]})]})}):(0,K.jsx)(`div`,{className:`flex items-center justify-center py-24`,children:(0,K.jsx)(Qw,{size:`lg`})})}function hL(){return(0,K.jsx)(mL,{})}var gL=OP;function _L({children:e}){return(0,K.jsxs)(`div`,{className:`space-y-4 px-5 py-5`,children:[(0,K.jsx)(vL,{}),(0,K.jsx)(TL,{}),(0,K.jsx)(EL,{}),e]})}function vL(){let{clearError:e,config:t,connect:n,disconnect:r,error:i,isConnected:a,isConnecting:o}=Ny(),[s,c]=(0,G.useState)(t?.serverUrl??`/api`),[l,u]=(0,G.useState)(t?.token??``),[d,f]=(0,G.useState)(null),[p,m]=(0,G.useState)(!1),[h,g]=(0,G.useState)(null),[_,v]=eI(`console:disconnect-clear-saved-config`,!1);return(0,G.useEffect)(()=>{let e=new URLSearchParams(window.location.search),t=e.get(`server`),n=!1;if(t&&(c(t),e.delete(`server`),n=!0),e.has(`token`)&&(e.delete(`token`),n=!0),n){let t=e.toString(),n=t?`${window.location.pathname}?${t}`:window.location.pathname;window.history.replaceState({},``,n)}},[]),(0,G.useEffect)(()=>{t?.serverUrl&&c(t.serverUrl),t?.token&&u(t.token)},[t?.serverUrl,t?.token]),(0,G.useEffect)(()=>{g(null)},[]),(0,K.jsx)(Xw,{isConnected:a,isConnecting:o,isTestingConnection:p,serverUrl:s,onServerUrlChange:c,consoleToken:l,onConsoleTokenChange:u,onSaveAndConnect:async()=>{e(),f(null),g(await n({serverUrl:s.trim(),token:l.trim()},{persistOverride:!0})?`Connected successfully and configuration saved.`:`Failed to connect with the provided settings.`)},onDisconnect:()=>{r({clearSavedConfig:_}),_&&(c(`/api`),u(``)),g(_?`Disconnected and saved credentials cleared.`:`Disconnected.`),f(null)},onTestConnection:async()=>{m(!0),f(null),g(null);let e=performance.now();try{let t=s.trim(),n=l.trim();if(!t||!n)throw Error(`Missing server URL or token`);if(!(await fetch(`${t}/console/stats`,{headers:{Authorization:`Bearer ${n}`}})).ok)throw Error(`Failed to connect`);f(Math.round(performance.now()-e))}catch{f(-1)}finally{m(!1)}},statusMessage:i??h??(d===null?void 0:d<0?`Connection failed`:`Connection successful (${d}ms latency)`),children:(0,K.jsx)(`div`,{className:`px-5 pb-5 -mt-2`,children:(0,K.jsxs)(`div`,{className:`flex items-center justify-between rounded-md border border-border px-3 py-2`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`font-mono text-[10px] text-neutral-400`,children:`Clear saved credentials on disconnect`}),(0,K.jsx)(`p`,{className:`font-mono text-[9px] text-neutral-500`,children:`Removes stored server URL and token from this browser.`})]}),(0,K.jsx)(Pw,{checked:_,onCheckedChange:v})]})})})}var yL=1440*60*1e3;function bL(e){let t=e.trim();if(!t)return null;let n=Number.parseInt(t,10);return!Number.isInteger(n)||n<=0?null:n}function xL(e){if(!e)return`Never`;let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():`Invalid date`}function SL(e){return e.length===0?`all scopes`:e.length<=2?e.join(`, `):`${e.slice(0,2).join(`, `)} +${e.length-2}`}function CL(e,t){if(e.revokedAt)return`revoked`;if(!e.expiresAt)return`active`;let n=Date.parse(e.expiresAt);if(!Number.isFinite(n))return`active`;let r=Date.now();return n<=r?`expired`:n<=r+t*yL?`expiring`:`active`}function wL(e){return e===`revoked`?`destructive`:e===`expired`?`offline`:e===`expiring`?`syncing`:`healthy`}function TL(){let[e,t]=(0,G.useState)(`all`),[n,r]=(0,G.useState)(`all`),[i,a]=(0,G.useState)(`14`),[o,s]=(0,G.useState)(!1),[c,l]=(0,G.useState)(!1),[u,d]=(0,G.useState)(``),[f,p]=(0,G.useState)(`relay`),[m,h]=(0,G.useState)(``),[g,_]=(0,G.useState)(``),[v,y]=(0,G.useState)(``),[b,x]=(0,G.useState)(null),[S,C]=(0,G.useState)([]),[w,T]=(0,G.useState)(null),[E,D]=(0,G.useState)(null),[O,k]=(0,G.useState)(null),[A,j]=(0,G.useState)(null),[M,N]=(0,G.useState)(null),[P,F]=(0,G.useState)(null),[I,L]=(0,G.useState)(null),ee=(0,G.useMemo)(()=>bL(i),[i]),R=ee??14,z=(0,G.useMemo)(()=>bL(v),[v]),B=v.trim().length>0,V=!B||z!==null,{data:H,isLoading:U,error:W}=MI((0,G.useMemo)(()=>({type:e===`all`?void 0:e,status:n===`all`?void 0:n,expiresWithinDays:n===`expiring`?R:void 0}),[e,n,R])),te=NI(),ne=FI(),re=PI(),ie=II(),ae=LI();(0,G.useEffect)(()=>{let e=new Set((H?.items??[]).map(e=>e.keyId));C(t=>t.filter(t=>e.has(t)))},[H?.items]);let oe=async()=>{try{let e=g.split(`,`).map(e=>e.trim()).filter(e=>e.length>0);x((await te.mutateAsync({name:u,keyType:f,actorId:m||void 0,scopeKeys:e.length>0?e:void 0,expiresInDays:B?z??void 0:void 0})).secretKey),d(``),h(``),_(``),y(``)}catch{}},se=e=>{navigator.clipboard.writeText(e),D(e),setTimeout(()=>D(null),2e3)},ce=async()=>{if(O)try{await re.mutateAsync(O)}finally{k(null)}},le=async()=>{if(S.length!==0)try{T(await ne.mutateAsync({keyIds:S})),C([])}catch{}},ue=async()=>{if(A)try{let e=await ae.mutateAsync(A.keyId);N({oldKeyId:A.keyId,oldKeyName:A.name,secretKey:e.secretKey})}catch{}},de=async()=>{if(M)try{await re.mutateAsync(M.oldKeyId)}finally{N(null),j(null)}},fe=async()=>{if(P)try{L((await ie.mutateAsync(P)).secretKey)}finally{F(null)}};if(U)return(0,K.jsx)(`div`,{className:`flex h-[200px] items-center justify-center`,children:(0,K.jsx)(Qw,{size:`lg`})});if(W)return(0,K.jsx)(`div`,{className:`flex h-[200px] items-center justify-center`,children:(0,K.jsxs)(`p`,{className:`text-danger`,children:[`Failed to load API keys: `,W.message]})});let pe=(H?.items??[]).filter(e=>e.revokedAt===null).map(e=>e.keyId),me=pe.length>0&&pe.every(e=>S.includes(e)),he=S.length>0,ge=(H?.items??[]).filter(e=>S.includes(e.keyId)).map(e=>e.name);return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(VT,{title:`API Keys`,description:`Issue, rotate, revoke, and audit key lifecycle state.`,actions:(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsxs)(Q,{size:`sm`,variant:`destructive`,onClick:()=>l(!0),disabled:S.length===0,children:[`Revoke Selected (`,S.length,`)`]}),(0,K.jsx)(Q,{size:`sm`,onClick:()=>s(!0),children:`Create Key`})]}),children:[(0,K.jsxs)(`div`,{className:`mb-4 grid gap-3 lg:grid-cols-3`,children:[(0,K.jsxs)(IM,{children:[(0,K.jsx)(LM,{children:`Type filter`}),(0,K.jsxs)(RP,{value:[e],multiple:!1,onValueChange:e=>{let n=e.find(e=>typeof e==`string`);(n===`all`||n===`relay`||n===`proxy`||n===`admin`)&&t(n)},children:[(0,K.jsx)(gL,{value:`all`,children:`all`}),(0,K.jsx)(gL,{value:`relay`,children:`relay`}),(0,K.jsx)(gL,{value:`proxy`,children:`proxy`}),(0,K.jsx)(gL,{value:`admin`,children:`admin`})]})]}),(0,K.jsxs)(IM,{children:[(0,K.jsx)(LM,{children:`Status filter`}),(0,K.jsxs)(RP,{value:[n],multiple:!1,onValueChange:e=>{let t=e.find(e=>typeof e==`string`);(t===`all`||t===`active`||t===`revoked`||t===`expiring`)&&r(t)},children:[(0,K.jsx)(gL,{value:`all`,children:`all`}),(0,K.jsx)(gL,{value:`active`,children:`active`}),(0,K.jsx)(gL,{value:`revoked`,children:`revoked`}),(0,K.jsx)(gL,{value:`expiring`,children:`expiring`})]})]}),(0,K.jsxs)(IM,{children:[(0,K.jsx)(LM,{htmlFor:`api-key-expiring-window`,children:`Expiring window (days)`}),(0,K.jsx)(RM,{children:`Used when status filter is set to expiring.`}),(0,K.jsx)(vS,{id:`api-key-expiring-window`,placeholder:`14`,value:i,inputMode:`numeric`,onChange:e=>a(e.target.value)}),ee===null&&i.trim().length>0?(0,K.jsx)(`p`,{className:`font-mono text-[10px] text-offline`,children:`Enter a positive whole number.`}):null]})]}),H?.items.length===0?(0,K.jsx)(aT,{message:`No API keys match the current filters.`}):(0,K.jsxs)(zw,{children:[(0,K.jsx)(Bw,{children:(0,K.jsxs)(Hw,{children:[(0,K.jsx)(Uw,{className:`w-[28px]`,children:(0,K.jsx)(bM,{checked:me,indeterminate:!me&&he&&pe.length>0,onCheckedChange:e=>{C(e?pe:[])},"aria-label":`Select all active keys`})}),(0,K.jsx)(Uw,{className:`w-[100px]`,children:`NAME`}),(0,K.jsx)(Uw,{className:`w-[55px]`,children:`TYPE`}),(0,K.jsx)(Uw,{className:`w-[90px]`,children:`KEY PREFIX`}),(0,K.jsx)(Uw,{className:`w-[80px]`,children:`ACTOR`}),(0,K.jsx)(Uw,{className:`w-[100px]`,children:`SCOPES`}),(0,K.jsx)(Uw,{className:`w-[120px]`,children:`CREATED`}),(0,K.jsx)(Uw,{className:`w-[120px]`,children:`LAST USED`}),(0,K.jsx)(Uw,{className:`w-[120px]`,children:`EXPIRES`}),(0,K.jsx)(Uw,{className:`flex-1`,children:`STATUS`})]})}),(0,K.jsx)(Vw,{children:(H?.items??[]).map(e=>{let t=CL(e,R);return(0,K.jsxs)(Hw,{className:`group relative`,children:[(0,K.jsx)(Ww,{className:`w-[28px]`,children:(0,K.jsx)(bM,{checked:S.includes(e.keyId),onCheckedChange:t=>{C(n=>t?[...new Set([...n,e.keyId])]:n.filter(t=>t!==e.keyId))},"aria-label":`Select ${e.name}`,disabled:e.revokedAt!==null})}),(0,K.jsx)(Ww,{className:`w-[100px] font-medium`,children:e.name}),(0,K.jsx)(Ww,{className:`w-[55px]`,children:(0,K.jsx)(Rw,{variant:e.keyType===`admin`?`flow`:e.keyType===`proxy`?`ghost`:`relay`,children:e.keyType})}),(0,K.jsx)(Ww,{className:`w-[90px]`,children:(0,K.jsxs)(`code`,{className:`font-mono text-[11px]`,children:[e.keyPrefix,`...`]})}),(0,K.jsx)(Ww,{className:`w-[80px] text-neutral-500`,children:e.actorId??`-`}),(0,K.jsx)(Ww,{className:`w-[100px] text-neutral-500`,children:(0,K.jsx)(`code`,{className:`font-mono text-[10px]`,children:SL(e.scopeKeys)})}),(0,K.jsx)(Ww,{className:`w-[120px] text-neutral-500`,children:xL(e.createdAt)}),(0,K.jsx)(Ww,{className:`w-[120px] text-neutral-500`,children:xL(e.lastUsedAt)}),(0,K.jsx)(Ww,{className:`w-[120px] text-neutral-500`,children:xL(e.expiresAt)}),(0,K.jsx)(Ww,{className:`flex-1`,children:(0,K.jsx)(Rw,{variant:wL(t),children:t})}),e.revokedAt===null&&(0,K.jsxs)(`div`,{className:`absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity`,children:[(0,K.jsx)(`button`,{type:`button`,onClick:()=>j(e),className:`px-1.5 py-0.5 rounded text-[9px] font-mono text-neutral-600 hover:text-white hover:bg-white/[0.05] cursor-pointer transition-colors`,children:`stage`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>F(e.keyId),className:`px-1.5 py-0.5 rounded text-[9px] font-mono text-neutral-600 hover:text-white hover:bg-white/[0.05] cursor-pointer transition-colors`,children:`rotate`}),(0,K.jsx)(`button`,{type:`button`,onClick:()=>k(e.keyId),className:`px-1.5 py-0.5 rounded text-[9px] font-mono text-neutral-600 hover:text-offline hover:bg-offline/10 cursor-pointer transition-colors`,children:`revoke`})]})]},e.keyId)})})]})]}),(0,K.jsx)(gF,{open:o,onOpenChange:s,children:(0,K.jsxs)(vF,{children:[(0,K.jsx)(yF,{children:(0,K.jsx)(xF,{children:`Create API Key`})}),b?(0,K.jsx)(DL,{copiedKeyId:E,onClose:()=>{x(null),s(!1)},onCopy:se,secretKey:b,warning:`Copy this key now. You will not be able to view it again.`}):(0,K.jsxs)(`div`,{className:`px-5 py-4 flex flex-col gap-4`,children:[(0,K.jsxs)(IM,{children:[(0,K.jsx)(LM,{htmlFor:`api-key-name`,children:`Name`}),(0,K.jsx)(vS,{id:`api-key-name`,placeholder:`Backend Relay Key`,value:u,onChange:e=>d(e.target.value)})]}),(0,K.jsxs)(IM,{children:[(0,K.jsx)(LM,{children:`Key type`}),(0,K.jsxs)(RP,{value:[f],multiple:!1,onValueChange:e=>{let t=e.find(e=>typeof e==`string`);(t===`relay`||t===`proxy`||t===`admin`)&&p(t)},children:[(0,K.jsx)(gL,{value:`relay`,children:`relay`}),(0,K.jsx)(gL,{value:`proxy`,children:`proxy`}),(0,K.jsx)(gL,{value:`admin`,children:`admin`})]})]}),(0,K.jsxs)(IM,{children:[(0,K.jsx)(LM,{htmlFor:`api-key-actor-id`,children:`Actor ID (optional)`}),(0,K.jsx)(RM,{children:`Pin this key to a fixed actor ID`}),(0,K.jsx)(vS,{id:`api-key-actor-id`,placeholder:`actor-123`,value:m,onChange:e=>h(e.target.value)})]}),(0,K.jsxs)(IM,{children:[(0,K.jsx)(LM,{htmlFor:`api-key-scope-keys`,children:`Scope keys (optional)`}),(0,K.jsx)(RM,{children:`Comma-separated list of allowed scope keys`}),(0,K.jsx)(vS,{id:`api-key-scope-keys`,placeholder:`scope-a, scope-b`,value:g,onChange:e=>_(e.target.value)})]}),(0,K.jsxs)(IM,{children:[(0,K.jsx)(LM,{htmlFor:`api-key-expires-days`,children:`Expires in days (optional)`}),(0,K.jsx)(RM,{children:`Leave empty to keep the key non-expiring.`}),(0,K.jsx)(vS,{id:`api-key-expires-days`,placeholder:`30`,value:v,inputMode:`numeric`,onChange:e=>y(e.target.value)}),V?null:(0,K.jsx)(`p`,{className:`font-mono text-[10px] text-offline`,children:`Enter a positive whole number.`})]}),(0,K.jsxs)(bF,{children:[(0,K.jsx)(Q,{variant:`default`,onClick:()=>s(!1),children:`Cancel`}),(0,K.jsx)(Q,{variant:`primary`,onClick:oe,disabled:te.isPending||!u||!V,children:te.isPending?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Qw,{size:`sm`}),`Creating...`]}):`Create`})]})]})]})}),(0,K.jsx)(gF,{open:c,onOpenChange:e=>{l(e),e||T(null)},children:(0,K.jsxs)(vF,{children:[(0,K.jsx)(yF,{children:(0,K.jsx)(xF,{children:`Bulk Revoke API Keys`})}),w?(0,K.jsxs)(`div`,{className:`px-5 py-4 flex flex-col gap-3`,children:[(0,K.jsx)(YP,{variant:`destructive`,children:(0,K.jsxs)(ZP,{children:[`Requested `,w.requestedCount,` keys. Revoked`,` `,w.revokedCount,`, already revoked`,` `,w.alreadyRevokedCount,`, not found`,` `,w.notFoundCount,`.`]})}),(0,K.jsx)(bF,{children:(0,K.jsx)(Q,{variant:`primary`,onClick:()=>{l(!1),T(null)},children:`Done`})})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`px-5 py-4 flex flex-col gap-3`,children:[(0,K.jsx)(YP,{variant:`destructive`,children:(0,K.jsx)(ZP,{children:`This revokes selected keys immediately and cannot be undone.`})}),(0,K.jsxs)(`p`,{className:`font-mono text-[10px] text-neutral-500`,children:[`Selected keys: `,ge.slice(0,5).join(`, `),ge.length>5?` +${ge.length-5} more`:``]})]}),(0,K.jsxs)(bF,{children:[(0,K.jsx)(Q,{variant:`default`,onClick:()=>l(!1),children:`Cancel`}),(0,K.jsx)(Q,{variant:`destructive`,onClick:le,disabled:ne.isPending||S.length===0,children:ne.isPending?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Qw,{size:`sm`}),`Revoking...`]}):`Revoke Selected`})]})]})]})}),(0,K.jsx)(gF,{open:A!==null||M!==null,onOpenChange:()=>{j(null),N(null)},children:(0,K.jsxs)(vF,{children:[(0,K.jsx)(yF,{children:(0,K.jsx)(xF,{children:`Stage Rotate API Key`})}),M?(0,K.jsxs)(`div`,{className:`px-5 py-4 flex flex-col gap-4`,children:[(0,K.jsx)(YP,{variant:`default`,children:(0,K.jsxs)(ZP,{children:[`Replacement key created for `,M.oldKeyName,`. The old key is still active until you revoke it.`]})}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`code`,{className:`flex-1 rounded-md border border-border bg-surface p-3 font-mono text-[11px] text-white break-all`,children:M.secretKey}),(0,K.jsx)(Q,{variant:`default`,size:`sm`,onClick:()=>se(M.secretKey),children:E===M.secretKey?`Copied`:`Copy`})]}),(0,K.jsxs)(bF,{children:[(0,K.jsx)(Q,{variant:`default`,onClick:()=>{N(null),j(null)},children:`Keep Old Key Active`}),(0,K.jsx)(Q,{variant:`destructive`,onClick:de,disabled:re.isPending,children:re.isPending?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Qw,{size:`sm`}),`Revoking Old Key...`]}):`Finalize and Revoke Old Key`})]})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`px-5 py-4`,children:(0,K.jsx)(`p`,{className:`font-mono text-[10px] text-neutral-500`,children:`Staged rotation creates a replacement key now and keeps the current key active until you explicitly revoke it.`})}),(0,K.jsxs)(bF,{children:[(0,K.jsx)(Q,{variant:`default`,onClick:()=>j(null),children:`Cancel`}),(0,K.jsx)(Q,{variant:`primary`,onClick:ue,disabled:ae.isPending||!A,children:ae.isPending?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Qw,{size:`sm`}),`Staging...`]}):`Create Replacement Key`})]})]})]})}),(0,K.jsx)(gF,{open:O!==null,onOpenChange:()=>k(null),children:(0,K.jsxs)(vF,{children:[(0,K.jsx)(yF,{children:(0,K.jsx)(xF,{children:`Revoke API Key`})}),(0,K.jsx)(`div`,{className:`px-5 py-4`,children:(0,K.jsx)(YP,{variant:`destructive`,children:(0,K.jsx)(ZP,{children:`Revoking a key immediately invalidates it for all requests.`})})}),(0,K.jsxs)(bF,{children:[(0,K.jsx)(Q,{variant:`default`,onClick:()=>k(null),children:`Cancel`}),(0,K.jsx)(Q,{variant:`destructive`,onClick:ce,disabled:re.isPending,children:re.isPending?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Qw,{size:`sm`}),`Revoking...`]}):`Revoke`})]})]})}),(0,K.jsx)(gF,{open:P!==null||I!==null,onOpenChange:()=>{F(null),L(null)},children:(0,K.jsxs)(vF,{children:[(0,K.jsx)(yF,{children:(0,K.jsx)(xF,{children:`Rotate API Key`})}),I?(0,K.jsx)(DL,{copiedKeyId:E,onClose:()=>L(null),onCopy:se,secretKey:I,warning:`The previous key has been invalidated. Store this replacement securely.`}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`px-5 py-4`,children:(0,K.jsx)(`p`,{className:`font-mono text-[10px] text-neutral-500`,children:`Rotating a key invalidates the previous secret immediately.`})}),(0,K.jsxs)(bF,{children:[(0,K.jsx)(Q,{variant:`default`,onClick:()=>F(null),children:`Cancel`}),(0,K.jsx)(Q,{variant:`primary`,onClick:fe,disabled:ie.isPending,children:ie.isPending?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Qw,{size:`sm`}),`Rotating...`]}):`Rotate`})]})]})]})})]})}function EL(){let{preferences:e,updatePreference:t,resetPreferences:n}=WI();return(0,K.jsx)(zT,{rows:[{type:`filter`,label:`Auto-refresh interval`,options:GI.map(e=>({id:`${e.value}`,label:e.label})),activeId:`${e.refreshInterval}`,onActiveChange:e=>t(`refreshInterval`,Number.parseInt(e,10))},{type:`filter`,label:`Items per page`,options:KI.map(e=>({id:`${e.value}`,label:e.label})),activeId:`${e.pageSize}`,onActiveChange:e=>t(`pageSize`,Number.parseInt(e,10))},{type:`filter`,label:`Time format`,options:[{id:`relative`,label:`Relative`},{id:`absolute`,label:`Absolute`}],activeId:e.timeFormat,onActiveChange:e=>t(`timeFormat`,e)},{type:`toggle`,label:`Show sparklines`,description:`Display mini trend charts in dashboard metric cards`,checked:e.showSparklines,onCheckedChange:e=>t(`showSparklines`,e)}],onResetDefaults:n})}function DL({copiedKeyId:e,onClose:t,onCopy:n,secretKey:r,warning:i}){return(0,K.jsxs)(`div`,{className:`px-5 py-4 flex flex-col gap-4`,children:[(0,K.jsx)(YP,{variant:`destructive`,children:(0,K.jsx)(ZP,{children:i})}),(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(`code`,{className:`flex-1 rounded-md border border-border bg-surface p-3 font-mono text-[11px] text-white break-all`,children:r}),(0,K.jsx)(Q,{variant:`default`,size:`sm`,onClick:()=>n(r),children:e===r?`Copied`:`Copy`})]}),(0,K.jsx)(bF,{children:(0,K.jsx)(Q,{variant:`primary`,onClick:t,children:`Done`})})]})}function OL(e){let t=e.toLowerCase();return t.includes(`mobile`)||t.includes(`ios`)||t.includes(`android`)?`mobile`:t.includes(`tablet`)?`tablet`:t.includes(`desktop`)||t.includes(`laptop`)?`desktop`:t.includes(`edge`)?`edge`:t.includes(`iot`)?`iot`:`desktop`}function kL(e){let t=e.toLowerCase();return t.includes(`pglite`)?`PGlite`:t.includes(`wa-sqlite`)||t.includes(`sqlite`)?`SQLite`:t.includes(`postgres`)||t.includes(`pg`)?`PostgreSQL`:`unknown`}function AL(e,t){if(t===`absolute`)return new Date(e).toLocaleString();try{let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3),i=Math.floor(r/60),a=Math.floor(i/60),o=Math.floor(a/24);return r<60?`just now`:i<60?`${i}m ago`:a<24?`${a}h ago`:`${o}d ago`}catch{return e}}function jL(e,t,n){return{id:e.clientId,type:OL(e.clientId),status:e.activityState===`stale`?`offline`:e.activityState===`idle`?`syncing`:`online`,cursor:e.cursor,actor:e.actorId,mode:e.connectionMode===`realtime`?`realtime`:`polling`,dialect:kL(e.clientId),scopes:Object.keys(e.effectiveScopes??{}),lastSeen:AL(e.updatedAt,n)}}function ML({emptyState:e}={}){let[t,n]=(0,G.useState)(1),[r,i]=(0,G.useState)(null),{preferences:a}=WI(),{partitionId:o}=HI(),s=a.pageSize,c=a.refreshInterval*1e3,{data:l,isLoading:u}=hI({refetchIntervalMs:c,partitionId:o}),{data:d,isLoading:f,error:p}=xI({limit:s,offset:(t-1)*s,partitionId:o},{refetchIntervalMs:c}),m=OI(),h=Math.ceil((d?.total??0)/s),g=l?.maxCommitSeq??0;(0,G.useEffect)(()=>{n(1)},[]);let _=async()=>{if(r)try{await m.mutateAsync({clientId:r,partitionId:o})}finally{i(null)}};if(f||u)return(0,K.jsx)(`div`,{className:`flex items-center justify-center h-[200px]`,children:(0,K.jsx)(Qw,{size:`lg`})});if(p)return(0,K.jsx)(`div`,{className:`flex items-center justify-center h-[200px]`,children:(0,K.jsxs)(`p`,{className:`text-danger`,children:[`Failed to load clients: `,p.message]})});let v=(d?.items??[]).map(e=>jL(e,g,a.timeFormat));return(0,K.jsxs)(`div`,{className:`flex flex-col gap-5 px-5 py-5`,children:[v.length>0&&(0,K.jsx)(qT,{clients:v,headSeq:g}),v.length===0?e??(0,K.jsx)(RT,{children:(0,K.jsx)(aT,{message:`No clients yet`})}):(0,K.jsx)(OT,{clients:v,headSeq:g,onEvict:e=>{let t=d?.items.find(t=>t.clientId===e);i(t?.clientId??e)}}),h>1&&(0,K.jsx)(CF,{page:t,totalPages:h,totalItems:d?.total??0,onPageChange:n}),(0,K.jsx)(gF,{open:r!==null,onOpenChange:()=>i(null),children:(0,K.jsxs)(vF,{children:[(0,K.jsx)(yF,{children:(0,K.jsx)(xF,{children:`Evict Client`})}),(0,K.jsxs)(`div`,{className:`px-5 py-4 flex flex-col gap-4`,children:[(0,K.jsxs)(`p`,{className:`font-mono text-[11px] text-neutral-300`,children:[`Are you sure you want to evict client`,` `,(0,K.jsxs)(`span`,{className:`font-mono text-white`,children:[r?.slice(0,12),`...`]}),`?`]}),(0,K.jsx)(`p`,{className:`font-mono text-[10px] text-neutral-500`,children:`This will force the client to re-bootstrap on their next sync.`})]}),(0,K.jsxs)(bF,{children:[(0,K.jsx)(Q,{variant:`default`,onClick:()=>i(null),children:`Cancel`}),(0,K.jsx)(Q,{variant:`destructive`,onClick:_,disabled:m.isPending,children:m.isPending?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Qw,{size:`sm`}),`Evicting...`]}):`Evict`})]})]})})]})}var NL={latencyThresholdMs:1e3,errorRateThreshold:5,clientLagThreshold:50,enabled:!1};function PL(e){return e<1e3?`${e}ms`:e<6e4?`${Math.round(e/1e3)}s`:e<36e5?`${Math.round(e/6e4)}m`:`${Math.round(e/36e5)}h`}function FL(e){let t=e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0);return Array.from(new Set(t))}function IL(e){switch(e){case`notify_data_change`:return`Notify`;case`evict_client`:return`Evict`;case`compact`:return`Compact`;default:return`Prune`}}function LL(e){return!e||typeof e!=`object`||Array.isArray(e)?null:e}function RL(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function zL(e){let t=LL(e.requestPayload),n=LL(e.resultPayload);if(e.operationType===`notify_data_change`){let e=RL(t?.tables),r=n?.commitSeq;return`${e.length} table${e.length===1?``:`s`} -> commit #${typeof r==`number`?r:`?`}`}if(e.operationType===`evict_client`){let t=n?.evicted===!0?`evicted`:`not found`;return`client ${e.targetClientId??`?`} ${t}`}return e.operationType===`compact`?`${typeof n?.deletedChanges==`number`?n.deletedChanges:0} changes removed`:`${typeof n?.deletedCommits==`number`?n.deletedCommits:0} commits removed${typeof t?.watermarkCommitSeq==`number`?` at #${t.watermarkCommitSeq}`:``}`}function BL(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function VL(){let{partitionId:e}=HI();return(0,K.jsxs)(`div`,{className:`flex flex-col gap-4 px-5 py-5`,children:[(0,K.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-2`,children:[(0,K.jsx)(HL,{}),(0,K.jsx)(qL,{})]}),(0,K.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-3`,children:[(0,K.jsx)(UL,{partitionId:e}),(0,K.jsx)(WL,{partitionId:e}),(0,K.jsx)(GL,{partitionId:e})]}),(0,K.jsx)(KL,{partitionId:e})]})}function HL(){let{data:e,isLoading:t,error:n}=wI();return t?(0,K.jsx)(`div`,{className:`flex items-center justify-center h-[200px]`,children:(0,K.jsx)(Qw,{size:`lg`})}):n?(0,K.jsx)(`div`,{className:`flex items-center justify-center h-[200px]`,children:(0,K.jsxs)(`p`,{className:`text-danger`,children:[`Failed to load handlers: `,n.message]})}):(0,K.jsx)(kT,{handlers:(e?.items??[]).map(e=>({table:e.table,dependsOn:e.dependsOn?.join(`, `)??null,chunkTtl:e.snapshotChunkTtlMs?PL(e.snapshotChunkTtlMs):`default`})),tableCount:e?.items.length??0})}function UL({partitionId:e}){let[t,n]=(0,G.useState)(!1),[r,i]=(0,G.useState)(null),{data:a,isLoading:o}=hI({partitionId:e}),{data:s,isLoading:c,refetch:l}=TI({enabled:!1}),u=kI();return o?(0,K.jsx)(`div`,{className:`flex items-center justify-center h-[200px]`,children:(0,K.jsx)(Qw,{size:`lg`})}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(LT,{title:`Prune`,description:`Delete commits that all clients have already synced. Pruning removes commits older than the oldest active client cursor.`,dotColor:`syncing`,stats:[{label:`Total commits`,value:a?.commitCount??0},{label:`Commit range`,value:`${a?.minCommitSeq??0} - ${a?.maxCommitSeq??0}`},{label:`Min active cursor`,value:a?.minActiveClientCursor??`N/A`,tone:`syncing`}],actionLabel:`Preview Prune`,actionVariant:`destructive`,onAction:async()=>{n(!0),i(null),await l()}}),(0,K.jsx)(gF,{open:t,onOpenChange:n,children:(0,K.jsxs)(vF,{children:[(0,K.jsx)(yF,{children:(0,K.jsx)(xF,{children:`Prune Old Commits`})}),(0,K.jsx)(`div`,{className:`px-5 py-4 flex flex-col gap-4`,children:r===null?c?(0,K.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,K.jsx)(Qw,{size:`sm`})}):s?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(YP,{variant:s.commitsToDelete>0?`destructive`:`default`,children:(0,K.jsx)(ZP,{children:s.commitsToDelete>0?(0,K.jsxs)(K.Fragment,{children:[`This will delete`,` `,(0,K.jsx)(`strong`,{children:s.commitsToDelete}),` commits up to sequence`,` `,(0,K.jsxs)(`code`,{className:`font-mono`,children:[`#`,s.watermarkCommitSeq]}),`.`]}):`No commits are eligible for pruning.`})}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,K.jsxs)(`div`,{className:`flex justify-between font-mono text-[11px]`,children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Watermark commit seq:`}),(0,K.jsxs)(`span`,{className:`text-white`,children:[`#`,s.watermarkCommitSeq]})]}),(0,K.jsxs)(`div`,{className:`flex justify-between font-mono text-[11px] items-center`,children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Commits to delete:`}),(0,K.jsx)(Rw,{variant:s.commitsToDelete>0?`offline`:`ghost`,children:s.commitsToDelete})]})]})]}):null:(0,K.jsxs)(YP,{variant:`default`,children:[(0,K.jsx)(XP,{children:`Pruning Complete`}),(0,K.jsxs)(ZP,{children:[`Successfully deleted `,(0,K.jsx)(`strong`,{children:r}),` commits.`]})]})}),(0,K.jsxs)(bF,{children:[(0,K.jsx)(Q,{variant:`default`,onClick:()=>n(!1),children:r===null?`Cancel`:`Close`}),r===null&&(0,K.jsx)(Q,{variant:`destructive`,onClick:async()=>{i((await u.mutateAsync()).deletedCommits)},disabled:u.isPending||c||(s?.commitsToDelete??0)===0,children:u.isPending?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Qw,{size:`sm`}),`Pruning...`]}):`Prune Now`})]})]})})]})}function WL({partitionId:e}){let[t,n]=(0,G.useState)(!1),[r,i]=(0,G.useState)(null),{data:a,isLoading:o}=hI({partitionId:e}),s=AI();return o?(0,K.jsx)(`div`,{className:`flex items-center justify-center h-[200px]`,children:(0,K.jsx)(Qw,{size:`lg`})}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(LT,{title:`Compact`,description:`Merge old changes to reduce storage space. Compaction merges multiple changes to the same row into a single change.`,dotColor:`flow`,stats:[{label:`Total changes`,value:a?.changeCount??0},{label:`Total commits`,value:a?.commitCount??0}],actionLabel:`Run Compaction`,actionVariant:`primary`,onAction:()=>{n(!0),i(null)}}),(0,K.jsx)(gF,{open:t,onOpenChange:n,children:(0,K.jsxs)(vF,{children:[(0,K.jsx)(yF,{children:(0,K.jsx)(xF,{children:`Compact Changes`})}),(0,K.jsx)(`div`,{className:`px-5 py-4 flex flex-col gap-4`,children:r===null?(0,K.jsx)(YP,{variant:`default`,children:(0,K.jsx)(ZP,{children:`Compaction will merge multiple changes to the same row, keeping only the most recent version. This is safe and can be run at any time.`})}):(0,K.jsxs)(YP,{variant:`default`,children:[(0,K.jsx)(XP,{children:`Compaction Complete`}),(0,K.jsxs)(ZP,{children:[`Successfully removed `,(0,K.jsx)(`strong`,{children:r}),` redundant changes.`]})]})}),(0,K.jsxs)(bF,{children:[(0,K.jsx)(Q,{variant:`default`,onClick:()=>n(!1),children:r===null?`Cancel`:`Close`}),r===null&&(0,K.jsx)(Q,{variant:`primary`,onClick:async()=>{i((await s.mutateAsync()).deletedChanges)},disabled:s.isPending,children:s.isPending?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Qw,{size:`sm`}),`Compacting...`]}):`Compact Now`})]})]})})]})}function GL({partitionId:e}){let[t,n]=(0,G.useState)(!1),[r,i]=(0,G.useState)(`tasks`),[a,o]=(0,G.useState)(e??``),[s,c]=(0,G.useState)(null),[l,u]=(0,G.useState)(null),d=jI(),f=FL(r),p=[{label:`Next tables`,value:f.length,tone:`syncing`},{label:`Last commit seq`,value:s?`#${s.commitSeq}`:`—`,tone:`syncing`},{label:`Last chunks cleared`,value:s?.deletedChunks??`—`}];return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(LT,{title:`Notify Data Change`,description:`Create a synthetic commit after external imports or direct DB writes so clients re-bootstrap for affected tables.`,dotColor:`healthy`,stats:p,actionLabel:`Notify Clients`,actionVariant:`primary`,onAction:()=>{n(!0),u(null)}}),(0,K.jsx)(gF,{open:t,onOpenChange:n,children:(0,K.jsxs)(vF,{children:[(0,K.jsx)(yF,{children:(0,K.jsx)(xF,{children:`Notify External Data Change`})}),(0,K.jsxs)(`div`,{className:`flex flex-col gap-4 px-5 py-4`,children:[s?(0,K.jsxs)(YP,{variant:`default`,children:[(0,K.jsx)(XP,{children:`Notification Sent`}),(0,K.jsxs)(ZP,{children:[`Created synthetic commit`,` `,(0,K.jsxs)(`strong`,{children:[`#`,s.commitSeq]}),` for`,` `,(0,K.jsx)(`strong`,{children:s.tables.length}),` table`,s.tables.length===1?``:`s`,` and cleared`,` `,(0,K.jsx)(`strong`,{children:s.deletedChunks}),` cached chunk`,s.deletedChunks===1?``:`s`,`.`]})]}):(0,K.jsx)(YP,{variant:`default`,children:(0,K.jsx)(ZP,{children:`Use this when data changed outside Syncular push flow. It invalidates cached snapshot chunks and forces clients to pull fresh data.`})}),l?(0,K.jsx)(YP,{variant:`destructive`,children:(0,K.jsx)(ZP,{children:l})}):null,(0,K.jsxs)(IM,{children:[(0,K.jsx)(LM,{children:`Tables (comma-separated)`}),(0,K.jsx)(vS,{value:r,onChange:e=>i(e.target.value),placeholder:`tasks, notes`,disabled:d.isPending}),(0,K.jsx)(RM,{children:`Enter one or more table names affected by the external change.`})]}),(0,K.jsxs)(IM,{children:[(0,K.jsx)(LM,{children:`Partition ID (optional)`}),(0,K.jsx)(vS,{value:a,onChange:e=>o(e.target.value),placeholder:`default`,disabled:d.isPending})]})]}),(0,K.jsxs)(bF,{children:[(0,K.jsx)(Q,{variant:`default`,onClick:()=>n(!1),children:s?`Close`:`Cancel`}),s?null:(0,K.jsx)(Q,{variant:`primary`,onClick:async()=>{if(f.length===0){u(`Provide at least one table name.`);return}u(null),c(await d.mutateAsync({tables:f,partitionId:a.trim()||void 0}))},disabled:d.isPending,children:d.isPending?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Qw,{size:`sm`}),`Notifying...`]}):`Notify Data Change`})]})]})})]})}function KL({partitionId:e}){let[t,n]=(0,G.useState)(`all`),{data:r,isLoading:i,error:a}=EI({limit:20,offset:0,operationType:t===`all`?void 0:t,partitionId:e},{refetchIntervalMs:5e3});return(0,K.jsx)(VT,{title:`Operation Audit`,description:`Recent prune/compact/notify/evict actions with actor and result context.`,actions:(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Q,{variant:t===`all`?`default`:`ghost`,size:`sm`,onClick:()=>n(`all`),children:`All`}),(0,K.jsx)(Q,{variant:t===`prune`?`default`:`ghost`,size:`sm`,onClick:()=>n(`prune`),children:`Prune`}),(0,K.jsx)(Q,{variant:t===`compact`?`default`:`ghost`,size:`sm`,onClick:()=>n(`compact`),children:`Compact`}),(0,K.jsx)(Q,{variant:t===`notify_data_change`?`default`:`ghost`,size:`sm`,onClick:()=>n(`notify_data_change`),children:`Notify`}),(0,K.jsx)(Q,{variant:t===`evict_client`?`default`:`ghost`,size:`sm`,onClick:()=>n(`evict_client`),children:`Evict`})]}),contentClassName:`pt-2`,children:i?(0,K.jsx)(`div`,{className:`flex items-center justify-center py-10`,children:(0,K.jsx)(Qw,{size:`lg`})}):a?(0,K.jsx)(YP,{variant:`destructive`,children:(0,K.jsxs)(ZP,{children:[`Failed to load operation audit events: `,a.message]})}):(r?.items.length??0)===0?(0,K.jsx)(`div`,{className:`px-2 py-8 text-sm text-neutral-500`,children:`No operation events found for this filter.`}):(0,K.jsx)(`div`,{className:`overflow-x-auto`,children:(0,K.jsxs)(zw,{children:[(0,K.jsx)(Bw,{children:(0,K.jsxs)(Hw,{children:[(0,K.jsx)(Uw,{children:`Time`}),(0,K.jsx)(Uw,{children:`Type`}),(0,K.jsx)(Uw,{children:`User`}),(0,K.jsx)(Uw,{children:`Target`}),(0,K.jsx)(Uw,{children:`Result`})]})}),(0,K.jsx)(Vw,{children:(r?.items??[]).map((e,t)=>(0,K.jsxs)(Hw,{children:[(0,K.jsx)(Ww,{className:`whitespace-nowrap text-xs text-neutral-400`,children:BL(e.createdAt)}),(0,K.jsx)(Ww,{children:(0,K.jsx)(Rw,{variant:`ghost`,children:IL(e.operationType)})}),(0,K.jsx)(Ww,{className:`font-mono text-xs`,children:e.consoleUserId??`system`}),(0,K.jsx)(Ww,{className:`font-mono text-xs`,children:e.targetClientId??e.partitionId??(e.operationType===`notify_data_change`?`partition default`:`global`)}),(0,K.jsx)(Ww,{className:`font-mono text-xs text-neutral-300`,children:zL(e)})]},`${e.operationId}:${e.createdAt}:${t}`))})]})})})}function qL(){let[e,t]=eI(`console:alert-config`,NL),n={p90Latency:e.latencyThresholdMs,errorRate:e.errorRateThreshold,clientLag:e.clientLagThreshold};return(0,K.jsx)(Fw,{enabled:e.enabled,onEnabledChange:e=>{t(t=>({...t,enabled:e}))},thresholds:n,onThresholdsChange:e=>{t(t=>({...t,latencyThresholdMs:e.p90Latency,errorRateThreshold:e.errorRate,clientLagThreshold:e.clientLag}))}})}function JL(e){if(e===0)return`0 B`;let t=[`B`,`KB`,`MB`,`GB`,`TB`],n=Math.floor(Math.log(e)/Math.log(1024));return`${(e/1024**n).toFixed(n===0?0:1)} ${t[n]}`}function YL(e){let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function XL(){let[e,t]=(0,G.useState)(``),[n,r]=(0,G.useState)(void 0),[i,a]=(0,G.useState)(void 0),[o,s]=(0,G.useState)([]),[c,l]=(0,G.useState)(null),{data:u,isLoading:d,error:f}=RI({prefix:n,cursor:i,limit:100}),p=zI(),m=BI();function h(){let t=e.trim();r(t.length>0?t:void 0),a(void 0),s([])}function g(){t(``),r(void 0),a(void 0),s([])}function _(){u?.cursor&&(s(e=>[...e,i??``]),a(u.cursor))}function v(){s(e=>{let t=[...e],n=t.pop();return a(n&&n.length>0?n:void 0),t})}function y(){c&&p.mutate(c,{onSuccess:()=>l(null)})}if(d)return(0,K.jsx)(`div`,{className:`flex flex-col gap-4 px-5 py-5`,children:(0,K.jsx)(`div`,{className:`flex items-center justify-center h-[200px]`,children:(0,K.jsx)(Qw,{size:`lg`})})});if(f)return(0,K.jsx)(`div`,{className:`flex flex-col gap-4 px-5 py-5`,children:(0,K.jsx)(`div`,{className:`flex items-center justify-center h-[200px]`,children:(0,K.jsxs)(`p`,{className:`text-danger font-mono text-[11px]`,children:[`Failed to load storage items: `,f.message]})})});let b=u?.items??[];return(0,K.jsxs)(`div`,{className:`flex flex-col gap-4 px-5 py-5`,children:[(0,K.jsx)(VT,{title:`Storage`,actions:(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(vS,{placeholder:`Prefix filter...`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{e.key===`Enter`&&h()},className:`h-7 w-48 text-xs`}),(0,K.jsx)(Q,{variant:`default`,size:`sm`,onClick:h,children:`Filter`}),n&&(0,K.jsx)(Q,{variant:`ghost`,size:`sm`,onClick:g,children:`Clear`})]}),children:b.length===0?(0,K.jsx)(aT,{message:n?`No storage items matching prefix "${n}".`:`No storage items found.`}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`div`,{className:`overflow-x-auto`,children:(0,K.jsxs)(zw,{children:[(0,K.jsx)(Bw,{children:(0,K.jsxs)(Hw,{children:[(0,K.jsx)(Uw,{children:`Key`}),(0,K.jsx)(Uw,{children:`Size`}),(0,K.jsx)(Uw,{children:`Type`}),(0,K.jsx)(Uw,{children:`Uploaded`}),(0,K.jsx)(Uw,{children:`Actions`})]})}),(0,K.jsx)(Vw,{children:b.map(e=>(0,K.jsxs)(Hw,{children:[(0,K.jsx)(Ww,{className:`font-mono text-xs max-w-[320px]`,title:e.key,children:e.key}),(0,K.jsx)(Ww,{className:`font-mono text-xs text-neutral-400 whitespace-nowrap`,children:JL(e.size)}),(0,K.jsx)(Ww,{children:e.httpMetadata?.contentType?(0,K.jsx)(Rw,{variant:`ghost`,children:e.httpMetadata.contentType}):(0,K.jsx)(`span`,{className:`text-neutral-500 text-xs`,children:`--`})}),(0,K.jsx)(Ww,{className:`whitespace-nowrap text-xs text-neutral-400`,children:YL(e.uploaded)}),(0,K.jsx)(Ww,{children:(0,K.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,K.jsx)(Q,{variant:`ghost`,size:`sm`,onClick:()=>void m(e.key),children:`Download`}),(0,K.jsx)(Q,{variant:`ghost`,size:`sm`,onClick:()=>l(e.key),children:`Delete`})]})})]},e.key))})]})}),(0,K.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-2`,children:[(0,K.jsx)(Q,{variant:`ghost`,size:`sm`,disabled:o.length===0,onClick:v,children:`Previous`}),(0,K.jsx)(Q,{variant:`ghost`,size:`sm`,disabled:!u?.truncated,onClick:_,children:`Next`})]})]})}),(0,K.jsx)(gF,{open:c!==null,onOpenChange:()=>l(null),children:(0,K.jsxs)(vF,{children:[(0,K.jsx)(yF,{children:(0,K.jsx)(xF,{children:`Delete Storage Item`})}),(0,K.jsxs)(`div`,{className:`px-5 py-4 flex flex-col gap-4`,children:[(0,K.jsxs)(`p`,{className:`font-mono text-[11px] text-neutral-300`,children:[`Are you sure you want to delete`,` `,(0,K.jsx)(`span`,{className:`font-mono text-white`,children:c}),`?`]}),(0,K.jsx)(`p`,{className:`font-mono text-[10px] text-neutral-500`,children:`This action cannot be undone.`})]}),(0,K.jsxs)(bF,{children:[(0,K.jsx)(Q,{variant:`default`,onClick:()=>l(null),children:`Cancel`}),(0,K.jsx)(Q,{variant:`destructive`,onClick:y,disabled:p.isPending,children:p.isPending?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Qw,{size:`sm`}),` Deleting...`]}):`Delete`})]})]})})]})}function ZL(e,t){if(t===`absolute`)return new Date(e).toLocaleString();let n=new Date(e),r=new Date().getTime()-n.getTime(),i=Math.floor(r/1e3);return i<60?`${i}s`:i<3600?`${Math.floor(i/60)}m`:i<86400?`${Math.floor(i/3600)}h`:`${Math.floor(i/86400)}d`}function QL(e){let t=e.split(/\s+/).map(e=>e.trim()).filter(e=>e.length>0),n={},r=[];for(let e of t){let[t=``,...i]=e.split(`:`),a=i.join(`:`).trim(),o=t.toLowerCase();if(!a){r.push(e);continue}if(o===`actor`){n.actorId=a;continue}if(o===`client`){n.clientId=a;continue}if(o===`table`){n.table=a;continue}if(o===`request`){n.requestId=a;continue}if(o===`trace`){n.traceId=a;continue}r.push(e)}return r.length>0&&(n.search=r.join(` `)),n}function $L(e){return e===`1h`?3600*1e3:e===`6h`?360*60*1e3:e===`24h`?1440*60*1e3:e===`7d`?10080*60*1e3:720*60*60*1e3}function eR(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function tR(e,t){return e?`#${e.federatedCommitId??(t?`${t}:${e.commitSeq}`:String(e.commitSeq))}`:`#?`}function nR(e,t){return e?`E${e.federatedEventId??(t?`${t}:${e.eventId}`:e.eventId)}`:`E?`}function rR(e,t,n){return!e||!t?null:e.replaceAll(`{traceId}`,encodeURIComponent(t)).replaceAll(`{spanId}`,encodeURIComponent(n??``))}function iR({initialSelectedEntryId:e}={}){let{preferences:t}=WI(),{partitionId:n}=HI(),{range:r,setRange:i}=rL(),a=t.pageSize,o=t.refreshInterval*1e3,[s,c]=(0,G.useState)(()=>e?.startsWith(`#`)?`commits`:e?.startsWith(`E`)?`events`:`all`),[l,u]=(0,G.useState)(`all`),[d,f]=(0,G.useState)(`all`),[p,m]=(0,G.useState)(``),[h,g]=(0,G.useState)(1),[_,v]=(0,G.useState)(!1),[y,b]=(0,G.useState)(e??null),x=(0,G.useRef)(!1),S=(0,G.useMemo)(()=>QL(p),[p]),C=(0,G.useMemo)(()=>new Date(Date.now()-$L(r)).toISOString(),[r]),{data:w,isLoading:T,refetch:E}=bI({limit:a,offset:(h-1)*a,...n?{partitionId:n}:{},view:s,...s!==`commits`&&l!==`all`?{eventType:l}:{},...s!==`commits`&&d!==`all`?{outcome:d}:{},...S.actorId?{actorId:S.actorId}:{},...S.clientId?{clientId:S.clientId}:{},...S.requestId?{requestId:S.requestId}:{},...S.traceId?{traceId:S.traceId}:{},...S.table?{table:S.table}:{},...S.search?{search:S.search}:{},from:C},{refetchIntervalMs:o}),D=DI(),O=y?.startsWith(`#`)?y.slice(1):void 0,k=y?.startsWith(`E`)?y.slice(1):void 0,A=O&&O!==`?`?O:void 0,j=k&&k!==`?`?k:void 0,{data:M,isLoading:N,error:P}=yI(A,{enabled:A!==void 0,partitionId:n}),{data:F,isLoading:I,error:L}=SI(j,{enabled:j!==void 0,partitionId:n}),{data:ee,isLoading:R,error:z}=CI(j,{enabled:j!==void 0&&!!F?.payloadRef,partitionId:n}),B=(0,G.useMemo)(()=>rR(void 0,F?.traceId??null,F?.spanId??null),[F?.spanId,F?.traceId,void 0]);(0,G.useEffect)(()=>{g(1)},[]),(0,G.useEffect)(()=>{g(1)},[]),(0,G.useEffect)(()=>{e&&b(e)},[e]),(0,G.useEffect)(()=>{if(!x.current){x.current=!0;return}b(null)},[]),(0,G.useEffect)(()=>{g(1),b(null)},[]);let V=(0,G.useMemo)(()=>(w?.items??[]).map(e=>{let n=e.instanceId??e.commit?.instanceId??e.event?.instanceId,r=n?`[${n}] `:``;if(e.type===`commit`&&e.commit){let i=e.commit;return{type:`commit`,id:tR(i,n),outcome:`--`,duration:`--`,actor:i.actorId,client:i.clientId,detail:`${r}${i.changeCount} chg | ${(i.affectedTables??[]).join(`, `)}`,time:ZL(e.timestamp,t.timeFormat)}}let i=e.event;return i?{type:i.eventType,id:nR(i,n),outcome:i.outcome,duration:`${i.durationMs}ms`,actor:i.actorId,client:i.clientId,detail:`${r}${(i.tables??[]).join(`, `)||`--`}`,time:ZL(e.timestamp,t.timeFormat)}:{type:`pull`,id:`E?`,outcome:`unknown`,duration:`--`,actor:``,client:``,detail:`--`,time:ZL(e.timestamp,t.timeFormat)}}),[t.timeFormat,w?.items]),H=w?.total??0,U=Math.max(1,Math.ceil(H/a)),W=T,te=[{label:``,options:[{id:`all`,label:`All`},{id:`commits`,label:`Commits`},{id:`events`,label:`Events`}],activeId:s,onActiveChange:e=>{c(e),e===`commits`&&(u(`all`),f(`all`)),g(1)}},{label:`Time`,options:[{id:`1h`,label:`1h`},{id:`6h`,label:`6h`},{id:`24h`,label:`24h`},{id:`7d`,label:`7d`},{id:`30d`,label:`30d`}],activeId:r,onActiveChange:e=>{i(e),g(1)}},{label:`Type`,options:[{id:`all`,label:`All`},{id:`push`,label:`Push`},{id:`pull`,label:`Pull`}],activeId:l,onActiveChange:e=>{u(e),g(1)}},{label:`Outcome`,options:[{id:`all`,label:`All`},{id:`applied`,label:`Applied`},{id:`error`,label:`Error`},{id:`rejected`,label:`Rejected`}],activeId:d,onActiveChange:e=>{f(e),g(1)}}];function ne(){D.mutate(void 0,{onSuccess:()=>{v(!1),E()}})}return(0,K.jsxs)(`div`,{className:`flex flex-col h-full`,children:[W&&V.length===0?(0,K.jsx)(`div`,{className:`flex items-center justify-center py-24`,children:(0,K.jsx)(Qw,{size:`lg`})}):(0,K.jsx)(WT,{entries:V,selectedEntryId:y,onEntryClick:e=>b(e.id),filterBar:(0,K.jsx)(oT,{groups:te,searchValue:p,searchPlaceholder:`Use actor:, client:, table:, request:, trace: or free text...`,onSearchChange:m,actions:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Q,{size:`sm`,variant:`ghost`,onClick:()=>void E(),children:`Refresh`}),(0,K.jsx)(Q,{size:`sm`,variant:`ghost`,children:`Export`}),(0,K.jsx)(Q,{size:`sm`,variant:`destructive`,onClick:()=>v(!0),children:`Clear`})]})}),pagination:(0,K.jsx)(CF,{page:h,totalPages:U,totalItems:H,onPageChange:g})}),(0,K.jsx)(gF,{open:y!==null,onOpenChange:e=>{e||b(null)},children:(0,K.jsxs)(vF,{children:[(0,K.jsx)(yF,{children:(0,K.jsx)(xF,{children:A===void 0?j===void 0?`Entry details`:`Event E${j}`:`Commit #${A}`})}),(0,K.jsx)(`div`,{className:`px-5 py-4 space-y-3 max-h-[70vh] overflow-y-auto`,children:N||I?(0,K.jsx)(`div`,{className:`flex items-center justify-center py-8`,children:(0,K.jsx)(Qw,{size:`sm`})}):P||L?(0,K.jsx)(`p`,{className:`font-mono text-[11px] text-offline`,children:`Failed to load details.`}):M?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 font-mono text-[11px]`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Actor`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:M.actorId})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Client`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:M.clientId})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Instance`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:M.instanceId??`--`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Created`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:ZL(M.createdAt,t.timeFormat)})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Changes`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:M.changeCount})]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2`,children:`Affected Tables`}),(0,K.jsx)(`p`,{className:`font-mono text-[11px] text-neutral-200`,children:M.affectedTables.join(`, `)||`--`})]}),(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(`p`,{className:`font-mono text-[10px] uppercase tracking-wider text-neutral-500`,children:`Changes`}),M.changes.length===0?(0,K.jsx)(`p`,{className:`font-mono text-[11px] text-neutral-500`,children:`No changes recorded.`}):M.changes.map(e=>(0,K.jsxs)(`div`,{className:`rounded-md border border-border p-3 space-y-2`,children:[(0,K.jsxs)(`div`,{className:`flex items-center justify-between font-mono text-[11px]`,children:[(0,K.jsxs)(`span`,{className:`text-neutral-300`,children:[e.table,` | `,e.op]}),(0,K.jsxs)(`span`,{className:`text-neutral-500`,children:[`#`,e.changeId]})]}),(0,K.jsxs)(`div`,{className:`font-mono text-[11px] text-neutral-400`,children:[`rowId: `,e.rowId,e.rowVersion===null?``:` | version: ${e.rowVersion}`]}),(0,K.jsx)(`pre`,{className:`font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200`,children:eR(e.rowJson)})]},e.changeId))]})]}):F?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`grid grid-cols-2 gap-3 font-mono text-[11px]`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Type`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:F.eventType})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Path`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:F.syncPath})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Instance`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:F.instanceId??`--`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Outcome`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:F.outcome})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Response Status`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:F.responseStatus})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Actor`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:F.actorId})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Client`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:F.clientId})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Status`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:F.statusCode})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Transport`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:F.transportPath})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Duration`}),(0,K.jsxs)(`div`,{className:`text-neutral-100`,children:[F.durationMs,`ms`]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Request ID`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:F.requestId})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Trace ID`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:F.traceId??`--`}),B&&(0,K.jsx)(`a`,{href:B,target:`_blank`,rel:`noreferrer`,className:`font-mono text-[10px] text-flow underline underline-offset-4`,children:`Open external trace`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Span ID`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:F.spanId??`--`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Commit Seq`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:F.commitSeq??`--`}),F.commitSeq!==null&&(0,K.jsx)(Q,{variant:`ghost`,size:`sm`,onClick:()=>b(`#${F.instanceId?`${F.instanceId}:`:``}${F.commitSeq}`),children:`Open linked commit`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Subscription Count`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:F.subscriptionCount??`--`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Error Code`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:F.errorCode??`--`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Payload Ref`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:F.payloadRef??`--`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{className:`text-neutral-500`,children:`Created`}),(0,K.jsx)(`div`,{className:`text-neutral-100`,children:ZL(F.createdAt,t.timeFormat)})]})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2`,children:`Tables`}),(0,K.jsx)(`p`,{className:`font-mono text-[11px] text-neutral-200`,children:F.tables.join(`, `)||`--`})]}),F.scopesSummary&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2`,children:`Scopes Summary`}),(0,K.jsx)(`pre`,{className:`font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200`,children:eR(F.scopesSummary)})]}),F.payloadRef&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2`,children:`Payload Snapshot`}),R?(0,K.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,K.jsx)(Qw,{size:`sm`}),(0,K.jsx)(`span`,{className:`font-mono text-[11px] text-neutral-400`,children:`Loading payload snapshot...`})]}):z?(0,K.jsx)(`p`,{className:`font-mono text-[11px] text-offline`,children:`Failed to load payload snapshot.`}):ee?(0,K.jsxs)(`div`,{className:`space-y-2`,children:[(0,K.jsx)(`p`,{className:`font-mono text-[10px] uppercase tracking-wider text-neutral-500`,children:`Request`}),(0,K.jsx)(`pre`,{className:`font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200`,children:eR(ee.requestPayload)}),(0,K.jsx)(`p`,{className:`font-mono text-[10px] uppercase tracking-wider text-neutral-500`,children:`Response`}),(0,K.jsx)(`pre`,{className:`font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200`,children:eR(ee.responsePayload)})]}):(0,K.jsx)(`p`,{className:`font-mono text-[11px] text-neutral-500`,children:`No payload snapshot available.`})]}),F.errorMessage&&(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`p`,{className:`font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2`,children:`Error`}),(0,K.jsx)(`p`,{className:`font-mono text-[11px] text-offline`,children:F.errorMessage})]})]}):(0,K.jsx)(`p`,{className:`font-mono text-[11px] text-neutral-500`,children:`No details available for this row.`})}),(0,K.jsx)(bF,{children:(0,K.jsx)(Q,{variant:`default`,size:`sm`,onClick:()=>b(null),children:`Close`})})]})}),(0,K.jsx)(gF,{open:_,onOpenChange:e=>{e||v(!1)},children:(0,K.jsxs)(vF,{children:[(0,K.jsx)(yF,{children:(0,K.jsx)(xF,{children:`Clear all events`})}),(0,K.jsx)(`div`,{className:`p-4`,children:(0,K.jsx)(`span`,{className:`font-mono text-[11px] text-neutral-400`,children:`This will permanently delete all request events. Commits are not affected. Are you sure?`})}),(0,K.jsxs)(bF,{children:[(0,K.jsx)(Q,{variant:`default`,size:`sm`,onClick:()=>v(!1),children:`Cancel`}),(0,K.jsx)(Q,{variant:`destructive`,size:`sm`,onClick:ne,disabled:D.isPending,children:D.isPending?`Clearing...`:`Clear all`})]})]})})]})}var aR=Vv({getParentRoute:()=>eL,path:`/config`,component:_L}),oR=Vv({getParentRoute:()=>eL,path:`/fleet`,component:ML}),sR=Vv({getParentRoute:()=>eL,path:`/`,component:hL});function cR(){let{seq:e}=lR.useParams();return(0,K.jsx)(iR,{initialSelectedEntryId:`#${e}`})}var lR=Vv({getParentRoute:()=>eL,path:`/investigate/commit/$seq`,component:cR});function uR(){let{id:e}=dR.useParams();return(0,K.jsx)(iR,{initialSelectedEntryId:`E${e}`})}var dR=Vv({getParentRoute:()=>eL,path:`/investigate/event/$id`,component:uR}),fR=Vv({getParentRoute:()=>eL,path:`/ops`,component:VL}),pR=Vv({getParentRoute:()=>eL,path:`/storage`,component:XL}),mR=Vv({getParentRoute:()=>eL,path:`/stream`,component:iR}),hR=eL.addChildren([sR,mR,lR,dR,oR,fR,pR,aR]),gR=`syncular-console-basepath`,_R=`syncular-console-server-url`,vR=`syncular-console-token`;function yR(e){if(!e)return;let t=e.trim();return t.length>0?t:void 0}function bR(e){let t=globalThis.document;if(!t)return;let n=t.querySelector(`meta[name="${e}"]`)?.getAttribute(`content`);return yR(n)}function xR(e){return!e||e===`/`?`/`:(e.startsWith(`/`)?e:`/${e}`).replace(/\/+$/g,``)||`/`}function SR(){return xR(bR(gR))}function CR(){let e=bR(_R),t=bR(vR);return!e||!t?null:{serverUrl:e,token:t}}function wR(){return new Bm({defaultOptions:{queries:{staleTime:5e3,retry:1}}})}function TR(e){return xR(e??SR())}function ER(e){let[t]=(0,G.useState)(()=>wR()),n=(0,G.useMemo)(()=>ry({routeTree:hR,basepath:TR(e.basePath)}),[e.basePath]);return(0,K.jsx)(Wm,{client:t,children:(0,K.jsx)(jy,{defaultConfig:e.defaultConfig===void 0?CR():e.defaultConfig,autoConnect:e.autoConnect??e.defaultConfig===void 0,storageMode:e.storageMode,children:(0,K.jsx)(oy,{router:n})})})}function DR(e){return(0,K.jsx)(`div`,{className:qI,children:(0,K.jsx)(ER,{...e})})}function OR(e){if(typeof e!=`string`)return e;let t=document.querySelector(e);if(!t)throw Error(`Unable to mount console: ${e} not found`);return t}function kR(e,t={}){let n=OR(e);JI(n);let r=(0,Sy.createRoot)(n),i=(0,K.jsx)(DR,{basePath:t.basePath,defaultConfig:t.defaultConfig,autoConnect:t.autoConnect});return t.strictMode===!1?(r.render(i),r):(r.render((0,K.jsx)(G.StrictMode,{children:i})),r)}var AR=`syncular-sentry-dsn`,jR=`syncular-sentry-environment`,MR=`syncular-sentry-release`;function NR(e){if(!e)return;let t=e.trim();return t.length>0?t:void 0}function PR(e){if(typeof document>`u`)return;let t=document.querySelector(`meta[name="${e}"]`)?.getAttribute(`content`);return NR(t)}function FR(e){if(!(typeof process>`u`))return NR({}[e])}function IR(e){for(let t of e)if(t)return t}function LR(){let e=IR([NR(globalThis.__SYNCULAR_SENTRY_DSN__),PR(AR),FR(`SYNCULAR_SENTRY_DSN`)]);return e?{dsn:e,environment:IR([NR(globalThis.__SYNCULAR_SENTRY_ENVIRONMENT__),PR(jR),FR(`SYNCULAR_SENTRY_ENVIRONMENT`)]),release:IR([NR(globalThis.__SYNCULAR_SENTRY_RELEASE__),PR(MR),FR(`SYNCULAR_SENTRY_RELEASE`)]),enableLogs:!0,tracesSampleRate:.2,tracePropagationTargets:[/^https?:\/\/.*\/api\/.*/]}:null}var RR=LR();RR&&wp(RR),kR(`#root`);