@syncular/console 0.0.6-185 → 0.0.6-201
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,48 @@
|
|
|
1
|
+
function OA(e,t){for(var n=0;n<t.length;n++){const i=t[n];if(typeof i!="string"&&!Array.isArray(i)){for(const o in i)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(i,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>i[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))i(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const u of l.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&i(u)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();const Te=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,it=globalThis,No="10.40.0";function Ho(){return ch(it),it}function ch(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||No,t[No]=t[No]||{}}function fl(e,t,n=it){const i=n.__SENTRY__=n.__SENTRY__||{},o=i[No]=i[No]||{};return o[e]||(o[e]=t())}const kA=["debug","info","warn","error","log","assert","trace"],IA="Sentry Logger ",Rd={};function Fo(e){if(!("console"in it))return e();const t=it.console,n={},i=Object.keys(Rd);i.forEach(o=>{const l=Rd[o];n[o]=t[o],t[o]=l});try{return e()}finally{i.forEach(o=>{t[o]=n[o]})}}function DA(){Yy().enabled=!0}function LA(){Yy().enabled=!1}function jT(){return Yy().enabled}function PA(...e){Ky("log",...e)}function zA(...e){Ky("warn",...e)}function UA(...e){Ky("error",...e)}function Ky(e,...t){Te&&jT()&&Fo(()=>{it.console[e](`${IA}[${e}]:`,...t)})}function Yy(){return Te?fl("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const ve={enable:DA,disable:LA,isEnabled:jT,log:PA,warn:zA,error:UA},MT=50,Io="?",aE=/\(error: (.*)\)/,lE=/captureMessage|captureException/;function AT(...e){const t=e.sort((n,i)=>n[0]-i[0]).map(n=>n[1]);return(n,i=0,o=0)=>{const l=[],u=n.split(`
|
|
2
|
+
`);for(let f=i;f<u.length;f++){let h=u[f];h.length>1024&&(h=h.slice(0,1024));const p=aE.test(h)?h.replace(aE,"$1"):h;if(!p.match(/\S*Error: /)){for(const y of t){const v=y(p);if(v){l.push(v);break}}if(l.length>=MT+o)break}}return HA(l.slice(o))}}function BA(e){return Array.isArray(e)?AT(...e):e}function HA(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(zf(t).function||"")&&t.pop(),t.reverse(),lE.test(zf(t).function||"")&&(t.pop(),lE.test(zf(t).function||"")&&t.pop()),t.slice(0,MT).map(n=>({...n,filename:n.filename||zf(t).filename,function:n.function||Io}))}function zf(e){return e[e.length-1]||{}}const Xm="<anonymous>";function Os(e){try{return!e||typeof e!="function"?Xm:e.name||Xm}catch{return Xm}}function cE(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(i=>{i.stacktrace.frames&&n.push(...i.stacktrace.frames)}),n}catch{return}}}function OT(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const ld={},uE={};function Ui(e,t){ld[e]=ld[e]||[],ld[e].push(t)}function Bi(e,t){if(!uE[e]){uE[e]=!0;try{t()}catch(n){Te&&ve.error(`Error while instrumenting ${e}`,n)}}}function Tr(e,t){const n=e&&ld[e];if(n)for(const i of n)try{i(t)}catch(o){Te&&ve.error(`Error while triggering instrumentation handler.
|
|
3
|
+
Type: ${e}
|
|
4
|
+
Name: ${Os(i)}
|
|
5
|
+
Error:`,o)}}let Qm=null;function kT(e){const t="error";Ui(t,e),Bi(t,FA)}function FA(){Qm=it.onerror,it.onerror=function(e,t,n,i,o){return Tr("error",{column:i,error:o,line:n,msg:e,url:t}),Qm?Qm.apply(this,arguments):!1},it.onerror.__SENTRY_INSTRUMENTED__=!0}let Wm=null;function IT(e){const t="unhandledrejection";Ui(t,e),Bi(t,qA)}function qA(){Wm=it.onunhandledrejection,it.onunhandledrejection=function(e){return Tr("unhandledrejection",e),Wm?Wm.apply(this,arguments):!0},it.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const DT=Object.prototype.toString;function uh(e){switch(DT.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return ks(e,Error)}}function dl(e,t){return DT.call(e)===`[object ${t}]`}function LT(e){return dl(e,"ErrorEvent")}function fE(e){return dl(e,"DOMError")}function VA(e){return dl(e,"DOMException")}function js(e){return dl(e,"String")}function fh(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Wa(e){return e===null||fh(e)||typeof e!="object"&&typeof e!="function"}function zc(e){return dl(e,"Object")}function dh(e){return typeof Event<"u"&&ks(e,Event)}function $A(e){return typeof Element<"u"&&ks(e,Element)}function GA(e){return dl(e,"RegExp")}function hl(e){return!!(e?.then&&typeof e.then=="function")}function KA(e){return zc(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function ks(e,t){try{return e instanceof t}catch{return!1}}function PT(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function Xy(e){return typeof Request<"u"&&ks(e,Request)}const Qy=it,YA=80;function Rr(e,t={}){if(!e)return"<unknown>";try{let n=e;const i=5,o=[];let l=0,u=0;const f=" > ",h=f.length;let p;const y=Array.isArray(t)?t:t.keyAttrs,v=!Array.isArray(t)&&t.maxStringLength||YA;for(;n&&l++<i&&(p=XA(n,y),!(p==="html"||l>1&&u+o.length*h+p.length>=v));)o.push(p),u+=p.length,n=n.parentNode;return o.reverse().join(f)}catch{return"<unknown>"}}function XA(e,t){const n=e,i=[];if(!n?.tagName)return"";if(Qy.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}i.push(n.tagName.toLowerCase());const o=t?.length?t.filter(u=>n.getAttribute(u)).map(u=>[u,n.getAttribute(u)]):null;if(o?.length)o.forEach(u=>{i.push(`[${u[0]}="${u[1]}"]`)});else{n.id&&i.push(`#${n.id}`);const u=n.className;if(u&&js(u)){const f=u.split(/\s+/);for(const h of f)i.push(`.${h}`)}}const l=["aria-label","type","name","title","alt"];for(const u of l){const f=n.getAttribute(u);f&&i.push(`[${u}="${f}"]`)}return i.join("")}function Zc(){try{return Qy.document.location.href}catch{return""}}function zT(e){if(!Qy.HTMLElement)return null;let t=e;const n=5;for(let i=0;i<n;i++){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 Zn(e,t,n){if(!(t in e))return;const i=e[t];if(typeof i!="function")return;const o=n(i);typeof o=="function"&&UT(o,i);try{e[t]=o}catch{Te&&ve.log(`Failed to replace method "${t}" in object`,e)}}function kn(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Te&&ve.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function UT(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,kn(e,"__sentry_original__",t)}catch{}}function Wy(e){return e.__sentry_original__}function BT(e){if(uh(e))return{message:e.message,name:e.name,stack:e.stack,...hE(e)};if(dh(e)){const t={type:e.type,target:dE(e.target),currentTarget:dE(e.currentTarget),...hE(e)};return typeof CustomEvent<"u"&&ks(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function dE(e){try{return $A(e)?Rr(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function hE(e){if(typeof e=="object"&&e!==null){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function QA(e){const t=Object.keys(BT(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let Da;function Jc(e){if(Da!==void 0)return Da?Da(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=it;return t in n&&typeof n[t]=="function"?(Da=n[t],Da(e)):(Da=null,e())}function Ti(){return Jc(()=>Math.random())}function eu(){return Jc(()=>Date.now())}function Zg(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function pE(e,t){if(!Array.isArray(e))return"";const n=[];for(let i=0;i<e.length;i++){const o=e[i];try{PT(o)?n.push(OT(o)):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function cd(e,t,n=!1){return js(e)?GA(t)?t.test(e):js(t)?n?e===t:e.includes(t):!1:!1}function Ci(e,t=[],n=!1){return t.some(i=>cd(e,i,n))}function WA(){const e=it;return e.crypto||e.msCrypto}let Zm;function ZA(){return Ti()*16}function Cr(e=WA()){try{if(e?.randomUUID)return Jc(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Zm||(Zm="10000000100040008000"+1e11),Zm.replace(/[018]/g,t=>(t^(ZA()&15)>>t/4).toString(16))}function HT(e){return e.exception?.values?.[0]}function Eo(e){const{message:t,event_id:n}=e;if(t)return t;const i=HT(e);return i?i.type&&i.value?`${i.type}: ${i.value}`:i.type||i.value||n||"<unknown>":n||"<unknown>"}function Jg(e,t,n){const i=e.exception=e.exception||{},o=i.values=i.values||[],l=o[0]=o[0]||{};l.value||(l.value=t||""),l.type||(l.type="Error")}function Za(e,t){const n=HT(e);if(!n)return;const i={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...i,...o,...t},t&&"data"in t){const l={...o?.data,...t.data};n.mechanism.data=l}}function mE(e){if(JA(e))return!0;try{kn(e,"__sentry_captured__",!0)}catch{}return!1}function JA(e){try{return e.__sentry_captured__}catch{}}const FT=1e3;function qo(){return eu()/FT}function eO(){const{performance:e}=it;if(!e?.now||!e.timeOrigin)return qo;const t=e.timeOrigin;return()=>(t+Jc(()=>e.now()))/FT}let gE;function Yt(){return(gE??(gE=eO()))()}let Jm=null;function tO(){const{performance:e}=it;if(!e?.now)return;const t=3e5,n=Jc(()=>e.now()),i=eu(),o=e.timeOrigin;if(typeof o=="number"&&Math.abs(o+n-i)<t)return o;const l=e.timing?.navigationStart;return typeof l=="number"&&Math.abs(l+n-i)<t?l:i-n}function rr(){return Jm===null&&(Jm=tO()),Jm}function nO(e){const t=Yt(),n={sid:Cr(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>sO(n)};return e&&Ja(n,e),n}function Ja(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||Yt(),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:Cr()),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{const n=e.timestamp-e.started;e.duration=n>=0?n: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 rO(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),Ja(e,n)}function sO(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 tu(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const i={...e};for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(i[o]=tu(i[o],t[o],n-1));return i}function Is(){return Cr()}function Ms(){return Cr().substring(16)}const ey="_sentrySpan";function el(e,t){t?kn(e,ey,t):delete e[ey]}function tl(e){return e[ey]}const iO=100;class Ds{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:Is(),sampleRand:Ti()}}clone(){const t=new Ds;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,el(t,tl(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Ja(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,i=n instanceof Ds?n.getScopeData():zc(n)?t:void 0,{tags:o,attributes:l,extra:u,user:f,contexts:h,level:p,fingerprint:y=[],propagationContext:v,conversationId:b}=i||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...l},this._extra={...this._extra,...u},this._contexts={...this._contexts,...h},f&&Object.keys(f).length&&(this._user=f),p&&(this._level=p),y.length&&(this._fingerprint=y),v&&(this._propagationContext=v),b&&(this._conversationId=b),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,el(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Is(),sampleRand:Ti()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const i=typeof n=="number"?n:iO;if(i<=0)return this;const o={timestamp:qo(),...t,message:t.message?Zg(t.message,2048):t.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>i&&(this._breadcrumbs=this._breadcrumbs.slice(-i),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(t){return this._attachments.push(t),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:tl(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=tu(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const i=n?.event_id||Cr();if(!this._client)return Te&&ve.warn("No client configured on scope - will not capture exception!"),i;const o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:i},this),i}captureMessage(t,n,i){const o=i?.event_id||Cr();if(!this._client)return Te&&ve.warn("No client configured on scope - will not capture message!"),o;const l=i?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:l,...i,event_id:o},this),o}captureEvent(t,n){const i=t.event_id||n?.event_id||Cr();return this._client?(this._client.captureEvent(t,{...n,event_id:i},this),i):(Te&&ve.warn("No client configured on scope - will not capture event!"),i)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function oO(){return fl("defaultCurrentScope",()=>new Ds)}function aO(){return fl("defaultIsolationScope",()=>new Ds)}class lO{constructor(t,n){let i;t?i=t:i=new Ds;let o;n?o=n:o=new Ds,this._stack=[{scope:i}],this._isolationScope=o}withScope(t){const n=this._pushScope();let i;try{i=t(n)}catch(o){throw this._popScope(),o}return hl(i)?i.then(o=>(this._popScope(),o),o=>{throw this._popScope(),o}):(this._popScope(),i)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function nl(){const e=Ho(),t=ch(e);return t.stack=t.stack||new lO(oO(),aO())}function cO(e){return nl().withScope(e)}function uO(e,t){const n=nl();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function yE(e){return nl().withScope(()=>e(nl().getIsolationScope()))}function fO(){return{withIsolationScope:yE,withScope:cO,withSetScope:uO,withSetIsolationScope:(e,t)=>yE(t),getCurrentScope:()=>nl().getScope(),getIsolationScope:()=>nl().getIsolationScope()}}function pl(e){const t=ch(e);return t.acs?t.acs:fO()}function gt(){const e=Ho();return pl(e).getCurrentScope()}function jr(){const e=Ho();return pl(e).getIsolationScope()}function dO(){return fl("globalScope",()=>new Ds)}function nu(...e){const t=Ho(),n=pl(t);if(e.length===2){const[i,o]=e;return i?n.withSetScope(i,o):n.withScope(o)}return n.withScope(e[0])}function mt(){return gt().getClient()}function qT(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:i,propagationSpanId:o}=t,l={trace_id:n,span_id:o||Ms()};return i&&(l.parent_span_id=i),l}const es="sentry.source",Zy="sentry.sample_rate",VT="sentry.previous_trace_sample_rate",Ls="sentry.op",tn="sentry.origin",Uc="sentry.idle_span_finish_reason",ru="sentry.measurement_unit",su="sentry.measurement_value",vE="sentry.custom_span_name",Jy="sentry.profile_id",ml="sentry.exclusive_time",hO="sentry.link.type",pO="gen_ai.conversation.id",mO=0,ev=1,Zt=2;function gO(e){if(e<400&&e>=100)return{code:ev};if(e>=400&&e<500)switch(e){case 401:return{code:Zt,message:"unauthenticated"};case 403:return{code:Zt,message:"permission_denied"};case 404:return{code:Zt,message:"not_found"};case 409:return{code:Zt,message:"already_exists"};case 413:return{code:Zt,message:"failed_precondition"};case 429:return{code:Zt,message:"resource_exhausted"};case 499:return{code:Zt,message:"cancelled"};default:return{code:Zt,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:Zt,message:"unimplemented"};case 503:return{code:Zt,message:"unavailable"};case 504:return{code:Zt,message:"deadline_exceeded"};default:return{code:Zt,message:"internal_error"}}return{code:Zt,message:"internal_error"}}function $T(e,t){e.setAttribute("http.response.status_code",t);const n=gO(t);n.message!=="unknown_error"&&e.setStatus(n)}const GT="_sentryScope",KT="_sentryIsolationScope";function yO(e){try{const t=it.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function vO(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function bO(e,t,n){e&&(kn(e,KT,yO(n)),kn(e,GT,t))}function Nd(e){const t=e;return{scope:t[GT],isolationScope:vO(t[KT])}}const tv="sentry-",xO=/^sentry-/,SO=8192;function YT(e){const t=_O(e);if(!t)return;const n=Object.entries(t).reduce((i,[o,l])=>{if(o.match(xO)){const u=o.slice(tv.length);i[u]=l}return i},{});if(Object.keys(n).length>0)return n}function EO(e){if(!e)return;const t=Object.entries(e).reduce((n,[i,o])=>(o&&(n[`${tv}${i}`]=o),n),{});return wO(t)}function _O(e){if(!(!e||!js(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const i=bE(n);return Object.entries(i).forEach(([o,l])=>{t[o]=l}),t},{}):bE(e)}function bE(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const i=t.slice(0,n),o=t.slice(n+1);return[i,o].map(l=>{try{return decodeURIComponent(l.trim())}catch{return}})}).reduce((t,[n,i])=>(n&&i&&(t[n]=i),t),{})}function wO(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,i],o)=>{const l=`${encodeURIComponent(n)}=${encodeURIComponent(i)}`,u=o===0?l:`${t},${l}`;return u.length>SO?(Te&&ve.warn(`Not adding key: ${n} with val: ${i} to baggage header due to exceeding baggage size limits.`),t):u},"")}const TO=/^o(\d+)\./,CO=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function RO(e){return e==="http"||e==="https"}function gl(e,t=!1){const{host:n,path:i,pass:o,port:l,projectId:u,protocol:f,publicKey:h}=e;return`${f}://${h}${t&&o?`:${o}`:""}@${n}${l?`:${l}`:""}/${i&&`${i}/`}${u}`}function NO(e){const t=CO.exec(e);if(!t){Fo(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,i,o="",l="",u="",f=""]=t.slice(1);let h="",p=f;const y=p.split("/");if(y.length>1&&(h=y.slice(0,-1).join("/"),p=y.pop()),p){const v=p.match(/^\d+/);v&&(p=v[0])}return XT({host:l,pass:o,path:h,projectId:p,port:u,protocol:n,publicKey:i})}function XT(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function jO(e){if(!Te)return!0;const{port:t,projectId:n,protocol:i}=e;return["protocol","publicKey","host","projectId"].find(u=>e[u]?!1:(ve.error(`Invalid Sentry Dsn: ${u} missing`),!0))?!1:n.match(/^\d+$/)?RO(i)?t&&isNaN(parseInt(t,10))?(ve.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(ve.error(`Invalid Sentry Dsn: Invalid protocol ${i}`),!1):(ve.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function MO(e){return e.match(TO)?.[1]}function AO(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let i;return t.orgId?i=String(t.orgId):n&&(i=MO(n)),i}function OO(e){const t=typeof e=="string"?NO(e):XT(e);if(!(!t||!jO(t)))return t}function Bc(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const QT=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function kO(e){if(!e)return;const t=e.match(QT);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 IO(e,t){const n=kO(e),i=YT(t);if(!n?.traceId)return{traceId:Is(),sampleRand:Ti()};const o=DO(n,i);i&&(i.sample_rand=o.toString());const{traceId:l,parentSpanId:u,parentSampled:f}=n;return{traceId:l,parentSpanId:u,sampled:f,dsc:i||{},sampleRand:o}}function WT(e=Is(),t=Ms(),n){let i="";return n!==void 0&&(i=n?"-1":"-0"),`${e}-${t}${i}`}function ZT(e=Is(),t=Ms(),n){return`00-${e}-${t}-${n?"01":"00"}`}function DO(e,t){const n=Bc(t?.sample_rand);if(n!==void 0)return n;const i=Bc(t?.sample_rate);return i&&e?.parentSampled!==void 0?e.parentSampled?Ti()*i:i+Ti()*(1-i):Ti()}const JT=0,nv=1;let xE=!1;function LO(e){const{spanId:t,traceId:n}=e.spanContext(),{data:i,op:o,parent_span_id:l,status:u,origin:f,links:h}=pt(e);return{parent_span_id:l,span_id:t,trace_id:n,data:i,op:o,status:u,origin:f,links:h}}function eC(e){const{spanId:t,traceId:n,isRemote:i}=e.spanContext(),o=i?t:pt(e).parent_span_id,l=Nd(e).scope,u=i?l?.getPropagationContext().propagationSpanId||Ms():t;return{parent_span_id:o,span_id:u,trace_id:n}}function PO(e){const{traceId:t,spanId:n}=e.spanContext(),i=Hi(e);return WT(t,n,i)}function zO(e){const{traceId:t,spanId:n}=e.spanContext(),i=Hi(e);return ZT(t,n,i)}function tC(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:i,...o},attributes:l})=>({span_id:t,trace_id:n,sampled:i===nv,attributes:l,...o}))}function jo(e){return typeof e=="number"?SE(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?SE(e.getTime()):Yt()}function SE(e){return e>9999999999?e/1e3:e}function pt(e){if(BO(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(UO(e)){const{attributes:i,startTime:o,name:l,endTime:u,status:f,links:h}=e,p="parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0;return{span_id:t,trace_id:n,data:i,description:l,parent_span_id:p,start_timestamp:jo(o),timestamp:jo(u)||void 0,status:nC(f),op:i[Ls],origin:i[tn],links:tC(h)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function UO(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function BO(e){return typeof e.getSpanJSON=="function"}function Hi(e){const{traceFlags:t}=e.spanContext();return t===nv}function nC(e){if(!(!e||e.code===mO))return e.code===ev?"ok":e.message||"internal_error"}const Mo="_sentryChildSpans",ty="_sentryRootSpan";function rC(e,t){const n=e[ty]||e;kn(t,ty,n),e[Mo]?e[Mo].add(t):kn(e,Mo,new Set([t]))}function HO(e,t){e[Mo]&&e[Mo].delete(t)}function ud(e){const t=new Set;function n(i){if(!t.has(i)&&Hi(i)){t.add(i);const o=i[Mo]?Array.from(i[Mo]):[];for(const l of o)n(l)}}return n(e),Array.from(t)}function Sn(e){return e[ty]||e}function In(){const e=Ho(),t=pl(e);return t.getActiveSpan?t.getActiveSpan():tl(gt())}function ny(){xE||(Fo(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),xE=!0)}let EE=!1;function FO(){if(EE)return;function e(){const t=In(),n=t&&Sn(t);if(n){const i="internal_error";Te&&ve.log(`[Tracing] Root span: ${i} -> Global error occurred`),n.setStatus({code:Zt,message:i})}}e.tag="sentry_tracingErrorCallback",EE=!0,kT(e),IT(e)}function Ur(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||mt()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function _E(e){ve.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function jd(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(VO(n)){if(cd(e.description,n))return Te&&_E(e),!0;continue}if(!n.name&&!n.op)continue;const i=n.name?cd(e.description,n.name):!0,o=n.op?e.op&&cd(e.op,n.op):!0;if(i&&o)return Te&&_E(e),!0}return!1}function qO(e,t){const n=t.parent_span_id,i=t.span_id;if(n)for(const o of e)o.parent_span_id===i&&(o.parent_span_id=n)}function VO(e){return typeof e=="string"||e instanceof RegExp}const rv="production",sC="_frozenDsc";function fd(e,t){kn(e,sC,t)}function iC(e,t){const n=t.getOptions(),{publicKey:i}=t.getDsn()||{},o={environment:n.environment||rv,release:n.release,public_key:i,trace_id:e,org_id:AO(t)};return t.emit("createDsc",o),o}function sv(e,t){const n=t.getPropagationContext();return n.dsc||iC(n.traceId,e)}function Ps(e){const t=mt();if(!t)return{};const n=Sn(e),i=pt(n),o=i.data,l=n.spanContext().traceState,u=l?.get("sentry.sample_rate")??o[Zy]??o[VT];function f(E){return(typeof u=="number"||typeof u=="string")&&(E.sample_rate=`${u}`),E}const h=n[sC];if(h)return f(h);const p=l?.get("sentry.dsc"),y=p&&YT(p);if(y)return f(y);const v=iC(e.spanContext().traceId,t),b=o[es],x=i.description;return b!=="url"&&x&&(v.transaction=x),Ur()&&(v.sampled=String(Hi(n)),v.sample_rand=l?.get("sentry.sample_rand")??Nd(n).scope?.getPropagationContext().sampleRand.toString()),f(v),t.emit("createDsc",v,n),v}class Ii{constructor(t={}){this._traceId=t.traceId||Is(),this._spanId=t.spanId||Ms()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:JT}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,i){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}}function Rs(e,t=100,n=1/0){try{return ry("",e,t,n)}catch(i){return{ERROR:`**non-serializable** (${i})`}}}function oC(e,t=3,n=100*1024){const i=Rs(e,t);return YO(i)>n?oC(e,t-1,n):i}function ry(e,t,n=1/0,i=1/0,o=XO()){const[l,u]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const f=$O(e,t);if(!f.startsWith("[object "))return f;if(t.__sentry_skip_normalization__)return t;const h=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(h===0)return f.replace("object ","");if(l(t))return"[Circular ~]";const p=t;if(p&&typeof p.toJSON=="function")try{const x=p.toJSON();return ry("",x,h-1,i,o)}catch{}const y=Array.isArray(t)?[]:{};let v=0;const b=BT(t);for(const x in b){if(!Object.prototype.hasOwnProperty.call(b,x))continue;if(v>=i){y[x]="[MaxProperties ~]";break}const E=b[x];y[x]=ry(x,E,h-1,i,o),v++}return u(t),y}function $O(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(PT(t))return OT(t);if(KA(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Os(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=GO(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function GO(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function KO(e){return~-encodeURI(e).split(/%..|./).length}function YO(e){return KO(JSON.stringify(e))}function XO(){const e=new WeakSet;function t(i){return e.has(i)?!0:(e.add(i),!1)}function n(i){e.delete(i)}return[t,n]}function Vo(e,t=[]){return[e,t]}function QO(e,t){const[n,i]=e;return[n,[...i,t]]}function sy(e,t){const n=e[1];for(const i of n){const o=i[0].type;if(t(i,o))return!0}return!1}function WO(e,t){return sy(e,(n,i)=>t.includes(i))}function iy(e){const t=ch(it);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function ZO(e){const[t,n]=e;let i=JSON.stringify(t);function o(l){typeof i=="string"?i=typeof l=="string"?i+l:[iy(i),l]:i.push(typeof l=="string"?iy(l):l)}for(const l of n){const[u,f]=l;if(o(`
|
|
6
|
+
${JSON.stringify(u)}
|
|
7
|
+
`),typeof f=="string"||f instanceof Uint8Array)o(f);else{let h;try{h=JSON.stringify(f)}catch{h=JSON.stringify(Rs(f))}o(h)}}return typeof i=="string"?i:JO(i)}function JO(e){const t=e.reduce((o,l)=>o+l.length,0),n=new Uint8Array(t);let i=0;for(const o of e)n.set(o,i),i+=o.length;return n}function ek(e){return[{type:"span"},e]}function tk(e){const t=typeof e.data=="string"?iy(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const nk={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item",metric:"metric",trace_metric:"metric"};function wE(e){return nk[e]}function aC(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function rk(e,t,n,i){const o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&i&&{dsn:gl(i)},...o&&{trace:o}}}function sk(e,t){if(!t)return e;const 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 ik(e,t,n,i){const o=aC(n),l={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!i&&t&&{dsn:gl(t)}},u="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Vo(l,[u])}function ok(e,t,n,i){const o=aC(n),l=e.type&&e.type!=="replay_event"?e.type:"event";sk(e,n?.sdk);const u=rk(e,o,i,t);return delete e.sdkProcessingMetadata,Vo(u,[[{type:l},e]])}function ak(e,t){function n(x){return!!x.trace_id&&!!x.public_key}const i=Ps(e[0]),o=t?.getDsn(),l=t?.getOptions().tunnel,u={sent_at:new Date().toISOString(),...n(i)&&{trace:i},...!!l&&o&&{dsn:gl(o)}},{beforeSendSpan:f,ignoreSpans:h}=t?.getOptions()||{},p=h?.length?e.filter(x=>!jd(pt(x),h)):e,y=e.length-p.length;y&&t?.recordDroppedEvent("before_send","span",y);const v=f?x=>{const E=pt(x),_=f(E);return _||(ny(),E)}:pt,b=[];for(const x of p){const E=v(x);E&&b.push(ek(E))}return Vo(u,b)}function lk(e){if(!Te)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:i}=pt(e),{spanId:o}=e.spanContext(),l=Hi(e),u=Sn(e),f=u===e,h=`[Tracing] Starting ${l?"sampled":"unsampled"} ${f?"root ":""}span`,p=[`op: ${n}`,`name: ${t}`,`ID: ${o}`];if(i&&p.push(`parent ID: ${i}`),!f){const{op:y,description:v}=pt(u);p.push(`root ID: ${u.spanContext().spanId}`),y&&p.push(`root op: ${y}`),v&&p.push(`root description: ${v}`)}ve.log(`${h}
|
|
8
|
+
${p.join(`
|
|
9
|
+
`)}`)}function ck(e){if(!Te)return;const{description:t="< unknown name >",op:n="< unknown op >"}=pt(e),{spanId:i}=e.spanContext(),l=Sn(e)===e,u=`[Tracing] Finishing "${n}" ${l?"root ":""}span "${t}" with ID ${i}`;ve.log(u)}function uk(e,t,n,i=In()){const o=i&&Sn(i);o&&(Te&&ve.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),o.addEvent(e,{[su]:t,[ru]:n}))}function TE(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const i=n.attributes||{},o=i[ru],l=i[su];typeof o=="string"&&typeof l=="number"&&(t[n.name]={value:l,unit:o})}),t}const CE=1e3;class hh{constructor(t={}){this._traceId=t.traceId||Is(),this._spanId=t.spanId||Ms(),this._startTime=t.startTimestamp||Yt(),this._links=t.links,this._attributes={},this.setAttributes({[tn]:"manual",[Ls]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){const{_spanId:t,_traceId:n,_sampled:i}=this;return{spanId:t,traceId:n,traceFlags:i?nv:JT}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=jo(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(es,"custom"),this}end(t){this._endTime||(this._endTime=jo(t),ck(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Ls],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:nC(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[tn],profile_id:this._attributes[Jy],exclusive_time:this._attributes[ml],measurements:TE(this._events),is_segment:this._isStandaloneSpan&&Sn(this)===this||void 0,segment_id:this._isStandaloneSpan?Sn(this).spanContext().spanId:void 0,links:tC(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,i){Te&&ve.log("[Tracing] Adding an event to span:",t);const o=RE(n)?n:i||Yt(),l=RE(n)?{}:n||{},u={name:t,time:jo(o),attributes:l};return this._events.push(u),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=mt();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===Sn(this)))return;if(this._isStandaloneSpan){this._sampled?dk(ak([this],t)):(Te&&ve.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}const i=this._convertSpanToTransaction();i&&(Nd(this).scope||gt()).captureEvent(i)}_convertSpanToTransaction(){if(!NE(pt(this)))return;this._name||(Te&&ve.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=Nd(this),i=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;const l=ud(this).filter(y=>y!==this&&!fk(y)).map(y=>pt(y)).filter(NE),u=this._attributes[es];delete this._attributes[vE],l.forEach(y=>{delete y.data[vE]});const f={contexts:{trace:LO(this)},spans:l.length>CE?l.sort((y,v)=>y.start_timestamp-v.start_timestamp).slice(0,CE):l,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:Ps(this)},request:i,...u&&{transaction_info:{source:u}}},h=TE(this._events);return h&&Object.keys(h).length&&(Te&&ve.log("[Measurements] Adding measurements to transaction event",JSON.stringify(h,void 0,2)),f.measurements=h),f}}function RE(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function NE(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function fk(e){return e instanceof hh&&e.isStandaloneSpan()}function dk(e){const t=mt();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function hk(e,t,n=()=>{},i=()=>{}){let o;try{o=e()}catch(l){throw t(l),n(),l}return pk(o,t,n,i)}function pk(e,t,n,i){return hl(e)?e.then(o=>(n(),i(o),o),o=>{throw t(o),n(),o}):(n(),i(e),e)}function mk(e,t,n){if(!Ur(e))return[!1];let i,o;typeof e.tracesSampler=="function"?(o=e.tracesSampler({...t,inheritOrSampleWith:f=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):f}),i=!0):t.parentSampled!==void 0?o=t.parentSampled:typeof e.tracesSampleRate<"u"&&(o=e.tracesSampleRate,i=!0);const l=Bc(o);if(l===void 0)return Te&&ve.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(o)} of type ${JSON.stringify(typeof o)}.`),[!1];if(!l)return Te&&ve.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,l,i];const u=n<l;return u||Te&&ve.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[u,l,i]}const lC="__SENTRY_SUPPRESS_TRACING__";function cC(e,t){const n=ov();if(n.startSpan)return n.startSpan(e,t);const i=fC(e),{forceTransaction:o,parentSpan:l,scope:u}=e,f=u?.clone();return nu(f,()=>yk(l)(()=>{const p=gt(),y=dC(p,l),b=e.onlyIfParent&&!y?new Ii:uC({parentSpan:y,spanArguments:i,forceTransaction:o,scope:p});return el(p,b),hk(()=>t(b),()=>{const{status:x}=pt(b);b.isRecording()&&(!x||x==="ok")&&b.setStatus({code:Zt,message:"internal_error"})},()=>{b.end()})}))}function yl(e){const t=ov();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=fC(e),{forceTransaction:i,parentSpan:o}=e;return(e.scope?u=>nu(e.scope,u):o!==void 0?u=>iv(o,u):u=>u())(()=>{const u=gt(),f=dC(u,o);return e.onlyIfParent&&!f?new Ii:uC({parentSpan:f,spanArguments:n,forceTransaction:i,scope:u})})}function iv(e,t){const n=ov();return n.withActiveSpan?n.withActiveSpan(e,t):nu(i=>(el(i,e||void 0),t(i)))}function uC({parentSpan:e,spanArguments:t,forceTransaction:n,scope:i}){if(!Ur()){const u=new Ii;if(n||!e){const f={sampled:"false",sample_rate:"0",transaction:t.name,...Ps(u)};fd(u,f)}return u}const o=jr();let l;if(e&&!n)l=gk(e,i,t),rC(e,l);else if(e){const u=Ps(e),{traceId:f,spanId:h}=e.spanContext(),p=Hi(e);l=jE({traceId:f,parentSpanId:h,...t},i,p),fd(l,u)}else{const{traceId:u,dsc:f,parentSpanId:h,sampled:p}={...o.getPropagationContext(),...i.getPropagationContext()};l=jE({traceId:u,parentSpanId:h,...t},i,p),f&&fd(l,f)}return lk(l),bO(l,i,o),l}function fC(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const i={...n};return i.startTimestamp=jo(e.startTime),delete i.startTime,i}return n}function ov(){const e=Ho();return pl(e)}function jE(e,t,n){const i=mt(),o=i?.getOptions()||{},{name:l=""}=e,u={spanAttributes:{...e.attributes},spanName:l,parentSampled:n};i?.emit("beforeSampling",u,{decision:!1});const f=u.parentSampled??n,h=u.spanAttributes,p=t.getPropagationContext(),[y,v,b]=t.getScopeData().sdkProcessingMetadata[lC]?[!1]:mk(o,{name:l,parentSampled:f,attributes:h,parentSampleRate:Bc(p.dsc?.sample_rate)},p.sampleRand),x=new hh({...e,attributes:{[es]:"custom",[Zy]:v!==void 0&&b?v:void 0,...h},sampled:y});return!y&&i&&(Te&&ve.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),i.recordDroppedEvent("sample_rate","transaction")),i&&i.emit("spanStart",x),x}function gk(e,t,n){const{spanId:i,traceId:o}=e.spanContext(),l=t.getScopeData().sdkProcessingMetadata[lC]?!1:Hi(e),u=l?new hh({...n,parentSpanId:i,traceId:o,sampled:l}):new Ii({traceId:o});rC(e,u);const f=mt();return f&&(f.emit("spanStart",u),n.endTimestamp&&f.emit("spanEnd",u)),u}function dC(e,t){if(t)return t;if(t===null)return;const n=tl(e);if(!n)return;const i=mt();return(i?i.getOptions():{}).parentSpanIsAlwaysRootSpan?Sn(n):n}function yk(e){return e!==void 0?t=>iv(e,t):t=>t()}const dd={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},vk="heartbeatFailed",bk="idleTimeout",xk="finalTimeout",Sk="externalFinish";function hC(e,t={}){const n=new Map;let i=!1,o,l=Sk,u=!t.disableAutoFinish;const f=[],{idleTimeout:h=dd.idleTimeout,finalTimeout:p=dd.finalTimeout,childSpanTimeout:y=dd.childSpanTimeout,beforeSpanEnd:v,trimIdleSpanEndTimestamp:b=!0}=t,x=mt();if(!x||!Ur()){const j=new Ii,A={sample_rate:"0",sampled:"false",...Ps(j)};return fd(j,A),j}const E=gt(),_=In(),T=Ek(e);T.end=new Proxy(T.end,{apply(j,A,D){if(v&&v(T),A instanceof Ii)return;const[G,...F]=D,P=G||Yt(),Q=jo(P),X=ud(T).filter(U=>U!==T),te=pt(T);if(!X.length||!b)return z(Q),Reflect.apply(j,A,[Q,...F]);const L=x.getOptions().ignoreSpans,$=X?.reduce((U,I)=>{const K=pt(I);return!K.timestamp||L&&jd(K,L)?U:U?Math.max(U,K.timestamp):K.timestamp},void 0),H=te.start_timestamp,V=Math.min(H?H+p/1e3:1/0,Math.max(H||-1/0,Math.min(Q,$||1/0)));return z(V),Reflect.apply(j,A,[V,...F])}});function C(){o&&(clearTimeout(o),o=void 0)}function M(j){C(),o=setTimeout(()=>{!i&&n.size===0&&u&&(l=bk,T.end(j))},h)}function R(j){o=setTimeout(()=>{!i&&u&&(l=vk,T.end(j))},y)}function N(j){C(),n.set(j,!0);const A=Yt();R(A+y/1e3)}function k(j){if(n.has(j)&&n.delete(j),n.size===0){const A=Yt();M(A+h/1e3)}}function z(j){i=!0,n.clear(),f.forEach(X=>X()),el(E,_);const A=pt(T),{start_timestamp:D}=A;if(!D)return;A.data[Uc]||T.setAttribute(Uc,l);const F=A.status;(!F||F==="unknown")&&T.setStatus({code:ev}),ve.log(`[Tracing] Idle span "${A.op}" finished`);const P=ud(T).filter(X=>X!==T);let Q=0;P.forEach(X=>{X.isRecording()&&(X.setStatus({code:Zt,message:"cancelled"}),X.end(j),Te&&ve.log("[Tracing] Cancelling span since span ended early",JSON.stringify(X,void 0,2)));const te=pt(X),{timestamp:L=0,start_timestamp:$=0}=te,H=$<=j,V=(p+h)/1e3,U=L-$<=V;if(Te){const I=JSON.stringify(X,void 0,2);H?U||ve.log("[Tracing] Discarding span since it finished after idle span final timeout",I):ve.log("[Tracing] Discarding span since it happened after idle span was finished",I)}(!U||!H)&&(HO(T,X),Q++)}),Q>0&&T.setAttribute("sentry.idle_span_discarded_spans",Q)}return f.push(x.on("spanStart",j=>{if(i||j===T||pt(j).timestamp||j instanceof hh&&j.isStandaloneSpan())return;ud(T).includes(j)&&N(j.spanContext().spanId)})),f.push(x.on("spanEnd",j=>{i||k(j.spanContext().spanId)})),f.push(x.on("idleSpanEnableAutoFinish",j=>{j===T&&(u=!0,M(),n.size&&R())})),t.disableAutoFinish||M(),setTimeout(()=>{i||(T.setStatus({code:Zt,message:"deadline_exceeded"}),l=xk,T.end())},p),T}function Ek(e){const t=yl(e);return el(gt(),t),Te&&ve.log("[Tracing] Started span is an idle span"),t}const eg=0,ME=1,AE=2;function iu(e){return new Hc(t=>{t(e)})}function av(e){return new Hc((t,n)=>{n(e)})}class Hc{constructor(t){this._state=eg,this._handlers=[],this._runExecutor(t)}then(t,n){return new Hc((i,o)=>{this._handlers.push([!1,l=>{if(!t)i(l);else try{i(t(l))}catch(u){o(u)}},l=>{if(!n)o(l);else try{i(n(l))}catch(u){o(u)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new Hc((n,i)=>{let o,l;return this.then(u=>{l=!1,o=u,t&&t()},u=>{l=!0,o=u,t&&t()}).then(()=>{if(l){i(o);return}n(o)})})}_executeHandlers(){if(this._state===eg)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===ME&&n[1](this._value),this._state===AE&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(l,u)=>{if(this._state===eg){if(hl(u)){u.then(i,o);return}this._state=l,this._value=u,this._executeHandlers()}},i=l=>{n(ME,l)},o=l=>{n(AE,l)};try{t(i,o)}catch(l){o(l)}}}function _k(e,t,n,i=0){try{const o=oy(t,n,e,i);return hl(o)?o:iu(o)}catch(o){return av(o)}}function oy(e,t,n,i){const o=n[i];if(!e||!o)return e;const l=o({...e},t);return Te&&l===null&&ve.log(`Event processor "${o.id||"?"}" dropped event`),hl(l)?l.then(u=>oy(u,t,n,i+1)):oy(l,t,n,i+1)}let yo,OE,kE,yi;function wk(e){const t=it._sentryDebugIds,n=it._debugIds;if(!t&&!n)return{};const i=t?Object.keys(t):[],o=n?Object.keys(n):[];if(yi&&i.length===OE&&o.length===kE)return yi;OE=i.length,kE=o.length,yi={},yo||(yo={});const l=(u,f)=>{for(const h of u){const p=f[h],y=yo?.[h];if(y&&yi&&p)yi[y[0]]=p,yo&&(yo[h]=[y[0],p]);else if(p){const v=e(h);for(let b=v.length-1;b>=0;b--){const E=v[b]?.filename;if(E&&yi&&yo){yi[E]=p,yo[h]=[E,p];break}}}}};return t&&l(i,t),n&&l(o,n),yi}function Tk(e,t){const{fingerprint:n,span:i,breadcrumbs:o,sdkProcessingMetadata:l}=t;Ck(e,t),i&&jk(e,i),Mk(e,n),Rk(e,o),Nk(e,l)}function IE(e,t){const{extra:n,tags:i,attributes:o,user:l,contexts:u,level:f,sdkProcessingMetadata:h,breadcrumbs:p,fingerprint:y,eventProcessors:v,attachments:b,propagationContext:x,transactionName:E,span:_}=t;xc(e,"extra",n),xc(e,"tags",i),xc(e,"attributes",o),xc(e,"user",l),xc(e,"contexts",u),e.sdkProcessingMetadata=tu(e.sdkProcessingMetadata,h,2),f&&(e.level=f),E&&(e.transactionName=E),_&&(e.span=_),p.length&&(e.breadcrumbs=[...e.breadcrumbs,...p]),y.length&&(e.fingerprint=[...e.fingerprint,...y]),v.length&&(e.eventProcessors=[...e.eventProcessors,...v]),b.length&&(e.attachments=[...e.attachments,...b]),e.propagationContext={...e.propagationContext,...x}}function xc(e,t,n){e[t]=tu(e[t],n,1)}function ph(e,t){const n=dO().getScopeData();return e&&IE(n,e.getScopeData()),t&&IE(n,t.getScopeData()),n}function Ck(e,t){const{extra:n,tags:i,user:o,contexts:l,level:u,transactionName:f}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(i).length&&(e.tags={...i,...e.tags}),Object.keys(o).length&&(e.user={...o,...e.user}),Object.keys(l).length&&(e.contexts={...l,...e.contexts}),u&&(e.level=u),f&&e.type!=="transaction"&&(e.transaction=f)}function Rk(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Nk(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function jk(e,t){e.contexts={trace:eC(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Ps(t),...e.sdkProcessingMetadata};const n=Sn(t),i=pt(n).description;i&&!e.transaction&&e.type==="transaction"&&(e.transaction=i)}function Mk(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 Ak(e,t,n,i,o,l){const{normalizeDepth:u=3,normalizeMaxBreadth:f=1e3}=e,h={...t,event_id:t.event_id||n.event_id||Cr(),timestamp:t.timestamp||qo()},p=n.integrations||e.integrations.map(C=>C.name);Ok(h,e),Dk(h,p),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&kk(h,e.stackParser);const y=Pk(i,n.captureContext);n.mechanism&&Za(h,n.mechanism);const v=o?o.getEventProcessors():[],b=ph(l,y),x=[...n.attachments||[],...b.attachments];x.length&&(n.attachments=x),Tk(h,b);const E=[...v,...b.eventProcessors];return(n.data&&n.data.__sentry__===!0?iu(h):_k(E,h,n)).then(C=>(C&&Ik(C),typeof u=="number"&&u>0?Lk(C,u,f):C))}function Ok(e,t){const{environment:n,release:i,dist:o,maxValueLength:l}=t;e.environment=e.environment||n||rv,!e.release&&i&&(e.release=i),!e.dist&&o&&(e.dist=o);const u=e.request;u?.url&&l&&(u.url=Zg(u.url,l)),l&&e.exception?.values?.forEach(f=>{f.value&&(f.value=Zg(f.value,l))})}function kk(e,t){const n=wk(t);e.exception?.values?.forEach(i=>{i.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function Ik(e){const t={};if(e.exception?.values?.forEach(i=>{i.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?t[o.abs_path]=o.debug_id:o.filename&&(t[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([i,o])=>{n.push({type:"sourcemap",code_file:i,debug_id:o})})}function Dk(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Lk(e,t,n){if(!e)return null;const i={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:Rs(o.data,t,n)}}))},...e.user&&{user:Rs(e.user,t,n)},...e.contexts&&{contexts:Rs(e.contexts,t,n)},...e.extra&&{extra:Rs(e.extra,t,n)}};return e.contexts?.trace&&i.contexts&&(i.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(i.contexts.trace.data=Rs(e.contexts.trace.data,t,n))),e.spans&&(i.spans=e.spans.map(o=>({...o,...o.data&&{data:Rs(o.data,t,n)}}))),e.contexts?.flags&&i.contexts&&(i.contexts.flags=Rs(e.contexts.flags,3,n)),i}function Pk(e,t){if(!t)return e;const n=e?e.clone():new Ds;return n.update(t),n}function pC(e,t){return gt().captureException(e,void 0)}function mC(e,t){return gt().captureEvent(e,t)}function zk(e,t){jr().setContext(e,t)}function Uk(){const e=mt();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function DE(e){const t=jr(),{user:n}=ph(t,gt()),{userAgent:i}=it.navigator||{},o=nO({user:n,...i&&{userAgent:i},...e}),l=t.getSession();return l?.status==="ok"&&Ja(l,{status:"exited"}),gC(),t.setSession(o),o}function gC(){const e=jr(),n=gt().getSession()||e.getSession();n&&rO(n),yC(),e.setSession()}function yC(){const e=jr(),t=mt(),n=e.getSession();n&&t&&t.captureSession(n)}function tg(e=!1){if(e){gC();return}yC()}const Bk="7";function Hk(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Fk(e){return`${Hk(e)}${e.projectId}/envelope/`}function qk(e,t){const n={sentry_version:Bk};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Vk(e,t,n){return t||`${Fk(e)}?${qk(e,n)}`}const LE=[];function $k(e){const t={};return e.forEach(n=>{const{name:i}=n,o=t[i];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[i]=n)}),Object.values(t)}function Gk(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let i;if(Array.isArray(n))i=[...t,...n];else if(typeof n=="function"){const o=n(t);i=Array.isArray(o)?o:[o]}else i=t;return $k(i)}function Kk(e,t){const n={};return t.forEach(i=>{i&&vC(e,i,n)}),n}function PE(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function vC(e,t,n){if(n[t.name]){Te&&ve.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!LE.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),LE.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const i=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,l)=>i(o,l,e))}if(typeof t.processEvent=="function"){const i=t.processEvent.bind(t),o=Object.assign((l,u)=>i(l,u,e),{id:t.name});e.addEventProcessor(o)}Te&&ve.log(`Integration installed: ${t.name}`)}function Yk(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function Xk(e,t){const{value:n,unit:i}=Yk(e)?e:{value:e,unit:void 0},o=Qk(n),l=i&&typeof i=="string"?{unit:i}:{};if(o)return{...o,...l};if(!t||t==="skip-undefined"&&n===void 0)return;let u="";try{u=JSON.stringify(n)??""}catch{}return{value:u,type:"string",...l}}function Md(e,t=!1){const n={};for(const[i,o]of Object.entries(e??{})){const l=Xk(o,t);l&&(n[i]=l)}return n}function Qk(e){const 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}}function bC(e,t){return t?nu(t,()=>{const n=In(),i=n?eC(n):qT(t);return[n?Ps(n):sv(e,t),i]}):[void 0,void 0]}const Wk={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function Zk(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function Jk(e,t,n,i){const o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&i&&(o.dsn=gl(i)),Vo(o,[Zk(e)])}const eI=100;function Qr(e,t,n,i=!0){n&&(!e[t]||i)&&(e[t]=n)}function tI(e,t){const n=lv(),i=xC(e);i===void 0?n.set(e,[t]):i.length>=eI?(Ad(e,i),n.set(e,[t])):n.set(e,[...i,t])}function nI(e,t=gt(),n=tI){const i=t?.getClient()??mt();if(!i){Te&&ve.warn("No client available to capture log.");return}const{release:o,environment:l,enableLogs:u=!1,beforeSendLog:f}=i.getOptions();if(!u){Te&&ve.warn("logging option not enabled, log will not be captured.");return}const[,h]=bC(i,t),p={...e.attributes},{user:{id:y,email:v,username:b},attributes:x={}}=ph(jr(),t);Qr(p,"user.id",y,!1),Qr(p,"user.email",v,!1),Qr(p,"user.name",b,!1),Qr(p,"sentry.release",o),Qr(p,"sentry.environment",l);const{name:E,version:_}=i.getSdkMetadata()?.sdk??{};Qr(p,"sentry.sdk.name",E),Qr(p,"sentry.sdk.version",_);const T=i.getIntegrationByName("Replay"),C=T?.getReplayId(!0);Qr(p,"sentry.replay_id",C),C&&T?.getRecordingMode()==="buffer"&&Qr(p,"sentry._internal.replay_is_buffering",!0);const M=e.message;if(fh(M)){const{__sentry_template_string__:F,__sentry_template_values__:P=[]}=M;P?.length&&(p["sentry.message.template"]=F),P.forEach((Q,X)=>{p[`sentry.message.parameter.${X}`]=Q})}const R=tl(t);Qr(p,"sentry.trace.parent_span_id",R?.spanContext().spanId);const N={...e,attributes:p};i.emit("beforeCaptureLog",N);const k=f?Fo(()=>f(N)):N;if(!k){i.recordDroppedEvent("before_send","log_item",1),Te&&ve.warn("beforeSendLog returned null, log will not be captured.");return}const{level:z,message:j,attributes:A={},severityNumber:D}=k,G={timestamp:Yt(),level:z,body:j,trace_id:h?.trace_id,severity_number:D??Wk[z],attributes:{...Md(x),...Md(A,!0)}};n(i,G),i.emit("afterCaptureLog",k)}function Ad(e,t){const n=t??xC(e)??[];if(n.length===0)return;const i=e.getOptions(),o=Jk(n,i._metadata,i.tunnel,e.getDsn());lv().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function xC(e){return lv().get(e)}function lv(){return fl("clientToLogBufferMap",()=>new WeakMap)}function rI(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function sI(e,t,n,i){const o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&i&&(o.dsn=gl(i)),Vo(o,[rI(e)])}const iI=1e3;function ws(e,t,n,i=!0){n&&(i||!(t in e))&&(e[t]=n)}function oI(e,t){const n=uv(),i=SC(e);i===void 0?n.set(e,[t]):i.length>=iI?(cv(e,i),n.set(e,[t])):n.set(e,[...i,t])}function aI(e,t,n){const{release:i,environment:o}=t.getOptions(),l={...e.attributes};ws(l,"user.id",n.id,!1),ws(l,"user.email",n.email,!1),ws(l,"user.name",n.username,!1),ws(l,"sentry.release",i),ws(l,"sentry.environment",o);const{name:u,version:f}=t.getSdkMetadata()?.sdk??{};ws(l,"sentry.sdk.name",u),ws(l,"sentry.sdk.version",f);const h=t.getIntegrationByName("Replay"),p=h?.getReplayId(!0);return ws(l,"sentry.replay_id",p),p&&h?.getRecordingMode()==="buffer"&&ws(l,"sentry._internal.replay_is_buffering",!0),{...e,attributes:l}}function lI(e,t,n,i){const[,o]=bC(t,n),l=tl(n),u=l?l.spanContext().traceId:o?.trace_id,f=l?l.spanContext().spanId:void 0;return{timestamp:Yt(),trace_id:u??"",span_id:f,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...Md(i),...Md(e.attributes,"skip-undefined")}}}function cI(e,t){const n=t?.scope??gt(),i=t?.captureSerializedMetric??oI,o=n?.getClient()??mt();if(!o){Te&&ve.warn("No client available to capture metric.");return}const{_experiments:l,enableMetrics:u,beforeSendMetric:f}=o.getOptions();if(!(u??l?.enableMetrics??!0)){Te&&ve.warn("metrics option not enabled, metric will not be captured.");return}const{user:p,attributes:y}=ph(jr(),n),v=aI(e,o,p);o.emit("processMetric",v);const b=f||l?.beforeSendMetric,x=b?b(v):v;if(!x){Te&&ve.log("`beforeSendMetric` returned `null`, will not send metric.");return}const E=lI(x,o,n,y);Te&&ve.log("[Metric]",E),i(o,E),o.emit("afterCaptureMetric",x)}function cv(e,t){const n=t??SC(e)??[];if(n.length===0)return;const i=e.getOptions(),o=sI(n,i._metadata,i.tunnel,e.getDsn());uv().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function SC(e){return uv().get(e)}function uv(){return fl("clientToMetricBufferMap",()=>new WeakMap)}function EC(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const fv=Symbol.for("SentryBufferFullError");function dv(e=100){const t=new Set;function n(){return t.size<e}function i(u){t.delete(u)}function o(u){if(!n())return av(fv);const f=u();return t.add(f),f.then(()=>i(f),()=>i(f)),f}function l(u){if(!t.size)return iu(!0);const f=Promise.allSettled(Array.from(t)).then(()=>!0);if(!u)return f;const h=[f,new Promise(p=>EC(setTimeout(()=>p(!1),u)))];return Promise.race(h)}return{get $(){return Array.from(t)},add:o,drain:l}}const uI=60*1e3;function fI(e,t=eu()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const i=Date.parse(`${e}`);return isNaN(i)?uI:i-t}function dI(e,t){return e[t]||e.all||0}function hI(e,t,n=eu()){return dI(e,t)>n}function pI(e,{statusCode:t,headers:n},i=eu()){const o={...e},l=n?.["x-sentry-rate-limits"],u=n?.["retry-after"];if(l)for(const f of l.trim().split(",")){const[h,p,,,y]=f.split(":",5),v=parseInt(h,10),b=(isNaN(v)?60:v)*1e3;if(!p)o.all=i+b;else for(const x of p.split(";"))x==="metric_bucket"?(!y||y.split(";").includes("custom"))&&(o[x]=i+b):o[x]=i+b}else u?o.all=i+fI(u,i):t===429&&(o.all=i+60*1e3);return o}const _C=64;function mI(e,t,n=dv(e.bufferSize||_C)){let i={};const o=u=>n.drain(u);function l(u){const f=[];if(sy(u,(v,b)=>{const x=wE(b);hI(i,x)?e.recordDroppedEvent("ratelimit_backoff",x):f.push(v)}),f.length===0)return Promise.resolve({});const h=Vo(u[0],f),p=v=>{if(WO(h,["client_report"])){Te&&ve.warn(`Dropping client report. Will not send outcomes (reason: ${v}).`);return}sy(h,(b,x)=>{e.recordDroppedEvent(v,wE(x))})},y=()=>t({body:ZO(h)}).then(v=>v.statusCode===413?(Te&&ve.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),p("send_error"),v):(Te&&v.statusCode!==void 0&&(v.statusCode<200||v.statusCode>=300)&&ve.warn(`Sentry responded with status code ${v.statusCode} to sent event.`),i=pI(i,v),v),v=>{throw p("network_error"),Te&&ve.error("Encountered error running transport request:",v),v});return n.add(y).then(v=>v,v=>{if(v===fv)return Te&&ve.error("Skipped sending event because buffer is full."),p("queue_overflow"),Promise.resolve({});throw v})}return{send:l,flush:o}}function gI(e,t,n){const i=[{type:"client_report"},{timestamp:qo(),discarded_events:e}];return Vo(t?{dsn:t}:{},[i])}function wC(e){const t=[];e.message&&t.push(e.message);try{const 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 yI(e){const{trace_id:t,parent_span_id:n,span_id:i,status:o,origin:l,data:u,op:f}=e.contexts?.trace??{};return{data:u??{},description:e.transaction,op:f,parent_span_id:n,span_id:i??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:l,profile_id:u?.[Jy],exclusive_time:u?.[ml],measurements:e.measurements,is_segment:!0}}function vI(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&&{[Jy]:e.profile_id},...e.exclusive_time&&{[ml]:e.exclusive_time}}}},measurements:e.measurements}}const zE="Not capturing exception because it's already been captured.",UE="Discarded session because of missing or non-string release",TC=Symbol.for("SentryInternalError"),CC=Symbol.for("SentryDoNotSendEventError"),bI=5e3;function hd(e){return{message:e,[TC]:!0}}function ng(e){return{message:e,[CC]:!0}}function BE(e){return!!e&&typeof e=="object"&&TC in e}function HE(e){return!!e&&typeof e=="object"&&CC in e}function FE(e,t,n,i,o){let l=0,u,f=!1;e.on(n,()=>{l=0,clearTimeout(u),f=!1}),e.on(t,h=>{l+=i(h),l>=8e5?o(e):f||(f=!0,u=EC(setTimeout(()=>{o(e)},bI)))}),e.on("flush",()=>{o(e)})}class xI{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=dv(t.transportOptions?.bufferSize??_C),t.dsn?this._dsn=OO(t.dsn):Te&&ve.warn("No DSN provided, client will not send events."),this._dsn){const i=Vk(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:i})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&FE(this,"afterCaptureLog","flushLogs",wI,Ad),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&FE(this,"afterCaptureMetric","flushMetrics",_I,cv)}captureException(t,n,i){const o=Cr();if(mE(t))return Te&&ve.log(zE),o;const l={event_id:o,...n};return this._process(()=>this.eventFromException(t,l).then(u=>this._captureEvent(u,l,i)).then(u=>u),"error"),l.event_id}captureMessage(t,n,i,o){const l={event_id:Cr(),...i},u=fh(t)?t:String(t),f=Wa(t),h=f?this.eventFromMessage(u,n,l):this.eventFromException(t,l);return this._process(()=>h.then(p=>this._captureEvent(p,l,o)),f?"unknown":"error"),l.event_id}captureEvent(t,n,i){const o=Cr();if(n?.originalException&&mE(n.originalException))return Te&&ve.log(zE),o;const l={event_id:o,...n},u=t.sdkProcessingMetadata||{},f=u.capturedSpanScope,h=u.capturedSpanIsolationScope,p=qE(t.type);return this._process(()=>this._captureEvent(t,l,f||i,h),p),l.event_id}captureSession(t){this.sendSession(t),Ja(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const n=this._transport;if(!n)return!0;this.emit("flush");const i=await this._isClientDoneProcessing(t),o=await n.flush(t);return i&&o}async close(t){Ad(this);const n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];vC(this,t,this._integrations),n||PE(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let i=ok(t,this._dsn,this._options._metadata,this._options.tunnel);for(const o of n.attachments||[])i=QO(i,tk(o));this.sendEnvelope(i).then(o=>this.emit("afterSendEvent",t,o))}sendSession(t){const{release:n,environment:i=rv}=this._options;if("aggregates"in t){const l=t.attrs||{};if(!l.release&&!n){Te&&ve.warn(UE);return}l.release=l.release||n,l.environment=l.environment||i,t.attrs=l}else{if(!t.release&&!n){Te&&ve.warn(UE);return}t.release=t.release||n,t.environment=t.environment||i}this.emit("beforeSendSession",t);const o=ik(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,i=1){if(this._options.sendClientReports){const o=`${t}:${n}`;Te&&ve.log(`Recording outcome: "${o}"${i>1?` (${i} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+i}}on(t,n){const i=this._hooks[t]=this._hooks[t]||new Set,o=(...l)=>n(...l);return i.add(o),()=>{i.delete(o)}}emit(t,...n){const i=this._hooks[t];i&&i.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return Te&&ve.error("Error while sending envelope:",n),{}}return Te&&ve.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=Kk(this,t),PE(this,t)}_updateSessionFromEvent(t,n){let i=n.level==="fatal",o=!1;const l=n.exception?.values;if(l){o=!0,i=!1;for(const h of l)if(h.mechanism?.handled===!1){i=!0;break}}const u=t.status==="ok";(u&&t.errors===0||u&&i)&&(Ja(t,{...i&&{status:"crashed"},errors:t.errors||Number(o||i)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(i=>setTimeout(i,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,i,o){const l=this.getOptions(),u=Object.keys(this._integrations);return!n.integrations&&u?.length&&(n.integrations=u),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),Ak(l,t,n,i,this,o).then(f=>{if(f===null)return f;this.emit("postprocessEvent",f,n),f.contexts={trace:qT(i),...f.contexts};const h=sv(this,i);return f.sdkProcessingMetadata={dynamicSamplingContext:h,...f.sdkProcessingMetadata},f})}_captureEvent(t,n={},i=gt(),o=jr()){return Te&&ay(t)&&ve.log(`Captured error event \`${wC(t)[0]||"<unknown>"}\``),this._processEvent(t,n,i,o).then(l=>l.event_id,l=>{Te&&(HE(l)?ve.log(l.message):BE(l)?ve.warn(l.message):ve.warn(l))})}_processEvent(t,n,i,o){const l=this.getOptions(),{sampleRate:u}=l,f=RC(t),h=ay(t),y=`before send for type \`${t.type||"error"}\``,v=typeof u>"u"?void 0:Bc(u);if(h&&typeof v=="number"&&Ti()>v)return this.recordDroppedEvent("sample_rate","error"),av(ng(`Discarding event because it's not included in the random sample (sampling rate = ${u})`));const b=qE(t.type);return this._prepareEvent(t,n,i,o).then(x=>{if(x===null)throw this.recordDroppedEvent("event_processor",b),ng("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return x;const _=EI(this,l,x,n);return SI(_,y)}).then(x=>{if(x===null){if(this.recordDroppedEvent("before_send",b),f){const C=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",C)}throw ng(`${y} returned \`null\`, will not send event.`)}const E=i.getSession()||o.getSession();if(h&&E&&this._updateSessionFromEvent(E,x),f){const T=x.sdkProcessingMetadata?.spanCountBeforeProcessing||0,C=x.spans?x.spans.length:0,M=T-C;M>0&&this.recordDroppedEvent("before_send","span",M)}const _=x.transaction_info;if(f&&_&&x.transaction!==t.transaction){const T="custom";x.transaction_info={..._,source:T}}return this.sendEvent(x,n),x}).then(null,x=>{throw HE(x)||BE(x)?x:(this.captureException(x,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:x}),hd(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
10
|
+
Reason: ${x}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(i=>(this._numProcessing--,i),i=>(this._numProcessing--,i===fv&&this.recordDroppedEvent("queue_overflow",n),i))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,i])=>{const[o,l]=n.split(":");return{reason:o,category:l,quantity:i}})}_flushOutcomes(){Te&&ve.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){Te&&ve.log("No outcomes to send");return}if(!this._dsn){Te&&ve.log("No dsn provided, will not send outcomes");return}Te&&ve.log("Sending outcomes:",t);const n=gI(t,this._options.tunnel&&gl(this._dsn));this.sendEnvelope(n)}}function qE(e){return e==="replay_event"?"replay":e||"error"}function SI(e,t){const n=`${t} must return \`null\` or a valid event.`;if(hl(e))return e.then(i=>{if(!zc(i)&&i!==null)throw hd(n);return i},i=>{throw hd(`${t} rejected with ${i}`)});if(!zc(e)&&e!==null)throw hd(n);return e}function EI(e,t,n,i){const{beforeSend:o,beforeSendTransaction:l,beforeSendSpan:u,ignoreSpans:f}=t;let h=n;if(ay(h)&&o)return o(h,i);if(RC(h)){if(u||f){const p=yI(h);if(f?.length&&jd(p,f))return null;if(u){const y=u(p);y?h=tu(n,vI(y)):ny()}if(h.spans){const y=[],v=h.spans;for(const x of v){if(f?.length&&jd(x,f)){qO(v,x);continue}if(u){const E=u(x);E?y.push(E):(ny(),y.push(x))}else y.push(x)}const b=h.spans.length-y.length;b&&e.recordDroppedEvent("before_send","span",b),h.spans=y}}if(l){if(h.spans){const p=h.spans.length;h.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:p}}return l(h,i)}}return h}function ay(e){return e.type===void 0}function RC(e){return e.type==="transaction"}function _I(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+NC(e.attributes)}function wI(e){let t=0;return e.message&&(t+=e.message.length*2),t+NC(e.attributes)}function NC(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*VE(n[0]):Wa(n)?t+=VE(n):t+=100}),t}function VE(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function TI(e){return uh(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function $E(e){return TI(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function CI(e,t){t.debug===!0&&(Te?ve.enable():Fo(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),gt().update(t.initialScope);const i=new e(t);return RI(i),i.init(),i}function RI(e){gt().setClient(e)}const NI="thismessage:/";function jC(e){return"isRelative"in e}function MC(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,i=n?NI:void 0;try{if("canParse"in URL&&!URL.canParse(e,i))return;const o=new URL(e,i);return n?{isRelative:n,pathname:o.pathname,search:o.search,hash:o.hash}:o}catch{}}function jI(e){if(jC(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function Ao(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",i=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:i,relative:t[5]+n+i}}function MI(e){return e.split(/[?#]/,1)[0]}function Ri(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),i=n?n[1]:"text/plain",o=e.includes(";base64,"),l=e.indexOf(",");let u="";if(t&&l!==-1){const f=e.slice(l+1);u=f.length>10?`${f.slice(0,10)}... [truncated]`:f}return`data:${i}${o?",base64":""}${u?`,${u}`:""}`}return e}function AI(e,...t){const 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}const OI=AI;function kI(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 AC(e,t,n=[t],i="npm"){const o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(l=>({name:`${i}:@sentry/${l}`,version:No})),o.version=No)}function OC(e={}){const t=e.client||mt();if(!Uk()||!t)return{};const n=Ho(),i=pl(n);if(i.getTraceData)return i.getTraceData(e);const o=e.scope||gt(),l=e.span||In(),u=l?PO(l):II(o),f=l?Ps(l):sv(t,o),h=EO(f);if(!QT.test(u))return ve.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const y={"sentry-trace":u,baggage:h};return e.propagateTraceparent&&(y.traceparent=l?zO(l):DI(o)),y}function II(e){const{traceId:t,sampled:n,propagationSpanId:i}=e.getPropagationContext();return WT(t,i,n)}function DI(e){const{traceId:t,sampled:n,propagationSpanId:i}=e.getPropagationContext();return ZT(t,i,n)}const LI=100;function Do(e,t){const n=mt(),i=jr();if(!n)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:l=LI}=n.getOptions();if(l<=0)return;const f={timestamp:qo(),...e},h=o?Fo(()=>o(f,t)):f;h!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",h,t),i.addBreadcrumb(h,l))}let GE;const PI="FunctionToString",KE=new WeakMap,zI=(()=>({name:PI,setupOnce(){GE=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Wy(this),n=KE.has(mt())&&t!==void 0?t:this;return GE.apply(n,e)}}catch{}},setup(e){KE.set(e,!0)}})),UI=zI,BI=[/^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. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],HI="EventFilters",FI=(e={})=>{let t;return{name:HI,setup(n){const i=n.getOptions();t=YE(e,i)},processEvent(n,i,o){if(!t){const l=o.getOptions();t=YE(e,l)}return VI(n,t)?null:n}}},qI=((e={})=>({...FI(e),name:"InboundFilters"}));function YE(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:BI],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function VI(e,t){if(e.type){if(e.type==="transaction"&&GI(e,t.ignoreTransactions))return Te&&ve.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
11
|
+
Event: ${Eo(e)}`),!0}else{if($I(e,t.ignoreErrors))return Te&&ve.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
12
|
+
Event: ${Eo(e)}`),!0;if(QI(e))return Te&&ve.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
13
|
+
Event: ${Eo(e)}`),!0;if(KI(e,t.denyUrls))return Te&&ve.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
14
|
+
Event: ${Eo(e)}.
|
|
15
|
+
Url: ${Od(e)}`),!0;if(!YI(e,t.allowUrls))return Te&&ve.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
16
|
+
Event: ${Eo(e)}.
|
|
17
|
+
Url: ${Od(e)}`),!0}return!1}function $I(e,t){return t?.length?wC(e).some(n=>Ci(n,t)):!1}function GI(e,t){if(!t?.length)return!1;const n=e.transaction;return n?Ci(n,t):!1}function KI(e,t){if(!t?.length)return!1;const n=Od(e);return n?Ci(n,t):!1}function YI(e,t){if(!t?.length)return!0;const n=Od(e);return n?Ci(n,t):!0}function XI(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Od(e){try{const n=[...e.exception?.values??[]].reverse().find(i=>i.mechanism?.parent_id===void 0&&i.stacktrace?.frames?.length)?.stacktrace?.frames;return n?XI(n):null}catch{return Te&&ve.error(`Cannot extract url for event ${Eo(e)}`),null}}function QI(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function WI(e,t,n,i,o,l){if(!o.exception?.values||!l||!ks(l.originalException,Error))return;const u=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;u&&(o.exception.values=ly(e,t,i,l.originalException,n,o.exception.values,u,0))}function ly(e,t,n,i,o,l,u,f){if(l.length>=n+1)return l;let h=[...l];if(ks(i[o],Error)){XE(u,f,i);const p=e(t,i[o]),y=h.length;QE(p,o,y,f),h=ly(e,t,n,i[o],o,[p,...h],p,y)}return kC(i)&&i.errors.forEach((p,y)=>{if(ks(p,Error)){XE(u,f,i);const v=e(t,p),b=h.length;QE(v,`errors[${y}]`,b,f),h=ly(e,t,n,p,o,[v,...h],v,b)}}),h}function kC(e){return Array.isArray(e.errors)}function XE(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...kC(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function QE(e,t,n,i){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:i}}function ZI(e){const t="console";Ui(t,e),Bi(t,JI)}function JI(){"console"in it&&kA.forEach(function(e){e in it.console&&Zn(it.console,e,function(t){return Rd[e]=t,function(...n){Tr("console",{args:n,level:e}),Rd[e]?.apply(it.console,n)}})})}function eD(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const tD="Dedupe",nD=(()=>{let e;return{name:tD,processEvent(t){if(t.type)return t;try{if(sD(t,e))return Te&&ve.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),rD=nD;function sD(e,t){return t?!!(iD(e,t)||oD(e,t)):!1}function iD(e,t){const n=e.message,i=t.message;return!(!n&&!i||n&&!i||!n&&i||n!==i||!DC(e,t)||!IC(e,t))}function oD(e,t){const n=WE(t),i=WE(e);return!(!n||!i||n.type!==i.type||n.value!==i.value||!DC(e,t)||!IC(e,t))}function IC(e,t){let n=cE(e),i=cE(t);if(!n&&!i)return!0;if(n&&!i||!n&&i||(n=n,i=i,i.length!==n.length))return!1;for(let o=0;o<i.length;o++){const l=i[o],u=n[o];if(l.filename!==u.filename||l.lineno!==u.lineno||l.colno!==u.colno||l.function!==u.function)return!1}return!0}function DC(e,t){let n=e.fingerprint,i=t.fingerprint;if(!n&&!i)return!0;if(n&&!i||!n&&i)return!1;n=n,i=i;try{return n.join("")===i.join("")}catch{return!1}}function WE(e){return e.exception?.values?.[0]}const aD="ConversationId",lD=(()=>({name:aD,setup(e){e.on("spanStart",t=>{const n=gt().getScopeData(),i=jr().getScopeData(),o=n.conversationId||i.conversationId;o&&t.setAttribute(pO,o)})}})),cD=lD;function uD(e,t,n,i,o){if(!e.fetchData)return;const{method:l,url:u}=e.fetchData,f=Ur()&&t(u);if(e.endTimestamp){const x=e.fetchData.__span;if(!x)return;const E=i[x];E&&(f&&(hD(E,e),fD(E,e,o)),delete i[x]);return}const{spanOrigin:h="auto.http.browser",propagateTraceparent:p=!1}=typeof o=="object"?o:{spanOrigin:o},y=!!In(),v=f&&y?yl(mD(u,l,h)):new Ii;if(e.fetchData.__span=v.spanContext().spanId,i[v.spanContext().spanId]=v,n(e.fetchData.url)){const x=e.args[0],E={...e.args[1]||{}},_=dD(x,E,Ur()&&y?v:void 0,p);_&&(e.args[1]=E,E.headers=_)}const b=mt();if(b){const x={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};b.emit("beforeOutgoingRequestSpan",v,x)}return v}function fD(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function dD(e,t,n,i){const o=OC({span:n,propagateTraceparent:i}),l=o["sentry-trace"],u=o.baggage,f=o.traceparent;if(!l)return;const h=t.headers||(Xy(e)?e.headers:void 0);if(h)if(pD(h)){const p=new Headers(h);if(p.get("sentry-trace")||p.set("sentry-trace",l),i&&f&&!p.get("traceparent")&&p.set("traceparent",f),u){const y=p.get("baggage");y?Uf(y)||p.set("baggage",`${y},${u}`):p.set("baggage",u)}return p}else if(Array.isArray(h)){const p=[...h];h.find(v=>v[0]==="sentry-trace")||p.push(["sentry-trace",l]),i&&f&&!h.find(v=>v[0]==="traceparent")&&p.push(["traceparent",f]);const y=h.find(v=>v[0]==="baggage"&&Uf(v[1]));return u&&!y&&p.push(["baggage",u]),p}else{const p="sentry-trace"in h?h["sentry-trace"]:void 0,y="traceparent"in h?h.traceparent:void 0,v="baggage"in h?h.baggage:void 0,b=v?Array.isArray(v)?[...v]:[v]:[],x=v&&(Array.isArray(v)?v.find(_=>Uf(_)):Uf(v));u&&!x&&b.push(u);const E={...h,"sentry-trace":p??l,baggage:b.length>0?b.join(","):void 0};return i&&f&&!y&&(E.traceparent=f),E}else return{...o}}function hD(e,t){if(t.response){$T(e,t.response.status);const n=t.response?.headers?.get("content-length");if(n){const i=parseInt(n);i>0&&e.setAttribute("http.response_content_length",i)}}else t.error&&e.setStatus({code:Zt,message:"internal_error"});e.end()}function Uf(e){return e.split(",").some(t=>t.trim().startsWith(tv))}function pD(e){return typeof Headers<"u"&&ks(e,Headers)}function mD(e,t,n){if(e.startsWith("data:")){const l=Ri(e);return{name:`${t} ${l}`,attributes:ZE(e,void 0,t,n)}}const i=MC(e),o=i?jI(i):e;return{name:`${t} ${o}`,attributes:ZE(e,i,t,n)}}function ZE(e,t,n,i){const o={url:Ri(e),type:"fetch","http.method":n,[tn]:i,[Ls]:"http.client"};return t&&(jC(t)||(o["http.url"]=Ri(t.href),o["server.address"]=t.host),t.search&&(o["http.query"]=t.search),t.hash&&(o["http.fragment"]=t.hash)),o}function vl(e,t,n,i,o){nI({level:e,message:t,attributes:n,severityNumber:o},i)}function gD(e,t,{scope:n}={}){vl("trace",e,t,n)}function yD(e,t,{scope:n}={}){vl("debug",e,t,n)}function vD(e,t,{scope:n}={}){vl("info",e,t,n)}function bD(e,t,{scope:n}={}){vl("warn",e,t,n)}function xD(e,t,{scope:n}={}){vl("error",e,t,n)}function SD(e,t,{scope:n}={}){vl("fatal",e,t,n)}const ED=Object.freeze(Object.defineProperty({__proto__:null,debug:yD,error:xD,fatal:SD,fmt:OI,info:vD,trace:gD,warn:bD},Symbol.toStringTag,{value:"Module"}));function hv(e,t,n,i){cI({type:e,name:t,value:n,unit:i?.unit,attributes:i?.attributes},{scope:i?.scope})}function JE(e,t=1,n){hv("counter",e,t,n)}function e_(e,t,n){hv("gauge",e,t,n)}function t_(e,t,n){hv("distribution",e,t,n)}function LC(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const Fc=it;function _D(){return"history"in Fc&&!!Fc.history}function wD(){if(!("fetch"in Fc))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function cy(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function TD(){if(typeof EdgeRuntime=="string")return!0;if(!wD())return!1;if(cy(Fc.fetch))return!0;let e=!1;const t=Fc.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=cy(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){Te&&ve.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function PC(e,t){const n="fetch";Ui(n,e),Bi(n,()=>zC(void 0,t))}function CD(e){const t="fetch-body-resolved";Ui(t,e),Bi(t,()=>zC(ND))}function zC(e,t=!1){t&&!TD()||Zn(it,"fetch",function(n){return function(...i){const o=new Error,{method:l,url:u}=jD(i),f={args:i,fetchData:{method:l,url:u},startTimestamp:Yt()*1e3,virtualError:o,headers:MD(i)};return e||Tr("fetch",{...f}),n.apply(it,i).then(async h=>(e?e(h):Tr("fetch",{...f,endTimestamp:Yt()*1e3,response:h}),h),h=>{Tr("fetch",{...f,endTimestamp:Yt()*1e3,error:h}),uh(h)&&h.stack===void 0&&(h.stack=o.stack,kn(h,"framesToPop",1));const y=mt()?.getOptions().enhanceFetchErrorMessages??"always";if(y!==!1&&h instanceof TypeError&&(h.message==="Failed to fetch"||h.message==="Load failed"||h.message==="NetworkError when attempting to fetch resource."))try{const x=new URL(f.fetchData.url).host;y==="always"?h.message=`${h.message} (${x})`:kn(h,"__sentry_fetch_url_host__",x)}catch{}throw h})}})}async function RD(e,t){if(e?.body){const n=e.body,i=n.getReader(),o=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let l=!0;for(;l;){let u;try{u=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:f}=await i.read();clearTimeout(u),f&&(t(),l=!1)}catch{l=!1}finally{clearTimeout(u)}}clearTimeout(o),i.releaseLock(),n.cancel().then(null,()=>{})}}function ND(e){let t;try{t=e.clone()}catch{return}RD(t,()=>{Tr("fetch-body-resolved",{endTimestamp:Yt()*1e3,response:e})})}function pd(e,t){return!!e&&typeof e=="object"&&!!e[t]}function n_(e){return typeof e=="string"?e:e?pd(e,"url")?e.url:e.toString?e.toString():"":""}function jD(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,i]=e;return{url:n_(n),method:pd(i,"method")?String(i.method).toUpperCase():Xy(n)&&pd(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:n_(t),method:pd(t,"method")?String(t.method).toUpperCase():"GET"}}function MD(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Xy(t))return new Headers(t.headers)}catch{}}function AD(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function OD(){return"npm"}function kD(){return!AD()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function ID(){return typeof window<"u"&&(!kD()||DD())}function DD(){return it.process?.type==="renderer"}const tt=it;let uy=0;function UC(){return uy>0}function LD(){uy++,setTimeout(()=>{uy--})}function rl(e,t={}){function n(o){return typeof o=="function"}if(!n(e))return e;try{const o=e.__sentry_wrapped__;if(o)return typeof o=="function"?o:e;if(Wy(e))return e}catch{return e}const i=function(...o){try{const l=o.map(u=>rl(u,t));return e.apply(this,l)}catch(l){throw LD(),nu(u=>{u.addEventProcessor(f=>(t.mechanism&&(Jg(f,void 0),Za(f,t.mechanism)),f.extra={...f.extra,arguments:o},f)),pC(l)}),l}};try{for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(i[o]=e[o])}catch{}UT(i,e),kn(e,"__sentry_wrapped__",i);try{Object.getOwnPropertyDescriptor(i,"name").configurable&&Object.defineProperty(i,"name",{get(){return e.name}})}catch{}return i}function pv(){const e=Zc(),{referrer:t}=tt.document||{},{userAgent:n}=tt.navigator||{},i={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:i}}function mv(e,t){const n=gv(e,t),i={type:HD(t),value:FD(t)};return n.length&&(i.stacktrace={frames:n}),i.type===void 0&&i.value===""&&(i.value="Unrecoverable error caught"),i}function PD(e,t,n,i){const l=mt()?.getOptions().normalizeDepth,u=KD(t),f={__serialized__:oC(t,l)};if(u)return{exception:{values:[mv(e,u)]},extra:f};const h={exception:{values:[{type:dh(t)?t.constructor.name:i?"UnhandledRejection":"Error",value:$D(t,{isUnhandledRejection:i})}]},extra:f};if(n){const p=gv(e,n);p.length&&(h.exception.values[0].stacktrace={frames:p})}return h}function rg(e,t){return{exception:{values:[mv(e,t)]}}}function gv(e,t){const n=t.stacktrace||t.stack||"",i=UD(t),o=BD(t);try{return e(n,i,o)}catch{}return[]}const zD=/Minified React error #\d+;/i;function UD(e){return e&&zD.test(e.message)?1:0}function BD(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function BC(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function HD(e){const t=e?.name;return!t&&BC(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function FD(e){const t=e?.message;return BC(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?$E(t.error):$E(e):"No error message"}function qD(e,t,n,i){const o=n?.syntheticException||void 0,l=yv(e,t,o,i);return Za(l),l.level="error",n?.event_id&&(l.event_id=n.event_id),iu(l)}function VD(e,t,n="info",i,o){const l=i?.syntheticException||void 0,u=fy(e,t,l,o);return u.level=n,i?.event_id&&(u.event_id=i.event_id),iu(u)}function yv(e,t,n,i,o){let l;if(LT(t)&&t.error)return rg(e,t.error);if(fE(t)||VA(t)){const u=t;if("stack"in t)l=rg(e,t);else{const f=u.name||(fE(u)?"DOMError":"DOMException"),h=u.message?`${f}: ${u.message}`:f;l=fy(e,h,n,i),Jg(l,h)}return"code"in u&&(l.tags={...l.tags,"DOMException.code":`${u.code}`}),l}return uh(t)?rg(e,t):zc(t)||dh(t)?(l=PD(e,t,n,o),Za(l,{synthetic:!0}),l):(l=fy(e,t,n,i),Jg(l,`${t}`),Za(l,{synthetic:!0}),l)}function fy(e,t,n,i){const o={};if(i&&n){const l=gv(e,n);l.length&&(o.exception={values:[{value:t,stacktrace:{frames:l}}]}),Za(o,{synthetic:!0})}if(fh(t)){const{__sentry_template_string__:l,__sentry_template_values__:u}=t;return o.logentry={message:l,params:u},o}return o.message=t,o}function $D(e,{isUnhandledRejection:t}){const n=QA(e),i=t?"promise rejection":"exception";return LT(e)?`Event \`ErrorEvent\` captured as ${i} with message \`${e.message}\``:dh(e)?`Event \`${GD(e)}\` (type=${e.type}) captured as ${i}`:`Object captured as ${i} with keys: ${n}`}function GD(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function KD(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class YD extends xI{constructor(t){const n=XD(t),i=tt.SENTRY_SDK_SOURCE||OD();AC(n,"browser",["browser"],i),n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:o,sendClientReports:l,enableLogs:u,_experiments:f,enableMetrics:h}=this._options,p=h??f?.enableMetrics??!0;tt.document&&(l||u||p)&&tt.document.addEventListener("visibilitychange",()=>{tt.document.visibilityState==="hidden"&&(l&&this._flushOutcomes(),u&&Ad(this),p&&cv(this))}),o&&this.on("beforeSendSession",kI)}eventFromException(t,n){return qD(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",i){return VD(this._options.stackParser,t,n,i,this._options.attachStacktrace)}_prepareEvent(t,n,i,o){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,i,o)}}function XD(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:tt.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const ou=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ve=it,QD=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",au=(e,t,n,i)=>{let o,l;return u=>{t.value>=0&&(u||i)&&(l=t.value-(o??0),(l||o===void 0)&&(o=t.value,t.delta=l,t.rating=QD(t.value,n),e(t)))}},lu=(e=!0)=>{const t=Ve.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},bl=()=>lu()?.activationStart??0;function Ni(e,t,n){Ve.document&&Ve.addEventListener(e,t,n)}function kd(e,t,n){Ve.document&&Ve.removeEventListener(e,t,n)}let Fa=-1;const HC=new Set,WD=()=>Ve.document?.visibilityState==="hidden"&&!Ve.document?.prerendering?0:1/0,md=e=>{if(ZD(e)&&Fa>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of HC)t();isFinite(Fa)||(Fa=e.type==="visibilitychange"?e.timeStamp:0,kd("prerenderingchange",md,!0))}},cu=()=>{if(Ve.document&&Fa<0){const e=bl();Fa=(Ve.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??WD(),Ni("visibilitychange",md,!0),Ni("pagehide",md,!0),Ni("prerenderingchange",md,!0)}return{get firstHiddenTime(){return Fa},onHidden(e){HC.add(e)}}};function ZD(e){return e.type==="pagehide"||Ve.document?.visibilityState==="hidden"}const JD=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,uu=(e,t=-1)=>{const n=lu();let i="navigate";return n&&(Ve.document?.prerendering||bl()>0?i="prerender":Ve.document?.wasDiscarded?i="restore":n.type&&(i=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:JD(),navigationType:i}},sg=new WeakMap;function vv(e,t){try{return sg.get(e)||sg.set(e,new t),sg.get(e)}catch{return new t}}class Id{constructor(){Id.prototype.__init.call(this),Id.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){if(t.hadRecentInput)return;const n=this._sessionEntries[0],i=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&i&&t.startTime-i.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),this._onAfterProcessingUnexpectedShift?.(t)}}const xl=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const i=new PerformanceObserver(o=>{Promise.resolve().then(()=>{t(o.getEntries())})});return i.observe({type:e,buffered:!0,...n}),i}}catch{}},bv=e=>{let t=!1;return()=>{t||(e(),t=!0)}},mh=e=>{Ve.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},e2=[1800,3e3],t2=(e,t={})=>{mh(()=>{const n=cu(),i=uu("FCP");let o;const u=xl("paint",f=>{for(const h of f)h.name==="first-contentful-paint"&&(u.disconnect(),h.startTime<n.firstHiddenTime&&(i.value=Math.max(h.startTime-bl(),0),i.entries.push(h),o(!0)))});u&&(o=au(e,i,e2,t.reportAllChanges))})},n2=[.1,.25],r2=(e,t={})=>{t2(bv(()=>{const n=uu("CLS",0);let i;const o=cu(),l=vv(t,Id),u=h=>{for(const p of h)l._processEntry(p);l._sessionValue>n.value&&(n.value=l._sessionValue,n.entries=l._sessionEntries,i())},f=xl("layout-shift",u);f&&(i=au(e,n,n2,t.reportAllChanges),o.onHidden(()=>{u(f.takeRecords()),i(!0)}),Ve?.setTimeout?.(i))}))};let FC=0,ig=1/0,Bf=0;const s2=e=>{e.forEach(t=>{t.interactionId&&(ig=Math.min(ig,t.interactionId),Bf=Math.max(Bf,t.interactionId),FC=Bf?(Bf-ig)/7+1:0)})};let dy;const qC=()=>dy?FC:performance.interactionCount||0,i2=()=>{"interactionCount"in performance||dy||(dy=xl("event",s2,{type:"event",buffered:!0,durationThreshold:0}))},og=10;let VC=0;const o2=()=>qC()-VC;class Dd{constructor(){Dd.prototype.__init.call(this),Dd.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){VC=qC(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(o2()/50));return this._longestInteractionList[t]}_processEntry(t){if(this._onBeforeProcessingEntry?.(t),!(t.interactionId||t.entryType==="first-input"))return;const n=this._longestInteractionList.at(-1);let i=this._longestInteractionMap.get(t.interactionId);if(i||this._longestInteractionList.length<og||t.duration>n._latency){if(i?t.duration>i._latency?(i.entries=[t],i._latency=t.duration):t.duration===i._latency&&t.startTime===i.entries[0].startTime&&i.entries.push(t):(i={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(i.id,i),this._longestInteractionList.push(i)),this._longestInteractionList.sort((o,l)=>l._latency-o._latency),this._longestInteractionList.length>og){const o=this._longestInteractionList.splice(og);for(const l of o)this._longestInteractionMap.delete(l.id)}this._onAfterProcessingINPCandidate?.(i)}}}const $C=e=>{const t=Ve.requestIdleCallback||Ve.setTimeout;Ve.document?.visibilityState==="hidden"?e():(e=bv(e),Ni("visibilitychange",e,{once:!0,capture:!0}),Ni("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),kd("visibilitychange",e,{capture:!0}),kd("pagehide",e,{capture:!0})}))},a2=[200,500],l2=40,c2=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=cu();mh(()=>{i2();const i=uu("INP");let o;const l=vv(t,Dd),u=h=>{$C(()=>{for(const y of h)l._processEntry(y);const p=l._estimateP98LongestInteraction();p&&p._latency!==i.value&&(i.value=p._latency,i.entries=p.entries,o())})},f=xl("event",u,{durationThreshold:t.durationThreshold??l2});o=au(e,i,a2,t.reportAllChanges),f&&(f.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{u(f.takeRecords()),o(!0)}))})};class u2{_processEntry(t){this._onBeforeProcessingEntry?.(t)}}const f2=[2500,4e3],d2=(e,t={})=>{mh(()=>{const n=cu(),i=uu("LCP");let o;const l=vv(t,u2),u=h=>{t.reportAllChanges||(h=h.slice(-1));for(const p of h)l._processEntry(p),p.startTime<n.firstHiddenTime&&(i.value=Math.max(p.startTime-bl(),0),i.entries=[p],o())},f=xl("largest-contentful-paint",u);if(f){o=au(e,i,f2,t.reportAllChanges);const h=bv(()=>{u(f.takeRecords()),f.disconnect(),o(!0)}),p=y=>{y.isTrusted&&($C(h),kd(y.type,p,{capture:!0}))};for(const y of["keydown","click","visibilitychange"])Ni(y,p,{capture:!0})}})},h2=[800,1800],hy=e=>{Ve.document?.prerendering?mh(()=>hy(e)):Ve.document?.readyState!=="complete"?addEventListener("load",()=>hy(e),!0):setTimeout(e)},p2=(e,t={})=>{const n=uu("TTFB"),i=au(e,n,h2,t.reportAllChanges);hy(()=>{const o=lu();o&&(n.value=Math.max(o.responseStart-bl(),0),n.entries=[o],i(!0))})},Ac={},Ld={};let GC,KC,YC,XC;function QC(e,t=!1){return gh("cls",e,y2,GC,t)}function WC(e,t=!1){return gh("lcp",e,v2,KC,t)}function m2(e){return gh("ttfb",e,b2,YC)}function g2(e){return gh("inp",e,x2,XC)}function sl(e,t){return ZC(e,t),Ld[e]||(S2(e),Ld[e]=!0),JC(e,t)}function fu(e,t){const n=Ac[e];if(n?.length)for(const i of n)try{i(t)}catch(o){ou&&ve.error(`Error while triggering instrumentation handler.
|
|
18
|
+
Type: ${e}
|
|
19
|
+
Name: ${Os(i)}
|
|
20
|
+
Error:`,o)}}function y2(){return r2(e=>{fu("cls",{metric:e}),GC=e},{reportAllChanges:!0})}function v2(){return d2(e=>{fu("lcp",{metric:e}),KC=e},{reportAllChanges:!0})}function b2(){return p2(e=>{fu("ttfb",{metric:e}),YC=e})}function x2(){return c2(e=>{fu("inp",{metric:e}),XC=e})}function gh(e,t,n,i,o=!1){ZC(e,t);let l;return Ld[e]||(l=n(),Ld[e]=!0),i&&t({metric:i}),JC(e,t,o?l:void 0)}function S2(e){const t={};e==="event"&&(t.durationThreshold=0),xl(e,n=>{fu(e,{entries:n})},t)}function ZC(e,t){Ac[e]=Ac[e]||[],Ac[e].push(t)}function JC(e,t,n){return()=>{n&&n();const i=Ac[e];if(!i)return;const o=i.indexOf(t);o!==-1&&i.splice(o,1)}}function E2(e){return"duration"in e}const _2=e=>{const t=n=>{(n.type==="pagehide"||Ve.document?.visibilityState==="hidden")&&e(n)};Ni("visibilitychange",t,{capture:!0,once:!0}),Ni("pagehide",t,{capture:!0,once:!0})};function ag(e){return typeof e=="number"&&isFinite(e)}function Di(e,t,n,{...i}){const o=pt(e).start_timestamp;return o&&o>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),iv(e,()=>{const l=yl({startTime:t,...i});return l&&l.end(n),l})}function xv(e){const t=mt();if(!t)return;const{name:n,transaction:i,attributes:o,startTime:l}=e,{release:u,environment:f,sendDefaultPii:h}=t.getOptions(),y=t.getIntegrationByName("Replay")?.getReplayId(),v=gt(),b=v.getUser(),x=b!==void 0?b.email||b.id||b.ip_address:void 0;let E;try{E=v.getScopeData().contexts.profile.profile_id}catch{}const _={release:u,environment:f,user:x||void 0,profile_id:E||void 0,replay_id:y||void 0,transaction:i,"user_agent.original":Ve.navigator?.userAgent,"client.address":h?"{{auto}}":void 0,...o};return yl({name:n,attributes:_,startTime:l,experimental:{standalone:!0}})}function du(){return Ve.addEventListener&&Ve.performance}function zt(e){return e/1e3}function w2(e){let t="unknown",n="unknown",i="";for(const o of e){if(o==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(o))){t=i==="h"?"http":i,n=e.split(i)[1];break}i+=o}return i===e&&(t=i),{name:t,version:n}}function eR(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function tR(e,t){let n,i=!1;function o(f){!i&&n&&t(f,n),i=!0}_2(()=>{o("pagehide")});const l=e.on("beforeStartNavigationSpan",(f,h)=>{h?.isRedirect||(o("navigation"),l(),u())}),u=e.on("afterStartPageLoadSpan",f=>{n=f.spanContext().spanId,u()})}function T2(e){let t=0,n;if(!eR("layout-shift"))return;const i=QC(({metric:o})=>{const l=o.entries[o.entries.length-1];l&&(t=o.value,n=l)},!0);tR(e,(o,l)=>{C2(t,n,l,o),i()})}function C2(e,t,n,i){ou&&ve.log(`Sending CLS span (${e})`);const o=t?zt((rr()||0)+t.startTime):Yt(),l=gt().getScopeData().transactionName,u=t?Rr(t.sources[0]?.node):"Layout shift",f={[tn]:"auto.http.browser.cls",[Ls]:"ui.webvital.cls",[ml]:0,"sentry.pageload.span_id":n,"sentry.report_event":i};t?.sources&&t.sources.forEach((p,y)=>{f[`cls.source.${y+1}`]=Rr(p.node)});const h=xv({name:u,transaction:l,attributes:f,startTime:o});h&&(h.addEvent("cls",{[ru]:"",[su]:e}),h.end(o))}function R2(e){let t=0,n;if(!eR("largest-contentful-paint"))return;const i=WC(({metric:o})=>{const l=o.entries[o.entries.length-1];l&&(t=o.value,n=l)},!0);tR(e,(o,l)=>{N2(t,n,l,o),i()})}function N2(e,t,n,i){ou&&ve.log(`Sending LCP span (${e})`);const o=zt((rr()||0)+(t?.startTime||0)),l=gt().getScopeData().transactionName,u=t?Rr(t.element):"Largest contentful paint",f={[tn]:"auto.http.browser.lcp",[Ls]:"ui.webvital.lcp",[ml]:0,"sentry.pageload.span_id":n,"sentry.report_event":i};t&&(t.element&&(f["lcp.element"]=Rr(t.element)),t.id&&(f["lcp.id"]=t.id),t.url&&(f["lcp.url"]=t.url),t.loadTime!=null&&(f["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(f["lcp.renderTime"]=t.renderTime),t.size!=null&&(f["lcp.size"]=t.size));const h=xv({name:u,transaction:l,attributes:f,startTime:o});h&&(h.addEvent("lcp",{[ru]:"millisecond",[su]:e}),h.end(o))}function vr(e){return e&&((rr()||performance.timeOrigin)+e)/1e3}function nR(e){const t={};if(e.nextHopProtocol!=null){const{name:n,version:i}=w2(e.nextHopProtocol);t["network.protocol.version"]=i,t["network.protocol.name"]=n}return rr()||du()?.timeOrigin?j2({...t,"http.request.redirect_start":vr(e.redirectStart),"http.request.redirect_end":vr(e.redirectEnd),"http.request.worker_start":vr(e.workerStart),"http.request.fetch_start":vr(e.fetchStart),"http.request.domain_lookup_start":vr(e.domainLookupStart),"http.request.domain_lookup_end":vr(e.domainLookupEnd),"http.request.connect_start":vr(e.connectStart),"http.request.secure_connection_start":vr(e.secureConnectionStart),"http.request.connection_end":vr(e.connectEnd),"http.request.request_start":vr(e.requestStart),"http.request.response_start":vr(e.responseStart),"http.request.response_end":vr(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function j2(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const M2=2147483647;let r_=0,Pr={},Mn,Pd;function A2({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const i=du();if(i&&rr()){i.mark&&Ve.performance.mark("sentry-tracing-init");const o=t?R2(n):L2(),l=P2(),u=e?T2(n):D2();return()=>{o?.(),l(),u?.()}}return()=>{}}function O2(){sl("longtask",({entries:e})=>{const t=In();if(!t)return;const{op:n,start_timestamp:i}=pt(t);for(const o of e){const l=zt(rr()+o.startTime),u=zt(o.duration);n==="navigation"&&i&&l<i||Di(t,l,l+u,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[tn]:"auto.ui.browser.metrics"}})}})}function k2(){new PerformanceObserver(t=>{const n=In();if(n)for(const i of t.getEntries()){if(!i.scripts[0])continue;const o=zt(rr()+i.startTime),{start_timestamp:l,op:u}=pt(n);if(u==="navigation"&&l&&o<l)continue;const f=zt(i.duration),h={[tn]:"auto.ui.browser.metrics"},p=i.scripts[0],{invoker:y,invokerType:v,sourceURL:b,sourceFunctionName:x,sourceCharPosition:E}=p;h["browser.script.invoker"]=y,h["browser.script.invoker_type"]=v,b&&(h["code.filepath"]=b),x&&(h["code.function"]=x),E!==-1&&(h["browser.script.source_char_position"]=E),Di(n,o,o+f,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:h})}}).observe({type:"long-animation-frame",buffered:!0})}function I2(){sl("event",({entries:e})=>{const t=In();if(t){for(const n of e)if(n.name==="click"){const i=zt(rr()+n.startTime),o=zt(n.duration),l={name:Rr(n.target),op:`ui.interaction.${n.name}`,startTime:i,attributes:{[tn]:"auto.ui.browser.metrics"}},u=zT(n.target);u&&(l.attributes["ui.component_name"]=u),Di(t,i,i+o,l)}}})}function D2(){return QC(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Pr.cls={value:e.value,unit:""},Pd=t)},!0)}function L2(){return WC(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Pr.lcp={value:e.value,unit:"millisecond"},Mn=t)},!0)}function P2(){return m2(({metric:e})=>{e.entries[e.entries.length-1]&&(Pr.ttfb={value:e.value,unit:"millisecond"})})}function z2(e,t){const n=du(),i=rr();if(!n?.getEntries||!i)return;const o=zt(i),l=n.getEntries(),{op:u,start_timestamp:f}=pt(e);l.slice(r_).forEach(h=>{const p=zt(h.startTime),y=zt(Math.max(0,h.duration));if(!(u==="navigation"&&f&&o+p<f))switch(h.entryType){case"navigation":{F2(e,h,o);break}case"mark":case"paint":case"measure":{B2(e,h,p,y,o,t.ignorePerformanceApiSpans);const v=cu(),b=h.startTime<v.firstHiddenTime;h.name==="first-paint"&&b&&(Pr.fp={value:h.startTime,unit:"millisecond"}),h.name==="first-contentful-paint"&&b&&(Pr.fcp={value:h.startTime,unit:"millisecond"});break}case"resource":{$2(e,h,h.name,p,y,o,t.ignoreResourceSpans);break}}}),r_=Math.max(l.length-1,0),G2(e),u==="pageload"&&(X2(Pr),t.recordClsOnPageloadSpan||delete Pr.cls,t.recordLcpOnPageloadSpan||delete Pr.lcp,Object.entries(Pr).forEach(([h,p])=>{uk(h,p.value,p.unit)}),e.setAttribute("performance.timeOrigin",o),e.setAttribute("performance.activationStart",bl()),K2(e,t)),Mn=void 0,Pd=void 0,Pr={}}function U2(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function B2(e,t,n,i,o,l){if(U2(t)||["mark","measure"].includes(t.entryType)&&Ci(t.name,l))return;const u=lu(!1),f=zt(u?u.requestStart:0),h=o+Math.max(n,f),p=o+n,y=p+i,v={[tn]:"auto.resource.browser.metrics"};h!==p&&(v["sentry.browser.measure_happened_before_request"]=!0,v["sentry.browser.measure_start_time"]=h),H2(v,t),h<=y&&Di(e,h,y,{name:t.name,op:t.entryType,attributes:v})}function H2(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[i,o]of Object.entries(n))if(o&&Wa(o))e[`sentry.browser.measure.detail.${i}`]=o;else if(o!==void 0)try{e[`sentry.browser.measure.detail.${i}`]=JSON.stringify(o)}catch{}return}if(Wa(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function F2(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(i=>{Hf(e,t,i,n)}),Hf(e,t,"secureConnection",n,"TLS/SSL"),Hf(e,t,"fetch",n,"cache"),Hf(e,t,"domainLookup",n,"DNS"),V2(e,t,n)}function Hf(e,t,n,i,o=n){const l=q2(n),u=t[l],f=t[`${n}Start`];!f||!u||Di(e,i+zt(f),i+zt(u),{op:`browser.${o}`,name:t.name,attributes:{[tn]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function q2(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function V2(e,t,n){const i=n+zt(t.requestStart),o=n+zt(t.responseEnd),l=n+zt(t.responseStart);t.responseEnd&&(Di(e,i,o,{op:"browser.request",name:t.name,attributes:{[tn]:"auto.ui.browser.metrics"}}),Di(e,l,o,{op:"browser.response",name:t.name,attributes:{[tn]:"auto.ui.browser.metrics"}}))}function $2(e,t,n,i,o,l,u){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const f=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(u?.includes(f))return;const h={[tn]:"auto.resource.browser.metrics"},p=Ao(n);p.protocol&&(h["url.scheme"]=p.protocol.split(":").pop()),p.host&&(h["server.address"]=p.host),h["url.same_origin"]=n.includes(Ve.location.origin),Y2(t,h,[["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"]]);const y={...h,...nR(t)},v=l+i,b=v+o;Di(e,v,b,{name:n.replace(Ve.location.origin,""),op:f,attributes:y})}function G2(e){const t=Ve.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),ag(n.rtt)&&(Pr["connection.rtt"]={value:n.rtt,unit:"millisecond"})),ag(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),ag(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function K2(e,t){Mn&&t.recordLcpOnPageloadSpan&&(Mn.element&&e.setAttribute("lcp.element",Rr(Mn.element)),Mn.id&&e.setAttribute("lcp.id",Mn.id),Mn.url&&e.setAttribute("lcp.url",Mn.url.trim().slice(0,200)),Mn.loadTime!=null&&e.setAttribute("lcp.loadTime",Mn.loadTime),Mn.renderTime!=null&&e.setAttribute("lcp.renderTime",Mn.renderTime),e.setAttribute("lcp.size",Mn.size)),Pd?.sources&&t.recordClsOnPageloadSpan&&Pd.sources.forEach((n,i)=>e.setAttribute(`cls.source.${i+1}`,Rr(n.node)))}function Y2(e,t,n){n.forEach(([i,o])=>{const l=e[i];l!=null&&(typeof l=="number"&&l<M2||typeof l=="string")&&(t[o]=l)})}function X2(e){const t=lu(!1);if(!t)return;const{responseStart:n,requestStart:i}=t;i<=n&&(e["ttfb.requestTime"]={value:n-i,unit:"millisecond"})}function Q2(){return du()&&rr()?sl("element",W2):()=>{}}const W2=({entries:e})=>{const t=In(),n=t?Sn(t):void 0,i=n?pt(n).description:gt().getScopeData().transactionName;e.forEach(o=>{const l=o;if(!l.identifier)return;const u=l.name,f=l.renderTime,h=l.loadTime,[p,y]=h?[zt(h),"load-time"]:f?[zt(f),"render-time"]:[Yt(),"entry-emission"],v=u==="image-paint"?zt(Math.max(0,(f??0)-(h??0))):0,b={[tn]:"auto.ui.browser.elementtiming",[Ls]:"ui.elementtiming",[es]:"component","sentry.span_start_time_source":y,"sentry.transaction_name":i,"element.id":l.id,"element.type":l.element?.tagName?.toLowerCase()||"unknown","element.size":l.naturalWidth&&l.naturalHeight?`${l.naturalWidth}x${l.naturalHeight}`:void 0,"element.render_time":f,"element.load_time":h,"element.url":l.url||void 0,"element.identifier":l.identifier,"element.paint_type":u};cC({name:`element[${l.identifier}]`,attributes:b,startTime:p,onlyIfParent:!0},x=>{x.end(p+v)})})},Z2=1e3;let s_,py,my;function J2(e){Ui("dom",e),Bi("dom",eL)}function eL(){if(!Ve.document)return;const e=Tr.bind(null,"dom"),t=i_(e,!0);Ve.document.addEventListener("click",t,!1),Ve.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const o=Ve[n]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(Zn(o,"addEventListener",function(l){return function(u,f,h){if(u==="click"||u=="keypress")try{const p=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},y=p[u]=p[u]||{refCount:0};if(!y.handler){const v=i_(e);y.handler=v,l.call(this,u,v,h)}y.refCount++}catch{}return l.call(this,u,f,h)}}),Zn(o,"removeEventListener",function(l){return function(u,f,h){if(u==="click"||u=="keypress")try{const p=this.__sentry_instrumentation_handlers__||{},y=p[u];y&&(y.refCount--,y.refCount<=0&&(l.call(this,u,y.handler,h),y.handler=void 0,delete p[u]),Object.keys(p).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return l.call(this,u,f,h)}}))})}function tL(e){if(e.type!==py)return!1;try{if(!e.target||e.target._sentryId!==my)return!1}catch{}return!0}function nL(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function i_(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const i=rL(n);if(nL(n.type,i))return;kn(n,"_sentryCaptured",!0),i&&!i._sentryId&&kn(i,"_sentryId",Cr());const o=n.type==="keypress"?"input":n.type;tL(n)||(e({event:n,name:o,global:t}),py=n.type,my=i?i._sentryId:void 0),clearTimeout(s_),s_=Ve.setTimeout(()=>{my=void 0,py=void 0},Z2)}}function rL(e){try{return e.target}catch{return null}}let Ff;function Sv(e){const t="history";Ui(t,e),Bi(t,sL)}function sL(){if(Ve.addEventListener("popstate",()=>{const t=Ve.location.href,n=Ff;if(Ff=t,n===t)return;Tr("history",{from:n,to:t})}),!_D())return;function e(t){return function(...n){const i=n.length>2?n[2]:void 0;if(i){const o=Ff,l=iL(String(i));if(Ff=l,o===l)return t.apply(this,n);Tr("history",{from:o,to:l})}return t.apply(this,n)}}Zn(Ve.history,"pushState",e),Zn(Ve.history,"replaceState",e)}function iL(e){try{return new URL(e,Ve.location.origin).toString()}catch{return e}}const gd={};function oL(e){const t=gd[e];if(t)return t;let n=Ve[e];if(cy(n))return gd[e]=n.bind(Ve);const i=Ve.document;if(i&&typeof i.createElement=="function")try{const o=i.createElement("iframe");o.hidden=!0,i.head.appendChild(o);const l=o.contentWindow;l?.[e]&&(n=l[e]),i.head.removeChild(o)}catch(o){ou&&ve.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,o)}return n&&(gd[e]=n.bind(Ve))}function aL(e){gd[e]=void 0}const Ua="__sentry_xhr_v3__";function rR(e){Ui("xhr",e),Bi("xhr",lL)}function lL(){if(!Ve.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,i){const o=new Error,l=Yt()*1e3,u=js(i[0])?i[0].toUpperCase():void 0,f=cL(i[1]);if(!u||!f)return t.apply(n,i);n[Ua]={method:u,url:f,request_headers:{}},u==="POST"&&f.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const h=()=>{const p=n[Ua];if(p&&n.readyState===4){try{p.status_code=n.status}catch{}const y={endTimestamp:Yt()*1e3,startTimestamp:l,xhr:n,virtualError:o};Tr("xhr",y)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(p,y,v){return h(),p.apply(y,v)}}):n.addEventListener("readystatechange",h),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(p,y,v){const[b,x]=v,E=y[Ua];return E&&js(b)&&js(x)&&(E.request_headers[b.toLowerCase()]=x),p.apply(y,v)}}),t.apply(n,i)}}),e.send=new Proxy(e.send,{apply(t,n,i){const o=n[Ua];if(!o)return t.apply(n,i);i[0]!==void 0&&(o.body=i[0]);const l={startTimestamp:Yt()*1e3,xhr:n};return Tr("xhr",l),t.apply(n,i)}})}function cL(e){if(js(e))return e;try{return e.toString()}catch{}}function uL(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return ou&&ve.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
|
|
21
|
+
`).reduce((n,i)=>{const[o,l]=i.split(": ");return l&&(n[o.toLowerCase()]=l),n},{}):{}}const lg=[],yd=new Map,La=new Map,fL=60;function dL(){if(du()&&rr()){const t=hL();return()=>{t()}}return()=>{}}const gy={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 hL(){return g2(pL)}const pL=({metric:e})=>{if(e.value==null)return;const t=zt(e.value);if(t>fL)return;const n=e.entries.find(E=>E.duration===e.value&&gy[E.name]);if(!n)return;const{interactionId:i}=n,o=gy[n.name],l=zt(rr()+n.startTime),u=In(),f=u?Sn(u):void 0,h=i!=null?yd.get(i):void 0,p=h?.span||f,y=p?pt(p).description:gt().getScopeData().transactionName,v=h?.elementName||Rr(n.target),b={[tn]:"auto.http.browser.inp",[Ls]:`ui.interaction.${o}`,[ml]:n.duration},x=xv({name:v,transaction:y,attributes:b,startTime:l});x&&(x.addEvent("inp",{[ru]:"millisecond",[su]:e.value}),x.end(l+t))};function mL(){const e=Object.keys(gy);ID()&&e.forEach(o=>{Ve.addEventListener(o,t,{capture:!0,passive:!0})});function t(o){const l=o.target;if(!l)return;const u=Rr(l),f=Math.round(o.timeStamp);if(La.set(f,u),La.size>50){const h=La.keys().next().value;h!==void 0&&La.delete(h)}}function n(o){const l=Math.round(o.startTime);let u=La.get(l);if(!u)for(let f=-5;f<=5;f++){const h=La.get(l+f);if(h){u=h;break}}return u||"<unknown>"}const i=({entries:o})=>{const l=In(),u=l&&Sn(l);o.forEach(f=>{if(!E2(f))return;const h=f.interactionId;if(h==null||yd.has(h))return;const p=f.target?Rr(f.target):n(f);if(lg.length>10){const y=lg.shift();yd.delete(y)}lg.push(h),yd.set(h,{span:u,elementName:p})})};sl("event",i),sl("first-input",i)}const gL=40;function yL(e,t=oL("fetch")){let n=0,i=0;async function o(l){const u=l.body.length;n+=u,i++;const f={body:l.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&i<15,...e.fetchOptions};try{const h=await t(e.url,f);return{statusCode:h.status,headers:{"x-sentry-rate-limits":h.headers.get("X-Sentry-Rate-Limits"),"retry-after":h.headers.get("Retry-After")}}}catch(h){throw aL("fetch"),h}finally{n-=u,i--}}return mI(e,o,dv(e.bufferSize||gL))}const Nr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,vL=30,bL=50;function yy(e,t,n,i){const o={filename:e,function:t==="<anonymous>"?Io:t,in_app:!0};return n!==void 0&&(o.lineno=n),i!==void 0&&(o.colno=i),o}const xL=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,SL=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,EL=/\((\S*)(?::(\d+))(?::(\d+))\)/,_L=/at (.+?) ?\(data:(.+?),/,wL=e=>{const t=e.match(_L);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=xL.exec(e);if(n){const[,o,l,u]=n;return yy(o,Io,+l,+u)}const i=SL.exec(e);if(i){if(i[2]&&i[2].indexOf("eval")===0){const f=EL.exec(i[2]);f&&(i[2]=f[1],i[3]=f[2],i[4]=f[3])}const[l,u]=sR(i[1]||Io,i[2]);return yy(u,l,i[3]?+i[3]:void 0,i[4]?+i[4]:void 0)}},TL=[vL,wL],CL=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,RL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,NL=e=>{const t=CL.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const l=RL.exec(t[3]);l&&(t[1]=t[1]||"eval",t[3]=l[1],t[4]=l[2],t[5]="")}let i=t[3],o=t[1]||Io;return[o,i]=sR(o,i),yy(i,o,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},jL=[bL,NL],ML=[TL,jL],AL=AT(...ML),sR=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,i=e.indexOf("safari-web-extension")!==-1;return n||i?[e.indexOf("@")!==-1?e.split("@")[0]:Io,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},qf=1024,OL="Breadcrumbs",kL=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:OL,setup(n){t.console&&ZI(PL(n)),t.dom&&J2(LL(n,t.dom)),t.xhr&&rR(zL(n)),t.fetch&&PC(UL(n)),t.history&&Sv(BL(n)),t.sentry&&n.on("beforeSendEvent",DL(n))}}}),IL=kL;function DL(e){return function(n){mt()===e&&Do({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Eo(n)},{event:n})}}function LL(e,t){return function(i){if(mt()!==e)return;let o,l,u=typeof t=="object"?t.serializeAttribute:void 0,f=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;f&&f>qf&&(Nr&&ve.warn(`\`dom.maxStringLength\` cannot exceed ${qf}, but a value of ${f} was configured. Sentry will use ${qf} instead.`),f=qf),typeof u=="string"&&(u=[u]);try{const p=i.event,y=HL(p)?p.target:p;o=Rr(y,{keyAttrs:u,maxStringLength:f}),l=zT(y)}catch{o="<unknown>"}if(o.length===0)return;const h={category:`ui.${i.name}`,message:o};l&&(h.data={"ui.component_name":l}),Do(h,{event:i.event,name:i.name,global:i.global})}}function PL(e){return function(n){if(mt()!==e)return;const i={category:"console",data:{arguments:n.args,logger:"console"},level:eD(n.level),message:pE(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)i.message=`Assertion failed: ${pE(n.args.slice(1)," ")||"console.assert"}`,i.data.arguments=n.args.slice(1);else return;Do(i,{input:n.args,level:n.level})}}function zL(e){return function(n){if(mt()!==e)return;const{startTimestamp:i,endTimestamp:o}=n,l=n.xhr[Ua];if(!i||!o||!l)return;const{method:u,url:f,status_code:h,body:p}=l,y={method:u,url:f,status_code:h},v={xhr:n.xhr,input:p,startTimestamp:i,endTimestamp:o},b={category:"xhr",data:y,type:"http",level:LC(h)};e.emit("beforeOutgoingRequestBreadcrumb",b,v),Do(b,v)}}function UL(e){return function(n){if(mt()!==e)return;const{startTimestamp:i,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.fetchData.method,n.fetchData.url,n.error){const l=n.fetchData,u={data:n.error,input:n.args,startTimestamp:i,endTimestamp:o},f={category:"fetch",data:l,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",f,u),Do(f,u)}else{const l=n.response,u={...n.fetchData,status_code:l?.status};n.fetchData.request_body_size,n.fetchData.response_body_size,l?.status;const f={input:n.args,response:l,startTimestamp:i,endTimestamp:o},h={category:"fetch",data:u,type:"http",level:LC(u.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",h,f),Do(h,f)}}}function BL(e){return function(n){if(mt()!==e)return;let i=n.from,o=n.to;const l=Ao(tt.location.href);let u=i?Ao(i):void 0;const f=Ao(o);u?.path||(u=l),l.protocol===f.protocol&&l.host===f.host&&(o=f.relative),l.protocol===u.protocol&&l.host===u.host&&(i=u.relative),Do({category:"navigation",data:{from:i,to:o}})}}function HL(e){return!!e&&!!e.target}const FL=["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"],qL="BrowserApiErrors",VL=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:qL,setupOnce(){t.setTimeout&&Zn(tt,"setTimeout",o_),t.setInterval&&Zn(tt,"setInterval",o_),t.requestAnimationFrame&&Zn(tt,"requestAnimationFrame",GL),t.XMLHttpRequest&&"XMLHttpRequest"in tt&&Zn(XMLHttpRequest.prototype,"send",KL);const n=t.eventTarget;n&&(Array.isArray(n)?n:FL).forEach(o=>YL(o,t))}}}),$L=VL;function o_(e){return function(...t){const n=t[0];return t[0]=rl(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Os(e)}`}}),e.apply(this,t)}}function GL(e){return function(t){return e.apply(this,[rl(t,{mechanism:{data:{handler:Os(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function KL(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&Zn(n,o,function(l){const u={mechanism:{data:{handler:Os(l)},handled:!1,type:`auto.browser.browserapierrors.xhr.${o}`}},f=Wy(l);return f&&(u.mechanism.data.handler=Os(f)),rl(l,u)})}),e.apply(this,t)}}function YL(e,t){const i=tt[e]?.prototype;i?.hasOwnProperty?.("addEventListener")&&(Zn(i,"addEventListener",function(o){return function(l,u,f){try{XL(u)&&(u.handleEvent=rl(u.handleEvent,{mechanism:{data:{handler:Os(u),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&QL(this,l,u),o.apply(this,[l,rl(u,{mechanism:{data:{handler:Os(u),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),f])}}),Zn(i,"removeEventListener",function(o){return function(l,u,f){try{const h=u.__sentry_wrapped__;h&&o.call(this,l,h,f)}catch{}return o.call(this,l,u,f)}}))}function XL(e){return typeof e.handleEvent=="function"}function QL(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const WL=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof tt.document>"u"){Nr&&ve.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}DE({ignoreDuration:!0}),tg();const n=jr();let i=n.getUser();n.addScopeListener(o=>{const l=o.getUser();(i?.id!==l?.id||i?.ip_address!==l?.ip_address)&&(tg(),i=l)}),t==="route"&&Sv(({from:o,to:l})=>{o!==l&&(DE({ignoreDuration:!0}),tg())})}}},ZL="CultureContext",JL=(()=>({name:ZL,preprocessEvent(e){const t=tP();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})}})),eP=JL;function tP(){try{const e=tt.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const nP="GlobalHandlers",rP=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:nP,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(iP(n),a_("onerror")),t.onunhandledrejection&&(oP(n),a_("onunhandledrejection"))}}}),sP=rP;function iP(e){kT(t=>{const{stackParser:n,attachStacktrace:i}=iR();if(mt()!==e||UC())return;const{msg:o,url:l,line:u,column:f,error:h}=t,p=cP(yv(n,h||o,void 0,i,!1),l,u,f);p.level="error",mC(p,{originalException:h,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function oP(e){IT(t=>{const{stackParser:n,attachStacktrace:i}=iR();if(mt()!==e||UC())return;const o=aP(t),l=Wa(o)?lP(o):yv(n,o,void 0,i,!0);l.level="error",mC(l,{originalException:o,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function aP(e){if(Wa(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 lP(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function cP(e,t,n,i){const o=e.exception=e.exception||{},l=o.values=o.values||[],u=l[0]=l[0]||{},f=u.stacktrace=u.stacktrace||{},h=f.frames=f.frames||[],p=i,y=n,v=uP(t)??Zc();return h.length===0&&h.push({colno:p,filename:v,function:Io,in_app:!0,lineno:y}),e}function a_(e){Nr&&ve.log(`Global Handler attached: ${e}`)}function iR(){return mt()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function uP(e){if(!(!js(e)||e.length===0))return e.startsWith("data:")?`<${Ri(e,!1)}>`:e}const fP=()=>({name:"HttpContext",preprocessEvent(e){if(!tt.navigator&&!tt.location&&!tt.document)return;const t=pv(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}}),dP="cause",hP=5,pP="LinkedErrors",mP=((e={})=>{const t=e.limit||hP,n=e.key||dP;return{name:pP,preprocessEvent(i,o,l){const u=l.getOptions();WI(mv,u.stackParser,n,t,i,o)}}}),gP=mP;function yP(){return vP()?(Nr&&Fo(()=>{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 vP(){if(typeof tt.window>"u")return!1;const e=tt;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=Zc(),i=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(tt===tt.top&&i.some(l=>n.startsWith(`${l}://`)))}function bP(e){return[qI(),UI(),cD(),$L(),IL(),sP(),gP(),rD(),fP(),eP(),WL()]}function xP(e={}){const t=!e.skipBrowserExtensionCheck&&yP();let n=e.defaultIntegrations==null?bP():e.defaultIntegrations;const i={...e,enabled:t?!1:e.enabled,stackParser:BA(e.stackParser||AL),integrations:Gk({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||yL};return CI(YD,i)}function SP(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function oR(e){try{return new URL(e,tt.location.origin).href}catch{return}}function EP(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function aR(e){try{return new Headers(e)}catch{return}}const l_=new WeakMap,cg=new Map,lR={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function _P(e,t){const{traceFetch:n,traceXHR:i,trackFetchStreamPerformance:o,shouldCreateSpanForRequest:l,enableHTTPTimings:u,tracePropagationTargets:f,onRequestSpanStart:h,onRequestSpanEnd:p}={...lR,...t},y=typeof l=="function"?l:E=>!0,v=E=>wP(E,f),b={},x=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(E=>(E.type==="transaction"&&E.spans&&E.spans.forEach(_=>{if(_.op==="http.client"){const T=cg.get(_.span_id);T&&(_.timestamp=T/1e3,cg.delete(_.span_id))}}),E)),o&&CD(E=>{if(E.response){const _=l_.get(E.response);_&&E.endTimestamp&&cg.set(_,E.endTimestamp)}}),PC(E=>{const _=uD(E,y,v,b,{propagateTraceparent:x,onRequestSpanEnd:p});if(E.response&&E.fetchData.__span&&l_.set(E.response,E.fetchData.__span),_){const T=oR(E.fetchData.url),C=T?Ao(T).host:void 0;_.setAttributes({"http.url":T?Ri(T):void 0,"server.address":C}),u&&c_(_),h?.(_,{headers:E.headers})}})),i&&rR(E=>{const _=TP(E,y,v,b,x,p);_&&(u&&c_(_),h?.(_,{headers:aR(E.xhr.__sentry_xhr_v3__?.request_headers)}))})}function c_(e){const{url:t}=pt(e).data;if(!t||typeof t!="string")return;const n=sl("resource",({entries:i})=>{i.forEach(o=>{EP(o)&&o.name.endsWith(t)&&(e.setAttributes(nR(o)),setTimeout(n))})})}function wP(e,t){const n=Zc();if(n){let i,o;try{i=new URL(e,n),o=new URL(n).origin}catch{return!1}const l=i.origin===o;return t?Ci(i.toString(),t)||l&&Ci(i.pathname,t):l}else{const i=!!e.match(/^\/(?!\/)/);return t?Ci(e,t):i}}function TP(e,t,n,i,o,l){const u=e.xhr,f=u?.[Ua];if(!u||u.__sentry_own_request__||!f)return;const{url:h,method:p}=f,y=Ur()&&t(h);if(e.endTimestamp){const C=u.__sentry_xhr_span_id__;if(!C)return;const M=i[C];M&&(y&&f.status_code!==void 0&&($T(M,f.status_code),M.end(),l?.(M,{headers:aR(uL(u)),error:e.error})),delete i[C]);return}const v=oR(h),b=Ao(v||h),x=Ri(MI(h)),E=!!In(),_=y&&E?yl({name:`${p} ${x}`,attributes:{url:Ri(h),type:"xhr","http.method":p,"http.url":v?Ri(v):void 0,"server.address":b?.host,[tn]:"auto.http.browser",[Ls]:"http.client",...b?.search&&{"http.query":b?.search},...b?.hash&&{"http.fragment":b?.hash}}}):new Ii;u.__sentry_xhr_span_id__=_.spanContext().spanId,i[u.__sentry_xhr_span_id__]=_,n(h)&&CP(u,Ur()&&E?_:void 0,o);const T=mt();return T&&T.emit("beforeOutgoingRequestSpan",_,e),_}function CP(e,t,n){const{"sentry-trace":i,baggage:o,traceparent:l}=OC({span:t,propagateTraceparent:n});i&&RP(e,i,o,l)}function RP(e,t,n,i){const o=e.__sentry_xhr_v3__?.request_headers;if(!(o?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),i&&!o?.traceparent&&e.setRequestHeader("traceparent",i),n){const l=o?.baggage;(!l||!SP(l))&&e.setRequestHeader("baggage",n)}}catch{}}function NP(){tt.document?tt.document.addEventListener("visibilitychange",()=>{const e=In();if(!e)return;const t=Sn(e);if(tt.document.hidden&&t){const n="cancelled",{op:i,status:o}=pt(t);Nr&&ve.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${i}`),o||t.setStatus({code:Zt,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Nr&&ve.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const jP=3600,cR="sentry_previous_trace",MP="sentry.previous_trace";function AP(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const i=t==="session-storage";let o=i?IP():void 0;e.on("spanStart",u=>{if(Sn(u)!==u)return;const f=gt().getPropagationContext();o=OP(o,u,f),i&&kP(o)});let l=!0;n&&e.on("beforeSampling",u=>{if(!o)return;const f=gt(),h=f.getPropagationContext();if(l&&h.parentSpanId){l=!1;return}f.setPropagationContext({...h,dsc:{...h.dsc,sample_rate:String(o.sampleRate),sampled:String(vy(o.spanContext))},sampleRand:o.sampleRand}),u.parentSampled=vy(o.spanContext),u.parentSampleRate=o.sampleRate,u.spanAttributes={...u.spanAttributes,[VT]:o.sampleRate}})}function OP(e,t,n){const i=pt(t);function o(){try{return Number(n.dsc?.sample_rate)??Number(i.data?.[Zy])}catch{return 0}}const l={spanContext:t.spanContext(),startTimestamp:i.start_timestamp,sampleRate:o(),sampleRand:n.sampleRand};if(!e)return l;const u=e.spanContext;return u.traceId===i.trace_id?e:(Date.now()/1e3-e.startTimestamp<=jP&&(Nr&&ve.log(`Adding previous_trace \`${JSON.stringify(u)}\` link to span \`${JSON.stringify({op:i.op,...t.spanContext()})}\``),t.addLink({context:u,attributes:{[hO]:"previous_trace"}}),t.setAttribute(MP,`${u.traceId}-${u.spanId}-${vy(u)?1:0}`)),l)}function kP(e){try{tt.sessionStorage.setItem(cR,JSON.stringify(e))}catch(t){Nr&&ve.warn("Could not store previous trace in sessionStorage",t)}}function IP(){try{const e=tt.sessionStorage?.getItem(cR);return JSON.parse(e)}catch{return}}function vy(e){return e.traceFlags===1}const DP="BrowserTracing",LP={...dd,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,enableElementTiming:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...lR},PP=((e={})=>{const t={name:void 0,source:void 0},n=tt.document,{enableInp:i,enableElementTiming:o,enableLongTask:l,enableLongAnimationFrame:u,_experiments:{enableInteractions:f,enableStandaloneClsSpans:h,enableStandaloneLcpSpans:p},beforeStartSpan:y,idleTimeout:v,finalTimeout:b,childSpanTimeout:x,markBackgroundSpan:E,traceFetch:_,traceXHR:T,trackFetchStreamPerformance:C,shouldCreateSpanForRequest:M,enableHTTPTimings:R,ignoreResourceSpans:N,ignorePerformanceApiSpans:k,instrumentPageLoad:z,instrumentNavigation:j,detectRedirects:A,linkPreviousTrace:D,consistentTraceSampling:G,enableReportPageLoaded:F,onRequestSpanStart:P,onRequestSpanEnd:Q}={...LP,...e};let X,te,L;function $(H,V,U=!0){const I=V.op==="pageload",K=V.name,Z=y?y(V):V,W=Z.attributes||{};if(K!==Z.name&&(W[es]="custom",Z.attributes=W),!U){const he=qo();yl({...Z,startTime:he}).end(he);return}t.name=Z.name,t.source=W[es];const se=hC(Z,{idleTimeout:v,finalTimeout:b,childSpanTimeout:x,disableAutoFinish:I,beforeSpanEnd:he=>{X?.(),z2(he,{recordClsOnPageloadSpan:!h,recordLcpOnPageloadSpan:!p,ignoreResourceSpans:N,ignorePerformanceApiSpans:k}),d_(H,void 0);const xe=gt(),de=xe.getPropagationContext();xe.setPropagationContext({...de,traceId:se.spanContext().traceId,sampled:Hi(se),dsc:Ps(he)}),I&&(L=void 0)},trimIdleSpanEndTimestamp:!F});I&&F&&(L=se),d_(H,se);function ie(){n&&["interactive","complete"].includes(n.readyState)&&H.emit("idleSpanEnableAutoFinish",se)}I&&!F&&n&&(n.addEventListener("readystatechange",()=>{ie()}),ie())}return{name:DP,setup(H){if(FO(),X=A2({recordClsStandaloneSpans:h||!1,recordLcpStandaloneSpans:p||!1,client:H}),i&&dL(),o&&Q2(),u&&it.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?k2():l&&O2(),f&&I2(),A&&n){const U=()=>{te=Yt()};addEventListener("click",U,{capture:!0}),addEventListener("keydown",U,{capture:!0,passive:!0})}function V(){const U=qc(H);U&&!pt(U).timestamp&&(Nr&&ve.log(`[Tracing] Finishing current active span with op: ${pt(U).op}`),U.setAttribute(Uc,"cancelled"),U.end())}H.on("startNavigationSpan",(U,I)=>{if(mt()!==H)return;if(I?.isRedirect){Nr&&ve.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),$(H,{op:"navigation.redirect",...U},!1);return}te=void 0,V(),jr().setPropagationContext({traceId:Is(),sampleRand:Math.random(),propagationSpanId:Ur()?void 0:Ms()});const K=gt();K.setPropagationContext({traceId:Is(),sampleRand:Math.random(),propagationSpanId:Ur()?void 0:Ms()}),K.setSDKProcessingMetadata({normalizedRequest:void 0}),$(H,{op:"navigation",...U,parentSpan:null,forceTransaction:!0})}),H.on("startPageLoadSpan",(U,I={})=>{if(mt()!==H)return;V();const K=I.sentryTrace||u_("sentry-trace")||f_("sentry-trace"),Z=I.baggage||u_("baggage")||f_("baggage"),W=IO(K,Z),se=gt();se.setPropagationContext(W),Ur()||(se.getPropagationContext().propagationSpanId=Ms()),se.setSDKProcessingMetadata({normalizedRequest:pv()}),$(H,{op:"pageload",...U})}),H.on("endPageloadSpan",()=>{F&&L&&(L.setAttribute(Uc,"reportPageLoaded"),L.end())})},afterAllSetup(H){let V=Zc();if(D!=="off"&&AP(H,{linkPreviousTrace:D,consistentTraceSampling:G}),tt.location){if(z){const U=rr();zP(H,{name:tt.location.pathname,startTime:U?U/1e3:void 0,attributes:{[es]:"url",[tn]:"auto.pageload.browser"}})}j&&Sv(({to:U,from:I})=>{if(I===void 0&&V?.indexOf(U)!==-1){V=void 0;return}V=void 0;const K=MC(U),Z=qc(H),W=Z&&A&&HP(Z,te);UP(H,{name:K?.pathname||tt.location.pathname,attributes:{[es]:"url",[tn]:"auto.navigation.browser"}},{url:U,isRedirect:W})})}E&&NP(),f&&BP(H,v,b,x,t),i&&mL(),_P(H,{traceFetch:_,traceXHR:T,trackFetchStreamPerformance:C,tracePropagationTargets:H.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:M,enableHTTPTimings:R,onRequestSpanStart:P,onRequestSpanEnd:Q})}}});function zP(e,t,n){e.emit("startPageLoadSpan",t,n),gt().setTransactionName(t.name);const i=qc(e);return i&&e.emit("afterStartPageLoadSpan",i),i}function UP(e,t,n){const{url:i,isRedirect:o}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:o}),e.emit("startNavigationSpan",t,{isRedirect:o});const l=gt();return l.setTransactionName(t.name),i&&!o&&l.setSDKProcessingMetadata({normalizedRequest:{...pv(),url:i}}),qc(e)}function u_(e){return tt.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function f_(e){return tt.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(i=>i.name===e)?.description}function BP(e,t,n,i,o){const l=tt.document;let u;const f=()=>{const h="ui.action.click",p=qc(e);if(p){const y=pt(p).op;if(["navigation","pageload"].includes(y)){Nr&&ve.warn(`[Tracing] Did not create ${h} span because a pageload or navigation span is in progress.`);return}}if(u&&(u.setAttribute(Uc,"interactionInterrupted"),u.end(),u=void 0),!o.name){Nr&&ve.warn(`[Tracing] Did not create ${h} transaction because _latestRouteName is missing.`);return}u=hC({name:o.name,op:h,attributes:{[es]:o.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:i})};l&&addEventListener("click",f,{capture:!0})}const uR="_sentry_idleSpan";function qc(e){return e[uR]}function d_(e,t){kn(e,uR,t)}const h_=1.5;function HP(e,t){const n=pt(e),i=qo(),o=n.start_timestamp;return!(i-o>h_||t&&i-t<=h_)}function fR(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ug={exports:{}},qe={};var p_;function FP(){if(p_)return qe;p_=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),b=Symbol.iterator;function x(I){return I===null||typeof I!="object"?null:(I=b&&I[b]||I["@@iterator"],typeof I=="function"?I:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,T={};function C(I,K,Z){this.props=I,this.context=K,this.refs=T,this.updater=Z||E}C.prototype.isReactComponent={},C.prototype.setState=function(I,K){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,K,"setState")},C.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function M(){}M.prototype=C.prototype;function R(I,K,Z){this.props=I,this.context=K,this.refs=T,this.updater=Z||E}var N=R.prototype=new M;N.constructor=R,_(N,C.prototype),N.isPureReactComponent=!0;var k=Array.isArray;function z(){}var j={H:null,A:null,T:null,S:null},A=Object.prototype.hasOwnProperty;function D(I,K,Z){var W=Z.ref;return{$$typeof:e,type:I,key:K,ref:W!==void 0?W:null,props:Z}}function G(I,K){return D(I.type,K,I.props)}function F(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function P(I){var K={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(Z){return K[Z]})}var Q=/\/+/g;function X(I,K){return typeof I=="object"&&I!==null&&I.key!=null?P(""+I.key):K.toString(36)}function te(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(z,z):(I.status="pending",I.then(function(K){I.status==="pending"&&(I.status="fulfilled",I.value=K)},function(K){I.status==="pending"&&(I.status="rejected",I.reason=K)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function L(I,K,Z,W,se){var ie=typeof I;(ie==="undefined"||ie==="boolean")&&(I=null);var he=!1;if(I===null)he=!0;else switch(ie){case"bigint":case"string":case"number":he=!0;break;case"object":switch(I.$$typeof){case e:case t:he=!0;break;case y:return he=I._init,L(he(I._payload),K,Z,W,se)}}if(he)return se=se(I),he=W===""?"."+X(I,0):W,k(se)?(Z="",he!=null&&(Z=he.replace(Q,"$&/")+"/"),L(se,K,Z,"",function(Be){return Be})):se!=null&&(F(se)&&(se=G(se,Z+(se.key==null||I&&I.key===se.key?"":(""+se.key).replace(Q,"$&/")+"/")+he)),K.push(se)),1;he=0;var xe=W===""?".":W+":";if(k(I))for(var de=0;de<I.length;de++)W=I[de],ie=xe+X(W,de),he+=L(W,K,Z,ie,se);else if(de=x(I),typeof de=="function")for(I=de.call(I),de=0;!(W=I.next()).done;)W=W.value,ie=xe+X(W,de++),he+=L(W,K,Z,ie,se);else if(ie==="object"){if(typeof I.then=="function")return L(te(I),K,Z,W,se);throw K=String(I),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return he}function $(I,K,Z){if(I==null)return I;var W=[],se=0;return L(I,W,"","",function(ie){return K.call(Z,ie,se++)}),W}function H(I){if(I._status===-1){var K=I._result;K=K(),K.then(function(Z){(I._status===0||I._status===-1)&&(I._status=1,I._result=Z)},function(Z){(I._status===0||I._status===-1)&&(I._status=2,I._result=Z)}),I._status===-1&&(I._status=0,I._result=K)}if(I._status===1)return I._result.default;throw I._result}var V=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},U={map:$,forEach:function(I,K,Z){$(I,function(){K.apply(this,arguments)},Z)},count:function(I){var K=0;return $(I,function(){K++}),K},toArray:function(I){return $(I,function(K){return K})||[]},only:function(I){if(!F(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return qe.Activity=v,qe.Children=U,qe.Component=C,qe.Fragment=n,qe.Profiler=o,qe.PureComponent=R,qe.StrictMode=i,qe.Suspense=h,qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,qe.__COMPILER_RUNTIME={__proto__:null,c:function(I){return j.H.useMemoCache(I)}},qe.cache=function(I){return function(){return I.apply(null,arguments)}},qe.cacheSignal=function(){return null},qe.cloneElement=function(I,K,Z){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var W=_({},I.props),se=I.key;if(K!=null)for(ie in K.key!==void 0&&(se=""+K.key),K)!A.call(K,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&K.ref===void 0||(W[ie]=K[ie]);var ie=arguments.length-2;if(ie===1)W.children=Z;else if(1<ie){for(var he=Array(ie),xe=0;xe<ie;xe++)he[xe]=arguments[xe+2];W.children=he}return D(I.type,se,W)},qe.createContext=function(I){return I={$$typeof:u,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:l,_context:I},I},qe.createElement=function(I,K,Z){var W,se={},ie=null;if(K!=null)for(W in K.key!==void 0&&(ie=""+K.key),K)A.call(K,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(se[W]=K[W]);var he=arguments.length-2;if(he===1)se.children=Z;else if(1<he){for(var xe=Array(he),de=0;de<he;de++)xe[de]=arguments[de+2];se.children=xe}if(I&&I.defaultProps)for(W in he=I.defaultProps,he)se[W]===void 0&&(se[W]=he[W]);return D(I,ie,se)},qe.createRef=function(){return{current:null}},qe.forwardRef=function(I){return{$$typeof:f,render:I}},qe.isValidElement=F,qe.lazy=function(I){return{$$typeof:y,_payload:{_status:-1,_result:I},_init:H}},qe.memo=function(I,K){return{$$typeof:p,type:I,compare:K===void 0?null:K}},qe.startTransition=function(I){var K=j.T,Z={};j.T=Z;try{var W=I(),se=j.S;se!==null&&se(Z,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(z,V)}catch(ie){V(ie)}finally{K!==null&&Z.types!==null&&(K.types=Z.types),j.T=K}},qe.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},qe.use=function(I){return j.H.use(I)},qe.useActionState=function(I,K,Z){return j.H.useActionState(I,K,Z)},qe.useCallback=function(I,K){return j.H.useCallback(I,K)},qe.useContext=function(I){return j.H.useContext(I)},qe.useDebugValue=function(){},qe.useDeferredValue=function(I,K){return j.H.useDeferredValue(I,K)},qe.useEffect=function(I,K){return j.H.useEffect(I,K)},qe.useEffectEvent=function(I){return j.H.useEffectEvent(I)},qe.useId=function(){return j.H.useId()},qe.useImperativeHandle=function(I,K,Z){return j.H.useImperativeHandle(I,K,Z)},qe.useInsertionEffect=function(I,K){return j.H.useInsertionEffect(I,K)},qe.useLayoutEffect=function(I,K){return j.H.useLayoutEffect(I,K)},qe.useMemo=function(I,K){return j.H.useMemo(I,K)},qe.useOptimistic=function(I,K){return j.H.useOptimistic(I,K)},qe.useReducer=function(I,K,Z){return j.H.useReducer(I,K,Z)},qe.useRef=function(I){return j.H.useRef(I)},qe.useState=function(I){return j.H.useState(I)},qe.useSyncExternalStore=function(I,K,Z){return j.H.useSyncExternalStore(I,K,Z)},qe.useTransition=function(){return j.H.useTransition()},qe.version="19.2.4",qe}var m_;function hu(){return m_||(m_=1,ug.exports=FP()),ug.exports}var S=hu();const il=fR(S),dR=OA({__proto__:null,default:il},[S]);function qP(e){const t={...e};return AC(t,"react"),zk("react",{version:S.version}),xP(t)}const VP={setAttribute(){},setAttributes(){},setStatus(){}};function $P(e){return e.level?e.level:e.error?"error":"info"}function fg(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 GP(e){return{setAttribute(t,n){e.setAttribute?.(t,n)},setAttributes(t){if(e.setAttributes){e.setAttributes(t);return}for(const[n,i]of Object.entries(t))e.setAttribute?.(n,i)},setStatus(t){e.setStatus?.(t)}}}function KP(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"){const 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 g_(e){const t={};for(const[n,i]of Object.entries(e)){const o=KP(i);o!==void 0&&(t[n]=o)}return Object.keys(t).length>0?t:null}function YP(e){return{startSpan(t,n){return e.startSpan?e.startSpan(t,i=>n(GP(i))):n(VP)}}}function XP(e){return{count(t,n,i){e.metrics?.count?.(t,n??1,i)},gauge(t,n,i){e.metrics?.gauge?.(t,n,i)},distribution(t,n,i){e.metrics?.distribution?.(t,n,i)}}}function QP(e){return{log(t){const n=$P(t),{event:i,...o}=t,l=fg(e.logger,n);if(!l)return;const u=g_(o);if(!u){l(i);return}l(i,u)},tracer:YP(e),metrics:XP(e),captureException(t,n){if(e.captureException?.(t),!n)return;const i=fg(e.logger,"error")??fg(e.logger,"info");if(!i)return;const o=g_(n);if(!o){i("sync.exception.context");return}i("sync.exception.context",o)}}}function WP(e){if(e?.attributes)return{attributes:e.attributes}}function y_(e){if(!e)return;const t=!!e.attributes,n=!!e.unit;if(!(!t&&!n))return{attributes:e.attributes,unit:e.unit}}function ZP(){return QP({logger:ED,startSpan(e,t){return cC(e,n=>t({setAttribute(i,o){n.setAttribute(i,o)},setAttributes(i){n.setAttributes(i)},setStatus(i){n.setStatus({code:i==="ok"?1:2})}}))},metrics:{count(e,t,n){const i=WP(n);if(i){JE(e,t,i);return}JE(e,t)},gauge(e,t,n){const i=y_(n);if(i){e_(e,t,i);return}e_(e,t)},distribution(e,t,n){const i=y_(n);if(i){t_(e,t,i);return}t_(e,t)}},captureException(e){pC(e)}})}function JP(){return ZP()}function e5(e){const t=t5(e);return qP(t),JP()}function t5(e){const t=e.integrations;if(typeof t=="function")return e;const n=t??[];return n.some(o=>o.name==="BrowserTracing")?e:{...e,integrations:[PP(),...n]}}var dg={exports:{}},Sc={};var v_;function n5(){if(v_)return Sc;v_=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(i,o,l){var u=null;if(l!==void 0&&(u=""+l),o.key!==void 0&&(u=""+o.key),"key"in o){l={};for(var f in o)f!=="key"&&(l[f]=o[f])}else l=o;return o=l.ref,{$$typeof:e,type:i,key:u,ref:o!==void 0?o:null,props:l}}return Sc.Fragment=t,Sc.jsx=n,Sc.jsxs=n,Sc}var b_;function r5(){return b_||(b_=1,dg.exports=n5()),dg.exports}var d=r5(),hg={exports:{}},Ec={},pg={exports:{}},mg={};var x_;function s5(){return x_||(x_=1,(function(e){function t(L,$){var H=L.length;L.push($);e:for(;0<H;){var V=H-1>>>1,U=L[V];if(0<o(U,$))L[V]=$,L[H]=U,H=V;else break e}}function n(L){return L.length===0?null:L[0]}function i(L){if(L.length===0)return null;var $=L[0],H=L.pop();if(H!==$){L[0]=H;e:for(var V=0,U=L.length,I=U>>>1;V<I;){var K=2*(V+1)-1,Z=L[K],W=K+1,se=L[W];if(0>o(Z,H))W<U&&0>o(se,Z)?(L[V]=se,L[W]=H,V=W):(L[V]=Z,L[K]=H,V=K);else if(W<U&&0>o(se,H))L[V]=se,L[W]=H,V=W;else break e}}return $}function o(L,$){var H=L.sortIndex-$.sortIndex;return H!==0?H:L.id-$.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],p=[],y=1,v=null,b=3,x=!1,E=!1,_=!1,T=!1,C=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function N(L){for(var $=n(p);$!==null;){if($.callback===null)i(p);else if($.startTime<=L)i(p),$.sortIndex=$.expirationTime,t(h,$);else break;$=n(p)}}function k(L){if(_=!1,N(L),!E)if(n(h)!==null)E=!0,z||(z=!0,P());else{var $=n(p);$!==null&&te(k,$.startTime-L)}}var z=!1,j=-1,A=5,D=-1;function G(){return T?!0:!(e.unstable_now()-D<A)}function F(){if(T=!1,z){var L=e.unstable_now();D=L;var $=!0;try{e:{E=!1,_&&(_=!1,M(j),j=-1),x=!0;var H=b;try{t:{for(N(L),v=n(h);v!==null&&!(v.expirationTime>L&&G());){var V=v.callback;if(typeof V=="function"){v.callback=null,b=v.priorityLevel;var U=V(v.expirationTime<=L);if(L=e.unstable_now(),typeof U=="function"){v.callback=U,N(L),$=!0;break t}v===n(h)&&i(h),N(L)}else i(h);v=n(h)}if(v!==null)$=!0;else{var I=n(p);I!==null&&te(k,I.startTime-L),$=!1}}break e}finally{v=null,b=H,x=!1}$=void 0}}finally{$?P():z=!1}}}var P;if(typeof R=="function")P=function(){R(F)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,X=Q.port2;Q.port1.onmessage=F,P=function(){X.postMessage(null)}}else P=function(){C(F,0)};function te(L,$){j=C(function(){L(e.unstable_now())},$)}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(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):A=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(L){switch(b){case 1:case 2:case 3:var $=3;break;default:$=b}var H=b;b=$;try{return L()}finally{b=H}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(L,$){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var H=b;b=L;try{return $()}finally{b=H}},e.unstable_scheduleCallback=function(L,$,H){var V=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?V+H:V):H=V,L){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=H+U,L={id:y++,callback:$,priorityLevel:L,startTime:H,expirationTime:U,sortIndex:-1},H>V?(L.sortIndex=H,t(p,L),n(h)===null&&L===n(p)&&(_?(M(j),j=-1):_=!0,te(k,H-V))):(L.sortIndex=U,t(h,L),E||x||(E=!0,z||(z=!0,P()))),L},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(L){var $=b;return function(){var H=b;b=$;try{return L.apply(this,arguments)}finally{b=H}}}})(mg)),mg}var S_;function i5(){return S_||(S_=1,pg.exports=s5()),pg.exports}var gg={exports:{}},hn={};var E_;function o5(){if(E_)return hn;E_=1;var e=hu();function t(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(h,p,y){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:v==null?null:""+v,children:h,containerInfo:p,implementation:y}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,hn.createPortal=function(h,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return l(h,p,null,y)},hn.flushSync=function(h){var p=u.T,y=i.p;try{if(u.T=null,i.p=2,h)return h()}finally{u.T=p,i.p=y,i.d.f()}},hn.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,i.d.C(h,p))},hn.prefetchDNS=function(h){typeof h=="string"&&i.d.D(h)},hn.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var y=p.as,v=f(y,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,x=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?i.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:b,fetchPriority:x}):y==="script"&&i.d.X(h,{crossOrigin:v,integrity:b,fetchPriority:x,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},hn.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=f(p.as,p.crossOrigin);i.d.M(h,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&i.d.M(h)},hn.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,v=f(y,p.crossOrigin);i.d.L(h,y,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},hn.preloadModule=function(h,p){if(typeof h=="string")if(p){var y=f(p.as,p.crossOrigin);i.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else i.d.m(h)},hn.requestFormReset=function(h){i.d.r(h)},hn.unstable_batchedUpdates=function(h,p){return h(p)},hn.useFormState=function(h,p,y){return u.H.useFormState(h,p,y)},hn.useFormStatus=function(){return u.H.useHostTransitionStatus()},hn.version="19.2.4",hn}var __;function hR(){if(__)return gg.exports;__=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),gg.exports=o5(),gg.exports}var w_;function a5(){if(w_)return Ec;w_=1;var e=i5(),t=hu(),n=hR();function i(r){var s="https://react.dev/errors/"+r;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)s+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function l(r){var s=r,a=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(a=s.return),r=s.return;while(r)}return s.tag===3?a:null}function u(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function f(r){if(r.tag===31){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function h(r){if(l(r)!==r)throw Error(i(188))}function p(r){var s=r.alternate;if(!s){if(s=l(r),s===null)throw Error(i(188));return s!==r?null:r}for(var a=r,c=s;;){var m=a.return;if(m===null)break;var g=m.alternate;if(g===null){if(c=m.return,c!==null){a=c;continue}break}if(m.child===g.child){for(g=m.child;g;){if(g===a)return h(m),r;if(g===c)return h(m),s;g=g.sibling}throw Error(i(188))}if(a.return!==c.return)a=m,c=g;else{for(var w=!1,O=m.child;O;){if(O===a){w=!0,a=m,c=g;break}if(O===c){w=!0,c=m,a=g;break}O=O.sibling}if(!w){for(O=g.child;O;){if(O===a){w=!0,a=g,c=m;break}if(O===c){w=!0,c=g,a=m;break}O=O.sibling}if(!w)throw Error(i(189))}}if(a.alternate!==c)throw Error(i(190))}if(a.tag!==3)throw Error(i(188));return a.stateNode.current===a?r:s}function y(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r;for(r=r.child;r!==null;){if(s=y(r),s!==null)return s;r=r.sibling}return null}var v=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),R=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),G=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function P(r){return r===null||typeof r!="object"?null:(r=F&&r[F]||r["@@iterator"],typeof r=="function"?r:null)}var Q=Symbol.for("react.client.reference");function X(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===Q?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case _:return"Fragment";case C:return"Profiler";case T:return"StrictMode";case k:return"Suspense";case z:return"SuspenseList";case D:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case E:return"Portal";case R:return r.displayName||"Context";case M:return(r._context.displayName||"Context")+".Consumer";case N:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case j:return s=r.displayName||null,s!==null?s:X(r.type)||"Memo";case A:s=r._payload,r=r._init;try{return X(r(s))}catch{}}return null}var te=Array.isArray,L=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},V=[],U=-1;function I(r){return{current:r}}function K(r){0>U||(r.current=V[U],V[U]=null,U--)}function Z(r,s){U++,V[U]=r.current,r.current=s}var W=I(null),se=I(null),ie=I(null),he=I(null);function xe(r,s){switch(Z(ie,s),Z(se,r),Z(W,null),s.nodeType){case 9:case 11:r=(r=s.documentElement)&&(r=r.namespaceURI)?MS(r):0;break;default:if(r=s.tagName,s=s.namespaceURI)s=MS(s),r=AS(s,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}K(W),Z(W,r)}function de(){K(W),K(se),K(ie)}function Be(r){r.memoizedState!==null&&Z(he,r);var s=W.current,a=AS(s,r.type);s!==a&&(Z(se,r),Z(W,a))}function _e(r){se.current===r&&(K(W),K(se)),he.current===r&&(K(he),gc._currentValue=H)}var re,fe;function ae(r){if(re===void 0)try{throw Error()}catch(a){var s=a.stack.trim().match(/\n( *(at )?)/);re=s&&s[1]||"",fe=-1<a.stack.indexOf(`
|
|
22
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
23
|
+
`+re+r+fe}var Se=!1;function ye(r,s){if(!r||Se)return"";Se=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(s){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(oe){var ne=oe}Reflect.construct(r,[],ue)}else{try{ue.call()}catch(oe){ne=oe}r.call(ue.prototype)}}else{try{throw Error()}catch(oe){ne=oe}(ue=r())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(oe){if(oe&&ne&&typeof oe.stack=="string")return[oe.stack,ne.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=c.DetermineComponentFrameRoot(),w=g[0],O=g[1];if(w&&O){var B=w.split(`
|
|
24
|
+
`),ee=O.split(`
|
|
25
|
+
`);for(m=c=0;c<B.length&&!B[c].includes("DetermineComponentFrameRoot");)c++;for(;m<ee.length&&!ee[m].includes("DetermineComponentFrameRoot");)m++;if(c===B.length||m===ee.length)for(c=B.length-1,m=ee.length-1;1<=c&&0<=m&&B[c]!==ee[m];)m--;for(;1<=c&&0<=m;c--,m--)if(B[c]!==ee[m]){if(c!==1||m!==1)do if(c--,m--,0>m||B[c]!==ee[m]){var le=`
|
|
26
|
+
`+B[c].replace(" at new "," at ");return r.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",r.displayName)),le}while(1<=c&&0<=m);break}}}finally{Se=!1,Error.prepareStackTrace=a}return(a=r?r.displayName||r.name:"")?ae(a):""}function be(r,s){switch(r.tag){case 26:case 27:case 5:return ae(r.type);case 16:return ae("Lazy");case 13:return r.child!==s&&s!==null?ae("Suspense Fallback"):ae("Suspense");case 19:return ae("SuspenseList");case 0:case 15:return ye(r.type,!1);case 11:return ye(r.type.render,!1);case 1:return ye(r.type,!0);case 31:return ae("Activity");default:return""}}function ge(r){try{var s="",a=null;do s+=be(r,a),a=r,r=r.return;while(r);return s}catch(c){return`
|
|
27
|
+
Error generating stack: `+c.message+`
|
|
28
|
+
`+c.stack}}var Le=Object.prototype.hasOwnProperty,Oe=e.unstable_scheduleCallback,Ee=e.unstable_cancelCallback,Fe=e.unstable_shouldYield,Ke=e.unstable_requestPaint,ze=e.unstable_now,Xe=e.unstable_getCurrentPriorityLevel,Ue=e.unstable_ImmediatePriority,pe=e.unstable_UserBlockingPriority,we=e.unstable_NormalPriority,He=e.unstable_LowPriority,dt=e.unstable_IdlePriority,ot=e.log,or=e.unstable_setDisableYieldValue,ar=null,Ut=null;function at(r){if(typeof ot=="function"&&or(r),Ut&&typeof Ut.setStrictMode=="function")try{Ut.setStrictMode(ar,r)}catch{}}var yt=Math.clz32?Math.clz32:rn,nt=Math.log,Bt=Math.LN2;function rn(r){return r>>>=0,r===0?32:31-(nt(r)/Bt|0)|0}var Ct=256,dn=262144,Ln=4194304;function gn(r){var s=r&42;if(s!==0)return s;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function qr(r,s,a){var c=r.pendingLanes;if(c===0)return 0;var m=0,g=r.suspendedLanes,w=r.pingedLanes;r=r.warmLanes;var O=c&134217727;return O!==0?(c=O&~g,c!==0?m=gn(c):(w&=O,w!==0?m=gn(w):a||(a=O&~r,a!==0&&(m=gn(a))))):(O=c&~g,O!==0?m=gn(O):w!==0?m=gn(w):a||(a=c&~r,a!==0&&(m=gn(a)))),m===0?0:s!==0&&s!==m&&(s&g)===0&&(g=m&-m,a=s&-s,g>=a||g===32&&(a&4194048)!==0)?s:m}function Vr(r,s){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&s)===0}function Qo(r,s){switch(r){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 Wi(){var r=Ln;return Ln<<=1,(Ln&62914560)===0&&(Ln=4194304),r}function Zi(r){for(var s=[],a=0;31>a;a++)s.push(r);return s}function is(r,s){r.pendingLanes|=s,s!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Pn(r,s,a,c,m,g){var w=r.pendingLanes;r.pendingLanes=a,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=a,r.entangledLanes&=a,r.errorRecoveryDisabledLanes&=a,r.shellSuspendCounter=0;var O=r.entanglements,B=r.expirationTimes,ee=r.hiddenUpdates;for(a=w&~a;0<a;){var le=31-yt(a),ue=1<<le;O[le]=0,B[le]=-1;var ne=ee[le];if(ne!==null)for(ee[le]=null,le=0;le<ne.length;le++){var oe=ne[le];oe!==null&&(oe.lane&=-536870913)}a&=~ue}c!==0&&$r(r,c,0),g!==0&&m===0&&r.tag!==0&&(r.suspendedLanes|=g&~(w&~s))}function $r(r,s,a){r.pendingLanes|=s,r.suspendedLanes&=~s;var c=31-yt(s);r.entangledLanes|=s,r.entanglements[c]=r.entanglements[c]|1073741824|a&261930}function $s(r,s){var a=r.entangledLanes|=s;for(r=r.entanglements;a;){var c=31-yt(a),m=1<<c;m&s|r[c]&s&&(r[c]|=s),a&=~m}}function Gs(r,s){var a=s&-s;return a=(a&42)!==0?1:zn(a),(a&(r.suspendedLanes|s))!==0?0:a}function zn(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Ml(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function _u(){var r=$.p;return r!==0?r:(r=window.event,r===void 0?32:eE(r.type))}function wu(r,s){var a=$.p;try{return $.p=r,s()}finally{$.p=a}}var Ks=Math.random().toString(36).slice(2),an="__reactFiber$"+Ks,_n="__reactProps$"+Ks,Wo="__reactContainer$"+Ks,Bh="__reactEvents$"+Ks,Sj="__reactListeners$"+Ks,Ej="__reactHandles$"+Ks,yb="__reactResources$"+Ks,Al="__reactMarker$"+Ks;function Hh(r){delete r[an],delete r[_n],delete r[Bh],delete r[Sj],delete r[Ej]}function Zo(r){var s=r[an];if(s)return s;for(var a=r.parentNode;a;){if(s=a[Wo]||a[an]){if(a=s.alternate,s.child!==null||a!==null&&a.child!==null)for(r=zS(r);r!==null;){if(a=r[an])return a;r=zS(r)}return s}r=a,a=r.parentNode}return null}function Jo(r){if(r=r[an]||r[Wo]){var s=r.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return r}return null}function Ol(r){var s=r.tag;if(s===5||s===26||s===27||s===6)return r.stateNode;throw Error(i(33))}function ea(r){var s=r[yb];return s||(s=r[yb]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function sn(r){r[Al]=!0}var vb=new Set,bb={};function Ji(r,s){ta(r,s),ta(r+"Capture",s)}function ta(r,s){for(bb[r]=s,r=0;r<s.length;r++)vb.add(s[r])}var _j=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]*$"),xb={},Sb={};function wj(r){return Le.call(Sb,r)?!0:Le.call(xb,r)?!1:_j.test(r)?Sb[r]=!0:(xb[r]=!0,!1)}function Tu(r,s,a){if(wj(s))if(a===null)r.removeAttribute(s);else{switch(typeof a){case"undefined":case"function":case"symbol":r.removeAttribute(s);return;case"boolean":var c=s.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){r.removeAttribute(s);return}}r.setAttribute(s,""+a)}}function Cu(r,s,a){if(a===null)r.removeAttribute(s);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(s);return}r.setAttribute(s,""+a)}}function os(r,s,a,c){if(c===null)r.removeAttribute(a);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(a);return}r.setAttributeNS(s,a,""+c)}}function lr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Eb(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Tj(r,s,a){var c=Object.getOwnPropertyDescriptor(r.constructor.prototype,s);if(!r.hasOwnProperty(s)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var m=c.get,g=c.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return m.call(this)},set:function(w){a=""+w,g.call(this,w)}}),Object.defineProperty(r,s,{enumerable:c.enumerable}),{getValue:function(){return a},setValue:function(w){a=""+w},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function Fh(r){if(!r._valueTracker){var s=Eb(r)?"checked":"value";r._valueTracker=Tj(r,s,""+r[s])}}function _b(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var a=s.getValue(),c="";return r&&(c=Eb(r)?r.checked?"true":"false":r.value),r=c,r!==a?(s.setValue(r),!0):!1}function Ru(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var Cj=/[\n"\\]/g;function cr(r){return r.replace(Cj,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function qh(r,s,a,c,m,g,w,O){r.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?r.type=w:r.removeAttribute("type"),s!=null?w==="number"?(s===0&&r.value===""||r.value!=s)&&(r.value=""+lr(s)):r.value!==""+lr(s)&&(r.value=""+lr(s)):w!=="submit"&&w!=="reset"||r.removeAttribute("value"),s!=null?Vh(r,w,lr(s)):a!=null?Vh(r,w,lr(a)):c!=null&&r.removeAttribute("value"),m==null&&g!=null&&(r.defaultChecked=!!g),m!=null&&(r.checked=m&&typeof m!="function"&&typeof m!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?r.name=""+lr(O):r.removeAttribute("name")}function wb(r,s,a,c,m,g,w,O){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(r.type=g),s!=null||a!=null){if(!(g!=="submit"&&g!=="reset"||s!=null)){Fh(r);return}a=a!=null?""+lr(a):"",s=s!=null?""+lr(s):a,O||s===r.value||(r.value=s),r.defaultValue=s}c=c??m,c=typeof c!="function"&&typeof c!="symbol"&&!!c,r.checked=O?r.checked:!!c,r.defaultChecked=!!c,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(r.name=w),Fh(r)}function Vh(r,s,a){s==="number"&&Ru(r.ownerDocument)===r||r.defaultValue===""+a||(r.defaultValue=""+a)}function na(r,s,a,c){if(r=r.options,s){s={};for(var m=0;m<a.length;m++)s["$"+a[m]]=!0;for(a=0;a<r.length;a++)m=s.hasOwnProperty("$"+r[a].value),r[a].selected!==m&&(r[a].selected=m),m&&c&&(r[a].defaultSelected=!0)}else{for(a=""+lr(a),s=null,m=0;m<r.length;m++){if(r[m].value===a){r[m].selected=!0,c&&(r[m].defaultSelected=!0);return}s!==null||r[m].disabled||(s=r[m])}s!==null&&(s.selected=!0)}}function Tb(r,s,a){if(s!=null&&(s=""+lr(s),s!==r.value&&(r.value=s),a==null)){r.defaultValue!==s&&(r.defaultValue=s);return}r.defaultValue=a!=null?""+lr(a):""}function Cb(r,s,a,c){if(s==null){if(c!=null){if(a!=null)throw Error(i(92));if(te(c)){if(1<c.length)throw Error(i(93));c=c[0]}a=c}a==null&&(a=""),s=a}a=lr(s),r.defaultValue=a,c=r.textContent,c===a&&c!==""&&c!==null&&(r.value=c),Fh(r)}function ra(r,s){if(s){var a=r.firstChild;if(a&&a===r.lastChild&&a.nodeType===3){a.nodeValue=s;return}}r.textContent=s}var Rj=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 Rb(r,s,a){var c=s.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?c?r.setProperty(s,""):s==="float"?r.cssFloat="":r[s]="":c?r.setProperty(s,a):typeof a!="number"||a===0||Rj.has(s)?s==="float"?r.cssFloat=a:r[s]=(""+a).trim():r[s]=a+"px"}function Nb(r,s,a){if(s!=null&&typeof s!="object")throw Error(i(62));if(r=r.style,a!=null){for(var c in a)!a.hasOwnProperty(c)||s!=null&&s.hasOwnProperty(c)||(c.indexOf("--")===0?r.setProperty(c,""):c==="float"?r.cssFloat="":r[c]="");for(var m in s)c=s[m],s.hasOwnProperty(m)&&a[m]!==c&&Rb(r,m,c)}else for(var g in s)s.hasOwnProperty(g)&&Rb(r,g,s[g])}function $h(r){if(r.indexOf("-")===-1)return!1;switch(r){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 Nj=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"]]),jj=/^[\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 Nu(r){return jj.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function as(){}var Gh=null;function Kh(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var sa=null,ia=null;function jb(r){var s=Jo(r);if(s&&(r=s.stateNode)){var a=r[_n]||null;e:switch(r=s.stateNode,s.type){case"input":if(qh(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),s=a.name,a.type==="radio"&&s!=null){for(a=r;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+cr(""+s)+'"][type="radio"]'),s=0;s<a.length;s++){var c=a[s];if(c!==r&&c.form===r.form){var m=c[_n]||null;if(!m)throw Error(i(90));qh(c,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(s=0;s<a.length;s++)c=a[s],c.form===r.form&&_b(c)}break e;case"textarea":Tb(r,a.value,a.defaultValue);break e;case"select":s=a.value,s!=null&&na(r,!!a.multiple,s,!1)}}}var Yh=!1;function Mb(r,s,a){if(Yh)return r(s,a);Yh=!0;try{var c=r(s);return c}finally{if(Yh=!1,(sa!==null||ia!==null)&&(gf(),sa&&(s=sa,r=ia,ia=sa=null,jb(s),r)))for(s=0;s<r.length;s++)jb(r[s])}}function kl(r,s){var a=r.stateNode;if(a===null)return null;var c=a[_n]||null;if(c===null)return null;a=c[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(c=!c.disabled)||(r=r.type,c=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!c;break e;default:r=!1}if(r)return null;if(a&&typeof a!="function")throw Error(i(231,s,typeof a));return a}var ls=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Xh=!1;if(ls)try{var Il={};Object.defineProperty(Il,"passive",{get:function(){Xh=!0}}),window.addEventListener("test",Il,Il),window.removeEventListener("test",Il,Il)}catch{Xh=!1}var Ys=null,Qh=null,ju=null;function Ab(){if(ju)return ju;var r,s=Qh,a=s.length,c,m="value"in Ys?Ys.value:Ys.textContent,g=m.length;for(r=0;r<a&&s[r]===m[r];r++);var w=a-r;for(c=1;c<=w&&s[a-c]===m[g-c];c++);return ju=m.slice(r,1<c?1-c:void 0)}function Mu(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function Au(){return!0}function Ob(){return!1}function wn(r){function s(a,c,m,g,w){this._reactName=a,this._targetInst=m,this.type=c,this.nativeEvent=g,this.target=w,this.currentTarget=null;for(var O in r)r.hasOwnProperty(O)&&(a=r[O],this[O]=a?a(g):g[O]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Au:Ob,this.isPropagationStopped=Ob,this}return v(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Au)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Au)},persist:function(){},isPersistent:Au}),s}var eo={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ou=wn(eo),Dl=v({},eo,{view:0,detail:0}),Mj=wn(Dl),Wh,Zh,Ll,ku=v({},Dl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ep,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Ll&&(Ll&&r.type==="mousemove"?(Wh=r.screenX-Ll.screenX,Zh=r.screenY-Ll.screenY):Zh=Wh=0,Ll=r),Wh)},movementY:function(r){return"movementY"in r?r.movementY:Zh}}),kb=wn(ku),Aj=v({},ku,{dataTransfer:0}),Oj=wn(Aj),kj=v({},Dl,{relatedTarget:0}),Jh=wn(kj),Ij=v({},eo,{animationName:0,elapsedTime:0,pseudoElement:0}),Dj=wn(Ij),Lj=v({},eo,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Pj=wn(Lj),zj=v({},eo,{data:0}),Ib=wn(zj),Uj={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bj={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"},Hj={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fj(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=Hj[r])?!!s[r]:!1}function ep(){return Fj}var qj=v({},Dl,{key:function(r){if(r.key){var s=Uj[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=Mu(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?Bj[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ep,charCode:function(r){return r.type==="keypress"?Mu(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Mu(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),Vj=wn(qj),$j=v({},ku,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Db=wn($j),Gj=v({},Dl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ep}),Kj=wn(Gj),Yj=v({},eo,{propertyName:0,elapsedTime:0,pseudoElement:0}),Xj=wn(Yj),Qj=v({},ku,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Wj=wn(Qj),Zj=v({},eo,{newState:0,oldState:0}),Jj=wn(Zj),eM=[9,13,27,32],tp=ls&&"CompositionEvent"in window,Pl=null;ls&&"documentMode"in document&&(Pl=document.documentMode);var tM=ls&&"TextEvent"in window&&!Pl,Lb=ls&&(!tp||Pl&&8<Pl&&11>=Pl),Pb=" ",zb=!1;function Ub(r,s){switch(r){case"keyup":return eM.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Bb(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var oa=!1;function nM(r,s){switch(r){case"compositionend":return Bb(s);case"keypress":return s.which!==32?null:(zb=!0,Pb);case"textInput":return r=s.data,r===Pb&&zb?null:r;default:return null}}function rM(r,s){if(oa)return r==="compositionend"||!tp&&Ub(r,s)?(r=Ab(),ju=Qh=Ys=null,oa=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Lb&&s.locale!=="ko"?null:s.data;default:return null}}var sM={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 Hb(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!sM[r.type]:s==="textarea"}function Fb(r,s,a,c){sa?ia?ia.push(c):ia=[c]:sa=c,s=_f(s,"onChange"),0<s.length&&(a=new Ou("onChange","change",null,a,c),r.push({event:a,listeners:s}))}var zl=null,Ul=null;function iM(r){wS(r,0)}function Iu(r){var s=Ol(r);if(_b(s))return r}function qb(r,s){if(r==="change")return s}var Vb=!1;if(ls){var np;if(ls){var rp="oninput"in document;if(!rp){var $b=document.createElement("div");$b.setAttribute("oninput","return;"),rp=typeof $b.oninput=="function"}np=rp}else np=!1;Vb=np&&(!document.documentMode||9<document.documentMode)}function Gb(){zl&&(zl.detachEvent("onpropertychange",Kb),Ul=zl=null)}function Kb(r){if(r.propertyName==="value"&&Iu(Ul)){var s=[];Fb(s,Ul,r,Kh(r)),Mb(iM,s)}}function oM(r,s,a){r==="focusin"?(Gb(),zl=s,Ul=a,zl.attachEvent("onpropertychange",Kb)):r==="focusout"&&Gb()}function aM(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Iu(Ul)}function lM(r,s){if(r==="click")return Iu(s)}function cM(r,s){if(r==="input"||r==="change")return Iu(s)}function uM(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var Un=typeof Object.is=="function"?Object.is:uM;function Bl(r,s){if(Un(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var a=Object.keys(r),c=Object.keys(s);if(a.length!==c.length)return!1;for(c=0;c<a.length;c++){var m=a[c];if(!Le.call(s,m)||!Un(r[m],s[m]))return!1}return!0}function Yb(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Xb(r,s){var a=Yb(r);r=0;for(var c;a;){if(a.nodeType===3){if(c=r+a.textContent.length,r<=s&&c>=s)return{node:a,offset:s-r};r=c}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Yb(a)}}function Qb(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?Qb(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function Wb(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var s=Ru(r.document);s instanceof r.HTMLIFrameElement;){try{var a=typeof s.contentWindow.location.href=="string"}catch{a=!1}if(a)r=s.contentWindow;else break;s=Ru(r.document)}return s}function sp(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}var fM=ls&&"documentMode"in document&&11>=document.documentMode,aa=null,ip=null,Hl=null,op=!1;function Zb(r,s,a){var c=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;op||aa==null||aa!==Ru(c)||(c=aa,"selectionStart"in c&&sp(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Hl&&Bl(Hl,c)||(Hl=c,c=_f(ip,"onSelect"),0<c.length&&(s=new Ou("onSelect","select",null,s,a),r.push({event:s,listeners:c}),s.target=aa)))}function to(r,s){var a={};return a[r.toLowerCase()]=s.toLowerCase(),a["Webkit"+r]="webkit"+s,a["Moz"+r]="moz"+s,a}var la={animationend:to("Animation","AnimationEnd"),animationiteration:to("Animation","AnimationIteration"),animationstart:to("Animation","AnimationStart"),transitionrun:to("Transition","TransitionRun"),transitionstart:to("Transition","TransitionStart"),transitioncancel:to("Transition","TransitionCancel"),transitionend:to("Transition","TransitionEnd")},ap={},Jb={};ls&&(Jb=document.createElement("div").style,"AnimationEvent"in window||(delete la.animationend.animation,delete la.animationiteration.animation,delete la.animationstart.animation),"TransitionEvent"in window||delete la.transitionend.transition);function no(r){if(ap[r])return ap[r];if(!la[r])return r;var s=la[r],a;for(a in s)if(s.hasOwnProperty(a)&&a in Jb)return ap[r]=s[a];return r}var ex=no("animationend"),tx=no("animationiteration"),nx=no("animationstart"),dM=no("transitionrun"),hM=no("transitionstart"),pM=no("transitioncancel"),rx=no("transitionend"),sx=new Map,lp="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(" ");lp.push("scrollEnd");function Ar(r,s){sx.set(r,s),Ji(s,[r])}var Du=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},ur=[],ca=0,cp=0;function Lu(){for(var r=ca,s=cp=ca=0;s<r;){var a=ur[s];ur[s++]=null;var c=ur[s];ur[s++]=null;var m=ur[s];ur[s++]=null;var g=ur[s];if(ur[s++]=null,c!==null&&m!==null){var w=c.pending;w===null?m.next=m:(m.next=w.next,w.next=m),c.pending=m}g!==0&&ix(a,m,g)}}function Pu(r,s,a,c){ur[ca++]=r,ur[ca++]=s,ur[ca++]=a,ur[ca++]=c,cp|=c,r.lanes|=c,r=r.alternate,r!==null&&(r.lanes|=c)}function up(r,s,a,c){return Pu(r,s,a,c),zu(r)}function ro(r,s){return Pu(r,null,null,s),zu(r)}function ix(r,s,a){r.lanes|=a;var c=r.alternate;c!==null&&(c.lanes|=a);for(var m=!1,g=r.return;g!==null;)g.childLanes|=a,c=g.alternate,c!==null&&(c.childLanes|=a),g.tag===22&&(r=g.stateNode,r===null||r._visibility&1||(m=!0)),r=g,g=g.return;return r.tag===3?(g=r.stateNode,m&&s!==null&&(m=31-yt(a),r=g.hiddenUpdates,c=r[m],c===null?r[m]=[s]:c.push(s),s.lane=a|536870912),g):null}function zu(r){if(50<cc)throw cc=0,bm=null,Error(i(185));for(var s=r.return;s!==null;)r=s,s=r.return;return r.tag===3?r.stateNode:null}var ua={};function mM(r,s,a,c){this.tag=r,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bn(r,s,a,c){return new mM(r,s,a,c)}function fp(r){return r=r.prototype,!(!r||!r.isReactComponent)}function cs(r,s){var a=r.alternate;return a===null?(a=Bn(r.tag,s,r.key,r.mode),a.elementType=r.elementType,a.type=r.type,a.stateNode=r.stateNode,a.alternate=r,r.alternate=a):(a.pendingProps=s,a.type=r.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=r.flags&65011712,a.childLanes=r.childLanes,a.lanes=r.lanes,a.child=r.child,a.memoizedProps=r.memoizedProps,a.memoizedState=r.memoizedState,a.updateQueue=r.updateQueue,s=r.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},a.sibling=r.sibling,a.index=r.index,a.ref=r.ref,a.refCleanup=r.refCleanup,a}function ox(r,s){r.flags&=65011714;var a=r.alternate;return a===null?(r.childLanes=0,r.lanes=s,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=a.childLanes,r.lanes=a.lanes,r.child=a.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=a.memoizedProps,r.memoizedState=a.memoizedState,r.updateQueue=a.updateQueue,r.type=a.type,s=a.dependencies,r.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),r}function Uu(r,s,a,c,m,g){var w=0;if(c=r,typeof r=="function")fp(r)&&(w=1);else if(typeof r=="string")w=xA(r,a,W.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case D:return r=Bn(31,a,s,m),r.elementType=D,r.lanes=g,r;case _:return so(a.children,m,g,s);case T:w=8,m|=24;break;case C:return r=Bn(12,a,s,m|2),r.elementType=C,r.lanes=g,r;case k:return r=Bn(13,a,s,m),r.elementType=k,r.lanes=g,r;case z:return r=Bn(19,a,s,m),r.elementType=z,r.lanes=g,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case R:w=10;break e;case M:w=9;break e;case N:w=11;break e;case j:w=14;break e;case A:w=16,c=null;break e}w=29,a=Error(i(130,r===null?"null":typeof r,"")),c=null}return s=Bn(w,a,s,m),s.elementType=r,s.type=c,s.lanes=g,s}function so(r,s,a,c){return r=Bn(7,r,c,s),r.lanes=a,r}function dp(r,s,a){return r=Bn(6,r,null,s),r.lanes=a,r}function ax(r){var s=Bn(18,null,null,0);return s.stateNode=r,s}function hp(r,s,a){return s=Bn(4,r.children!==null?r.children:[],r.key,s),s.lanes=a,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}var lx=new WeakMap;function fr(r,s){if(typeof r=="object"&&r!==null){var a=lx.get(r);return a!==void 0?a:(s={value:r,source:s,stack:ge(s)},lx.set(r,s),s)}return{value:r,source:s,stack:ge(s)}}var fa=[],da=0,Bu=null,Fl=0,dr=[],hr=0,Xs=null,Gr=1,Kr="";function us(r,s){fa[da++]=Fl,fa[da++]=Bu,Bu=r,Fl=s}function cx(r,s,a){dr[hr++]=Gr,dr[hr++]=Kr,dr[hr++]=Xs,Xs=r;var c=Gr;r=Kr;var m=32-yt(c)-1;c&=~(1<<m),a+=1;var g=32-yt(s)+m;if(30<g){var w=m-m%5;g=(c&(1<<w)-1).toString(32),c>>=w,m-=w,Gr=1<<32-yt(s)+m|a<<m|c,Kr=g+r}else Gr=1<<g|a<<m|c,Kr=r}function pp(r){r.return!==null&&(us(r,1),cx(r,1,0))}function mp(r){for(;r===Bu;)Bu=fa[--da],fa[da]=null,Fl=fa[--da],fa[da]=null;for(;r===Xs;)Xs=dr[--hr],dr[hr]=null,Kr=dr[--hr],dr[hr]=null,Gr=dr[--hr],dr[hr]=null}function ux(r,s){dr[hr++]=Gr,dr[hr++]=Kr,dr[hr++]=Xs,Gr=s.id,Kr=s.overflow,Xs=r}var ln=null,Nt=null,et=!1,Qs=null,pr=!1,gp=Error(i(519));function Ws(r){var s=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ql(fr(s,r)),gp}function fx(r){var s=r.stateNode,a=r.type,c=r.memoizedProps;switch(s[an]=r,s[_n]=c,a){case"dialog":We("cancel",s),We("close",s);break;case"iframe":case"object":case"embed":We("load",s);break;case"video":case"audio":for(a=0;a<fc.length;a++)We(fc[a],s);break;case"source":We("error",s);break;case"img":case"image":case"link":We("error",s),We("load",s);break;case"details":We("toggle",s);break;case"input":We("invalid",s),wb(s,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":We("invalid",s);break;case"textarea":We("invalid",s),Cb(s,c.value,c.defaultValue,c.children)}a=c.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||s.textContent===""+a||c.suppressHydrationWarning===!0||NS(s.textContent,a)?(c.popover!=null&&(We("beforetoggle",s),We("toggle",s)),c.onScroll!=null&&We("scroll",s),c.onScrollEnd!=null&&We("scrollend",s),c.onClick!=null&&(s.onclick=as),s=!0):s=!1,s||Ws(r,!0)}function dx(r){for(ln=r.return;ln;)switch(ln.tag){case 5:case 31:case 13:pr=!1;return;case 27:case 3:pr=!0;return;default:ln=ln.return}}function ha(r){if(r!==ln)return!1;if(!et)return dx(r),et=!0,!1;var s=r.tag,a;if((a=s!==3&&s!==27)&&((a=s===5)&&(a=r.type,a=!(a!=="form"&&a!=="button")||Im(r.type,r.memoizedProps)),a=!a),a&&Nt&&Ws(r),dx(r),s===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));Nt=PS(r)}else if(s===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(317));Nt=PS(r)}else s===27?(s=Nt,fi(r.type)?(r=Um,Um=null,Nt=r):Nt=s):Nt=ln?gr(r.stateNode.nextSibling):null;return!0}function io(){Nt=ln=null,et=!1}function yp(){var r=Qs;return r!==null&&(Nn===null?Nn=r:Nn.push.apply(Nn,r),Qs=null),r}function ql(r){Qs===null?Qs=[r]:Qs.push(r)}var vp=I(null),oo=null,fs=null;function Zs(r,s,a){Z(vp,s._currentValue),s._currentValue=a}function ds(r){r._currentValue=vp.current,K(vp)}function bp(r,s,a){for(;r!==null;){var c=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,c!==null&&(c.childLanes|=s)):c!==null&&(c.childLanes&s)!==s&&(c.childLanes|=s),r===a)break;r=r.return}}function xp(r,s,a,c){var m=r.child;for(m!==null&&(m.return=r);m!==null;){var g=m.dependencies;if(g!==null){var w=m.child;g=g.firstContext;e:for(;g!==null;){var O=g;g=m;for(var B=0;B<s.length;B++)if(O.context===s[B]){g.lanes|=a,O=g.alternate,O!==null&&(O.lanes|=a),bp(g.return,a,r),c||(w=null);break e}g=O.next}}else if(m.tag===18){if(w=m.return,w===null)throw Error(i(341));w.lanes|=a,g=w.alternate,g!==null&&(g.lanes|=a),bp(w,a,r),w=null}else w=m.child;if(w!==null)w.return=m;else for(w=m;w!==null;){if(w===r){w=null;break}if(m=w.sibling,m!==null){m.return=w.return,w=m;break}w=w.return}m=w}}function pa(r,s,a,c){r=null;for(var m=s,g=!1;m!==null;){if(!g){if((m.flags&524288)!==0)g=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var w=m.alternate;if(w===null)throw Error(i(387));if(w=w.memoizedProps,w!==null){var O=m.type;Un(m.pendingProps.value,w.value)||(r!==null?r.push(O):r=[O])}}else if(m===he.current){if(w=m.alternate,w===null)throw Error(i(387));w.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(r!==null?r.push(gc):r=[gc])}m=m.return}r!==null&&xp(s,r,a,c),s.flags|=262144}function Hu(r){for(r=r.firstContext;r!==null;){if(!Un(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function ao(r){oo=r,fs=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function cn(r){return hx(oo,r)}function Fu(r,s){return oo===null&&ao(r),hx(r,s)}function hx(r,s){var a=s._currentValue;if(s={context:s,memoizedValue:a,next:null},fs===null){if(r===null)throw Error(i(308));fs=s,r.dependencies={lanes:0,firstContext:s},r.flags|=524288}else fs=fs.next=s;return a}var gM=typeof AbortController<"u"?AbortController:function(){var r=[],s=this.signal={aborted:!1,addEventListener:function(a,c){r.push(c)}};this.abort=function(){s.aborted=!0,r.forEach(function(a){return a()})}},yM=e.unstable_scheduleCallback,vM=e.unstable_NormalPriority,qt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sp(){return{controller:new gM,data:new Map,refCount:0}}function Vl(r){r.refCount--,r.refCount===0&&yM(vM,function(){r.controller.abort()})}var $l=null,Ep=0,ma=0,ga=null;function bM(r,s){if($l===null){var a=$l=[];Ep=0,ma=Tm(),ga={status:"pending",value:void 0,then:function(c){a.push(c)}}}return Ep++,s.then(px,px),s}function px(){if(--Ep===0&&$l!==null){ga!==null&&(ga.status="fulfilled");var r=$l;$l=null,ma=0,ga=null;for(var s=0;s<r.length;s++)(0,r[s])()}}function xM(r,s){var a=[],c={status:"pending",value:null,reason:null,then:function(m){a.push(m)}};return r.then(function(){c.status="fulfilled",c.value=s;for(var m=0;m<a.length;m++)(0,a[m])(s)},function(m){for(c.status="rejected",c.reason=m,m=0;m<a.length;m++)(0,a[m])(void 0)}),c}var mx=L.S;L.S=function(r,s){Z0=ze(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&bM(r,s),mx!==null&&mx(r,s)};var lo=I(null);function _p(){var r=lo.current;return r!==null?r:wt.pooledCache}function qu(r,s){s===null?Z(lo,lo.current):Z(lo,s.pool)}function gx(){var r=_p();return r===null?null:{parent:qt._currentValue,pool:r}}var ya=Error(i(460)),wp=Error(i(474)),Vu=Error(i(542)),$u={then:function(){}};function yx(r){return r=r.status,r==="fulfilled"||r==="rejected"}function vx(r,s,a){switch(a=r[a],a===void 0?r.push(s):a!==s&&(s.then(as,as),s=a),s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,xx(r),r;default:if(typeof s.status=="string")s.then(as,as);else{if(r=wt,r!==null&&100<r.shellSuspendCounter)throw Error(i(482));r=s,r.status="pending",r.then(function(c){if(s.status==="pending"){var m=s;m.status="fulfilled",m.value=c}},function(c){if(s.status==="pending"){var m=s;m.status="rejected",m.reason=c}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw r=s.reason,xx(r),r}throw uo=s,ya}}function co(r){try{var s=r._init;return s(r._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(uo=a,ya):a}}var uo=null;function bx(){if(uo===null)throw Error(i(459));var r=uo;return uo=null,r}function xx(r){if(r===ya||r===Vu)throw Error(i(483))}var va=null,Gl=0;function Gu(r){var s=Gl;return Gl+=1,va===null&&(va=[]),vx(va,r,s)}function Kl(r,s){s=s.props.ref,r.ref=s!==void 0?s:null}function Ku(r,s){throw s.$$typeof===b?Error(i(525)):(r=Object.prototype.toString.call(s),Error(i(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r)))}function Sx(r){function s(Y,q){if(r){var J=Y.deletions;J===null?(Y.deletions=[q],Y.flags|=16):J.push(q)}}function a(Y,q){if(!r)return null;for(;q!==null;)s(Y,q),q=q.sibling;return null}function c(Y){for(var q=new Map;Y!==null;)Y.key!==null?q.set(Y.key,Y):q.set(Y.index,Y),Y=Y.sibling;return q}function m(Y,q){return Y=cs(Y,q),Y.index=0,Y.sibling=null,Y}function g(Y,q,J){return Y.index=J,r?(J=Y.alternate,J!==null?(J=J.index,J<q?(Y.flags|=67108866,q):J):(Y.flags|=67108866,q)):(Y.flags|=1048576,q)}function w(Y){return r&&Y.alternate===null&&(Y.flags|=67108866),Y}function O(Y,q,J,ce){return q===null||q.tag!==6?(q=dp(J,Y.mode,ce),q.return=Y,q):(q=m(q,J),q.return=Y,q)}function B(Y,q,J,ce){var Ie=J.type;return Ie===_?le(Y,q,J.props.children,ce,J.key):q!==null&&(q.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===A&&co(Ie)===q.type)?(q=m(q,J.props),Kl(q,J),q.return=Y,q):(q=Uu(J.type,J.key,J.props,null,Y.mode,ce),Kl(q,J),q.return=Y,q)}function ee(Y,q,J,ce){return q===null||q.tag!==4||q.stateNode.containerInfo!==J.containerInfo||q.stateNode.implementation!==J.implementation?(q=hp(J,Y.mode,ce),q.return=Y,q):(q=m(q,J.children||[]),q.return=Y,q)}function le(Y,q,J,ce,Ie){return q===null||q.tag!==7?(q=so(J,Y.mode,ce,Ie),q.return=Y,q):(q=m(q,J),q.return=Y,q)}function ue(Y,q,J){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=dp(""+q,Y.mode,J),q.return=Y,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case x:return J=Uu(q.type,q.key,q.props,null,Y.mode,J),Kl(J,q),J.return=Y,J;case E:return q=hp(q,Y.mode,J),q.return=Y,q;case A:return q=co(q),ue(Y,q,J)}if(te(q)||P(q))return q=so(q,Y.mode,J,null),q.return=Y,q;if(typeof q.then=="function")return ue(Y,Gu(q),J);if(q.$$typeof===R)return ue(Y,Fu(Y,q),J);Ku(Y,q)}return null}function ne(Y,q,J,ce){var Ie=q!==null?q.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Ie!==null?null:O(Y,q,""+J,ce);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return J.key===Ie?B(Y,q,J,ce):null;case E:return J.key===Ie?ee(Y,q,J,ce):null;case A:return J=co(J),ne(Y,q,J,ce)}if(te(J)||P(J))return Ie!==null?null:le(Y,q,J,ce,null);if(typeof J.then=="function")return ne(Y,q,Gu(J),ce);if(J.$$typeof===R)return ne(Y,q,Fu(Y,J),ce);Ku(Y,J)}return null}function oe(Y,q,J,ce,Ie){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Y=Y.get(J)||null,O(q,Y,""+ce,Ie);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:return Y=Y.get(ce.key===null?J:ce.key)||null,B(q,Y,ce,Ie);case E:return Y=Y.get(ce.key===null?J:ce.key)||null,ee(q,Y,ce,Ie);case A:return ce=co(ce),oe(Y,q,J,ce,Ie)}if(te(ce)||P(ce))return Y=Y.get(J)||null,le(q,Y,ce,Ie,null);if(typeof ce.then=="function")return oe(Y,q,J,Gu(ce),Ie);if(ce.$$typeof===R)return oe(Y,q,J,Fu(q,ce),Ie);Ku(q,ce)}return null}function Ce(Y,q,J,ce){for(var Ie=null,lt=null,Me=q,Ge=q=0,Je=null;Me!==null&&Ge<J.length;Ge++){Me.index>Ge?(Je=Me,Me=null):Je=Me.sibling;var ct=ne(Y,Me,J[Ge],ce);if(ct===null){Me===null&&(Me=Je);break}r&&Me&&ct.alternate===null&&s(Y,Me),q=g(ct,q,Ge),lt===null?Ie=ct:lt.sibling=ct,lt=ct,Me=Je}if(Ge===J.length)return a(Y,Me),et&&us(Y,Ge),Ie;if(Me===null){for(;Ge<J.length;Ge++)Me=ue(Y,J[Ge],ce),Me!==null&&(q=g(Me,q,Ge),lt===null?Ie=Me:lt.sibling=Me,lt=Me);return et&&us(Y,Ge),Ie}for(Me=c(Me);Ge<J.length;Ge++)Je=oe(Me,Y,Ge,J[Ge],ce),Je!==null&&(r&&Je.alternate!==null&&Me.delete(Je.key===null?Ge:Je.key),q=g(Je,q,Ge),lt===null?Ie=Je:lt.sibling=Je,lt=Je);return r&&Me.forEach(function(gi){return s(Y,gi)}),et&&us(Y,Ge),Ie}function Pe(Y,q,J,ce){if(J==null)throw Error(i(151));for(var Ie=null,lt=null,Me=q,Ge=q=0,Je=null,ct=J.next();Me!==null&&!ct.done;Ge++,ct=J.next()){Me.index>Ge?(Je=Me,Me=null):Je=Me.sibling;var gi=ne(Y,Me,ct.value,ce);if(gi===null){Me===null&&(Me=Je);break}r&&Me&&gi.alternate===null&&s(Y,Me),q=g(gi,q,Ge),lt===null?Ie=gi:lt.sibling=gi,lt=gi,Me=Je}if(ct.done)return a(Y,Me),et&&us(Y,Ge),Ie;if(Me===null){for(;!ct.done;Ge++,ct=J.next())ct=ue(Y,ct.value,ce),ct!==null&&(q=g(ct,q,Ge),lt===null?Ie=ct:lt.sibling=ct,lt=ct);return et&&us(Y,Ge),Ie}for(Me=c(Me);!ct.done;Ge++,ct=J.next())ct=oe(Me,Y,Ge,ct.value,ce),ct!==null&&(r&&ct.alternate!==null&&Me.delete(ct.key===null?Ge:ct.key),q=g(ct,q,Ge),lt===null?Ie=ct:lt.sibling=ct,lt=ct);return r&&Me.forEach(function(AA){return s(Y,AA)}),et&&us(Y,Ge),Ie}function Et(Y,q,J,ce){if(typeof J=="object"&&J!==null&&J.type===_&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case x:e:{for(var Ie=J.key;q!==null;){if(q.key===Ie){if(Ie=J.type,Ie===_){if(q.tag===7){a(Y,q.sibling),ce=m(q,J.props.children),ce.return=Y,Y=ce;break e}}else if(q.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===A&&co(Ie)===q.type){a(Y,q.sibling),ce=m(q,J.props),Kl(ce,J),ce.return=Y,Y=ce;break e}a(Y,q);break}else s(Y,q);q=q.sibling}J.type===_?(ce=so(J.props.children,Y.mode,ce,J.key),ce.return=Y,Y=ce):(ce=Uu(J.type,J.key,J.props,null,Y.mode,ce),Kl(ce,J),ce.return=Y,Y=ce)}return w(Y);case E:e:{for(Ie=J.key;q!==null;){if(q.key===Ie)if(q.tag===4&&q.stateNode.containerInfo===J.containerInfo&&q.stateNode.implementation===J.implementation){a(Y,q.sibling),ce=m(q,J.children||[]),ce.return=Y,Y=ce;break e}else{a(Y,q);break}else s(Y,q);q=q.sibling}ce=hp(J,Y.mode,ce),ce.return=Y,Y=ce}return w(Y);case A:return J=co(J),Et(Y,q,J,ce)}if(te(J))return Ce(Y,q,J,ce);if(P(J)){if(Ie=P(J),typeof Ie!="function")throw Error(i(150));return J=Ie.call(J),Pe(Y,q,J,ce)}if(typeof J.then=="function")return Et(Y,q,Gu(J),ce);if(J.$$typeof===R)return Et(Y,q,Fu(Y,J),ce);Ku(Y,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,q!==null&&q.tag===6?(a(Y,q.sibling),ce=m(q,J),ce.return=Y,Y=ce):(a(Y,q),ce=dp(J,Y.mode,ce),ce.return=Y,Y=ce),w(Y)):a(Y,q)}return function(Y,q,J,ce){try{Gl=0;var Ie=Et(Y,q,J,ce);return va=null,Ie}catch(Me){if(Me===ya||Me===Vu)throw Me;var lt=Bn(29,Me,null,Y.mode);return lt.lanes=ce,lt.return=Y,lt}}}var fo=Sx(!0),Ex=Sx(!1),Js=!1;function Tp(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Cp(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function ei(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function ti(r,s,a){var c=r.updateQueue;if(c===null)return null;if(c=c.shared,(ht&2)!==0){var m=c.pending;return m===null?s.next=s:(s.next=m.next,m.next=s),c.pending=s,s=zu(r),ix(r,null,a),s}return Pu(r,c,s,a),zu(r)}function Yl(r,s,a){if(s=s.updateQueue,s!==null&&(s=s.shared,(a&4194048)!==0)){var c=s.lanes;c&=r.pendingLanes,a|=c,s.lanes=a,$s(r,a)}}function Rp(r,s){var a=r.updateQueue,c=r.alternate;if(c!==null&&(c=c.updateQueue,a===c)){var m=null,g=null;if(a=a.firstBaseUpdate,a!==null){do{var w={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};g===null?m=g=w:g=g.next=w,a=a.next}while(a!==null);g===null?m=g=s:g=g.next=s}else m=g=s;a={baseState:c.baseState,firstBaseUpdate:m,lastBaseUpdate:g,shared:c.shared,callbacks:c.callbacks},r.updateQueue=a;return}r=a.lastBaseUpdate,r===null?a.firstBaseUpdate=s:r.next=s,a.lastBaseUpdate=s}var Np=!1;function Xl(){if(Np){var r=ga;if(r!==null)throw r}}function Ql(r,s,a,c){Np=!1;var m=r.updateQueue;Js=!1;var g=m.firstBaseUpdate,w=m.lastBaseUpdate,O=m.shared.pending;if(O!==null){m.shared.pending=null;var B=O,ee=B.next;B.next=null,w===null?g=ee:w.next=ee,w=B;var le=r.alternate;le!==null&&(le=le.updateQueue,O=le.lastBaseUpdate,O!==w&&(O===null?le.firstBaseUpdate=ee:O.next=ee,le.lastBaseUpdate=B))}if(g!==null){var ue=m.baseState;w=0,le=ee=B=null,O=g;do{var ne=O.lane&-536870913,oe=ne!==O.lane;if(oe?(Ze&ne)===ne:(c&ne)===ne){ne!==0&&ne===ma&&(Np=!0),le!==null&&(le=le.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Ce=r,Pe=O;ne=s;var Et=a;switch(Pe.tag){case 1:if(Ce=Pe.payload,typeof Ce=="function"){ue=Ce.call(Et,ue,ne);break e}ue=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Pe.payload,ne=typeof Ce=="function"?Ce.call(Et,ue,ne):Ce,ne==null)break e;ue=v({},ue,ne);break e;case 2:Js=!0}}ne=O.callback,ne!==null&&(r.flags|=64,oe&&(r.flags|=8192),oe=m.callbacks,oe===null?m.callbacks=[ne]:oe.push(ne))}else oe={lane:ne,tag:O.tag,payload:O.payload,callback:O.callback,next:null},le===null?(ee=le=oe,B=ue):le=le.next=oe,w|=ne;if(O=O.next,O===null){if(O=m.shared.pending,O===null)break;oe=O,O=oe.next,oe.next=null,m.lastBaseUpdate=oe,m.shared.pending=null}}while(!0);le===null&&(B=ue),m.baseState=B,m.firstBaseUpdate=ee,m.lastBaseUpdate=le,g===null&&(m.shared.lanes=0),oi|=w,r.lanes=w,r.memoizedState=ue}}function _x(r,s){if(typeof r!="function")throw Error(i(191,r));r.call(s)}function wx(r,s){var a=r.callbacks;if(a!==null)for(r.callbacks=null,r=0;r<a.length;r++)_x(a[r],s)}var ba=I(null),Yu=I(0);function Tx(r,s){r=Ss,Z(Yu,r),Z(ba,s),Ss=r|s.baseLanes}function jp(){Z(Yu,Ss),Z(ba,ba.current)}function Mp(){Ss=Yu.current,K(ba),K(Yu)}var Hn=I(null),mr=null;function ni(r){var s=r.alternate;Z(Ht,Ht.current&1),Z(Hn,r),mr===null&&(s===null||ba.current!==null||s.memoizedState!==null)&&(mr=r)}function Ap(r){Z(Ht,Ht.current),Z(Hn,r),mr===null&&(mr=r)}function Cx(r){r.tag===22?(Z(Ht,Ht.current),Z(Hn,r),mr===null&&(mr=r)):ri()}function ri(){Z(Ht,Ht.current),Z(Hn,Hn.current)}function Fn(r){K(Hn),mr===r&&(mr=null),K(Ht)}var Ht=I(0);function Xu(r){for(var s=r;s!==null;){if(s.tag===13){var a=s.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Pm(a)||zm(a)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var hs=0,$e=null,xt=null,Vt=null,Qu=!1,xa=!1,ho=!1,Wu=0,Wl=0,Sa=null,SM=0;function It(){throw Error(i(321))}function Op(r,s){if(s===null)return!1;for(var a=0;a<s.length&&a<r.length;a++)if(!Un(r[a],s[a]))return!1;return!0}function kp(r,s,a,c,m,g){return hs=g,$e=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,L.H=r===null||r.memoizedState===null?c0:Yp,ho=!1,g=a(c,m),ho=!1,xa&&(g=Nx(s,a,c,m)),Rx(r),g}function Rx(r){L.H=ec;var s=xt!==null&&xt.next!==null;if(hs=0,Vt=xt=$e=null,Qu=!1,Wl=0,Sa=null,s)throw Error(i(300));r===null||$t||(r=r.dependencies,r!==null&&Hu(r)&&($t=!0))}function Nx(r,s,a,c){$e=r;var m=0;do{if(xa&&(Sa=null),Wl=0,xa=!1,25<=m)throw Error(i(301));if(m+=1,Vt=xt=null,r.updateQueue!=null){var g=r.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}L.H=u0,g=s(a,c)}while(xa);return g}function EM(){var r=L.H,s=r.useState()[0];return s=typeof s.then=="function"?Zl(s):s,r=r.useState()[0],(xt!==null?xt.memoizedState:null)!==r&&($e.flags|=1024),s}function Ip(){var r=Wu!==0;return Wu=0,r}function Dp(r,s,a){s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~a}function Lp(r){if(Qu){for(r=r.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}Qu=!1}hs=0,Vt=xt=$e=null,xa=!1,Wl=Wu=0,Sa=null}function yn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?$e.memoizedState=Vt=r:Vt=Vt.next=r,Vt}function Ft(){if(xt===null){var r=$e.alternate;r=r!==null?r.memoizedState:null}else r=xt.next;var s=Vt===null?$e.memoizedState:Vt.next;if(s!==null)Vt=s,xt=r;else{if(r===null)throw $e.alternate===null?Error(i(467)):Error(i(310));xt=r,r={memoizedState:xt.memoizedState,baseState:xt.baseState,baseQueue:xt.baseQueue,queue:xt.queue,next:null},Vt===null?$e.memoizedState=Vt=r:Vt=Vt.next=r}return Vt}function Zu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zl(r){var s=Wl;return Wl+=1,Sa===null&&(Sa=[]),r=vx(Sa,r,s),s=$e,(Vt===null?s.memoizedState:Vt.next)===null&&(s=s.alternate,L.H=s===null||s.memoizedState===null?c0:Yp),r}function Ju(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Zl(r);if(r.$$typeof===R)return cn(r)}throw Error(i(438,String(r)))}function Pp(r){var s=null,a=$e.updateQueue;if(a!==null&&(s=a.memoCache),s==null){var c=$e.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(s={data:c.data.map(function(m){return m.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),a===null&&(a=Zu(),$e.updateQueue=a),a.memoCache=s,a=s.data[s.index],a===void 0)for(a=s.data[s.index]=Array(r),c=0;c<r;c++)a[c]=G;return s.index++,a}function ps(r,s){return typeof s=="function"?s(r):s}function ef(r){var s=Ft();return zp(s,xt,r)}function zp(r,s,a){var c=r.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=a;var m=r.baseQueue,g=c.pending;if(g!==null){if(m!==null){var w=m.next;m.next=g.next,g.next=w}s.baseQueue=m=g,c.pending=null}if(g=r.baseState,m===null)r.memoizedState=g;else{s=m.next;var O=w=null,B=null,ee=s,le=!1;do{var ue=ee.lane&-536870913;if(ue!==ee.lane?(Ze&ue)===ue:(hs&ue)===ue){var ne=ee.revertLane;if(ne===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),ue===ma&&(le=!0);else if((hs&ne)===ne){ee=ee.next,ne===ma&&(le=!0);continue}else ue={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},B===null?(O=B=ue,w=g):B=B.next=ue,$e.lanes|=ne,oi|=ne;ue=ee.action,ho&&a(g,ue),g=ee.hasEagerState?ee.eagerState:a(g,ue)}else ne={lane:ue,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},B===null?(O=B=ne,w=g):B=B.next=ne,$e.lanes|=ue,oi|=ue;ee=ee.next}while(ee!==null&&ee!==s);if(B===null?w=g:B.next=O,!Un(g,r.memoizedState)&&($t=!0,le&&(a=ga,a!==null)))throw a;r.memoizedState=g,r.baseState=w,r.baseQueue=B,c.lastRenderedState=g}return m===null&&(c.lanes=0),[r.memoizedState,c.dispatch]}function Up(r){var s=Ft(),a=s.queue;if(a===null)throw Error(i(311));a.lastRenderedReducer=r;var c=a.dispatch,m=a.pending,g=s.memoizedState;if(m!==null){a.pending=null;var w=m=m.next;do g=r(g,w.action),w=w.next;while(w!==m);Un(g,s.memoizedState)||($t=!0),s.memoizedState=g,s.baseQueue===null&&(s.baseState=g),a.lastRenderedState=g}return[g,c]}function jx(r,s,a){var c=$e,m=Ft(),g=et;if(g){if(a===void 0)throw Error(i(407));a=a()}else a=s();var w=!Un((xt||m).memoizedState,a);if(w&&(m.memoizedState=a,$t=!0),m=m.queue,Fp(Ox.bind(null,c,m,r),[r]),m.getSnapshot!==s||w||Vt!==null&&Vt.memoizedState.tag&1){if(c.flags|=2048,Ea(9,{destroy:void 0},Ax.bind(null,c,m,a,s),null),wt===null)throw Error(i(349));g||(hs&127)!==0||Mx(c,s,a)}return a}function Mx(r,s,a){r.flags|=16384,r={getSnapshot:s,value:a},s=$e.updateQueue,s===null?(s=Zu(),$e.updateQueue=s,s.stores=[r]):(a=s.stores,a===null?s.stores=[r]:a.push(r))}function Ax(r,s,a,c){s.value=a,s.getSnapshot=c,kx(s)&&Ix(r)}function Ox(r,s,a){return a(function(){kx(s)&&Ix(r)})}function kx(r){var s=r.getSnapshot;r=r.value;try{var a=s();return!Un(r,a)}catch{return!0}}function Ix(r){var s=ro(r,2);s!==null&&jn(s,r,2)}function Bp(r){var s=yn();if(typeof r=="function"){var a=r;if(r=a(),ho){at(!0);try{a()}finally{at(!1)}}}return s.memoizedState=s.baseState=r,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:r},s}function Dx(r,s,a,c){return r.baseState=a,zp(r,xt,typeof c=="function"?c:ps)}function _M(r,s,a,c,m){if(rf(r))throw Error(i(485));if(r=s.action,r!==null){var g={payload:m,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){g.listeners.push(w)}};L.T!==null?a(!0):g.isTransition=!1,c(g),a=s.pending,a===null?(g.next=s.pending=g,Lx(s,g)):(g.next=a.next,s.pending=a.next=g)}}function Lx(r,s){var a=s.action,c=s.payload,m=r.state;if(s.isTransition){var g=L.T,w={};L.T=w;try{var O=a(m,c),B=L.S;B!==null&&B(w,O),Px(r,s,O)}catch(ee){Hp(r,s,ee)}finally{g!==null&&w.types!==null&&(g.types=w.types),L.T=g}}else try{g=a(m,c),Px(r,s,g)}catch(ee){Hp(r,s,ee)}}function Px(r,s,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(c){zx(r,s,c)},function(c){return Hp(r,s,c)}):zx(r,s,a)}function zx(r,s,a){s.status="fulfilled",s.value=a,Ux(s),r.state=a,s=r.pending,s!==null&&(a=s.next,a===s?r.pending=null:(a=a.next,s.next=a,Lx(r,a)))}function Hp(r,s,a){var c=r.pending;if(r.pending=null,c!==null){c=c.next;do s.status="rejected",s.reason=a,Ux(s),s=s.next;while(s!==c)}r.action=null}function Ux(r){r=r.listeners;for(var s=0;s<r.length;s++)(0,r[s])()}function Bx(r,s){return s}function Hx(r,s){if(et){var a=wt.formState;if(a!==null){e:{var c=$e;if(et){if(Nt){t:{for(var m=Nt,g=pr;m.nodeType!==8;){if(!g){m=null;break t}if(m=gr(m.nextSibling),m===null){m=null;break t}}g=m.data,m=g==="F!"||g==="F"?m:null}if(m){Nt=gr(m.nextSibling),c=m.data==="F!";break e}}Ws(c)}c=!1}c&&(s=a[0])}}return a=yn(),a.memoizedState=a.baseState=s,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bx,lastRenderedState:s},a.queue=c,a=o0.bind(null,$e,c),c.dispatch=a,c=Bp(!1),g=Kp.bind(null,$e,!1,c.queue),c=yn(),m={state:s,dispatch:null,action:r,pending:null},c.queue=m,a=_M.bind(null,$e,m,g,a),m.dispatch=a,c.memoizedState=r,[s,a,!1]}function Fx(r){var s=Ft();return qx(s,xt,r)}function qx(r,s,a){if(s=zp(r,s,Bx)[0],r=ef(ps)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var c=Zl(s)}catch(w){throw w===ya?Vu:w}else c=s;s=Ft();var m=s.queue,g=m.dispatch;return a!==s.memoizedState&&($e.flags|=2048,Ea(9,{destroy:void 0},wM.bind(null,m,a),null)),[c,g,r]}function wM(r,s){r.action=s}function Vx(r){var s=Ft(),a=xt;if(a!==null)return qx(s,a,r);Ft(),s=s.memoizedState,a=Ft();var c=a.queue.dispatch;return a.memoizedState=r,[s,c,!1]}function Ea(r,s,a,c){return r={tag:r,create:a,deps:c,inst:s,next:null},s=$e.updateQueue,s===null&&(s=Zu(),$e.updateQueue=s),a=s.lastEffect,a===null?s.lastEffect=r.next=r:(c=a.next,a.next=r,r.next=c,s.lastEffect=r),r}function $x(){return Ft().memoizedState}function tf(r,s,a,c){var m=yn();$e.flags|=r,m.memoizedState=Ea(1|s,{destroy:void 0},a,c===void 0?null:c)}function nf(r,s,a,c){var m=Ft();c=c===void 0?null:c;var g=m.memoizedState.inst;xt!==null&&c!==null&&Op(c,xt.memoizedState.deps)?m.memoizedState=Ea(s,g,a,c):($e.flags|=r,m.memoizedState=Ea(1|s,g,a,c))}function Gx(r,s){tf(8390656,8,r,s)}function Fp(r,s){nf(2048,8,r,s)}function TM(r){$e.flags|=4;var s=$e.updateQueue;if(s===null)s=Zu(),$e.updateQueue=s,s.events=[r];else{var a=s.events;a===null?s.events=[r]:a.push(r)}}function Kx(r){var s=Ft().memoizedState;return TM({ref:s,nextImpl:r}),function(){if((ht&2)!==0)throw Error(i(440));return s.impl.apply(void 0,arguments)}}function Yx(r,s){return nf(4,2,r,s)}function Xx(r,s){return nf(4,4,r,s)}function Qx(r,s){if(typeof s=="function"){r=r();var a=s(r);return function(){typeof a=="function"?a():s(null)}}if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function Wx(r,s,a){a=a!=null?a.concat([r]):null,nf(4,4,Qx.bind(null,s,r),a)}function qp(){}function Zx(r,s){var a=Ft();s=s===void 0?null:s;var c=a.memoizedState;return s!==null&&Op(s,c[1])?c[0]:(a.memoizedState=[r,s],r)}function Jx(r,s){var a=Ft();s=s===void 0?null:s;var c=a.memoizedState;if(s!==null&&Op(s,c[1]))return c[0];if(c=r(),ho){at(!0);try{r()}finally{at(!1)}}return a.memoizedState=[c,s],c}function Vp(r,s,a){return a===void 0||(hs&1073741824)!==0&&(Ze&261930)===0?r.memoizedState=s:(r.memoizedState=a,r=eS(),$e.lanes|=r,oi|=r,a)}function e0(r,s,a,c){return Un(a,s)?a:ba.current!==null?(r=Vp(r,a,c),Un(r,s)||($t=!0),r):(hs&42)===0||(hs&1073741824)!==0&&(Ze&261930)===0?($t=!0,r.memoizedState=a):(r=eS(),$e.lanes|=r,oi|=r,s)}function t0(r,s,a,c,m){var g=$.p;$.p=g!==0&&8>g?g:8;var w=L.T,O={};L.T=O,Kp(r,!1,s,a);try{var B=m(),ee=L.S;if(ee!==null&&ee(O,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var le=xM(B,c);Jl(r,s,le,$n(r))}else Jl(r,s,c,$n(r))}catch(ue){Jl(r,s,{then:function(){},status:"rejected",reason:ue},$n())}finally{$.p=g,w!==null&&O.types!==null&&(w.types=O.types),L.T=w}}function CM(){}function $p(r,s,a,c){if(r.tag!==5)throw Error(i(476));var m=n0(r).queue;t0(r,m,s,H,a===null?CM:function(){return r0(r),a(c)})}function n0(r){var s=r.memoizedState;if(s!==null)return s;s={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:H},next:null};var a={};return s.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:a},next:null},r.memoizedState=s,r=r.alternate,r!==null&&(r.memoizedState=s),s}function r0(r){var s=n0(r);s.next===null&&(s=r.alternate.memoizedState),Jl(r,s.next.queue,{},$n())}function Gp(){return cn(gc)}function s0(){return Ft().memoizedState}function i0(){return Ft().memoizedState}function RM(r){for(var s=r.return;s!==null;){switch(s.tag){case 24:case 3:var a=$n();r=ei(a);var c=ti(s,r,a);c!==null&&(jn(c,s,a),Yl(c,s,a)),s={cache:Sp()},r.payload=s;return}s=s.return}}function NM(r,s,a){var c=$n();a={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},rf(r)?a0(s,a):(a=up(r,s,a,c),a!==null&&(jn(a,r,c),l0(a,s,c)))}function o0(r,s,a){var c=$n();Jl(r,s,a,c)}function Jl(r,s,a,c){var m={lane:c,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(rf(r))a0(s,m);else{var g=r.alternate;if(r.lanes===0&&(g===null||g.lanes===0)&&(g=s.lastRenderedReducer,g!==null))try{var w=s.lastRenderedState,O=g(w,a);if(m.hasEagerState=!0,m.eagerState=O,Un(O,w))return Pu(r,s,m,0),wt===null&&Lu(),!1}catch{}if(a=up(r,s,m,c),a!==null)return jn(a,r,c),l0(a,s,c),!0}return!1}function Kp(r,s,a,c){if(c={lane:2,revertLane:Tm(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},rf(r)){if(s)throw Error(i(479))}else s=up(r,a,c,2),s!==null&&jn(s,r,2)}function rf(r){var s=r.alternate;return r===$e||s!==null&&s===$e}function a0(r,s){xa=Qu=!0;var a=r.pending;a===null?s.next=s:(s.next=a.next,a.next=s),r.pending=s}function l0(r,s,a){if((a&4194048)!==0){var c=s.lanes;c&=r.pendingLanes,a|=c,s.lanes=a,$s(r,a)}}var ec={readContext:cn,use:Ju,useCallback:It,useContext:It,useEffect:It,useImperativeHandle:It,useLayoutEffect:It,useInsertionEffect:It,useMemo:It,useReducer:It,useRef:It,useState:It,useDebugValue:It,useDeferredValue:It,useTransition:It,useSyncExternalStore:It,useId:It,useHostTransitionStatus:It,useFormState:It,useActionState:It,useOptimistic:It,useMemoCache:It,useCacheRefresh:It};ec.useEffectEvent=It;var c0={readContext:cn,use:Ju,useCallback:function(r,s){return yn().memoizedState=[r,s===void 0?null:s],r},useContext:cn,useEffect:Gx,useImperativeHandle:function(r,s,a){a=a!=null?a.concat([r]):null,tf(4194308,4,Qx.bind(null,s,r),a)},useLayoutEffect:function(r,s){return tf(4194308,4,r,s)},useInsertionEffect:function(r,s){tf(4,2,r,s)},useMemo:function(r,s){var a=yn();s=s===void 0?null:s;var c=r();if(ho){at(!0);try{r()}finally{at(!1)}}return a.memoizedState=[c,s],c},useReducer:function(r,s,a){var c=yn();if(a!==void 0){var m=a(s);if(ho){at(!0);try{a(s)}finally{at(!1)}}}else m=s;return c.memoizedState=c.baseState=m,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:m},c.queue=r,r=r.dispatch=NM.bind(null,$e,r),[c.memoizedState,r]},useRef:function(r){var s=yn();return r={current:r},s.memoizedState=r},useState:function(r){r=Bp(r);var s=r.queue,a=o0.bind(null,$e,s);return s.dispatch=a,[r.memoizedState,a]},useDebugValue:qp,useDeferredValue:function(r,s){var a=yn();return Vp(a,r,s)},useTransition:function(){var r=Bp(!1);return r=t0.bind(null,$e,r.queue,!0,!1),yn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,s,a){var c=$e,m=yn();if(et){if(a===void 0)throw Error(i(407));a=a()}else{if(a=s(),wt===null)throw Error(i(349));(Ze&127)!==0||Mx(c,s,a)}m.memoizedState=a;var g={value:a,getSnapshot:s};return m.queue=g,Gx(Ox.bind(null,c,g,r),[r]),c.flags|=2048,Ea(9,{destroy:void 0},Ax.bind(null,c,g,a,s),null),a},useId:function(){var r=yn(),s=wt.identifierPrefix;if(et){var a=Kr,c=Gr;a=(c&~(1<<32-yt(c)-1)).toString(32)+a,s="_"+s+"R_"+a,a=Wu++,0<a&&(s+="H"+a.toString(32)),s+="_"}else a=SM++,s="_"+s+"r_"+a.toString(32)+"_";return r.memoizedState=s},useHostTransitionStatus:Gp,useFormState:Hx,useActionState:Hx,useOptimistic:function(r){var s=yn();s.memoizedState=s.baseState=r;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=a,s=Kp.bind(null,$e,!0,a),a.dispatch=s,[r,s]},useMemoCache:Pp,useCacheRefresh:function(){return yn().memoizedState=RM.bind(null,$e)},useEffectEvent:function(r){var s=yn(),a={impl:r};return s.memoizedState=a,function(){if((ht&2)!==0)throw Error(i(440));return a.impl.apply(void 0,arguments)}}},Yp={readContext:cn,use:Ju,useCallback:Zx,useContext:cn,useEffect:Fp,useImperativeHandle:Wx,useInsertionEffect:Yx,useLayoutEffect:Xx,useMemo:Jx,useReducer:ef,useRef:$x,useState:function(){return ef(ps)},useDebugValue:qp,useDeferredValue:function(r,s){var a=Ft();return e0(a,xt.memoizedState,r,s)},useTransition:function(){var r=ef(ps)[0],s=Ft().memoizedState;return[typeof r=="boolean"?r:Zl(r),s]},useSyncExternalStore:jx,useId:s0,useHostTransitionStatus:Gp,useFormState:Fx,useActionState:Fx,useOptimistic:function(r,s){var a=Ft();return Dx(a,xt,r,s)},useMemoCache:Pp,useCacheRefresh:i0};Yp.useEffectEvent=Kx;var u0={readContext:cn,use:Ju,useCallback:Zx,useContext:cn,useEffect:Fp,useImperativeHandle:Wx,useInsertionEffect:Yx,useLayoutEffect:Xx,useMemo:Jx,useReducer:Up,useRef:$x,useState:function(){return Up(ps)},useDebugValue:qp,useDeferredValue:function(r,s){var a=Ft();return xt===null?Vp(a,r,s):e0(a,xt.memoizedState,r,s)},useTransition:function(){var r=Up(ps)[0],s=Ft().memoizedState;return[typeof r=="boolean"?r:Zl(r),s]},useSyncExternalStore:jx,useId:s0,useHostTransitionStatus:Gp,useFormState:Vx,useActionState:Vx,useOptimistic:function(r,s){var a=Ft();return xt!==null?Dx(a,xt,r,s):(a.baseState=r,[r,a.queue.dispatch])},useMemoCache:Pp,useCacheRefresh:i0};u0.useEffectEvent=Kx;function Xp(r,s,a,c){s=r.memoizedState,a=a(c,s),a=a==null?s:v({},s,a),r.memoizedState=a,r.lanes===0&&(r.updateQueue.baseState=a)}var Qp={enqueueSetState:function(r,s,a){r=r._reactInternals;var c=$n(),m=ei(c);m.payload=s,a!=null&&(m.callback=a),s=ti(r,m,c),s!==null&&(jn(s,r,c),Yl(s,r,c))},enqueueReplaceState:function(r,s,a){r=r._reactInternals;var c=$n(),m=ei(c);m.tag=1,m.payload=s,a!=null&&(m.callback=a),s=ti(r,m,c),s!==null&&(jn(s,r,c),Yl(s,r,c))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var a=$n(),c=ei(a);c.tag=2,s!=null&&(c.callback=s),s=ti(r,c,a),s!==null&&(jn(s,r,a),Yl(s,r,a))}};function f0(r,s,a,c,m,g,w){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(c,g,w):s.prototype&&s.prototype.isPureReactComponent?!Bl(a,c)||!Bl(m,g):!0}function d0(r,s,a,c){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(a,c),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(a,c),s.state!==r&&Qp.enqueueReplaceState(s,s.state,null)}function po(r,s){var a=s;if("ref"in s){a={};for(var c in s)c!=="ref"&&(a[c]=s[c])}if(r=r.defaultProps){a===s&&(a=v({},a));for(var m in r)a[m]===void 0&&(a[m]=r[m])}return a}function h0(r){Du(r)}function p0(r){console.error(r)}function m0(r){Du(r)}function sf(r,s){try{var a=r.onUncaughtError;a(s.value,{componentStack:s.stack})}catch(c){setTimeout(function(){throw c})}}function g0(r,s,a){try{var c=r.onCaughtError;c(a.value,{componentStack:a.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function Wp(r,s,a){return a=ei(a),a.tag=3,a.payload={element:null},a.callback=function(){sf(r,s)},a}function y0(r){return r=ei(r),r.tag=3,r}function v0(r,s,a,c){var m=a.type.getDerivedStateFromError;if(typeof m=="function"){var g=c.value;r.payload=function(){return m(g)},r.callback=function(){g0(s,a,c)}}var w=a.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(r.callback=function(){g0(s,a,c),typeof m!="function"&&(ai===null?ai=new Set([this]):ai.add(this));var O=c.stack;this.componentDidCatch(c.value,{componentStack:O!==null?O:""})})}function jM(r,s,a,c,m){if(a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(s=a.alternate,s!==null&&pa(s,a,m,!0),a=Hn.current,a!==null){switch(a.tag){case 31:case 13:return mr===null?yf():a.alternate===null&&Dt===0&&(Dt=3),a.flags&=-257,a.flags|=65536,a.lanes=m,c===$u?a.flags|=16384:(s=a.updateQueue,s===null?a.updateQueue=new Set([c]):s.add(c),Em(r,c,m)),!1;case 22:return a.flags|=65536,c===$u?a.flags|=16384:(s=a.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([c])},a.updateQueue=s):(a=s.retryQueue,a===null?s.retryQueue=new Set([c]):a.add(c)),Em(r,c,m)),!1}throw Error(i(435,a.tag))}return Em(r,c,m),yf(),!1}if(et)return s=Hn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=m,c!==gp&&(r=Error(i(422),{cause:c}),ql(fr(r,a)))):(c!==gp&&(s=Error(i(423),{cause:c}),ql(fr(s,a))),r=r.current.alternate,r.flags|=65536,m&=-m,r.lanes|=m,c=fr(c,a),m=Wp(r.stateNode,c,m),Rp(r,m),Dt!==4&&(Dt=2)),!1;var g=Error(i(520),{cause:c});if(g=fr(g,a),lc===null?lc=[g]:lc.push(g),Dt!==4&&(Dt=2),s===null)return!0;c=fr(c,a),a=s;do{switch(a.tag){case 3:return a.flags|=65536,r=m&-m,a.lanes|=r,r=Wp(a.stateNode,c,r),Rp(a,r),!1;case 1:if(s=a.type,g=a.stateNode,(a.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(ai===null||!ai.has(g))))return a.flags|=65536,m&=-m,a.lanes|=m,m=y0(m),v0(m,r,a,c),Rp(a,m),!1}a=a.return}while(a!==null);return!1}var Zp=Error(i(461)),$t=!1;function un(r,s,a,c){s.child=r===null?Ex(s,null,a,c):fo(s,r.child,a,c)}function b0(r,s,a,c,m){a=a.render;var g=s.ref;if("ref"in c){var w={};for(var O in c)O!=="ref"&&(w[O]=c[O])}else w=c;return ao(s),c=kp(r,s,a,w,g,m),O=Ip(),r!==null&&!$t?(Dp(r,s,m),ms(r,s,m)):(et&&O&&pp(s),s.flags|=1,un(r,s,c,m),s.child)}function x0(r,s,a,c,m){if(r===null){var g=a.type;return typeof g=="function"&&!fp(g)&&g.defaultProps===void 0&&a.compare===null?(s.tag=15,s.type=g,S0(r,s,g,c,m)):(r=Uu(a.type,null,c,s,s.mode,m),r.ref=s.ref,r.return=s,s.child=r)}if(g=r.child,!om(r,m)){var w=g.memoizedProps;if(a=a.compare,a=a!==null?a:Bl,a(w,c)&&r.ref===s.ref)return ms(r,s,m)}return s.flags|=1,r=cs(g,c),r.ref=s.ref,r.return=s,s.child=r}function S0(r,s,a,c,m){if(r!==null){var g=r.memoizedProps;if(Bl(g,c)&&r.ref===s.ref)if($t=!1,s.pendingProps=c=g,om(r,m))(r.flags&131072)!==0&&($t=!0);else return s.lanes=r.lanes,ms(r,s,m)}return Jp(r,s,a,c,m)}function E0(r,s,a,c){var m=c.children,g=r!==null?r.memoizedState:null;if(r===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((s.flags&128)!==0){if(g=g!==null?g.baseLanes|a:a,r!==null){for(c=s.child=r.child,m=0;c!==null;)m=m|c.lanes|c.childLanes,c=c.sibling;c=m&~g}else c=0,s.child=null;return _0(r,s,g,a,c)}if((a&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},r!==null&&qu(s,g!==null?g.cachePool:null),g!==null?Tx(s,g):jp(),Cx(s);else return c=s.lanes=536870912,_0(r,s,g!==null?g.baseLanes|a:a,a,c)}else g!==null?(qu(s,g.cachePool),Tx(s,g),ri(),s.memoizedState=null):(r!==null&&qu(s,null),jp(),ri());return un(r,s,m,a),s.child}function tc(r,s){return r!==null&&r.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function _0(r,s,a,c,m){var g=_p();return g=g===null?null:{parent:qt._currentValue,pool:g},s.memoizedState={baseLanes:a,cachePool:g},r!==null&&qu(s,null),jp(),Cx(s),r!==null&&pa(r,s,c,!0),s.childLanes=m,null}function of(r,s){return s=lf({mode:s.mode,children:s.children},r.mode),s.ref=r.ref,r.child=s,s.return=r,s}function w0(r,s,a){return fo(s,r.child,null,a),r=of(s,s.pendingProps),r.flags|=2,Fn(s),s.memoizedState=null,r}function MM(r,s,a){var c=s.pendingProps,m=(s.flags&128)!==0;if(s.flags&=-129,r===null){if(et){if(c.mode==="hidden")return r=of(s,c),s.lanes=536870912,tc(null,r);if(Ap(s),(r=Nt)?(r=LS(r,pr),r=r!==null&&r.data==="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:Xs!==null?{id:Gr,overflow:Kr}:null,retryLane:536870912,hydrationErrors:null},a=ax(r),a.return=s,s.child=a,ln=s,Nt=null)):r=null,r===null)throw Ws(s);return s.lanes=536870912,null}return of(s,c)}var g=r.memoizedState;if(g!==null){var w=g.dehydrated;if(Ap(s),m)if(s.flags&256)s.flags&=-257,s=w0(r,s,a);else if(s.memoizedState!==null)s.child=r.child,s.flags|=128,s=null;else throw Error(i(558));else if($t||pa(r,s,a,!1),m=(a&r.childLanes)!==0,$t||m){if(c=wt,c!==null&&(w=Gs(c,a),w!==0&&w!==g.retryLane))throw g.retryLane=w,ro(r,w),jn(c,r,w),Zp;yf(),s=w0(r,s,a)}else r=g.treeContext,Nt=gr(w.nextSibling),ln=s,et=!0,Qs=null,pr=!1,r!==null&&ux(s,r),s=of(s,c),s.flags|=4096;return s}return r=cs(r.child,{mode:c.mode,children:c.children}),r.ref=s.ref,s.child=r,r.return=s,r}function af(r,s){var a=s.ref;if(a===null)r!==null&&r.ref!==null&&(s.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(i(284));(r===null||r.ref!==a)&&(s.flags|=4194816)}}function Jp(r,s,a,c,m){return ao(s),a=kp(r,s,a,c,void 0,m),c=Ip(),r!==null&&!$t?(Dp(r,s,m),ms(r,s,m)):(et&&c&&pp(s),s.flags|=1,un(r,s,a,m),s.child)}function T0(r,s,a,c,m,g){return ao(s),s.updateQueue=null,a=Nx(s,c,a,m),Rx(r),c=Ip(),r!==null&&!$t?(Dp(r,s,g),ms(r,s,g)):(et&&c&&pp(s),s.flags|=1,un(r,s,a,g),s.child)}function C0(r,s,a,c,m){if(ao(s),s.stateNode===null){var g=ua,w=a.contextType;typeof w=="object"&&w!==null&&(g=cn(w)),g=new a(c,g),s.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Qp,s.stateNode=g,g._reactInternals=s,g=s.stateNode,g.props=c,g.state=s.memoizedState,g.refs={},Tp(s),w=a.contextType,g.context=typeof w=="object"&&w!==null?cn(w):ua,g.state=s.memoizedState,w=a.getDerivedStateFromProps,typeof w=="function"&&(Xp(s,a,w,c),g.state=s.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(w=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),w!==g.state&&Qp.enqueueReplaceState(g,g.state,null),Ql(s,c,g,m),Xl(),g.state=s.memoizedState),typeof g.componentDidMount=="function"&&(s.flags|=4194308),c=!0}else if(r===null){g=s.stateNode;var O=s.memoizedProps,B=po(a,O);g.props=B;var ee=g.context,le=a.contextType;w=ua,typeof le=="object"&&le!==null&&(w=cn(le));var ue=a.getDerivedStateFromProps;le=typeof ue=="function"||typeof g.getSnapshotBeforeUpdate=="function",O=s.pendingProps!==O,le||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(O||ee!==w)&&d0(s,g,c,w),Js=!1;var ne=s.memoizedState;g.state=ne,Ql(s,c,g,m),Xl(),ee=s.memoizedState,O||ne!==ee||Js?(typeof ue=="function"&&(Xp(s,a,ue,c),ee=s.memoizedState),(B=Js||f0(s,a,B,c,ne,ee,w))?(le||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(s.flags|=4194308)):(typeof g.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=c,s.memoizedState=ee),g.props=c,g.state=ee,g.context=w,c=B):(typeof g.componentDidMount=="function"&&(s.flags|=4194308),c=!1)}else{g=s.stateNode,Cp(r,s),w=s.memoizedProps,le=po(a,w),g.props=le,ue=s.pendingProps,ne=g.context,ee=a.contextType,B=ua,typeof ee=="object"&&ee!==null&&(B=cn(ee)),O=a.getDerivedStateFromProps,(ee=typeof O=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(w!==ue||ne!==B)&&d0(s,g,c,B),Js=!1,ne=s.memoizedState,g.state=ne,Ql(s,c,g,m),Xl();var oe=s.memoizedState;w!==ue||ne!==oe||Js||r!==null&&r.dependencies!==null&&Hu(r.dependencies)?(typeof O=="function"&&(Xp(s,a,O,c),oe=s.memoizedState),(le=Js||f0(s,a,le,c,ne,oe,B)||r!==null&&r.dependencies!==null&&Hu(r.dependencies))?(ee||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(c,oe,B),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(c,oe,B)),typeof g.componentDidUpdate=="function"&&(s.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof g.componentDidUpdate!="function"||w===r.memoizedProps&&ne===r.memoizedState||(s.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&ne===r.memoizedState||(s.flags|=1024),s.memoizedProps=c,s.memoizedState=oe),g.props=c,g.state=oe,g.context=B,c=le):(typeof g.componentDidUpdate!="function"||w===r.memoizedProps&&ne===r.memoizedState||(s.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||w===r.memoizedProps&&ne===r.memoizedState||(s.flags|=1024),c=!1)}return g=c,af(r,s),c=(s.flags&128)!==0,g||c?(g=s.stateNode,a=c&&typeof a.getDerivedStateFromError!="function"?null:g.render(),s.flags|=1,r!==null&&c?(s.child=fo(s,r.child,null,m),s.child=fo(s,null,a,m)):un(r,s,a,m),s.memoizedState=g.state,r=s.child):r=ms(r,s,m),r}function R0(r,s,a,c){return io(),s.flags|=256,un(r,s,a,c),s.child}var em={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tm(r){return{baseLanes:r,cachePool:gx()}}function nm(r,s,a){return r=r!==null?r.childLanes&~a:0,s&&(r|=Vn),r}function N0(r,s,a){var c=s.pendingProps,m=!1,g=(s.flags&128)!==0,w;if((w=g)||(w=r!==null&&r.memoizedState===null?!1:(Ht.current&2)!==0),w&&(m=!0,s.flags&=-129),w=(s.flags&32)!==0,s.flags&=-33,r===null){if(et){if(m?ni(s):ri(),(r=Nt)?(r=LS(r,pr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(s.memoizedState={dehydrated:r,treeContext:Xs!==null?{id:Gr,overflow:Kr}:null,retryLane:536870912,hydrationErrors:null},a=ax(r),a.return=s,s.child=a,ln=s,Nt=null)):r=null,r===null)throw Ws(s);return zm(r)?s.lanes=32:s.lanes=536870912,null}var O=c.children;return c=c.fallback,m?(ri(),m=s.mode,O=lf({mode:"hidden",children:O},m),c=so(c,m,a,null),O.return=s,c.return=s,O.sibling=c,s.child=O,c=s.child,c.memoizedState=tm(a),c.childLanes=nm(r,w,a),s.memoizedState=em,tc(null,c)):(ni(s),rm(s,O))}var B=r.memoizedState;if(B!==null&&(O=B.dehydrated,O!==null)){if(g)s.flags&256?(ni(s),s.flags&=-257,s=sm(r,s,a)):s.memoizedState!==null?(ri(),s.child=r.child,s.flags|=128,s=null):(ri(),O=c.fallback,m=s.mode,c=lf({mode:"visible",children:c.children},m),O=so(O,m,a,null),O.flags|=2,c.return=s,O.return=s,c.sibling=O,s.child=c,fo(s,r.child,null,a),c=s.child,c.memoizedState=tm(a),c.childLanes=nm(r,w,a),s.memoizedState=em,s=tc(null,c));else if(ni(s),zm(O)){if(w=O.nextSibling&&O.nextSibling.dataset,w)var ee=w.dgst;w=ee,c=Error(i(419)),c.stack="",c.digest=w,ql({value:c,source:null,stack:null}),s=sm(r,s,a)}else if($t||pa(r,s,a,!1),w=(a&r.childLanes)!==0,$t||w){if(w=wt,w!==null&&(c=Gs(w,a),c!==0&&c!==B.retryLane))throw B.retryLane=c,ro(r,c),jn(w,r,c),Zp;Pm(O)||yf(),s=sm(r,s,a)}else Pm(O)?(s.flags|=192,s.child=r.child,s=null):(r=B.treeContext,Nt=gr(O.nextSibling),ln=s,et=!0,Qs=null,pr=!1,r!==null&&ux(s,r),s=rm(s,c.children),s.flags|=4096);return s}return m?(ri(),O=c.fallback,m=s.mode,B=r.child,ee=B.sibling,c=cs(B,{mode:"hidden",children:c.children}),c.subtreeFlags=B.subtreeFlags&65011712,ee!==null?O=cs(ee,O):(O=so(O,m,a,null),O.flags|=2),O.return=s,c.return=s,c.sibling=O,s.child=c,tc(null,c),c=s.child,O=r.child.memoizedState,O===null?O=tm(a):(m=O.cachePool,m!==null?(B=qt._currentValue,m=m.parent!==B?{parent:B,pool:B}:m):m=gx(),O={baseLanes:O.baseLanes|a,cachePool:m}),c.memoizedState=O,c.childLanes=nm(r,w,a),s.memoizedState=em,tc(r.child,c)):(ni(s),a=r.child,r=a.sibling,a=cs(a,{mode:"visible",children:c.children}),a.return=s,a.sibling=null,r!==null&&(w=s.deletions,w===null?(s.deletions=[r],s.flags|=16):w.push(r)),s.child=a,s.memoizedState=null,a)}function rm(r,s){return s=lf({mode:"visible",children:s},r.mode),s.return=r,r.child=s}function lf(r,s){return r=Bn(22,r,null,s),r.lanes=0,r}function sm(r,s,a){return fo(s,r.child,null,a),r=rm(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function j0(r,s,a){r.lanes|=s;var c=r.alternate;c!==null&&(c.lanes|=s),bp(r.return,s,a)}function im(r,s,a,c,m,g){var w=r.memoizedState;w===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:c,tail:a,tailMode:m,treeForkCount:g}:(w.isBackwards=s,w.rendering=null,w.renderingStartTime=0,w.last=c,w.tail=a,w.tailMode=m,w.treeForkCount=g)}function M0(r,s,a){var c=s.pendingProps,m=c.revealOrder,g=c.tail;c=c.children;var w=Ht.current,O=(w&2)!==0;if(O?(w=w&1|2,s.flags|=128):w&=1,Z(Ht,w),un(r,s,c,a),c=et?Fl:0,!O&&r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&j0(r,a,s);else if(r.tag===19)j0(r,a,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(m){case"forwards":for(a=s.child,m=null;a!==null;)r=a.alternate,r!==null&&Xu(r)===null&&(m=a),a=a.sibling;a=m,a===null?(m=s.child,s.child=null):(m=a.sibling,a.sibling=null),im(s,!1,m,a,g,c);break;case"backwards":case"unstable_legacy-backwards":for(a=null,m=s.child,s.child=null;m!==null;){if(r=m.alternate,r!==null&&Xu(r)===null){s.child=m;break}r=m.sibling,m.sibling=a,a=m,m=r}im(s,!0,a,null,g,c);break;case"together":im(s,!1,null,null,void 0,c);break;default:s.memoizedState=null}return s.child}function ms(r,s,a){if(r!==null&&(s.dependencies=r.dependencies),oi|=s.lanes,(a&s.childLanes)===0)if(r!==null){if(pa(r,s,a,!1),(a&s.childLanes)===0)return null}else return null;if(r!==null&&s.child!==r.child)throw Error(i(153));if(s.child!==null){for(r=s.child,a=cs(r,r.pendingProps),s.child=a,a.return=s;r.sibling!==null;)r=r.sibling,a=a.sibling=cs(r,r.pendingProps),a.return=s;a.sibling=null}return s.child}function om(r,s){return(r.lanes&s)!==0?!0:(r=r.dependencies,!!(r!==null&&Hu(r)))}function AM(r,s,a){switch(s.tag){case 3:xe(s,s.stateNode.containerInfo),Zs(s,qt,r.memoizedState.cache),io();break;case 27:case 5:Be(s);break;case 4:xe(s,s.stateNode.containerInfo);break;case 10:Zs(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Ap(s),null;break;case 13:var c=s.memoizedState;if(c!==null)return c.dehydrated!==null?(ni(s),s.flags|=128,null):(a&s.child.childLanes)!==0?N0(r,s,a):(ni(s),r=ms(r,s,a),r!==null?r.sibling:null);ni(s);break;case 19:var m=(r.flags&128)!==0;if(c=(a&s.childLanes)!==0,c||(pa(r,s,a,!1),c=(a&s.childLanes)!==0),m){if(c)return M0(r,s,a);s.flags|=128}if(m=s.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),Z(Ht,Ht.current),c)break;return null;case 22:return s.lanes=0,E0(r,s,a,s.pendingProps);case 24:Zs(s,qt,r.memoizedState.cache)}return ms(r,s,a)}function A0(r,s,a){if(r!==null)if(r.memoizedProps!==s.pendingProps)$t=!0;else{if(!om(r,a)&&(s.flags&128)===0)return $t=!1,AM(r,s,a);$t=(r.flags&131072)!==0}else $t=!1,et&&(s.flags&1048576)!==0&&cx(s,Fl,s.index);switch(s.lanes=0,s.tag){case 16:e:{var c=s.pendingProps;if(r=co(s.elementType),s.type=r,typeof r=="function")fp(r)?(c=po(r,c),s.tag=1,s=C0(null,s,r,c,a)):(s.tag=0,s=Jp(null,s,r,c,a));else{if(r!=null){var m=r.$$typeof;if(m===N){s.tag=11,s=b0(null,s,r,c,a);break e}else if(m===j){s.tag=14,s=x0(null,s,r,c,a);break e}}throw s=X(r)||r,Error(i(306,s,""))}}return s;case 0:return Jp(r,s,s.type,s.pendingProps,a);case 1:return c=s.type,m=po(c,s.pendingProps),C0(r,s,c,m,a);case 3:e:{if(xe(s,s.stateNode.containerInfo),r===null)throw Error(i(387));c=s.pendingProps;var g=s.memoizedState;m=g.element,Cp(r,s),Ql(s,c,null,a);var w=s.memoizedState;if(c=w.cache,Zs(s,qt,c),c!==g.cache&&xp(s,[qt],a,!0),Xl(),c=w.element,g.isDehydrated)if(g={element:c,isDehydrated:!1,cache:w.cache},s.updateQueue.baseState=g,s.memoizedState=g,s.flags&256){s=R0(r,s,c,a);break e}else if(c!==m){m=fr(Error(i(424)),s),ql(m),s=R0(r,s,c,a);break e}else for(r=s.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,Nt=gr(r.firstChild),ln=s,et=!0,Qs=null,pr=!0,a=Ex(s,null,c,a),s.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(io(),c===m){s=ms(r,s,a);break e}un(r,s,c,a)}s=s.child}return s;case 26:return af(r,s),r===null?(a=FS(s.type,null,s.pendingProps,null))?s.memoizedState=a:et||(a=s.type,r=s.pendingProps,c=wf(ie.current).createElement(a),c[an]=s,c[_n]=r,fn(c,a,r),sn(c),s.stateNode=c):s.memoizedState=FS(s.type,r.memoizedProps,s.pendingProps,r.memoizedState),null;case 27:return Be(s),r===null&&et&&(c=s.stateNode=US(s.type,s.pendingProps,ie.current),ln=s,pr=!0,m=Nt,fi(s.type)?(Um=m,Nt=gr(c.firstChild)):Nt=m),un(r,s,s.pendingProps.children,a),af(r,s),r===null&&(s.flags|=4194304),s.child;case 5:return r===null&&et&&((m=c=Nt)&&(c=aA(c,s.type,s.pendingProps,pr),c!==null?(s.stateNode=c,ln=s,Nt=gr(c.firstChild),pr=!1,m=!0):m=!1),m||Ws(s)),Be(s),m=s.type,g=s.pendingProps,w=r!==null?r.memoizedProps:null,c=g.children,Im(m,g)?c=null:w!==null&&Im(m,w)&&(s.flags|=32),s.memoizedState!==null&&(m=kp(r,s,EM,null,null,a),gc._currentValue=m),af(r,s),un(r,s,c,a),s.child;case 6:return r===null&&et&&((r=a=Nt)&&(a=lA(a,s.pendingProps,pr),a!==null?(s.stateNode=a,ln=s,Nt=null,r=!0):r=!1),r||Ws(s)),null;case 13:return N0(r,s,a);case 4:return xe(s,s.stateNode.containerInfo),c=s.pendingProps,r===null?s.child=fo(s,null,c,a):un(r,s,c,a),s.child;case 11:return b0(r,s,s.type,s.pendingProps,a);case 7:return un(r,s,s.pendingProps,a),s.child;case 8:return un(r,s,s.pendingProps.children,a),s.child;case 12:return un(r,s,s.pendingProps.children,a),s.child;case 10:return c=s.pendingProps,Zs(s,s.type,c.value),un(r,s,c.children,a),s.child;case 9:return m=s.type._context,c=s.pendingProps.children,ao(s),m=cn(m),c=c(m),s.flags|=1,un(r,s,c,a),s.child;case 14:return x0(r,s,s.type,s.pendingProps,a);case 15:return S0(r,s,s.type,s.pendingProps,a);case 19:return M0(r,s,a);case 31:return MM(r,s,a);case 22:return E0(r,s,a,s.pendingProps);case 24:return ao(s),c=cn(qt),r===null?(m=_p(),m===null&&(m=wt,g=Sp(),m.pooledCache=g,g.refCount++,g!==null&&(m.pooledCacheLanes|=a),m=g),s.memoizedState={parent:c,cache:m},Tp(s),Zs(s,qt,m)):((r.lanes&a)!==0&&(Cp(r,s),Ql(s,null,null,a),Xl()),m=r.memoizedState,g=s.memoizedState,m.parent!==c?(m={parent:c,cache:c},s.memoizedState=m,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=m),Zs(s,qt,c)):(c=g.cache,Zs(s,qt,c),c!==m.cache&&xp(s,[qt],a,!0))),un(r,s,s.pendingProps.children,a),s.child;case 29:throw s.pendingProps}throw Error(i(156,s.tag))}function gs(r){r.flags|=4}function am(r,s,a,c,m){if((s=(r.mode&32)!==0)&&(s=!1),s){if(r.flags|=16777216,(m&335544128)===m)if(r.stateNode.complete)r.flags|=8192;else if(sS())r.flags|=8192;else throw uo=$u,wp}else r.flags&=-16777217}function O0(r,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!KS(s))if(sS())r.flags|=8192;else throw uo=$u,wp}function cf(r,s){s!==null&&(r.flags|=4),r.flags&16384&&(s=r.tag!==22?Wi():536870912,r.lanes|=s,Ca|=s)}function nc(r,s){if(!et)switch(r.tailMode){case"hidden":s=r.tail;for(var a=null;s!==null;)s.alternate!==null&&(a=s),s=s.sibling;a===null?r.tail=null:a.sibling=null;break;case"collapsed":a=r.tail;for(var c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:c.sibling=null}}function jt(r){var s=r.alternate!==null&&r.alternate.child===r.child,a=0,c=0;if(s)for(var m=r.child;m!==null;)a|=m.lanes|m.childLanes,c|=m.subtreeFlags&65011712,c|=m.flags&65011712,m.return=r,m=m.sibling;else for(m=r.child;m!==null;)a|=m.lanes|m.childLanes,c|=m.subtreeFlags,c|=m.flags,m.return=r,m=m.sibling;return r.subtreeFlags|=c,r.childLanes=a,s}function OM(r,s,a){var c=s.pendingProps;switch(mp(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(s),null;case 1:return jt(s),null;case 3:return a=s.stateNode,c=null,r!==null&&(c=r.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),ds(qt),de(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(r===null||r.child===null)&&(ha(s)?gs(s):r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,yp())),jt(s),null;case 26:var m=s.type,g=s.memoizedState;return r===null?(gs(s),g!==null?(jt(s),O0(s,g)):(jt(s),am(s,m,null,c,a))):g?g!==r.memoizedState?(gs(s),jt(s),O0(s,g)):(jt(s),s.flags&=-16777217):(r=r.memoizedProps,r!==c&&gs(s),jt(s),am(s,m,r,c,a)),null;case 27:if(_e(s),a=ie.current,m=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==c&&gs(s);else{if(!c){if(s.stateNode===null)throw Error(i(166));return jt(s),null}r=W.current,ha(s)?fx(s):(r=US(m,c,a),s.stateNode=r,gs(s))}return jt(s),null;case 5:if(_e(s),m=s.type,r!==null&&s.stateNode!=null)r.memoizedProps!==c&&gs(s);else{if(!c){if(s.stateNode===null)throw Error(i(166));return jt(s),null}if(g=W.current,ha(s))fx(s);else{var w=wf(ie.current);switch(g){case 1:g=w.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:g=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":g=w.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":g=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":g=w.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof c.is=="string"?w.createElement("select",{is:c.is}):w.createElement("select"),c.multiple?g.multiple=!0:c.size&&(g.size=c.size);break;default:g=typeof c.is=="string"?w.createElement(m,{is:c.is}):w.createElement(m)}}g[an]=s,g[_n]=c;e:for(w=s.child;w!==null;){if(w.tag===5||w.tag===6)g.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===s)break e;for(;w.sibling===null;){if(w.return===null||w.return===s)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}s.stateNode=g;e:switch(fn(g,m,c),m){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&gs(s)}}return jt(s),am(s,s.type,r===null?null:r.memoizedProps,s.pendingProps,a),null;case 6:if(r&&s.stateNode!=null)r.memoizedProps!==c&&gs(s);else{if(typeof c!="string"&&s.stateNode===null)throw Error(i(166));if(r=ie.current,ha(s)){if(r=s.stateNode,a=s.memoizedProps,c=null,m=ln,m!==null)switch(m.tag){case 27:case 5:c=m.memoizedProps}r[an]=s,r=!!(r.nodeValue===a||c!==null&&c.suppressHydrationWarning===!0||NS(r.nodeValue,a)),r||Ws(s,!0)}else r=wf(r).createTextNode(c),r[an]=s,s.stateNode=r}return jt(s),null;case 31:if(a=s.memoizedState,r===null||r.memoizedState!==null){if(c=ha(s),a!==null){if(r===null){if(!c)throw Error(i(318));if(r=s.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(i(557));r[an]=s}else io(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;jt(s),r=!1}else a=yp(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=a),r=!0;if(!r)return s.flags&256?(Fn(s),s):(Fn(s),null);if((s.flags&128)!==0)throw Error(i(558))}return jt(s),null;case 13:if(c=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(m=ha(s),c!==null&&c.dehydrated!==null){if(r===null){if(!m)throw Error(i(318));if(m=s.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(i(317));m[an]=s}else io(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;jt(s),m=!1}else m=yp(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=m),m=!0;if(!m)return s.flags&256?(Fn(s),s):(Fn(s),null)}return Fn(s),(s.flags&128)!==0?(s.lanes=a,s):(a=c!==null,r=r!==null&&r.memoizedState!==null,a&&(c=s.child,m=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(m=c.alternate.memoizedState.cachePool.pool),g=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(g=c.memoizedState.cachePool.pool),g!==m&&(c.flags|=2048)),a!==r&&a&&(s.child.flags|=8192),cf(s,s.updateQueue),jt(s),null);case 4:return de(),r===null&&jm(s.stateNode.containerInfo),jt(s),null;case 10:return ds(s.type),jt(s),null;case 19:if(K(Ht),c=s.memoizedState,c===null)return jt(s),null;if(m=(s.flags&128)!==0,g=c.rendering,g===null)if(m)nc(c,!1);else{if(Dt!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(g=Xu(r),g!==null){for(s.flags|=128,nc(c,!1),r=g.updateQueue,s.updateQueue=r,cf(s,r),s.subtreeFlags=0,r=a,a=s.child;a!==null;)ox(a,r),a=a.sibling;return Z(Ht,Ht.current&1|2),et&&us(s,c.treeForkCount),s.child}r=r.sibling}c.tail!==null&&ze()>pf&&(s.flags|=128,m=!0,nc(c,!1),s.lanes=4194304)}else{if(!m)if(r=Xu(g),r!==null){if(s.flags|=128,m=!0,r=r.updateQueue,s.updateQueue=r,cf(s,r),nc(c,!0),c.tail===null&&c.tailMode==="hidden"&&!g.alternate&&!et)return jt(s),null}else 2*ze()-c.renderingStartTime>pf&&a!==536870912&&(s.flags|=128,m=!0,nc(c,!1),s.lanes=4194304);c.isBackwards?(g.sibling=s.child,s.child=g):(r=c.last,r!==null?r.sibling=g:s.child=g,c.last=g)}return c.tail!==null?(r=c.tail,c.rendering=r,c.tail=r.sibling,c.renderingStartTime=ze(),r.sibling=null,a=Ht.current,Z(Ht,m?a&1|2:a&1),et&&us(s,c.treeForkCount),r):(jt(s),null);case 22:case 23:return Fn(s),Mp(),c=s.memoizedState!==null,r!==null?r.memoizedState!==null!==c&&(s.flags|=8192):c&&(s.flags|=8192),c?(a&536870912)!==0&&(s.flags&128)===0&&(jt(s),s.subtreeFlags&6&&(s.flags|=8192)):jt(s),a=s.updateQueue,a!==null&&cf(s,a.retryQueue),a=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),c=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),c!==a&&(s.flags|=2048),r!==null&&K(lo),null;case 24:return a=null,r!==null&&(a=r.memoizedState.cache),s.memoizedState.cache!==a&&(s.flags|=2048),ds(qt),jt(s),null;case 25:return null;case 30:return null}throw Error(i(156,s.tag))}function kM(r,s){switch(mp(s),s.tag){case 1:return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return ds(qt),de(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 26:case 27:case 5:return _e(s),null;case 31:if(s.memoizedState!==null){if(Fn(s),s.alternate===null)throw Error(i(340));io()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 13:if(Fn(s),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(i(340));io()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return K(Ht),null;case 4:return de(),null;case 10:return ds(s.type),null;case 22:case 23:return Fn(s),Mp(),r!==null&&K(lo),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 24:return ds(qt),null;case 25:return null;default:return null}}function k0(r,s){switch(mp(s),s.tag){case 3:ds(qt),de();break;case 26:case 27:case 5:_e(s);break;case 4:de();break;case 31:s.memoizedState!==null&&Fn(s);break;case 13:Fn(s);break;case 19:K(Ht);break;case 10:ds(s.type);break;case 22:case 23:Fn(s),Mp(),r!==null&&K(lo);break;case 24:ds(qt)}}function rc(r,s){try{var a=s.updateQueue,c=a!==null?a.lastEffect:null;if(c!==null){var m=c.next;a=m;do{if((a.tag&r)===r){c=void 0;var g=a.create,w=a.inst;c=g(),w.destroy=c}a=a.next}while(a!==m)}}catch(O){bt(s,s.return,O)}}function si(r,s,a){try{var c=s.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var g=m.next;c=g;do{if((c.tag&r)===r){var w=c.inst,O=w.destroy;if(O!==void 0){w.destroy=void 0,m=s;var B=a,ee=O;try{ee()}catch(le){bt(m,B,le)}}}c=c.next}while(c!==g)}}catch(le){bt(s,s.return,le)}}function I0(r){var s=r.updateQueue;if(s!==null){var a=r.stateNode;try{wx(s,a)}catch(c){bt(r,r.return,c)}}}function D0(r,s,a){a.props=po(r.type,r.memoizedProps),a.state=r.memoizedState;try{a.componentWillUnmount()}catch(c){bt(r,s,c)}}function sc(r,s){try{var a=r.ref;if(a!==null){switch(r.tag){case 26:case 27:case 5:var c=r.stateNode;break;case 30:c=r.stateNode;break;default:c=r.stateNode}typeof a=="function"?r.refCleanup=a(c):a.current=c}}catch(m){bt(r,s,m)}}function Yr(r,s){var a=r.ref,c=r.refCleanup;if(a!==null)if(typeof c=="function")try{c()}catch(m){bt(r,s,m)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(m){bt(r,s,m)}else a.current=null}function L0(r){var s=r.type,a=r.memoizedProps,c=r.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":a.autoFocus&&c.focus();break e;case"img":a.src?c.src=a.src:a.srcSet&&(c.srcset=a.srcSet)}}catch(m){bt(r,r.return,m)}}function lm(r,s,a){try{var c=r.stateNode;tA(c,r.type,a,s),c[_n]=s}catch(m){bt(r,r.return,m)}}function P0(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&fi(r.type)||r.tag===4}function cm(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||P0(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&fi(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function um(r,s,a){var c=r.tag;if(c===5||c===6)r=r.stateNode,s?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(r,s):(s=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,s.appendChild(r),a=a._reactRootContainer,a!=null||s.onclick!==null||(s.onclick=as));else if(c!==4&&(c===27&&fi(r.type)&&(a=r.stateNode,s=null),r=r.child,r!==null))for(um(r,s,a),r=r.sibling;r!==null;)um(r,s,a),r=r.sibling}function uf(r,s,a){var c=r.tag;if(c===5||c===6)r=r.stateNode,s?a.insertBefore(r,s):a.appendChild(r);else if(c!==4&&(c===27&&fi(r.type)&&(a=r.stateNode),r=r.child,r!==null))for(uf(r,s,a),r=r.sibling;r!==null;)uf(r,s,a),r=r.sibling}function z0(r){var s=r.stateNode,a=r.memoizedProps;try{for(var c=r.type,m=s.attributes;m.length;)s.removeAttributeNode(m[0]);fn(s,c,a),s[an]=r,s[_n]=a}catch(g){bt(r,r.return,g)}}var ys=!1,Gt=!1,fm=!1,U0=typeof WeakSet=="function"?WeakSet:Set,on=null;function IM(r,s){if(r=r.containerInfo,Om=Af,r=Wb(r),sp(r)){if("selectionStart"in r)var a={start:r.selectionStart,end:r.selectionEnd};else e:{a=(a=r.ownerDocument)&&a.defaultView||window;var c=a.getSelection&&a.getSelection();if(c&&c.rangeCount!==0){a=c.anchorNode;var m=c.anchorOffset,g=c.focusNode;c=c.focusOffset;try{a.nodeType,g.nodeType}catch{a=null;break e}var w=0,O=-1,B=-1,ee=0,le=0,ue=r,ne=null;t:for(;;){for(var oe;ue!==a||m!==0&&ue.nodeType!==3||(O=w+m),ue!==g||c!==0&&ue.nodeType!==3||(B=w+c),ue.nodeType===3&&(w+=ue.nodeValue.length),(oe=ue.firstChild)!==null;)ne=ue,ue=oe;for(;;){if(ue===r)break t;if(ne===a&&++ee===m&&(O=w),ne===g&&++le===c&&(B=w),(oe=ue.nextSibling)!==null)break;ue=ne,ne=ue.parentNode}ue=oe}a=O===-1||B===-1?null:{start:O,end:B}}else a=null}a=a||{start:0,end:0}}else a=null;for(km={focusedElem:r,selectionRange:a},Af=!1,on=s;on!==null;)if(s=on,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,on=r;else for(;on!==null;){switch(s=on,g=s.alternate,r=s.flags,s.tag){case 0:if((r&4)!==0&&(r=s.updateQueue,r=r!==null?r.events:null,r!==null))for(a=0;a<r.length;a++)m=r[a],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&g!==null){r=void 0,a=s,m=g.memoizedProps,g=g.memoizedState,c=a.stateNode;try{var Ce=po(a.type,m);r=c.getSnapshotBeforeUpdate(Ce,g),c.__reactInternalSnapshotBeforeUpdate=r}catch(Pe){bt(a,a.return,Pe)}}break;case 3:if((r&1024)!==0){if(r=s.stateNode.containerInfo,a=r.nodeType,a===9)Lm(r);else if(a===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Lm(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(i(163))}if(r=s.sibling,r!==null){r.return=s.return,on=r;break}on=s.return}}function B0(r,s,a){var c=a.flags;switch(a.tag){case 0:case 11:case 15:bs(r,a),c&4&&rc(5,a);break;case 1:if(bs(r,a),c&4)if(r=a.stateNode,s===null)try{r.componentDidMount()}catch(w){bt(a,a.return,w)}else{var m=po(a.type,s.memoizedProps);s=s.memoizedState;try{r.componentDidUpdate(m,s,r.__reactInternalSnapshotBeforeUpdate)}catch(w){bt(a,a.return,w)}}c&64&&I0(a),c&512&&sc(a,a.return);break;case 3:if(bs(r,a),c&64&&(r=a.updateQueue,r!==null)){if(s=null,a.child!==null)switch(a.child.tag){case 27:case 5:s=a.child.stateNode;break;case 1:s=a.child.stateNode}try{wx(r,s)}catch(w){bt(a,a.return,w)}}break;case 27:s===null&&c&4&&z0(a);case 26:case 5:bs(r,a),s===null&&c&4&&L0(a),c&512&&sc(a,a.return);break;case 12:bs(r,a);break;case 31:bs(r,a),c&4&&q0(r,a);break;case 13:bs(r,a),c&4&&V0(r,a),c&64&&(r=a.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(a=qM.bind(null,a),cA(r,a))));break;case 22:if(c=a.memoizedState!==null||ys,!c){s=s!==null&&s.memoizedState!==null||Gt,m=ys;var g=Gt;ys=c,(Gt=s)&&!g?xs(r,a,(a.subtreeFlags&8772)!==0):bs(r,a),ys=m,Gt=g}break;case 30:break;default:bs(r,a)}}function H0(r){var s=r.alternate;s!==null&&(r.alternate=null,H0(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&Hh(s)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var Ot=null,Tn=!1;function vs(r,s,a){for(a=a.child;a!==null;)F0(r,s,a),a=a.sibling}function F0(r,s,a){if(Ut&&typeof Ut.onCommitFiberUnmount=="function")try{Ut.onCommitFiberUnmount(ar,a)}catch{}switch(a.tag){case 26:Gt||Yr(a,s),vs(r,s,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Gt||Yr(a,s);var c=Ot,m=Tn;fi(a.type)&&(Ot=a.stateNode,Tn=!1),vs(r,s,a),hc(a.stateNode),Ot=c,Tn=m;break;case 5:Gt||Yr(a,s);case 6:if(c=Ot,m=Tn,Ot=null,vs(r,s,a),Ot=c,Tn=m,Ot!==null)if(Tn)try{(Ot.nodeType===9?Ot.body:Ot.nodeName==="HTML"?Ot.ownerDocument.body:Ot).removeChild(a.stateNode)}catch(g){bt(a,s,g)}else try{Ot.removeChild(a.stateNode)}catch(g){bt(a,s,g)}break;case 18:Ot!==null&&(Tn?(r=Ot,IS(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,a.stateNode),Ia(r)):IS(Ot,a.stateNode));break;case 4:c=Ot,m=Tn,Ot=a.stateNode.containerInfo,Tn=!0,vs(r,s,a),Ot=c,Tn=m;break;case 0:case 11:case 14:case 15:si(2,a,s),Gt||si(4,a,s),vs(r,s,a);break;case 1:Gt||(Yr(a,s),c=a.stateNode,typeof c.componentWillUnmount=="function"&&D0(a,s,c)),vs(r,s,a);break;case 21:vs(r,s,a);break;case 22:Gt=(c=Gt)||a.memoizedState!==null,vs(r,s,a),Gt=c;break;default:vs(r,s,a)}}function q0(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{Ia(r)}catch(a){bt(s,s.return,a)}}}function V0(r,s){if(s.memoizedState===null&&(r=s.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{Ia(r)}catch(a){bt(s,s.return,a)}}function DM(r){switch(r.tag){case 31:case 13:case 19:var s=r.stateNode;return s===null&&(s=r.stateNode=new U0),s;case 22:return r=r.stateNode,s=r._retryCache,s===null&&(s=r._retryCache=new U0),s;default:throw Error(i(435,r.tag))}}function ff(r,s){var a=DM(r);s.forEach(function(c){if(!a.has(c)){a.add(c);var m=VM.bind(null,r,c);c.then(m,m)}})}function Cn(r,s){var a=s.deletions;if(a!==null)for(var c=0;c<a.length;c++){var m=a[c],g=r,w=s,O=w;e:for(;O!==null;){switch(O.tag){case 27:if(fi(O.type)){Ot=O.stateNode,Tn=!1;break e}break;case 5:Ot=O.stateNode,Tn=!1;break e;case 3:case 4:Ot=O.stateNode.containerInfo,Tn=!0;break e}O=O.return}if(Ot===null)throw Error(i(160));F0(g,w,m),Ot=null,Tn=!1,g=m.alternate,g!==null&&(g.return=null),m.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)$0(s,r),s=s.sibling}var Or=null;function $0(r,s){var a=r.alternate,c=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Cn(s,r),Rn(r),c&4&&(si(3,r,r.return),rc(3,r),si(5,r,r.return));break;case 1:Cn(s,r),Rn(r),c&512&&(Gt||a===null||Yr(a,a.return)),c&64&&ys&&(r=r.updateQueue,r!==null&&(c=r.callbacks,c!==null&&(a=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=a===null?c:a.concat(c))));break;case 26:var m=Or;if(Cn(s,r),Rn(r),c&512&&(Gt||a===null||Yr(a,a.return)),c&4){var g=a!==null?a.memoizedState:null;if(c=r.memoizedState,a===null)if(c===null)if(r.stateNode===null){e:{c=r.type,a=r.memoizedProps,m=m.ownerDocument||m;t:switch(c){case"title":g=m.getElementsByTagName("title")[0],(!g||g[Al]||g[an]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=m.createElement(c),m.head.insertBefore(g,m.querySelector("head > title"))),fn(g,c,a),g[an]=r,sn(g),c=g;break e;case"link":var w=$S("link","href",m).get(c+(a.href||""));if(w){for(var O=0;O<w.length;O++)if(g=w[O],g.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&g.getAttribute("rel")===(a.rel==null?null:a.rel)&&g.getAttribute("title")===(a.title==null?null:a.title)&&g.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){w.splice(O,1);break t}}g=m.createElement(c),fn(g,c,a),m.head.appendChild(g);break;case"meta":if(w=$S("meta","content",m).get(c+(a.content||""))){for(O=0;O<w.length;O++)if(g=w[O],g.getAttribute("content")===(a.content==null?null:""+a.content)&&g.getAttribute("name")===(a.name==null?null:a.name)&&g.getAttribute("property")===(a.property==null?null:a.property)&&g.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&g.getAttribute("charset")===(a.charSet==null?null:a.charSet)){w.splice(O,1);break t}}g=m.createElement(c),fn(g,c,a),m.head.appendChild(g);break;default:throw Error(i(468,c))}g[an]=r,sn(g),c=g}r.stateNode=c}else GS(m,r.type,r.stateNode);else r.stateNode=VS(m,c,r.memoizedProps);else g!==c?(g===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):g.count--,c===null?GS(m,r.type,r.stateNode):VS(m,c,r.memoizedProps)):c===null&&r.stateNode!==null&&lm(r,r.memoizedProps,a.memoizedProps)}break;case 27:Cn(s,r),Rn(r),c&512&&(Gt||a===null||Yr(a,a.return)),a!==null&&c&4&&lm(r,r.memoizedProps,a.memoizedProps);break;case 5:if(Cn(s,r),Rn(r),c&512&&(Gt||a===null||Yr(a,a.return)),r.flags&32){m=r.stateNode;try{ra(m,"")}catch(Ce){bt(r,r.return,Ce)}}c&4&&r.stateNode!=null&&(m=r.memoizedProps,lm(r,m,a!==null?a.memoizedProps:m)),c&1024&&(fm=!0);break;case 6:if(Cn(s,r),Rn(r),c&4){if(r.stateNode===null)throw Error(i(162));c=r.memoizedProps,a=r.stateNode;try{a.nodeValue=c}catch(Ce){bt(r,r.return,Ce)}}break;case 3:if(Rf=null,m=Or,Or=Tf(s.containerInfo),Cn(s,r),Or=m,Rn(r),c&4&&a!==null&&a.memoizedState.isDehydrated)try{Ia(s.containerInfo)}catch(Ce){bt(r,r.return,Ce)}fm&&(fm=!1,G0(r));break;case 4:c=Or,Or=Tf(r.stateNode.containerInfo),Cn(s,r),Rn(r),Or=c;break;case 12:Cn(s,r),Rn(r);break;case 31:Cn(s,r),Rn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,ff(r,c)));break;case 13:Cn(s,r),Rn(r),r.child.flags&8192&&r.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(hf=ze()),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,ff(r,c)));break;case 22:m=r.memoizedState!==null;var B=a!==null&&a.memoizedState!==null,ee=ys,le=Gt;if(ys=ee||m,Gt=le||B,Cn(s,r),Gt=le,ys=ee,Rn(r),c&8192)e:for(s=r.stateNode,s._visibility=m?s._visibility&-2:s._visibility|1,m&&(a===null||B||ys||Gt||mo(r)),a=null,s=r;;){if(s.tag===5||s.tag===26){if(a===null){B=a=s;try{if(g=B.stateNode,m)w=g.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{O=B.stateNode;var ue=B.memoizedProps.style,ne=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;O.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Ce){bt(B,B.return,Ce)}}}else if(s.tag===6){if(a===null){B=s;try{B.stateNode.nodeValue=m?"":B.memoizedProps}catch(Ce){bt(B,B.return,Ce)}}}else if(s.tag===18){if(a===null){B=s;try{var oe=B.stateNode;m?DS(oe,!0):DS(B.stateNode,!1)}catch(Ce){bt(B,B.return,Ce)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===r)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break e;for(;s.sibling===null;){if(s.return===null||s.return===r)break e;a===s&&(a=null),s=s.return}a===s&&(a=null),s.sibling.return=s.return,s=s.sibling}c&4&&(c=r.updateQueue,c!==null&&(a=c.retryQueue,a!==null&&(c.retryQueue=null,ff(r,a))));break;case 19:Cn(s,r),Rn(r),c&4&&(c=r.updateQueue,c!==null&&(r.updateQueue=null,ff(r,c)));break;case 30:break;case 21:break;default:Cn(s,r),Rn(r)}}function Rn(r){var s=r.flags;if(s&2){try{for(var a,c=r.return;c!==null;){if(P0(c)){a=c;break}c=c.return}if(a==null)throw Error(i(160));switch(a.tag){case 27:var m=a.stateNode,g=cm(r);uf(r,g,m);break;case 5:var w=a.stateNode;a.flags&32&&(ra(w,""),a.flags&=-33);var O=cm(r);uf(r,O,w);break;case 3:case 4:var B=a.stateNode.containerInfo,ee=cm(r);um(r,ee,B);break;default:throw Error(i(161))}}catch(le){bt(r,r.return,le)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function G0(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var s=r;G0(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),r=r.sibling}}function bs(r,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)B0(r,s.alternate,s),s=s.sibling}function mo(r){for(r=r.child;r!==null;){var s=r;switch(s.tag){case 0:case 11:case 14:case 15:si(4,s,s.return),mo(s);break;case 1:Yr(s,s.return);var a=s.stateNode;typeof a.componentWillUnmount=="function"&&D0(s,s.return,a),mo(s);break;case 27:hc(s.stateNode);case 26:case 5:Yr(s,s.return),mo(s);break;case 22:s.memoizedState===null&&mo(s);break;case 30:mo(s);break;default:mo(s)}r=r.sibling}}function xs(r,s,a){for(a=a&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var c=s.alternate,m=r,g=s,w=g.flags;switch(g.tag){case 0:case 11:case 15:xs(m,g,a),rc(4,g);break;case 1:if(xs(m,g,a),c=g,m=c.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(ee){bt(c,c.return,ee)}if(c=g,m=c.updateQueue,m!==null){var O=c.stateNode;try{var B=m.shared.hiddenCallbacks;if(B!==null)for(m.shared.hiddenCallbacks=null,m=0;m<B.length;m++)_x(B[m],O)}catch(ee){bt(c,c.return,ee)}}a&&w&64&&I0(g),sc(g,g.return);break;case 27:z0(g);case 26:case 5:xs(m,g,a),a&&c===null&&w&4&&L0(g),sc(g,g.return);break;case 12:xs(m,g,a);break;case 31:xs(m,g,a),a&&w&4&&q0(m,g);break;case 13:xs(m,g,a),a&&w&4&&V0(m,g);break;case 22:g.memoizedState===null&&xs(m,g,a),sc(g,g.return);break;case 30:break;default:xs(m,g,a)}s=s.sibling}}function dm(r,s){var a=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),r=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(r=s.memoizedState.cachePool.pool),r!==a&&(r!=null&&r.refCount++,a!=null&&Vl(a))}function hm(r,s){r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&Vl(r))}function kr(r,s,a,c){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)K0(r,s,a,c),s=s.sibling}function K0(r,s,a,c){var m=s.flags;switch(s.tag){case 0:case 11:case 15:kr(r,s,a,c),m&2048&&rc(9,s);break;case 1:kr(r,s,a,c);break;case 3:kr(r,s,a,c),m&2048&&(r=null,s.alternate!==null&&(r=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==r&&(s.refCount++,r!=null&&Vl(r)));break;case 12:if(m&2048){kr(r,s,a,c),r=s.stateNode;try{var g=s.memoizedProps,w=g.id,O=g.onPostCommit;typeof O=="function"&&O(w,s.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(B){bt(s,s.return,B)}}else kr(r,s,a,c);break;case 31:kr(r,s,a,c);break;case 13:kr(r,s,a,c);break;case 23:break;case 22:g=s.stateNode,w=s.alternate,s.memoizedState!==null?g._visibility&2?kr(r,s,a,c):ic(r,s):g._visibility&2?kr(r,s,a,c):(g._visibility|=2,_a(r,s,a,c,(s.subtreeFlags&10256)!==0||!1)),m&2048&&dm(w,s);break;case 24:kr(r,s,a,c),m&2048&&hm(s.alternate,s);break;default:kr(r,s,a,c)}}function _a(r,s,a,c,m){for(m=m&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var g=r,w=s,O=a,B=c,ee=w.flags;switch(w.tag){case 0:case 11:case 15:_a(g,w,O,B,m),rc(8,w);break;case 23:break;case 22:var le=w.stateNode;w.memoizedState!==null?le._visibility&2?_a(g,w,O,B,m):ic(g,w):(le._visibility|=2,_a(g,w,O,B,m)),m&&ee&2048&&dm(w.alternate,w);break;case 24:_a(g,w,O,B,m),m&&ee&2048&&hm(w.alternate,w);break;default:_a(g,w,O,B,m)}s=s.sibling}}function ic(r,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var a=r,c=s,m=c.flags;switch(c.tag){case 22:ic(a,c),m&2048&&dm(c.alternate,c);break;case 24:ic(a,c),m&2048&&hm(c.alternate,c);break;default:ic(a,c)}s=s.sibling}}var oc=8192;function wa(r,s,a){if(r.subtreeFlags&oc)for(r=r.child;r!==null;)Y0(r,s,a),r=r.sibling}function Y0(r,s,a){switch(r.tag){case 26:wa(r,s,a),r.flags&oc&&r.memoizedState!==null&&SA(a,Or,r.memoizedState,r.memoizedProps);break;case 5:wa(r,s,a);break;case 3:case 4:var c=Or;Or=Tf(r.stateNode.containerInfo),wa(r,s,a),Or=c;break;case 22:r.memoizedState===null&&(c=r.alternate,c!==null&&c.memoizedState!==null?(c=oc,oc=16777216,wa(r,s,a),oc=c):wa(r,s,a));break;default:wa(r,s,a)}}function X0(r){var s=r.alternate;if(s!==null&&(r=s.child,r!==null)){s.child=null;do s=r.sibling,r.sibling=null,r=s;while(r!==null)}}function ac(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var a=0;a<s.length;a++){var c=s[a];on=c,W0(c,r)}X0(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Q0(r),r=r.sibling}function Q0(r){switch(r.tag){case 0:case 11:case 15:ac(r),r.flags&2048&&si(9,r,r.return);break;case 3:ac(r);break;case 12:ac(r);break;case 22:var s=r.stateNode;r.memoizedState!==null&&s._visibility&2&&(r.return===null||r.return.tag!==13)?(s._visibility&=-3,df(r)):ac(r);break;default:ac(r)}}function df(r){var s=r.deletions;if((r.flags&16)!==0){if(s!==null)for(var a=0;a<s.length;a++){var c=s[a];on=c,W0(c,r)}X0(r)}for(r=r.child;r!==null;){switch(s=r,s.tag){case 0:case 11:case 15:si(8,s,s.return),df(s);break;case 22:a=s.stateNode,a._visibility&2&&(a._visibility&=-3,df(s));break;default:df(s)}r=r.sibling}}function W0(r,s){for(;on!==null;){var a=on;switch(a.tag){case 0:case 11:case 15:si(8,a,s);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var c=a.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Vl(a.memoizedState.cache)}if(c=a.child,c!==null)c.return=a,on=c;else e:for(a=r;on!==null;){c=on;var m=c.sibling,g=c.return;if(H0(c),c===a){on=null;break e}if(m!==null){m.return=g,on=m;break e}on=g}}}var LM={getCacheForType:function(r){var s=cn(qt),a=s.data.get(r);return a===void 0&&(a=r(),s.data.set(r,a)),a},cacheSignal:function(){return cn(qt).controller.signal}},PM=typeof WeakMap=="function"?WeakMap:Map,ht=0,wt=null,Qe=null,Ze=0,vt=0,qn=null,ii=!1,Ta=!1,pm=!1,Ss=0,Dt=0,oi=0,go=0,mm=0,Vn=0,Ca=0,lc=null,Nn=null,gm=!1,hf=0,Z0=0,pf=1/0,mf=null,ai=null,Qt=0,li=null,Ra=null,Es=0,ym=0,vm=null,J0=null,cc=0,bm=null;function $n(){return(ht&2)!==0&&Ze!==0?Ze&-Ze:L.T!==null?Tm():_u()}function eS(){if(Vn===0)if((Ze&536870912)===0||et){var r=dn;dn<<=1,(dn&3932160)===0&&(dn=262144),Vn=r}else Vn=536870912;return r=Hn.current,r!==null&&(r.flags|=32),Vn}function jn(r,s,a){(r===wt&&(vt===2||vt===9)||r.cancelPendingCommit!==null)&&(Na(r,0),ci(r,Ze,Vn,!1)),is(r,a),((ht&2)===0||r!==wt)&&(r===wt&&((ht&2)===0&&(go|=a),Dt===4&&ci(r,Ze,Vn,!1)),Xr(r))}function tS(r,s,a){if((ht&6)!==0)throw Error(i(327));var c=!a&&(s&127)===0&&(s&r.expiredLanes)===0||Vr(r,s),m=c?BM(r,s):Sm(r,s,!0),g=c;do{if(m===0){Ta&&!c&&ci(r,s,0,!1);break}else{if(a=r.current.alternate,g&&!zM(a)){m=Sm(r,s,!1),g=!1;continue}if(m===2){if(g=s,r.errorRecoveryDisabledLanes&g)var w=0;else w=r.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){s=w;e:{var O=r;m=lc;var B=O.current.memoizedState.isDehydrated;if(B&&(Na(O,w).flags|=256),w=Sm(O,w,!1),w!==2){if(pm&&!B){O.errorRecoveryDisabledLanes|=g,go|=g,m=4;break e}g=Nn,Nn=m,g!==null&&(Nn===null?Nn=g:Nn.push.apply(Nn,g))}m=w}if(g=!1,m!==2)continue}}if(m===1){Na(r,0),ci(r,s,0,!0);break}e:{switch(c=r,g=m,g){case 0:case 1:throw Error(i(345));case 4:if((s&4194048)!==s)break;case 6:ci(c,s,Vn,!ii);break e;case 2:Nn=null;break;case 3:case 5:break;default:throw Error(i(329))}if((s&62914560)===s&&(m=hf+300-ze(),10<m)){if(ci(c,s,Vn,!ii),qr(c,0,!0)!==0)break e;Es=s,c.timeoutHandle=OS(nS.bind(null,c,a,Nn,mf,gm,s,Vn,go,Ca,ii,g,"Throttled",-0,0),m);break e}nS(c,a,Nn,mf,gm,s,Vn,go,Ca,ii,g,null,-0,0)}}break}while(!0);Xr(r)}function nS(r,s,a,c,m,g,w,O,B,ee,le,ue,ne,oe){if(r.timeoutHandle=-1,ue=s.subtreeFlags,ue&8192||(ue&16785408)===16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:as},Y0(s,g,ue);var Ce=(g&62914560)===g?hf-ze():(g&4194048)===g?Z0-ze():0;if(Ce=EA(ue,Ce),Ce!==null){Es=g,r.cancelPendingCommit=Ce(uS.bind(null,r,s,g,a,c,m,w,O,B,le,ue,null,ne,oe)),ci(r,g,w,!ee);return}}uS(r,s,g,a,c,m,w,O,B)}function zM(r){for(var s=r;;){var a=s.tag;if((a===0||a===11||a===15)&&s.flags&16384&&(a=s.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var c=0;c<a.length;c++){var m=a[c],g=m.getSnapshot;m=m.value;try{if(!Un(g(),m))return!1}catch{return!1}}if(a=s.child,s.subtreeFlags&16384&&a!==null)a.return=s,s=a;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function ci(r,s,a,c){s&=~mm,s&=~go,r.suspendedLanes|=s,r.pingedLanes&=~s,c&&(r.warmLanes|=s),c=r.expirationTimes;for(var m=s;0<m;){var g=31-yt(m),w=1<<g;c[g]=-1,m&=~w}a!==0&&$r(r,a,s)}function gf(){return(ht&6)===0?(uc(0),!1):!0}function xm(){if(Qe!==null){if(vt===0)var r=Qe.return;else r=Qe,fs=oo=null,Lp(r),va=null,Gl=0,r=Qe;for(;r!==null;)k0(r.alternate,r),r=r.return;Qe=null}}function Na(r,s){var a=r.timeoutHandle;a!==-1&&(r.timeoutHandle=-1,sA(a)),a=r.cancelPendingCommit,a!==null&&(r.cancelPendingCommit=null,a()),Es=0,xm(),wt=r,Qe=a=cs(r.current,null),Ze=s,vt=0,qn=null,ii=!1,Ta=Vr(r,s),pm=!1,Ca=Vn=mm=go=oi=Dt=0,Nn=lc=null,gm=!1,(s&8)!==0&&(s|=s&32);var c=r.entangledLanes;if(c!==0)for(r=r.entanglements,c&=s;0<c;){var m=31-yt(c),g=1<<m;s|=r[m],c&=~g}return Ss=s,Lu(),a}function rS(r,s){$e=null,L.H=ec,s===ya||s===Vu?(s=bx(),vt=3):s===wp?(s=bx(),vt=4):vt=s===Zp?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,qn=s,Qe===null&&(Dt=1,sf(r,fr(s,r.current)))}function sS(){var r=Hn.current;return r===null?!0:(Ze&4194048)===Ze?mr===null:(Ze&62914560)===Ze||(Ze&536870912)!==0?r===mr:!1}function iS(){var r=L.H;return L.H=ec,r===null?ec:r}function oS(){var r=L.A;return L.A=LM,r}function yf(){Dt=4,ii||(Ze&4194048)!==Ze&&Hn.current!==null||(Ta=!0),(oi&134217727)===0&&(go&134217727)===0||wt===null||ci(wt,Ze,Vn,!1)}function Sm(r,s,a){var c=ht;ht|=2;var m=iS(),g=oS();(wt!==r||Ze!==s)&&(mf=null,Na(r,s)),s=!1;var w=Dt;e:do try{if(vt!==0&&Qe!==null){var O=Qe,B=qn;switch(vt){case 8:xm(),w=6;break e;case 3:case 2:case 9:case 6:Hn.current===null&&(s=!0);var ee=vt;if(vt=0,qn=null,ja(r,O,B,ee),a&&Ta){w=0;break e}break;default:ee=vt,vt=0,qn=null,ja(r,O,B,ee)}}UM(),w=Dt;break}catch(le){rS(r,le)}while(!0);return s&&r.shellSuspendCounter++,fs=oo=null,ht=c,L.H=m,L.A=g,Qe===null&&(wt=null,Ze=0,Lu()),w}function UM(){for(;Qe!==null;)aS(Qe)}function BM(r,s){var a=ht;ht|=2;var c=iS(),m=oS();wt!==r||Ze!==s?(mf=null,pf=ze()+500,Na(r,s)):Ta=Vr(r,s);e:do try{if(vt!==0&&Qe!==null){s=Qe;var g=qn;t:switch(vt){case 1:vt=0,qn=null,ja(r,s,g,1);break;case 2:case 9:if(yx(g)){vt=0,qn=null,lS(s);break}s=function(){vt!==2&&vt!==9||wt!==r||(vt=7),Xr(r)},g.then(s,s);break e;case 3:vt=7;break e;case 4:vt=5;break e;case 7:yx(g)?(vt=0,qn=null,lS(s)):(vt=0,qn=null,ja(r,s,g,7));break;case 5:var w=null;switch(Qe.tag){case 26:w=Qe.memoizedState;case 5:case 27:var O=Qe;if(w?KS(w):O.stateNode.complete){vt=0,qn=null;var B=O.sibling;if(B!==null)Qe=B;else{var ee=O.return;ee!==null?(Qe=ee,vf(ee)):Qe=null}break t}}vt=0,qn=null,ja(r,s,g,5);break;case 6:vt=0,qn=null,ja(r,s,g,6);break;case 8:xm(),Dt=6;break e;default:throw Error(i(462))}}HM();break}catch(le){rS(r,le)}while(!0);return fs=oo=null,L.H=c,L.A=m,ht=a,Qe!==null?0:(wt=null,Ze=0,Lu(),Dt)}function HM(){for(;Qe!==null&&!Fe();)aS(Qe)}function aS(r){var s=A0(r.alternate,r,Ss);r.memoizedProps=r.pendingProps,s===null?vf(r):Qe=s}function lS(r){var s=r,a=s.alternate;switch(s.tag){case 15:case 0:s=T0(a,s,s.pendingProps,s.type,void 0,Ze);break;case 11:s=T0(a,s,s.pendingProps,s.type.render,s.ref,Ze);break;case 5:Lp(s);default:k0(a,s),s=Qe=ox(s,Ss),s=A0(a,s,Ss)}r.memoizedProps=r.pendingProps,s===null?vf(r):Qe=s}function ja(r,s,a,c){fs=oo=null,Lp(s),va=null,Gl=0;var m=s.return;try{if(jM(r,m,s,a,Ze)){Dt=1,sf(r,fr(a,r.current)),Qe=null;return}}catch(g){if(m!==null)throw Qe=m,g;Dt=1,sf(r,fr(a,r.current)),Qe=null;return}s.flags&32768?(et||c===1?r=!0:Ta||(Ze&536870912)!==0?r=!1:(ii=r=!0,(c===2||c===9||c===3||c===6)&&(c=Hn.current,c!==null&&c.tag===13&&(c.flags|=16384))),cS(s,r)):vf(s)}function vf(r){var s=r;do{if((s.flags&32768)!==0){cS(s,ii);return}r=s.return;var a=OM(s.alternate,s,Ss);if(a!==null){Qe=a;return}if(s=s.sibling,s!==null){Qe=s;return}Qe=s=r}while(s!==null);Dt===0&&(Dt=5)}function cS(r,s){do{var a=kM(r.alternate,r);if(a!==null){a.flags&=32767,Qe=a;return}if(a=r.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!s&&(r=r.sibling,r!==null)){Qe=r;return}Qe=r=a}while(r!==null);Dt=6,Qe=null}function uS(r,s,a,c,m,g,w,O,B){r.cancelPendingCommit=null;do bf();while(Qt!==0);if((ht&6)!==0)throw Error(i(327));if(s!==null){if(s===r.current)throw Error(i(177));if(g=s.lanes|s.childLanes,g|=cp,Pn(r,a,g,w,O,B),r===wt&&(Qe=wt=null,Ze=0),Ra=s,li=r,Es=a,ym=g,vm=m,J0=c,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,$M(we,function(){return mS(),null})):(r.callbackNode=null,r.callbackPriority=0),c=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||c){c=L.T,L.T=null,m=$.p,$.p=2,w=ht,ht|=4;try{IM(r,s,a)}finally{ht=w,$.p=m,L.T=c}}Qt=1,fS(),dS(),hS()}}function fS(){if(Qt===1){Qt=0;var r=li,s=Ra,a=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||a){a=L.T,L.T=null;var c=$.p;$.p=2;var m=ht;ht|=4;try{$0(s,r);var g=km,w=Wb(r.containerInfo),O=g.focusedElem,B=g.selectionRange;if(w!==O&&O&&O.ownerDocument&&Qb(O.ownerDocument.documentElement,O)){if(B!==null&&sp(O)){var ee=B.start,le=B.end;if(le===void 0&&(le=ee),"selectionStart"in O)O.selectionStart=ee,O.selectionEnd=Math.min(le,O.value.length);else{var ue=O.ownerDocument||document,ne=ue&&ue.defaultView||window;if(ne.getSelection){var oe=ne.getSelection(),Ce=O.textContent.length,Pe=Math.min(B.start,Ce),Et=B.end===void 0?Pe:Math.min(B.end,Ce);!oe.extend&&Pe>Et&&(w=Et,Et=Pe,Pe=w);var Y=Xb(O,Pe),q=Xb(O,Et);if(Y&&q&&(oe.rangeCount!==1||oe.anchorNode!==Y.node||oe.anchorOffset!==Y.offset||oe.focusNode!==q.node||oe.focusOffset!==q.offset)){var J=ue.createRange();J.setStart(Y.node,Y.offset),oe.removeAllRanges(),Pe>Et?(oe.addRange(J),oe.extend(q.node,q.offset)):(J.setEnd(q.node,q.offset),oe.addRange(J))}}}}for(ue=[],oe=O;oe=oe.parentNode;)oe.nodeType===1&&ue.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<ue.length;O++){var ce=ue[O];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Af=!!Om,km=Om=null}finally{ht=m,$.p=c,L.T=a}}r.current=s,Qt=2}}function dS(){if(Qt===2){Qt=0;var r=li,s=Ra,a=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||a){a=L.T,L.T=null;var c=$.p;$.p=2;var m=ht;ht|=4;try{B0(r,s.alternate,s)}finally{ht=m,$.p=c,L.T=a}}Qt=3}}function hS(){if(Qt===4||Qt===3){Qt=0,Ke();var r=li,s=Ra,a=Es,c=J0;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Qt=5:(Qt=0,Ra=li=null,pS(r,r.pendingLanes));var m=r.pendingLanes;if(m===0&&(ai=null),Ml(a),s=s.stateNode,Ut&&typeof Ut.onCommitFiberRoot=="function")try{Ut.onCommitFiberRoot(ar,s,void 0,(s.current.flags&128)===128)}catch{}if(c!==null){s=L.T,m=$.p,$.p=2,L.T=null;try{for(var g=r.onRecoverableError,w=0;w<c.length;w++){var O=c[w];g(O.value,{componentStack:O.stack})}}finally{L.T=s,$.p=m}}(Es&3)!==0&&bf(),Xr(r),m=r.pendingLanes,(a&261930)!==0&&(m&42)!==0?r===bm?cc++:(cc=0,bm=r):cc=0,uc(0)}}function pS(r,s){(r.pooledCacheLanes&=s)===0&&(s=r.pooledCache,s!=null&&(r.pooledCache=null,Vl(s)))}function bf(){return fS(),dS(),hS(),mS()}function mS(){if(Qt!==5)return!1;var r=li,s=ym;ym=0;var a=Ml(Es),c=L.T,m=$.p;try{$.p=32>a?32:a,L.T=null,a=vm,vm=null;var g=li,w=Es;if(Qt=0,Ra=li=null,Es=0,(ht&6)!==0)throw Error(i(331));var O=ht;if(ht|=4,Q0(g.current),K0(g,g.current,w,a),ht=O,uc(0,!1),Ut&&typeof Ut.onPostCommitFiberRoot=="function")try{Ut.onPostCommitFiberRoot(ar,g)}catch{}return!0}finally{$.p=m,L.T=c,pS(r,s)}}function gS(r,s,a){s=fr(a,s),s=Wp(r.stateNode,s,2),r=ti(r,s,2),r!==null&&(is(r,2),Xr(r))}function bt(r,s,a){if(r.tag===3)gS(r,r,a);else for(;s!==null;){if(s.tag===3){gS(s,r,a);break}else if(s.tag===1){var c=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(ai===null||!ai.has(c))){r=fr(a,r),a=y0(2),c=ti(s,a,2),c!==null&&(v0(a,c,s,r),is(c,2),Xr(c));break}}s=s.return}}function Em(r,s,a){var c=r.pingCache;if(c===null){c=r.pingCache=new PM;var m=new Set;c.set(s,m)}else m=c.get(s),m===void 0&&(m=new Set,c.set(s,m));m.has(a)||(pm=!0,m.add(a),r=FM.bind(null,r,s,a),s.then(r,r))}function FM(r,s,a){var c=r.pingCache;c!==null&&c.delete(s),r.pingedLanes|=r.suspendedLanes&a,r.warmLanes&=~a,wt===r&&(Ze&a)===a&&(Dt===4||Dt===3&&(Ze&62914560)===Ze&&300>ze()-hf?(ht&2)===0&&Na(r,0):mm|=a,Ca===Ze&&(Ca=0)),Xr(r)}function yS(r,s){s===0&&(s=Wi()),r=ro(r,s),r!==null&&(is(r,s),Xr(r))}function qM(r){var s=r.memoizedState,a=0;s!==null&&(a=s.retryLane),yS(r,a)}function VM(r,s){var a=0;switch(r.tag){case 31:case 13:var c=r.stateNode,m=r.memoizedState;m!==null&&(a=m.retryLane);break;case 19:c=r.stateNode;break;case 22:c=r.stateNode._retryCache;break;default:throw Error(i(314))}c!==null&&c.delete(s),yS(r,a)}function $M(r,s){return Oe(r,s)}var xf=null,Ma=null,_m=!1,Sf=!1,wm=!1,ui=0;function Xr(r){r!==Ma&&r.next===null&&(Ma===null?xf=Ma=r:Ma=Ma.next=r),Sf=!0,_m||(_m=!0,KM())}function uc(r,s){if(!wm&&Sf){wm=!0;do for(var a=!1,c=xf;c!==null;){if(r!==0){var m=c.pendingLanes;if(m===0)var g=0;else{var w=c.suspendedLanes,O=c.pingedLanes;g=(1<<31-yt(42|r)+1)-1,g&=m&~(w&~O),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(a=!0,SS(c,g))}else g=Ze,g=qr(c,c===wt?g:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(g&3)===0||Vr(c,g)||(a=!0,SS(c,g));c=c.next}while(a);wm=!1}}function GM(){vS()}function vS(){Sf=_m=!1;var r=0;ui!==0&&rA()&&(r=ui);for(var s=ze(),a=null,c=xf;c!==null;){var m=c.next,g=bS(c,s);g===0?(c.next=null,a===null?xf=m:a.next=m,m===null&&(Ma=a)):(a=c,(r!==0||(g&3)!==0)&&(Sf=!0)),c=m}Qt!==0&&Qt!==5||uc(r),ui!==0&&(ui=0)}function bS(r,s){for(var a=r.suspendedLanes,c=r.pingedLanes,m=r.expirationTimes,g=r.pendingLanes&-62914561;0<g;){var w=31-yt(g),O=1<<w,B=m[w];B===-1?((O&a)===0||(O&c)!==0)&&(m[w]=Qo(O,s)):B<=s&&(r.expiredLanes|=O),g&=~O}if(s=wt,a=Ze,a=qr(r,r===s?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c=r.callbackNode,a===0||r===s&&(vt===2||vt===9)||r.cancelPendingCommit!==null)return c!==null&&c!==null&&Ee(c),r.callbackNode=null,r.callbackPriority=0;if((a&3)===0||Vr(r,a)){if(s=a&-a,s===r.callbackPriority)return s;switch(c!==null&&Ee(c),Ml(a)){case 2:case 8:a=pe;break;case 32:a=we;break;case 268435456:a=dt;break;default:a=we}return c=xS.bind(null,r),a=Oe(a,c),r.callbackPriority=s,r.callbackNode=a,s}return c!==null&&c!==null&&Ee(c),r.callbackPriority=2,r.callbackNode=null,2}function xS(r,s){if(Qt!==0&&Qt!==5)return r.callbackNode=null,r.callbackPriority=0,null;var a=r.callbackNode;if(bf()&&r.callbackNode!==a)return null;var c=Ze;return c=qr(r,r===wt?c:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),c===0?null:(tS(r,c,s),bS(r,ze()),r.callbackNode!=null&&r.callbackNode===a?xS.bind(null,r):null)}function SS(r,s){if(bf())return null;tS(r,s,!0)}function KM(){iA(function(){(ht&6)!==0?Oe(Ue,GM):vS()})}function Tm(){if(ui===0){var r=ma;r===0&&(r=Ct,Ct<<=1,(Ct&261888)===0&&(Ct=256)),ui=r}return ui}function ES(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Nu(""+r)}function _S(r,s){var a=s.ownerDocument.createElement("input");return a.name=s.name,a.value=s.value,r.id&&a.setAttribute("form",r.id),s.parentNode.insertBefore(a,s),r=new FormData(r),a.parentNode.removeChild(a),r}function YM(r,s,a,c,m){if(s==="submit"&&a&&a.stateNode===m){var g=ES((m[_n]||null).action),w=c.submitter;w&&(s=(s=w[_n]||null)?ES(s.formAction):w.getAttribute("formAction"),s!==null&&(g=s,w=null));var O=new Ou("action","action",null,c,m);r.push({event:O,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(ui!==0){var B=w?_S(m,w):new FormData(m);$p(a,{pending:!0,data:B,method:m.method,action:g},null,B)}}else typeof g=="function"&&(O.preventDefault(),B=w?_S(m,w):new FormData(m),$p(a,{pending:!0,data:B,method:m.method,action:g},g,B))},currentTarget:m}]})}}for(var Cm=0;Cm<lp.length;Cm++){var Rm=lp[Cm],XM=Rm.toLowerCase(),QM=Rm[0].toUpperCase()+Rm.slice(1);Ar(XM,"on"+QM)}Ar(ex,"onAnimationEnd"),Ar(tx,"onAnimationIteration"),Ar(nx,"onAnimationStart"),Ar("dblclick","onDoubleClick"),Ar("focusin","onFocus"),Ar("focusout","onBlur"),Ar(dM,"onTransitionRun"),Ar(hM,"onTransitionStart"),Ar(pM,"onTransitionCancel"),Ar(rx,"onTransitionEnd"),ta("onMouseEnter",["mouseout","mouseover"]),ta("onMouseLeave",["mouseout","mouseover"]),ta("onPointerEnter",["pointerout","pointerover"]),ta("onPointerLeave",["pointerout","pointerover"]),Ji("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ji("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ji("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ji("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ji("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ji("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fc="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(" "),WM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fc));function wS(r,s){s=(s&4)!==0;for(var a=0;a<r.length;a++){var c=r[a],m=c.event;c=c.listeners;e:{var g=void 0;if(s)for(var w=c.length-1;0<=w;w--){var O=c[w],B=O.instance,ee=O.currentTarget;if(O=O.listener,B!==g&&m.isPropagationStopped())break e;g=O,m.currentTarget=ee;try{g(m)}catch(le){Du(le)}m.currentTarget=null,g=B}else for(w=0;w<c.length;w++){if(O=c[w],B=O.instance,ee=O.currentTarget,O=O.listener,B!==g&&m.isPropagationStopped())break e;g=O,m.currentTarget=ee;try{g(m)}catch(le){Du(le)}m.currentTarget=null,g=B}}}}function We(r,s){var a=s[Bh];a===void 0&&(a=s[Bh]=new Set);var c=r+"__bubble";a.has(c)||(TS(s,r,2,!1),a.add(c))}function Nm(r,s,a){var c=0;s&&(c|=4),TS(a,r,c,s)}var Ef="_reactListening"+Math.random().toString(36).slice(2);function jm(r){if(!r[Ef]){r[Ef]=!0,vb.forEach(function(a){a!=="selectionchange"&&(WM.has(a)||Nm(a,!1,r),Nm(a,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[Ef]||(s[Ef]=!0,Nm("selectionchange",!1,s))}}function TS(r,s,a,c){switch(eE(s)){case 2:var m=TA;break;case 8:m=CA;break;default:m=Vm}a=m.bind(null,s,a,r),m=void 0,!Xh||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(m=!0),c?m!==void 0?r.addEventListener(s,a,{capture:!0,passive:m}):r.addEventListener(s,a,!0):m!==void 0?r.addEventListener(s,a,{passive:m}):r.addEventListener(s,a,!1)}function Mm(r,s,a,c,m){var g=c;if((s&1)===0&&(s&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var O=c.stateNode.containerInfo;if(O===m)break;if(w===4)for(w=c.return;w!==null;){var B=w.tag;if((B===3||B===4)&&w.stateNode.containerInfo===m)return;w=w.return}for(;O!==null;){if(w=Zo(O),w===null)return;if(B=w.tag,B===5||B===6||B===26||B===27){c=g=w;continue e}O=O.parentNode}}c=c.return}Mb(function(){var ee=g,le=Kh(a),ue=[];e:{var ne=sx.get(r);if(ne!==void 0){var oe=Ou,Ce=r;switch(r){case"keypress":if(Mu(a)===0)break e;case"keydown":case"keyup":oe=Vj;break;case"focusin":Ce="focus",oe=Jh;break;case"focusout":Ce="blur",oe=Jh;break;case"beforeblur":case"afterblur":oe=Jh;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=kb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=Oj;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=Kj;break;case ex:case tx:case nx:oe=Dj;break;case rx:oe=Xj;break;case"scroll":case"scrollend":oe=Mj;break;case"wheel":oe=Wj;break;case"copy":case"cut":case"paste":oe=Pj;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=Db;break;case"toggle":case"beforetoggle":oe=Jj}var Pe=(s&4)!==0,Et=!Pe&&(r==="scroll"||r==="scrollend"),Y=Pe?ne!==null?ne+"Capture":null:ne;Pe=[];for(var q=ee,J;q!==null;){var ce=q;if(J=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||J===null||Y===null||(ce=kl(q,Y),ce!=null&&Pe.push(dc(q,ce,J))),Et)break;q=q.return}0<Pe.length&&(ne=new oe(ne,Ce,null,a,le),ue.push({event:ne,listeners:Pe}))}}if((s&7)===0){e:{if(ne=r==="mouseover"||r==="pointerover",oe=r==="mouseout"||r==="pointerout",ne&&a!==Gh&&(Ce=a.relatedTarget||a.fromElement)&&(Zo(Ce)||Ce[Wo]))break e;if((oe||ne)&&(ne=le.window===le?le:(ne=le.ownerDocument)?ne.defaultView||ne.parentWindow:window,oe?(Ce=a.relatedTarget||a.toElement,oe=ee,Ce=Ce?Zo(Ce):null,Ce!==null&&(Et=l(Ce),Pe=Ce.tag,Ce!==Et||Pe!==5&&Pe!==27&&Pe!==6)&&(Ce=null)):(oe=null,Ce=ee),oe!==Ce)){if(Pe=kb,ce="onMouseLeave",Y="onMouseEnter",q="mouse",(r==="pointerout"||r==="pointerover")&&(Pe=Db,ce="onPointerLeave",Y="onPointerEnter",q="pointer"),Et=oe==null?ne:Ol(oe),J=Ce==null?ne:Ol(Ce),ne=new Pe(ce,q+"leave",oe,a,le),ne.target=Et,ne.relatedTarget=J,ce=null,Zo(le)===ee&&(Pe=new Pe(Y,q+"enter",Ce,a,le),Pe.target=J,Pe.relatedTarget=Et,ce=Pe),Et=ce,oe&&Ce)t:{for(Pe=ZM,Y=oe,q=Ce,J=0,ce=Y;ce;ce=Pe(ce))J++;ce=0;for(var Ie=q;Ie;Ie=Pe(Ie))ce++;for(;0<J-ce;)Y=Pe(Y),J--;for(;0<ce-J;)q=Pe(q),ce--;for(;J--;){if(Y===q||q!==null&&Y===q.alternate){Pe=Y;break t}Y=Pe(Y),q=Pe(q)}Pe=null}else Pe=null;oe!==null&&CS(ue,ne,oe,Pe,!1),Ce!==null&&Et!==null&&CS(ue,Et,Ce,Pe,!0)}}e:{if(ne=ee?Ol(ee):window,oe=ne.nodeName&&ne.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ne.type==="file")var lt=qb;else if(Hb(ne))if(Vb)lt=cM;else{lt=aM;var Me=oM}else oe=ne.nodeName,!oe||oe.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?ee&&$h(ee.elementType)&&(lt=qb):lt=lM;if(lt&&(lt=lt(r,ee))){Fb(ue,lt,a,le);break e}Me&&Me(r,ne,ee),r==="focusout"&&ee&&ne.type==="number"&&ee.memoizedProps.value!=null&&Vh(ne,"number",ne.value)}switch(Me=ee?Ol(ee):window,r){case"focusin":(Hb(Me)||Me.contentEditable==="true")&&(aa=Me,ip=ee,Hl=null);break;case"focusout":Hl=ip=aa=null;break;case"mousedown":op=!0;break;case"contextmenu":case"mouseup":case"dragend":op=!1,Zb(ue,a,le);break;case"selectionchange":if(fM)break;case"keydown":case"keyup":Zb(ue,a,le)}var Ge;if(tp)e:{switch(r){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else oa?Ub(r,a)&&(Je="onCompositionEnd"):r==="keydown"&&a.keyCode===229&&(Je="onCompositionStart");Je&&(Lb&&a.locale!=="ko"&&(oa||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&oa&&(Ge=Ab()):(Ys=le,Qh="value"in Ys?Ys.value:Ys.textContent,oa=!0)),Me=_f(ee,Je),0<Me.length&&(Je=new Ib(Je,r,null,a,le),ue.push({event:Je,listeners:Me}),Ge?Je.data=Ge:(Ge=Bb(a),Ge!==null&&(Je.data=Ge)))),(Ge=tM?nM(r,a):rM(r,a))&&(Je=_f(ee,"onBeforeInput"),0<Je.length&&(Me=new Ib("onBeforeInput","beforeinput",null,a,le),ue.push({event:Me,listeners:Je}),Me.data=Ge)),YM(ue,r,ee,a,le)}wS(ue,s)})}function dc(r,s,a){return{instance:r,listener:s,currentTarget:a}}function _f(r,s){for(var a=s+"Capture",c=[];r!==null;){var m=r,g=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||g===null||(m=kl(r,a),m!=null&&c.unshift(dc(r,m,g)),m=kl(r,s),m!=null&&c.push(dc(r,m,g))),r.tag===3)return c;r=r.return}return[]}function ZM(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function CS(r,s,a,c,m){for(var g=s._reactName,w=[];a!==null&&a!==c;){var O=a,B=O.alternate,ee=O.stateNode;if(O=O.tag,B!==null&&B===c)break;O!==5&&O!==26&&O!==27||ee===null||(B=ee,m?(ee=kl(a,g),ee!=null&&w.unshift(dc(a,ee,B))):m||(ee=kl(a,g),ee!=null&&w.push(dc(a,ee,B)))),a=a.return}w.length!==0&&r.push({event:s,listeners:w})}var JM=/\r\n?/g,eA=/\u0000|\uFFFD/g;function RS(r){return(typeof r=="string"?r:""+r).replace(JM,`
|
|
29
|
+
`).replace(eA,"")}function NS(r,s){return s=RS(s),RS(r)===s}function St(r,s,a,c,m,g){switch(a){case"children":typeof c=="string"?s==="body"||s==="textarea"&&c===""||ra(r,c):(typeof c=="number"||typeof c=="bigint")&&s!=="body"&&ra(r,""+c);break;case"className":Cu(r,"class",c);break;case"tabIndex":Cu(r,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Cu(r,a,c);break;case"style":Nb(r,c,g);break;case"data":if(s!=="object"){Cu(r,"data",c);break}case"src":case"href":if(c===""&&(s!=="a"||a!=="href")){r.removeAttribute(a);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(a);break}c=Nu(""+c),r.setAttribute(a,c);break;case"action":case"formAction":if(typeof c=="function"){r.setAttribute(a,"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 g=="function"&&(a==="formAction"?(s!=="input"&&St(r,s,"name",m.name,m,null),St(r,s,"formEncType",m.formEncType,m,null),St(r,s,"formMethod",m.formMethod,m,null),St(r,s,"formTarget",m.formTarget,m,null)):(St(r,s,"encType",m.encType,m,null),St(r,s,"method",m.method,m,null),St(r,s,"target",m.target,m,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){r.removeAttribute(a);break}c=Nu(""+c),r.setAttribute(a,c);break;case"onClick":c!=null&&(r.onclick=as);break;case"onScroll":c!=null&&We("scroll",r);break;case"onScrollEnd":c!=null&&We("scrollend",r);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(a=c.__html,a!=null){if(m.children!=null)throw Error(i(60));r.innerHTML=a}}break;case"multiple":r.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":r.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){r.removeAttribute("xlink:href");break}a=Nu(""+c),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(a,""+c):r.removeAttribute(a);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":c&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(a,""):r.removeAttribute(a);break;case"capture":case"download":c===!0?r.setAttribute(a,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?r.setAttribute(a,c):r.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?r.setAttribute(a,c):r.removeAttribute(a);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?r.removeAttribute(a):r.setAttribute(a,c);break;case"popover":We("beforetoggle",r),We("toggle",r),Tu(r,"popover",c);break;case"xlinkActuate":os(r,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":os(r,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":os(r,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":os(r,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":os(r,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":os(r,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":os(r,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":os(r,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":os(r,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":Tu(r,"is",c);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Nj.get(a)||a,Tu(r,a,c))}}function Am(r,s,a,c,m,g){switch(a){case"style":Nb(r,c,g);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(i(61));if(a=c.__html,a!=null){if(m.children!=null)throw Error(i(60));r.innerHTML=a}}break;case"children":typeof c=="string"?ra(r,c):(typeof c=="number"||typeof c=="bigint")&&ra(r,""+c);break;case"onScroll":c!=null&&We("scroll",r);break;case"onScrollEnd":c!=null&&We("scrollend",r);break;case"onClick":c!=null&&(r.onclick=as);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!bb.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(m=a.endsWith("Capture"),s=a.slice(2,m?a.length-7:void 0),g=r[_n]||null,g=g!=null?g[a]:null,typeof g=="function"&&r.removeEventListener(s,g,m),typeof c=="function")){typeof g!="function"&&g!==null&&(a in r?r[a]=null:r.hasAttribute(a)&&r.removeAttribute(a)),r.addEventListener(s,c,m);break e}a in r?r[a]=c:c===!0?r.setAttribute(a,""):Tu(r,a,c)}}}function fn(r,s,a){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":We("error",r),We("load",r);var c=!1,m=!1,g;for(g in a)if(a.hasOwnProperty(g)){var w=a[g];if(w!=null)switch(g){case"src":c=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:St(r,s,g,w,a,null)}}m&&St(r,s,"srcSet",a.srcSet,a,null),c&&St(r,s,"src",a.src,a,null);return;case"input":We("invalid",r);var O=g=w=m=null,B=null,ee=null;for(c in a)if(a.hasOwnProperty(c)){var le=a[c];if(le!=null)switch(c){case"name":m=le;break;case"type":w=le;break;case"checked":B=le;break;case"defaultChecked":ee=le;break;case"value":g=le;break;case"defaultValue":O=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(i(137,s));break;default:St(r,s,c,le,a,null)}}wb(r,g,O,B,ee,w,m,!1);return;case"select":We("invalid",r),c=w=g=null;for(m in a)if(a.hasOwnProperty(m)&&(O=a[m],O!=null))switch(m){case"value":g=O;break;case"defaultValue":w=O;break;case"multiple":c=O;default:St(r,s,m,O,a,null)}s=g,a=w,r.multiple=!!c,s!=null?na(r,!!c,s,!1):a!=null&&na(r,!!c,a,!0);return;case"textarea":We("invalid",r),g=m=c=null;for(w in a)if(a.hasOwnProperty(w)&&(O=a[w],O!=null))switch(w){case"value":c=O;break;case"defaultValue":m=O;break;case"children":g=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(i(91));break;default:St(r,s,w,O,a,null)}Cb(r,c,m,g);return;case"option":for(B in a)a.hasOwnProperty(B)&&(c=a[B],c!=null)&&(B==="selected"?r.selected=c&&typeof c!="function"&&typeof c!="symbol":St(r,s,B,c,a,null));return;case"dialog":We("beforetoggle",r),We("toggle",r),We("cancel",r),We("close",r);break;case"iframe":case"object":We("load",r);break;case"video":case"audio":for(c=0;c<fc.length;c++)We(fc[c],r);break;case"image":We("error",r),We("load",r);break;case"details":We("toggle",r);break;case"embed":case"source":case"link":We("error",r),We("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in a)if(a.hasOwnProperty(ee)&&(c=a[ee],c!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,s));default:St(r,s,ee,c,a,null)}return;default:if($h(s)){for(le in a)a.hasOwnProperty(le)&&(c=a[le],c!==void 0&&Am(r,s,le,c,a,void 0));return}}for(O in a)a.hasOwnProperty(O)&&(c=a[O],c!=null&&St(r,s,O,c,a,null))}function tA(r,s,a,c){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,g=null,w=null,O=null,B=null,ee=null,le=null;for(oe in a){var ue=a[oe];if(a.hasOwnProperty(oe)&&ue!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":B=ue;default:c.hasOwnProperty(oe)||St(r,s,oe,null,c,ue)}}for(var ne in c){var oe=c[ne];if(ue=a[ne],c.hasOwnProperty(ne)&&(oe!=null||ue!=null))switch(ne){case"type":g=oe;break;case"name":m=oe;break;case"checked":ee=oe;break;case"defaultChecked":le=oe;break;case"value":w=oe;break;case"defaultValue":O=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(i(137,s));break;default:oe!==ue&&St(r,s,ne,oe,c,ue)}}qh(r,w,O,B,ee,le,g,m);return;case"select":oe=w=O=ne=null;for(g in a)if(B=a[g],a.hasOwnProperty(g)&&B!=null)switch(g){case"value":break;case"multiple":oe=B;default:c.hasOwnProperty(g)||St(r,s,g,null,c,B)}for(m in c)if(g=c[m],B=a[m],c.hasOwnProperty(m)&&(g!=null||B!=null))switch(m){case"value":ne=g;break;case"defaultValue":O=g;break;case"multiple":w=g;default:g!==B&&St(r,s,m,g,c,B)}s=O,a=w,c=oe,ne!=null?na(r,!!a,ne,!1):!!c!=!!a&&(s!=null?na(r,!!a,s,!0):na(r,!!a,a?[]:"",!1));return;case"textarea":oe=ne=null;for(O in a)if(m=a[O],a.hasOwnProperty(O)&&m!=null&&!c.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:St(r,s,O,null,c,m)}for(w in c)if(m=c[w],g=a[w],c.hasOwnProperty(w)&&(m!=null||g!=null))switch(w){case"value":ne=m;break;case"defaultValue":oe=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(i(91));break;default:m!==g&&St(r,s,w,m,c,g)}Tb(r,ne,oe);return;case"option":for(var Ce in a)ne=a[Ce],a.hasOwnProperty(Ce)&&ne!=null&&!c.hasOwnProperty(Ce)&&(Ce==="selected"?r.selected=!1:St(r,s,Ce,null,c,ne));for(B in c)ne=c[B],oe=a[B],c.hasOwnProperty(B)&&ne!==oe&&(ne!=null||oe!=null)&&(B==="selected"?r.selected=ne&&typeof ne!="function"&&typeof ne!="symbol":St(r,s,B,ne,c,oe));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 Pe in a)ne=a[Pe],a.hasOwnProperty(Pe)&&ne!=null&&!c.hasOwnProperty(Pe)&&St(r,s,Pe,null,c,ne);for(ee in c)if(ne=c[ee],oe=a[ee],c.hasOwnProperty(ee)&&ne!==oe&&(ne!=null||oe!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(i(137,s));break;default:St(r,s,ee,ne,c,oe)}return;default:if($h(s)){for(var Et in a)ne=a[Et],a.hasOwnProperty(Et)&&ne!==void 0&&!c.hasOwnProperty(Et)&&Am(r,s,Et,void 0,c,ne);for(le in c)ne=c[le],oe=a[le],!c.hasOwnProperty(le)||ne===oe||ne===void 0&&oe===void 0||Am(r,s,le,ne,c,oe);return}}for(var Y in a)ne=a[Y],a.hasOwnProperty(Y)&&ne!=null&&!c.hasOwnProperty(Y)&&St(r,s,Y,null,c,ne);for(ue in c)ne=c[ue],oe=a[ue],!c.hasOwnProperty(ue)||ne===oe||ne==null&&oe==null||St(r,s,ue,ne,c,oe)}function jS(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function nA(){if(typeof performance.getEntriesByType=="function"){for(var r=0,s=0,a=performance.getEntriesByType("resource"),c=0;c<a.length;c++){var m=a[c],g=m.transferSize,w=m.initiatorType,O=m.duration;if(g&&O&&jS(w)){for(w=0,O=m.responseEnd,c+=1;c<a.length;c++){var B=a[c],ee=B.startTime;if(ee>O)break;var le=B.transferSize,ue=B.initiatorType;le&&jS(ue)&&(B=B.responseEnd,w+=le*(B<O?1:(O-ee)/(B-ee)))}if(--c,s+=8*(g+w)/(m.duration/1e3),r++,10<r)break}}if(0<r)return s/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Om=null,km=null;function wf(r){return r.nodeType===9?r:r.ownerDocument}function MS(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function AS(r,s){if(r===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&s==="foreignObject"?0:r}function Im(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Dm=null;function rA(){var r=window.event;return r&&r.type==="popstate"?r===Dm?!1:(Dm=r,!0):(Dm=null,!1)}var OS=typeof setTimeout=="function"?setTimeout:void 0,sA=typeof clearTimeout=="function"?clearTimeout:void 0,kS=typeof Promise=="function"?Promise:void 0,iA=typeof queueMicrotask=="function"?queueMicrotask:typeof kS<"u"?function(r){return kS.resolve(null).then(r).catch(oA)}:OS;function oA(r){setTimeout(function(){throw r})}function fi(r){return r==="head"}function IS(r,s){var a=s,c=0;do{var m=a.nextSibling;if(r.removeChild(a),m&&m.nodeType===8)if(a=m.data,a==="/$"||a==="/&"){if(c===0){r.removeChild(m),Ia(s);return}c--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")c++;else if(a==="html")hc(r.ownerDocument.documentElement);else if(a==="head"){a=r.ownerDocument.head,hc(a);for(var g=a.firstChild;g;){var w=g.nextSibling,O=g.nodeName;g[Al]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&g.rel.toLowerCase()==="stylesheet"||a.removeChild(g),g=w}}else a==="body"&&hc(r.ownerDocument.body);a=m}while(a);Ia(s)}function DS(r,s){var a=r;r=0;do{var c=a.nextSibling;if(a.nodeType===1?s?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(s?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),c&&c.nodeType===8)if(a=c.data,a==="/$"){if(r===0)break;r--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||r++;a=c}while(a)}function Lm(r){var s=r.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var a=s;switch(s=s.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Lm(a),Hh(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}r.removeChild(a)}}function aA(r,s,a,c){for(;r.nodeType===1;){var m=a;if(r.nodeName.toLowerCase()!==s.toLowerCase()){if(!c&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(c){if(!r[Al])switch(s){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(g=r.getAttribute("rel"),g==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(g!==m.rel||r.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||r.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||r.getAttribute("title")!==(m.title==null?null:m.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(g=r.getAttribute("src"),(g!==(m.src==null?null:m.src)||r.getAttribute("type")!==(m.type==null?null:m.type)||r.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&g&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(s==="input"&&r.type==="hidden"){var g=m.name==null?null:""+m.name;if(m.type==="hidden"&&r.getAttribute("name")===g)return r}else return r;if(r=gr(r.nextSibling),r===null)break}return null}function lA(r,s,a){if(s==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!a||(r=gr(r.nextSibling),r===null))return null;return r}function LS(r,s){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!s||(r=gr(r.nextSibling),r===null))return null;return r}function Pm(r){return r.data==="$?"||r.data==="$~"}function zm(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function cA(r,s){var a=r.ownerDocument;if(r.data==="$~")r._reactRetry=s;else if(r.data!=="$?"||a.readyState!=="loading")s();else{var c=function(){s(),a.removeEventListener("DOMContentLoaded",c)};a.addEventListener("DOMContentLoaded",c),r._reactRetry=c}}function gr(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return r}var Um=null;function PS(r){r=r.nextSibling;for(var s=0;r;){if(r.nodeType===8){var a=r.data;if(a==="/$"||a==="/&"){if(s===0)return gr(r.nextSibling);s--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||s++}r=r.nextSibling}return null}function zS(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var a=r.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(s===0)return r;s--}else a!=="/$"&&a!=="/&"||s++}r=r.previousSibling}return null}function US(r,s,a){switch(s=wf(a),r){case"html":if(r=s.documentElement,!r)throw Error(i(452));return r;case"head":if(r=s.head,!r)throw Error(i(453));return r;case"body":if(r=s.body,!r)throw Error(i(454));return r;default:throw Error(i(451))}}function hc(r){for(var s=r.attributes;s.length;)r.removeAttributeNode(s[0]);Hh(r)}var yr=new Map,BS=new Set;function Tf(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var _s=$.d;$.d={f:uA,r:fA,D:dA,C:hA,L:pA,m:mA,X:yA,S:gA,M:vA};function uA(){var r=_s.f(),s=gf();return r||s}function fA(r){var s=Jo(r);s!==null&&s.tag===5&&s.type==="form"?r0(s):_s.r(r)}var Aa=typeof document>"u"?null:document;function HS(r,s,a){var c=Aa;if(c&&typeof s=="string"&&s){var m=cr(s);m='link[rel="'+r+'"][href="'+m+'"]',typeof a=="string"&&(m+='[crossorigin="'+a+'"]'),BS.has(m)||(BS.add(m),r={rel:r,crossOrigin:a,href:s},c.querySelector(m)===null&&(s=c.createElement("link"),fn(s,"link",r),sn(s),c.head.appendChild(s)))}}function dA(r){_s.D(r),HS("dns-prefetch",r,null)}function hA(r,s){_s.C(r,s),HS("preconnect",r,s)}function pA(r,s,a){_s.L(r,s,a);var c=Aa;if(c&&r&&s){var m='link[rel="preload"][as="'+cr(s)+'"]';s==="image"&&a&&a.imageSrcSet?(m+='[imagesrcset="'+cr(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(m+='[imagesizes="'+cr(a.imageSizes)+'"]')):m+='[href="'+cr(r)+'"]';var g=m;switch(s){case"style":g=Oa(r);break;case"script":g=ka(r)}yr.has(g)||(r=v({rel:"preload",href:s==="image"&&a&&a.imageSrcSet?void 0:r,as:s},a),yr.set(g,r),c.querySelector(m)!==null||s==="style"&&c.querySelector(pc(g))||s==="script"&&c.querySelector(mc(g))||(s=c.createElement("link"),fn(s,"link",r),sn(s),c.head.appendChild(s)))}}function mA(r,s){_s.m(r,s);var a=Aa;if(a&&r){var c=s&&typeof s.as=="string"?s.as:"script",m='link[rel="modulepreload"][as="'+cr(c)+'"][href="'+cr(r)+'"]',g=m;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=ka(r)}if(!yr.has(g)&&(r=v({rel:"modulepreload",href:r},s),yr.set(g,r),a.querySelector(m)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(mc(g)))return}c=a.createElement("link"),fn(c,"link",r),sn(c),a.head.appendChild(c)}}}function gA(r,s,a){_s.S(r,s,a);var c=Aa;if(c&&r){var m=ea(c).hoistableStyles,g=Oa(r);s=s||"default";var w=m.get(g);if(!w){var O={loading:0,preload:null};if(w=c.querySelector(pc(g)))O.loading=5;else{r=v({rel:"stylesheet",href:r,"data-precedence":s},a),(a=yr.get(g))&&Bm(r,a);var B=w=c.createElement("link");sn(B),fn(B,"link",r),B._p=new Promise(function(ee,le){B.onload=ee,B.onerror=le}),B.addEventListener("load",function(){O.loading|=1}),B.addEventListener("error",function(){O.loading|=2}),O.loading|=4,Cf(w,s,c)}w={type:"stylesheet",instance:w,count:1,state:O},m.set(g,w)}}}function yA(r,s){_s.X(r,s);var a=Aa;if(a&&r){var c=ea(a).hoistableScripts,m=ka(r),g=c.get(m);g||(g=a.querySelector(mc(m)),g||(r=v({src:r,async:!0},s),(s=yr.get(m))&&Hm(r,s),g=a.createElement("script"),sn(g),fn(g,"link",r),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(m,g))}}function vA(r,s){_s.M(r,s);var a=Aa;if(a&&r){var c=ea(a).hoistableScripts,m=ka(r),g=c.get(m);g||(g=a.querySelector(mc(m)),g||(r=v({src:r,async:!0,type:"module"},s),(s=yr.get(m))&&Hm(r,s),g=a.createElement("script"),sn(g),fn(g,"link",r),a.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},c.set(m,g))}}function FS(r,s,a,c){var m=(m=ie.current)?Tf(m):null;if(!m)throw Error(i(446));switch(r){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(s=Oa(a.href),a=ea(m).hoistableStyles,c=a.get(s),c||(c={type:"style",instance:null,count:0,state:null},a.set(s,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){r=Oa(a.href);var g=ea(m).hoistableStyles,w=g.get(r);if(w||(m=m.ownerDocument||m,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(r,w),(g=m.querySelector(pc(r)))&&!g._p&&(w.instance=g,w.state.loading=5),yr.has(r)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},yr.set(r,a),g||bA(m,r,a,w.state))),s&&c===null)throw Error(i(528,""));return w}if(s&&c!==null)throw Error(i(529,""));return null;case"script":return s=a.async,a=a.src,typeof a=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=ka(a),a=ea(m).hoistableScripts,c=a.get(s),c||(c={type:"script",instance:null,count:0,state:null},a.set(s,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,r))}}function Oa(r){return'href="'+cr(r)+'"'}function pc(r){return'link[rel="stylesheet"]['+r+"]"}function qS(r){return v({},r,{"data-precedence":r.precedence,precedence:null})}function bA(r,s,a,c){r.querySelector('link[rel="preload"][as="style"]['+s+"]")?c.loading=1:(s=r.createElement("link"),c.preload=s,s.addEventListener("load",function(){return c.loading|=1}),s.addEventListener("error",function(){return c.loading|=2}),fn(s,"link",a),sn(s),r.head.appendChild(s))}function ka(r){return'[src="'+cr(r)+'"]'}function mc(r){return"script[async]"+r}function VS(r,s,a){if(s.count++,s.instance===null)switch(s.type){case"style":var c=r.querySelector('style[data-href~="'+cr(a.href)+'"]');if(c)return s.instance=c,sn(c),c;var m=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return c=(r.ownerDocument||r).createElement("style"),sn(c),fn(c,"style",m),Cf(c,a.precedence,r),s.instance=c;case"stylesheet":m=Oa(a.href);var g=r.querySelector(pc(m));if(g)return s.state.loading|=4,s.instance=g,sn(g),g;c=qS(a),(m=yr.get(m))&&Bm(c,m),g=(r.ownerDocument||r).createElement("link"),sn(g);var w=g;return w._p=new Promise(function(O,B){w.onload=O,w.onerror=B}),fn(g,"link",c),s.state.loading|=4,Cf(g,a.precedence,r),s.instance=g;case"script":return g=ka(a.src),(m=r.querySelector(mc(g)))?(s.instance=m,sn(m),m):(c=a,(m=yr.get(g))&&(c=v({},a),Hm(c,m)),r=r.ownerDocument||r,m=r.createElement("script"),sn(m),fn(m,"link",c),r.head.appendChild(m),s.instance=m);case"void":return null;default:throw Error(i(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(c=s.instance,s.state.loading|=4,Cf(c,a.precedence,r));return s.instance}function Cf(r,s,a){for(var c=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=c.length?c[c.length-1]:null,g=m,w=0;w<c.length;w++){var O=c[w];if(O.dataset.precedence===s)g=O;else if(g!==m)break}g?g.parentNode.insertBefore(r,g.nextSibling):(s=a.nodeType===9?a.head:a,s.insertBefore(r,s.firstChild))}function Bm(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.title==null&&(r.title=s.title)}function Hm(r,s){r.crossOrigin==null&&(r.crossOrigin=s.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=s.referrerPolicy),r.integrity==null&&(r.integrity=s.integrity)}var Rf=null;function $S(r,s,a){if(Rf===null){var c=new Map,m=Rf=new Map;m.set(a,c)}else m=Rf,c=m.get(a),c||(c=new Map,m.set(a,c));if(c.has(r))return c;for(c.set(r,null),a=a.getElementsByTagName(r),m=0;m<a.length;m++){var g=a[m];if(!(g[Al]||g[an]||r==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var w=g.getAttribute(s)||"";w=r+w;var O=c.get(w);O?O.push(g):c.set(w,[g])}}return c}function GS(r,s,a){r=r.ownerDocument||r,r.head.insertBefore(a,s==="title"?r.querySelector("head > title"):null)}function xA(r,s,a){if(a===1||s.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;return s.rel==="stylesheet"?(r=s.disabled,typeof s.precedence=="string"&&r==null):!0;case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function KS(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function SA(r,s,a,c){if(a.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var m=Oa(c.href),g=s.querySelector(pc(m));if(g){s=g._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(r.count++,r=Nf.bind(r),s.then(r,r)),a.state.loading|=4,a.instance=g,sn(g);return}g=s.ownerDocument||s,c=qS(c),(m=yr.get(m))&&Bm(c,m),g=g.createElement("link"),sn(g);var w=g;w._p=new Promise(function(O,B){w.onload=O,w.onerror=B}),fn(g,"link",c),a.instance=g}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(a,s),(s=a.state.preload)&&(a.state.loading&3)===0&&(r.count++,a=Nf.bind(r),s.addEventListener("load",a),s.addEventListener("error",a))}}var Fm=0;function EA(r,s){return r.stylesheets&&r.count===0&&Mf(r,r.stylesheets),0<r.count||0<r.imgCount?function(a){var c=setTimeout(function(){if(r.stylesheets&&Mf(r,r.stylesheets),r.unsuspend){var g=r.unsuspend;r.unsuspend=null,g()}},6e4+s);0<r.imgBytes&&Fm===0&&(Fm=62500*nA());var m=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Mf(r,r.stylesheets),r.unsuspend)){var g=r.unsuspend;r.unsuspend=null,g()}},(r.imgBytes>Fm?50:800)+s);return r.unsuspend=a,function(){r.unsuspend=null,clearTimeout(c),clearTimeout(m)}}:null}function Nf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mf(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var jf=null;function Mf(r,s){r.stylesheets=null,r.unsuspend!==null&&(r.count++,jf=new Map,s.forEach(_A,r),jf=null,Nf.call(r))}function _A(r,s){if(!(s.state.loading&4)){var a=jf.get(r);if(a)var c=a.get(null);else{a=new Map,jf.set(r,a);for(var m=r.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<m.length;g++){var w=m[g];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(a.set(w.dataset.precedence,w),c=w)}c&&a.set(null,c)}m=s.instance,w=m.getAttribute("data-precedence"),g=a.get(w)||c,g===c&&a.set(null,m),a.set(w,m),this.count++,c=Nf.bind(this),m.addEventListener("load",c),m.addEventListener("error",c),g?g.parentNode.insertBefore(m,g.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(m,r.firstChild)),s.state.loading|=4}}var gc={$$typeof:R,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function wA(r,s,a,c,m,g,w,O,B){this.tag=1,this.containerInfo=r,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=Zi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Zi(0),this.hiddenUpdates=Zi(null),this.identifierPrefix=c,this.onUncaughtError=m,this.onCaughtError=g,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.incompleteTransitions=new Map}function YS(r,s,a,c,m,g,w,O,B,ee,le,ue){return r=new wA(r,s,a,w,B,ee,le,ue,O),s=1,g===!0&&(s|=24),g=Bn(3,null,null,s),r.current=g,g.stateNode=r,s=Sp(),s.refCount++,r.pooledCache=s,s.refCount++,g.memoizedState={element:c,isDehydrated:a,cache:s},Tp(g),r}function XS(r){return r?(r=ua,r):ua}function QS(r,s,a,c,m,g){m=XS(m),c.context===null?c.context=m:c.pendingContext=m,c=ei(s),c.payload={element:a},g=g===void 0?null:g,g!==null&&(c.callback=g),a=ti(r,c,s),a!==null&&(jn(a,r,s),Yl(a,r,s))}function WS(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var a=r.retryLane;r.retryLane=a!==0&&a<s?a:s}}function qm(r,s){WS(r,s),(r=r.alternate)&&WS(r,s)}function ZS(r){if(r.tag===13||r.tag===31){var s=ro(r,67108864);s!==null&&jn(s,r,67108864),qm(r,67108864)}}function JS(r){if(r.tag===13||r.tag===31){var s=$n();s=zn(s);var a=ro(r,s);a!==null&&jn(a,r,s),qm(r,s)}}var Af=!0;function TA(r,s,a,c){var m=L.T;L.T=null;var g=$.p;try{$.p=2,Vm(r,s,a,c)}finally{$.p=g,L.T=m}}function CA(r,s,a,c){var m=L.T;L.T=null;var g=$.p;try{$.p=8,Vm(r,s,a,c)}finally{$.p=g,L.T=m}}function Vm(r,s,a,c){if(Af){var m=$m(c);if(m===null)Mm(r,s,c,Of,a),tE(r,c);else if(NA(m,r,s,a,c))c.stopPropagation();else if(tE(r,c),s&4&&-1<RA.indexOf(r)){for(;m!==null;){var g=Jo(m);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var w=gn(g.pendingLanes);if(w!==0){var O=g;for(O.pendingLanes|=2,O.entangledLanes|=2;w;){var B=1<<31-yt(w);O.entanglements[1]|=B,w&=~B}Xr(g),(ht&6)===0&&(pf=ze()+500,uc(0))}}break;case 31:case 13:O=ro(g,2),O!==null&&jn(O,g,2),gf(),qm(g,2)}if(g=$m(c),g===null&&Mm(r,s,c,Of,a),g===m)break;m=g}m!==null&&c.stopPropagation()}else Mm(r,s,c,null,a)}}function $m(r){return r=Kh(r),Gm(r)}var Of=null;function Gm(r){if(Of=null,r=Zo(r),r!==null){var s=l(r);if(s===null)r=null;else{var a=s.tag;if(a===13){if(r=u(s),r!==null)return r;r=null}else if(a===31){if(r=f(s),r!==null)return r;r=null}else if(a===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null)}}return Of=r,null}function eE(r){switch(r){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(Xe()){case Ue:return 2;case pe:return 8;case we:case He:return 32;case dt:return 268435456;default:return 32}default:return 32}}var Km=!1,di=null,hi=null,pi=null,yc=new Map,vc=new Map,mi=[],RA="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 tE(r,s){switch(r){case"focusin":case"focusout":di=null;break;case"dragenter":case"dragleave":hi=null;break;case"mouseover":case"mouseout":pi=null;break;case"pointerover":case"pointerout":yc.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":vc.delete(s.pointerId)}}function bc(r,s,a,c,m,g){return r===null||r.nativeEvent!==g?(r={blockedOn:s,domEventName:a,eventSystemFlags:c,nativeEvent:g,targetContainers:[m]},s!==null&&(s=Jo(s),s!==null&&ZS(s)),r):(r.eventSystemFlags|=c,s=r.targetContainers,m!==null&&s.indexOf(m)===-1&&s.push(m),r)}function NA(r,s,a,c,m){switch(s){case"focusin":return di=bc(di,r,s,a,c,m),!0;case"dragenter":return hi=bc(hi,r,s,a,c,m),!0;case"mouseover":return pi=bc(pi,r,s,a,c,m),!0;case"pointerover":var g=m.pointerId;return yc.set(g,bc(yc.get(g)||null,r,s,a,c,m)),!0;case"gotpointercapture":return g=m.pointerId,vc.set(g,bc(vc.get(g)||null,r,s,a,c,m)),!0}return!1}function nE(r){var s=Zo(r.target);if(s!==null){var a=l(s);if(a!==null){if(s=a.tag,s===13){if(s=u(a),s!==null){r.blockedOn=s,wu(r.priority,function(){JS(a)});return}}else if(s===31){if(s=f(a),s!==null){r.blockedOn=s,wu(r.priority,function(){JS(a)});return}}else if(s===3&&a.stateNode.current.memoizedState.isDehydrated){r.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}r.blockedOn=null}function kf(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var a=$m(r.nativeEvent);if(a===null){a=r.nativeEvent;var c=new a.constructor(a.type,a);Gh=c,a.target.dispatchEvent(c),Gh=null}else return s=Jo(a),s!==null&&ZS(s),r.blockedOn=a,!1;s.shift()}return!0}function rE(r,s,a){kf(r)&&a.delete(s)}function jA(){Km=!1,di!==null&&kf(di)&&(di=null),hi!==null&&kf(hi)&&(hi=null),pi!==null&&kf(pi)&&(pi=null),yc.forEach(rE),vc.forEach(rE)}function If(r,s){r.blockedOn===s&&(r.blockedOn=null,Km||(Km=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,jA)))}var Df=null;function sE(r){Df!==r&&(Df=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Df===r&&(Df=null);for(var s=0;s<r.length;s+=3){var a=r[s],c=r[s+1],m=r[s+2];if(typeof c!="function"){if(Gm(c||a)===null)continue;break}var g=Jo(a);g!==null&&(r.splice(s,3),s-=3,$p(g,{pending:!0,data:m,method:a.method,action:c},c,m))}}))}function Ia(r){function s(B){return If(B,r)}di!==null&&If(di,r),hi!==null&&If(hi,r),pi!==null&&If(pi,r),yc.forEach(s),vc.forEach(s);for(var a=0;a<mi.length;a++){var c=mi[a];c.blockedOn===r&&(c.blockedOn=null)}for(;0<mi.length&&(a=mi[0],a.blockedOn===null);)nE(a),a.blockedOn===null&&mi.shift();if(a=(r.ownerDocument||r).$$reactFormReplay,a!=null)for(c=0;c<a.length;c+=3){var m=a[c],g=a[c+1],w=m[_n]||null;if(typeof g=="function")w||sE(a);else if(w){var O=null;if(g&&g.hasAttribute("formAction")){if(m=g,w=g[_n]||null)O=w.formAction;else if(Gm(m)!==null)continue}else O=w.action;typeof O=="function"?a[c+1]=O:(a.splice(c,3),c-=3),sE(a)}}}function iE(){function r(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(w){return m=w})},focusReset:"manual",scroll:"manual"})}function s(){m!==null&&(m(),m=null),c||setTimeout(a,20)}function a(){if(!c&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,m=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(a,100),function(){c=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),m!==null&&(m(),m=null)}}}function Ym(r){this._internalRoot=r}Lf.prototype.render=Ym.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(i(409));var a=s.current,c=$n();QS(a,c,r,s,null,null)},Lf.prototype.unmount=Ym.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;QS(r.current,2,null,r,null,null),gf(),s[Wo]=null}};function Lf(r){this._internalRoot=r}Lf.prototype.unstable_scheduleHydration=function(r){if(r){var s=_u();r={blockedOn:null,target:r,priority:s};for(var a=0;a<mi.length&&s!==0&&s<mi[a].priority;a++);mi.splice(a,0,r),a===0&&nE(r)}};var oE=t.version;if(oE!=="19.2.4")throw Error(i(527,oE,"19.2.4"));$.findDOMNode=function(r){var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(i(188)):(r=Object.keys(r).join(","),Error(i(268,r)));return r=p(s),r=r!==null?y(r):null,r=r===null?null:r.stateNode,r};var MA={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pf.isDisabled&&Pf.supportsFiber)try{ar=Pf.inject(MA),Ut=Pf}catch{}}return Ec.createRoot=function(r,s){if(!o(r))throw Error(i(299));var a=!1,c="",m=h0,g=p0,w=m0;return s!=null&&(s.unstable_strictMode===!0&&(a=!0),s.identifierPrefix!==void 0&&(c=s.identifierPrefix),s.onUncaughtError!==void 0&&(m=s.onUncaughtError),s.onCaughtError!==void 0&&(g=s.onCaughtError),s.onRecoverableError!==void 0&&(w=s.onRecoverableError)),s=YS(r,1,!1,null,null,a,c,null,m,g,w,iE),r[Wo]=s.current,jm(r),new Ym(s)},Ec.hydrateRoot=function(r,s,a){if(!o(r))throw Error(i(299));var c=!1,m="",g=h0,w=p0,O=m0,B=null;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onUncaughtError!==void 0&&(g=a.onUncaughtError),a.onCaughtError!==void 0&&(w=a.onCaughtError),a.onRecoverableError!==void 0&&(O=a.onRecoverableError),a.formState!==void 0&&(B=a.formState)),s=YS(r,1,!0,s,a??null,c,m,B,g,w,O,iE),s.context=XS(null),a=s.current,c=$n(),c=zn(c),m=ei(c),m.callback=null,ti(a,m,c),a=c,s.current.lanes=a,is(s,a),Xr(s),r[Wo]=s.current,jm(r),new Lf(s)},Ec.version="19.2.4",Ec}var T_;function l5(){if(T_)return hg.exports;T_=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),hg.exports=a5(),hg.exports}var c5=l5(),Sl=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(){}},u5={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},f5=class{#e=u5;#t=!1;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)}},_o=new f5;function d5(e){setTimeout(e,0)}var Lo=typeof window>"u"||"Deno"in globalThis;function vn(){}function h5(e,t){return typeof e=="function"?e(t):e}function by(e){return typeof e=="number"&&e>=0&&e!==1/0}function pR(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ji(e,t){return typeof e=="function"?e(t):e}function br(e,t){return typeof e=="function"?e(t):e}function C_(e,t){const{type:n="all",exact:i,fetchStatus:o,predicate:l,queryKey:u,stale:f}=e;if(u){if(i){if(t.queryHash!==Ev(u,t.options))return!1}else if(!Vc(t.queryKey,u))return!1}if(n!=="all"){const h=t.isActive();if(n==="active"&&!h||n==="inactive"&&h)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||o&&o!==t.state.fetchStatus||l&&!l(t))}function R_(e,t){const{exact:n,status:i,predicate:o,mutationKey:l}=e;if(l){if(!t.options.mutationKey)return!1;if(n){if(Po(t.options.mutationKey)!==Po(l))return!1}else if(!Vc(t.options.mutationKey,l))return!1}return!(i&&t.state.status!==i||o&&!o(t))}function Ev(e,t){return(t?.queryKeyHashFn||Po)(e)}function Po(e){return JSON.stringify(e,(t,n)=>xy(n)?Object.keys(n).sort().reduce((i,o)=>(i[o]=n[o],i),{}):n)}function Vc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Vc(e[n],t[n])):!1}var p5=Object.prototype.hasOwnProperty;function mR(e,t,n=0){if(e===t)return e;if(n>500)return t;const i=N_(e)&&N_(t);if(!i&&!(xy(e)&&xy(t)))return t;const l=(i?e:Object.keys(e)).length,u=i?t:Object.keys(t),f=u.length,h=i?new Array(f):{};let p=0;for(let y=0;y<f;y++){const v=i?y:u[y],b=e[v],x=t[v];if(b===x){h[v]=b,(i?y<l:p5.call(e,v))&&p++;continue}if(b===null||x===null||typeof b!="object"||typeof x!="object"){h[v]=x;continue}const E=mR(b,x,n+1);h[v]=E,E===b&&p++}return l===f&&p===l?e:h}function zd(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function N_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function xy(e){if(!j_(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!j_(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function j_(e){return Object.prototype.toString.call(e)==="[object Object]"}function m5(e){return new Promise(t=>{_o.setTimeout(t,e)})}function Sy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?mR(e,t):t}function g5(e,t,n=0){const i=[...e,t];return n&&i.length>n?i.slice(1):i}function y5(e,t,n=0){const i=[t,...e];return n&&i.length>n?i.slice(0,-1):i}var _v=Symbol();function gR(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===_v?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function wv(e,t){return typeof e=="function"?e(...t):!!e}function v5(e,t,n){let i=!1,o;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t(),i||(i=!0,o.aborted?n():o.addEventListener("abort",n,{once:!0})),o)}),e}var b5=class extends Sl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!Lo&&window.addEventListener){const 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(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Tv=new b5;function Ey(){let e,t;const n=new Promise((o,l)=>{e=o,t=l});n.status="pending",n.catch(()=>{});function i(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{i({status:"fulfilled",value:o}),e(o)},n.reject=o=>{i({status:"rejected",reason:o}),t(o)},n}var x5=d5;function S5(){let e=[],t=0,n=f=>{f()},i=f=>{f()},o=x5;const l=f=>{t?e.push(f):o(()=>{n(f)})},u=()=>{const f=e;e=[],f.length&&o(()=>{i(()=>{f.forEach(h=>{n(h)})})})};return{batch:f=>{let h;t++;try{h=f()}finally{t--,t||u()}return h},batchCalls:f=>(...h)=>{l(()=>{f(...h)})},schedule:l,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{i=f},setScheduler:f=>{o=f}}}var Jt=S5(),E5=class extends Sl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!Lo&&window.addEventListener){const 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(n=>{n(e)}))}isOnline(){return this.#e}},Ud=new E5;function _5(e){return Math.min(1e3*2**e,3e4)}function yR(e){return(e??"online")==="online"?Ud.isOnline():!0}var _y=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function vR(e){let t=!1,n=0,i;const o=Ey(),l=()=>o.status!=="pending",u=_=>{if(!l()){const T=new _y(_);b(T),e.onCancel?.(T)}},f=()=>{t=!0},h=()=>{t=!1},p=()=>Tv.isFocused()&&(e.networkMode==="always"||Ud.isOnline())&&e.canRun(),y=()=>yR(e.networkMode)&&e.canRun(),v=_=>{l()||(i?.(),o.resolve(_))},b=_=>{l()||(i?.(),o.reject(_))},x=()=>new Promise(_=>{i=T=>{(l()||p())&&_(T)},e.onPause?.()}).then(()=>{i=void 0,l()||e.onContinue?.()}),E=()=>{if(l())return;let _;const T=n===0?e.initialPromise:void 0;try{_=T??e.fn()}catch(C){_=Promise.reject(C)}Promise.resolve(_).then(v).catch(C=>{if(l())return;const M=e.retry??(Lo?0:3),R=e.retryDelay??_5,N=typeof R=="function"?R(n,C):R,k=M===!0||typeof M=="number"&&n<M||typeof M=="function"&&M(n,C);if(t||!k){b(C);return}n++,e.onFail?.(n,C),m5(N).then(()=>p()?void 0:x()).then(()=>{t?b(C):E()})})};return{promise:o,status:()=>o.status,cancel:u,continue:()=>(i?.(),o),cancelRetry:f,continueRetry:h,canStart:y,start:()=>(y()?E():x().then(E),o)}}var bR=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),by(this.gcTime)&&(this.#e=_o.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Lo?1/0:300*1e3))}clearGcTimeout(){this.#e&&(_o.clearTimeout(this.#e),this.#e=void 0)}},w5=class extends bR{#e;#t;#n;#s;#r;#o;#a;constructor(e){super(),this.#a=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=A_(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#o,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=A_(this.options);t.data!==void 0&&(this.setState(M_(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Sy(this.state.data,e,this.options);return this.#i({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#i({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(vn).catch(vn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>br(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_v||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ji(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:!pR(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.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.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#i({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},o=()=>{const f=gR(this.options,t),p=(()=>{const y={client:this.#s,queryKey:this.queryKey,meta:this.meta};return i(y),y})();return this.#a=!1,this.options.persister?this.options.persister(f,p,this):f(p)},u=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:o};return i(f),f})();this.options.behavior?.onFetch(u,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#i({type:"fetch",meta:u.fetchOptions?.meta}),this.#r=vR({initialPromise:t?.initialPromise,fn:u.fetchFn,onCancel:f=>{f instanceof _y&&f.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(f,h)=>{this.#i({type:"failed",failureCount:f,error:h})},onPause:()=>{this.#i({type:"pause"})},onContinue:()=>{this.#i({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{const f=await this.#r.start();if(f===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(f),this.#n.config.onSuccess?.(f,this),this.#n.config.onSettled?.(f,this.state.error,this),f}catch(f){if(f instanceof _y){if(f.silent)return this.#r.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#i({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#i(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...xR(n.data,this.options),fetchMeta:e.meta??null};case"success":const i={...n,...M_(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?i:void 0,i;case"error":const o=e.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Jt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function xR(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:yR(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function M_(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function A_(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,i=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var T5=class extends Sl{constructor(e,t){super(),this.options=t,this.#e=e,this.#i=null,this.#a=Ey(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#o;#a;#i;#m;#d;#h;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),O_(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return wy(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return wy(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#S(),this.#t.removeObserver(this)}setOptions(e){const 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 br(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#E(),this.#t.setOptions(this.options),t._defaulted&&!zd(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&k_(this.#t,n,this.options,t)&&this.#f(),this.updateResult(),i&&(this.#t!==n||br(this.options.enabled,this.#t)!==br(t.enabled,this.#t)||ji(this.options.staleTime,this.#t)!==ji(t.staleTime,this.#t))&&this.#g();const o=this.#y();i&&(this.#t!==n||br(this.options.enabled,this.#t)!==br(t.enabled,this.#t)||o!==this.#l)&&this.#v(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return R5(this,n)&&(this.#s=n,this.#o=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,i)=>(this.trackProp(i),t?.(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,i))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const 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.#f({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#f(e){this.#E();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(vn)),t}#g(){this.#x();const e=ji(this.options.staleTime,this.#t);if(Lo||this.#s.isStale||!by(e))return;const n=pR(this.#s.dataUpdatedAt,e)+1;this.#c=_o.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#S(),this.#l=e,!(Lo||br(this.options.enabled,this.#t)===!1||!by(this.#l)||this.#l===0)&&(this.#u=_o.setInterval(()=>{(this.options.refetchIntervalInBackground||Tv.isFocused())&&this.#f()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(_o.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(_o.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,i=this.options,o=this.#s,l=this.#r,u=this.#o,h=e!==n?e.state:this.#n,{state:p}=e;let y={...p},v=!1,b;if(t._optimisticResults){const A=this.hasListeners(),D=!A&&O_(e,t),G=A&&k_(e,n,t,i);(D||G)&&(y={...y,...xR(p.data,e.options)}),t._optimisticResults==="isRestoring"&&(y.fetchStatus="idle")}let{error:x,errorUpdatedAt:E,status:_}=y;b=y.data;let T=!1;if(t.placeholderData!==void 0&&b===void 0&&_==="pending"){let A;o?.isPlaceholderData&&t.placeholderData===u?.placeholderData?(A=o.data,T=!0):A=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,A!==void 0&&(_="success",b=Sy(o?.data,A,t),v=!0)}if(t.select&&b!==void 0&&!T)if(o&&b===l?.data&&t.select===this.#m)b=this.#d;else try{this.#m=t.select,b=t.select(b),b=Sy(o?.data,b,t),this.#d=b,this.#i=null}catch(A){this.#i=A}this.#i&&(x=this.#i,b=this.#d,E=Date.now(),_="error");const C=y.fetchStatus==="fetching",M=_==="pending",R=_==="error",N=M&&C,k=b!==void 0,j={status:_,fetchStatus:y.fetchStatus,isPending:M,isSuccess:_==="success",isError:R,isInitialLoading:N,isLoading:N,data:b,dataUpdatedAt:y.dataUpdatedAt,error:x,errorUpdatedAt:E,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>h.dataUpdateCount||y.errorUpdateCount>h.errorUpdateCount,isFetching:C,isRefetching:C&&!M,isLoadingError:R&&!k,isPaused:y.fetchStatus==="paused",isPlaceholderData:v,isRefetchError:R&&k,isStale:Cv(e,t),refetch:this.refetch,promise:this.#a,isEnabled:br(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const A=j.data!==void 0,D=j.status==="error"&&!A,G=Q=>{D?Q.reject(j.error):A&&Q.resolve(j.data)},F=()=>{const Q=this.#a=j.promise=Ey();G(Q)},P=this.#a;switch(P.status){case"pending":e.queryHash===n.queryHash&&G(P);break;case"fulfilled":(D||j.data!==P.value)&&F();break;case"rejected":(!D||j.error!==P.reason)&&F();break}}return j}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#o=this.options,this.#r.data!==void 0&&(this.#h=this.#t),zd(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!this.#p.size)return!0;const l=new Set(o??this.#p);return this.options.throwOnError&&l.add("error"),Object.keys(this.#s).some(u=>{const f=u;return this.#s[f]!==e[f]&&l.has(f)})};this.#_({listeners:n()})}#E(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#_(e){Jt.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function C5(e,t){return br(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function O_(e,t){return C5(e,t)||e.state.data!==void 0&&wy(e,t,t.refetchOnMount)}function wy(e,t,n){if(br(t.enabled,e)!==!1&&ji(t.staleTime,e)!=="static"){const i=typeof n=="function"?n(e):n;return i==="always"||i!==!1&&Cv(e,t)}return!1}function k_(e,t,n,i){return(e!==t||br(i.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Cv(e,n)}function Cv(e,t){return br(t.enabled,e)!==!1&&e.isStaleByTime(ji(t.staleTime,e))}function R5(e,t){return!zd(e.getCurrentResult(),t)}function I_(e){return{onFetch:(t,n)=>{const i=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,l=t.state.data?.pages||[],u=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},h=0;const p=async()=>{let y=!1;const v=E=>{v5(E,()=>t.signal,()=>y=!0)},b=gR(t.options,t.fetchOptions),x=async(E,_,T)=>{if(y)return Promise.reject();if(_==null&&E.pages.length)return Promise.resolve(E);const M=(()=>{const z={client:t.client,queryKey:t.queryKey,pageParam:_,direction:T?"backward":"forward",meta:t.options.meta};return v(z),z})(),R=await b(M),{maxPages:N}=t.options,k=T?y5:g5;return{pages:k(E.pages,R,N),pageParams:k(E.pageParams,_,N)}};if(o&&l.length){const E=o==="backward",_=E?N5:D_,T={pages:l,pageParams:u},C=_(i,T);f=await x(T,C,E)}else{const E=e??l.length;do{const _=h===0?u[0]??i.initialPageParam:D_(i,f);if(h>0&&_==null)break;f=await x(f,_),h++}while(h<E)}return f};t.options.persister?t.fetchFn=()=>t.options.persister?.(p,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=p}}}function D_(e,{pages:t,pageParams:n}){const i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,n[i],n):void 0}function N5(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var j5=class extends bR{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||SR(),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.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=vR({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(l,u)=>{this.#r({type:"failed",failureCount:l,error:u})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",o=!this.#s.canStart();try{if(i)t();else{this.#r({type:"pending",variables:e,isPaused:o}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const u=await this.options.onMutate?.(e,n);u!==this.state.context&&this.#r({type:"pending",context:u,variables:e,isPaused:o})}const l=await this.#s.start();return await this.#n.config.onSuccess?.(l,e,this.state.context,this,n),await this.options.onSuccess?.(l,e,this.state.context,n),await this.#n.config.onSettled?.(l,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(l,null,e,this.state.context,n),this.#r({type:"success",data:l}),l}catch(l){try{await this.#n.config.onError?.(l,e,this.state.context,this,n)}catch(u){Promise.reject(u)}try{await this.options.onError?.(l,e,this.state.context,n)}catch(u){Promise.reject(u)}try{await this.#n.config.onSettled?.(void 0,l,this.state.variables,this.state.context,this,n)}catch(u){Promise.reject(u)}try{await this.options.onSettled?.(void 0,l,e,this.state.context,n)}catch(u){Promise.reject(u)}throw this.#r({type:"error",error:l}),l}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,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{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Jt.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function SR(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var M5=class extends Sl{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const i=new j5({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(i),i}add(e){this.#e.add(e);const t=Vf(e);if(typeof t=="string"){const 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)){const t=Vf(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const i=n.indexOf(e);i!==-1&&n.splice(i,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Vf(e);if(typeof t=="string"){const i=this.#t.get(t)?.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){const t=Vf(e);return typeof t=="string"?this.#t.get(t)?.find(i=>i!==e&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Jt.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){const t={exact:!0,...e};return this.getAll().find(n=>R_(t,n))}findAll(e={}){return this.getAll().filter(t=>R_(e,t))}notify(e){Jt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Jt.batch(()=>Promise.all(e.map(t=>t.continue().catch(vn))))}};function Vf(e){return e.options.scope?.id}var A5=class extends Sl{#e;#t=void 0;#n;#s;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),zd(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Po(n.mutationKey)!==Po(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#o(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#o()}mutate(t,n){return this.#s=n,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(t)}#r(){const t=this.#n?.state??SR();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#o(t){Jt.batch(()=>{if(this.#s&&this.hasListeners()){const n=this.#t.variables,i=this.#t.context,o={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#s.onSuccess?.(t.data,n,i,o)}catch(l){Promise.reject(l)}try{this.#s.onSettled?.(t.data,null,n,i,o)}catch(l){Promise.reject(l)}}else if(t?.type==="error"){try{this.#s.onError?.(t.error,n,i,o)}catch(l){Promise.reject(l)}try{this.#s.onSettled?.(void 0,t.error,n,i,o)}catch(l){Promise.reject(l)}}}this.listeners.forEach(n=>{n(this.#t)})})}},O5=class extends Sl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const i=t.queryKey,o=t.queryHash??Ev(i,t);let l=this.get(o);return l||(l=new w5({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(i)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Jt.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>C_(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>C_(e,n)):t}notify(e){Jt.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Jt.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Jt.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},k5=class{#e;#t;#n;#s;#r;#o;#a;#i;constructor(e={}){this.#e=e.queryCache||new O5,this.#t=e.mutationCache||new M5,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#a=Tv.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=Ud.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#a?.(),this.#a=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),i=n.state.data;return i===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ji(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(i))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const i=n.data;return[t,i]})}setQueryData(e,t,n){const i=this.defaultQueryOptions({queryKey:e}),l=this.#e.get(i.queryHash)?.state.data,u=h5(t,l);if(u!==void 0)return this.#e.build(this,i).setData(u,{...n,manual:!0})}setQueriesData(e,t,n){return Jt.batch(()=>this.#e.findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;Jt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return Jt.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},i=Jt.batch(()=>this.#e.findAll(e).map(o=>o.cancel(n)));return Promise.all(i).then(vn).catch(vn)}invalidateQueries(e,t={}){return Jt.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},i=Jt.batch(()=>this.#e.findAll(e).filter(o=>!o.isDisabled()&&!o.isStatic()).map(o=>{let l=o.fetch(void 0,n);return n.throwOnError||(l=l.catch(vn)),o.state.fetchStatus==="paused"?Promise.resolve():l}));return Promise.all(i).then(vn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(ji(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(vn).catch(vn)}fetchInfiniteQuery(e){return e.behavior=I_(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(vn).catch(vn)}ensureInfiniteQueryData(e){return e.behavior=I_(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Ud.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.#s.set(Po(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(i=>{Vc(e,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(Po(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(i=>{Vc(e,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ev(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===_v&&(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()}},ER=S.createContext(void 0),Rv=e=>{const t=S.useContext(ER);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},I5=({client:e,children:t})=>(S.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(ER.Provider,{value:e,children:t})),_R=S.createContext(!1),D5=()=>S.useContext(_R);_R.Provider;function L5(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var P5=S.createContext(L5()),z5=()=>S.useContext(P5),U5=(e,t,n)=>{const i=n?.state.error&&typeof e.throwOnError=="function"?wv(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||i)&&(t.isReset()||(e.retryOnMount=!1))},B5=e=>{S.useEffect(()=>{e.clearReset()},[e])},H5=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(o&&e.data===void 0||wv(n,[e.error,i])),F5=e=>{if(e.suspense){const n=o=>o==="static"?o:Math.max(o??1e3,1e3),i=e.staleTime;e.staleTime=typeof i=="function"?(...o)=>n(i(...o)):n(i),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},q5=(e,t)=>e.isLoading&&e.isFetching&&!t,V5=(e,t)=>e?.suspense&&t.isPending,L_=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function $5(e,t,n){const i=D5(),o=z5(),l=Rv(),u=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(u);const f=l.getQueryCache().get(u.queryHash);u._optimisticResults=i?"isRestoring":"optimistic",F5(u),U5(u,o,f),B5(o);const h=!l.getQueryCache().get(u.queryHash),[p]=S.useState(()=>new t(l,u)),y=p.getOptimisticResult(u),v=!i&&e.subscribed!==!1;if(S.useSyncExternalStore(S.useCallback(b=>{const x=v?p.subscribe(Jt.batchCalls(b)):vn;return p.updateResult(),x},[p,v]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),S.useEffect(()=>{p.setOptions(u)},[u,p]),V5(u,y))throw L_(u,p,o);if(H5({result:y,errorResetBoundary:o,throwOnError:u.throwOnError,query:f,suspense:u.suspense}))throw y.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(u,y),u.experimental_prefetchInRender&&!Lo&&q5(y,i)&&(h?L_(u,p,o):f?.promise)?.catch(vn).finally(()=>{p.updateResult()}),u.notifyOnChangeProps?y:p.trackResult(y)}function wR(e,t){return $5(e,T5)}function G5(e,t){const n=Rv(),[i]=S.useState(()=>new A5(n,e));S.useEffect(()=>{i.setOptions(e)},[i,e]);const o=S.useSyncExternalStore(S.useCallback(u=>i.subscribe(Jt.batchCalls(u)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),l=S.useCallback((u,f)=>{i.mutate(u,f).catch(vn)},[i]);if(o.error&&wv(i.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:l,mutateAsync:o.mutate}}var kt=(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))(kt||{});function TR({update:e,notify:t,unwatched:n}){return{link:i,unlink:o,propagate:l,checkDirty:u,shallowPropagate:f};function i(p,y,v){const b=y.depsTail;if(b!==void 0&&b.dep===p)return;const x=b!==void 0?b.nextDep:y.deps;if(x!==void 0&&x.dep===p){x.version=v,y.depsTail=x;return}const E=p.subsTail;if(E!==void 0&&E.version===v&&E.sub===y)return;const _=y.depsTail=p.subsTail={version:v,dep:p,sub:y,prevDep:b,nextDep:x,prevSub:E,nextSub:void 0};x!==void 0&&(x.prevDep=_),b!==void 0?b.nextDep=_:y.deps=_,E!==void 0?E.nextSub=_:p.subs=_}function o(p,y=p.sub){const v=p.dep,b=p.prevDep,x=p.nextDep,E=p.nextSub,_=p.prevSub;return x!==void 0?x.prevDep=b:y.depsTail=b,b!==void 0?b.nextDep=x:y.deps=x,E!==void 0?E.prevSub=_:v.subsTail=_,_!==void 0?_.nextSub=E:(v.subs=E)===void 0&&n(v),x}function l(p){let y=p.nextSub,v;e:do{const b=p.sub;let x=b.flags;if(x&60?x&12?x&4?!(x&48)&&h(p,b)?(b.flags=x|40,x&=1):x=0:b.flags=x&-9|32:x=0:b.flags=x|32,x&2&&t(b),x&1){const E=b.subs;if(E!==void 0){const _=(p=E).nextSub;_!==void 0&&(v={value:y,prev:v},y=_);continue}}if((p=y)!==void 0){y=p.nextSub;continue}for(;v!==void 0;)if(p=v.value,v=v.prev,p!==void 0){y=p.nextSub;continue e}break}while(!0)}function u(p,y){let v,b=0,x=!1;e:do{const E=p.dep,_=E.flags;if(y.flags&16)x=!0;else if((_&17)===17){if(e(E)){const T=E.subs;T.nextSub!==void 0&&f(T),x=!0}}else if((_&33)===33){(p.nextSub!==void 0||p.prevSub!==void 0)&&(v={value:p,prev:v}),p=E.deps,y=E,++b;continue}if(!x){const T=p.nextDep;if(T!==void 0){p=T;continue}}for(;b--;){const T=y.subs,C=T.nextSub!==void 0;if(C?(p=v.value,v=v.prev):p=T,x){if(e(y)){C&&f(T),y=p.sub;continue}x=!1}else y.flags&=-33;y=p.sub;const M=p.nextDep;if(M!==void 0){p=M;continue e}}return x}while(!0)}function f(p){do{const y=p.sub,v=y.flags;(v&48)===32&&(y.flags=v|16,(v&6)===2&&t(y))}while((p=p.nextSub)!==void 0)}function h(p,y){let v=y.depsTail;for(;v!==void 0;){if(v===p)return!0;v=v.prevDep}return!1}}let Nv=0,vo=0,Oc=0;const Ns=[],{link:C9,unlink:CR,propagate:R9,checkDirty:K5,shallowPropagate:N9}=TR({update(e){return e.depsTail!==void 0?W5(e):Z5(e)},notify(e){let t=Oc,n=t;do if(Ns[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(Oc=t;n<--t;){const i=Ns[n];Ns[n++]=Ns[t],Ns[t]=i}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,yh(e)):tz.call(e)}});function Y5(){return Nv}function X5(){++Nv}function Q5(){--Nv||ez()}function W5(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,yh(e)}}function Z5(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function J5(e){const t=e.flags;if(t&16||t&32&&K5(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,yh(e)}}else e.flags=2}function ez(){try{for(;vo<Oc;){const e=Ns[vo];Ns[vo++]=void 0,J5(e)}}finally{for(;vo<Oc;){const e=Ns[vo];Ns[vo++]=void 0,e.flags|=10}vo=0,Oc=0}}function tz(){this.depsTail=void 0,this.flags=0,yh(this);const e=this.subs;e!==void 0&&CR(e)}function yh(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=CR(n,e)}function jv(e,t,n){const i=typeof e=="object",o=i?e:void 0;return{next:(i?e.next:e)?.bind(o),error:(i?e.error:t)?.bind(o),complete:(i?e.complete:n)?.bind(o)}}const Ty=[];let vd=0;const{link:P_,unlink:nz,propagate:rz,checkDirty:RR,shallowPropagate:z_}=TR({update(e){return e._update()},notify(e){Ty[Cy++]=e,e.flags&=~kt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=kt.Mutable|kt.Dirty,Bd(e))}});let $f=0,Cy=0,Zr;function Bd(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=nz(n,e)}function NR(){if(!(Y5()>0)){for(;$f<Cy;){const e=Ty[$f];Ty[$f++]=void 0,e.notify()}$f=0,Cy=0}}function jR(e,t){const n=typeof e=="function",i=e,o={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?kt.None:kt.Mutable,get(){return Zr!==void 0&&P_(o,Zr,vd),o._snapshot},subscribe(l){const u=jv(l),f={current:!1},h=sz(()=>{o.get(),f.current?u.next?.(o._snapshot):f.current=!0});return{unsubscribe:()=>{h.stop()}}},_update(l){const u=Zr,f=Object.is;Zr=o,++vd,o.depsTail=void 0,n&&(o.flags=kt.Mutable|kt.RecursedCheck);try{const h=o._snapshot,p=typeof l=="function"?l(h):l===void 0&&n?i(h):l;return h===void 0||!f(h,p)?(o._snapshot=p,!0):!1}finally{Zr=u,n&&(o.flags&=~kt.RecursedCheck),Bd(o)}}};return n?(o.flags=kt.Mutable|kt.Dirty,o.get=function(){const l=o.flags;if(l&kt.Dirty||l&kt.Pending&&RR(o.deps,o)){if(o._update()){const u=o.subs;u!==void 0&&z_(u)}}else l&kt.Pending&&(o.flags=l&~kt.Pending);return Zr!==void 0&&P_(o,Zr,vd),o._snapshot}):o.set=function(l){if(o._update(l)){const u=o.subs;u!==void 0&&(rz(u),z_(u),NR())}},o}function sz(e){const t=()=>{const i=Zr;Zr=n,++vd,n.depsTail=void 0,n.flags=kt.Watching|kt.RecursedCheck;try{return e()}finally{Zr=i,n.flags&=~kt.RecursedCheck,Bd(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:kt.Watching|kt.RecursedCheck,notify(){const i=this.flags;i&kt.Dirty||i&kt.Pending&&RR(this.deps,this)?t():this.flags=kt.Watching},stop(){this.flags=kt.None,this.depsTail=void 0,Bd(this)}};return t(),n}let iz=class{constructor(t){this.atom=jR(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(jv(t))}};class oz{constructor(t){this.atom=jR(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(jv(t))}}function az(e){return typeof e=="function"?new oz(e):new iz(e)}function lz(e){try{X5(),e()}finally{Q5(),NR()}}const Mi="__TSR_index",U_="popstate",B_="beforeunload";function cz(e){let t=e.getLocation();const n=new Set,i=u=>{t=e.getLocation(),n.forEach(f=>f({location:t,action:u}))},o=u=>{e.notifyOnIndexChange??!0?i(u):t=e.getLocation()},l=async({task:u,navigateOpts:f,...h})=>{if(f?.ignoreBlocker??!1){u();return}const y=e.getBlockers?.()??[],v=h.type==="PUSH"||h.type==="REPLACE";if(typeof document<"u"&&y.length&&v)for(const b of y){const x=Hd(h.path,h.state);if(await b.blockerFn({currentLocation:t,nextLocation:x,action:h.type})){e.onBlocked?.();return}}u()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:u=>(n.add(u),()=>{n.delete(u)}),push:(u,f,h)=>{const p=t.state[Mi];f=H_(p+1,f),l({task:()=>{e.pushState(u,f),i({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:u,state:f})},replace:(u,f,h)=>{const p=t.state[Mi];f=H_(p,f),l({task:()=>{e.replaceState(u,f),i({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:u,state:f})},go:(u,f)=>{l({task:()=>{e.go(u),o({type:"GO",index:u})},navigateOpts:f,type:"GO"})},back:u=>{l({task:()=>{e.back(u?.ignoreBlocker??!1),o({type:"BACK"})},navigateOpts:u,type:"BACK"})},forward:u=>{l({task:()=>{e.forward(u?.ignoreBlocker??!1),o({type:"FORWARD"})},navigateOpts:u,type:"FORWARD"})},canGoBack:()=>t.state[Mi]!==0,createHref:u=>e.createHref(u),block:u=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,u]),()=>{const h=e.getBlockers?.()??[];e.setBlockers?.(h.filter(p=>p!==u))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:i}}function H_(e,t){t||(t={});const n=Mv();return{...t,key:n,__TSR_key:n,[Mi]:e}}function uz(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,i=t.history.replaceState;let o=[];const l=()=>o,u=A=>o=A,f=(A=>A),h=(()=>Hd(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const A=Mv();t.history.replaceState({[Mi]:0,key:A,__TSR_key:A},"")}let p=h(),y,v=!1,b=!1,x=!1,E=!1;const _=()=>p;let T,C;const M=()=>{T&&(j._ignoreSubscribers=!0,(T.isPush?t.history.pushState:t.history.replaceState)(T.state,"",T.href),j._ignoreSubscribers=!1,T=void 0,C=void 0,y=void 0)},R=(A,D,G)=>{const F=f(D);C||(y=p),p=Hd(D,G),T={href:F,state:G,isPush:T?.isPush||A==="push"},C||(C=Promise.resolve().then(()=>M()))},N=A=>{p=h(),j.notify({type:A})},k=async()=>{if(b){b=!1;return}const A=h(),D=A.state[Mi]-p.state[Mi],G=D===1,F=D===-1,P=!G&&!F||v;v=!1;const Q=P?"GO":F?"BACK":"FORWARD",X=P?{type:"GO",index:D}:{type:F?"BACK":"FORWARD"};if(x)x=!1;else{const te=l();if(typeof document<"u"&&te.length){for(const L of te)if(await L.blockerFn({currentLocation:p,nextLocation:A,action:Q})){b=!0,t.history.go(1),j.notify(X);return}}}p=h(),j.notify(X)},z=A=>{if(E){E=!1;return}let D=!1;const G=l();if(typeof document<"u"&&G.length)for(const F of G){const P=F.enableBeforeUnload??!0;if(P===!0){D=!0;break}if(typeof P=="function"&&P()===!0){D=!0;break}}if(D)return A.preventDefault(),A.returnValue=""},j=cz({getLocation:_,getLength:()=>t.history.length,pushState:(A,D)=>R("push",A,D),replaceState:(A,D)=>R("replace",A,D),back:A=>(A&&(x=!0),E=!0,t.history.back()),forward:A=>{A&&(x=!0),E=!0,t.history.forward()},go:A=>{v=!0,t.history.go(A)},createHref:A=>f(A),flush:M,destroy:()=>{t.history.pushState=n,t.history.replaceState=i,t.removeEventListener(B_,z,{capture:!0}),t.removeEventListener(U_,k)},onBlocked:()=>{y&&p!==y&&(p=y)},getBlockers:l,setBlockers:u,notifyOnIndexChange:!1});return t.addEventListener(B_,z,{capture:!0}),t.addEventListener(U_,k),t.history.pushState=function(...A){const D=n.apply(t.history,A);return j._ignoreSubscribers||N("PUSH"),D},t.history.replaceState=function(...A){const D=i.apply(t.history,A);return j._ignoreSubscribers||N("REPLACE"),D},j}function fz(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Hd(e,t){const n=fz(e),i=n.indexOf("#"),o=n.indexOf("?"),l=Mv();return{href:n,pathname:n.substring(0,i>0?o>0?Math.min(i,o):i:o>0?o:n.length),hash:i>-1?n.substring(i):"",search:o>-1?n.slice(o,i===-1?void 0:i):"",state:t||{[Mi]:0,key:l,__TSR_key:l}}}function Mv(){return(Math.random()+1).toString(36).substring(7)}const dz=!1;function kc(e){let t;return lz(()=>{t=e()}),t}function $c(e){return e[e.length-1]}function hz(e){return typeof e=="function"}function Ei(e,t){return hz(e)?e(t):e}const pz=Object.prototype.hasOwnProperty,F_=Object.prototype.propertyIsEnumerable;function Gn(e,t,n=0){if(e===t)return e;if(n>500)return t;const i=t,o=$_(e)&&$_(i);if(!o&&!(Fd(e)&&Fd(i)))return i;const l=o?e:q_(e);if(!l)return i;const u=o?i:q_(i);if(!u)return i;const f=l.length,h=u.length,p=o?new Array(h):{};let y=0;for(let v=0;v<h;v++){const b=o?v:u[v],x=e[b],E=i[b];if(x===E){p[b]=x,(o?v<f:pz.call(e,b))&&y++;continue}if(x===null||E===null||typeof x!="object"||typeof E!="object"){p[b]=E;continue}const _=Gn(x,E,n+1);p[b]=_,_===x&&y++}return f===h&&y===f?e:p}function q_(e){const t=Object.getOwnPropertyNames(e);for(const o of t)if(!F_.call(e,o))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const i=t;for(const o of n){if(!F_.call(e,o))return!1;i.push(o)}return i}function Fd(e){if(!V_(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!V_(n)||!n.hasOwnProperty("isPrototypeOf"))}function V_(e){return Object.prototype.toString.call(e)==="[object Object]"}function $_(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Oo(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 i=0,o=e.length;i<o;i++)if(!Oo(e[i],t[i],n))return!1;return!0}if(Fd(e)&&Fd(t)){const i=n?.ignoreUndefined??!0;if(n?.partial){for(const u in t)if((!i||t[u]!==void 0)&&!Oo(e[u],t[u],n))return!1;return!0}let o=0;if(!i)o=Object.keys(e).length;else for(const u in e)e[u]!==void 0&&o++;let l=0;for(const u in t)if((!i||t[u]!==void 0)&&(l++,l>o||!Oo(e[u],t[u],n)))return!1;return o===l}return!1}function ol(e){let t,n;const i=new Promise((o,l)=>{t=o,n=l});return i.status="pending",i.resolve=o=>{i.status="resolved",i.value=o,t(o),e?.(o)},i.reject=o=>{i.status="rejected",n(o)},i}function qa(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function mz(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function G_(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return mz(t)}const gz=["http:","https:","mailto:","tel:"];function qd(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function _c(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,i="",o;for(;(o=t.exec(e))!==null;)i+=G_(e.slice(n,o.index))+o[0],n=t.lastIndex;i=i+G_(n?e.slice(n):e);let l=!1;return i.startsWith("//")&&(l=!0,i="/"+i.replace(/^\/+/,"")),{path:i,handledProtocolRelativeURL:l}}function yz(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var vz="Invariant failed";function zs(e,t){if(!e)throw new Error(vz)}function Vd(e){const t=new Map;let n,i;const o=l=>{l.next&&(l.prev?(l.prev.next=l.next,l.next.prev=l.prev,l.next=void 0,i&&(i.next=l,l.prev=i)):(l.next.prev=void 0,n=l.next,l.next=void 0,i&&(l.prev=i,i.next=l)),i=l)};return{get(l){const u=t.get(l);if(u)return o(u),u.value},set(l,u){if(t.size>=e&&n){const h=n;t.delete(h.key),h.next&&(n=h.next,h.next.prev=void 0),h===i&&(i=void 0)}const f=t.get(l);if(f)f.value=u,o(f);else{const h={key:l,value:u,prev:i};i&&(i.next=h),i=h,n||(n=h),t.set(l,h)}},clear(){t.clear(),n=void 0,i=void 0}}}const al=0,zo=1,Uo=2,Gc=3,wo=4,MR=5;function bz(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Av(e,t,n=new Uint16Array(6)){const i=e.indexOf("/",t),o=i===-1?e.length:i,l=e.substring(t,o);if(!l||!l.includes("$"))return n[0]=al,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n;if(l==="$"){const f=e.length;return n[0]=Uo,n[1]=t,n[2]=t,n[3]=f,n[4]=f,n[5]=f,n}if(l.charCodeAt(0)===36)return n[0]=zo,n[1]=t,n[2]=t+1,n[3]=o,n[4]=o,n[5]=o,n;const u=bz(l);if(u){const[f,h]=u,p=l.charCodeAt(f+1);if(p===45){if(f+2<l.length&&l.charCodeAt(f+2)===36){const y=f+3,v=h;if(y<v)return n[0]=Gc,n[1]=t+f,n[2]=t+y,n[3]=t+v,n[4]=t+h+1,n[5]=o,n}}else if(p===36){const y=f+1,v=f+2;return v===h?(n[0]=Uo,n[1]=t+f,n[2]=t+y,n[3]=t+v,n[4]=t+h+1,n[5]=e.length,n):(n[0]=zo,n[1]=t+f,n[2]=t+v,n[3]=t+h,n[4]=t+h+1,n[5]=o,n)}}return n[0]=al,n[1]=t,n[2]=t,n[3]=o,n[4]=o,n[5]=o,n}function vh(e,t,n,i,o,l,u){u?.(n);let f=i;{const h=n.fullPath??n.from,p=h.length,y=n.options?.caseSensitive??e,v=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;f<p;){const x=Av(h,f,t);let E;const _=f,T=x[5];switch(f=T+1,l++,x[0]){case al:{const M=h.substring(x[2],x[3]);if(y){const R=o.static?.get(M);if(R)E=R;else{o.static??=new Map;const N=To(n.fullPath??n.from);N.parent=o,N.depth=l,E=N,o.static.set(M,N)}}else{const R=M.toLowerCase(),N=o.staticInsensitive?.get(R);if(N)E=N;else{o.staticInsensitive??=new Map;const k=To(n.fullPath??n.from);k.parent=o,k.depth=l,E=k,o.staticInsensitive.set(R,k)}}break}case zo:{const M=h.substring(_,x[1]),R=h.substring(x[4],T),N=y&&!!(M||R),k=M?N?M:M.toLowerCase():void 0,z=R?N?R:R.toLowerCase():void 0,j=!v&&o.dynamic?.find(A=>!A.skipOnParamError&&A.caseSensitive===N&&A.prefix===k&&A.suffix===z);if(j)E=j;else{const A=vg(zo,n.fullPath??n.from,N,k,z);E=A,A.depth=l,A.parent=o,o.dynamic??=[],o.dynamic.push(A)}break}case Gc:{const M=h.substring(_,x[1]),R=h.substring(x[4],T),N=y&&!!(M||R),k=M?N?M:M.toLowerCase():void 0,z=R?N?R:R.toLowerCase():void 0,j=!v&&o.optional?.find(A=>!A.skipOnParamError&&A.caseSensitive===N&&A.prefix===k&&A.suffix===z);if(j)E=j;else{const A=vg(Gc,n.fullPath??n.from,N,k,z);E=A,A.parent=o,A.depth=l,o.optional??=[],o.optional.push(A)}break}case Uo:{const M=h.substring(_,x[1]),R=h.substring(x[4],T),N=y&&!!(M||R),k=M?N?M:M.toLowerCase():void 0,z=R?N?R:R.toLowerCase():void 0,j=vg(Uo,n.fullPath??n.from,N,k,z);E=j,j.parent=o,j.depth=l,o.wildcard??=[],o.wildcard.push(j)}}o=E}if(v&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const x=To(n.fullPath??n.from);x.kind=MR,x.parent=o,l++,x.depth=l,o.pathless??=[],o.pathless.push(x),o=x}const b=(n.path||!n.children)&&!n.isRoot;if(b&&h.endsWith("/")){const x=To(n.fullPath??n.from);x.kind=wo,x.parent=o,l++,x.depth=l,o.index=x,o=x}o.parse=n.options?.params?.parse??null,o.skipOnParamError=v,o.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,b&&!o.route&&(o.route=n,o.fullPath=n.fullPath??n.from)}if(n.children)for(const h of n.children)vh(e,t,h,f,o,l,u)}function yg(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 xi(e){if(e.pathless)for(const t of e.pathless)xi(t);if(e.static)for(const t of e.static.values())xi(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())xi(t);if(e.dynamic?.length){e.dynamic.sort(yg);for(const t of e.dynamic)xi(t)}if(e.optional?.length){e.optional.sort(yg);for(const t of e.optional)xi(t)}if(e.wildcard?.length){e.wildcard.sort(yg);for(const t of e.wildcard)xi(t)}}function To(e){return{kind:al,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 vg(e,t,n,i,o){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:i,suffix:o}}function xz(e,t){const n=To("/"),i=new Uint16Array(6);for(const o of e)vh(!1,i,o,1,n,0);xi(n),t.masksTree=n,t.flatCache=Vd(1e3)}function Sz(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const i=Ov(e,t.masksTree);return t.flatCache.set(e,i),i}function Ez(e,t,n,i,o){e||="/",i||="/";const l=t?`case\0${e}`:e;let u=o.singleCache.get(l);if(!u){u=To("/");const f=new Uint16Array(6);vh(t,f,{from:e},1,u,0),o.singleCache.set(l,u)}return Ov(i,u,n)}function _z(e,t,n=!1){const i=n?e:`nofuzz\0${e}`,o=t.matchCache.get(i);if(o!==void 0)return o;e||="/";let l;try{l=Ov(e,t.segmentTree,n)}catch(u){if(u instanceof URIError)l=null;else throw u}return l&&(l.branch=Cz(l.route)),t.matchCache.set(i,l),l}function wz(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Tz(e,t=!1,n){const i=To(e.fullPath),o=new Uint16Array(6),l={},u={};let f=0;return vh(t,o,e,1,i,0,p=>{if(n?.(p,f),zs(!(p.id in l),`Duplicate routes found with id: ${String(p.id)}`),l[p.id]=p,f!==0&&p.path){const y=wz(p.fullPath);(!u[y]||p.fullPath.endsWith("/"))&&(u[y]=p)}f++}),xi(i),{processedTree:{segmentTree:i,singleCache:Vd(1e3),matchCache:Vd(1e3),flatCache:null,masksTree:null},routesById:l,routesByPath:u}}function Ov(e,t,n=!1){const i=e.split("/"),o=Nz(e,i,t,n);if(!o)return null;const[l]=AR(e,i,o);return{route:o.node.route,rawParams:l,parsedParams:o.parsedParams}}function AR(e,t,n){const i=Rz(n.node);let o=null;const l={};let u=n.extract?.part??0,f=n.extract?.node??0,h=n.extract?.path??0,p=n.extract?.segment??0;for(;f<i.length;u++,f++,h++,p++){const y=i[f];if(y.kind===wo)break;if(y.kind===MR){p--,u--,h--;continue}const v=t[u],b=h;if(v&&(h+=v.length),y.kind===zo){o??=n.node.fullPath.split("/");const x=o[p],E=y.prefix?.length??0;if(x.charCodeAt(E)===123){const T=y.suffix?.length??0,C=x.substring(E+2,x.length-T-1),M=v.substring(E,v.length-T);l[C]=decodeURIComponent(M)}else{const T=x.substring(1);l[T]=decodeURIComponent(v)}}else if(y.kind===Gc){if(n.skipped&1<<f){u--,h=b-1;continue}o??=n.node.fullPath.split("/");const x=o[p],E=y.prefix?.length??0,_=y.suffix?.length??0,T=x.substring(E+3,x.length-_-1),C=y.suffix||y.prefix?v.substring(E,v.length-_):v;C&&(l[T]=decodeURIComponent(C))}else if(y.kind===Uo){const x=y,E=e.substring(b+(x.prefix?.length??0),e.length-(x.suffix?.length??0)),_=decodeURIComponent(E);l["*"]=_,l._splat=_;break}}return n.rawParams&&Object.assign(l,n.rawParams),[l,{part:u,node:f,path:h,segment:p}]}function Cz(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function Rz(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Nz(e,t,n,i){if(e==="/"&&n.index)return{node:n.index,skipped:0};const o=!$c(t),l=o&&e!=="/",u=t.length-(o?1:0),f=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let h=null,p=null,y=null;for(;f.length;){const v=f.pop(),{node:b,index:x,skipped:E,depth:_,statics:T,dynamics:C,optionals:M}=v;let{extract:R,rawParams:N,parsedParams:k}=v;if(b.skipOnParamError){if(!bg(e,t,v))continue;N=v.rawParams,R=v.extract,k=v.parsedParams}i&&b.route&&b.kind!==wo&&wc(p,v)&&(p=v);const z=x===u;if(z&&(b.route&&!l&&wc(y,v)&&(y=v),!b.optional&&!b.wildcard&&!b.index&&!b.pathless))continue;const j=z?void 0:t[x];let A;if(z&&b.index){const D={node:b.index,index:x,skipped:E,depth:_+1,statics:T,dynamics:C,optionals:M,extract:R,rawParams:N,parsedParams:k};let G=!0;if(b.index.skipOnParamError&&(bg(e,t,D)||(G=!1)),G){if(T===u&&!C&&!M&&!E)return D;wc(y,D)&&(y=D)}}if(b.wildcard&&wc(h,v))for(const D of b.wildcard){const{prefix:G,suffix:F}=D;if(G&&(z||!(D.caseSensitive?j:A??=j.toLowerCase()).startsWith(G)))continue;if(F){if(z)continue;const Q=t.slice(x).join("/").slice(-F.length);if((D.caseSensitive?Q:Q.toLowerCase())!==F)continue}const P={node:D,index:u,skipped:E,depth:_,statics:T,dynamics:C,optionals:M,extract:R,rawParams:N,parsedParams:k};if(!(D.skipOnParamError&&!bg(e,t,P))){h=P;break}}if(b.optional){const D=E|1<<_,G=_+1;for(let F=b.optional.length-1;F>=0;F--){const P=b.optional[F];f.push({node:P,index:x,skipped:D,depth:G,statics:T,dynamics:C,optionals:M,extract:R,rawParams:N,parsedParams:k})}if(!z)for(let F=b.optional.length-1;F>=0;F--){const P=b.optional[F],{prefix:Q,suffix:X}=P;if(Q||X){const te=P.caseSensitive?j:A??=j.toLowerCase();if(Q&&!te.startsWith(Q)||X&&!te.endsWith(X))continue}f.push({node:P,index:x+1,skipped:E,depth:G,statics:T,dynamics:C,optionals:M+1,extract:R,rawParams:N,parsedParams:k})}}if(!z&&b.dynamic&&j)for(let D=b.dynamic.length-1;D>=0;D--){const G=b.dynamic[D],{prefix:F,suffix:P}=G;if(F||P){const Q=G.caseSensitive?j:A??=j.toLowerCase();if(F&&!Q.startsWith(F)||P&&!Q.endsWith(P))continue}f.push({node:G,index:x+1,skipped:E,depth:_+1,statics:T,dynamics:C+1,optionals:M,extract:R,rawParams:N,parsedParams:k})}if(!z&&b.staticInsensitive){const D=b.staticInsensitive.get(A??=j.toLowerCase());D&&f.push({node:D,index:x+1,skipped:E,depth:_+1,statics:T+1,dynamics:C,optionals:M,extract:R,rawParams:N,parsedParams:k})}if(!z&&b.static){const D=b.static.get(j);D&&f.push({node:D,index:x+1,skipped:E,depth:_+1,statics:T+1,dynamics:C,optionals:M,extract:R,rawParams:N,parsedParams:k})}if(b.pathless){const D=_+1;for(let G=b.pathless.length-1;G>=0;G--){const F=b.pathless[G];f.push({node:F,index:x,skipped:E,depth:D,statics:T,dynamics:C,optionals:M,extract:R,rawParams:N,parsedParams:k})}}}if(y&&h)return wc(h,y)?y:h;if(y)return y;if(h)return h;if(i&&p){let v=p.index;for(let x=0;x<p.index;x++)v+=t[x].length;const b=v===e.length?"/":e.slice(v);return p.rawParams??={},p.rawParams["**"]=decodeURIComponent(b),p}return null}function bg(e,t,n){try{const[i,o]=AR(e,t,n);n.rawParams=i,n.extract=o;const l=n.node.parse(i);return n.parsedParams=Object.assign({},n.parsedParams,l),!0}catch{return null}}function wc(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===wo)>(e.node.kind===wo)||t.node.kind===wo==(e.node.kind===wo)&&t.depth>e.depth))):!0}function bd(e){return kv(e.filter(t=>t!==void 0).join("/"))}function kv(e){return e.replace(/\/{2,}/g,"/")}function OR(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Ai(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function kR(e){return Ai(OR(e))}function $d(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function jz(e,t,n){return $d(e,n)===$d(t,n)}function Mz({base:e,to:t,trailingSlash:n="never",cache:i}){const o=t.startsWith("/"),l=!o&&t===".";let u;if(i){u=o?t:l?e:e+"\0"+t;const v=i.get(u);if(v)return v}let f;if(l)f=e.split("/");else if(o)f=t.split("/");else{for(f=e.split("/");f.length>1&&$c(f)==="";)f.pop();const v=t.split("/");for(let b=0,x=v.length;b<x;b++){const E=v[b];E===""?b?b===x-1&&f.push(E):f=[E]:E===".."?f.pop():E==="."||f.push(E)}}f.length>1&&($c(f)===""?n==="never"&&f.pop():n==="always"&&f.push(""));let h,p="";for(let v=0;v<f.length;v++){v>0&&(p+="/");const b=f[v];if(!b)continue;h=Av(b,0,h);const x=h[0];if(x===al){p+=b;continue}const E=h[5],_=b.substring(0,h[1]),T=b.substring(h[4],E),C=b.substring(h[2],h[3]);x===zo?p+=_||T?`${_}{$${C}}${T}`:`$${C}`:x===Uo?p+=_||T?`${_}{$}${T}`:"$":p+=`${_}{-$${C}}${T}`}p=kv(p);const y=p||"/";return u&&i&&i.set(u,y),y}function Az(e){const t=new Map(e.map(o=>[encodeURIComponent(o),o])),n=Array.from(t.keys()).map(o=>o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),i=new RegExp(n,"g");return o=>o.replace(i,l=>t.get(l)??l)}function xg(e,t,n){const i=t[e];return typeof i!="string"?i:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(i)?i:i.split("/").map(o=>Y_(o,n)).join("/"):Y_(i,n)}function K_({path:e,params:t,decoder:n,...i}){let o=!1;const l={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:l,isMissingParams:o};if(!e.includes("$"))return{interpolatedPath:e,usedParams:l,isMissingParams:o};const u=e.length;let f=0,h,p="";for(;f<u;){const v=f;h=Av(e,v,h);const b=h[5];if(f=b+1,v===b)continue;const x=h[0];if(x===al){p+="/"+e.substring(v,b);continue}if(x===Uo){const E=t._splat;l._splat=E,l["*"]=E;const _=e.substring(v,h[1]),T=e.substring(h[4],b);if(!E){o=!0,(_||T)&&(p+="/"+_+T);continue}const C=xg("_splat",t,n);p+="/"+_+C+T;continue}if(x===zo){const E=e.substring(h[2],h[3]);!o&&!(E in t)&&(o=!0),l[E]=t[E];const _=e.substring(v,h[1]),T=e.substring(h[4],b),C=xg(E,t,n)??"undefined";p+="/"+_+C+T;continue}if(x===Gc){const E=e.substring(h[2],h[3]),_=t[E];if(_==null)continue;l[E]=_;const T=e.substring(v,h[1]),C=e.substring(h[4],b),M=xg(E,t,n)??"";p+="/"+T+M+C;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:l,interpolatedPath:p||"/",isMissingParams:o}}function Y_(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function Jn(e){return!!e?.isNotFound}function Oz(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Ry="tsr-scroll-restoration-v1_3",kz=(e,t)=>{let n;return(...i)=>{n||(n=setTimeout(()=>{e(...i),n=null},t))}};function Iz(){const e=Oz();if(!e)return null;const t=e.getItem(Ry);let n=t?JSON.parse(t):{};return{state:n,set:i=>{n=Ei(i,n)||n;try{e.setItem(Ry,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Gf=Iz(),Dz=e=>e.state.__TSR_key||e.href;function Lz(e){const t=[];let 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()}let Gd=!1;function Pz({storageKey:e,key:t,behavior:n,shouldScrollRestoration:i,scrollToTopSelectors:o,location:l}){let u;try{u=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(p){console.error(p);return}const f=t||window.history.state?.__TSR_key,h=u[f];Gd=!0;e:{if(i&&h&&Object.keys(h).length>0){for(const v in h){const b=h[v];if(v==="window")window.scrollTo({top:b.scrollY,left:b.scrollX,behavior:n});else if(v){const x=document.querySelector(v);x&&(x.scrollLeft=b.scrollX,x.scrollTop=b.scrollY)}}break e}const p=(l??window.location).hash.split("#",2)[1];if(p){const v=window.history.state?.__hashScrollIntoViewOptions??!0;if(v){const b=document.getElementById(p);b&&b.scrollIntoView(v)}break e}const y={top:0,left:0,behavior:n};if(window.scrollTo(y),o)for(const v of o){if(v==="window")continue;const b=typeof v=="function"?v():document.querySelector(v);b&&b.scrollTo(y)}}Gd=!1}function zz(e,t){if(!Gf||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Gf))return;e.isScrollRestorationSetup=!0,Gd=!1;const i=e.options.getScrollRestorationKey||Dz;window.history.scrollRestoration="manual";const o=l=>{if(Gd||!e.isScrollRestoring)return;let u="";if(l.target===document||l.target===window)u="window";else{const h=l.target.getAttribute("data-scroll-restoration-id");h?u=`[data-scroll-restoration-id="${h}"]`:u=Lz(l.target)}const f=i(e.state.location);Gf.set(h=>{const p=h[f]||={},y=p[u]||={};if(u==="window")y.scrollX=window.scrollX||0,y.scrollY=window.scrollY||0;else if(u){const v=document.querySelector(u);v&&(y.scrollX=v.scrollLeft||0,y.scrollY=v.scrollTop||0)}return h})};typeof document<"u"&&document.addEventListener("scroll",kz(o,100),!0),e.subscribe("onRendered",l=>{const u=i(l.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(Pz({storageKey:Ry,key:u,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Gf.set(f=>(f[u]||={},f)))})}function Uz(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function Bz(e,t=String){const n=new URLSearchParams;for(const i in e){const o=e[i];o!==void 0&&n.set(i,t(o))}return n.toString()}function Sg(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function Hz(e){const t=new URLSearchParams(e),n={};for(const[i,o]of t.entries()){const l=n[i];l==null?n[i]=Sg(o):Array.isArray(l)?l.push(Sg(o)):n[i]=[l,Sg(o)]}return n}const Fz=Vz(JSON.parse),qz=$z(JSON.stringify,JSON.parse);function Vz(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=Hz(t);for(const i in n){const o=n[i];if(typeof o=="string")try{n[i]=e(o)}catch{}}return n}}function $z(e,t){const n=typeof t=="function";function i(o){if(typeof o=="object"&&o!==null)try{return e(o)}catch{}else if(n&&typeof o=="string")try{return t(o),e(o)}catch{}return o}return o=>{const l=Bz(o,i);return l?`?${l}`:""}}const xr="__root__";function Gz(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{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function _r(e){return e instanceof Response&&!!e.options}const xd=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},bh=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),Va=(e,t,n=!0)=>{const i={...e.router.options.context??{}},o=n?t:t-1;for(let l=0;l<=o;l++){const u=e.matches[l];if(!u)continue;const f=e.router.getMatch(u.id);f&&Object.assign(i,f.__routeContext,f.__beforeLoadContext)}return i},IR=(e,t,n)=>{const i=e.router.routesById[t.routeId??""]??e.router.routeTree;!i.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(i.options.notFoundComponent=e.router.options.defaultNotFoundComponent);const o=n==="BEFORE_LOAD"&&i.parentRoute;o||zs(i.options.notFoundComponent);const l=e.matches.find(u=>u.routeId===i.id);zs(l,"Could not find match for route: "+i.id),e.updateMatch(l.id,u=>({...u,status:"notFound",error:t,isFetching:!1})),o&&(t.routeId=i.parentRoute.id,IR(e,t,n))},_i=(e,t,n,i)=>{if(!(!_r(n)&&!Jn(n))){if(_r(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const o=_r(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,l=>({...l,status:o,context:Va(e,t.index),isFetching:!1,error:n})),Jn(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw _r(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(IR(e,n,i),n)}},DR=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,Tc=(e,t,n,i)=>{const{id:o,routeId:l}=e.matches[t],u=e.router.looseRoutesById[l];if(n instanceof Promise)throw n;n.routerCode=i,e.firstBadMatchIndex??=t,_i(e,e.router.getMatch(o),n,i);try{u.options.onError?.(n)}catch(f){n=f,_i(e,e.router.getMatch(o),n,i)}e.updateMatch(o,f=>(f._nonReactive.beforeLoadPromise?.resolve(),f._nonReactive.beforeLoadPromise=void 0,f._nonReactive.loadPromise?.resolve(),{...f,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},LR=(e,t,n,i)=>{if(i._nonReactive.pendingTimeout!==void 0)return;const o=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!bh(e,t)&&(n.options.loader||n.options.beforeLoad||UR(n))&&typeof o=="number"&&o!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const u=setTimeout(()=>{xd(e)},o);i._nonReactive.pendingTimeout=u}},Kz=(e,t,n)=>{const i=e.router.getMatch(t);if(!i._nonReactive.beforeLoadPromise&&!i._nonReactive.loaderPromise)return;LR(e,t,n,i);const o=()=>{const l=e.router.getMatch(t);l.preload&&(l.status==="redirected"||l.status==="notFound")&&_i(e,l,l.error)};return i._nonReactive.beforeLoadPromise?i._nonReactive.beforeLoadPromise.then(o):o()},Yz=(e,t,n,i)=>{const o=e.router.getMatch(t),l=o._nonReactive.loadPromise;o._nonReactive.loadPromise=ol(()=>{l?.resolve()});const{paramsError:u,searchError:f}=o;u&&Tc(e,n,u,"PARSE_PARAMS"),f&&Tc(e,n,f,"VALIDATE_SEARCH"),LR(e,t,i,o);const h=new AbortController;let p=!1;const y=()=>{p||(p=!0,e.updateMatch(t,N=>({...N,isFetching:"beforeLoad",fetchCount:N.fetchCount+1,abortController:h})))},v=()=>{o._nonReactive.beforeLoadPromise?.resolve(),o._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,N=>({...N,isFetching:!1}))};if(!i.options.beforeLoad){kc(()=>{y(),v()});return}o._nonReactive.beforeLoadPromise=ol();const b={...Va(e,n,!1),...o.__routeContext},{search:x,params:E,cause:_}=o,T=bh(e,t),C={search:x,abortController:h,params:E,preload:T,context:b,location:e.location,navigate:N=>e.router.navigate({...N,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:T?"preload":_,matches:e.matches,routeId:i.id,...e.router.options.additionalContext},M=N=>{if(N===void 0){kc(()=>{y(),v()});return}(_r(N)||Jn(N))&&(y(),Tc(e,n,N,"BEFORE_LOAD")),kc(()=>{y(),e.updateMatch(t,k=>({...k,__beforeLoadContext:N})),v()})};let R;try{if(R=i.options.beforeLoad(C),qa(R))return y(),R.catch(N=>{Tc(e,n,N,"BEFORE_LOAD")}).then(M)}catch(N){y(),Tc(e,n,N,"BEFORE_LOAD")}M(R)},Xz=(e,t)=>{const{id:n,routeId:i}=e.matches[t],o=e.router.looseRoutesById[i],l=()=>f(),u=()=>Yz(e,n,t,o),f=()=>{if(DR(e,n))return;const h=Kz(e,n,o);return qa(h)?h.then(u):u()};return l()},Qz=(e,t,n)=>{const i=e.router.getMatch(t);if(!i||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const o={ssr:e.router.options.ssr,matches:e.matches,match:i,params:i.params,loaderData:i.loaderData};return Promise.all([n.options.head?.(o),n.options.scripts?.(o),n.options.headers?.(o)]).then(([l,u,f])=>{const h=l?.meta,p=l?.links,y=l?.scripts,v=l?.styles;return{meta:h,links:p,headScripts:y,headers:f,scripts:u,styles:v}})},PR=(e,t,n,i)=>{const o=e.matchPromises[n-1],{params:l,loaderDeps:u,abortController:f,cause:h}=e.router.getMatch(t),p=Va(e,n),y=bh(e,t);return{params:l,deps:u,preload:!!y,parentMatchPromise:o,abortController:f,context:p,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:y?"preload":h,route:i,...e.router.options.additionalContext}},X_=async(e,t,n,i)=>{try{const o=e.router.getMatch(t);try{(!(dz??e.router.isServer)||o.ssr===!0)&&zR(i);const l=i.options.loader?.(PR(e,t,n,i)),u=i.options.loader&&qa(l);if((u||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||o._nonReactive.minPendingPromise)&&e.updateMatch(t,p=>({...p,isFetching:"loader"})),i.options.loader){const p=u?await l:l;_i(e,e.router.getMatch(t),p),p!==void 0&&e.updateMatch(t,y=>({...y,loaderData:p}))}i._lazyPromise&&await i._lazyPromise;const h=o._nonReactive.minPendingPromise;h&&await h,i._componentsPromise&&await i._componentsPromise,e.updateMatch(t,p=>({...p,error:void 0,context:Va(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(l){let u=l;if(u?.name==="AbortError"){if(o.abortController.signal.aborted){o._nonReactive.loaderPromise?.resolve(),o._nonReactive.loaderPromise=void 0;return}e.updateMatch(t,h=>({...h,status:h.status==="pending"?"success":h.status,isFetching:!1,context:Va(e,n)}));return}const f=o._nonReactive.minPendingPromise;f&&await f,Jn(l)&&await i.options.notFoundComponent?.preload?.(),_i(e,e.router.getMatch(t),l);try{i.options.onError?.(l)}catch(h){u=h,_i(e,e.router.getMatch(t),h)}e.updateMatch(t,h=>({...h,error:u,context:Va(e,n),status:"error",isFetching:!1}))}}catch(o){const l=e.router.getMatch(t);l&&(l._nonReactive.loaderPromise=void 0),_i(e,l,o)}},Wz=async(e,t)=>{async function n(y,v,b,x){const E=Date.now()-v.updatedAt,_=y?x.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:x.options.staleTime??e.router.options.defaultStaleTime??0,T=x.options.shouldReload,C=typeof T=="function"?T(PR(e,i,t,x)):T,{status:M,invalid:R}=b;l=M==="success"&&(R||(C??E>_)),y&&x.options.preload===!1||(l&&!e.sync?(u=!0,(async()=>{try{await X_(e,i,t,x);const N=e.router.getMatch(i);N._nonReactive.loaderPromise?.resolve(),N._nonReactive.loadPromise?.resolve(),N._nonReactive.loaderPromise=void 0}catch(N){_r(N)&&await e.router.navigate(N.options)}})()):(M!=="success"||l&&e.sync)&&await X_(e,i,t,x))}const{id:i,routeId:o}=e.matches[t];let l=!1,u=!1;const f=e.router.looseRoutesById[o];if(!DR(e,i)){const y=e.router.getMatch(i),v=bh(e,i);if(y._nonReactive.loaderPromise){if(y.status==="success"&&!e.sync&&!y.preload)return y;await y._nonReactive.loaderPromise;const b=e.router.getMatch(i),x=b._nonReactive.error||b.error;x&&_i(e,b,x),b.status==="pending"&&await n(v,y,b,f)}else{const b=v&&!e.router.state.matches.some(E=>E.id===i),x=e.router.getMatch(i);x._nonReactive.loaderPromise=ol(),b!==x.preload&&e.updateMatch(i,E=>({...E,preload:b})),await n(v,y,x,f)}}const h=e.router.getMatch(i);u||(h._nonReactive.loaderPromise?.resolve(),h._nonReactive.loadPromise?.resolve()),clearTimeout(h._nonReactive.pendingTimeout),h._nonReactive.pendingTimeout=void 0,u||(h._nonReactive.loaderPromise=void 0),h._nonReactive.dehydrated=void 0;const p=u?h.isFetching:!1;return p!==h.isFetching||h.invalid!==!1?(e.updateMatch(i,y=>({...y,isFetching:p,invalid:!1})),e.router.getMatch(i)):h};async function Q_(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&xd(t);try{for(let f=0;f<t.matches.length;f++){const h=Xz(t,f);qa(h)&&await h}const n=t.firstBadMatchIndex??t.matches.length;for(let f=0;f<n;f++)t.matchPromises.push(Wz(t,f));const o=(await Promise.allSettled(t.matchPromises)).filter(f=>f.status==="rejected").map(f=>f.reason);let l;for(const f of o){if(_r(f))throw f;!l&&Jn(f)&&(l=f)}for(const f of t.matches){const{id:h,routeId:p}=f,y=t.router.looseRoutesById[p];try{const v=Qz(t,h,y);if(v){const b=await v;t.updateMatch(h,x=>({...x,...b}))}}catch(v){console.error(`Error executing head for route ${p}:`,v)}}if(l)throw l;const u=xd(t);qa(u)&&await u}catch(n){if(Jn(n)&&!t.preload){const i=xd(t);throw qa(i)&&await i,n}if(_r(n))throw n}return t.matches}async function zR(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...i}=t.options;Object.assign(e.options,i),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const i of BR){const o=e.options[i]?.preload;o&&n.push(o())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function UR(e){for(const t of BR)if(e.options[t]?.preload)return!0;return!1}const BR=["component","errorComponent","pendingComponent","notFoundComponent"];function Zz(e){return{input:({url:t})=>{for(const n of e)t=Ny(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=HR(e[n],t);return t}}}function Jz(e){const t=kR(e.basepath),n=`/${t}`,i=`${n}/`,o=e.caseSensitive?n:n.toLowerCase(),l=e.caseSensitive?i:i.toLowerCase();return{input:({url:u})=>{const f=e.caseSensitive?u.pathname:u.pathname.toLowerCase();return f===o?u.pathname="/":f.startsWith(l)&&(u.pathname=u.pathname.slice(n.length)),u},output:({url:u})=>(u.pathname=bd(["/",t,u.pathname]),u)}}function Ny(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function HR(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function ko(e){const t=e.resolvedLocation,n=e.location,i=t?.pathname!==n.pathname,o=t?.href!==n.href,l=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:i,hrefChanged:o,hashChanged:l}}function e3(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class t3{constructor(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=n=>n(),this.update=n=>{const i=this.options,o=this.basepath??i?.basepath??"/",l=this.basepath===void 0,u=i?.rewrite;if(this.options={...i,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Az(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=uz()),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 b;this.resolvePathCache=Vd(1e3),b=this.buildRouteTree(),this.setRoutes(b)}!this.__store&&this.latestLocation&&(this.__store=az(r3(this.latestLocation)),zz(this));let f=!1;const h=this.options.basepath??"/",p=this.options.rewrite;if(l||o!==h||u!==p){this.basepath=h;const b=[],x=kR(h);x&&x!=="/"&&b.push(Jz({basepath:h})),p&&b.push(p),this.rewrite=b.length===0?void 0:b.length===1?b[0]:Zz(b),this.history&&this.updateLatestLocation(),f=!0}f&&this.__store&&this.__store.setState(b=>({...b,location: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=()=>{const n=Tz(this.routeTree,this.options.caseSensitive,(i,o)=>{i.init({originalIndex:o})});return this.options.routeMasks&&xz(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,i)=>{const o={eventType:n,fn:i};return this.subscribers.add(o),()=>{this.subscribers.delete(o)}},this.emit=n=>{this.subscribers.forEach(i=>{i.eventType===n.type&&i.fn(n)})},this.parseLocation=(n,i)=>{const o=({pathname:h,search:p,hash:y,href:v,state:b})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(h)){const M=this.options.parseSearch(p),R=this.options.stringifySearch(M);return{href:h+R+y,publicHref:v,pathname:_c(h).path,external:!1,searchStr:R,search:Gn(i?.search,M),hash:_c(y.slice(1)).path,state:Gn(i?.state,b)}}const x=new URL(v,this.origin),E=Ny(this.rewrite,x),_=this.options.parseSearch(E.search),T=this.options.stringifySearch(_);return E.search=T,{href:E.href.replace(E.origin,""),publicHref:v,pathname:_c(E.pathname).path,external:!!this.rewrite&&E.origin!==this.origin,searchStr:T,search:Gn(i?.search,_),hash:_c(E.hash.slice(1)).path,state:Gn(i?.state,b)}},l=o(n),{__tempLocation:u,__tempKey:f}=l.state;if(u&&(!f||f===this.tempLocationKey)){const h=o(u);return h.state.key=l.state.key,h.state.__TSR_key=l.state.__TSR_key,delete h.state.__tempLocation,{...h,maskedLocation:l}}return l},this.resolvePathWithBase=(n,i)=>Mz({base:n,to:kv(i),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,i,o)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:i},o):this.matchRoutesInternal(n,i),this.getMatchedRoutes=n=>s3({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const i=this.getMatch(n);i&&(i.abortController.abort(),clearTimeout(i._nonReactive.pendingTimeout),i._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(l=>l.status==="pending"),i=this.state.matches.filter(l=>l.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...i]).forEach(l=>{this.cancelMatch(l.id)})},this.buildLocation=n=>{const i=(l={})=>{const u=l._fromLocation||this.pendingBuiltLocation||this.latestLocation,f=this.matchRoutesLightweight(u);l.from;const h=l.unsafeRelative==="path"?u.pathname:l.from??f.fullPath,p=this.resolvePathWithBase(h,"."),y=f.search,v={...f.params},b=l.to?this.resolvePathWithBase(p,`${l.to}`):this.resolvePathWithBase(p,"."),x=l.params===!1||l.params===null?{}:(l.params??!0)===!0?v:Object.assign(v,Ei(l.params,v)),E=this.getMatchedRoutes(b);let _=E.matchedRoutes;if((!E.foundRoute||E.foundRoute.path!=="/"&&E.routeParams["**"])&&this.options.notFoundRoute&&(_=[..._,this.options.notFoundRoute]),Object.keys(x).length>0)for(const F of _){const P=F.options.params?.stringify??F.options.stringifyParams;if(P)try{Object.assign(x,P(x))}catch{}}const C=n.leaveParams?b:_c(K_({path:b,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let M=y;if(n._includeValidateSearch&&this.options.search?.strict){const F={};_.forEach(P=>{if(P.options.validateSearch)try{Object.assign(F,Sd(P.options.validateSearch,{...F,...M}))}catch{}}),M=F}M=i3({search:M,dest:l,destRoutes:_,_includeValidateSearch:n._includeValidateSearch}),M=Gn(y,M);const R=this.options.stringifySearch(M),N=l.hash===!0?u.hash:l.hash?Ei(l.hash,u.hash):void 0,k=N?`#${N}`:"";let z=l.state===!0?u.state:l.state?Ei(l.state,u.state):{};z=Gn(u.state,z);const j=`${C}${R}${k}`;let A,D,G=!1;if(this.rewrite){const F=new URL(j,this.origin),P=HR(this.rewrite,F);A=F.href.replace(F.origin,""),P.origin!==this.origin?(D=P.href,G=!0):D=P.pathname+P.search+P.hash}else A=yz(j),D=A;return{publicHref:D,href:A,pathname:C,search:M,searchStr:R,state:z,hash:N??"",external:G,unmaskOnReload:l.unmaskOnReload}},o=(l={},u)=>{const f=i(l);let h=u?i(u):void 0;if(!h){const p={};if(this.options.routeMasks){const y=Sz(f.pathname,this.processedTree);if(y){Object.assign(p,y.rawParams);const{from:v,params:b,...x}=y.route,E=b===!1||b===null?{}:(b??!0)===!0?p:Object.assign(p,Ei(b,p));u={from:n.from,...x,params:E},h=i(u)}}}return h&&(f.maskedLocation=h),f};return n.mask?o(n,{from:n.from,...n.mask}):o(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:i,...o})=>{const l=()=>{const h=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];h.forEach(y=>{o.state[y]=this.latestLocation.state[y]});const p=Oo(o.state,this.latestLocation.state);return h.forEach(y=>{delete o.state[y]}),p},u=Ai(this.latestLocation.href)===Ai(o.href),f=this.commitLocationPromise;if(this.commitLocationPromise=ol(()=>{f?.resolve()}),u&&l())this.load();else{let{maskedLocation:h,hashScrollIntoView:p,...y}=o;h&&(y={...h,state:{...h.state,__tempKey:void 0,__tempLocation:{...y,search:y.searchStr,state:{...y.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(y.unmaskOnReload??this.options.unmaskOnReload??!1)&&(y.state.__tempKey=this.tempLocationKey)),y.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[o.replace?"replace":"push"](y.publicHref,y.state,{ignoreBlocker:i})}return this.resetNextScroll=o.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:i,hashScrollIntoView:o,viewTransition:l,ignoreBlocker:u,href:f,...h}={})=>{if(f){const v=this.history.location.state.__TSR_index,b=Hd(f,{__TSR_index:n?v:v+1}),x=new URL(b.pathname,this.origin),E=Ny(this.rewrite,x);h.to=E.pathname,h.search=this.options.parseSearch(b.search),h.hash=b.hash.slice(1)}const p=this.buildLocation({...h,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const y=this.commitLocation({...p,viewTransition:l,replace:n,resetScroll:i,hashScrollIntoView:o,ignoreBlocker:u});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),y},this.navigate=async({to:n,reloadDocument:i,href:o,publicHref:l,...u})=>{let f=!1;if(o)try{new URL(`${o}`),f=!0}catch{}if(f&&!i&&(i=!0),i){if(n!==void 0||!o){const p=this.buildLocation({to:n,...u});o=o??p.publicHref,l=l??p.publicHref}const h=!f&&l?l:o;if(qd(h,this.protocolAllowlist))return Promise.resolve();if(!u.ignoreBlocker){const y=this.history.getBlockers?.()??[];for(const v of y)if(v?.blockerFn&&await v.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return u.replace?window.location.replace(h):window.location.href=h,Promise.resolve()}return this.buildAndCommitLocation({...u,href:o,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(i=>({...i,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:i.cachedMatches.filter(o=>!n.some(l=>l.id===o.id))}))},this.load=async n=>{let i,o,l;for(l=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const h=this.latestLocation,p=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ko({resolvedLocation:p,location:h})}),this.emit({type:"onBeforeLoad",...ko({resolvedLocation:p,location:h})}),await Q_({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:h,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let y=[],v=[],b=[],x=[];kc(()=>{this.__store.setState(E=>{const _=E.matches,T=E.pendingMatches||E.matches;return y=_.filter(C=>!T.some(M=>M.id===C.id)),v=_.filter(C=>!T.some(M=>M.routeId===C.routeId)),b=T.filter(C=>!_.some(M=>M.routeId===C.routeId)),x=T.filter(C=>_.some(M=>M.routeId===C.routeId)),{...E,isLoading:!1,loadedAt:Date.now(),matches:T,pendingMatches:void 0,cachedMatches:[...E.cachedMatches,...y.filter(C=>C.status!=="error"&&C.status!=="notFound"&&C.status!=="redirected")]}}),this.clearExpiredCache()}),[[v,"onLeave"],[b,"onEnter"],[x,"onStay"]].forEach(([E,_])=>{E.forEach(T=>{this.looseRoutesById[T.routeId].options[_]?.(T)})})})})}})}catch(h){_r(h)?(i=h,this.navigate({...i.options,replace:!0,ignoreBlocker:!0})):Jn(h)&&(o=h),this.__store.setState(p=>({...p,statusCode:i?i.status:o?404:p.matches.some(y=>y.status==="error")?500:200,redirect:i}))}this.latestLoadPromise===l&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let u;this.hasNotFoundMatch()?u=404:this.__store.state.matches.some(f=>f.status==="error")&&(u=500),u!==void 0&&this.__store.setState(f=>({...f,statusCode:u}))},this.startViewTransition=n=>{const i=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,i&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let o;if(typeof i=="object"&&this.isViewTransitionTypesSupported){const l=this.latestLocation,u=this.state.resolvedLocation,f=typeof i.types=="function"?i.types(ko({resolvedLocation:u,location:l})):i.types;if(f===!1){n();return}o={update:n,types:f}}else o=n;document.startViewTransition(o)}else n()},this.updateMatch=(n,i)=>{this.startTransition(()=>{const o=this.state.pendingMatches?.some(l=>l.id===n)?"pendingMatches":this.state.matches.some(l=>l.id===n)?"matches":this.state.cachedMatches.some(l=>l.id===n)?"cachedMatches":"";o&&(o==="cachedMatches"?this.__store.setState(l=>({...l,cachedMatches:e3(l.cachedMatches.map(u=>u.id===n?i(u):u))})):this.__store.setState(l=>({...l,[o]:l[o]?.map(u=>u.id===n?i(u):u)})))})},this.getMatch=n=>{const i=o=>o.id===n;return this.state.cachedMatches.find(i)??this.state.pendingMatches?.find(i)??this.state.matches.find(i)},this.invalidate=n=>{const i=o=>n?.filter?.(o)??!0?{...o,invalid:!0,...n?.forcePending||o.status==="error"||o.status==="notFound"?{status:"pending",error:void 0}:void 0}:o;return this.__store.setState(o=>({...o,matches:o.matches.map(i),cachedMatches:o.cachedMatches.map(i),pendingMatches:o.pendingMatches?.map(i)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const i=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const o=n.options._builtLocation??this.buildLocation(n.options),l=this.getParsedLocationHref(o);n.options.href=l,n.headers.set("Location",l)}else if(i)try{const o=new URL(i);if(this.origin&&o.origin===this.origin){const l=o.pathname+o.search+o.hash;n.options.href=l,n.headers.set("Location",l)}}catch{}if(n.options.href&&!n.options._builtLocation&&qd(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const i=n?.filter;i!==void 0?this.__store.setState(o=>({...o,cachedMatches:o.cachedMatches.filter(l=>!i(l))})):this.__store.setState(o=>({...o,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=i=>{const o=this.looseRoutesById[i.routeId];if(!o.options.loader)return!0;const l=(i.preload?o.options.preloadGcTime??this.options.defaultPreloadGcTime:o.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:Date.now()-i.updatedAt>=l};this.clearCache({filter:n})},this.loadRouteChunk=zR,this.preloadRoute=async n=>{const i=n._builtLocation??this.buildLocation(n);let o=this.matchRoutes(i,{throwOnError:!0,preload:!0,dest:n});const l=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(f=>f.id)),u=new Set([...l,...this.state.cachedMatches.map(f=>f.id)]);kc(()=>{o.forEach(f=>{u.has(f.id)||this.__store.setState(h=>({...h,cachedMatches:[...h.cachedMatches,f]}))})});try{return o=await Q_({router:this,matches:o,location:i,preload:!0,updateMatch:(f,h)=>{l.has(f)?o=o.map(p=>p.id===f?h(p):p):this.updateMatch(f,h)}}),o}catch(f){if(_r(f))return f.options.reloadDocument?void 0:await this.preloadRoute({...f.options,_fromLocation:i});Jn(f)||console.error(f);return}},this.matchRoute=(n,i)=>{const o={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},l=this.buildLocation(o);if(i?.pending&&this.state.status!=="pending")return!1;const f=(i?.pending===void 0?!this.state.isLoading:i.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,h=Ez(l.pathname,i?.caseSensitive??!1,i?.fuzzy??!1,f.pathname,this.processedTree);return!h||n.params&&!Oo(h.rawParams,n.params,{partial:!0})?!1:i?.includeSearch??!0?Oo(f.search,l.search,{partial:!0})?h.rawParams:!1:h.rawParams},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??qz,parseSearch:t.parseSearch??Fz,protocolAllowlist:t.protocolAllowlist??gz}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}setRoutes({routesById:t,routesByPath:n,processedTree:i}){this.routesById=t,this.routesByPath=n,this.processedTree=i;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)}get looseRoutesById(){return this.routesById}getParentContext(t){return t?.id?t.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(t,n){const i=this.getMatchedRoutes(t.pathname),{foundRoute:o,routeParams:l,parsedParams:u}=i;let{matchedRoutes:f}=i,h=!1;(o?o.path!=="/"&&l["**"]:Ai(t.pathname))&&(this.options.notFoundRoute?f=[...f,this.options.notFoundRoute]:h=!0);const p=h?a3(this.options.notFoundMode,f):void 0,y=new Array(f.length),v=new Map(this.state.matches.map(b=>[b.routeId,b]));for(let b=0;b<f.length;b++){const x=f[b],E=y[b-1];let _,T,C;{const X=E?.search??t.search,te=E?._strictSearch??void 0;try{const L=Sd(x.options.validateSearch,{...X})??void 0;_={...X,...L},T={...te,...L},C=void 0}catch(L){let $=L;if(L instanceof Kd||($=new Kd(L.message,{cause:L})),n?.throwOnError)throw $;_=X,T={},C=$}}const M=x.options.loaderDeps?.({search:_})??"",R=M?JSON.stringify(M):"",{interpolatedPath:N,usedParams:k}=K_({path:x.fullPath,params:l,decoder:this.pathParamsDecoder,server:this.isServer}),z=x.id+N+R,j=this.getMatch(z),A=v.get(x.id),D=j?._strictParams??k;let G;if(!j)try{W_(x,k,u,D)}catch(X){if(Jn(X)||_r(X)?G=X:G=new n3(X.message,{cause:X}),n?.throwOnError)throw G}Object.assign(l,D);const F=A?"stay":"enter";let P;if(j)P={...j,cause:F,params:A?.params??l,_strictParams:D,search:Gn(A?A.search:j.search,_),_strictSearch:T};else{const X=x.options.loader||x.options.beforeLoad||x.lazyFn||UR(x)?"pending":"success";P={id:z,ssr:x.options.ssr,index:b,routeId:x.id,params:A?.params??l,_strictParams:D,pathname:N,updatedAt:Date.now(),search:A?Gn(A.search,_):_,_strictSearch:T,searchError:void 0,status:X,isFetching:!1,error:void 0,paramsError:G,__routeContext:void 0,_nonReactive:{loadPromise:ol()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:A?Gn(A.loaderDeps,M):M,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:x.options.staticData||{},fullPath:x.fullPath}}n?.preload||(P.globalNotFound=p===x.id),P.searchError=C;const Q=this.getParentContext(E);P.context={...Q,...P.__routeContext,...P.__beforeLoadContext},y[b]=P}for(let b=0;b<y.length;b++){const x=y[b],E=this.looseRoutesById[x.routeId],_=this.getMatch(x.id),T=v.get(x.routeId);if(x.params=T?Gn(T.params,l):l,!_){const C=y[b-1],M=this.getParentContext(C);if(E.options.context){const R={deps:x.loaderDeps,params:x.params,context:M??{},location:t,navigate:N=>this.navigate({...N,_fromLocation:t}),buildLocation:this.buildLocation,cause:x.cause,abortController:x.abortController,preload:!!x.preload,matches:y,routeId:E.id};x.__routeContext=E.options.context(R)??void 0}x.context={...M,...x.__routeContext,...x.__beforeLoadContext}}}return y}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:i,parsedParams:o}=this.getMatchedRoutes(t.pathname),l=$c(n),u={...t.search};for(const y of n)try{Object.assign(u,Sd(y.options.validateSearch,u))}catch{}const f=$c(this.state.matches),h=f&&f.routeId===l.id&&t.pathname===this.state.location.pathname;let p;if(h)p=f.params;else{const y={...i};for(const v of n)try{W_(v,i,o??{},y)}catch{}p=y}return{matchedRoutes:n,fullPath:l.fullPath,search:u,params:p}}}class Kd extends Error{}class n3 extends Error{}function r3(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function Sd(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Kd("Async validation not supported");if(n.issues)throw new Kd(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 s3({pathname:e,routesById:t,processedTree:n}){const i={},o=Ai(e);let l,u;const f=_z(o,n,!0);return f&&(l=f.route,Object.assign(i,f.rawParams),u=Object.assign({},f.parsedParams)),{matchedRoutes:f?.branch||[t[xr]],routeParams:i,foundRoute:l,parsedParams:u}}function i3({search:e,dest:t,destRoutes:n,_includeValidateSearch:i}){return o3(n)(e,t,i??!1)}function o3(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const o of e){if("search"in o.options)o.options.search?.middlewares&&t.middlewares.push(...o.options.search.middlewares);else if(o.options.preSearchFilters||o.options.postSearchFilters){const l=({search:u,next:f})=>{let h=u;"preSearchFilters"in o.options&&o.options.preSearchFilters&&(h=o.options.preSearchFilters.reduce((y,v)=>v(y),u));const p=f(h);return"postSearchFilters"in o.options&&o.options.postSearchFilters?o.options.postSearchFilters.reduce((y,v)=>v(y),p):p};t.middlewares.push(l)}if(o.options.validateSearch){const l=({search:u,next:f})=>{const h=f(u);if(!t._includeValidateSearch)return h;try{return{...h,...Sd(o.options.validateSearch,h)??void 0}}catch{return h}};t.middlewares.push(l)}}const n=({search:o})=>{const l=t.dest;return l.search?l.search===!0?o:Ei(l.search,o):{}};t.middlewares.push(n);const i=(o,l,u)=>{if(o>=u.length)return l;const f=u[o];return f({search:l,next:p=>i(o+1,p,u)})};return function(l,u,f){return t.dest=u,t._includeValidateSearch=f,i(0,l,t.middlewares)}}function a3(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const i=t[n];if(i.children)return i.id}return xr}function W_(e,t,n,i){const o=e.options.params?.parse??e.options.parseParams;if(o)if(e.options.skipRouteOnParseError)for(const l in t)l in n&&(i[l]=n[l]);else{const l=o(i);Object.assign(i,l)}}const l3="Error preloading route! ☝️";class FR{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const i=this.options,o=!i?.path&&!i?.id;this.parentRoute=this.options.getParentRoute?.(),o?this._path=xr:this.parentRoute||zs(!1);let l=o?xr:i?.path;l&&l!=="/"&&(l=OR(l));const u=i?.id||l;let f=o?xr:bd([this.parentRoute.id===xr?"":this.parentRoute.id,u]);l===xr&&(l="/"),f!==xr&&(f=bd(["/",f]));const h=f===xr?"/":bd([this.parentRoute.fullPath,l]);this._path=l,this._id=f,this._fullPath=h,this._to=Ai(h)},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.redirect=n=>Gz({from:this.fullPath,...n}),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class c3 extends FR{constructor(t){super(t)}}const Kf=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Eg(e){const t=S.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function u3(e,t,n={},i={}){S.useEffect(()=>{if(!e.current||i.disabled||typeof IntersectionObserver!="function")return;const o=new IntersectionObserver(([l])=>{t(l)},n);return o.observe(e.current),()=>{o.disconnect()}},[t,n,i.disabled,e])}function f3(e){const t=S.useRef(null);return S.useImperativeHandle(e,()=>t.current,[]),t}function Iv(e){const t=e.errorComponent??Dv;return d.jsx(d3,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:i})=>n?S.createElement(t,{error:n,reset:i}):e.children})}class d3 extends S.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function Dv({error:e}){const[t,n]=S.useState(!1);return d.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[d.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),d.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(i=>!i),children:t?"Hide Error":"Show Error"})]}),d.jsx("div",{style:{height:".25rem"}}),t?d.jsx("div",{children:d.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?d.jsx("code",{children:e.message}):null})}):null]})}function h3({children:e,fallback:t=null}){return qR()?d.jsx(il.Fragment,{children:e}):d.jsx(il.Fragment,{children:t})}function qR(){return il.useSyncExternalStore(p3,()=>!0,()=>!1)}function p3(){return()=>{}}var _g={exports:{}},wg={},Tg={exports:{}},Cg={};var Z_;function m3(){if(Z_)return Cg;Z_=1;var e=hu();function t(v,b){return v===b&&(v!==0||1/v===1/b)||v!==v&&b!==b}var n=typeof Object.is=="function"?Object.is:t,i=e.useState,o=e.useEffect,l=e.useLayoutEffect,u=e.useDebugValue;function f(v,b){var x=b(),E=i({inst:{value:x,getSnapshot:b}}),_=E[0].inst,T=E[1];return l(function(){_.value=x,_.getSnapshot=b,h(_)&&T({inst:_})},[v,x,b]),o(function(){return h(_)&&T({inst:_}),v(function(){h(_)&&T({inst:_})})},[v]),u(x),x}function h(v){var b=v.getSnapshot;v=v.value;try{var x=b();return!n(v,x)}catch{return!0}}function p(v,b){return b()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return Cg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,Cg}var J_;function VR(){return J_||(J_=1,Tg.exports=m3()),Tg.exports}var ew;function g3(){if(ew)return wg;ew=1;var e=hu(),t=VR();function n(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var i=typeof Object.is=="function"?Object.is:n,o=t.useSyncExternalStore,l=e.useRef,u=e.useEffect,f=e.useMemo,h=e.useDebugValue;return wg.useSyncExternalStoreWithSelector=function(p,y,v,b,x){var E=l(null);if(E.current===null){var _={hasValue:!1,value:null};E.current=_}else _=E.current;E=f(function(){function C(z){if(!M){if(M=!0,R=z,z=b(z),x!==void 0&&_.hasValue){var j=_.value;if(x(j,z))return N=j}return N=z}if(j=N,i(R,z))return j;var A=b(z);return x!==void 0&&x(j,A)?(R=z,j):(R=z,N=A)}var M=!1,R,N,k=v===void 0?null:v;return[function(){return C(y())},k===null?void 0:function(){return C(k())}]},[y,v,b,x]);var T=o(p,E[0],E[1]);return u(function(){_.hasValue=!0,_.value=T},[T]),h(T),T},wg}var tw;function y3(){return tw||(tw=1,_g.exports=g3()),_g.exports}var $R=y3();function v3(e,t){return e===t}function b3(e,t,n=v3){const i=S.useCallback(u=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(u);return f},[e]),o=S.useCallback(()=>e?.get(),[e]);return $R.useSyncExternalStoreWithSelector(i,o,o,t,n)}const GR=S.createContext(null);function Mr(e){const t=S.useContext(GR);return e?.warn,t}function er(e){const t=Mr({warn:e?.router===void 0}),n=e?.router||t,i=S.useRef(void 0);return b3(n.__store,o=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const l=Gn(i.current,e.select(o));return i.current=l,l}return e.select(o)}return o})}const xh=S.createContext(void 0),x3=S.createContext(void 0);function rs(e){const t=S.useContext(e.from?x3:xh);return er({select:i=>{const o=i.matches.find(l=>e.from?e.from===l.routeId:l.id===t);if(zs(!((e.shouldThrow??!0)&&!o),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),o!==void 0)return e.select?e.select(o):o},structuralSharing:e.structuralSharing})}function Lv(e){return rs({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Pv(e){const{select:t,...n}=e;return rs({...n,select:i=>t?t(i.loaderDeps):i.loaderDeps})}function zv(e){return rs({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Uv(e){return rs({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Sh(e){const t=Mr();return S.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var Fi=hR();function S3(e,t){const n=Mr(),i=f3(t),{activeProps:o,inactiveProps:l,activeOptions:u,to:f,preload:h,preloadDelay:p,hashScrollIntoView:y,replace:v,startTransition:b,resetScroll:x,viewTransition:E,children:_,target:T,disabled:C,style:M,className:R,onClick:N,onBlur:k,onFocus:z,onMouseEnter:j,onMouseLeave:A,onTouchStart:D,ignoreBlocker:G,params:F,search:P,hash:Q,state:X,mask:te,reloadDocument:L,unsafeRelative:$,from:H,_fromLocation:V,...U}=e,I=qR(),K=er({select:Ue=>{const pe=Ue.matches[Ue.matches.length-1];return{search:pe?.search,hash:Ue.location.hash,path:pe?.pathname}},structuralSharing:!0}),Z=e.from,W=S.useMemo(()=>({...e,from:Z}),[n,K,Z,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),se=S.useMemo(()=>n.buildLocation({...W}),[n,W]),ie=se.maskedLocation?se.maskedLocation.publicHref:se.publicHref,he=se.maskedLocation?se.maskedLocation.external:se.external,xe=S.useMemo(()=>R3(ie,he,n.history,C),[C,he,ie,n.history]),de=S.useMemo(()=>{if(xe?.external)return qd(xe.href,n.protocolAllowlist)?void 0:xe.href;if(!N3(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),qd(f,n.protocolAllowlist)?void 0:f}catch{}},[f,xe,n.protocolAllowlist]),Be=er({select:Ue=>{if(de)return!1;if(u?.exact){if(!jz(Ue.location.pathname,se.pathname,n.basepath))return!1}else{const pe=$d(Ue.location.pathname,n.basepath),we=$d(se.pathname,n.basepath);if(!(pe.startsWith(we)&&(pe.length===we.length||pe[we.length]==="/")))return!1}return(u?.includeSearch??!0)&&!Oo(Ue.location.search,se.search,{partial:!u?.exact,ignoreUndefined:!u?.explicitUndefined})?!1:u?.includeHash?I&&Ue.location.hash===se.hash:!0}}),_e=Be?Ei(o,{})??E3:Rg,re=Be?Rg:Ei(l,{})??Rg,fe=[R,_e.className,re.className].filter(Boolean).join(" "),ae=(M||_e.style||re.style)&&{...M,..._e.style,...re.style},[Se,ye]=S.useState(!1),be=S.useRef(!1),ge=e.reloadDocument||de?!1:h??n.options.defaultPreload,Le=p??n.options.defaultPreloadDelay??0,Oe=S.useCallback(()=>{n.preloadRoute({...W,_builtLocation:se}).catch(Ue=>{console.warn(Ue),console.warn(l3)})},[n,W,se]),Ee=S.useCallback(Ue=>{Ue?.isIntersecting&&Oe()},[Oe]);u3(i,Ee,C3,{disabled:!!C||ge!=="viewport"}),S.useEffect(()=>{be.current||!C&&ge==="render"&&(Oe(),be.current=!0)},[C,Oe,ge]);const Fe=Ue=>{const pe=Ue.currentTarget.getAttribute("target"),we=T!==void 0?T:pe;if(!C&&!j3(Ue)&&!Ue.defaultPrevented&&(!we||we==="_self")&&Ue.button===0){Ue.preventDefault(),Fi.flushSync(()=>{ye(!0)});const He=n.subscribe("onResolved",()=>{He(),ye(!1)});n.navigate({...W,replace:v,resetScroll:x,hashScrollIntoView:y,startTransition:b,viewTransition:E,ignoreBlocker:G})}};if(de)return{...U,ref:i,href:de,..._&&{children:_},...T&&{target:T},...C&&{disabled:C},...M&&{style:M},...R&&{className:R},...N&&{onClick:N},...k&&{onBlur:k},...z&&{onFocus:z},...j&&{onMouseEnter:j},...A&&{onMouseLeave:A},...D&&{onTouchStart:D}};const Ke=Ue=>{if(C||ge!=="intent")return;if(!Le){Oe();return}const pe=Ue.currentTarget;if(Cc.has(pe))return;const we=setTimeout(()=>{Cc.delete(pe),Oe()},Le);Cc.set(pe,we)},ze=Ue=>{C||ge!=="intent"||Oe()},Xe=Ue=>{if(C||!ge||!Le)return;const pe=Ue.currentTarget,we=Cc.get(pe);we&&(clearTimeout(we),Cc.delete(pe))};return{...U,..._e,...re,href:xe?.href,ref:i,onClick:Pa([N,Fe]),onBlur:Pa([k,Xe]),onFocus:Pa([z,Ke]),onMouseEnter:Pa([j,Ke]),onMouseLeave:Pa([A,Xe]),onTouchStart:Pa([D,ze]),disabled:!!C,target:T,...ae&&{style:ae},...fe&&{className:fe},...C&&_3,...Be&&w3,...I&&Se&&T3}}const Rg={},E3={className:"active"},_3={role:"link","aria-disabled":!0},w3={"data-status":"active","aria-current":"page"},T3={"data-transitioning":"transitioning"},Cc=new WeakMap,C3={rootMargin:"100px"},Pa=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function R3(e,t,n,i){if(!i)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function N3(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const $a=S.forwardRef((e,t)=>{const{_asChild:n,...i}=e,{type:o,...l}=S3(i,t),u=typeof i.children=="function"?i.children({isActive:l["data-status"]==="active"}):i.children;if(!n){const{disabled:f,...h}=l;return S.createElement("a",h,u)}return S.createElement(n,l,u)});function j3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let M3=class extends FR{constructor(t){super(t),this.useMatch=n=>rs({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>rs({...n,from:this.id,select:i=>n?.select?n.select(i.context):i.context}),this.useSearch=n=>Uv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>zv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Pv({...n,from:this.id}),this.useLoaderData=n=>Lv({...n,from:this.id}),this.useNavigate=()=>Sh({from:this.fullPath}),this.Link=il.forwardRef((n,i)=>d.jsx($a,{ref:i,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function Fs(e){return new M3(e)}class A3 extends c3{constructor(t){super(t),this.useMatch=n=>rs({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>rs({...n,from:this.id,select:i=>n?.select?n.select(i.context):i.context}),this.useSearch=n=>Uv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>zv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>Pv({...n,from:this.id}),this.useLoaderData=n=>Lv({...n,from:this.id}),this.useNavigate=()=>Sh({from:this.fullPath}),this.Link=il.forwardRef((n,i)=>d.jsx($a,{ref:i,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function O3(e){return new A3(e)}function nw(e){return typeof e=="object"?new rw(e,{silent:!0}).createRoute(e):new rw(e,{silent:!0}).createRoute}class rw{constructor(t,n){this.path=t,this.createRoute=i=>{const o=Fs(i);return o.isRoot=!1,o},this.silent=n?.silent}}class sw{constructor(t){this.useMatch=n=>rs({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>rs({from:this.options.id,select:i=>n?.select?n.select(i.context):i.context}),this.useSearch=n=>Uv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>zv({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>Pv({...n,from:this.options.id}),this.useLoaderData=n=>Lv({...n,from:this.options.id}),this.useNavigate=()=>{const n=Mr();return Sh({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function iw(e){return typeof e=="object"?new sw(e):t=>new sw({id:e,...t})}function k3(){const e=Mr(),t=S.useRef({router:e,mounted:!1}),[n,i]=S.useState(!1),{hasPendingMatches:o,isLoading:l}=er({select:v=>({isLoading:v.isLoading,hasPendingMatches:v.matches.some(b=>b.status==="pending")}),structuralSharing:!0}),u=Eg(l),f=l||n||o,h=Eg(f),p=l||o,y=Eg(p);return e.startTransition=v=>{i(!0),S.startTransition(()=>{v(),i(!1)})},S.useEffect(()=>{const v=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Ai(e.latestLocation.publicHref)!==Ai(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{v()}},[e,e.history]),Kf(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(b){console.error(b)}})()},[e]),Kf(()=>{u&&!l&&e.emit({type:"onLoad",...ko(e.state)})},[u,e,l]),Kf(()=>{y&&!p&&e.emit({type:"onBeforeRouteMount",...ko(e.state)})},[p,y,e]),Kf(()=>{if(h&&!f){const v=ko(e.state);e.emit({type:"onResolved",...v}),e.__store.setState(b=>({...b,status:"idle",resolvedLocation:b.location})),v.hrefChanged&&Uz(e)}},[f,h,e]),null}function I3(e){const t=er({select:n=>`not-found-${n.location.pathname}-${n.status}`});return d.jsx(Iv,{getResetKey:()=>t,onCatch:(n,i)=>{if(Jn(n))e.onCatch?.(n,i);else throw n},errorComponent:({error:n})=>{if(Jn(n))return e.fallback?.(n);throw n},children:e.children})}function D3(){return d.jsx("p",{children:"Not Found"})}function za(e){return d.jsx(d.Fragment,{children:e.children})}function KR(e,t,n){return t.options.notFoundComponent?d.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?d.jsx(e.options.defaultNotFoundComponent,{...n}):d.jsx(D3,{})}function L3(){return Mr().isScrollRestoring,null}const YR=S.memo(function({matchId:t}){const n=Mr(),i=er({select:_=>{const T=_.matches.findIndex(M=>M.id===t),C=_.matches[T];return zs(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:_.loadedAt,parentRouteId:_.matches[T-1]?.routeId}},structuralSharing:!0}),o=n.routesById[i.routeId],l=o.options.pendingComponent??n.options.defaultPendingComponent,u=l?d.jsx(l,{}):null,f=o.options.errorComponent??n.options.defaultErrorComponent,h=o.options.onCatch??n.options.defaultOnCatch,p=o.isRoot?o.options.notFoundComponent??n.options.notFoundRoute?.options.component:o.options.notFoundComponent,y=i.ssr===!1||i.ssr==="data-only",v=(!o.isRoot||o.options.wrapInSuspense||y)&&(o.options.wrapInSuspense??l??(o.options.errorComponent?.preload||y))?S.Suspense:za,b=f?Iv:za,x=p?I3:za,E=o.isRoot?o.options.shellComponent??za:za;return d.jsxs(E,{children:[d.jsx(xh.Provider,{value:t,children:d.jsx(v,{fallback:u,children:d.jsx(b,{getResetKey:()=>i.resetKey,errorComponent:f||Dv,onCatch:(_,T)=>{if(Jn(_))throw _;h?.(_,T)},children:d.jsx(x,{fallback:_=>{if(!p||_.routeId&&_.routeId!==i.routeId||!_.routeId&&!o.isRoot)throw _;return S.createElement(p,_)},children:y||i._displayPending?d.jsx(h3,{fallback:u,children:d.jsx(ow,{matchId:t})}):d.jsx(ow,{matchId:t})})})})}),i.parentRouteId===xr&&n.options.scrollRestoration?d.jsxs(d.Fragment,{children:[d.jsx(P3,{}),d.jsx(L3,{})]}):null]})});function P3(){const e=Mr(),t=S.useRef(void 0);return d.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...ko(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const ow=S.memo(function({matchId:t}){const n=Mr(),{match:i,key:o,routeId:l}=er({select:h=>{const p=h.matches.find(E=>E.id===t),y=p.routeId,b=(n.routesById[y].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:y,loaderDeps:p.loaderDeps,params:p._strictParams,search:p._strictSearch});return{key:b?JSON.stringify(b):void 0,routeId:y,match:{id:p.id,status:p.status,error:p.error,invalid:p.invalid,_forcePending:p._forcePending,_displayPending:p._displayPending}}},structuralSharing:!0}),u=n.routesById[l],f=S.useMemo(()=>{const h=u.options.component??n.options.defaultComponent;return h?d.jsx(h,{},o):d.jsx(XR,{})},[o,u.options.component,n.options.defaultComponent]);if(i._displayPending)throw n.getMatch(i.id)?._nonReactive.displayPendingPromise;if(i._forcePending)throw n.getMatch(i.id)?._nonReactive.minPendingPromise;if(i.status==="pending"){const h=u.options.pendingMinMs??n.options.defaultPendingMinMs;if(h){const p=n.getMatch(i.id);if(p&&!p._nonReactive.minPendingPromise){const y=ol();p._nonReactive.minPendingPromise=y,setTimeout(()=>{y.resolve(),p._nonReactive.minPendingPromise=void 0},h)}}throw n.getMatch(i.id)?._nonReactive.loadPromise}if(i.status==="notFound")return zs(Jn(i.error)),KR(n,u,i.error);if(i.status==="redirected")throw zs(_r(i.error)),n.getMatch(i.id)?._nonReactive.loadPromise;if(i.status==="error")throw i.error;return f}),XR=S.memo(function(){const t=Mr(),n=S.useContext(xh),i=er({select:p=>p.matches.find(y=>y.id===n)?.routeId}),o=t.routesById[i],l=er({select:p=>{const v=p.matches.find(b=>b.id===n);return zs(v),v.globalNotFound}}),u=er({select:p=>{const y=p.matches,v=y.findIndex(b=>b.id===n);return y[v+1]?.id}}),f=t.options.defaultPendingComponent?d.jsx(t.options.defaultPendingComponent,{}):null;if(l)return KR(t,o,void 0);if(!u)return null;const h=d.jsx(YR,{matchId:u});return i===xr?d.jsx(S.Suspense,{fallback:f,children:h}):h});function z3(){const e=Mr(),n=e.routesById[xr].options.pendingComponent??e.options.defaultPendingComponent,i=n?d.jsx(n,{}):null,o=typeof document<"u"&&e.ssr?za:S.Suspense,l=d.jsxs(o,{fallback:i,children:[d.jsx(k3,{}),d.jsx(U3,{})]});return e.options.InnerWrap?d.jsx(e.options.InnerWrap,{children:l}):l}function U3(){const e=Mr(),t=er({select:o=>o.matches[0]?.id}),n=er({select:o=>o.loadedAt}),i=t?d.jsx(YR,{matchId:t}):null;return d.jsx(xh.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?i:d.jsx(Iv,{getResetKey:()=>n,errorComponent:Dv,onCatch:void 0,children:i})})}const B3=e=>new H3(e);class H3 extends t3{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=nw,globalThis.createLazyFileRoute=iw):typeof window<"u"&&(window.createFileRoute=nw,window.createLazyFileRoute=iw);function F3({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const i=d.jsx(GR.Provider,{value:e,children:t});return e.options.Wrap?d.jsx(e.options.Wrap,{children:i}):i}function q3({router:e,...t}){return d.jsx(F3,{router:e,...t,children:d.jsx(z3,{})})}const V3=/\{[^{}]+\}/g,$3=()=>typeof process=="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function G3(){return Math.random().toString(36).slice(2,11)}function K3(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:i=globalThis.fetch,querySerializer:o,bodySerializer:l,pathSerializer:u,headers:f,requestInitExt:h=void 0,...p}={...e};h=$3()?h:void 0,t=cw(t);const y=[];async function v(b,x){const{baseUrl:E,fetch:_=i,Request:T=n,headers:C,params:M={},parseAs:R="json",querySerializer:N,bodySerializer:k=l??X3,pathSerializer:z,body:j,middleware:A=[],...D}=x||{};let G=t;E&&(G=cw(E)??t);let F=typeof o=="function"?o:aw(o);N&&(F=typeof N=="function"?N:aw({...typeof o=="object"?o:{},...N}));const P=z||u||Y3,Q=j===void 0?void 0:k(j,lw(f,C,M.header)),X=lw(Q===void 0||Q instanceof FormData?{}:{"Content-Type":"application/json"},f,C,M.header),te=[...y,...A],L={redirect:"follow",...p,...D,body:Q,headers:X};let $,H,V=new T(Q3(b,{baseUrl:G,params:M,querySerializer:F,pathSerializer:P}),L),U;for(const Z in D)Z in V||(V[Z]=D[Z]);if(te.length){$=G3(),H=Object.freeze({baseUrl:G,fetch:_,parseAs:R,querySerializer:F,bodySerializer:k,pathSerializer:P});for(const Z of te)if(Z&&typeof Z=="object"&&typeof Z.onRequest=="function"){const W=await Z.onRequest({request:V,schemaPath:b,params:M,options:H,id:$});if(W)if(W instanceof T)V=W;else if(W instanceof Response){U=W;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!U){try{U=await _(V,h)}catch(Z){let W=Z;if(te.length)for(let se=te.length-1;se>=0;se--){const ie=te[se];if(ie&&typeof ie=="object"&&typeof ie.onError=="function"){const he=await ie.onError({request:V,error:W,schemaPath:b,params:M,options:H,id:$});if(he){if(he instanceof Response){W=void 0,U=he;break}if(he instanceof Error){W=he;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(W)throw W}if(te.length)for(let Z=te.length-1;Z>=0;Z--){const W=te[Z];if(W&&typeof W=="object"&&typeof W.onResponse=="function"){const se=await W.onResponse({request:V,response:U,schemaPath:b,params:M,options:H,id:$});if(se){if(!(se instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");U=se}}}}const I=U.headers.get("Content-Length");if(U.status===204||V.method==="HEAD"||I==="0"&&!U.headers.get("Transfer-Encoding")?.includes("chunked"))return U.ok?{data:void 0,response:U}:{error:void 0,response:U};if(U.ok)return{data:await(async()=>{if(R==="stream")return U.body;if(R==="json"&&!I){const W=await U.text();return W?JSON.parse(W):void 0}return await U[R]()})(),response:U};let K=await U.text();try{K=JSON.parse(K)}catch{}return{error:K,response:U}}return{request(b,x,E){return v(x,{...E,method:b.toUpperCase()})},GET(b,x){return v(b,{...x,method:"GET"})},PUT(b,x){return v(b,{...x,method:"PUT"})},POST(b,x){return v(b,{...x,method:"POST"})},DELETE(b,x){return v(b,{...x,method:"DELETE"})},OPTIONS(b,x){return v(b,{...x,method:"OPTIONS"})},HEAD(b,x){return v(b,{...x,method:"HEAD"})},PATCH(b,x){return v(b,{...x,method:"PATCH"})},TRACE(b,x){return v(b,{...x,method:"TRACE"})},use(...b){for(const x of b)if(x){if(typeof x!="object"||!("onRequest"in x||"onResponse"in x||"onError"in x))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");y.push(x)}},eject(...b){for(const x of b){const E=y.indexOf(x);E!==-1&&y.splice(E,1)}}}}function Eh(e,t,n){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?.allowReserved===!0?t:encodeURIComponent(t)}`}function QR(e,t,n){if(!t||typeof t!="object")return"";const i=[],o={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const f in t)i.push(f,n.allowReserved===!0?t[f]:encodeURIComponent(t[f]));const u=i.join(",");switch(n.style){case"form":return`${e}=${u}`;case"label":return`.${u}`;case"matrix":return`;${e}=${u}`;default:return u}}for(const u in t){const f=n.style==="deepObject"?`${e}[${u}]`:u;i.push(Eh(f,t[u],n))}const l=i.join(o);return n.style==="label"||n.style==="matrix"?`${o}${l}`:l}function WR(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const l={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",u=(n.allowReserved===!0?t:t.map(f=>encodeURIComponent(f))).join(l);switch(n.style){case"simple":return u;case"label":return`.${u}`;case"matrix":return`;${e}=${u}`;default:return`${e}=${u}`}}const i={simple:",",label:".",matrix:";"}[n.style]||"&",o=[];for(const l of t)n.style==="simple"||n.style==="label"?o.push(n.allowReserved===!0?l:encodeURIComponent(l)):o.push(Eh(e,l,n));return n.style==="label"||n.style==="matrix"?`${i}${o.join(i)}`:o.join(i)}function aw(e){return function(n){const i=[];if(n&&typeof n=="object")for(const o in n){const l=n[o];if(l!=null){if(Array.isArray(l)){if(l.length===0)continue;i.push(WR(o,l,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof l=="object"){i.push(QR(o,l,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}i.push(Eh(o,l,e))}}return i.join("&")}}function Y3(e,t){let n=e;for(const i of e.match(V3)??[]){let o=i.substring(1,i.length-1),l=!1,u="simple";if(o.endsWith("*")&&(l=!0,o=o.substring(0,o.length-1)),o.startsWith(".")?(u="label",o=o.substring(1)):o.startsWith(";")&&(u="matrix",o=o.substring(1)),!t||t[o]===void 0||t[o]===null)continue;const f=t[o];if(Array.isArray(f)){n=n.replace(i,WR(o,f,{style:u,explode:l}));continue}if(typeof f=="object"){n=n.replace(i,QR(o,f,{style:u,explode:l}));continue}if(u==="matrix"){n=n.replace(i,`;${Eh(o,f)}`);continue}n=n.replace(i,u==="label"?`.${encodeURIComponent(f)}`:encodeURIComponent(f))}return n}function X3(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 Q3(e,t){let n=`${t.baseUrl}${e}`;t.params?.path&&(n=t.pathSerializer(n,t.params.path));let i=t.querySerializer(t.params.query??{});return i.startsWith("?")&&(i=i.substring(1)),i&&(n+=`?${i}`),n}function lw(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const i=n instanceof Headers?n.entries():Object.entries(n);for(const[o,l]of i)if(l===null)t.delete(o);else if(Array.isArray(l))for(const u of l)t.append(o,u);else l!==void 0&&t.set(o,l)}return t}function cw(e){return e.endsWith("/")?e.substring(0,e.length-1):e}function W3(e){const t=K3({baseUrl:e.baseUrl,...e.fetch&&{fetch:e.fetch}}),n=e.getHeaders,i=e.transportPath??"direct";return t.use({async onRequest({request:o}){if(n){const l=await n();for(const[u,f]of Object.entries(l))o.headers.set(u,f)}return o.headers.has("x-syncular-transport-path")||o.headers.set("x-syncular-transport-path",i),o}}),t}function Z3(e){return W3({baseUrl:e.serverUrl,getHeaders:()=>({Authorization:`Bearer ${e.token}`})})}async function J3(e){try{const{error:t,response:n}=await e.GET("/console/stats");if(!t)return;const i=n.status;let o=null;if(typeof t=="string")o=t;else if(t&&typeof t=="object"){const l=t,u=l.error,f=l.message;if(typeof u=="string"&&u.length>0)o=u;else if(typeof f=="string"&&f.length>0)o=f;else try{o=JSON.stringify(l)}catch{o=null}}throw new Error(o&&o.length>0?`Console API /console/stats returned ${i}: ${o}`:`Console API /console/stats returned ${i}`)}catch(t){throw t instanceof Error?t:new Error("Failed to connect to console API")}}const Kc="sync-console-connection";function jy(e){if(!e)return null;const t=e.serverUrl?.trim()??"",n=e.token?.trim()??"";return!t||!n?null:{serverUrl:t,token:n}}function ZR(e){return typeof window>"u"?null:e==="local"?window.localStorage:e==="session"?window.sessionStorage:null}function uw(e){const t=ZR(e);if(!t)return null;try{const n=t.getItem(Kc);return n?jy(JSON.parse(n)):null}catch{return null}}function e4(e,t){const n=ZR(e);if(n)try{if(!t){n.removeItem(Kc);return}n.setItem(Kc,JSON.stringify(t))}catch{}}const JR=S.createContext(null);function t4({children:e,defaultConfig:t=null,autoConnect:n=!1,storageMode:i="session"}){const[o,l]=S.useState(()=>uw(i));S.useEffect(()=>{const _=uw(i);l(_)},[i]),S.useEffect(()=>{typeof window>"u"||(i!=="local"&&window.localStorage.removeItem(Kc),i==="memory"&&window.sessionStorage.removeItem(Kc))},[i]);const u=S.useCallback(_=>{const T=jy(_);l(T),e4(i,T)},[i]),[f,h]=S.useState({isConnected:!1,isConnecting:!1,error:null,client:null}),p=S.useRef(null);S.useEffect(()=>{if(!(o?.serverUrl?.trim()&&o.token?.trim())&&t?.serverUrl?.trim()&&t.token?.trim()){u({serverUrl:t.serverUrl.trim(),token:t.token.trim()});return}},[u,o,t]);const y=S.useCallback(async(_,T)=>{const C=_??o;if(!C)return h(R=>({...R,error:"No connection configured"})),!1;const M=jy(C);if(!M){const R=(C.serverUrl?.trim()??"").length>0;return h(N=>({...N,error:R?"Token is required":"Server URL is required"})),!1}_&&(T?.persistOverride??!0)&&u(M),h(R=>({...R,isConnecting:!0,error:null}));try{const R=Z3(M);return await J3(R),h({isConnected:!0,isConnecting:!1,client:R,error:null}),!0}catch(R){return h({isConnected:!1,isConnecting:!1,client:null,error:R instanceof Error?R.message:"Connection failed"}),!1}},[o,u]),v=S.useCallback(_=>{_?.clearSavedConfig&&u(null),h({isConnected:!1,isConnecting:!1,client:null,error:null})},[u]),b=S.useCallback(()=>{h(_=>({..._,error:null}))},[]),x=S.useCallback(_=>{u(_),h({isConnected:!1,isConnecting:!1,client:null,error:null})},[u]),E=S.useMemo(()=>({config:o,setConfig:x,isConnected:f.isConnected,isConnecting:f.isConnecting,error:f.error,client:f.client,connect:y,disconnect:v,clearError:b}),[o,x,f,y,v,b]);return S.useEffect(()=>{if(!n||f.isConnected||f.isConnecting)return;const _=o??t,T=n4(_);!_||!T||p.current!==T&&(p.current=T,y(_,{persistOverride:!0}))},[n,o,t,f.isConnected,f.isConnecting,y]),d.jsx(JR.Provider,{value:E,children:e})}function n4(e){if(!e)return null;const t=e.serverUrl?.trim()??"",n=e.token?.trim()??"";return!t||!n?null:`${t}\0${n}`}function $o(){const e=S.useContext(JR);if(!e)throw new Error("useConnection must be used within a ConnectionProvider");return e}function e1(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=e1(e[t]))&&(i&&(i+=" "),i+=n)}else for(n in e)e[n]&&(i&&(i+=" "),i+=n);return i}function Bv(){for(var e,t,n=0,i="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=e1(e))&&(i&&(i+=" "),i+=t);return i}var r4=e=>typeof e=="number"&&e!=+e,Yd=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,fw=e=>(typeof e=="number"||e instanceof Number)&&!r4(e);function s4(){}var Xd=Symbol("NOT_FOUND");function i4(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function o4(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function a4(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(i=>typeof i=="function"?`function ${i.name||"unnamed"}()`:typeof i).join(", ");throw new TypeError(`${t}[${n}]`)}}var dw=e=>Array.isArray(e)?e:[e];function l4(e){const t=Array.isArray(e[0])?e[0]:e;return a4(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function c4(e,t){const n=[],{length:i}=e;for(let o=0;o<i;o++)n.push(e[o].apply(null,t));return n}function u4(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Xd},put(n,i){t={key:n,value:i}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function f4(e,t){let n=[];function i(f){const h=n.findIndex(p=>t(f,p.key));if(h>-1){const p=n[h];return h>0&&(n.splice(h,1),n.unshift(p)),p.value}return Xd}function o(f,h){i(f)===Xd&&(n.unshift({key:f,value:h}),n.length>e&&n.pop())}function l(){return n}function u(){n=[]}return{get:i,put:o,getEntries:l,clear:u}}var d4=(e,t)=>e===t;function h4(e){return function(n,i){if(n===null||i===null||n.length!==i.length)return!1;const{length:o}=n;for(let l=0;l<o;l++)if(!e(n[l],i[l]))return!1;return!0}}function p4(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:i=d4,maxSize:o=1,resultEqualityCheck:l}=n,u=h4(i);let f=0;const h=o<=1?u4(u):f4(o,u);function p(){let y=h.get(arguments);if(y===Xd){if(y=e.apply(null,arguments),f++,l){const b=h.getEntries().find(x=>l(x.value,y));b&&(y=b.value,f!==0&&f--)}h.put(arguments,y)}return y}return p.clearCache=()=>{h.clear(),p.resetResultsCount()},p.resultsCount=()=>f,p.resetResultsCount=()=>{f=0},p}var m4=class{constructor(e){this.value=e}deref(){return this.value}},g4=typeof WeakRef<"u"?WeakRef:m4,y4=0,hw=1;function Yf(){return{s:y4,v:void 0,o:null,p:null}}function t1(e,t={}){let n=Yf();const{resultEqualityCheck:i}=t;let o,l=0;function u(){let f=n;const{length:h}=arguments;for(let v=0,b=h;v<b;v++){const x=arguments[v];if(typeof x=="function"||typeof x=="object"&&x!==null){let E=f.o;E===null&&(f.o=E=new WeakMap);const _=E.get(x);_===void 0?(f=Yf(),E.set(x,f)):f=_}else{let E=f.p;E===null&&(f.p=E=new Map);const _=E.get(x);_===void 0?(f=Yf(),E.set(x,f)):f=_}}const p=f;let y;if(f.s===hw)y=f.v;else if(y=e.apply(null,arguments),l++,i){const v=o?.deref?.()??o;v!=null&&i(v,y)&&(y=v,l!==0&&l--),o=typeof y=="object"&&y!==null||typeof y=="function"?new g4(y):y}return p.s=hw,p.v=y,y}return u.clearCache=()=>{n=Yf(),u.resetResultsCount()},u.resultsCount=()=>l,u.resetResultsCount=()=>{l=0},u}function n1(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,i=(...o)=>{let l=0,u=0,f,h={},p=o.pop();typeof p=="object"&&(h=p,p=o.pop()),i4(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);const y={...n,...h},{memoize:v,memoizeOptions:b=[],argsMemoize:x=t1,argsMemoizeOptions:E=[]}=y,_=dw(b),T=dw(E),C=l4(o),M=v(function(){return l++,p.apply(null,arguments)},..._),R=x(function(){u++;const k=c4(C,arguments);return f=M.apply(null,k),f},...T);return Object.assign(R,{resultFunc:p,memoizedResultFunc:M,dependencies:C,dependencyRecomputations:()=>u,resetDependencyRecomputations:()=>{u=0},lastResult:()=>f,recomputations:()=>l,resetRecomputations:()=>{l=0},memoize:v,argsMemoize:x})};return Object.assign(i,{withTypes:()=>i}),i}var v4=n1(t1),b4=Object.assign((e,t=v4)=>{o4(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),i=n.map(l=>e[l]);return t(i,(...l)=>l.reduce((u,f,h)=>(u[n[h]]=f,u),{}))},{withTypes:()=>b4});function Qd(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}var Ng={},jg={},Mg={},pw;function x4(){return pw||(pw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,i,{signal:o,edges:l}={}){let u,f=null;const h=l!=null&&l.includes("leading"),p=l==null||l.includes("trailing"),y=()=>{f!==null&&(n.apply(u,f),u=void 0,f=null)},v=()=>{p&&y(),_()};let b=null;const x=()=>{b!=null&&clearTimeout(b),b=setTimeout(()=>{b=null,v()},i)},E=()=>{b!==null&&(clearTimeout(b),b=null)},_=()=>{E(),u=void 0,f=null},T=()=>{y()},C=function(...M){if(o?.aborted)return;u=this,f=M;const R=b==null;x(),h&&R&&y()};return C.schedule=x,C.cancel=_,C.flush=T,o?.addEventListener("abort",_,{once:!0}),C}e.debounce=t})(Mg)),Mg}var mw;function S4(){return mw||(mw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=x4();function n(i,o=0,l={}){typeof l!="object"&&(l={});const{leading:u=!1,trailing:f=!0,maxWait:h}=l,p=Array(2);u&&(p[0]="leading"),f&&(p[1]="trailing");let y,v=null;const b=t.debounce(function(..._){y=i.apply(this,_),v=null},o,{edges:p}),x=function(..._){return h!=null&&(v===null&&(v=Date.now()),Date.now()-v>=h)?(y=i.apply(this,_),v=Date.now(),b.cancel(),b.schedule(),y):(b.apply(this,_),y)},E=()=>(b.flush(),y);return x.cancel=b.cancel,x.flush=E,x}e.debounce=n})(jg)),jg}var gw;function E4(){return gw||(gw=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=S4();function n(i,o=0,l={}){const{leading:u=!0,trailing:f=!0}=l;return t.debounce(i,o,{leading:u,maxWait:o,trailing:f})}e.throttle=n})(Ng)),Ng}var Ag,yw;function _4(){return yw||(yw=1,Ag=E4().throttle),Ag}var w4=_4();const T4=fR(w4);var vw=function(t,n){for(var i=arguments.length,o=new Array(i>2?i-2:0),l=2;l<i;l++)o[l-2]=arguments[l];if(typeof console<"u"&&console.warn&&(n===void 0&&console.warn("LogUtils requires an error message argument"),!t))if(n===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=0;console.warn(n.replace(/%s/g,()=>o[u++]))}},ts={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},r1=(e,t,n)=>{var{width:i=ts.width,height:o=ts.height,aspect:l,maxHeight:u}=n,f=Yd(i)?e:Number(i),h=Yd(o)?t:Number(o);return l&&l>0&&(f?h=f/l:h&&(f=h*l),u&&h!=null&&h>u&&(h=u)),{calculatedWidth:f,calculatedHeight:h}},C4={width:0,height:0,overflow:"visible"},R4={width:0,overflowX:"visible"},N4={height:0,overflowY:"visible"},j4={},M4=e=>{var{width:t,height:n}=e,i=Yd(t),o=Yd(n);return i&&o?C4:i?R4:o?N4:j4};function A4(e){var{width:t,height:n,aspect:i}=e,o=t,l=n;return o===void 0&&l===void 0?(o=ts.width,l=ts.height):o===void 0?o=i&&i>0?void 0:ts.width:l===void 0&&(l=i&&i>0?void 0:ts.height),{width:o,height:l}}function My(){return My=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)({}).hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},My.apply(null,arguments)}function bw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,i)}return n}function xw(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?bw(Object(n),!0).forEach(function(i){O4(e,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):bw(Object(n)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(n,i))})}return e}function O4(e,t,n){return(t=k4(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k4(e){var t=I4(e,"string");return typeof t=="symbol"?t:t+""}function I4(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var s1=S.createContext(ts.initialDimension);function D4(e){return Qd(e.width)&&Qd(e.height)}function i1(e){var{children:t,width:n,height:i}=e,o=S.useMemo(()=>({width:n,height:i}),[n,i]);return D4(o)?S.createElement(s1.Provider,{value:o},t):null}var L4=()=>S.useContext(s1),P4=S.forwardRef((e,t)=>{var{aspect:n,initialDimension:i=ts.initialDimension,width:o,height:l,minWidth:u=ts.minWidth,minHeight:f,maxHeight:h,children:p,debounce:y=ts.debounce,id:v,className:b,onResize:x,style:E={}}=e,_=S.useRef(null),T=S.useRef();T.current=x,S.useImperativeHandle(t,()=>_.current);var[C,M]=S.useState({containerWidth:i.width,containerHeight:i.height}),R=S.useCallback((A,D)=>{M(G=>{var F=Math.round(A),P=Math.round(D);return G.containerWidth===F&&G.containerHeight===P?G:{containerWidth:F,containerHeight:P}})},[]);S.useEffect(()=>{if(_.current==null||typeof ResizeObserver>"u")return s4;var A=P=>{var Q,X=P[0];if(X!=null){var{width:te,height:L}=X.contentRect;R(te,L),(Q=T.current)===null||Q===void 0||Q.call(T,te,L)}};y>0&&(A=T4(A,y,{trailing:!0,leading:!1}));var D=new ResizeObserver(A),{width:G,height:F}=_.current.getBoundingClientRect();return R(G,F),D.observe(_.current),()=>{D.disconnect()}},[R,y]);var{containerWidth:N,containerHeight:k}=C;vw(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:z,calculatedHeight:j}=r1(N,k,{width:o,height:l,aspect:n,maxHeight:h});return vw(z!=null&&z>0||j!=null&&j>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
30
|
+
please check the style of container, or the props width(%s) and height(%s),
|
|
31
|
+
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
32
|
+
height and width.`,z,j,o,l,u,f,n),S.createElement("div",{id:v?"".concat(v):void 0,className:Bv("recharts-responsive-container",b),style:xw(xw({},E),{},{width:o,height:l,minWidth:u,minHeight:f,maxHeight:h}),ref:_},S.createElement("div",{style:M4({width:o,height:l})},S.createElement(i1,{width:z,height:j},p)))}),z4=S.forwardRef((e,t)=>{var n=L4();if(Qd(n.width)&&Qd(n.height))return e.children;var{width:i,height:o}=A4({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:l,calculatedHeight:u}=r1(void 0,void 0,{width:i,height:o,aspect:e.aspect,maxHeight:e.maxHeight});return fw(l)&&fw(u)?S.createElement(i1,{width:l,height:u},e.children):S.createElement(P4,My({},e,{width:i,height:o,ref:t}))});const U4=(e,t)=>{const n=new Array(e.length+t.length);for(let i=0;i<e.length;i++)n[i]=e[i];for(let i=0;i<t.length;i++)n[e.length+i]=t[i];return n},B4=(e,t)=>({classGroupId:e,validator:t}),o1=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Wd="-",Sw=[],H4="arbitrary..",F4=e=>{const t=V4(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:u=>{if(u.startsWith("[")&&u.endsWith("]"))return q4(u);const f=u.split(Wd),h=f[0]===""&&f.length>1?1:0;return a1(f,h,t)},getConflictingClassGroupIds:(u,f)=>{if(f){const h=i[u],p=n[u];return h?p?U4(p,h):h:p||Sw}return n[u]||Sw}}},a1=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const o=e[t],l=n.nextPart.get(o);if(l){const p=a1(e,t+1,l);if(p)return p}const u=n.validators;if(u===null)return;const f=t===0?e.join(Wd):e.slice(t).join(Wd),h=u.length;for(let p=0;p<h;p++){const y=u[p];if(y.validator(f))return y.classGroupId}},q4=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),i=t.slice(0,n);return i?H4+i:void 0})(),V4=e=>{const{theme:t,classGroups:n}=e;return $4(n,t)},$4=(e,t)=>{const n=o1();for(const i in e){const o=e[i];Hv(o,n,i,t)}return n},Hv=(e,t,n,i)=>{const o=e.length;for(let l=0;l<o;l++){const u=e[l];G4(u,t,n,i)}},G4=(e,t,n,i)=>{if(typeof e=="string"){K4(e,t,n);return}if(typeof e=="function"){Y4(e,t,n,i);return}X4(e,t,n,i)},K4=(e,t,n)=>{const i=e===""?t:l1(t,e);i.classGroupId=n},Y4=(e,t,n,i)=>{if(Q4(e)){Hv(e(i),t,n,i);return}t.validators===null&&(t.validators=[]),t.validators.push(B4(n,e))},X4=(e,t,n,i)=>{const o=Object.entries(e),l=o.length;for(let u=0;u<l;u++){const[f,h]=o[u];Hv(h,l1(t,f),n,i)}},l1=(e,t)=>{let n=e;const i=t.split(Wd),o=i.length;for(let l=0;l<o;l++){const u=i[l];let f=n.nextPart.get(u);f||(f=o1(),n.nextPart.set(u,f)),n=f}return n},Q4=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,W4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),i=Object.create(null);const o=(l,u)=>{n[l]=u,t++,t>e&&(t=0,i=n,n=Object.create(null))};return{get(l){let u=n[l];if(u!==void 0)return u;if((u=i[l])!==void 0)return o(l,u),u},set(l,u){l in n?n[l]=u:o(l,u)}}},Ay="!",Ew=":",Z4=[],_w=(e,t,n,i,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:i,isExternal:o}),J4=e=>{const{prefix:t,experimentalParseClassName:n}=e;let i=o=>{const l=[];let u=0,f=0,h=0,p;const y=o.length;for(let _=0;_<y;_++){const T=o[_];if(u===0&&f===0){if(T===Ew){l.push(o.slice(h,_)),h=_+1;continue}if(T==="/"){p=_;continue}}T==="["?u++:T==="]"?u--:T==="("?f++:T===")"&&f--}const v=l.length===0?o:o.slice(h);let b=v,x=!1;v.endsWith(Ay)?(b=v.slice(0,-1),x=!0):v.startsWith(Ay)&&(b=v.slice(1),x=!0);const E=p&&p>h?p-h:void 0;return _w(l,x,b,E)};if(t){const o=t+Ew,l=i;i=u=>u.startsWith(o)?l(u.slice(o.length)):_w(Z4,!1,u,void 0,!0)}if(n){const o=i;i=l=>n({className:l,parseClassName:o})}return i},eU=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,i)=>{t.set(n,1e6+i)}),n=>{const i=[];let o=[];for(let l=0;l<n.length;l++){const u=n[l],f=u[0]==="[",h=t.has(u);f||h?(o.length>0&&(o.sort(),i.push(...o),o=[]),i.push(u)):o.push(u)}return o.length>0&&(o.sort(),i.push(...o)),i}},tU=e=>({cache:W4(e.cacheSize),parseClassName:J4(e),sortModifiers:eU(e),...F4(e)}),nU=/\s+/,rU=(e,t)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:o,sortModifiers:l}=t,u=[],f=e.trim().split(nU);let h="";for(let p=f.length-1;p>=0;p-=1){const y=f[p],{isExternal:v,modifiers:b,hasImportantModifier:x,baseClassName:E,maybePostfixModifierPosition:_}=n(y);if(v){h=y+(h.length>0?" "+h:h);continue}let T=!!_,C=i(T?E.substring(0,_):E);if(!C){if(!T){h=y+(h.length>0?" "+h:h);continue}if(C=i(E),!C){h=y+(h.length>0?" "+h:h);continue}T=!1}const M=b.length===0?"":b.length===1?b[0]:l(b).join(":"),R=x?M+Ay:M,N=R+C;if(u.indexOf(N)>-1)continue;u.push(N);const k=o(C,T);for(let z=0;z<k.length;++z){const j=k[z];u.push(R+j)}h=y+(h.length>0?" "+h:h)}return h},sU=(...e)=>{let t=0,n,i,o="";for(;t<e.length;)(n=e[t++])&&(i=c1(n))&&(o&&(o+=" "),o+=i);return o},c1=e=>{if(typeof e=="string")return e;let t,n="";for(let i=0;i<e.length;i++)e[i]&&(t=c1(e[i]))&&(n&&(n+=" "),n+=t);return n},iU=(e,...t)=>{let n,i,o,l;const u=h=>{const p=t.reduce((y,v)=>v(y),e());return n=tU(p),i=n.cache.get,o=n.cache.set,l=f,f(h)},f=h=>{const p=i(h);if(p)return p;const y=rU(h,n);return o(h,y),y};return l=u,(...h)=>l(sU(...h))},oU=[],Wt=e=>{const t=n=>n[e]||oU;return t.isThemeGetter=!0,t},u1=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,f1=/^\((?:(\w[\w-]*):)?(.+)\)$/i,aU=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,lU=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cU=/\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$/,uU=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fU=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dU=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,vi=e=>aU.test(e),Ye=e=>!!e&&!Number.isNaN(Number(e)),bi=e=>!!e&&Number.isInteger(Number(e)),Og=e=>e.endsWith("%")&&Ye(e.slice(0,-1)),Ts=e=>lU.test(e),d1=()=>!0,hU=e=>cU.test(e)&&!uU.test(e),Fv=()=>!1,pU=e=>fU.test(e),mU=e=>dU.test(e),gU=e=>!Re(e)&&!Ne(e),yU=e=>qi(e,m1,Fv),Re=e=>u1.test(e),bo=e=>qi(e,g1,hU),ww=e=>qi(e,TU,Ye),vU=e=>qi(e,v1,d1),bU=e=>qi(e,y1,Fv),Tw=e=>qi(e,h1,Fv),xU=e=>qi(e,p1,mU),Xf=e=>qi(e,b1,pU),Ne=e=>f1.test(e),Rc=e=>Go(e,g1),SU=e=>Go(e,y1),Cw=e=>Go(e,h1),EU=e=>Go(e,m1),_U=e=>Go(e,p1),Qf=e=>Go(e,b1,!0),wU=e=>Go(e,v1,!0),qi=(e,t,n)=>{const i=u1.exec(e);return i?i[1]?t(i[1]):n(i[2]):!1},Go=(e,t,n=!1)=>{const i=f1.exec(e);return i?i[1]?t(i[1]):n:!1},h1=e=>e==="position"||e==="percentage",p1=e=>e==="image"||e==="url",m1=e=>e==="length"||e==="size"||e==="bg-size",g1=e=>e==="length",TU=e=>e==="number",y1=e=>e==="family-name",v1=e=>e==="number"||e==="weight",b1=e=>e==="shadow",CU=()=>{const e=Wt("color"),t=Wt("font"),n=Wt("text"),i=Wt("font-weight"),o=Wt("tracking"),l=Wt("leading"),u=Wt("breakpoint"),f=Wt("container"),h=Wt("spacing"),p=Wt("radius"),y=Wt("shadow"),v=Wt("inset-shadow"),b=Wt("text-shadow"),x=Wt("drop-shadow"),E=Wt("blur"),_=Wt("perspective"),T=Wt("aspect"),C=Wt("ease"),M=Wt("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...N(),Ne,Re],z=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],A=()=>[Ne,Re,h],D=()=>[vi,"full","auto",...A()],G=()=>[bi,"none","subgrid",Ne,Re],F=()=>["auto",{span:["full",bi,Ne,Re]},bi,Ne,Re],P=()=>[bi,"auto",Ne,Re],Q=()=>["auto","min","max","fr",Ne,Re],X=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],te=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...A()],$=()=>[vi,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...A()],H=()=>[vi,"screen","full","dvw","lvw","svw","min","max","fit",...A()],V=()=>[vi,"screen","full","lh","dvh","lvh","svh","min","max","fit",...A()],U=()=>[e,Ne,Re],I=()=>[...N(),Cw,Tw,{position:[Ne,Re]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",EU,yU,{size:[Ne,Re]}],W=()=>[Og,Rc,bo],se=()=>["","none","full",p,Ne,Re],ie=()=>["",Ye,Rc,bo],he=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],de=()=>[Ye,Og,Cw,Tw],Be=()=>["","none",E,Ne,Re],_e=()=>["none",Ye,Ne,Re],re=()=>["none",Ye,Ne,Re],fe=()=>[Ye,Ne,Re],ae=()=>[vi,"full",...A()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ts],breakpoint:[Ts],color:[d1],container:[Ts],"drop-shadow":[Ts],ease:["in","out","in-out"],font:[gU],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ts],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ts],shadow:[Ts],spacing:["px",Ye],text:[Ts],"text-shadow":[Ts],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",vi,Re,Ne,T]}],container:["container"],columns:[{columns:[Ye,Re,Ne,f]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"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:k()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:D()}],"inset-x":[{"inset-x":D()}],"inset-y":[{"inset-y":D()}],start:[{"inset-s":D(),start:D()}],end:[{"inset-e":D(),end:D()}],"inset-bs":[{"inset-bs":D()}],"inset-be":[{"inset-be":D()}],top:[{top:D()}],right:[{right:D()}],bottom:[{bottom:D()}],left:[{left:D()}],visibility:["visible","invisible","collapse"],z:[{z:[bi,"auto",Ne,Re]}],basis:[{basis:[vi,"full","auto",f,...A()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ye,vi,"auto","initial","none",Re]}],grow:[{grow:["",Ye,Ne,Re]}],shrink:[{shrink:["",Ye,Ne,Re]}],order:[{order:[bi,"first","last","none",Ne,Re]}],"grid-cols":[{"grid-cols":G()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":P()}],"col-end":[{"col-end":P()}],"grid-rows":[{"grid-rows":G()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":P()}],"row-end":[{"row-end":P()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Q()}],"auto-rows":[{"auto-rows":Q()}],gap:[{gap:A()}],"gap-x":[{"gap-x":A()}],"gap-y":[{"gap-y":A()}],"justify-content":[{justify:[...X(),"normal"]}],"justify-items":[{"justify-items":[...te(),"normal"]}],"justify-self":[{"justify-self":["auto",...te()]}],"align-content":[{content:["normal",...X()]}],"align-items":[{items:[...te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...te(),{baseline:["","last"]}]}],"place-content":[{"place-content":X()}],"place-items":[{"place-items":[...te(),"baseline"]}],"place-self":[{"place-self":["auto",...te()]}],p:[{p:A()}],px:[{px:A()}],py:[{py:A()}],ps:[{ps:A()}],pe:[{pe:A()}],pbs:[{pbs:A()}],pbe:[{pbe:A()}],pt:[{pt:A()}],pr:[{pr:A()}],pb:[{pb:A()}],pl:[{pl:A()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mbs:[{mbs:L()}],mbe:[{mbe:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":A()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":A()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...V()]}],"min-block-size":[{"min-block":["auto",...V()]}],"max-block-size":[{"max-block":["none",...V()]}],w:[{w:[f,"screen",...$()]}],"min-w":[{"min-w":[f,"screen","none",...$()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[u]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,Rc,bo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,wU,vU]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Og,Re]}],"font-family":[{font:[SU,bU,t]}],"font-features":[{"font-features":[Re]}],"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:[o,Ne,Re]}],"line-clamp":[{"line-clamp":[Ye,"none",Ne,ww]}],leading:[{leading:[l,...A()]}],"list-image":[{"list-image":["none",Ne,Re]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ne,Re]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:U()}],"text-color":[{text:U()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...he(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ye,"from-font","auto",Ne,bo]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Ye,"auto",Ne,Re]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:A()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ne,Re]}],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",Ne,Re]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},bi,Ne,Re],radial:["",Ne,Re],conic:[bi,Ne,Re]},_U,xU]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:W()}],"gradient-via-pos":[{via:W()}],"gradient-to-pos":[{to:W()}],"gradient-from":[{from:U()}],"gradient-via":[{via:U()}],"gradient-to":[{to:U()}],rounded:[{rounded:se()}],"rounded-s":[{"rounded-s":se()}],"rounded-e":[{"rounded-e":se()}],"rounded-t":[{"rounded-t":se()}],"rounded-r":[{"rounded-r":se()}],"rounded-b":[{"rounded-b":se()}],"rounded-l":[{"rounded-l":se()}],"rounded-ss":[{"rounded-ss":se()}],"rounded-se":[{"rounded-se":se()}],"rounded-ee":[{"rounded-ee":se()}],"rounded-es":[{"rounded-es":se()}],"rounded-tl":[{"rounded-tl":se()}],"rounded-tr":[{"rounded-tr":se()}],"rounded-br":[{"rounded-br":se()}],"rounded-bl":[{"rounded-bl":se()}],"border-w":[{border:ie()}],"border-w-x":[{"border-x":ie()}],"border-w-y":[{"border-y":ie()}],"border-w-s":[{"border-s":ie()}],"border-w-e":[{"border-e":ie()}],"border-w-bs":[{"border-bs":ie()}],"border-w-be":[{"border-be":ie()}],"border-w-t":[{"border-t":ie()}],"border-w-r":[{"border-r":ie()}],"border-w-b":[{"border-b":ie()}],"border-w-l":[{"border-l":ie()}],"divide-x":[{"divide-x":ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...he(),"hidden","none"]}],"divide-style":[{divide:[...he(),"hidden","none"]}],"border-color":[{border:U()}],"border-color-x":[{"border-x":U()}],"border-color-y":[{"border-y":U()}],"border-color-s":[{"border-s":U()}],"border-color-e":[{"border-e":U()}],"border-color-bs":[{"border-bs":U()}],"border-color-be":[{"border-be":U()}],"border-color-t":[{"border-t":U()}],"border-color-r":[{"border-r":U()}],"border-color-b":[{"border-b":U()}],"border-color-l":[{"border-l":U()}],"divide-color":[{divide:U()}],"outline-style":[{outline:[...he(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ye,Ne,Re]}],"outline-w":[{outline:["",Ye,Rc,bo]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",y,Qf,Xf]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",v,Qf,Xf]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Ye,bo]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":ie()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",b,Qf,Xf]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Ye,Ne,Re]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"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":[Ye]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":U()}],"mask-image-linear-to-color":[{"mask-linear-to":U()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":U()}],"mask-image-t-to-color":[{"mask-t-to":U()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":U()}],"mask-image-r-to-color":[{"mask-r-to":U()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":U()}],"mask-image-b-to-color":[{"mask-b-to":U()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":U()}],"mask-image-l-to-color":[{"mask-l-to":U()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":U()}],"mask-image-x-to-color":[{"mask-x-to":U()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[Ne,Re]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":U()}],"mask-image-radial-to-color":[{"mask-radial-to":U()}],"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":N()}],"mask-image-conic-pos":[{"mask-conic":[Ye]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":U()}],"mask-image-conic-to-color":[{"mask-conic-to":U()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ne,Re]}],filter:[{filter:["","none",Ne,Re]}],blur:[{blur:Be()}],brightness:[{brightness:[Ye,Ne,Re]}],contrast:[{contrast:[Ye,Ne,Re]}],"drop-shadow":[{"drop-shadow":["","none",x,Qf,Xf]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Ye,Ne,Re]}],"hue-rotate":[{"hue-rotate":[Ye,Ne,Re]}],invert:[{invert:["",Ye,Ne,Re]}],saturate:[{saturate:[Ye,Ne,Re]}],sepia:[{sepia:["",Ye,Ne,Re]}],"backdrop-filter":[{"backdrop-filter":["","none",Ne,Re]}],"backdrop-blur":[{"backdrop-blur":Be()}],"backdrop-brightness":[{"backdrop-brightness":[Ye,Ne,Re]}],"backdrop-contrast":[{"backdrop-contrast":[Ye,Ne,Re]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ye,Ne,Re]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ye,Ne,Re]}],"backdrop-invert":[{"backdrop-invert":["",Ye,Ne,Re]}],"backdrop-opacity":[{"backdrop-opacity":[Ye,Ne,Re]}],"backdrop-saturate":[{"backdrop-saturate":[Ye,Ne,Re]}],"backdrop-sepia":[{"backdrop-sepia":["",Ye,Ne,Re]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":A()}],"border-spacing-x":[{"border-spacing-x":A()}],"border-spacing-y":[{"border-spacing-y":A()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ne,Re]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ye,"initial",Ne,Re]}],ease:[{ease:["linear","initial",C,Ne,Re]}],delay:[{delay:[Ye,Ne,Re]}],animate:[{animate:["none",M,Ne,Re]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Ne,Re]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":["scale-3d"],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[Ne,Re,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"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:U()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:U()}],"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",Ne,Re]}],"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":A()}],"scroll-mx":[{"scroll-mx":A()}],"scroll-my":[{"scroll-my":A()}],"scroll-ms":[{"scroll-ms":A()}],"scroll-me":[{"scroll-me":A()}],"scroll-mbs":[{"scroll-mbs":A()}],"scroll-mbe":[{"scroll-mbe":A()}],"scroll-mt":[{"scroll-mt":A()}],"scroll-mr":[{"scroll-mr":A()}],"scroll-mb":[{"scroll-mb":A()}],"scroll-ml":[{"scroll-ml":A()}],"scroll-p":[{"scroll-p":A()}],"scroll-px":[{"scroll-px":A()}],"scroll-py":[{"scroll-py":A()}],"scroll-ps":[{"scroll-ps":A()}],"scroll-pe":[{"scroll-pe":A()}],"scroll-pbs":[{"scroll-pbs":A()}],"scroll-pbe":[{"scroll-pbe":A()}],"scroll-pt":[{"scroll-pt":A()}],"scroll-pr":[{"scroll-pr":A()}],"scroll-pb":[{"scroll-pb":A()}],"scroll-pl":[{"scroll-pl":A()}],"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",Ne,Re]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Ye,Rc,bo,ww]}],stroke:[{stroke:["none",...U()]}],"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"]}},RU=iU(CU);function me(...e){return RU(Bv(e))}const NU={light:"",dark:".dark"},x1=S.createContext(null);function jU(){const e=S.useContext(x1);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const MU=S.forwardRef(({id:e,className:t,children:n,config:i,...o},l)=>{const u=S.useId(),f=`chart-${e||u.replace(/:/g,"")}`;return d.jsx(x1.Provider,{value:{config:i},children:d.jsxs("div",{className:me("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":f,ref:l,...o,children:[d.jsx(AU,{config:i,id:f}),d.jsx(z4,{initialDimension:{width:1,height:1},children:n})]})})});MU.displayName="ChartContainer";function AU({config:e,id:t}){const n=Object.entries(e).filter(([,i])=>i.theme||i.color);return n.length<1?null:d.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(NU).map(([i,o])=>{const l=n.map(([u,f])=>{const h=f.theme?.[i]??f.color;return h?` --color-${u}: ${h};`:null}).filter(Boolean).join(`
|
|
33
|
+
`);return`${o} [data-chart='${t}'] {
|
|
34
|
+
${l}
|
|
35
|
+
}`}).join(`
|
|
36
|
+
`)}})}const OU=S.forwardRef(({active:e,className:t,color:n,formatter:i,hideIndicator:o=!1,hideLabel:l=!1,indicator:u="dot",label:f,labelClassName:h,labelFormatter:p,labelKey:y,nameKey:v,payload:b},x)=>{const{config:E}=jU(),_=S.useMemo(()=>{if(l||!b?.length)return null;const C=b[0];if(!C)return null;const M=`${y||C.dataKey||C.name||"value"}`,R=Rw(E,C,M),N=!y&&typeof f=="string"?E[f]?.label??f:R?.label;return p?d.jsx("div",{className:me("font-medium",h),children:p(N??"",b)}):N?d.jsx("div",{className:me("font-medium",h),children:N}):null},[E,l,f,h,p,y,b]);if(!e||!b?.length)return null;const T=b.length===1&&u!=="dot";return d.jsxs("div",{className:me("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:x,children:[T?null:_,d.jsx("div",{className:"grid gap-1.5",children:b.map((C,M)=>{const R=`${v||C.name||C.dataKey||"value"}`,N=Rw(E,C,R),k=n||C.payload?.fill||C.color;return d.jsx("div",{className:me("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-neutral-500",u==="dot"?"items-center":null),children:i&&C.value!==void 0&&C.name?i(C.value,C.name,C,M,C.payload??{}):d.jsxs(d.Fragment,{children:[N?.icon?d.jsx(N.icon,{}):o?null:d.jsx("div",{className:me("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",u==="dot"?"h-2.5 w-2.5":null,u==="line"?"w-1":null,u==="dashed"?"w-0 border-[1.5px] border-dashed bg-transparent":null,T&&u==="dashed"?"my-0.5":null),style:{"--color-bg":k,"--color-border":k}}),d.jsxs("div",{className:me("flex flex-1 justify-between leading-none",T?"items-end":"items-center"),children:[d.jsxs("div",{className:"grid gap-1.5",children:[T?_:null,d.jsx("span",{className:"text-neutral-500",children:N?.label||C.name})]}),C.value!==void 0?d.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:typeof C.value=="number"?C.value.toLocaleString():C.value}):null]})]})},R)})})]})});OU.displayName="ChartTooltipContent";function Rw(e,t,n){const i=t.payload?.[n],o=typeof i=="string"?i:null,l=typeof t.dataKey=="string"?t.dataKey:null,u=typeof t.name=="string"?t.name:null;return e[o??l??u??n]}const kU=["1h","6h","24h","7d"],S1=S.forwardRef(({className:e,bars:t,activeRange:n="1h",onRangeChange:i,startLabel:o="-1h",midLabel:l="-30m",endLabel:u="now",...f},h)=>d.jsxs("div",{ref:h,className:me("px-5 pt-4 pb-3 border-b border-border",e),...f,children:[d.jsxs("div",{className:"flex items-center justify-between mb-3",children:[d.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Activity"}),d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"w-2 h-2 rounded-sm bg-healthy/70"}),d.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Push"})]}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"w-2 h-2 rounded-sm bg-flow/70"}),d.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Pull"})]}),d.jsx("div",{className:"flex gap-0.5 ml-2",children:kU.map(p=>d.jsx("button",{type:"button",onClick:()=>i?.(p),className:me("font-mono text-[9px] border rounded-sm px-1.5 py-0.5 cursor-pointer transition-all",p===n?"text-white border-border-bright bg-white/[0.03]":"text-neutral-500 border-transparent hover:text-neutral-300"),children:p},p))})]})]}),d.jsx("div",{className:"flex items-end gap-[2px] h-16",children:t.map((p,y)=>d.jsxs("div",{className:"flex-1 flex flex-col gap-[1px] h-16 justify-end",children:[d.jsx("div",{className:"bg-flow/60 rounded-t-sm min-h-[2px]",style:{height:`${p.pullPercent}%`}}),d.jsx("div",{className:"bg-healthy/60 rounded-t-sm min-h-[2px]",style:{height:`${p.pushPercent}%`}})]},y))}),d.jsxs("div",{className:"flex justify-between mt-1.5",children:[d.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:o}),d.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:l}),d.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:u})]})]}));S1.displayName="ActivityBars";const Nw=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,jw=Bv,Vi=(e,t)=>n=>{var i;if(t?.variants==null)return jw(e,n?.class,n?.className);const{variants:o,defaultVariants:l}=t,u=Object.keys(o).map(p=>{const y=n?.[p],v=l?.[p];if(y===null)return null;const b=Nw(y)||Nw(v);return o[p][b]}),f=n&&Object.entries(n).reduce((p,y)=>{let[v,b]=y;return b===void 0||(p[v]=b),p},{}),h=t==null||(i=t.compoundVariants)===null||i===void 0?void 0:i.reduce((p,y)=>{let{class:v,className:b,...x}=y;return Object.entries(x).every(E=>{let[_,T]=E;return Array.isArray(T)?T.includes({...l,...f}[_]):{...l,...f}[_]===T})?[...p,v,b]:p},[]);return jw(e,u,h,n?.class,n?.className)},IU=Vi("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"}}),An=S.forwardRef(({className:e,variant:t,...n},i)=>d.jsx("input",{ref:i,className:me(IU({variant:t,className:e})),...n}));An.displayName="Input";function _h({controlled:e,default:t,name:n,state:i="value"}){const{current:o}=S.useRef(e!==void 0),[l,u]=S.useState(t),f=o?e:l,h=S.useCallback(p=>{o||u(p)},[]);return[f,h]}const Mw={};function En(e,t){const n=S.useRef(Mw);return n.current===Mw&&(n.current=e(t)),n}const kg=dR[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],DU=kg&&kg!==S.useLayoutEffect?kg:e=>e();function je(e){const t=En(LU).current;return t.next=e,DU(t.effect),t.trampoline}function LU(){const e={next:void 0,callback:PU,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function PU(){}function Us(e,t,n,i){const o=En(E1).current;return UU(o,e,t,n,i)&&_1(o,[e,t,n,i]),o.callback}function zU(e){const t=En(E1).current;return BU(t,e)&&_1(t,e),t.callback}function E1(){return{callback:null,cleanup:null,refs:[]}}function UU(e,t,n,i,o){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==i||e.refs[3]!==o}function BU(e,t){return e.refs.length!==t.length||e.refs.some((n,i)=>n!==t[i])}function _1(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const i=Array(t.length).fill(null);for(let o=0;o<t.length;o+=1){const l=t[o];if(l!=null)switch(typeof l){case"function":{const u=l(n);typeof u=="function"&&(i[o]=u);break}case"object":{l.current=n;break}}}e.cleanup=()=>{for(let o=0;o<t.length;o+=1){const l=t[o];if(l!=null)switch(typeof l){case"function":{const u=i[o];typeof u=="function"?u():l(null);break}case"object":{l.current=null;break}}}}}}}const HU=()=>{},De=typeof document<"u"?S.useLayoutEffect:HU,w1={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},wh={...w1,position:"fixed",top:0,left:0},T1={...w1,position:"absolute"};function mn(){}const Yc=Object.freeze([]),Kt=Object.freeze({});function nn(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(i=>n.searchParams.append("args[]",i)),`Base UI error #${e}; visit ${n} for the full message.`}const FU=parseInt(S.version,10);function qv(e){return FU>=e}function Aw(e){if(!S.isValidElement(e))return null;const t=e,n=t.props;return(qv(19)?n?.ref:t.ref)??null}function Oy(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function qU(e,t){const n={};for(const i in e){const o=e[i];if(t?.hasOwnProperty(i)){const l=t[i](o);l!=null&&Object.assign(n,l);continue}o===!0?n[`data-${i.toLowerCase()}`]="":o&&(n[`data-${i.toLowerCase()}`]=o.toString())}return n}function VU(e,t){return typeof e=="function"?e(t):e}function $U(e,t){return typeof e=="function"?e(t):e}const Ic={};function Li(e,t,n,i,o){let l={...ky(e,Ic)};return t&&(l=Mc(l,t)),n&&(l=Mc(l,n)),i&&(l=Mc(l,i)),o&&(l=Mc(l,o)),l}function GU(e){if(e.length===0)return Ic;if(e.length===1)return ky(e[0],Ic);let t={...ky(e[0],Ic)};for(let n=1;n<e.length;n+=1)t=Mc(t,e[n]);return t}function Mc(e,t){return C1(t)?t(e):KU(e,t)}function KU(e,t){if(!t)return e;for(const n in t){const i=t[n];switch(n){case"style":{e[n]=Oy(e.style,i);break}case"className":{e[n]=R1(e.className,i);break}default:YU(n,i)?e[n]=XU(e[n],i):e[n]=i}}return e}function YU(e,t){const n=e.charCodeAt(0),i=e.charCodeAt(1),o=e.charCodeAt(2);return n===111&&i===110&&o>=65&&o<=90&&(typeof t=="function"||typeof t>"u")}function C1(e){return typeof e=="function"}function ky(e,t){return C1(e)?e(t):e??Ic}function XU(e,t){return t?e?n=>{if(QU(n)){const o=n;Iy(o);const l=t(o);return o.baseUIHandlerPrevented||e?.(o),l}const i=t(n);return e?.(n),i}:t:e}function Iy(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function R1(e,t){return t?e?t+" "+e:t:e}function QU(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const WU={style:{transition:"none"}},ZU="data-base-ui-click-trigger",JU={fallbackAxisSide:"none"},eB={fallbackAxisSide:"end"},tB={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function At(e,t,n={}){const i=t.render,o=nB(t,n);if(n.enabled===!1)return null;const l=n.state??Kt;return sB(e,i,o,l)}function nB(e,t={}){const{className:n,style:i,render:o}=e,{state:l=Kt,ref:u,props:f,stateAttributesMapping:h,enabled:p=!0}=t,y=p?VU(n,l):void 0,v=p?$U(i,l):void 0,b=p?qU(l,h):Kt,x=p?Oy(b,Array.isArray(f)?GU(f):f)??Kt:Kt;return typeof document<"u"&&(p?Array.isArray(u)?x.ref=zU([x.ref,Aw(o),...u]):x.ref=Us(x.ref,Aw(o),u):Us(null,null)),p?(y!==void 0&&(x.className=R1(x.className,y)),v!==void 0&&(x.style=Oy(x.style,v)),x):Kt}const rB=Symbol.for("react.lazy");function sB(e,t,n,i){if(t){if(typeof t=="function")return t(n,i);const o=Li(n,t.props);o.ref=n.ref;let l=t;return l?.$$typeof===rB&&(l=S.Children.toArray(t)[0]),S.cloneElement(l,o)}if(e&&typeof e=="string")return iB(e,n);throw new Error(nn(8))}function iB(e,t){return e==="button"?S.createElement("button",{type:"button",...t,key:t.key}):e==="img"?S.createElement("img",{alt:"",...t,key:t.key}):S.createElement(e,t)}const oB={...dR};let Ow=0;function aB(e,t="mui"){const[n,i]=S.useState(e),o=e||n;return S.useEffect(()=>{n==null&&(Ow+=1,i(`${t}-${Ow}`))},[n,t]),o}const kw=oB.useId;function pu(e,t){if(kw!==void 0){const n=kw();return e??(t?`${t}-${n}`:n)}return aB(e,t)}function tr(e){return pu(e,"base-ui")}function Th(){return typeof window<"u"}function $i(e){return Vv(e)?(e.nodeName||"").toLowerCase():"#document"}function Xt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ss(e){var t;return(t=(Vv(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Vv(e){return Th()?e instanceof Node||e instanceof Xt(e).Node:!1}function Tt(e){return Th()?e instanceof Element||e instanceof Xt(e).Element:!1}function Lt(e){return Th()?e instanceof HTMLElement||e instanceof Xt(e).HTMLElement:!1}function Dy(e){return!Th()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xt(e).ShadowRoot}const lB=new Set(["inline","contents"]);function Gi(e){const{overflow:t,overflowX:n,overflowY:i,display:o}=nr(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!lB.has(o)}const cB=new Set(["table","td","th"]);function uB(e){return cB.has($i(e))}const fB=[":popover-open",":modal"];function Ch(e){return fB.some(t=>{try{return e.matches(t)}catch{return!1}})}const dB=["transform","translate","scale","rotate","perspective"],hB=["transform","translate","scale","rotate","perspective","filter"],pB=["paint","layout","strict","content"];function $v(e){const t=Rh(),n=Tt(e)?nr(e):e;return dB.some(i=>n[i]?n[i]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||hB.some(i=>(n.willChange||"").includes(i))||pB.some(i=>(n.contain||"").includes(i))}function mB(e){let t=Bs(e);for(;Lt(t)&&!As(t);){if($v(t))return t;if(Ch(t))return null;t=Bs(t)}return null}function Rh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const gB=new Set(["html","body","#document"]);function As(e){return gB.has($i(e))}function nr(e){return Xt(e).getComputedStyle(e)}function Nh(e){return Tt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bs(e){if($i(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Dy(e)&&e.host||ss(e);return Dy(t)?t.host:t}function N1(e){const t=Bs(e);return As(t)?e.ownerDocument?e.ownerDocument.body:e.body:Lt(t)&&Gi(t)?t:N1(t)}function Oi(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=N1(e),l=o===((i=e.ownerDocument)==null?void 0:i.body),u=Xt(o);if(l){const f=Ly(u);return t.concat(u,u.visualViewport||[],Gi(o)?o:[],f&&n?Oi(f):[])}return t.concat(o,Oi(o,[],n))}function Ly(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const j1=S.createContext(void 0);function M1(e=!1){const t=S.useContext(j1);if(t===void 0&&!e)throw new Error(nn(16));return t}function yB(e){const{focusableWhenDisabled:t,disabled:n,composite:i=!1,tabIndex:o=0,isNativeButton:l}=e,u=i&&t!==!1,f=i&&t===!1;return{props:S.useMemo(()=>{const p={onKeyDown(y){n&&t&&y.key!=="Tab"&&y.preventDefault()}};return i||(p.tabIndex=o,!l&&n&&(p.tabIndex=t?o:-1)),(l&&(t||u)||!l&&n)&&(p["aria-disabled"]=n),l&&(!t||f)&&(p.disabled=n),p},[i,n,t,u,f,l,o])}}function El(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:i=0,native:o=!0}=e,l=S.useRef(null),u=M1(!0)!==void 0,f=je(()=>{const b=l.current;return!!(b?.tagName==="A"&&b?.href)}),{props:h}=yB({focusableWhenDisabled:n,disabled:t,composite:u,tabIndex:i,isNativeButton:o}),p=S.useCallback(()=>{const b=l.current;vB(b)&&u&&t&&h.disabled===void 0&&b.disabled&&(b.disabled=!1)},[t,h.disabled,u]);De(p,[p]);const y=S.useCallback((b={})=>{const{onClick:x,onMouseDown:E,onKeyUp:_,onKeyDown:T,onPointerDown:C,...M}=b;return Li({type:o?"button":void 0,onClick(N){if(t){N.preventDefault();return}x?.(N)},onMouseDown(N){t||E?.(N)},onKeyDown(N){if(t||(Iy(N),T?.(N)),N.baseUIHandlerPrevented)return;const k=N.target===N.currentTarget&&!o&&!f()&&!t,z=N.key==="Enter",j=N.key===" ";k&&((j||z)&&N.preventDefault(),z&&x?.(N))},onKeyUp(N){t||(Iy(N),_?.(N)),!N.baseUIHandlerPrevented&&N.target===N.currentTarget&&!o&&!t&&N.key===" "&&x?.(N)},onPointerDown(N){if(t){N.preventDefault();return}C?.(N)}},o?void 0:{role:"button"},h,M)},[t,h,o,f]),v=je(b=>{l.current=b,p()});return{getButtonProps:y,buttonRef:v}}function vB(e){return Lt(e)&&e.tagName==="BUTTON"}const A1=S.createContext(void 0);function bB(){const e=S.useContext(A1);if(e===void 0)throw new Error(nn(63));return e}let Iw=(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})({});const jh={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Ki={valid(e){return e===null?null:e?{[Iw.valid]:""}:{[Iw.invalid]:""}}};let Dw=(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})({});const O1={...Ki,checked(e){return e?{[Dw.checked]:""}:{[Dw.unchecked]:""}}};function Py(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const xB=S.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:mn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function _l(){return S.useContext(xB)}const k1=S.createContext({invalid:void 0,name:void 0,validityData:{state:jh,errors:[],error:"",value:"",initialValue:null},setValidityData:mn,disabled:void 0,touched:!1,setTouched:mn,dirty:!1,setDirty:mn,filled:!1,setFilled:mn,focused:!1,setFocused:mn,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Kt)=>e,getInputValidationProps:(e=Kt)=>e,inputRef:{current:null},commit:async()=>{}}});function Yi(e=!0){const t=S.useContext(k1);if(t.setValidityData===mn&&!e)throw new Error(nn(28));return t}function I1(e){const{enabled:t=!0,value:n,id:i,name:o,controlRef:l,commit:u}=e,{formRef:f}=_l(),{invalid:h,markedDirtyRef:p,validityData:y,setValidityData:v}=Yi(),b=je(e.getValue);De(()=>{if(!t)return;let x=n;x===void 0&&(x=b()),y.initialValue===null&&x!==null&&v(E=>({...E,initialValue:x}))},[t,v,n,y.initialValue,b]),De(()=>{!t||!i||f.current.fields.set(i,{getValue:b,name:o,controlRef:l,validityData:Py(y,h),validate(x=!0){let E=n;E===void 0&&(E=b()),p.current=!0,x?Fi.flushSync(()=>u(E)):u(E)}})},[u,l,t,f,b,i,h,p,o,y,n]),De(()=>{const x=f.current.fields;return()=>{i&&x.delete(i)}},[f,i])}const D1=S.createContext({controlId:void 0,registerControlId:mn,labelId:void 0,setLabelId:mn,messageIds:[],setMessageIds:mn,getDescriptionProps:e=>e});function qs(){return S.useContext(D1)}function L1(e={}){const{id:t,implicit:n=!1,controlRef:i}=e,{controlId:o,registerControlId:l}=qs(),u=tr(t),f=n?o:void 0,h=En(()=>Symbol("labelable-control")),p=S.useRef(!1),y=S.useRef(t!=null),v=je(()=>{!p.current||l===mn||(p.current=!1,l(h.current,void 0))});return De(()=>{if(l===mn)return;let b;if(n){const x=i?.current;Tt(x)&&x.closest("label")!=null?b=t??null:b=f??u}else if(t!=null)y.current=!0,b=t;else if(y.current)b=u;else{v();return}if(b===void 0){v();return}p.current=!0,l(h.current,b)},[t,i,f,l,n,u,h,v]),S.useEffect(()=>v,[v]),o??u}const Pi="none",Lw="trigger-press",zy="trigger-hover",P1="outside-press",Ig="item-press",z1="focus-out",SB="escape-key",EB="cancel-open",_B="imperative-action",wB="window-resize";function Pt(e,t,n,i){let o=!1,l=!1;const u=i??Kt;return{reason:e,event:t??new Event("base-ui"),cancel(){o=!0},allowPropagation(){l=!0},get isCanceled(){return o},get isPropagationAllowed(){return l},trigger:n,...u}}function U1(e,t){const n=S.useRef(e),i=je(t);De(()=>{n.current!==e&&i(n.current)},[e,i]),De(()=>{n.current=e},[e])}const TB=S.forwardRef(function(t,n){const{checked:i,className:o,defaultChecked:l,id:u,inputRef:f,name:h,nativeButton:p=!1,onCheckedChange:y,readOnly:v=!1,required:b=!1,disabled:x=!1,render:E,uncheckedValue:_,value:T,...C}=t,{clearErrors:M}=_l(),{state:R,setTouched:N,setDirty:k,validityData:z,setFilled:j,setFocused:A,shouldValidateOnChange:D,validationMode:G,disabled:F,name:P,validation:Q}=Yi(),{labelId:X}=qs(),te=F||x,L=P??h,$=je(y),H=S.useRef(null),V=Us(H,f,Q.inputRef),U=S.useRef(null),I=tr(),K=L1({id:u,implicit:!1,controlRef:U}),Z=p?void 0:K,[W,se]=_h({controlled:i,default:!!l,name:"Switch",state:"checked"});I1({id:I,commit:Q.commit,value:W,controlRef:U,name:L,getValue:()=>W}),De(()=>{H.current&&j(H.current.checked)},[H,j]),U1(W,()=>{M(L),k(W!==z.initialValue),j(W),D()?Q.commit(W):Q.commit(W,!0)});const{getButtonProps:ie,buttonRef:he}=El({disabled:te,native:p}),xe={id:p?K:I,role:"switch","aria-checked":W,"aria-readonly":v||void 0,"aria-required":b||void 0,"aria-labelledby":X,onFocus(){te||A(!0)},onBlur(){const re=H.current;!re||te||(N(!0),A(!1),G==="onBlur"&&Q.commit(re.checked))},onClick(re){v||te||(re.preventDefault(),H.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:re.shiftKey,ctrlKey:re.ctrlKey,altKey:re.altKey,metaKey:re.metaKey})))}},de=S.useMemo(()=>Li({checked:W,disabled:te,id:Z,name:L,required:b,style:L?T1:wh,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:V,onChange(re){if(re.nativeEvent.defaultPrevented)return;const fe=re.target.checked,ae=Pt(Pi,re.nativeEvent);$?.(fe,ae),!ae.isCanceled&&se(fe)},onFocus(){U.current?.focus()}},Q.getInputValidationProps,T!==void 0?{value:T}:Kt),[W,te,V,Z,L,$,b,se,Q,T]),Be=S.useMemo(()=>({...R,checked:W,disabled:te,readOnly:v,required:b}),[R,W,te,v,b]),_e=At("span",t,{state:Be,ref:[n,U,he],props:[xe,Q.getValidationProps,C,ie],stateAttributesMapping:O1});return d.jsxs(A1.Provider,{value:Be,children:[_e,!W&&L&&_!==void 0&&d.jsx("input",{type:"hidden",name:L,value:_}),d.jsx("input",{...de})]})}),CB=S.forwardRef(function(t,n){const{render:i,className:o,...l}=t,{state:u}=Yi(),f=bB(),h={...u,...f};return At("span",t,{state:h,ref:n,stateAttributesMapping:O1,props:l})}),Mh=S.forwardRef(({className:e,...t},n)=>d.jsx(TB,{ref:n,className:me("relative w-[34px] h-[18px] bg-border-bright rounded-full cursor-pointer transition data-[checked]:bg-healthy",e),...t,children:d.jsx(CB,{className:"block w-[14px] h-[14px] bg-white rounded-full transition-transform data-[checked]:translate-x-4 absolute top-0.5 left-0.5"})}));Mh.displayName="Switch";const B1=S.forwardRef(({className:e,enabled:t=!0,onEnabledChange:n,thresholds:i,onThresholdsChange:o,...l},u)=>{function f(h,p){const y=Number(p);Number.isFinite(y)&&o?.({...i,[h]:y})}return d.jsxs("div",{ref:u,className:me("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...l,children:[d.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-offline"}),d.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Alerts"})]}),d.jsx(Mh,{checked:t,onCheckedChange:h=>n?.(h)})]}),d.jsxs("div",{className:"p-4 space-y-3",children:[d.jsx(Dg,{label:"P90 latency threshold",value:i.p90Latency,onChange:h=>f("p90Latency",h)}),d.jsx(Dg,{label:"Error rate threshold",value:i.errorRate,onChange:h=>f("errorRate",h)}),d.jsx(Dg,{label:"Client lag threshold",value:i.clientLag,onChange:h=>f("clientLag",h)})]})]})});B1.displayName="AlertsConfig";function Dg({label:e,value:t,onChange:n}){return d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:e}),d.jsx(An,{variant:"mono",type:"number",value:t,onChange:i=>n(i.target.value),className:"w-[100px] text-[11px] px-2 py-1 text-right"})]})}const RB=Vi("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"}}),en=S.forwardRef(({className:e,variant:t,style:n,...i},o)=>d.jsx("span",{ref:o,className:me(RB({variant:t,className:e})),style:{lineHeight:1,...n},...i}));en.displayName="Badge";const wl=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,role:"table",className:me("w-full",e),...t}));wl.displayName="Table";const Tl=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,role:"rowgroup",className:me(e),...t}));Tl.displayName="TableHeader";const Cl=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,role:"rowgroup",className:me(e),...t}));Cl.displayName="TableBody";const Br=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,role:"row",className:me("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}));Br.displayName="TableRow";const ut=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,role:"columnheader",className:me("min-w-0 font-mono text-[9px] text-neutral-600 uppercase tracking-wider leading-6 bg-white/[0.01] text-left truncate",e),...t}));ut.displayName="TableHead";const ft=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,role:"cell",className:me("min-w-0 whitespace-nowrap overflow-hidden text-ellipsis",e),...t}));ft.displayName="TableCell";const NB={relay:"relay",admin:"flow",proxy:"ghost"},jB=S.forwardRef(({className:e,keys:t,onCreateKey:n,onRotateKey:i,onRevokeKey:o,...l},u)=>d.jsx("div",{ref:u,className:me("w-full",e),...l,children:d.jsxs(wl,{children:[d.jsx(Tl,{children:d.jsxs(Br,{children:[d.jsx(ut,{children:"Name"}),d.jsx(ut,{children:"Type"}),d.jsx(ut,{children:"Prefix"}),d.jsx(ut,{children:"Created"})]})}),d.jsx(Cl,{children:t.map((f,h)=>d.jsxs(Br,{className:"group relative",children:[d.jsx(ft,{children:d.jsx("span",{className:"text-white truncate",children:f.name})}),d.jsx(ft,{children:d.jsx(en,{variant:NB[f.type]??"ghost",children:f.type})}),d.jsx(ft,{children:d.jsx("span",{className:"text-neutral-500 truncate",children:f.prefix})}),d.jsx(ft,{children:d.jsx("span",{className:"text-neutral-600 truncate",children:f.created})}),(i||o)&&d.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:[i&&d.jsx("button",{type:"button",onClick:()=>i(f.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"}),o&&d.jsx("button",{type:"button",onClick:()=>o(f.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"})]})]},`${f.name}:${f.prefix}:${h}`))})]})}));jB.displayName="ApiKeysTable";const H1=S.forwardRef(({className:e,metrics:t=[],uptime:n,isLive:i=!0,...o},l)=>d.jsxs("div",{ref:l,className:me("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),...o,children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"flex items-center gap-[2px]",children:[0,.1,.2,.3,.4].map(u=>d.jsx("div",{className:"w-0.5 h-1.5 bg-healthy rounded-sm animate-[heartbeat_1.2s_ease-in-out_infinite]",style:{animationDelay:`${u}s`}},u))}),i&&d.jsx("span",{className:"font-mono text-[9px] text-healthy uppercase tracking-widest",children:"Live"})]}),d.jsx("div",{className:"flex items-center gap-6",children:t.map(u=>d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:u.label}),d.jsx("span",{className:"font-mono text-[10px] text-neutral-300",children:u.value})]},u.label))}),n!=null&&d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:"UPTIME"}),d.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:n})]})]}));H1.displayName="BottomBar";const F1=S.forwardRef(({className:e,commits:t,onViewAll:n,...i},o)=>d.jsxs("div",{ref:o,className:me("px-5 pt-3 pb-2",e),...i,children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Recent Commits"}),n&&d.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 →"})]}),d.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:[d.jsx("span",{className:"w-[60px] truncate",children:"Seq"}),d.jsx("span",{className:"w-[100px] truncate",children:"Actor"}),d.jsx("span",{className:"w-[50px] truncate",children:"Chg"}),d.jsx("span",{className:"flex-1 truncate",children:"Tables"}),d.jsx("span",{className:"w-[70px] text-right truncate",children:"Time"})]}),t.map(l=>d.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:[d.jsxs("span",{className:"w-[60px] text-flow font-medium truncate",children:["#",l.seq]}),d.jsx("span",{className:"w-[100px] text-neutral-400 truncate",children:l.actor}),d.jsx("span",{className:"w-[50px] text-white truncate",children:l.changes}),d.jsx("span",{className:"flex-1 truncate",children:d.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:l.tables})}),d.jsx("span",{className:"w-[70px] text-right text-neutral-600 truncate",children:l.time})]},l.seq))]}));F1.displayName="CommitTable";const q1=Vi("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"}}),Ae=S.forwardRef(({className:e,variant:t,size:n,...i},o)=>d.jsx("button",{ref:o,className:me(q1({variant:t,size:n,className:e})),...i}));Ae.displayName="Button";const V1=S.forwardRef(({className:e,isConnected:t=!1,isConnecting:n=!1,isTestingConnection:i=!1,serverUrl:o,onServerUrlChange:l,consoleToken:u,onConsoleTokenChange:f,onSaveAndConnect:h,onDisconnect:p,onTestConnection:y,statusMessage:v,...b},x)=>d.jsxs("div",{ref:x,className:me("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...b,children:[d.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:me("w-1.5 h-1.5 rounded-full",t?"bg-healthy":"bg-offline"),style:t?{boxShadow:"0 0 4px #22c55e"}:void 0}),d.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Connection"})]}),d.jsx(en,{variant:t?"healthy":"offline",children:t?"Connected":"Disconnected"})]}),d.jsxs("div",{className:"p-5 space-y-4",children:[d.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"Configure the server endpoint and authentication token."}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"console-server-url",className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",children:"Server URL"}),d.jsx(An,{id:"console-server-url",variant:"mono",value:o,onChange:E=>l?.(E.target.value)})]}),d.jsxs("div",{children:[d.jsx("label",{htmlFor:"console-token",className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",children:"Console Token"}),d.jsx(An,{id:"console-token",variant:"mono",type:"password",value:u,onChange:E=>f?.(E.target.value)})]}),d.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[d.jsx(Ae,{variant:"primary",size:"md",onClick:h,disabled:n,children:n?"Connecting...":"Save + Connect"}),d.jsx(Ae,{variant:"default",size:"md",onClick:y,disabled:n||i,children:i?"Testing...":"Test Connection"}),d.jsx(Ae,{variant:"destructive",size:"md",onClick:p,disabled:!t,children:"Disconnect"})]}),v&&d.jsx("div",{className:me("font-mono text-[10px]",t?"text-healthy":"text-offline"),children:v})]})]}));V1.displayName="ConnectionForm";const MB=Vi("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"}}),Mt=S.forwardRef(({className:e,size:t,...n},i)=>d.jsxs("svg",{ref:i,className:me(MB({size:t,className:e})),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...n,children:[d.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),d.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"})]}));Mt.displayName="Spinner";function AB({className:e,state:t}){switch(t){case"connected":return d.jsx(en,{variant:"healthy",className:e,children:"Connected"});case"disconnected":return d.jsx(en,{variant:"destructive",className:e,children:"Disconnected"});case"connecting":return d.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-neutral-400",children:[d.jsx(Mt,{size:"sm"}),"Connecting"]});case"not-configured":return d.jsx(en,{variant:"ghost",className:e,children:"Not configured"})}}const Gv=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:me("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...t}));Gv.displayName="Card";const OB=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:me("px-4 py-2.5 border-b border-border flex items-center justify-between",e),...t}));OB.displayName="CardHeader";const kB=S.forwardRef(({className:e,...t},n)=>d.jsx("h3",{ref:n,className:me("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));kB.displayName="CardTitle";const Kv=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:me("p-4",e),...t}));Kv.displayName="CardContent";const IB=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:me("px-4 py-2.5 border-t border-border",e),...t}));IB.displayName="CardFooter";function Yv({action:e,className:t,icon:n,message:i}){return d.jsxs("div",{className:me("flex flex-col items-center justify-center gap-3 py-12",t),children:[n?d.jsx("div",{className:"text-neutral-500",children:n}):null,d.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:i}),e?d.jsx("div",{children:e}):null]})}const $1=S.forwardRef(({className:e,groups:t,searchValue:n,searchPlaceholder:i="Filter by client or actor...",onSearchChange:o,actions:l,...u},f)=>d.jsxs("div",{ref:f,className:me("px-5 py-3 border-b border-border flex items-center gap-4 flex-wrap",e),...u,children:[t.map((h,p)=>d.jsx(DB,{group:h,showDivider:p>0},p)),o!==void 0&&d.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:i,value:n,onChange:h=>o(h.target.value)}),l&&d.jsx("div",{className:"ml-auto flex items-center gap-2",children:l})]}));$1.displayName="FilterBar";function DB({group:e,showDivider:t}){return d.jsxs(d.Fragment,{children:[t&&d.jsx("div",{className:"w-px h-4 bg-border"}),d.jsxs("div",{className:"flex items-center gap-1",children:[e.label&&d.jsx("span",{className:"font-mono text-[9px] text-neutral-500 mr-1",children:e.label}),e.options.map(n=>d.jsx("button",{type:"button",onClick:()=>e.onActiveChange(n.id),className:me("font-mono text-[10px] border rounded-sm px-2.5 py-0.5 cursor-pointer transition-all",n.id===e.activeId?"text-white border-border-bright bg-white/[0.03]":"text-neutral-500 border-transparent hover:text-neutral-300"),children:n.label},n.id))]})]})}function LB(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const PB={online:"healthy",syncing:"syncing",offline:"offline"},zB={realtime:"flow",polling:"ghost"},UB=S.forwardRef(({className:e,client:t,headSeq:n,onEvict:i,...o},l)=>{const u=Math.max(0,n-t.cursor),f=Math.min(100,t.cursor/n*100),h=LB(u);return d.jsxs("div",{ref:l,className:me("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),style:{borderLeft:`3px solid ${h}`},...o,children:[d.jsxs("div",{className:"px-3.5 py-2 border-b border-border flex items-center justify-between",children:[d.jsx("div",{className:"flex items-center gap-2 min-w-0",children:d.jsx("span",{className:"font-mono text-[11px] text-white truncate",title:t.id,children:t.id.length>14?`${t.id.substring(0,14)}…`:t.id})}),d.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[d.jsx(en,{variant:PB[t.status],children:t.status}),d.jsx(en,{variant:zB[t.mode],children:t.mode})]})]}),d.jsxs("div",{className:"p-3 space-y-3",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-1",children:[d.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["#",t.cursor.toLocaleString()]}),d.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["#",n.toLocaleString()]})]}),d.jsx("div",{className:"h-1 rounded-full bg-surface",children:d.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${f}%`,background:h}})}),d.jsx("div",{className:"font-mono text-[9px] mt-1",style:{color:h},children:u===0?"Caught up":`${u} behind`})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx(Lg,{label:"Actor",value:t.actor}),d.jsx(Lg,{label:"Dialect",value:t.dialect}),d.jsx(Lg,{label:"Last seen",value:t.lastSeen}),d.jsxs("div",{className:"flex justify-between items-start",children:[d.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:"Scopes"}),d.jsxs("div",{className:"flex gap-1 flex-wrap justify-end",children:[t.scopes.slice(0,2).map(p=>d.jsx(en,{variant:"ghost",children:p},p)),t.scopes.length>2&&d.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["+",t.scopes.length-2]})]})]})]}),i&&d.jsxs("button",{type:"button",onClick:i,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:[d.jsxs("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:[d.jsx("path",{d:"M18.36 6.64a9 9 0 11-12.73 0"}),d.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]}),"Evict"]})]})]})});UB.displayName="FleetCard";function Lg({label:e,value:t}){return d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:e}),d.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:t})]})}const G1=(...e)=>e.filter((t,n,i)=>!!t&&t.trim()!==""&&i.indexOf(t)===n).join(" ").trim();const BB=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const HB=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,i)=>i?i.toUpperCase():n.toLowerCase());const Pw=e=>{const t=HB(e);return t.charAt(0).toUpperCase()+t.slice(1)};var FB={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"};const qB=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const VB=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:i,className:o="",children:l,iconNode:u,...f},h)=>S.createElement("svg",{ref:h,...FB,width:t,height:t,stroke:e,strokeWidth:i?Number(n)*24/Number(t):n,className:G1("lucide",o),...!l&&!qB(f)&&{"aria-hidden":"true"},...f},[...u.map(([p,y])=>S.createElement(p,y)),...Array.isArray(l)?l:[l]]));const Xv=(e,t)=>{const n=S.forwardRef(({className:i,...o},l)=>S.createElement(VB,{ref:l,iconNode:t,className:G1(`lucide-${BB(Pw(e))}`,`lucide-${e}`,i),...o}));return n.displayName=Pw(e),n};const $B=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],GB=Xv("arrow-left",$B);const KB=[["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"}]],YB=Xv("settings",KB);const XB=[["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"}]],QB=Xv("user-x",XB);function WB(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const ZB={online:"healthy",syncing:"syncing",offline:"offline"},K1=S.forwardRef(({className:e,clients:t,headSeq:n,onEvict:i,...o},l)=>d.jsx("div",{ref:l,className:me("w-full",e),...o,children:d.jsxs(wl,{children:[d.jsx(Tl,{children:d.jsxs(Br,{children:[d.jsx(ut,{className:"w-[160px]",children:"Client"}),d.jsx(ut,{className:"w-[70px]",children:"Status"}),d.jsx(ut,{className:"w-[60px]",children:"Type"}),d.jsx(ut,{className:"w-[80px]",children:"Cursor"}),d.jsx(ut,{className:"w-[110px]",children:"Lag"}),d.jsx(ut,{className:"w-[60px]",children:"Dialect"}),d.jsx(ut,{className:"flex-1",children:"Mode"})]})}),d.jsx(Cl,{children:t.map(u=>{const f=Math.max(0,n-u.cursor),h=n>0?Math.min(100,u.cursor/n*100):100,p=WB(f);return d.jsxs(Br,{className:"group relative",children:[d.jsx(ft,{className:"w-[160px]",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:p,boxShadow:`0 0 4px ${p}`}}),d.jsx("span",{className:"font-mono text-[11px] text-white truncate",title:u.id,children:u.id.length>18?`${u.id.substring(0,18)}…`:u.id})]})}),d.jsx(ft,{className:"w-[70px]",children:d.jsx(en,{variant:ZB[u.status],children:u.status})}),d.jsx(ft,{className:"w-[60px]",children:d.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:u.type})}),d.jsx(ft,{className:"w-[80px]",children:d.jsxs("span",{className:"font-mono text-[11px] text-white font-medium",children:["#",u.cursor.toLocaleString()]})}),d.jsx(ft,{className:"w-[110px]",children:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"w-[60px] h-[3px] rounded-full bg-surface overflow-hidden",children:d.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${h}%`,background:p}})}),d.jsx("span",{className:"font-mono text-[10px] font-medium",style:{color:p},children:f===0?"0":`${f}`})]})}),d.jsx(ft,{className:"w-[60px]",children:d.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:u.dialect})}),d.jsx(ft,{className:"flex-1",children:d.jsx(en,{variant:u.mode==="realtime"?"flow":"ghost",children:u.mode})}),i&&d.jsxs("button",{type:"button",title:"Evict client",onClick:()=>i(u.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:[d.jsx(QB,{size:10}),"evict"]})]},u.id)})})]})}));K1.displayName="FleetTable";const Y1=S.forwardRef(({className:e,handlers:t,tableCount:n,...i},o)=>{const l=n??t.length;return d.jsxs("div",{ref:o,className:me("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...i,children:[d.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-flow"}),d.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Handlers"})]}),d.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[l," tables"]})]}),d.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:[d.jsx("span",{className:"flex-1",children:"Table"}),d.jsx("span",{className:"w-[100px]",children:"Depends On"}),d.jsx("span",{className:"w-[70px] text-right",children:"Chunk TTL"})]}),t.map((u,f)=>d.jsxs("div",{className:me("font-mono text-[11px] leading-7 px-4 flex items-center gap-4 hover:bg-white/[0.015] transition-colors cursor-default",f<t.length-1&&"border-b border-[#141414]"),children:[d.jsx("span",{className:"flex-1 text-white truncate",children:u.table}),d.jsx("span",{className:"w-[100px] truncate",children:u.dependsOn?d.jsx(en,{variant:"ghost",children:u.dependsOn}):d.jsx("span",{className:"text-neutral-600",children:"—"})}),d.jsx("span",{className:"w-[70px] text-right text-neutral-500 truncate",children:u.chunkTtl})]},`${u.table}:${f}`))]})});Y1.displayName="HandlersTable";const JB={flow:"bg-flow",healthy:"bg-healthy",syncing:"bg-syncing",offline:"bg-offline",relay:"bg-relay",muted:"bg-neutral-500"},X1=S.forwardRef(({className:e,items:t,...n},i)=>d.jsx("div",{ref:i,className:me("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((o,l)=>d.jsx(eH,{item:o,showDivider:l>0},o.label))}));X1.displayName="KpiStrip";function eH({item:e,showDivider:t}){const n=JB[e.color??"muted"]??"bg-neutral-500";return d.jsxs(d.Fragment,{children:[t&&d.jsx("div",{className:"w-px h-4 bg-border"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:me("w-1.5 h-1.5 rounded-full",n)}),d.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase",children:e.label}),d.jsxs("span",{className:"font-mono text-sm text-white font-semibold",children:[e.value,e.unit&&d.jsx("span",{className:"text-xs text-neutral-600",children:e.unit})]}),e.trend&&d.jsx("span",{className:me("font-mono text-[10px]",e.trend.startsWith("+")?"text-healthy":"text-offline"),children:e.trend})]})]})}const Q1=S.forwardRef(({className:e,buckets:t,successRate:n=99.6,successLabel:i="success",...o},l)=>{const u=n/100*88,f=88-u;return d.jsxs("div",{ref:l,className:me("px-5 py-3 border-b border-border flex items-center gap-8",e),...o,children:[d.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Latency"}),d.jsx("div",{className:"flex items-center gap-6",children:t.map(h=>d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:h.label}),d.jsxs("div",{className:"flex gap-1 items-end h-5",children:[d.jsx("div",{className:"w-3 rounded-t bg-healthy/60",style:{height:`${h.pushBarPercent}%`}}),d.jsx("div",{className:"w-3 rounded-t bg-flow/60",style:{height:`${h.pullBarPercent}%`}})]}),d.jsxs("span",{className:"font-mono text-[10px] text-neutral-400",children:[h.pushMs," / ",h.pullMs,"ms"]})]},h.label))}),d.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[d.jsxs("svg",{viewBox:"0 0 36 36",className:"w-7 h-7",children:[d.jsx("circle",{cx:18,cy:18,r:14,fill:"none",stroke:"#1e1e1e",strokeWidth:4}),d.jsx("circle",{cx:18,cy:18,r:14,fill:"none",stroke:"#22c55e",strokeWidth:4,strokeDasharray:`${u} ${f}`,transform:"rotate(-90 18 18)",strokeLinecap:"round"})]}),d.jsxs("span",{className:"font-mono text-[10px] text-neutral-400",children:[n,"%"," ",d.jsx("span",{className:"text-neutral-600",children:i})]})]})]})});Q1.displayName="LatencyPercentilesBar";const tH={PUSH:"syncing",PULL:"healthy",ACK:"flow"},W1=S.forwardRef(({className:e,entries:t,isConnected:n=!0,maxVisible:i=20,maxHeight:o,...l},u)=>{const f=t.slice(0,i);return d.jsxs("div",{ref:u,className:me("flex-shrink-0",e),style:{width:360},...l,children:[d.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Live Feed"}),d.jsx("span",{className:me("w-1.5 h-1.5 rounded-full",n?"bg-healthy animate-[dotPulse_1.5s_ease-in-out_infinite]":"bg-neutral-600")})]}),d.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:n?"WebSocket":"Disconnected"})]}),d.jsx("div",{className:"px-3 py-2 space-y-0.5 overflow-y-auto",style:o?{maxHeight:o}:void 0,children:f.length===0?d.jsx("div",{className:"flex items-center justify-center h-[200px]",children:d.jsx("p",{className:"text-neutral-500 text-sm font-mono",children:n?"Waiting for activity...":"Connect to see live activity"})}):f.map((h,p)=>d.jsxs("div",{className:"flex items-center gap-2 py-1 animate-[streamSlide_0.35s_ease-out]",children:[d.jsx(en,{variant:tH[h.type]??"ghost",className:"text-[8px] px-1.5 py-0",children:h.type}),d.jsxs("span",{className:"font-mono text-[10px] text-neutral-400 truncate flex-1",children:[h.actor," · ",h.table]}),d.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:h.time})]},`${h.time}-${p}`))})]})});W1.displayName="LiveActivityFeed";const nH={syncing:"bg-syncing",flow:"bg-flow",healthy:"bg-healthy",offline:"bg-offline"},Ah=S.forwardRef(({className:e,title:t,description:n,dotColor:i="syncing",stats:o,actionLabel:l,actionVariant:u="default",actionIcon:f,onAction:h,...p},y)=>d.jsxs("div",{ref:y,className:me("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...p,children:[d.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center gap-2",children:[d.jsx("span",{className:me("w-1.5 h-1.5 rounded-full",nH[i])}),d.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:t})]}),d.jsxs("div",{className:"p-4",children:[d.jsx("p",{className:"font-mono text-[10px] text-neutral-500 leading-relaxed mb-4",children:n}),d.jsx("div",{className:me("grid gap-3 mb-4",o.length<=2?"grid-cols-2":"grid-cols-3"),children:o.map(v=>d.jsxs("div",{children:[d.jsx("div",{className:"font-mono text-[9px] text-neutral-600 uppercase tracking-wider mb-1",children:v.label}),d.jsx("div",{className:me("font-mono font-semibold",v.tone==="syncing"?"text-sm text-syncing":"text-lg text-white"),children:v.value})]},v.label))}),d.jsxs(Ae,{variant:u,size:"md",onClick:h,children:[f,l]})]})]}));Ah.displayName="MaintenanceCard";function rH({actions:e,children:t,className:n,contentClassName:i,description:o,title:l}){return d.jsxs(Gv,{className:me("border-border",n),children:[l||e?d.jsxs("div",{className:"flex items-start justify-between px-4 pt-4",children:[d.jsxs("div",{children:[l?d.jsx("h3",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:l}):null,o?d.jsx("p",{className:"mt-1 font-mono text-[10px] text-neutral-500",children:o}):null]}),e?d.jsx("div",{className:"flex items-center gap-2",children:e}):null]}):null,d.jsx(Kv,{className:i,children:t})]})}const Z1=S.forwardRef(({className:e,rows:t,onResetDefaults:n,...i},o)=>d.jsxs("div",{ref:o,className:me("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...i,children:[d.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Preferences"}),n&&d.jsx(Ae,{variant:"default",size:"sm",onClick:n,children:"Reset defaults"})]}),d.jsx("div",{className:"p-4 space-y-4",children:t.map((l,u)=>d.jsx(sH,{row:l,showDivider:u>0},l.label))})]}));Z1.displayName="PreferencesPanel";function sH({row:e,showDivider:t}){return d.jsxs(d.Fragment,{children:[t&&d.jsx("div",{className:"border-t border-border"}),d.jsx("div",{className:"flex items-center justify-between",children:e.type==="filter"?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:e.label}),d.jsx("div",{className:"flex gap-0.5",children:e.options.map(n=>d.jsx("button",{type:"button",onClick:()=>e.onActiveChange(n.id),className:me("font-mono text-[10px] border rounded-sm px-2.5 py-0.5 cursor-pointer transition-all",n.id===e.activeId?"text-white border-border-bright bg-white/[0.03]":"text-neutral-500 border-transparent hover:text-neutral-300"),children:n.label},n.id))})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:e.label}),e.description&&d.jsx("p",{className:"font-mono text-[9px] text-neutral-600 mt-0.5",children:e.description})]}),d.jsx(Mh,{checked:e.checked,onCheckedChange:n=>e.onCheckedChange(n)})]})})]})}function Qv({actions:e,children:t,className:n,contentClassName:i,description:o,title:l}){return d.jsxs(Gv,{className:n,children:[l||e?d.jsxs("div",{className:"flex items-start justify-between px-4 pt-4",children:[d.jsxs("div",{children:[l?d.jsx("h3",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:l}):null,o?d.jsx("p",{className:"mt-1 font-mono text-[10px] text-neutral-500",children:o}):null]}),e?d.jsx("div",{className:"flex items-center gap-2",children:e}):null]}):null,d.jsx(Kv,{className:i,children:t})]})}const iH={commit:"text-flow",push:"text-syncing",pull:"text-healthy"},oH={applied:"text-healthy",error:"text-offline",cached:"text-syncing"},J1=S.forwardRef(({className:e,entries:t,filterBar:n,pagination:i,onEntryClick:o,selectedEntryId:l,...u},f)=>d.jsxs("div",{ref:f,className:me("h-full flex flex-col",e),...u,children:[n,d.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:[d.jsx("span",{className:"w-[50px] truncate",children:"Time"}),d.jsx("span",{className:"w-[65px] truncate",children:"Type"}),d.jsx("span",{className:"w-[55px] truncate",children:"ID"}),d.jsx("span",{className:"w-[65px] truncate",children:"Outcome"}),d.jsx("span",{className:"w-[50px] truncate",children:"Dur"}),d.jsx("span",{className:"w-[100px] truncate",children:"Actor"}),d.jsx("span",{className:"w-[120px] truncate",children:"Client"}),d.jsx("span",{className:"flex-1 truncate",children:"Detail"})]}),d.jsx("div",{className:"flex-1 overflow-y-auto",children:t.map((h,p)=>d.jsx(aH,{entry:h,isSelected:l===h.id,onClick:o},`${h.id}-${p}`))}),i]}));J1.displayName="StreamLog";function aH({entry:e,isSelected:t,onClick:n}){const i=iH[e.type]??"text-neutral-500",o=oH[e.outcome]??"text-neutral-600",l=me("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]"),u=d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"w-[50px] text-neutral-600 truncate",children:e.time}),d.jsx("span",{className:me("w-[65px] font-medium truncate",i),children:e.type.toUpperCase()}),d.jsx("span",{className:"w-[55px] text-flow truncate",children:e.id}),d.jsx("span",{className:me("w-[65px] truncate",o),children:e.outcome}),d.jsx("span",{className:"w-[50px] text-neutral-500 truncate",children:e.duration}),d.jsx("span",{className:"w-[100px] text-neutral-400 truncate",children:e.actor}),d.jsx("span",{className:"w-[120px] text-neutral-600 truncate",title:e.client,children:e.client.length>14?`${e.client.substring(0,14)}…`:e.client}),d.jsx("span",{className:"flex-1 text-neutral-500 truncate",children:e.detail})]});return n?d.jsx("button",{type:"button",className:me(l,"w-full bg-transparent text-left"),onClick:()=>n(e),children:u}):d.jsx("div",{className:l,children:u})}function lH(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const eN=S.forwardRef(({className:e,clients:t,headSeq:n,maxLag:i,minSeq:o,...l},u)=>{const f=t.map(b=>b.cursor),h=o??Math.min(...f,n)-10,p=i??Math.max(...t.map(b=>n-b.cursor),0),y=n-h,v=[h,Math.round(h+y*.33),Math.round(h+y*.66),n];return d.jsxs("div",{ref:u,className:me("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...l,children:[d.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[d.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Sync Horizon"}),d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:"Head"}),d.jsxs("span",{className:"font-mono text-xs text-white font-semibold",children:["#",n.toLocaleString()]})]}),d.jsx("div",{className:"w-px h-3 bg-border"}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:"Max lag"}),d.jsx("span",{className:"font-mono text-xs text-syncing font-semibold",children:p})]})]})]}),d.jsxs("div",{className:"p-4",children:[d.jsxs("div",{className:"relative h-8 mb-3 rounded bg-surface",children:[d.jsx("div",{className:"absolute inset-0 flex items-center justify-between px-2",children:v.map(b=>d.jsxs("span",{className:"font-mono text-[8px] text-neutral-700",children:["#",b.toLocaleString()]},b))}),d.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-flow/40",style:{right:"2%"}}),t.map(b=>{const x=y>0?(b.cursor-h)/y*96+2:50,E=lH(b.status),_=b.status==="offline"?.4:1;return d.jsx("div",{className:"absolute",style:{left:`${x}%`,top:"50%",transform:"translate(-50%,-50%)",opacity:_},title:`${b.id} → #${b.cursor}`,children:d.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{background:E,boxShadow:`0 0 4px ${E}`}})},b.id)})]}),d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"w-2 h-2 rounded-full bg-healthy"}),d.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Caught up"})]}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"w-2 h-2 rounded-full bg-syncing"}),d.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Behind"})]}),d.jsxs("div",{className:"flex items-center gap-1.5",children:[d.jsx("span",{className:"w-2 h-2 rounded-full bg-offline opacity-50"}),d.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Offline"})]})]})]})]})});eN.displayName="SyncHorizon";function cH(e){const t=S.useRef(!0);t.current&&(t.current=!1,e())}const uH=S.createContext(void 0);function Wv(e){const t=S.useContext(uH);if(t===void 0)throw new Error(nn(72));return t}const fH=[];function Zv(e){S.useEffect(e,fH)}const Nc=0;class zi{static create(){return new zi}currentId=Nc;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Nc,n()},t)}isStarted(){return this.currentId!==Nc}clear=()=>{this.currentId!==Nc&&(clearTimeout(this.currentId),this.currentId=Nc)};disposeEffect=()=>this.clear}function zr(){const e=En(zi.create).current;return Zv(e.disposeEffect),e}function ki(e){const t=En(dH,e).current;return t.next=e,De(t.effect),t}function dH(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function _t(e){return e?.ownerDocument||document}const Rl=typeof navigator<"u",Pg=mH(),tN=yH(),nN=gH(),Jv=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),rN=Pg.platform==="MacIntel"&&Pg.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Pg.platform),hH=Rl&&/apple/i.test(navigator.vendor),Uy=Rl&&/android/i.test(tN)||/android/i.test(nN);Rl&&tN.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const pH=nN.includes("jsdom/");function mH(){if(!Rl)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function gH(){if(!Rl)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function yH(){if(!Rl)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const By="data-base-ui-focusable",sN="active",iN="selected",oN="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",zg="ArrowLeft",Ug="ArrowRight",vH="ArrowUp",bH="ArrowDown";function Si(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Rt(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Dy(n)){let i=t;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function xH(e,t){if(!Tt(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,i]of t.entries())if(Rt(i,n))return!i.hasAttribute("data-trigger-disabled");return!1}function Sr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ir(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function SH(e){return e.matches("html,body")}function aN(e){return Lt(e)&&e.matches(oN)}function zw(e){return e?e.getAttribute("role")==="combobox"&&aN(e):!1}function Zd(e){return e?e.hasAttribute(By)?e:e.querySelector(`[${By}]`)||e:null}function Ga(e,t,n=!0){return e.filter(o=>o.parentId===t&&(!n||o.context?.open)).flatMap(o=>[o,...Ga(e,o.id,n)])}function Uw(e,t){let n=[],i=e.find(o=>o.id===t)?.parentId;for(;i;){const o=e.find(l=>l.id===i);i=o?.parentId,o&&(n=n.concat(o))}return n}function So(e){e.preventDefault(),e.stopPropagation()}function EH(e){return"nativeEvent"in e}function _H(e){return e.pointerType===""&&e.isTrusted?!0:Uy&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function wH(e){return pH?!1:!Uy&&e.width===0&&e.height===0||Uy&&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 TH(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function CH(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const RH=["top","right","bottom","left"],ll=Math.min,Yn=Math.max,Jd=Math.round,Ba=Math.floor,ns=e=>({x:e,y:e}),NH={left:"right",right:"left",bottom:"top",top:"bottom"},jH={start:"end",end:"start"};function Hy(e,t,n){return Yn(e,ll(t,n))}function Hs(e,t){return typeof e=="function"?e(t):e}function On(e){return e.split("-")[0]}function Xi(e){return e.split("-")[1]}function eb(e){return e==="x"?"y":"x"}function tb(e){return e==="y"?"height":"width"}const MH=new Set(["top","bottom"]);function wr(e){return MH.has(On(e))?"y":"x"}function nb(e){return eb(wr(e))}function AH(e,t,n){n===void 0&&(n=!1);const i=Xi(e),o=nb(e),l=tb(o);let u=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(u=eh(u)),[u,eh(u)]}function OH(e){const t=eh(e);return[Fy(e),t,Fy(t)]}function Fy(e){return e.replace(/start|end/g,t=>jH[t])}const Bw=["left","right"],Hw=["right","left"],kH=["top","bottom"],IH=["bottom","top"];function DH(e,t,n){switch(e){case"top":case"bottom":return n?t?Hw:Bw:t?Bw:Hw;case"left":case"right":return t?kH:IH;default:return[]}}function LH(e,t,n,i){const o=Xi(e);let l=DH(On(e),n==="start",i);return o&&(l=l.map(u=>u+"-"+o),t&&(l=l.concat(l.map(Fy)))),l}function eh(e){return e.replace(/left|right|bottom|top/g,t=>NH[t])}function PH(e){return{top:0,right:0,bottom:0,left:0,...e}}function lN(e){return typeof e!="number"?PH(e):{top:e,right:e,bottom:e,left:e}}function th(e){const{x:t,y:n,width:i,height:o}=e;return{width:i,height:o,top:n,left:t,right:t+i,bottom:n+o,x:t,y:n}}function Wf(e,t,n){return Math.floor(e/t)!==n}function Ed(e,t){return t<0||t>=e.current.length}function zH(e,t){return Kn(e,{disabledIndices:t})}function UH(e,t){return Kn(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Kn(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:i,amount:o=1}={}){let l=t;do l+=n?-o:o;while(l>=0&&l<=e.current.length-1&&Dc(e,l,i));return l}function BH(e,{event:t,orientation:n,loopFocus:i,rtl:o,cols:l,disabledIndices:u,minIndex:f,maxIndex:h,prevIndex:p,stopEvent:y=!1}){let v=p;const b=[],x={};let E=!1;{let C=null,M=-1;e.current.forEach((R,N)=>{if(R==null)return;const k=R.closest('[role="row"]');k&&(E=!0),(k!==C||M===-1)&&(C=k,M+=1,b[M]=[]),b[M].push(N),x[N]=M})}const _=E&&b.length>0&&b.some(C=>C.length!==l);function T(C){if(!_||p===-1)return;const M=x[p];if(M==null)return;const R=b[M].indexOf(p);let N=C==="up"?M-1:M+1;i&&(N<0?N=b.length-1:N>=b.length&&(N=0));const k=new Set;for(;N>=0&&N<b.length&&!k.has(N);){k.add(N);const z=b[N];if(z.length===0){N=C==="up"?N-1:N+1;continue}const j=Math.min(R,z.length-1);for(let A=j;A>=0;A-=1){const D=z[A];if(!Dc(e,D,u))return D}N=C==="up"?N-1:N+1,i&&(N<0?N=b.length-1:N>=b.length&&(N=0))}}if(t.key===vH){const C=T("up");if(C!==void 0)y&&So(t),v=C;else{if(y&&So(t),p===-1)v=h;else if(v=Kn(e,{startingIndex:v,amount:l,decrement:!0,disabledIndices:u}),i&&(p-l<f||v<0)){const M=p%l,R=h%l,N=h-(R-M);R===M?v=h:v=R>M?N:N-l}Ed(e,v)&&(v=p)}}if(t.key===bH){const C=T("down");C!==void 0?(y&&So(t),v=C):(y&&So(t),p===-1?v=f:(v=Kn(e,{startingIndex:p,amount:l,disabledIndices:u}),i&&p+l>h&&(v=Kn(e,{startingIndex:p%l-l,amount:l,disabledIndices:u}))),Ed(e,v)&&(v=p))}if(n==="both"){const C=Ba(p/l);t.key===(o?zg:Ug)&&(y&&So(t),p%l!==l-1?(v=Kn(e,{startingIndex:p,disabledIndices:u}),i&&Wf(v,l,C)&&(v=Kn(e,{startingIndex:p-p%l-1,disabledIndices:u}))):i&&(v=Kn(e,{startingIndex:p-p%l-1,disabledIndices:u})),Wf(v,l,C)&&(v=p)),t.key===(o?Ug:zg)&&(y&&So(t),p%l!==0?(v=Kn(e,{startingIndex:p,decrement:!0,disabledIndices:u}),i&&Wf(v,l,C)&&(v=Kn(e,{startingIndex:p+(l-p%l),decrement:!0,disabledIndices:u}))):i&&(v=Kn(e,{startingIndex:p+(l-p%l),decrement:!0,disabledIndices:u})),Wf(v,l,C)&&(v=p));const M=Ba(h/l)===C;Ed(e,v)&&(i&&M?v=t.key===(o?Ug:zg)?h:Kn(e,{startingIndex:p-p%l-1,disabledIndices:u}):v=p)}return v}function HH(e,t,n){const i=[];let o=0;return e.forEach(({width:l,height:u},f)=>{let h=!1;for(n&&(o=0);!h;){const p=[];for(let y=0;y<l;y+=1)for(let v=0;v<u;v+=1)p.push(o+y+v*t);o%t+l<=t&&p.every(y=>i[y]==null)?(p.forEach(y=>{i[y]=f}),h=!0):o+=1}}),[...i]}function FH(e,t,n,i,o){if(e===-1)return-1;const l=n.indexOf(e),u=t[e];switch(o){case"tl":return l;case"tr":return u?l+u.width-1:l;case"bl":return u?l+(u.height-1)*i:l;case"br":return n.lastIndexOf(e);default:return-1}}function qH(e,t){return t.flatMap((n,i)=>e.includes(n)?[i]:[])}function Dc(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const i=e.current[t];return i?i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true":!1}var VH=["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] *)"],nh=VH.join(","),cN=typeof Element>"u",cl=cN?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,rh=!cN&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},sh=function(t,n){var i;n===void 0&&(n=!0);var o=t==null||(i=t.getAttribute)===null||i===void 0?void 0:i.call(t,"inert"),l=o===""||o==="true",u=l||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):sh(t.parentNode));return u},$H=function(t){var n,i=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return i===""||i==="true"},uN=function(t,n,i){if(sh(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(nh));return n&&cl.call(t,nh)&&o.unshift(t),o=o.filter(i),o},ih=function(t,n,i){for(var o=[],l=Array.from(t);l.length;){var u=l.shift();if(!sh(u,!1))if(u.tagName==="SLOT"){var f=u.assignedElements(),h=f.length?f:u.children,p=ih(h,!0,i);i.flatten?o.push.apply(o,p):o.push({scopeParent:u,candidates:p})}else{var y=cl.call(u,nh);y&&i.filter(u)&&(n||!t.includes(u))&&o.push(u);var v=u.shadowRoot||typeof i.getShadowRoot=="function"&&i.getShadowRoot(u),b=!sh(v,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(u));if(v&&b){var x=ih(v===!0?u.children:v.children,!0,i);i.flatten?o.push.apply(o,x):o.push({scopeParent:u,candidates:x})}else l.unshift.apply(l,u.children)}}return o},fN=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},dN=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||$H(t))&&!fN(t)?0:t.tabIndex},GH=function(t,n){var i=dN(t);return i<0&&n&&!fN(t)?0:i},KH=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},hN=function(t){return t.tagName==="INPUT"},YH=function(t){return hN(t)&&t.type==="hidden"},XH=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(i){return i.tagName==="SUMMARY"});return n},QH=function(t,n){for(var i=0;i<t.length;i++)if(t[i].checked&&t[i].form===n)return t[i]},WH=function(t){if(!t.name)return!0;var n=t.form||rh(t),i=function(f){return n.querySelectorAll('input[type="radio"][name="'+f+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=i(window.CSS.escape(t.name));else try{o=i(t.name)}catch(u){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",u.message),!1}var l=QH(o,t.form);return!l||l===t},ZH=function(t){return hN(t)&&t.type==="radio"},JH=function(t){return ZH(t)&&!WH(t)},e6=function(t){var n,i=t&&rh(t),o=(n=i)===null||n===void 0?void 0:n.host,l=!1;if(i&&i!==t){var u,f,h;for(l=!!((u=o)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(o)||t!=null&&(h=t.ownerDocument)!==null&&h!==void 0&&h.contains(t));!l&&o;){var p,y,v;i=rh(o),o=(p=i)===null||p===void 0?void 0:p.host,l=!!((y=o)!==null&&y!==void 0&&(v=y.ownerDocument)!==null&&v!==void 0&&v.contains(o))}}return l},Fw=function(t){var n=t.getBoundingClientRect(),i=n.width,o=n.height;return i===0&&o===0},t6=function(t,n){var i=n.displayCheck,o=n.getShadowRoot;if(i==="full-native"&&"checkVisibility"in t){var l=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!l}if(getComputedStyle(t).visibility==="hidden")return!0;var u=cl.call(t,"details>summary:first-of-type"),f=u?t.parentElement:t;if(cl.call(f,"details:not([open]) *"))return!0;if(!i||i==="full"||i==="full-native"||i==="legacy-full"){if(typeof o=="function"){for(var h=t;t;){var p=t.parentElement,y=rh(t);if(p&&!p.shadowRoot&&o(p)===!0)return Fw(t);t.assignedSlot?t=t.assignedSlot:!p&&y!==t.ownerDocument?t=y.host:t=p}t=h}if(e6(t))return!t.getClientRects().length;if(i!=="legacy-full")return!0}else if(i==="non-zero-area")return Fw(t);return!1},n6=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var i=0;i<n.children.length;i++){var o=n.children.item(i);if(o.tagName==="LEGEND")return cl.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},qy=function(t,n){return!(n.disabled||YH(n)||t6(n,t)||XH(n)||n6(n))},Vy=function(t,n){return!(JH(n)||dN(n)<0||!qy(t,n))},r6=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},pN=function(t){var n=[],i=[];return t.forEach(function(o,l){var u=!!o.scopeParent,f=u?o.scopeParent:o,h=GH(f,u),p=u?pN(o.candidates):f;h===0?u?n.push.apply(n,p):n.push(f):i.push({documentOrder:l,tabIndex:h,item:o,isScope:u,content:p})}),i.sort(KH).reduce(function(o,l){return l.isScope?o.push.apply(o,l.content):o.push(l.content),o},[]).concat(n)},Oh=function(t,n){n=n||{};var i;return n.getShadowRoot?i=ih([t],n.includeContainer,{filter:Vy.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:r6}):i=uN(t,n.includeContainer,Vy.bind(null,n)),pN(i)},s6=function(t,n){n=n||{};var i;return n.getShadowRoot?i=ih([t],n.includeContainer,{filter:qy.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):i=uN(t,n.includeContainer,qy.bind(null,n)),i},mN=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return cl.call(t,nh)===!1?!1:Vy(n,t)};const mu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function gN(e,t){const n=Oh(e,mu()),i=n.length;if(i===0)return;const o=Si(_t(e)),l=n.indexOf(o),u=l===-1?t===1?0:i-1:l+t;return n[u]}function yN(e){return gN(_t(e).body,1)||e}function vN(e){return gN(_t(e).body,-1)||e}function Lc(e,t){const n=t||e.currentTarget,i=e.relatedTarget;return!i||!Rt(n,i)}function i6(e){Oh(e,mu()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function qw(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const i=n.dataset.tabindex;delete n.dataset.tabindex,i?n.setAttribute("tabindex",i):n.removeAttribute("tabindex")})}function o6(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(i=>i(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)}}}const a6=S.createContext(null),l6=S.createContext(null),kh=()=>S.useContext(a6)?.id||null,Ih=e=>{const t=S.useContext(l6);return e??t};function Xc(e){return`data-base-ui-${e}`}const Zf=null;class c6{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Jf=new c6;class Jr{static create(){return new Jr}static request(t){return Jf.request(t)}static cancel(t){return Jf.cancel(t)}currentId=Zf;request(t){this.cancel(),this.currentId=Jf.request(()=>{this.currentId=Zf,t()})}cancel=()=>{this.currentId!==Zf&&(Jf.cancel(this.currentId),this.currentId=Zf)};disposeEffect=()=>this.cancel}function rb(){const e=En(Jr.create).current;return Zv(e.disposeEffect),e}const oh=S.forwardRef(function(t,n){const[i,o]=S.useState();De(()=>{hH&&o("button")},[]);const l={tabIndex:0,role:i};return d.jsx("span",{...t,ref:n,style:wh,"aria-hidden":i?void 0:!0,...l,"data-base-ui-focus-guard":""})});let Vw=0;function Bg(e,t={}){const{preventScroll:n=!1,cancelPrevious:i=!0,sync:o=!1}=t;i&&cancelAnimationFrame(Vw);const l=()=>e?.focus({preventScroll:n});o?l():Vw=requestAnimationFrame(l)}const Ka={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function $w(e){return e==="inert"?Ka.inert:e==="aria-hidden"?Ka["aria-hidden"]:Ka.none}let ed=new WeakSet,td={},Hg=0;const bN=e=>e&&(e.host||bN(e.parentNode)),u6=(e,t)=>t.map(n=>{if(e.contains(n))return n;const i=bN(n);return e.contains(i)?i:null}).filter(n=>n!=null);function f6(e,t,n,i){const o="data-base-ui-inert",l=i?"inert":n?"aria-hidden":null,u=u6(t,e),f=new Set,h=new Set(u),p=[];td[o]||(td[o]=new WeakMap);const y=td[o];u.forEach(v),b(t),f.clear();function v(x){!x||f.has(x)||(f.add(x),x.parentNode&&v(x.parentNode))}function b(x){!x||h.has(x)||[].forEach.call(x.children,E=>{if($i(E)!=="script")if(f.has(E))b(E);else{const _=l?E.getAttribute(l):null,T=_!==null&&_!=="false",C=$w(l),M=(C.get(E)||0)+1,R=(y.get(E)||0)+1;C.set(E,M),y.set(E,R),p.push(E),M===1&&T&&ed.add(E),R===1&&E.setAttribute(o,""),!T&&l&&E.setAttribute(l,l==="inert"?"":"true")}})}return Hg+=1,()=>{p.forEach(x=>{const E=$w(l),T=(E.get(x)||0)-1,C=(y.get(x)||0)-1;E.set(x,T),y.set(x,C),T||(!ed.has(x)&&l&&x.removeAttribute(l),ed.delete(x)),C||x.removeAttribute(o)}),Hg-=1,Hg||(Ka.inert=new WeakMap,Ka["aria-hidden"]=new WeakMap,Ka.none=new WeakMap,ed=new WeakSet,td={})}}function d6(e,t=!1,n=!1){const i=_t(e[0]).body;return f6(e.concat(Array.from(i.querySelectorAll("[aria-live]"))),i,t,n)}const xN=S.createContext(null),SN=()=>S.useContext(xN),h6=Xc("portal");function EN(e={}){const{ref:t,container:n,componentProps:i=Kt,elementProps:o}=e,l=pu(),f=SN()?.portalNode,[h,p]=S.useState(null),[y,v]=S.useState(null),b=je(T=>{T!==null&&v(T)}),x=S.useRef(null);De(()=>{if(n===null){x.current&&(x.current=null,v(null),p(null));return}if(l==null)return;const T=(n&&(Vv(n)?n:n.current))??f??document.body;if(T==null){x.current&&(x.current=null,v(null),p(null));return}x.current!==T&&(x.current=T,v(null),p(T))},[n,f,l]);const E=At("div",i,{ref:[t,b],props:[{id:l,[h6]:""},o]});return{portalNode:y,portalSubtree:h&&E?Fi.createPortal(E,h):null}}const _N=S.forwardRef(function(t,n){const{children:i,container:o,className:l,render:u,renderGuards:f,...h}=t,{portalNode:p,portalSubtree:y}=EN({container:o,ref:n,componentProps:t,elementProps:h}),v=S.useRef(null),b=S.useRef(null),x=S.useRef(null),E=S.useRef(null),[_,T]=S.useState(null),C=_?.modal,M=_?.open,R=typeof f=="boolean"?f:!!_&&!_.modal&&_.open&&!!p;S.useEffect(()=>{if(!p||C)return;function k(z){p&&z.relatedTarget&&Lc(z)&&(z.type==="focusin"?qw:i6)(p)}return p.addEventListener("focusin",k,!0),p.addEventListener("focusout",k,!0),()=>{p.removeEventListener("focusin",k,!0),p.removeEventListener("focusout",k,!0)}},[p,C]),S.useEffect(()=>{!p||M||qw(p)},[M,p]);const N=S.useMemo(()=>({beforeOutsideRef:v,afterOutsideRef:b,beforeInsideRef:x,afterInsideRef:E,portalNode:p,setFocusManagerState:T}),[p]);return d.jsxs(S.Fragment,{children:[y,d.jsxs(xN.Provider,{value:N,children:[R&&p&&d.jsx(oh,{"data-type":"outside",ref:v,onFocus:k=>{if(Lc(k,p))x.current?.focus();else{const z=_?_.domReference:null;vN(z)?.focus()}}}),R&&p&&d.jsx("span",{"aria-owns":p.id,style:tB}),p&&Fi.createPortal(i,p),R&&p&&d.jsx(oh,{"data-type":"outside",ref:b,onFocus:k=>{if(Lc(k,p))E.current?.focus();else{const z=_?_.domReference:null;yN(z)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,Pt(z1,k.nativeEvent))}}})]})]})});function Cs(e){return e==null?e:"current"in e?e.current:e}function p6(e,t){const n=Xt(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"):""}const Gw=20;let wi=[];function sb(){wi=wi.filter(e=>e.deref()?.isConnected)}function m6(e){sb(),e&&$i(e)!=="body"&&(wi.push(new WeakRef(e)),wi.length>Gw&&(wi=wi.slice(-Gw)))}function Fg(){return sb(),wi[wi.length-1]?.deref()}function g6(e){if(!e)return null;const t=mu();return mN(e,t)?e:Oh(e,t)[0]||e}function y6(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():nr(e).display!=="none"}function Kw(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=mu(),o=s6(e,n).filter(u=>{const f=u.getAttribute("data-tabindex")||"";return mN(u,n)||u.hasAttribute("data-tabindex")&&!f.startsWith("-")}),l=e.getAttribute("tabindex");t.current.includes("floating")||o.length===0?l!=="0"&&e.setAttribute("tabindex","0"):(l!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function wN(e){const{context:t,children:n,disabled:i=!1,initialFocus:o=!0,returnFocus:l=!0,restoreFocus:u=!1,modal:f=!0,closeOnFocusOut:h=!0,openInteractionType:p="",nextFocusableElement:y,previousFocusableElement:v,beforeContentFocusGuardRef:b,externalTree:x}=e,E="rootStore"in t?t.rootStore:t,_=E.useState("open"),T=E.useState("domReferenceElement"),C=E.useState("floatingElement"),{events:M,dataRef:R}=E.context,N=je(()=>R.current.floatingContext?.nodeId),k=o===!1,z=zw(T)&&k,j=S.useRef(["content"]),A=ki(o),D=ki(l),G=ki(p),F=Ih(x),P=SN(),Q=S.useRef(null),X=S.useRef(null),te=S.useRef(!1),L=S.useRef(!1),$=S.useRef(!1),H=S.useRef(-1),V=S.useRef(""),U=S.useRef(""),I=S.useRef(null),K=S.useRef(null),Z=Us(I,b,P?.beforeInsideRef),W=Us(K,P?.afterInsideRef),se=zr(),ie=zr(),he=rb(),xe=P!=null,de=Zd(C),Be=je((fe=de)=>fe?Oh(fe,mu()):[]),_e=je(fe=>{const ae=Be(fe);return j.current.map(()=>ae).filter(Boolean).flat()});S.useEffect(()=>{if(i||!f)return;function fe(Se){Se.key==="Tab"&&Rt(de,Si(_t(de)))&&Be().length===0&&!z&&So(Se)}const ae=_t(de);return ae.addEventListener("keydown",fe),()=>{ae.removeEventListener("keydown",fe)}},[i,T,de,f,j,z,Be,_e]),S.useEffect(()=>{if(i||!_)return;const fe=_t(de);function ae(){$.current=!1}function Se(be){const ge=Sr(be),Le=Rt(C,ge)||Rt(T,ge)||Rt(P?.portalNode,ge);$.current=!Le,U.current=be.pointerType||"keyboard",ge?.closest(`[${ZU}]`)&&(L.current=!0)}function ye(){U.current="keyboard"}return fe.addEventListener("pointerdown",Se,!0),fe.addEventListener("pointerup",ae,!0),fe.addEventListener("pointercancel",ae,!0),fe.addEventListener("keydown",ye,!0),()=>{fe.removeEventListener("pointerdown",Se,!0),fe.removeEventListener("pointerup",ae,!0),fe.removeEventListener("pointercancel",ae,!0),fe.removeEventListener("keydown",ye,!0)}},[i,C,T,de,_,P]),S.useEffect(()=>{if(i||!h)return;const fe=_t(de);function ae(){L.current=!0,ie.start(0,()=>{L.current=!1})}function Se(Oe){const Ee=Sr(Oe),Ke=Be().indexOf(Ee);Ke!==-1&&(H.current=Ke)}function ye(Oe){const Ee=Oe.relatedTarget,Fe=Oe.currentTarget,Ke=Sr(Oe);queueMicrotask(()=>{const ze=N(),Xe=E.context.triggerElements,Ue=Ee?.hasAttribute(Xc("focus-guard"))&&[I.current,K.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Cs(v),Cs(y)].includes(Ee),pe=!(Rt(T,Ee)||Rt(C,Ee)||Rt(Ee,C)||Rt(P?.portalNode,Ee)||Ee!=null&&Xe.hasElement(Ee)||Xe.hasMatchingElement(we=>Rt(we,Ee))||Ue||F&&(Ga(F.nodesRef.current,ze).find(we=>Rt(we.context?.elements.floating,Ee)||Rt(we.context?.elements.domReference,Ee))||Uw(F.nodesRef.current,ze).find(we=>[we.context?.elements.floating,Zd(we.context?.elements.floating)].includes(Ee)||we.context?.elements.domReference===Ee)));if(Fe===T&&de&&Kw(de,j),u&&Fe!==T&&!y6(Ke)&&Si(fe)===fe.body){if(Lt(de)&&(de.focus(),u==="popup")){he.request(()=>{de.focus()});return}const we=H.current,He=Be(),dt=He[we]||He[He.length-1]||de;Lt(dt)&&dt.focus()}if(R.current.insideReactTree){R.current.insideReactTree=!1;return}(z||!f)&&Ee&&pe&&!L.current&&(z||Ee!==Fg())&&(te.current=!0,E.setOpen(!1,Pt(z1,Oe)))})}function be(){$.current||(R.current.insideReactTree=!0,se.start(0,()=>{R.current.insideReactTree=!1}))}const ge=Lt(T)?T:null,Le=[];if(!(!C&&!ge))return ge&&(ge.addEventListener("focusout",ye),ge.addEventListener("pointerdown",ae),Le.push(()=>{ge.removeEventListener("focusout",ye),ge.removeEventListener("pointerdown",ae)})),C&&(C.addEventListener("focusin",Se),C.addEventListener("focusout",ye),P&&(C.addEventListener("focusout",be,!0),Le.push(()=>{C.removeEventListener("focusout",be,!0)})),Le.push(()=>{C.removeEventListener("focusin",Se),C.removeEventListener("focusout",ye)})),()=>{Le.forEach(Oe=>{Oe()})}},[i,T,C,de,f,F,P,E,h,u,Be,z,N,j,R,se,ie,he,y,v]),S.useEffect(()=>{if(i||!C||!_)return;const fe=Array.from(P?.portalNode?.querySelectorAll(`[${Xc("portal")}]`)||[]),Se=(F?Uw(F.nodesRef.current,N()):[]).find(be=>zw(be.context?.elements.domReference||null))?.context?.elements.domReference,ye=[C,Se,...fe,Q.current,X.current,I.current,K.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,Cs(v),Cs(y),z?T:null].filter(be=>be!=null);return d6(ye,f||z)},[_,i,T,C,f,j,P,z,F,N,y,v]),De(()=>{if(!_||i||!Lt(de))return;const fe=_t(de),ae=Si(fe);queueMicrotask(()=>{const Se=_e(de),ye=A.current,be=typeof ye=="function"?ye(G.current||""):ye;if(be===void 0||be===!1)return;let ge;be===!0||be===null?ge=Se[0]||de:ge=Cs(be),ge=ge||Se[0]||de,!Rt(de,ae)&&Bg(ge,{preventScroll:ge===de})})},[i,_,de,k,_e,A,G]),De(()=>{if(i||!de)return;const fe=_t(de),ae=Si(fe);m6(ae);function Se(ge){if(ge.open||(V.current=p6(ge.nativeEvent,U.current)),ge.reason===zy&&ge.nativeEvent.type==="mouseleave"&&(te.current=!0),ge.reason===P1)if(ge.nested)te.current=!1;else if(_H(ge.nativeEvent)||wH(ge.nativeEvent))te.current=!1;else{let Le=!1;document.createElement("div").focus({get preventScroll(){return Le=!0,!1}}),Le?te.current=!1:te.current=!0}}M.on("openchange",Se);const ye=fe.createElement("span");ye.setAttribute("tabindex","-1"),ye.setAttribute("aria-hidden","true"),Object.assign(ye.style,wh),xe&&T&&T.insertAdjacentElement("afterend",ye);function be(){const ge=D.current;let Le=typeof ge=="function"?ge(V.current):ge;if(Le===void 0||Le===!1)return null;if(Le===null&&(Le=!0),typeof Le=="boolean"){const Ee=T||Fg();return Ee&&Ee.isConnected?Ee:ye}const Oe=T||Fg()||ye;return Cs(Le)||Oe}return()=>{M.off("openchange",Se);const ge=Si(fe),Le=Rt(C,ge)||F&&Ga(F.nodesRef.current,N(),!1).some(Ee=>Rt(Ee.context?.elements.floating,ge)),Oe=be();queueMicrotask(()=>{const Ee=g6(Oe),Fe=typeof D.current!="boolean";D.current&&!te.current&&Lt(Ee)&&(!(!Fe&&Ee!==ge&&ge!==fe.body)||Le)&&Ee.focus({preventScroll:!0}),ye.remove(),te.current=!1})}},[i,C,de,D,R,M,F,xe,T,N]),De(()=>{if(!Jv||_||!C)return;const fe=Si(_t(C));!Lt(fe)||!aN(fe)||Rt(C,fe)&&fe.blur()},[_,C]),De(()=>{if(!(i||!P))return P.setFocusManagerState({modal:f,closeOnFocusOut:h,open:_,onOpenChange:E.setOpen,domReference:T}),()=>{P.setFocusManagerState(null)}},[i,P,f,_,E,h,T]),De(()=>{if(!(i||!de))return Kw(de,j),()=>{queueMicrotask(sb)}},[i,de,j]);const re=!i&&(f?!z:!0)&&(xe||f);return d.jsxs(S.Fragment,{children:[re&&d.jsx(oh,{"data-type":"inside",ref:Z,onFocus:fe=>{if(f){const ae=_e();Bg(ae[ae.length-1])}else P?.portalNode&&(te.current=!1,Lc(fe,P.portalNode)?yN(T)?.focus():Cs(v??P.beforeOutsideRef)?.focus())}}),n,re&&d.jsx(oh,{"data-type":"inside",ref:W,onFocus:fe=>{f?Bg(_e()[0]):P?.portalNode&&(h&&(te.current=!0),Lc(fe,P.portalNode)?vN(T)?.focus():Cs(y??P.afterOutsideRef)?.focus())}})]})}function Yw(e,t,n){let{reference:i,floating:o}=e;const l=wr(t),u=nb(t),f=tb(u),h=On(t),p=l==="y",y=i.x+i.width/2-o.width/2,v=i.y+i.height/2-o.height/2,b=i[f]/2-o[f]/2;let x;switch(h){case"top":x={x:y,y:i.y-o.height};break;case"bottom":x={x:y,y:i.y+i.height};break;case"right":x={x:i.x+i.width,y:v};break;case"left":x={x:i.x-o.width,y:v};break;default:x={x:i.x,y:i.y}}switch(Xi(t)){case"start":x[u]-=b*(n&&p?-1:1);break;case"end":x[u]+=b*(n&&p?-1:1);break}return x}async function v6(e,t){var n;t===void 0&&(t={});const{x:i,y:o,platform:l,rects:u,elements:f,strategy:h}=e,{boundary:p="clippingAncestors",rootBoundary:y="viewport",elementContext:v="floating",altBoundary:b=!1,padding:x=0}=Hs(t,e),E=lN(x),T=f[b?v==="floating"?"reference":"floating":v],C=th(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(T)))==null||n?T:T.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(f.floating)),boundary:p,rootBoundary:y,strategy:h})),M=v==="floating"?{x:i,y:o,width:u.floating.width,height:u.floating.height}:u.reference,R=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f.floating)),N=await(l.isElement==null?void 0:l.isElement(R))?await(l.getScale==null?void 0:l.getScale(R))||{x:1,y:1}:{x:1,y:1},k=th(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:M,offsetParent:R,strategy:h}):M);return{top:(C.top-k.top+E.top)/N.y,bottom:(k.bottom-C.bottom+E.bottom)/N.y,left:(C.left-k.left+E.left)/N.x,right:(k.right-C.right+E.right)/N.x}}const b6=async(e,t,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:l=[],platform:u}=n,f=l.filter(Boolean),h=await(u.isRTL==null?void 0:u.isRTL(t));let p=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:y,y:v}=Yw(p,i,h),b=i,x={},E=0;for(let T=0;T<f.length;T++){var _;const{name:C,fn:M}=f[T],{x:R,y:N,data:k,reset:z}=await M({x:y,y:v,initialPlacement:i,placement:b,strategy:o,middlewareData:x,rects:p,platform:{...u,detectOverflow:(_=u.detectOverflow)!=null?_:v6},elements:{reference:e,floating:t}});y=R??y,v=N??v,x={...x,[C]:{...x[C],...k}},z&&E<=50&&(E++,typeof z=="object"&&(z.placement&&(b=z.placement),z.rects&&(p=z.rects===!0?await u.getElementRects({reference:e,floating:t,strategy:o}):z.rects),{x:y,y:v}=Yw(p,b,h)),T=-1)}return{x:y,y:v,placement:b,strategy:o,middlewareData:x}},x6=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,i;const{placement:o,middlewareData:l,rects:u,initialPlacement:f,platform:h,elements:p}=t,{mainAxis:y=!0,crossAxis:v=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:_=!0,...T}=Hs(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const C=On(o),M=wr(f),R=On(f)===f,N=await(h.isRTL==null?void 0:h.isRTL(p.floating)),k=b||(R||!_?[eh(f)]:OH(f)),z=E!=="none";!b&&z&&k.push(...LH(f,_,E,N));const j=[f,...k],A=await h.detectOverflow(t,T),D=[];let G=((i=l.flip)==null?void 0:i.overflows)||[];if(y&&D.push(A[C]),v){const X=AH(o,u,N);D.push(A[X[0]],A[X[1]])}if(G=[...G,{placement:o,overflows:D}],!D.every(X=>X<=0)){var F,P;const X=(((F=l.flip)==null?void 0:F.index)||0)+1,te=j[X];if(te&&(!(v==="alignment"?M!==wr(te):!1)||G.every(H=>wr(H.placement)===M?H.overflows[0]>0:!0)))return{data:{index:X,overflows:G},reset:{placement:te}};let L=(P=G.filter($=>$.overflows[0]<=0).sort(($,H)=>$.overflows[1]-H.overflows[1])[0])==null?void 0:P.placement;if(!L)switch(x){case"bestFit":{var Q;const $=(Q=G.filter(H=>{if(z){const V=wr(H.placement);return V===M||V==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(V=>V>0).reduce((V,U)=>V+U,0)]).sort((H,V)=>H[1]-V[1])[0])==null?void 0:Q[0];$&&(L=$);break}case"initialPlacement":L=f;break}if(o!==L)return{reset:{placement:L}}}return{}}}};function Xw(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Qw(e){return RH.some(t=>e[t]>=0)}const S6=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:i}=t,{strategy:o="referenceHidden",...l}=Hs(e,t);switch(o){case"referenceHidden":{const u=await i.detectOverflow(t,{...l,elementContext:"reference"}),f=Xw(u,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:Qw(f)}}}case"escaped":{const u=await i.detectOverflow(t,{...l,altBoundary:!0}),f=Xw(u,n.floating);return{data:{escapedOffsets:f,escaped:Qw(f)}}}default:return{}}}}},TN=new Set(["left","top"]);async function E6(e,t){const{placement:n,platform:i,elements:o}=e,l=await(i.isRTL==null?void 0:i.isRTL(o.floating)),u=On(n),f=Xi(n),h=wr(n)==="y",p=TN.has(u)?-1:1,y=l&&h?-1:1,v=Hs(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:E}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return f&&typeof E=="number"&&(x=f==="end"?E*-1:E),h?{x:x*y,y:b*p}:{x:b*p,y:x*y}}const _6=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:o,y:l,placement:u,middlewareData:f}=t,h=await E6(t,e);return u===((n=f.offset)==null?void 0:n.placement)&&(i=f.arrow)!=null&&i.alignmentOffset?{}:{x:o+h.x,y:l+h.y,data:{...h,placement:u}}}}},w6=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:o,platform:l}=t,{mainAxis:u=!0,crossAxis:f=!1,limiter:h={fn:C=>{let{x:M,y:R}=C;return{x:M,y:R}}},...p}=Hs(e,t),y={x:n,y:i},v=await l.detectOverflow(t,p),b=wr(On(o)),x=eb(b);let E=y[x],_=y[b];if(u){const C=x==="y"?"top":"left",M=x==="y"?"bottom":"right",R=E+v[C],N=E-v[M];E=Hy(R,E,N)}if(f){const C=b==="y"?"top":"left",M=b==="y"?"bottom":"right",R=_+v[C],N=_-v[M];_=Hy(R,_,N)}const T=h.fn({...t,[x]:E,[b]:_});return{...T,data:{x:T.x-n,y:T.y-i,enabled:{[x]:u,[b]:f}}}}}},T6=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:i,placement:o,rects:l,middlewareData:u}=t,{offset:f=0,mainAxis:h=!0,crossAxis:p=!0}=Hs(e,t),y={x:n,y:i},v=wr(o),b=eb(v);let x=y[b],E=y[v];const _=Hs(f,t),T=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(h){const R=b==="y"?"height":"width",N=l.reference[b]-l.floating[R]+T.mainAxis,k=l.reference[b]+l.reference[R]-T.mainAxis;x<N?x=N:x>k&&(x=k)}if(p){var C,M;const R=b==="y"?"width":"height",N=TN.has(On(o)),k=l.reference[v]-l.floating[R]+(N&&((C=u.offset)==null?void 0:C[v])||0)+(N?0:T.crossAxis),z=l.reference[v]+l.reference[R]+(N?0:((M=u.offset)==null?void 0:M[v])||0)-(N?T.crossAxis:0);E<k?E=k:E>z&&(E=z)}return{[b]:x,[v]:E}}}},C6=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,i;const{placement:o,rects:l,platform:u,elements:f}=t,{apply:h=()=>{},...p}=Hs(e,t),y=await u.detectOverflow(t,p),v=On(o),b=Xi(o),x=wr(o)==="y",{width:E,height:_}=l.floating;let T,C;v==="top"||v==="bottom"?(T=v,C=b===(await(u.isRTL==null?void 0:u.isRTL(f.floating))?"start":"end")?"left":"right"):(C=v,T=b==="end"?"top":"bottom");const M=_-y.top-y.bottom,R=E-y.left-y.right,N=ll(_-y[T],M),k=ll(E-y[C],R),z=!t.middlewareData.shift;let j=N,A=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(A=R),(i=t.middlewareData.shift)!=null&&i.enabled.y&&(j=M),z&&!b){const G=Yn(y.left,0),F=Yn(y.right,0),P=Yn(y.top,0),Q=Yn(y.bottom,0);x?A=E-2*(G!==0||F!==0?G+F:Yn(y.left,y.right)):j=_-2*(P!==0||Q!==0?P+Q:Yn(y.top,y.bottom))}await h({...t,availableWidth:A,availableHeight:j});const D=await u.getDimensions(f.floating);return E!==D.width||_!==D.height?{reset:{rects:!0}}:{}}}};function CN(e){const t=nr(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const o=Lt(e),l=o?e.offsetWidth:n,u=o?e.offsetHeight:i,f=Jd(n)!==l||Jd(i)!==u;return f&&(n=l,i=u),{width:n,height:i,$:f}}function ib(e){return Tt(e)?e:e.contextElement}function Ya(e){const t=ib(e);if(!Lt(t))return ns(1);const n=t.getBoundingClientRect(),{width:i,height:o,$:l}=CN(t);let u=(l?Jd(n.width):n.width)/i,f=(l?Jd(n.height):n.height)/o;return(!u||!Number.isFinite(u))&&(u=1),(!f||!Number.isFinite(f))&&(f=1),{x:u,y:f}}const R6=ns(0);function RN(e){const t=Xt(e);return!Rh()||!t.visualViewport?R6:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function N6(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Xt(e)?!1:t}function Bo(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),l=ib(e);let u=ns(1);t&&(i?Tt(i)&&(u=Ya(i)):u=Ya(e));const f=N6(l,n,i)?RN(l):ns(0);let h=(o.left+f.x)/u.x,p=(o.top+f.y)/u.y,y=o.width/u.x,v=o.height/u.y;if(l){const b=Xt(l),x=i&&Tt(i)?Xt(i):i;let E=b,_=Ly(E);for(;_&&i&&x!==E;){const T=Ya(_),C=_.getBoundingClientRect(),M=nr(_),R=C.left+(_.clientLeft+parseFloat(M.paddingLeft))*T.x,N=C.top+(_.clientTop+parseFloat(M.paddingTop))*T.y;h*=T.x,p*=T.y,y*=T.x,v*=T.y,h+=R,p+=N,E=Xt(_),_=Ly(E)}}return th({width:y,height:v,x:h,y:p})}function Dh(e,t){const n=Nh(e).scrollLeft;return t?t.left+n:Bo(ss(e)).left+n}function NN(e,t){const n=e.getBoundingClientRect(),i=n.left+t.scrollLeft-Dh(e,n),o=n.top+t.scrollTop;return{x:i,y:o}}function j6(e){let{elements:t,rect:n,offsetParent:i,strategy:o}=e;const l=o==="fixed",u=ss(i),f=t?Ch(t.floating):!1;if(i===u||f&&l)return n;let h={scrollLeft:0,scrollTop:0},p=ns(1);const y=ns(0),v=Lt(i);if((v||!v&&!l)&&(($i(i)!=="body"||Gi(u))&&(h=Nh(i)),Lt(i))){const x=Bo(i);p=Ya(i),y.x=x.x+i.clientLeft,y.y=x.y+i.clientTop}const b=u&&!v&&!l?NN(u,h):ns(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-h.scrollLeft*p.x+y.x+b.x,y:n.y*p.y-h.scrollTop*p.y+y.y+b.y}}function M6(e){return Array.from(e.getClientRects())}function A6(e){const t=ss(e),n=Nh(e),i=e.ownerDocument.body,o=Yn(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),l=Yn(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let u=-n.scrollLeft+Dh(e);const f=-n.scrollTop;return nr(i).direction==="rtl"&&(u+=Yn(t.clientWidth,i.clientWidth)-o),{width:o,height:l,x:u,y:f}}const Ww=25;function O6(e,t){const n=Xt(e),i=ss(e),o=n.visualViewport;let l=i.clientWidth,u=i.clientHeight,f=0,h=0;if(o){l=o.width,u=o.height;const y=Rh();(!y||y&&t==="fixed")&&(f=o.offsetLeft,h=o.offsetTop)}const p=Dh(i);if(p<=0){const y=i.ownerDocument,v=y.body,b=getComputedStyle(v),x=y.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,E=Math.abs(i.clientWidth-v.clientWidth-x);E<=Ww&&(l-=E)}else p<=Ww&&(l+=p);return{width:l,height:u,x:f,y:h}}const k6=new Set(["absolute","fixed"]);function I6(e,t){const n=Bo(e,!0,t==="fixed"),i=n.top+e.clientTop,o=n.left+e.clientLeft,l=Lt(e)?Ya(e):ns(1),u=e.clientWidth*l.x,f=e.clientHeight*l.y,h=o*l.x,p=i*l.y;return{width:u,height:f,x:h,y:p}}function Zw(e,t,n){let i;if(t==="viewport")i=O6(e,n);else if(t==="document")i=A6(ss(e));else if(Tt(t))i=I6(t,n);else{const o=RN(e);i={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return th(i)}function jN(e,t){const n=Bs(e);return n===t||!Tt(n)||As(n)?!1:nr(n).position==="fixed"||jN(n,t)}function D6(e,t){const n=t.get(e);if(n)return n;let i=Oi(e,[],!1).filter(f=>Tt(f)&&$i(f)!=="body"),o=null;const l=nr(e).position==="fixed";let u=l?Bs(e):e;for(;Tt(u)&&!As(u);){const f=nr(u),h=$v(u);!h&&f.position==="fixed"&&(o=null),(l?!h&&!o:!h&&f.position==="static"&&!!o&&k6.has(o.position)||Gi(u)&&!h&&jN(e,u))?i=i.filter(y=>y!==u):o=f,u=Bs(u)}return t.set(e,i),i}function L6(e){let{element:t,boundary:n,rootBoundary:i,strategy:o}=e;const u=[...n==="clippingAncestors"?Ch(t)?[]:D6(t,this._c):[].concat(n),i],f=u[0],h=u.reduce((p,y)=>{const v=Zw(t,y,o);return p.top=Yn(v.top,p.top),p.right=ll(v.right,p.right),p.bottom=ll(v.bottom,p.bottom),p.left=Yn(v.left,p.left),p},Zw(t,f,o));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function P6(e){const{width:t,height:n}=CN(e);return{width:t,height:n}}function z6(e,t,n){const i=Lt(t),o=ss(t),l=n==="fixed",u=Bo(e,!0,l,t);let f={scrollLeft:0,scrollTop:0};const h=ns(0);function p(){h.x=Dh(o)}if(i||!i&&!l)if(($i(t)!=="body"||Gi(o))&&(f=Nh(t)),i){const x=Bo(t,!0,l,t);h.x=x.x+t.clientLeft,h.y=x.y+t.clientTop}else o&&p();l&&!i&&o&&p();const y=o&&!i&&!l?NN(o,f):ns(0),v=u.left+f.scrollLeft-h.x-y.x,b=u.top+f.scrollTop-h.y-y.y;return{x:v,y:b,width:u.width,height:u.height}}function qg(e){return nr(e).position==="static"}function Jw(e,t){if(!Lt(e)||nr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ss(e)===n&&(n=n.ownerDocument.body),n}function MN(e,t){const n=Xt(e);if(Ch(e))return n;if(!Lt(e)){let o=Bs(e);for(;o&&!As(o);){if(Tt(o)&&!qg(o))return o;o=Bs(o)}return n}let i=Jw(e,t);for(;i&&uB(i)&&qg(i);)i=Jw(i,t);return i&&As(i)&&qg(i)&&!$v(i)?n:i||mB(e)||n}const U6=async function(e){const t=this.getOffsetParent||MN,n=this.getDimensions,i=await n(e.floating);return{reference:z6(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function B6(e){return nr(e).direction==="rtl"}const H6={convertOffsetParentRelativeRectToViewportRelativeRect:j6,getDocumentElement:ss,getClippingRect:L6,getOffsetParent:MN,getElementRects:U6,getClientRects:M6,getDimensions:P6,getScale:Ya,isElement:Tt,isRTL:B6};function AN(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function F6(e,t){let n=null,i;const o=ss(e);function l(){var f;clearTimeout(i),(f=n)==null||f.disconnect(),n=null}function u(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),l();const p=e.getBoundingClientRect(),{left:y,top:v,width:b,height:x}=p;if(f||t(),!b||!x)return;const E=Ba(v),_=Ba(o.clientWidth-(y+b)),T=Ba(o.clientHeight-(v+x)),C=Ba(y),R={rootMargin:-E+"px "+-_+"px "+-T+"px "+-C+"px",threshold:Yn(0,ll(1,h))||1};let N=!0;function k(z){const j=z[0].intersectionRatio;if(j!==h){if(!N)return u();j?u(!1,j):i=setTimeout(()=>{u(!1,1e-7)},1e3)}j===1&&!AN(p,e.getBoundingClientRect())&&u(),N=!1}try{n=new IntersectionObserver(k,{...R,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,R)}n.observe(e)}return u(!0),l}function eT(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:u=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=i,p=ib(e),y=o||l?[...p?Oi(p):[],...Oi(t)]:[];y.forEach(C=>{o&&C.addEventListener("scroll",n,{passive:!0}),l&&C.addEventListener("resize",n)});const v=p&&f?F6(p,n):null;let b=-1,x=null;u&&(x=new ResizeObserver(C=>{let[M]=C;M&&M.target===p&&x&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var R;(R=x)==null||R.observe(t)})),n()}),p&&!h&&x.observe(p),x.observe(t));let E,_=h?Bo(e):null;h&&T();function T(){const C=Bo(e);_&&!AN(_,C)&&n(),_=C,E=requestAnimationFrame(T)}return n(),()=>{var C;y.forEach(M=>{o&&M.removeEventListener("scroll",n),l&&M.removeEventListener("resize",n)}),v?.(),(C=x)==null||C.disconnect(),x=null,h&&cancelAnimationFrame(E)}}const q6=_6,V6=w6,$6=x6,G6=C6,K6=S6,Y6=T6,X6=(e,t,n)=>{const i=new Map,o={platform:H6,...n},l={...o.platform,_c:i};return b6(e,t,{...o,platform:l})};var Q6=typeof document<"u",W6=function(){},_d=Q6?S.useLayoutEffect:W6;function ah(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,i,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(i=n;i--!==0;)if(!ah(e[i],t[i]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,o[i]))return!1;for(i=n;i--!==0;){const l=o[i];if(!(l==="_owner"&&e.$$typeof)&&!ah(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function ON(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tT(e,t){const n=ON(e);return Math.round(t*n)/n}function Vg(e){const t=S.useRef(e);return _d(()=>{t.current=e}),t}function Z6(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:o,elements:{reference:l,floating:u}={},transform:f=!0,whileElementsMounted:h,open:p}=e,[y,v]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=S.useState(i);ah(b,i)||x(i);const[E,_]=S.useState(null),[T,C]=S.useState(null),M=S.useCallback(H=>{H!==z.current&&(z.current=H,_(H))},[]),R=S.useCallback(H=>{H!==j.current&&(j.current=H,C(H))},[]),N=l||E,k=u||T,z=S.useRef(null),j=S.useRef(null),A=S.useRef(y),D=h!=null,G=Vg(h),F=Vg(o),P=Vg(p),Q=S.useCallback(()=>{if(!z.current||!j.current)return;const H={placement:t,strategy:n,middleware:b};F.current&&(H.platform=F.current),X6(z.current,j.current,H).then(V=>{const U={...V,isPositioned:P.current!==!1};X.current&&!ah(A.current,U)&&(A.current=U,Fi.flushSync(()=>{v(U)}))})},[b,t,n,F,P]);_d(()=>{p===!1&&A.current.isPositioned&&(A.current.isPositioned=!1,v(H=>({...H,isPositioned:!1})))},[p]);const X=S.useRef(!1);_d(()=>(X.current=!0,()=>{X.current=!1}),[]),_d(()=>{if(N&&(z.current=N),k&&(j.current=k),N&&k){if(G.current)return G.current(N,k,Q);Q()}},[N,k,Q,G,D]);const te=S.useMemo(()=>({reference:z,floating:j,setReference:M,setFloating:R}),[M,R]),L=S.useMemo(()=>({reference:N,floating:k}),[N,k]),$=S.useMemo(()=>{const H={position:n,left:0,top:0};if(!L.floating)return H;const V=tT(L.floating,y.x),U=tT(L.floating,y.y);return f?{...H,transform:"translate("+V+"px, "+U+"px)",...ON(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:U}},[n,f,L.floating,y.x,y.y]);return S.useMemo(()=>({...y,update:Q,refs:te,elements:L,floatingStyles:$}),[y,Q,te,L,$])}const J6=(e,t)=>({...q6(e),options:[e,t]}),eF=(e,t)=>({...V6(e),options:[e,t]}),tF=(e,t)=>({...Y6(e),options:[e,t]}),nF=(e,t)=>({...$6(e),options:[e,t]}),rF=(e,t)=>({...G6(e),options:[e,t]}),sF=(e,t)=>({...K6(e),options:[e,t]}),iF={intentional:"onClick",sloppy:"onPointerDown"};function oF(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function aF(e,t={}){const n="rootStore"in e?e.rootStore:e,i=n.useState("open"),o=n.useState("floatingElement"),l=n.useState("referenceElement"),u=n.useState("domReferenceElement"),{onOpenChange:f,dataRef:h}=n.context,{enabled:p=!0,escapeKey:y=!0,outsidePress:v=!0,outsidePressEvent:b="sloppy",referencePress:x=!1,referencePressEvent:E="sloppy",ancestorScroll:_=!1,bubbles:T,externalTree:C}=t,M=Ih(C),R=je(typeof v=="function"?v:()=>!1),N=typeof v=="function"?R:v,k=S.useRef(!1),{escapeKey:z,outsidePress:j}=oF(T),A=S.useRef(null),D=zr(),G=zr(),F=je(()=>{G.clear(),h.current.insideReactTree=!1}),P=S.useRef(!1),Q=S.useRef(""),X=je(re=>{Q.current=re.pointerType}),te=je(()=>{const re=Q.current,fe=re==="pen"||!re?"mouse":re,ae=typeof b=="function"?b():b;return typeof ae=="string"?ae:ae[fe]}),L=je(re=>{if(!i||!p||!y||re.key!=="Escape"||P.current)return;const fe=h.current.floatingContext?.nodeId,ae=M?Ga(M.nodesRef.current,fe):[];if(!z&&ae.length>0){let be=!0;if(ae.forEach(ge=>{ge.context?.open&&!ge.context.dataRef.current.__escapeKeyBubbles&&(be=!1)}),!be)return}const Se=EH(re)?re.nativeEvent:re,ye=Pt(SB,Se);n.setOpen(!1,ye),!z&&!ye.isPropagationAllowed&&re.stopPropagation()}),$=je(re=>{const fe=te();return fe==="intentional"&&re.type!=="click"||fe==="sloppy"&&re.type==="click"}),H=je(()=>{h.current.insideReactTree=!0,G.start(0,F)}),V=je((re,fe=!1)=>{if($(re)){F();return}if(h.current.insideReactTree){F();return}if(te()==="intentional"&&fe||typeof N=="function"&&!N(re))return;const ae=Sr(re),Se=`[${Xc("inert")}]`,ye=_t(n.select("floatingElement")).querySelectorAll(Se),be=n.context.triggerElements;if(ae&&(be.hasElement(ae)||be.hasMatchingElement(Fe=>Rt(Fe,ae))))return;let ge=Tt(ae)?ae:null;for(;ge&&!As(ge);){const Fe=Bs(ge);if(As(Fe)||!Tt(Fe))break;ge=Fe}if(ye.length&&Tt(ae)&&!SH(ae)&&!Rt(ae,n.select("floatingElement"))&&Array.from(ye).every(Fe=>!Rt(ge,Fe)))return;if(Lt(ae)&&!("touches"in re)){const Fe=As(ae),Ke=nr(ae),ze=/auto|scroll/,Xe=Fe||ze.test(Ke.overflowX),Ue=Fe||ze.test(Ke.overflowY),pe=Xe&&ae.clientWidth>0&&ae.scrollWidth>ae.clientWidth,we=Ue&&ae.clientHeight>0&&ae.scrollHeight>ae.clientHeight,He=Ke.direction==="rtl",dt=we&&(He?re.offsetX<=ae.offsetWidth-ae.clientWidth:re.offsetX>ae.clientWidth),ot=pe&&re.offsetY>ae.clientHeight;if(dt||ot)return}const Le=h.current.floatingContext?.nodeId,Oe=M&&Ga(M.nodesRef.current,Le).some(Fe=>Ir(re,Fe.context?.elements.floating));if(Ir(re,n.select("floatingElement"))||Ir(re,n.select("domReferenceElement"))||Oe)return;const Ee=M?Ga(M.nodesRef.current,Le):[];if(Ee.length>0){let Fe=!0;if(Ee.forEach(Ke=>{Ke.context?.open&&!Ke.context.dataRef.current.__outsidePressBubbles&&(Fe=!1)}),!Fe)return}n.setOpen(!1,Pt(P1,re)),F()}),U=je(re=>{te()!=="sloppy"||re.pointerType==="touch"||!n.select("open")||!p||Ir(re,n.select("floatingElement"))||Ir(re,n.select("domReferenceElement"))||V(re)}),I=je(re=>{if(te()!=="sloppy"||!n.select("open")||!p||Ir(re,n.select("floatingElement"))||Ir(re,n.select("domReferenceElement")))return;const fe=re.touches[0];fe&&(A.current={startTime:Date.now(),startX:fe.clientX,startY:fe.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{A.current&&(A.current.dismissOnTouchEnd=!1,A.current.dismissOnMouseDown=!1)}))}),K=je(re=>{const fe=Sr(re);function ae(){I(re),fe?.removeEventListener(re.type,ae)}fe?.addEventListener(re.type,ae)}),Z=je(re=>{const fe=k.current;if(k.current=!1,D.clear(),re.type==="mousedown"&&A.current&&!A.current.dismissOnMouseDown)return;const ae=Sr(re);function Se(){re.type==="pointerdown"?U(re):V(re,fe),ae?.removeEventListener(re.type,Se)}ae?.addEventListener(re.type,Se)}),W=je(re=>{if(te()!=="sloppy"||!A.current||Ir(re,n.select("floatingElement"))||Ir(re,n.select("domReferenceElement")))return;const fe=re.touches[0];if(!fe)return;const ae=Math.abs(fe.clientX-A.current.startX),Se=Math.abs(fe.clientY-A.current.startY),ye=Math.sqrt(ae*ae+Se*Se);ye>5&&(A.current.dismissOnTouchEnd=!0),ye>10&&(V(re),D.clear(),A.current=null)}),se=je(re=>{const fe=Sr(re);function ae(){W(re),fe?.removeEventListener(re.type,ae)}fe?.addEventListener(re.type,ae)}),ie=je(re=>{te()!=="sloppy"||!A.current||Ir(re,n.select("floatingElement"))||Ir(re,n.select("domReferenceElement"))||(A.current.dismissOnTouchEnd&&V(re),D.clear(),A.current=null)}),he=je(re=>{const fe=Sr(re);function ae(){ie(re),fe?.removeEventListener(re.type,ae)}fe?.addEventListener(re.type,ae)});S.useEffect(()=>{if(!i||!p)return;h.current.__escapeKeyBubbles=z,h.current.__outsidePressBubbles=j;const re=new zi;function fe(ge){n.setOpen(!1,Pt(Pi,ge))}function ae(){re.clear(),P.current=!0}function Se(){re.start(Rh()?5:0,()=>{P.current=!1})}const ye=_t(o);ye.addEventListener("pointerdown",X,!0),y&&(ye.addEventListener("keydown",L),ye.addEventListener("compositionstart",ae),ye.addEventListener("compositionend",Se)),N&&(ye.addEventListener("click",Z,!0),ye.addEventListener("pointerdown",Z,!0),ye.addEventListener("touchstart",K,!0),ye.addEventListener("touchmove",se,!0),ye.addEventListener("touchend",he,!0),ye.addEventListener("mousedown",Z,!0));let be=[];return _&&(Tt(u)&&(be=Oi(u)),Tt(o)&&(be=be.concat(Oi(o))),!Tt(l)&&l&&l.contextElement&&(be=be.concat(Oi(l.contextElement)))),be=be.filter(ge=>ge!==ye.defaultView?.visualViewport),be.forEach(ge=>{ge.addEventListener("scroll",fe,{passive:!0})}),()=>{ye.removeEventListener("pointerdown",X,!0),y&&(ye.removeEventListener("keydown",L),ye.removeEventListener("compositionstart",ae),ye.removeEventListener("compositionend",Se)),N&&(ye.removeEventListener("click",Z,!0),ye.removeEventListener("pointerdown",Z,!0),ye.removeEventListener("touchstart",K,!0),ye.removeEventListener("touchmove",se,!0),ye.removeEventListener("touchend",he,!0),ye.removeEventListener("mousedown",Z,!0)),be.forEach(ge=>{ge.removeEventListener("scroll",fe)}),re.clear(),k.current=!1}},[h,o,l,u,y,N,i,f,_,p,z,j,L,V,Z,U,K,se,he,X,n]),S.useEffect(F,[N,F]);const xe=S.useMemo(()=>({onKeyDown:L,...x&&{[iF[E]]:re=>{n.setOpen(!1,Pt(Lw,re.nativeEvent))},...E!=="intentional"&&{onClick(re){n.setOpen(!1,Pt(Lw,re.nativeEvent))}}}}),[L,n,x,E]),de=je(re=>{const fe=Sr(re.nativeEvent);!Rt(n.select("floatingElement"),fe)||re.button!==0||(k.current=!0)}),Be=je(re=>{!i||!p||re.button!==0||(k.current=!0)}),_e=S.useMemo(()=>({onKeyDown:L,onPointerDown:de,onMouseDown:de,onMouseUp:de,onClickCapture:H,onMouseDownCapture(re){H(),Be(re)},onPointerDownCapture(re){H(),Be(re)},onMouseUpCapture:H,onTouchEndCapture:H,onTouchMoveCapture:H}),[L,de,H,Be]);return S.useMemo(()=>p?{reference:xe,floating:_e,trigger:xe}:{},[p,xe,_e])}n1({memoize:p4,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const ke=(e,t,n,i,o,l,...u)=>{if(u.length>0)throw new Error(nn(1));let f;if(e)f=e;else throw new Error("Missing arguments");return f};var lF=VR();const cF=qv(19),uF=cF?dF:hF;function st(e,t,n,i,o){return uF(e,t,n,i,o)}function fF(e,t,n,i,o){const l=S.useCallback(()=>t(e.getSnapshot(),n,i,o),[e,t,n,i,o]);return lF.useSyncExternalStore(e.subscribe,l,l)}function dF(e,t,n,i,o){return fF(e,t,n,i,o)}function hF(e,t,n,i,o){return $R.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,l=>t(l,n,i,o))}class pF{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const i of this.listeners){if(n!==this.updateTick)return;i(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,i,o){return st(this,t,n,i,o)}}class kN extends pF{constructor(t,n={},i){super(t),this.context=n,this.selectors=i}useSyncedValue(t,n){S.useDebugValue(t),De(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const i=this;De(()=>(i.state[t]!==n&&i.set(t,n),()=>{i.set(t,void 0)}),[i,t,n])}useSyncedValues(t){const n=this,i=Object.values(t);De(()=>{n.update(t)},[n,...i])}useControlledProp(t,n){S.useDebugValue(t);const i=n!==void 0;De(()=>{i&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,i])}select(t,n,i,o){const l=this.selectors[t];return l(this.state,n,i,o)}useState(t,n,i,o){return S.useDebugValue(t),st(this,this.selectors[t],n,i,o)}useContextCallback(t,n){S.useDebugValue(t);const i=je(n??mn);this.context[t]=i}useStateSetter(t){const n=S.useRef(void 0);return n.current===void 0&&(n.current=i=>{this.set(t,i)}),n.current}observe(t,n){let i;typeof t=="function"?i=t:i=this.selectors[t];let o=i(this.state);return n(o,o,this),this.subscribe(l=>{const u=i(l);if(!Object.is(o,u)){const f=o;o=u,n(u,f,this)}})}}const mF={open:ke(e=>e.open),domReferenceElement:ke(e=>e.domReferenceElement),referenceElement:ke(e=>e.positionReference??e.referenceElement),floatingElement:ke(e=>e.floatingElement),floatingId:ke(e=>e.floatingId)};class ob extends kN{constructor(t){const{nested:n,noEmit:i,onOpenChange:o,triggerElements:l,...u}=t;super({...u,positionReference:u.referenceElement,domReferenceElement:u.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:o6(),nested:n,noEmit:i,triggerElements:l},mF)}setOpen=(t,n)=>{if((!t||!this.state.open||CH(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const i={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",i)}this.context.onOpenChange?.(t,n)}}function Lh(e,t=!1,n=!1){const[i,o]=S.useState(e&&t?"idle":void 0),[l,u]=S.useState(e);return e&&!l&&(u(!0),o("starting")),!e&&l&&i!=="ending"&&!n&&o("ending"),!e&&!l&&i==="ending"&&o(void 0),De(()=>{if(!e&&l&&i!=="ending"&&n){const f=Jr.request(()=>{o("ending")});return()=>{Jr.cancel(f)}}},[e,l,i,n]),De(()=>{if(!e||t)return;const f=Jr.request(()=>{o(void 0)});return()=>{Jr.cancel(f)}},[t,e]),De(()=>{if(!e||!t)return;e&&l&&i!=="idle"&&o("starting");const f=Jr.request(()=>{o("idle")});return()=>{Jr.cancel(f)}},[t,e,l,o,i]),S.useMemo(()=>({mounted:l,setMounted:u,transitionStatus:i}),[l,i])}let Qc=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const gF={[Qc.startingStyle]:""},yF={[Qc.endingStyle]:""},Ko={transitionStatus(e){return e==="starting"?gF:e==="ending"?yF:null}};function vF(e,t=!1,n=!0){const i=rb();return je((o,l=null)=>{i.cancel();function u(){Fi.flushSync(o)}const f=Cs(e);if(f==null)return;const h=f;if(typeof h.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)o();else{let v=function(){const x=Qc.startingStyle;if(!h.hasAttribute(x)){i.request(b);return}const E=new MutationObserver(()=>{h.hasAttribute(x)||(E.disconnect(),b())});E.observe(h,{attributes:!0,attributeFilter:[x]}),l?.addEventListener("abort",()=>E.disconnect(),{once:!0})},b=function(){Promise.all(h.getAnimations().map(x=>x.finished)).then(()=>{l?.aborted||u()}).catch(()=>{const x=h.getAnimations();if(n){if(l?.aborted)return;u()}else x.length>0&&x.some(E=>E.pending||E.playState!=="finished")&&b()})};var p=v,y=b;if(t){v();return}i.request(b)}})}function Yo(e){const{enabled:t=!0,open:n,ref:i,onComplete:o}=e,l=je(o),u=vF(i,n,!1);S.useEffect(()=>{if(!t)return;const f=new AbortController;return u(l,f.signal),()=>{f.abort()}},[t,n,l,u])}function bF(e){const t=e.useState("open");De(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[i,o]=n.value;e.update({activeTriggerId:i,activeTriggerElement:o})}}},[t,e])}function xF(e,t,n){const{mounted:i,setMounted:o,transitionStatus:l}=Lh(e);t.useSyncedValues({mounted:i,transitionStatus:l});const u=je(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),f=t.useState("preventUnmountingOnClose");return Yo({enabled:!f,open:e,ref:t.context.popupRef,onComplete(){e||u()}}),{forceUnmount:u,transitionStatus:l}}class ab{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const i=this.idMap.get(t);i!==n&&(i!==void 0&&this.elementsSet.delete(i),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function SF(){return new ob({open:!1,floatingElement:null,referenceElement:null,triggerElements:new ab,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function EF(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:SF(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Kt,inactiveTriggerProps:Kt,popupProps:Kt}}const nd=ke(e=>e.triggerIdProp??e.activeTriggerId),_F={open:ke(e=>e.openProp??e.open),mounted:ke(e=>e.mounted),transitionStatus:ke(e=>e.transitionStatus),floatingRootContext:ke(e=>e.floatingRootContext),preventUnmountingOnClose:ke(e=>e.preventUnmountingOnClose),payload:ke(e=>e.payload),activeTriggerId:nd,activeTriggerElement:ke(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:ke((e,t)=>t!==void 0&&nd(e)===t),isOpenedByTrigger:ke((e,t)=>t!==void 0&&nd(e)===t&&e.open),isMountedByTrigger:ke((e,t)=>t!==void 0&&nd(e)===t&&e.mounted),triggerProps:ke((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:ke(e=>e.popupProps),popupElement:ke(e=>e.popupElement),positionerElement:ke(e=>e.positionerElement)};function wF(e){const{open:t=!1,onOpenChange:n,elements:i={}}=e,o=pu(),l=kh()!=null,u=En(()=>new ob({open:t,onOpenChange:n,referenceElement:i.reference??null,floatingElement:i.floating??null,triggerElements:new ab,floatingId:o,nested:l,noEmit:!1})).current;return De(()=>{const f={open:t,floatingId:o};i.reference!==void 0&&(f.referenceElement=i.reference,f.domReferenceElement=Tt(i.reference)?i.reference:null),i.floating!==void 0&&(f.floatingElement=i.floating),u.update(f)},[t,o,i.reference,i.floating,u]),u.context.onOpenChange=n,u.context.nested=l,u.context.noEmit=!1,u}function TF(e={}){const{nodeId:t,externalTree:n}=e,i=wF(e),o=e.rootContext||i,l={reference:o.useState("referenceElement"),floating:o.useState("floatingElement"),domReference:o.useState("domReferenceElement")},[u,f]=S.useState(null),h=S.useRef(null),p=Ih(n);De(()=>{l.domReference&&(h.current=l.domReference)},[l.domReference]);const y=Z6({...e,elements:{...l,...u&&{reference:u}}}),v=S.useCallback(j=>{const A=Tt(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),getClientRects:()=>j.getClientRects(),contextElement:j}:j;f(A),y.refs.setReference(A)},[y.refs]),[b,x]=S.useState(null),[E,_]=S.useState(null);o.useSyncedValue("referenceElement",b),o.useSyncedValue("domReferenceElement",Tt(b)?b:null),o.useSyncedValue("floatingElement",E);const T=S.useCallback(j=>{(Tt(j)||j===null)&&(h.current=j,x(j)),(Tt(y.refs.reference.current)||y.refs.reference.current===null||j!==null&&!Tt(j))&&y.refs.setReference(j)},[y.refs,x]),C=S.useCallback(j=>{_(j),y.refs.setFloating(j)},[y.refs]),M=S.useMemo(()=>({...y.refs,setReference:T,setFloating:C,setPositionReference:v,domReference:h}),[y.refs,T,C,v]),R=S.useMemo(()=>({...y.elements,domReference:l.domReference}),[y.elements,l.domReference]),N=o.useState("open"),k=o.useState("floatingId"),z=S.useMemo(()=>({...y,dataRef:o.context.dataRef,open:N,onOpenChange:o.setOpen,events:o.context.events,floatingId:k,refs:M,elements:R,nodeId:t,rootStore:o}),[y,M,R,t,o,N,k]);return De(()=>{o.context.dataRef.current.floatingContext=z;const j=p?.nodesRef.current.find(A=>A.id===t);j&&(j.context=z)}),S.useMemo(()=>({...y,context:z,refs:M,elements:R,rootStore:o}),[y,M,R,z,o])}function CF(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:i=!1,onOpenChange:o}=e,l=pu(),u=kh()!=null,f=t.useState("open"),h=t.useState("activeTriggerElement"),p=t.useState(i?"popupElement":"positionerElement"),y=t.context.triggerElements,v=En(()=>new ob({open:f,referenceElement:h,floatingElement:p,triggerElements:y,onOpenChange:o,floatingId:l,nested:u,noEmit:n})).current;return De(()=>{const b={open:f,floatingId:l,referenceElement:h,floatingElement:p};Tt(h)&&(b.domReferenceElement=h),v.state.positionReference===v.state.referenceElement&&(b.positionReference=h),v.update(b)},[f,l,h,p,v]),v.context.onOpenChange=o,v.context.nested=u,v.context.noEmit=n,v}const nT=Xc("safe-polygon"),RF=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${oN}`;function NF(e){return e?!!e.closest(RF):!1}class lb{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.unbindMouseMove=()=>{},this.restTimeoutPending=!1,this.openChangeTimeout=new zi,this.restTimeout=new zi,this.handleCloseOptions=void 0}static create(){return new lb}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}function jF(e){const t=En(lb.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),Zv(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const MF=new Set(["click","mousedown"]);function AF(e,t={}){const n="rootStore"in e?e.rootStore:e,i=n.useState("open"),o=n.useState("floatingElement"),l=n.useState("domReferenceElement"),{dataRef:u}=n.context,{enabled:f=!0,closeDelay:h=0}=t,p=jF(n),y=Ih(),v=kh(),b=je(()=>p.interactedInside?!0:u.current.openEvent?MF.has(u.current.openEvent.type):!1),x=je(()=>{const R=u.current.openEvent?.type;return R?.includes("mouse")&&R!=="mousedown"}),E=je(R=>xH(R,n.context.triggerElements)),_=S.useCallback((R,N=!0)=>{const k=OF(h,p.pointerType);k&&!p.handler?p.openChangeTimeout.start(k,()=>n.setOpen(!1,Pt(zy,R))):N&&(p.openChangeTimeout.clear(),n.setOpen(!1,Pt(zy,R)))},[h,n,p]),T=je(()=>{p.unbindMouseMove(),p.handler=void 0}),C=je(()=>{if(p.performedPointerEventsMutation){const R=_t(o).body;R.style.pointerEvents="",R.removeAttribute(nT),p.performedPointerEventsMutation=!1}}),M=je(R=>{const N=Sr(R);if(!NF(N)){p.interactedInside=!1;return}p.interactedInside=!0});De(()=>{i||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,T(),C())},[i,p,T,C]),S.useEffect(()=>()=>{T()},[T]),S.useEffect(()=>C,[C]),De(()=>{if(f&&i&&p.handleCloseOptions?.blockPointerEvents&&x()&&Tt(l)&&o){p.performedPointerEventsMutation=!0;const R=_t(o).body;R.setAttribute(nT,"");const N=l,k=o,z=y?.nodesRef.current.find(j=>j.id===v)?.context?.elements.floating;return z&&(z.style.pointerEvents=""),R.style.pointerEvents="none",N.style.pointerEvents="auto",k.style.pointerEvents="auto",()=>{R.style.pointerEvents="",N.style.pointerEvents="",k.style.pointerEvents=""}}},[f,i,l,o,p,x,y,v]),S.useEffect(()=>{if(!f)return;function R(j){b()||!u.current.floatingContext||!n.select("open")||E(j.relatedTarget)||(C(),T(),b()||_(j))}function N(j){p.openChangeTimeout.clear(),C(),p.handler?.(j),T()}function k(j){b()||_(j,!1)}const z=o;return z&&(z.addEventListener("mouseleave",R),z.addEventListener("mouseenter",N),z.addEventListener("mouseleave",k),z.addEventListener("pointerdown",M,!0)),()=>{z&&(z.removeEventListener("mouseleave",R),z.removeEventListener("mouseenter",N),z.removeEventListener("mouseleave",k),z.removeEventListener("pointerdown",M,!0))}},[f,o,n,u,b,E,_,C,T,M,p])}function OF(e,t){return t&&!TH(t)?0:typeof e=="function"?e():e}function kF(e=[]){const t=e.map(p=>p?.reference),n=e.map(p=>p?.floating),i=e.map(p=>p?.item),o=e.map(p=>p?.trigger),l=S.useCallback(p=>rd(p,e,"reference"),t),u=S.useCallback(p=>rd(p,e,"floating"),n),f=S.useCallback(p=>rd(p,e,"item"),i),h=S.useCallback(p=>rd(p,e,"trigger"),o);return S.useMemo(()=>({getReferenceProps:l,getFloatingProps:u,getItemProps:f,getTriggerProps:h}),[l,u,f,h])}function rd(e,t,n){const i=new Map,o=n==="item",l={};n==="floating"&&(l.tabIndex=-1,l[By]="");for(const u in e)o&&e&&(u===sN||u===iN)||(l[u]=e[u]);for(let u=0;u<t.length;u+=1){let f;const h=t[u]?.[n];typeof h=="function"?f=e?h(e):null:f=h,f&&rT(l,f,o,i)}return rT(l,e,o,i),l}function rT(e,t,n,i){for(const o in t){const l=t[o];n&&(o===sN||o===iN)||(o.startsWith("on")?(i.has(o)||i.set(o,[]),typeof l=="function"&&(i.get(o)?.push(l),e[o]=(...u)=>i.get(o)?.map(f=>f(...u)).find(f=>f!==void 0))):e[o]=l)}}const IF=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function DF(e,t={}){const n="rootStore"in e?e.rootStore:e,i=n.useState("open"),o=n.useState("floatingId"),l=n.useState("domReferenceElement"),u=n.useState("floatingElement"),{role:f="dialog"}=t,h=pu(),p=l?.id||h,y=S.useMemo(()=>Zd(u)?.id||o,[u,o]),v=IF.get(f)??f,x=kh()!=null,E=S.useMemo(()=>v==="tooltip"||f==="label"?Kt:{"aria-haspopup":v==="alertdialog"?"dialog":v,"aria-expanded":"false",...v==="listbox"&&{role:"combobox"},...v==="menu"&&x&&{role:"menuitem"},...f==="select"&&{"aria-autocomplete":"none"},...f==="combobox"&&{"aria-autocomplete":"list"}},[v,x,f]),_=S.useMemo(()=>v==="tooltip"||f==="label"?{[`aria-${f==="label"?"labelledby":"describedby"}`]:i?y:void 0}:{...E,"aria-expanded":i?"true":"false","aria-controls":i?y:void 0,...v==="menu"&&{id:p}},[v,y,i,p,f,E]),T=S.useMemo(()=>{const M={id:y,...v&&{role:v}};return v==="tooltip"||f==="label"?M:{...M,...v==="menu"&&{"aria-labelledby":p}}},[v,y,p,f]),C=S.useCallback(({active:M,selected:R})=>{const N={role:"option",...M&&{id:`${y}-fui-option`}};switch(f){case"select":case"combobox":return{...N,"aria-selected":R}}return{}},[y,f]);return S.useMemo(()=>({reference:_,floating:T,item:C,trigger:E}),[_,T,E,C])}let Co=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Qc.startingStyle]="startingStyle",e[e.endingStyle=Qc.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),sT=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const LF={[sT.popupOpen]:"",[sT.pressed]:""},PF={[Co.open]:""},zF={[Co.closed]:""},UF={[Co.anchorHidden]:""},BF={open(e){return e?LF:null}},Nl={open(e){return e?PF:zF},anchorHidden(e){return e?UF:null}},IN=S.createContext(void 0);function HF(){const e=S.useContext(IN);if(e===void 0)throw new Error(nn(70));return e}const FF=S.forwardRef(function(t,n){const{children:i,container:o,className:l,render:u,...f}=t,{portalNode:h,portalSubtree:p}=EN({container:o,ref:n,componentProps:t,elementProps:f});return!p&&!h?null:d.jsxs(S.Fragment,{children:[p,h&&Fi.createPortal(i,h)]})}),qF=S.forwardRef(function(t,n){const{keepMounted:i=!1,...o}=t;return Wv().useState("mounted")||i?d.jsx(IN.Provider,{value:i,children:d.jsx(FF,{ref:n,...o})}):null}),DN=S.createContext(void 0);function VF(){const e=S.useContext(DN);if(e===void 0)throw new Error(nn(71));return e}const $F=S.createContext(void 0);function LN(){return S.useContext($F)?.direction??"ltr"}const GF=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:o,rects:l,platform:u,elements:f,middlewareData:h}=t,{element:p,padding:y=0,offsetParent:v="real"}=Hs(e,t)||{};if(p==null)return{};const b=lN(y),x={x:n,y:i},E=nb(o),_=tb(E),T=await u.getDimensions(p),C=E==="y",M=C?"top":"left",R=C?"bottom":"right",N=C?"clientHeight":"clientWidth",k=l.reference[_]+l.reference[E]-x[E]-l.floating[_],z=x[E]-l.reference[E],j=v==="real"?await u.getOffsetParent?.(p):f.floating;let A=f.floating[N]||l.floating[_];(!A||!await u.isElement?.(j))&&(A=f.floating[N]||l.floating[_]);const D=k/2-z/2,G=A/2-T[_]/2-1,F=Math.min(b[M],G),P=Math.min(b[R],G),Q=F,X=A-T[_]-P,te=A/2-T[_]/2+D,L=Hy(Q,te,X),$=!h.arrow&&Xi(o)!=null&&te!==L&&l.reference[_]/2-(te<Q?F:P)-T[_]/2<0,H=$?te<Q?te-Q:te-X:0;return{[E]:x[E]+H,data:{[E]:L,centerOffset:te-L-H,...$&&{alignmentOffset:H}},reset:$}}}),KF=(e,t)=>({...GF(e),options:[e,t]}),YF={name:"hide",async fn(e){const{width:t,height:n,x:i,y:o}=e.rects.reference,l=t===0&&n===0&&i===0&&o===0;return{data:{referenceHidden:(await sF().fn(e)).data?.referenceHidden||l}}}},wd={sideX:"left",sideY:"top"},XF={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:i},elements:{floating:o},platform:l,strategy:u,placement:f}=e,h=Xt(o),p=h.getComputedStyle(o);if(!(p.transitionDuration!=="0s"&&p.transitionDuration!==""))return{x:t,y:n,data:wd};const v=await l.getOffsetParent?.(o);let b={width:0,height:0};if(u==="fixed"&&h?.visualViewport)b={width:h.visualViewport.width,height:h.visualViewport.height};else if(v===h){const M=_t(o);b={width:M.documentElement.clientWidth,height:M.documentElement.clientHeight}}else await l.isElement?.(v)&&(b=await l.getDimensions(v));const x=On(f);let E=t,_=n;x==="left"&&(E=b.width-(t+i.width)),x==="top"&&(_=b.height-(n+i.height));const T=x==="left"?"right":wd.sideX,C=x==="top"?"bottom":wd.sideY;return{x:E,y:_,data:{sideX:T,sideY:C}}}};function PN(e,t,n){const i=e==="inline-start"||e==="inline-end";return{top:"top",right:i?n?"inline-start":"inline-end":"right",bottom:"bottom",left:i?n?"inline-end":"inline-start":"left"}[t]}function iT(e,t,n){const{rects:i,placement:o}=e;return{side:PN(t,On(o),n),align:Xi(o)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function zN(e){const{anchor:t,positionMethod:n="absolute",side:i="bottom",sideOffset:o=0,align:l="center",alignOffset:u=0,collisionBoundary:f,collisionPadding:h=5,sticky:p=!1,arrowPadding:y=5,disableAnchorTracking:v=!1,keepMounted:b=!1,floatingRootContext:x,mounted:E,collisionAvoidance:_,shiftCrossAxis:T=!1,nodeId:C,adaptiveOrigin:M,lazyFlip:R=!1,externalTree:N}=e,[k,z]=S.useState(null);!E&&k!==null&&z(null);const j=_.side||"flip",A=_.align||"flip",D=_.fallbackAxisSide||"end",G=typeof t=="function"?t:void 0,F=je(G),P=G?F:t,Q=ki(t),te=LN()==="rtl",L=k||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":te?"left":"right","inline-start":te?"right":"left"}[i],$=l==="center"?L:`${L}-${l}`;let H=h;const V=1,U=i==="bottom"?V:0,I=i==="top"?V:0,K=i==="right"?V:0,Z=i==="left"?V:0;typeof H=="number"?H={top:H+U,right:H+Z,bottom:H+I,left:H+K}:H&&(H={top:(H.top||0)+U,right:(H.right||0)+Z,bottom:(H.bottom||0)+I,left:(H.left||0)+K});const W={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:H},se=S.useRef(null),ie=ki(o),he=ki(u),Be=[J6(nt=>{const Bt=iT(nt,i,te),rn=typeof ie.current=="function"?ie.current(Bt):ie.current,Ct=typeof he.current=="function"?he.current(Bt):he.current;return{mainAxis:rn,crossAxis:Ct,alignmentAxis:Ct}},[typeof o!="function"?o:0,typeof u!="function"?u:0,te,i])],_e=A==="none"&&j!=="shift",re=!_e&&(p||T||j==="shift"),fe=j==="none"?null:nF({...W,padding:{top:H.top+V,right:H.right+V,bottom:H.bottom+V,left:H.left+V},mainAxis:!T&&j==="flip",crossAxis:A==="flip"?"alignment":!1,fallbackAxisSideDirection:D}),ae=_e?null:eF(nt=>{const Bt=_t(nt.elements.floating).documentElement;return{...W,rootBoundary:T?{x:0,y:0,width:Bt.clientWidth,height:Bt.clientHeight}:void 0,mainAxis:A!=="none",crossAxis:re,limiter:p||T?void 0:tF(rn=>{if(!se.current)return{};const{width:Ct,height:dn}=se.current.getBoundingClientRect(),Ln=wr(On(rn.placement)),gn=Ln==="y"?Ct:dn,qr=Ln==="y"?H.left+H.right:H.top+H.bottom;return{offset:gn/2+qr/2}})}},[W,p,T,H,A]);j==="shift"||A==="shift"||l==="center"?Be.push(ae,fe):Be.push(fe,ae),Be.push(rF({...W,apply({elements:{floating:nt},rects:{reference:Bt},availableWidth:rn,availableHeight:Ct}){const dn=nt.style;dn.setProperty("--available-width",`${rn}px`),dn.setProperty("--available-height",`${Ct}px`),dn.setProperty("--anchor-width",`${Bt.width}px`),dn.setProperty("--anchor-height",`${Bt.height}px`)}}),KF(()=>({element:se.current||document.createElement("div"),padding:y,offsetParent:"floating"}),[y]),{name:"transformOrigin",fn(nt){const{elements:Bt,middlewareData:rn,placement:Ct,rects:dn,y:Ln}=nt,gn=On(Ct),qr=wr(gn),Vr=se.current,Qo=rn.arrow?.x||0,Wi=rn.arrow?.y||0,Zi=Vr?.clientWidth||0,is=Vr?.clientHeight||0,Pn=Qo+Zi/2,$r=Wi+is/2,$s=Math.abs(rn.shift?.y||0),Gs=dn.reference.height/2,zn=typeof o=="function"?o(iT(nt,i,te)):o,Ml=$s>zn,_u={top:`${Pn}px calc(100% + ${zn}px)`,bottom:`${Pn}px ${-zn}px`,left:`calc(100% + ${zn}px) ${$r}px`,right:`${-zn}px ${$r}px`}[gn],wu=`${Pn}px ${dn.reference.y+Gs-Ln}px`;return Bt.floating.style.setProperty("--transform-origin",re&&qr==="y"&&Ml?wu:_u),{}}},YF,M),De(()=>{!E&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[E,x]);const Se=S.useMemo(()=>({elementResize:!v&&typeof ResizeObserver<"u",layoutShift:!v&&typeof IntersectionObserver<"u"}),[v]),{refs:ye,elements:be,x:ge,y:Le,middlewareData:Oe,update:Ee,placement:Fe,context:Ke,isPositioned:ze,floatingStyles:Xe}=TF({rootContext:x,placement:$,middleware:Be,strategy:n,whileElementsMounted:b?void 0:(...nt)=>eT(...nt,Se),nodeId:C,externalTree:N}),{sideX:Ue,sideY:pe}=Oe.adaptiveOrigin||wd,we=ze?n:"fixed",He=S.useMemo(()=>{const nt=M?{position:we,[Ue]:ge,[pe]:Le}:{position:we,...Xe};return ze||(nt.opacity=0),nt},[M,we,Ue,ge,pe,Le,Xe,ze]),dt=S.useRef(null);De(()=>{if(!E)return;const nt=Q.current,Bt=typeof nt=="function"?nt():nt,Ct=(oT(Bt)?Bt.current:Bt)||null||null;Ct!==dt.current&&(ye.setPositionReference(Ct),dt.current=Ct)},[E,ye,P,Q]),S.useEffect(()=>{if(!E)return;const nt=Q.current;typeof nt!="function"&&oT(nt)&&nt.current!==dt.current&&(ye.setPositionReference(nt.current),dt.current=nt.current)},[E,ye,P,Q]),S.useEffect(()=>{if(b&&E&&be.domReference&&be.floating)return eT(be.domReference,be.floating,Ee,Se)},[b,E,be,Ee,Se]);const ot=On(Fe),or=PN(i,ot,te),ar=Xi(Fe)||"center",Ut=!!Oe.hide?.referenceHidden;De(()=>{R&&E&&ze&&z(ot)},[R,E,ze,ot]);const at=S.useMemo(()=>({position:"absolute",top:Oe.arrow?.y,left:Oe.arrow?.x}),[Oe.arrow]),yt=Oe.arrow?.centerOffset!==0;return S.useMemo(()=>({positionerStyles:He,arrowStyles:at,arrowRef:se,arrowUncentered:yt,side:or,align:ar,physicalSide:ot,anchorHidden:Ut,refs:ye,context:Ke,isPositioned:ze,update:Ee}),[He,at,se,yt,or,ar,ot,Ut,ye,Ke,ze,Ee])}function oT(e){return e!=null&&"current"in e}function Ph(e){return e==="starting"?WU:Kt}const QF=S.forwardRef(function(t,n){const{render:i,className:o,anchor:l,positionMethod:u="absolute",side:f="top",align:h="center",sideOffset:p=0,alignOffset:y=0,collisionBoundary:v="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:E=!1,disableAnchorTracking:_=!1,collisionAvoidance:T=eB,...C}=t,M=Wv(),R=HF(),N=M.useState("open"),k=M.useState("mounted"),z=M.useState("trackCursorAxis"),j=M.useState("disableHoverablePopup"),A=M.useState("floatingRootContext"),D=M.useState("instantType"),G=M.useState("transitionStatus"),F=M.useState("hasViewport"),P=zN({anchor:l,positionMethod:u,floatingRootContext:A,mounted:k,side:f,sideOffset:p,align:h,alignOffset:y,collisionBoundary:v,collisionPadding:b,sticky:E,arrowPadding:x,disableAnchorTracking:_,keepMounted:R,collisionAvoidance:T,adaptiveOrigin:F?XF:void 0}),Q=S.useMemo(()=>{const $={};return(!N||z==="both"||j)&&($.pointerEvents="none"),{role:"presentation",hidden:!k,style:{...P.positionerStyles,...$}}},[N,z,j,k,P.positionerStyles]),X=S.useMemo(()=>({open:N,side:P.side,align:P.align,anchorHidden:P.anchorHidden,instant:z!=="none"?"tracking-cursor":D}),[N,P.side,P.align,P.anchorHidden,z,D]),te=S.useMemo(()=>({...X,arrowRef:P.arrowRef,arrowStyles:P.arrowStyles,arrowUncentered:P.arrowUncentered}),[X,P.arrowRef,P.arrowStyles,P.arrowUncentered]),L=At("div",t,{state:X,props:[Q,Ph(G),C],ref:[n,M.useStateSetter("positionerElement")],stateAttributesMapping:Nl});return d.jsx(DN.Provider,{value:te,children:L})}),WF={...Nl,...Ko},ZF=S.forwardRef(function(t,n){const{className:i,render:o,...l}=t,u=Wv(),{side:f,align:h}=VF(),p=u.useState("open"),y=u.useState("instantType"),v=u.useState("transitionStatus"),b=u.useState("popupProps"),x=u.useState("floatingRootContext");Yo({open:p,ref:u.context.popupRef,onComplete(){p&&u.context.onOpenChangeComplete?.(!0)}});const E=u.useState("disabled"),_=u.useState("closeDelay");return AF(x,{enabled:!E,closeDelay:_}),At("div",t,{state:{open:p,side:f,align:h,instant:y,transitionStatus:v},ref:[n,u.context.popupRef,u.useStateSetter("popupElement")],props:[b,Ph(v),l],stateAttributesMapping:WF})});function cb(e){return qv(19)?e:e?"true":void 0}const JF=S.forwardRef(({className:e,sideOffset:t=4,children:n,...i},o)=>d.jsx(qF,{children:d.jsx(QF,{sideOffset:t,children:d.jsx(ZF,{ref:o,className:me("bg-[#1e1e1e] border border-neutral-700 rounded-md px-2.5 py-1.5 text-xs text-neutral-300 font-mono shadow-lg",e),...i,children:n})})}));JF.displayName="TooltipContent";function aT(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const UN=S.forwardRef(({className:e,clients:t,positions:n,relayClientIds:i=[],serverPosition:o={x:420,y:190},relayPosition:l={x:780,y:190},viewBox:u={width:1200,height:380},totalNodes:f,onlineCount:h,offlineCount:p,...y},v)=>{const b=o.x,x=o.y,E=l.x,_=l.y,T={},C=2*Math.PI/Math.max(t.length,1);t.forEach((j,A)=>{const D=i.includes(j.id),G=D?E:b,F=D?_:x,P=D?240:260,Q=D?130:150,X=C*A-Math.PI/2;T[j.id]={x:G+P*Math.cos(X),y:F+Q*Math.sin(X)}});const M={};if(n)for(const j of n)M[j.clientId]={x:j.x,y:j.y};function R(j){return M[j]??T[j]??{x:600,y:190}}const N=f??t.length+2,k=h??t.filter(j=>j.status!=="offline").length,z=p??t.filter(j=>j.status==="offline").length;return d.jsxs("div",{ref:v,className:me("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},...y,children:[d.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"}),d.jsx("div",{className:"absolute top-4 left-5 z-10",children:d.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Sync Topology"})}),d.jsxs("div",{className:"absolute top-4 right-5 z-10 flex items-center gap-3",children:[d.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[N," nodes"]}),d.jsx("span",{className:"font-mono text-[10px] text-neutral-600",children:"·"}),d.jsxs("span",{className:"font-mono text-[10px] text-healthy",children:[k," online"]}),d.jsx("span",{className:"font-mono text-[10px] text-neutral-600",children:"·"}),d.jsxs("span",{className:"font-mono text-[10px] text-offline",children:[z," offline"]})]}),d.jsxs("svg",{viewBox:`0 0 ${u.width} ${u.height}`,className:"w-full h-full",preserveAspectRatio:"xMidYMid meet",children:[d.jsx("ellipse",{cx:b,cy:x,rx:280,ry:160,fill:"none",stroke:"#1a1a1a",strokeWidth:.5,strokeDasharray:"6 10"}),d.jsx("ellipse",{cx:E,cy:_,rx:260,ry:140,fill:"none",stroke:"#1a1a1a",strokeWidth:.5,strokeDasharray:"6 10"}),d.jsx("line",{x1:b,y1:x,x2:E,y2:_,stroke:"#8b5cf6",strokeWidth:2,opacity:.3}),d.jsx("line",{x1:b,y1:x,x2:E,y2:_,stroke:"#8b5cf6",strokeWidth:1,strokeDasharray:"4 2",opacity:.6,children:d.jsx("animate",{attributeName:"stroke-dashoffset",from:"20",to:"0",dur:"1s",repeatCount:"indefinite"})}),d.jsxs("circle",{r:3,fill:"#8b5cf6",opacity:.8,children:[d.jsx("animateMotion",{dur:"2.5s",repeatCount:"indefinite",path:`M${b},${x} L${E},${_}`}),d.jsx("animate",{attributeName:"opacity",values:"0;0.8;0.8;0",dur:"2.5s",repeatCount:"indefinite"})]}),d.jsxs("circle",{r:3,fill:"#8b5cf6",opacity:.8,children:[d.jsx("animateMotion",{dur:"2.5s",begin:"1.25s",repeatCount:"indefinite",path:`M${E},${_} L${b},${x}`}),d.jsx("animate",{attributeName:"opacity",values:"0;0.8;0.8;0",dur:"2.5s",begin:"1.25s",repeatCount:"indefinite"})]}),d.jsx("text",{x:(b+E)/2,y:x-20,textAnchor:"middle",fill:"#8b5cf6",fontFamily:"JetBrains Mono, monospace",fontSize:8,opacity:.4,letterSpacing:2,children:"BACKBONE"}),t.map(j=>{const A=R(j.id),D=i.includes(j.id),G=D?E:b,F=D?_:x,P=aT(j.status),Q=j.status==="syncing"?2.5:1.5;if(j.status==="offline")return d.jsx("line",{x1:G,y1:F,x2:A.x,y2:A.y,stroke:P,strokeWidth:1,strokeDasharray:"3 6",opacity:.2},`line-${j.id}`);const X=j.status==="syncing"?"1.2s":"2.8s",te=`${Number.parseFloat(X)/2}s`;return d.jsxs("g",{children:[d.jsx("line",{x1:G,y1:F,x2:A.x,y2:A.y,stroke:P,strokeWidth:Q,strokeDasharray:"4 2",children:d.jsx("animate",{attributeName:"stroke-dashoffset",from:"20",to:"0",dur:"1s",repeatCount:"indefinite"})}),d.jsxs("circle",{r:2.5,fill:P,opacity:.7,children:[d.jsx("animateMotion",{dur:X,repeatCount:"indefinite",path:`M${G},${F} L${A.x},${A.y}`}),d.jsx("animate",{attributeName:"opacity",values:"0;0.7;0.7;0",dur:X,repeatCount:"indefinite"})]}),d.jsxs("circle",{r:2,fill:P,opacity:.5,children:[d.jsx("animateMotion",{dur:X,begin:te,repeatCount:"indefinite",path:`M${A.x},${A.y} L${G},${F}`}),d.jsx("animate",{attributeName:"opacity",values:"0;0.5;0.5;0",dur:X,begin:te,repeatCount:"indefinite"})]})]},`line-${j.id}`)}),d.jsxs("circle",{cx:b,cy:x,r:50,fill:"none",stroke:"#3b82f6",strokeWidth:.5,opacity:.15,children:[d.jsx("animate",{attributeName:"r",from:"32",to:"60",dur:"3s",repeatCount:"indefinite"}),d.jsx("animate",{attributeName:"opacity",from:"0.25",to:"0",dur:"3s",repeatCount:"indefinite"})]}),d.jsxs("circle",{cx:b,cy:x,r:50,fill:"none",stroke:"#3b82f6",strokeWidth:.5,opacity:.15,children:[d.jsx("animate",{attributeName:"r",from:"32",to:"60",dur:"3s",begin:"1.5s",repeatCount:"indefinite"}),d.jsx("animate",{attributeName:"opacity",from:"0.25",to:"0",dur:"3s",begin:"1.5s",repeatCount:"indefinite"})]}),d.jsx("circle",{cx:b,cy:x,r:32,fill:"#0c0c0c",stroke:"#3b82f6",strokeWidth:2,style:{filter:"drop-shadow(0 0 12px rgba(59,130,246,0.4))"}}),d.jsx("circle",{cx:b,cy:x,r:16,fill:"rgba(59,130,246,0.12)",stroke:"#3b82f6",strokeWidth:.8}),d.jsx("circle",{cx:b,cy:x,r:6,fill:"#3b82f6"}),d.jsx("text",{x:b,y:x+48,textAnchor:"middle",fill:"#444",fontFamily:"JetBrains Mono, monospace",fontSize:9,letterSpacing:2.5,children:"SERVER"}),d.jsxs("circle",{cx:E,cy:_,r:40,fill:"none",stroke:"#8b5cf6",strokeWidth:.5,opacity:.15,children:[d.jsx("animate",{attributeName:"r",from:"26",to:"48",dur:"3.5s",repeatCount:"indefinite"}),d.jsx("animate",{attributeName:"opacity",from:"0.2",to:"0",dur:"3.5s",repeatCount:"indefinite"})]}),d.jsx("circle",{cx:E,cy:_,r:26,fill:"#0c0c0c",stroke:"#8b5cf6",strokeWidth:2,style:{filter:"drop-shadow(0 0 10px rgba(139,92,246,0.35))"}}),d.jsx("circle",{cx:E,cy:_,r:13,fill:"rgba(139,92,246,0.12)",stroke:"#8b5cf6",strokeWidth:.8}),d.jsx("circle",{cx:E,cy:_,r:5,fill:"#8b5cf6"}),d.jsx("text",{x:E,y:_+42,textAnchor:"middle",fill:"#444",fontFamily:"JetBrains Mono, monospace",fontSize:9,letterSpacing:2.5,children:"RELAY"}),t.map(j=>{const A=R(j.id),D=aT(j.status),G=j.status==="offline"?.25:1,F=j.actor.replace("user-","").replace("svc-",""),P=i.includes(j.id);return d.jsxs("g",{opacity:G,children:[d.jsx("circle",{cx:A.x,cy:A.y,r:20,fill:"#0c0c0c",stroke:D,strokeWidth:1.5}),d.jsx("circle",{cx:A.x,cy:A.y,r:5,fill:D}),d.jsx("text",{x:A.x,y:A.y+32,textAnchor:"middle",fill:"#555",fontFamily:"JetBrains Mono, monospace",fontSize:9,children:F}),d.jsxs("text",{x:A.x,y:A.y+42,textAnchor:"middle",fill:"#333",fontFamily:"JetBrains Mono, monospace",fontSize:7,children:[j.type,P?" · relay":""]})]},`node-${j.id}`)})]})]})});UN.displayName="TopologyHero";let lT=(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 BN(e){return S.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[lT.checked]:""}:{[lT.unchecked]:""}},...Ki}),[e.indeterminate])}const eq=S.createContext({disabled:!1});function tq(){return S.useContext(eq)}const nq=S.createContext(void 0);function rq(e=!0){const t=S.useContext(nq);if(t===void 0&&!e)throw new Error(nn(3));return t}const HN=S.createContext(void 0);function sq(){const e=S.useContext(HN);if(e===void 0)throw new Error(nn(14));return e}const iq="data-parent",oq=S.forwardRef(function(t,n){const{checked:i,className:o,defaultChecked:l=!1,disabled:u=!1,id:f,indeterminate:h=!1,inputRef:p,name:y,onCheckedChange:v,parent:b=!1,readOnly:x=!1,render:E,required:_=!1,uncheckedValue:T,value:C,nativeButton:M=!1,...R}=t,{clearErrors:N}=_l(),{disabled:k,name:z,setDirty:j,setFilled:A,setFocused:D,setTouched:G,state:F,validationMode:P,validityData:Q,shouldValidateOnChange:X,validation:te}=Yi(),L=tq(),{labelId:$,controlId:H,registerControlId:V,getDescriptionProps:U}=qs(),I=rq(),K=I?.parent,Z=K&&I.allValues,W=k||L.disabled||I?.disabled||u,se=z??y,ie=C??se,he=tr(),xe=tr();let de=H;Z?de=b?xe:`${K.id}-${ie}`:f&&(de=f);let Be={};Z&&(b?Be=I.parent.getParentProps():ie&&(Be=I.parent.getChildProps(ie)));const _e=je(v),{checked:re=i,indeterminate:fe=h,onCheckedChange:ae,...Se}=Be,ye=I?.value,be=I?.setValue,ge=I?.defaultValue,Le=S.useRef(null),Oe=En(()=>Symbol("checkbox-control")),Ee=S.useRef(!1),{getButtonProps:Fe,buttonRef:Ke}=El({disabled:W,native:M}),ze=I?.validation??te,[Xe,Ue]=_h({controlled:ie&&ye&&!b?ye.includes(ie):re,default:ie&&ge&&!b?ge.includes(ie):l,name:"Checkbox",state:"checked"});De(()=>{V!==mn&&(Ee.current=!0,V(Oe.current,de))},[de,I,V,b,Oe]),S.useEffect(()=>{const at=Oe.current;return()=>{!Ee.current||V===mn||(Ee.current=!1,V(at,void 0))}},[V,Oe]),I1({enabled:!I,id:he,commit:ze.commit,value:Xe,controlRef:Le,name:se,getValue:()=>Xe});const pe=S.useRef(null),we=Us(p,pe,ze.inputRef);De(()=>{pe.current&&(pe.current.indeterminate=fe,Xe&&A(!0))},[Xe,fe,A]),U1(Xe,()=>{I&&!b||(N(se),A(Xe),j(Xe!==Q.initialValue),X()?ze.commit(Xe):ze.commit(Xe,!0))});const He=Li({checked:Xe,disabled:W,name:b?void 0:se,id:M?void 0:de??void 0,required:_,ref:we,style:se?T1:wh,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(at){if(at.nativeEvent.defaultPrevented)return;const yt=at.target.checked,nt=Pt(Pi,at.nativeEvent);if(ae?.(yt,nt),_e(yt,nt),!nt.isCanceled&&(Ue(yt),ie&&ye&&be&&!b)){const Bt=yt?[...ye,ie]:ye.filter(rn=>rn!==ie);be(Bt,nt)}},onFocus(){Le.current?.focus()}},C!==void 0?{value:(I?Xe&&C:C)||""}:Kt,U,I?ze.getValidationProps:ze.getInputValidationProps),dt=Z?!!re:Xe,ot=Z&&fe||h;S.useEffect(()=>{if(!K||!ie)return;const at=K.disabledStatesRef.current;return at.set(ie,W),()=>{at.delete(ie)}},[K,W,ie]);const or=S.useMemo(()=>({...F,checked:dt,disabled:W,readOnly:x,required:_,indeterminate:ot}),[F,dt,W,x,_,ot]),ar=BN(or),Ut=At("span",t,{state:or,ref:[Ke,Le,n,I?.registerControlRef],props:[{id:M?de??void 0:he,role:"checkbox","aria-checked":fe?"mixed":Xe,"aria-readonly":x||void 0,"aria-required":_||void 0,"aria-labelledby":$,[iq]:b?"":void 0,onFocus(){D(!0)},onBlur(){const at=pe.current;at&&(G(!0),D(!1),P==="onBlur"&&ze.commit(I?ye:at.checked))},onClick(at){x||W||(at.preventDefault(),pe.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:at.shiftKey,ctrlKey:at.ctrlKey,altKey:at.altKey,metaKey:at.metaKey})))}},U,ze.getValidationProps,R,Se,Fe],stateAttributesMapping:ar});return d.jsxs(HN.Provider,{value:or,children:[Ut,!Xe&&!I&&se&&!b&&T!==void 0&&d.jsx("input",{type:"hidden",name:se,value:T}),d.jsx("input",{...He})]})}),aq=S.forwardRef(function(t,n){const{render:i,className:o,keepMounted:l=!1,...u}=t,f=sq(),h=f.checked||f.indeterminate,{mounted:p,transitionStatus:y,setMounted:v}=Lh(h),b=S.useRef(null),x={...f,transitionStatus:y};Yo({open:h,ref:b,onComplete(){h||v(!1)}});const E=BN(f),_=S.useMemo(()=>({...E,...Ko,...Ki}),[E]),T=l||p,C=At("span",t,{ref:[n,b],state:x,stateAttributesMapping:_,props:u});return T?C:null}),$y=S.forwardRef(({className:e,label:t,...n},i)=>{const o=d.jsx(oq,{ref:i,className:me("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:d.jsx(aq,{className:"flex items-center justify-center text-white",children:d.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:d.jsx("path",{d:"M1.5 4L3.25 5.75L6.5 2.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})});return t?d.jsxs("span",{className:"inline-flex items-center gap-2 cursor-pointer font-mono text-[11px] text-neutral-400",children:[o,d.jsx("span",{children:t})]}):o});$y.displayName="Checkbox";const lq=S.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function cq(e=!1){const t=S.useContext(lq);if(!t&&!e)throw new Error(nn(86));return t}const uq=function(t){const n=tr(),[i,o]=S.useState(t.initialControlId===void 0?n:t.initialControlId),[l,u]=S.useState(void 0),[f,h]=S.useState([]),p=En(()=>new Map),{messageIds:y}=qs(),v=je((E,_)=>{const T=p.current;if(_===void 0){T.delete(E);return}T.set(E,_),o(C=>{if(T.size===0)return;let M;for(const R of T.values()){if(C!==void 0&&R===C)return C;M===void 0&&(M=R)}return M})}),b=S.useCallback(E=>Li({"aria-describedby":y.concat(f).join(" ")||void 0},E),[y,f]),x=S.useMemo(()=>({controlId:i,registerControlId:v,labelId:l,setLabelId:u,messageIds:f,setMessageIds:h,getDescriptionProps:b}),[i,v,l,u,f,h,b]);return d.jsx(D1.Provider,{value:x,children:t.children})},Td=Object.keys(jh);function fq(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const n of Td)n!=="valid"&&(n==="valueMissing"&&(t=e[n]),e[n]&&(t=!1));return t}function dq(e){const{formRef:t,clearErrors:n}=_l(),{setValidityData:i,validate:o,validityData:l,validationDebounceTime:u,invalid:f,markedDirtyRef:h,state:p,name:y,shouldValidateOnChange:v}=e,{controlId:b,getDescriptionProps:x}=qs(),E=zr(),_=S.useRef(null),T=je(async(R,N=!1)=>{const k=_.current;if(!k)return;if(N){if(p.valid!==!1)return;const Q=k.validity;if(!Q.valueMissing){const te={value:R,state:{...jh,valid:!0},error:"",errors:[],initialValue:l.initialValue};if(k.setCustomValidity(""),b){const L=t.current.fields.get(b);L&&t.current.fields.set(b,{...L,...Py(te,!1)})}i(te);return}const X=Td.reduce((te,L)=>(te[L]=Q[L],te),{});if(!X.valid&&!fq(X))return}function z(Q){const X=Td.reduce((L,$)=>(L[$]=Q.validity[$],L),{});let te=!1;for(const L of Td)if(L!=="valid"){if(L==="valueMissing"&&X[L])te=!0;else if(X[L])return X}return te&&!h.current&&(X.valid=!0,X.valueMissing=!1),X}E.clear();let j=null,A=[];const D=z(k);let G;const F=v();if(k.validationMessage&&!F)G=k.validationMessage,A=[k.validationMessage];else{const Q=Array.from(t.current.fields.values()).reduce((te,L)=>(L.name&&(te[L.name]=L.getValue()),te),{}),X=o(R,Q);typeof X=="object"&&X!==null&&"then"in X?j=await X:j=X,j!==null?(D.valid=!1,D.customError=!0,Array.isArray(j)?(A=j,k.setCustomValidity(j.join(`
|
|
37
|
+
`))):j&&(A=[j],k.setCustomValidity(j))):F&&(k.setCustomValidity(""),D.customError=!1,k.validationMessage?(G=k.validationMessage,A=[k.validationMessage]):k.validity.valid&&!D.valid&&(D.valid=!0))}const P={value:R,state:D,error:G??(Array.isArray(j)?j[0]:j??""),errors:A,initialValue:l.initialValue};if(b){const Q=t.current.fields.get(b);Q&&t.current.fields.set(b,{...Q,...Py(P,f)})}i(P)}),C=S.useCallback((R={})=>Li(x,p.valid===!1?{"aria-invalid":!0}:Kt,R),[x,p.valid]),M=S.useCallback((R={})=>Li({onChange(N){if(N.nativeEvent.defaultPrevented)return;if(n(y),!v()){T(N.currentTarget.value,!0);return}if(f)return;const k=N.currentTarget;if(k.value===""){T(k.value);return}E.clear(),u?E.start(u,()=>{T(k.value)}):T(k.value)}},C(R)),[C,n,y,E,T,f,u,v]);return S.useMemo(()=>({getValidationProps:C,getInputValidationProps:M,inputRef:_,commit:T}),[C,M,T])}const hq=S.forwardRef(function(t,n){const{errors:i,validationMode:o,submitAttemptedRef:l}=_l(),{render:u,className:f,validate:h,validationDebounceTime:p=0,validationMode:y=o,name:v,disabled:b=!1,invalid:x,dirty:E,touched:_,actionsRef:T,...C}=t,{disabled:M}=cq(),R=je(h||(()=>null)),N=M||b,[k,z]=S.useState(!1),[j,A]=S.useState(!1),[D,G]=S.useState(!1),[F,P]=S.useState(!1),Q=E??j,X=_??k,te=S.useRef(!1),L=je(xe=>{E===void 0&&(xe&&(te.current=!0),A(xe))}),$=je(xe=>{_===void 0&&z(xe)}),H=je(()=>y==="onChange"||y==="onSubmit"&&l.current),V=!!(x||v&&{}.hasOwnProperty.call(i,v)&&i[v]!==void 0),[U,I]=S.useState({state:jh,error:"",errors:[],value:null,initialValue:null}),K=!V&&U.state.valid,Z=S.useMemo(()=>({disabled:N,touched:X,dirty:Q,valid:K,filled:D,focused:F}),[N,X,Q,K,D,F]),W=dq({setValidityData:I,validate:R,validityData:U,validationDebounceTime:p,invalid:V,markedDirtyRef:te,state:Z,name:v,shouldValidateOnChange:H}),se=S.useCallback(()=>{te.current=!0,W.commit(U.value)},[W,U]);S.useImperativeHandle(T,()=>({validate:se}),[se]);const ie=S.useMemo(()=>({invalid:V,name:v,validityData:U,setValidityData:I,disabled:N,touched:X,setTouched:$,dirty:Q,setDirty:L,filled:D,setFilled:G,focused:F,setFocused:P,validate:R,validationMode:y,validationDebounceTime:p,shouldValidateOnChange:H,state:Z,markedDirtyRef:te,validation:W}),[V,v,U,N,X,$,Q,L,D,G,F,P,R,y,p,H,Z,W]),he=At("div",t,{ref:n,state:Z,props:C,stateAttributesMapping:Ki});return d.jsx(k1.Provider,{value:ie,children:he})}),pq=S.forwardRef(function(t,n){return d.jsx(uq,{children:d.jsx(hq,{...t,ref:n})})}),mq=S.forwardRef(function(t,n){const{render:i,className:o,id:l,nativeLabel:u=!0,...f}=t,h=Yi(!1),{controlId:p,setLabelId:y,labelId:v}=qs(),b=tr(l),x=S.useRef(null),E=je(T=>{if(Sr(T.nativeEvent)?.closest("button,input,select,textarea")||(!T.defaultPrevented&&T.detail>1&&T.preventDefault(),u||!p))return;const M=_t(T.currentTarget).getElementById(p);Lt(M)&&M.focus({focusVisible:!0})});return De(()=>(b&&y(b),()=>{y(void 0)}),[b,y]),At("label",t,{ref:[n,x],state:h.state,props:[{id:v},u?{htmlFor:p??void 0,onMouseDown:E}:{onClick:E,onPointerDown(T){T.preventDefault()}},f],stateAttributesMapping:Ki})}),gq={...Ki,...Ko},yq=S.forwardRef(function(t,n){const{render:i,id:o,className:l,match:u,...f}=t,h=tr(o),{validityData:p,state:y,name:v}=Yi(!1),{setMessageIds:b}=qs(),{errors:x}=_l(),E=v?x[v]:null;let _=!1;E||u===!0?_=!0:u?_=!!p.state[u]:_=p.state.valid===!1;const{mounted:T,transitionStatus:C,setMounted:M}=Lh(_);De(()=>{if(!(!_||!h))return b(P=>P.concat(h)),()=>{b(P=>P.filter(Q=>Q!==h))}},[_,h,b]);const R=S.useRef(null),[N,k]=S.useState(null),[z,j]=S.useState(null),A=E||(p.errors.length>1?d.jsx("ul",{children:p.errors.map(P=>d.jsx("li",{children:P},P))}):p.error);let D=p.error;E!=null?D=Array.isArray(E)?JSON.stringify(E):E:p.errors.length>1&&(D=JSON.stringify(p.errors)),_&&D!==z&&(j(D),k(A)),Yo({open:_,ref:R,onComplete(){_||M(!1)}});const G={...y,transitionStatus:C},F=At("div",t,{ref:[n,R],state:G,props:[{id:h,children:_?A:N},f],stateAttributesMapping:gq,enabled:T});return T?F:null}),vq=S.forwardRef(function(t,n){const{render:i,id:o,className:l,...u}=t,f=tr(o),h=Yi(!1),{setMessageIds:p}=qs();return De(()=>{if(f)return p(v=>v.concat(f)),()=>{p(v=>v.filter(b=>b!==f))}},[f,p]),At("p",t,{ref:n,state:h.state,props:[{id:f},u],stateAttributesMapping:Ki})}),Wr=pq,Lr=S.forwardRef(({className:e,...t},n)=>d.jsx(mq,{ref:n,className:me("font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",e),...t}));Lr.displayName="FieldLabel";const Ha=S.forwardRef(({className:e,...t},n)=>d.jsx(vq,{ref:n,className:me("font-mono text-[9px] text-neutral-600 mt-0.5",e),...t}));Ha.displayName="FieldDescription";const bq=S.forwardRef(({className:e,...t},n)=>d.jsx(yq,{ref:n,className:me("font-mono text-[10px] text-offline mt-1",e),...t}));bq.displayName="FieldError";const xq=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:me(e),...t}));xq.displayName="FieldContent";const Sq=S.createContext(null),Eq=S.createContext(null);function gu(){const e=S.useContext(Sq);if(e===null)throw new Error(nn(60));return e}function FN(){const e=S.useContext(Eq);if(e===null)throw new Error(nn(61));return e}function ul(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function _q(e,t,n){return!e||e.length===0?!1:e.some(i=>i===void 0?!1:ul(t,i,n))}function $g(e,t,n){return!e||e.length===0?-1:e.findIndex(i=>i===void 0?!1:ul(i,t,n))}function wq(e,t,n){return e.filter(i=>!ul(t,i,n))}function cT(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Tq(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function Cq(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(Tq(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function Rq(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?cT(e.value):cT(e)}const rt={id:ke(e=>e.id),modal:ke(e=>e.modal),multiple:ke(e=>e.multiple),items:ke(e=>e.items),itemToStringLabel:ke(e=>e.itemToStringLabel),itemToStringValue:ke(e=>e.itemToStringValue),isItemEqualToValue:ke(e=>e.isItemEqualToValue),value:ke(e=>e.value),hasSelectedValue:ke(e=>{const{value:t,multiple:n,itemToStringValue:i}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Rq(t,i)!==""}),hasNullItemLabel:ke((e,t)=>t?Cq(e.items):!1),open:ke(e=>e.open),mounted:ke(e=>e.mounted),forceMount:ke(e=>e.forceMount),transitionStatus:ke(e=>e.transitionStatus),openMethod:ke(e=>e.openMethod),activeIndex:ke(e=>e.activeIndex),selectedIndex:ke(e=>e.selectedIndex),isActive:ke((e,t)=>e.activeIndex===t),isSelected:ke((e,t,n)=>{const i=e.isItemEqualToValue,o=e.value;return e.multiple?Array.isArray(o)&&o.some(l=>ul(n,l,i)):e.selectedIndex===t&&e.selectedIndex!==null?!0:ul(n,o,i)}),isSelectedByFocus:ke((e,t)=>e.selectedIndex===t),popupProps:ke(e=>e.popupProps),triggerProps:ke(e=>e.triggerProps),triggerElement:ke(e=>e.triggerElement),positionerElement:ke(e=>e.positionerElement),listElement:ke(e=>e.listElement),scrollUpArrowVisible:ke(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:ke(e=>e.scrollDownArrowVisible),hasScrollArrows:ke(e=>e.hasScrollArrows)};function Nq(e){const t=S.useRef(""),n=S.useCallback(o=>{o.defaultPrevented||(t.current=o.pointerType,e(o,o.pointerType))},[e]);return{onClick:S.useCallback(o=>{if(o.detail===0){e(o,"keyboard");return}"pointerType"in o?e(o,o.pointerType):e(o,t.current),t.current=""},[e]),onPointerDown:n}}function jq(e){const[t,n]=S.useState(null),i=je((f,h)=>{e||n(h||(rN?"touch":""))}),o=S.useCallback(()=>{n(null)},[]),{onClick:l,onPointerDown:u}=Nq(i);return S.useMemo(()=>({openMethod:t,reset:o,triggerProps:{onClick:l,onPointerDown:u}}),[t,o,l,u])}function Mq(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),i=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||i.content!=="none"))return t;const l=parseFloat(n.width)||0,u=parseFloat(n.height)||0,f=parseFloat(i.width)||0,h=parseFloat(i.height)||0,p=Math.max(t.width,l,f),y=Math.max(t.height,u,h),v=p-t.width,b=y-t.height;return{left:t.left-v/2,right:t.right+v/2,top:t.top-b/2,bottom:t.bottom+b/2}}const sd=2,Aq=400,uT=200,Oq={...BF,...Ki,value:()=>null},kq=S.forwardRef(function(t,n){const{render:i,className:o,id:l,disabled:u=!1,nativeButton:f=!0,...h}=t,{setTouched:p,setFocused:y,validationMode:v,state:b,disabled:x}=Yi(),{labelId:E}=qs(),{store:_,setOpen:T,selectionRef:C,validation:M,readOnly:R,required:N,alignItemWithTriggerActiveRef:k,disabled:z,keyboardActiveRef:j}=gu(),A=x||z||u,D=st(_,rt.open),G=st(_,rt.value),F=st(_,rt.triggerProps),P=st(_,rt.positionerElement),Q=st(_,rt.listElement),X=st(_,rt.id),te=st(_,rt.hasSelectedValue),L=!te&&D,$=st(_,rt.hasNullItemLabel,L),H=l??X;L1({id:H});const V=ki(P),U=S.useRef(null),{getButtonProps:I,buttonRef:K}=El({disabled:A,native:f}),Z=je(re=>{_.set("triggerElement",re)}),W=Us(n,U,K,Z),se=zr(),ie=zr(),he=zr(),xe=zr();S.useEffect(()=>{if(D)return!(te||$)?he.start(Aq,()=>{C.current.allowUnselectedMouseUp=!0,C.current.allowSelectedMouseUp=!0}):xe.start(uT,()=>{C.current.allowUnselectedMouseUp=!0,he.start(uT,()=>{C.current.allowSelectedMouseUp=!0})}),()=>{he.clear(),xe.clear()};C.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},ie.clear()},[D,te,$,C,ie,he,xe]);const de=S.useMemo(()=>Q?.id??Zd(P)?.id,[Q,P]),Be=Li(F,{id:H,role:"combobox","aria-expanded":D?"true":"false","aria-haspopup":"listbox","aria-controls":D?de:void 0,"aria-labelledby":E,"aria-readonly":R||void 0,"aria-required":N||void 0,tabIndex:A?-1:0,ref:W,onFocus(re){y(!0),D&&k.current&&T(!1,Pt(Pi,re.nativeEvent)),se.start(0,()=>{_.set("forceMount",!0)})},onBlur(re){Rt(P,re.relatedTarget)||(p(!0),y(!1),v==="onBlur"&&M.commit(G))},onPointerMove(){j.current=!1},onKeyDown(){j.current=!0},onMouseDown(re){if(D)return;const fe=_t(re.currentTarget);function ae(Se){if(!U.current)return;const ye=Se.target;if(Rt(U.current,ye)||Rt(V.current,ye)||ye===U.current)return;const be=Mq(U.current);Se.clientX>=be.left-sd&&Se.clientX<=be.right+sd&&Se.clientY>=be.top-sd&&Se.clientY<=be.bottom+sd||T(!1,Pt(EB,Se))}ie.start(0,()=>{fe.addEventListener("mouseup",ae,{once:!0})})}},M.getValidationProps,h,I);Be.role="combobox";const _e={...b,open:D,disabled:A,value:G,readOnly:R,placeholder:!te};return At("button",t,{ref:[n,U],state:_e,stateAttributesMapping:Oq,props:Be})}),Iq=S.createContext(void 0),Dq=S.forwardRef(function(t,n){const{store:i}=gu(),o=st(i,rt.mounted),l=st(i,rt.forceMount);return o||l?d.jsx(Iq.Provider,{value:!0,children:d.jsx(_N,{ref:n,...t})}):null});let fT={},dT={},hT="";function Lq(e){if(typeof document>"u")return!1;const t=_t(e);return Xt(t).innerWidth-t.documentElement.clientWidth>0}function Pq(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=_t(e),i=n.documentElement,o=n.body,l=Gi(i)?i:o,u=l.style.overflowY,f=i.style.scrollbarGutter;i.style.scrollbarGutter="stable",l.style.overflowY="scroll";const h=l.offsetWidth;l.style.overflowY="hidden";const p=l.offsetWidth;return l.style.overflowY=u,i.style.scrollbarGutter=f,h===p}function zq(e){const t=_t(e),n=t.documentElement,i=t.body,o=Gi(n)?n:i,l={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,l)}}function Uq(e){const t=_t(e),n=t.documentElement,i=t.body,o=Xt(n);let l=0,u=0,f=!1;const h=Jr.create();if(Jv&&(o.visualViewport?.scale??1)!==1)return()=>{};function p(){const b=o.getComputedStyle(n),x=o.getComputedStyle(i),T=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";l=n.scrollTop,u=n.scrollLeft,fT={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},hT=n.style.scrollBehavior,dT={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const C=n.scrollHeight>n.clientHeight,M=n.scrollWidth>n.clientWidth,R=b.overflowY==="scroll"||x.overflowY==="scroll",N=b.overflowX==="scroll"||x.overflowX==="scroll",k=Math.max(0,o.innerWidth-i.clientWidth),z=Math.max(0,o.innerHeight-i.clientHeight),j=parseFloat(x.marginTop)+parseFloat(x.marginBottom),A=parseFloat(x.marginLeft)+parseFloat(x.marginRight),D=Gi(n)?n:i;if(f=Pq(e),f){n.style.scrollbarGutter=T,D.style.overflowY="hidden",D.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:T,overflowY:"hidden",overflowX:"hidden"}),(C||R)&&(n.style.overflowY="scroll"),(M||N)&&(n.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:j||z?`calc(100dvh - ${j+z}px)`:"100dvh",width:A||k?`calc(100vw - ${A+k}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),i.scrollTop=l,i.scrollLeft=u,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function y(){Object.assign(n.style,fT),Object.assign(i.style,dT),f||(n.scrollTop=l,n.scrollLeft=u,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=hT)}function v(){y(),h.request(p)}return p(),o.addEventListener("resize",v),()=>{h.cancel(),y(),typeof o.removeEventListener=="function"&&o.removeEventListener("resize",v)}}class Bq{lockCount=0;restore=null;timeoutLock=zi.create();timeoutUnlock=zi.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const i=_t(t).documentElement,o=Xt(i).getComputedStyle(i).overflowY;if(o==="hidden"||o==="clip"){this.restore=mn;return}const l=rN||!Lq(t);this.restore=l?zq(t):Uq(t)}}const Hq=new Bq;function qN(e=!0,t=null){De(()=>{if(e)return Hq.acquire(t)},[e,t])}const VN=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Fq(){return S.useContext(VN)}function $N(e){const{children:t,elementsRef:n,labelsRef:i,onMapChange:o}=e,l=je(o),u=S.useRef(0),f=En(Vq).current,h=En(qq).current,[p,y]=S.useState(0),v=S.useRef(p),b=je((C,M)=>{h.set(C,M??null),v.current+=1,y(v.current)}),x=je(C=>{h.delete(C),v.current+=1,y(v.current)}),E=S.useMemo(()=>{const C=new Map;return Array.from(h.keys()).filter(R=>R.isConnected).sort($q).forEach((R,N)=>{const k=h.get(R)??{};C.set(R,{...k,index:N})}),C},[h,p]);De(()=>{if(typeof MutationObserver!="function"||E.size===0)return;const C=new MutationObserver(M=>{const R=new Set,N=k=>R.has(k)?R.delete(k):R.add(k);M.forEach(k=>{k.removedNodes.forEach(N),k.addedNodes.forEach(N)}),R.size===0&&(v.current+=1,y(v.current))});return E.forEach((M,R)=>{R.parentElement&&C.observe(R.parentElement,{childList:!0})}),()=>{C.disconnect()}},[E]),De(()=>{v.current===p&&(n.current.length!==E.size&&(n.current.length=E.size),i&&i.current.length!==E.size&&(i.current.length=E.size),u.current=E.size),l(E)},[l,E,n,i,p]),De(()=>()=>{n.current=[]},[n]),De(()=>()=>{i&&(i.current=[])},[i]);const _=je(C=>(f.add(C),()=>{f.delete(C)}));De(()=>{f.forEach(C=>C(E))},[f,E]);const T=S.useMemo(()=>({register:b,unregister:x,subscribeMapChange:_,elementsRef:n,labelsRef:i,nextIndexRef:u}),[b,x,_,n,i,u]);return d.jsx(VN.Provider,{value:T,children:t})}function qq(){return new Map}function Vq(){return new Set}function $q(e,t){const 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}const GN=S.createContext(void 0);function Gq(){const e=S.useContext(GN);if(!e)throw new Error(nn(59));return e}const KN=S.forwardRef(function(t,n){const{cutout:i,...o}=t;let l;if(i){const u=i?.getBoundingClientRect();l=`polygon(
|
|
38
|
+
0% 0%,
|
|
39
|
+
100% 0%,
|
|
40
|
+
100% 100%,
|
|
41
|
+
0% 100%,
|
|
42
|
+
0% 0%,
|
|
43
|
+
${u.left}px ${u.top}px,
|
|
44
|
+
${u.left}px ${u.bottom}px,
|
|
45
|
+
${u.right}px ${u.bottom}px,
|
|
46
|
+
${u.right}px ${u.top}px,
|
|
47
|
+
${u.left}px ${u.top}px
|
|
48
|
+
)`}return d.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:l}})});function lh(e,t){e&&Object.assign(e.style,t)}const Kq={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},Yq={position:"fixed"},Xq=S.forwardRef(function(t,n){const{anchor:i,positionMethod:o="absolute",className:l,render:u,side:f="bottom",align:h="center",sideOffset:p=0,alignOffset:y=0,collisionBoundary:v="clipping-ancestors",collisionPadding:b,arrowPadding:x=5,sticky:E=!1,disableAnchorTracking:_,alignItemWithTrigger:T=!0,collisionAvoidance:C=JU,...M}=t,{store:R,listRef:N,labelsRef:k,alignItemWithTriggerActiveRef:z,selectedItemTextRef:j,valuesRef:A,initialValueRef:D,popupRef:G,setValue:F}=gu(),P=FN(),Q=st(R,rt.open),X=st(R,rt.mounted),te=st(R,rt.modal),L=st(R,rt.value),$=st(R,rt.openMethod),H=st(R,rt.positionerElement),V=st(R,rt.triggerElement),U=st(R,rt.isItemEqualToValue),I=st(R,rt.transitionStatus),K=S.useRef(null),Z=S.useRef(null),[W,se]=S.useState(T),ie=X&&W&&$!=="touch";!X&&W!==T&&se(T),De(()=>{X||(rt.scrollUpArrowVisible(R.state)&&R.set("scrollUpArrowVisible",!1),rt.scrollDownArrowVisible(R.state)&&R.set("scrollDownArrowVisible",!1))},[R,X]),S.useImperativeHandle(z,()=>ie),qN((ie||te)&&Q&&$!=="touch",V);const he=zN({anchor:i,floatingRootContext:P,positionMethod:o,mounted:X,side:f,sideOffset:p,align:h,alignOffset:y,arrowPadding:x,collisionBoundary:v,collisionPadding:b,sticky:E,disableAnchorTracking:_??ie,collisionAvoidance:C,keepMounted:!0}),xe=ie?"none":he.side,de=ie?Yq:he.positionerStyles,Be=S.useMemo(()=>{const be={};return Q||(be.pointerEvents="none"),{role:"presentation",hidden:!X,style:{...de,...be}}},[Q,X,de]),_e={open:Q,side:xe,align:he.align,anchorHidden:he.anchorHidden},re=je(be=>{R.set("positionerElement",be)}),fe=At("div",t,{ref:[n,re],state:_e,stateAttributesMapping:Nl,props:[Be,Ph(I),M]}),ae=S.useRef(0),Se=je(be=>{if(be.size===0&&ae.current===0||A.current.length===0)return;const ge=ae.current;if(ae.current=be.size,be.size===ge)return;const Le=Pt(Pi);if(ge!==0&&!R.state.multiple&&L!==null&&$g(A.current,L,U)===-1){const Ee=D.current,Ke=Ee!=null&&$g(A.current,Ee,U)!==-1?Ee:null;F(Ke,Le),Ke===null&&(R.set("selectedIndex",null),j.current=null)}if(ge!==0&&R.state.multiple&&Array.isArray(L)){const Oe=Fe=>$g(A.current,Fe,U)!==-1,Ee=L.filter(Fe=>Oe(Fe));(Ee.length!==L.length||Ee.some(Fe=>!_q(L,Fe,U)))&&(F(Ee,Le),Ee.length===0&&(R.set("selectedIndex",null),j.current=null))}if(Q&&ie){R.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Oe={height:""};lh(H,Oe),lh(G.current,Oe)}}),ye=S.useMemo(()=>({...he,side:xe,alignItemWithTriggerActive:ie,setControlledAlignItemWithTrigger:se,scrollUpArrowRef:K,scrollDownArrowRef:Z}),[he,xe,ie,se]);return d.jsx($N,{elementsRef:N,labelsRef:k,onMapChange:Se,children:d.jsxs(GN.Provider,{value:ye,children:[X&&te&&d.jsx(KN,{inert:cb(!Q),cutout:V}),fe]})})});function YN(e){const 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}const id="base-ui-disable-scrollbar",pT={className:id,getElement(e){return d.jsx("style",{nonce:e,href:id,precedence:"base-ui:low",children:`.${id}{scrollbar-width:none}.${id}::-webkit-scrollbar{display:none}`})}},Qq=S.createContext(void 0);function XN(e){return S.useContext(Qq)}const Xa="ArrowUp",Ro="ArrowDown",Wc="ArrowLeft",Qa="ArrowRight",yu="Home",vu="End",QN=new Set([Wc,Qa]),Wq=new Set([Wc,Qa,yu,vu]),WN=new Set([Xa,Ro]),Zq=new Set([Xa,Ro,yu,vu]),ZN=new Set([...QN,...WN]),Jq=new Set([...ZN,yu,vu]),JN=new Set([Xa,Ro,Wc,Qa,yu,vu]),e8="Shift",t8="Control",n8="Alt",r8="Meta",s8=new Set([e8,t8,n8,r8]);function i8(e){return Lt(e)&&e.tagName==="INPUT"}function mT(e){return!!(i8(e)&&e.selectionStart!=null||Lt(e)&&e.tagName==="TEXTAREA")}function gT(e,t,n,i){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,l=e.scrollTop;const u=e.clientWidth<e.scrollWidth,f=e.clientHeight<e.scrollHeight;if(u&&i!=="vertical"){const h=yT(e,t,"left"),p=od(e),y=od(t);n==="ltr"&&(h+t.offsetWidth+y.scrollMarginRight>e.scrollLeft+e.clientWidth-p.scrollPaddingRight?o=h+t.offsetWidth+y.scrollMarginRight-e.clientWidth+p.scrollPaddingRight:h-y.scrollMarginLeft<e.scrollLeft+p.scrollPaddingLeft&&(o=h-y.scrollMarginLeft-p.scrollPaddingLeft)),n==="rtl"&&(h-y.scrollMarginRight<e.scrollLeft+p.scrollPaddingLeft?o=h-y.scrollMarginLeft-p.scrollPaddingLeft:h+t.offsetWidth+y.scrollMarginRight>e.scrollLeft+e.clientWidth-p.scrollPaddingRight&&(o=h+t.offsetWidth+y.scrollMarginRight-e.clientWidth+p.scrollPaddingRight))}if(f&&i!=="horizontal"){const h=yT(e,t,"top"),p=od(e),y=od(t);h-y.scrollMarginTop<e.scrollTop+p.scrollPaddingTop?l=h-y.scrollMarginTop-p.scrollPaddingTop:h+t.offsetHeight+y.scrollMarginBottom>e.scrollTop+e.clientHeight-p.scrollPaddingBottom&&(l=h+t.offsetHeight+y.scrollMarginBottom-e.clientHeight+p.scrollPaddingBottom)}e.scrollTo({left:o,top:l,behavior:"auto"})}function yT(e,t,n){const i=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[i],t.offsetParent!==e);)t=t.offsetParent;return o}function od(e){const 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 Gg(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const o8=S.createContext(void 0),a8={disableStyleElements:!1};function l8(){return S.useContext(o8)??a8}const xo=1,c8={...Nl,...Ko},u8=S.forwardRef(function(t,n){const{render:i,className:o,finalFocus:l,...u}=t,{store:f,popupRef:h,onOpenChangeComplete:p,setOpen:y,valueRef:v,selectedItemTextRef:b,keyboardActiveRef:x,multiple:E,handleScrollArrowVisibility:_,scrollHandlerRef:T,highlightItemOnHover:C}=gu(),{side:M,align:R,alignItemWithTriggerActive:N,setControlledAlignItemWithTrigger:k,scrollDownArrowRef:z,scrollUpArrowRef:j}=Gq(),A=XN()!=null,D=FN(),{nonce:G,disableStyleElements:F}=l8(),P=zr(),Q=st(f,rt.id),X=st(f,rt.open),te=st(f,rt.mounted),L=st(f,rt.popupProps),$=st(f,rt.transitionStatus),H=st(f,rt.triggerElement),V=st(f,rt.positionerElement),U=st(f,rt.listElement),I=S.useRef(0),K=S.useRef(!1),Z=S.useRef(0),W=S.useRef(!1),se=S.useRef({}),ie=rb(),he=je(_e=>{if(!V||!h.current||!W.current)return;if(K.current||!N){_();return}const re=V.style.top==="0px",fe=V.style.bottom==="0px",ae=V.getBoundingClientRect().height,Se=_t(V),ye=getComputedStyle(V),be=parseFloat(ye.marginTop),ge=parseFloat(ye.marginBottom),Le=vT(getComputedStyle(h.current)),Oe=Math.min(Se.documentElement.clientHeight-be-ge,Le),Ee=_e.scrollTop,Fe=bT(_e);let Ke=0,ze=null,Xe=!1,Ue=!1;const pe=He=>{V.style.height=`${He}px`},we=(He,dt)=>{const ot=Gg(He,0,Oe-ae);ot>0&&pe(ae+ot),_e.scrollTop=dt,Oe-(ae+ot)<=xo&&(K.current=!0),_()};if(re){const He=Fe-Ee,dt=ae+He,ot=Math.min(dt,Oe);if(Ke=ot,He<=xo){we(He,Fe);return}Oe-ot>xo?Ue=!0:Xe=!0}else if(fe){const He=Ee,dt=ae+He,ot=Math.min(dt,Oe),or=dt-Oe;if(Ke=ot,He<=xo){we(He,0);return}Oe-ot>xo?ze=0:(Xe=!0,Ee<Fe&&(ze=Ee-(He-or)))}if(Ke=Math.ceil(Ke),Ke!==0&&pe(Ke),Ue||ze!=null){const He=bT(_e),dt=Ue?He:Gg(ze,0,He);Math.abs(_e.scrollTop-dt)>xo&&(_e.scrollTop=dt)}(Xe||Ke>=Oe-xo)&&(K.current=!0),_()});S.useImperativeHandle(T,()=>he,[he]),Yo({open:X,ref:h,onComplete(){X&&p?.(!0)}});const xe={open:X,transitionStatus:$,side:M,align:R};De(()=>{!V||!h.current||Object.keys(se.current).length||(se.current={top:V.style.top||"0",left:V.style.left||"0",right:V.style.right,height:V.style.height,bottom:V.style.bottom,minHeight:V.style.minHeight,maxHeight:V.style.maxHeight,marginTop:V.style.marginTop,marginBottom:V.style.marginBottom})},[h,V]),De(()=>{X||N||(W.current=!1,K.current=!1,I.current=0,Z.current=0,lh(V,se.current))},[X,N,V,h]),De(()=>{const _e=h.current;if(!(!X||!H||!V||!_e||f.state.transitionStatus==="ending")){if(!N){W.current=!0,ie.request(_),_e.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{const re=f8(_e);_e.style.removeProperty("--transform-origin");try{const fe=getComputedStyle(V),ae=getComputedStyle(_e),Se=_t(H),ye=Xt(V),be=H.getBoundingClientRect(),ge=V.getBoundingClientRect(),Le=be.left,Oe=be.height,Ee=U||_e,Fe=Ee.scrollHeight,Ke=parseFloat(ae.borderBottomWidth),ze=parseFloat(fe.marginTop)||10,Xe=parseFloat(fe.marginBottom)||10,Ue=parseFloat(fe.minHeight)||100,pe=vT(ae),we=5,He=5,dt=20,ot=Se.documentElement.clientHeight-ze-Xe,or=Se.documentElement.clientWidth,ar=ot-be.bottom+Oe,Ut=b.current,at=v.current;let yt,nt=0,Bt=0;if(Ut&&at){const Pn=at.getBoundingClientRect();yt=Ut.getBoundingClientRect();const $r=Pn.left-Le,$s=yt.left-ge.left,Gs=Pn.top-be.top+Pn.height/2,zn=yt.top-ge.top+yt.height/2;nt=$r-$s,Bt=zn-Gs}const rn=ar+Bt+Xe+Ke;let Ct=Math.min(ot,rn);const dn=ot-ze-Xe,Ln=rn-Ct,gn=Math.max(we,Le+nt),qr=or-He,Vr=Math.max(0,gn+ge.width-qr);V.style.left=`${gn-Vr}px`,V.style.height=`${Ct}px`,V.style.maxHeight="auto",V.style.marginTop=`${ze}px`,V.style.marginBottom=`${Xe}px`,_e.style.height="100%";const Qo=Ee.scrollHeight-Ee.clientHeight,Wi=Ln>=Qo;Wi&&(Ct=Math.min(ot,ge.height)-(Ln-Qo));const Zi=be.top<dt||be.bottom>ot-dt||Ct<Math.min(Fe,Ue),is=(ye.visualViewport?.scale??1)!==1&&Jv;if(Zi||is){W.current=!0,lh(V,se.current),Fi.flushSync(()=>k(!1));return}if(Wi){const Pn=Math.max(0,ot-rn);V.style.top=ge.height>=dn?"0":`${Pn}px`,V.style.height=`${Ct}px`,Ee.scrollTop=Ee.scrollHeight-Ee.clientHeight,I.current=Math.max(Ue,Ct)}else V.style.bottom="0",I.current=Math.max(Ue,Ct),Ee.scrollTop=Ln;if(yt){const Pn=ge.top,$r=ge.height,$s=yt.top+yt.height/2,Gs=$r>0?($s-Pn)/$r*100:50,zn=Gg(Gs,0,100);_e.style.setProperty("--transform-origin",`50% ${zn}%`)}(I.current===ot||Ct>=pe)&&(K.current=!0),_(),setTimeout(()=>{W.current=!0})}finally{re()}})}},[f,X,V,H,v,b,h,_,N,k,ie,z,j,U]),S.useEffect(()=>{if(!N||!V||!X)return;const _e=Xt(V);function re(fe){y(!1,Pt(wB,fe))}return _e.addEventListener("resize",re),()=>{_e.removeEventListener("resize",re)}},[y,N,V,X]);const de={...U?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":E||void 0,id:`${Q}-list`},onKeyDown(_e){x.current=!0,A&&JN.has(_e.key)&&_e.stopPropagation()},onMouseMove(){x.current=!1},onPointerLeave(_e){if(!C||YN(_e)||_e.pointerType==="touch")return;const re=_e.currentTarget;P.start(0,()=>{f.set("activeIndex",null),re.focus({preventScroll:!0})})},onScroll(_e){U||he(_e.currentTarget)},...N&&{style:U?{height:"100%"}:Kq}},Be=At("div",t,{ref:[n,h],state:xe,stateAttributesMapping:c8,props:[L,de,Ph($),{className:!U&&N?pT.className:void 0},u]});return d.jsxs(S.Fragment,{children:[!F&&pT.getElement(G),d.jsx(wN,{context:D,modal:!1,disabled:!te,returnFocus:l,restoreFocus:!0,children:Be})]})});function vT(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function bT(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const xT=[["transform","none"],["scale","1"],["translate","0 0"]];function f8(e){const{style:t}=e,n={};for(const[i,o]of xT)n[i]=t.getPropertyValue(i),t.setProperty(i,o,"important");return()=>{for(const[i]of xT){const o=n[i];o?t.setProperty(i,o):t.removeProperty(i)}}}let ej=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function ub(e={}){const{label:t,metadata:n,textRef:i,indexGuessBehavior:o,index:l}=e,{register:u,unregister:f,subscribeMapChange:h,elementsRef:p,labelsRef:y,nextIndexRef:v}=Fq(),b=S.useRef(-1),[x,E]=S.useState(l??(o===ej.GuessFromOrder?()=>{if(b.current===-1){const C=v.current;v.current+=1,b.current=C}return b.current}:-1)),_=S.useRef(null),T=S.useCallback(C=>{if(_.current=C,x!==-1&&C!==null&&(p.current[x]=C,y)){const M=t!==void 0;y.current[x]=M?t:i?.current?.textContent??C.textContent}},[x,p,y,t,i]);return De(()=>{if(l!=null)return;const C=_.current;if(C)return u(C,n),()=>{f(C)}},[l,u,f,n]),De(()=>{if(l==null)return h(C=>{const M=_.current?C.get(_.current)?.index:null;M!=null&&E(M)})},[l,h,E]),S.useMemo(()=>({ref:T,index:x}),[x,T])}const d8=S.createContext(void 0),h8=S.memo(S.forwardRef(function(t,n){const{render:i,className:o,value:l=null,label:u,disabled:f=!1,nativeButton:h=!1,...p}=t,y=S.useRef(null),v=ub({label:u,textRef:y,indexGuessBehavior:ej.GuessFromOrder}),{store:b,getItemProps:x,setOpen:E,setValue:_,selectionRef:T,typingRef:C,valuesRef:M,keyboardActiveRef:R,multiple:N,highlightItemOnHover:k}=gu(),z=zr(),j=st(b,rt.isActive,v.index),A=st(b,rt.isSelected,v.index,l),D=st(b,rt.isSelectedByFocus,v.index),G=st(b,rt.isItemEqualToValue),F=v.index,P=F!==-1,Q=S.useRef(null),X=ki(F);De(()=>{if(!P)return;const ie=M.current;return ie[F]=l,()=>{delete ie[F]}},[P,F,l,M]),De(()=>{if(!P)return;const ie=b.state.value;let he=ie;N&&Array.isArray(ie)&&ie.length>0&&(he=ie[ie.length-1]),he!==void 0&&ul(l,he,G)&&b.set("selectedIndex",F)},[P,F,N,G,b,l]);const te={disabled:f,selected:A,highlighted:j},L=x({active:j,selected:A});L.onFocus=void 0,L.id=void 0;const $=S.useRef(null),H=S.useRef("mouse"),V=S.useRef(!1),{getButtonProps:U,buttonRef:I}=El({disabled:f,focusableWhenDisabled:!0,native:h});function K(ie){const he=b.state.value;if(N){const xe=Array.isArray(he)?he:[],de=A?wq(xe,l,G):[...xe,l];_(de,Pt(Ig,ie))}else _(l,Pt(Ig,ie)),E(!1,Pt(Ig,ie))}const Z={role:"option","aria-selected":A,tabIndex:j?0:-1,onFocus(){b.set("activeIndex",F)},onMouseEnter(){!R.current&&b.state.selectedIndex===null&&k&&b.set("activeIndex",F)},onMouseMove(){k&&b.set("activeIndex",F)},onMouseLeave(ie){!k||R.current||YN(ie)||z.start(0,()=>{b.state.activeIndex===F&&b.set("activeIndex",null)})},onTouchStart(){T.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(ie){$.current=ie.key,b.set("activeIndex",F)},onClick(ie){V.current=!1,!(ie.type==="keydown"&&$.current===null)&&(f||$.current===" "&&C.current||H.current!=="touch"&&!j||($.current=null,K(ie.nativeEvent)))},onPointerEnter(ie){H.current=ie.pointerType},onPointerDown(ie){H.current=ie.pointerType,V.current=!0},onMouseUp(ie){if(f)return;if(V.current){V.current=!1;return}const he=!T.current.allowSelectedMouseUp&&A,xe=!T.current.allowUnselectedMouseUp&&!A;he||xe||H.current!=="touch"&&!j||K(ie.nativeEvent)}},W=At("div",t,{ref:[I,n,v.ref,Q],state:te,props:[L,Z,p,U]}),se=S.useMemo(()=>({selected:A,indexRef:X,textRef:y,selectedByFocus:D,hasRegistered:P}),[A,X,y,D,P]);return d.jsx(d8.Provider,{value:se,children:W})})),p8=S.forwardRef(({className:e,children:t,...n},i)=>d.jsx(kq,{ref:i,className:me("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}));p8.displayName="SelectTrigger";const m8=S.forwardRef(({className:e,portalProps:t,positionerProps:n,...i},o)=>d.jsx(Dq,{...t,children:d.jsx(Xq,{...n,children:d.jsx(u8,{ref:o,className:me("bg-panel border border-border rounded-md py-1 shadow-lg z-50",e),...i})})}));m8.displayName="SelectContent";const g8=S.forwardRef(({className:e,...t},n)=>d.jsx(h8,{ref:n,className:me("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}));g8.displayName="SelectItem";const y8=S.forwardRef(({className:e,...t},n)=>d.jsx("textarea",{ref:n,className:me("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}));y8.displayName="Textarea";const tj=S.createContext(void 0);function v8(e=!0){const t=S.useContext(tj);if(t===void 0&&!e)throw new Error(nn(7));return t}function nj(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:i}=M1(),{ref:o,index:l}=ub(e),u=n===l,f=S.useRef(null),h=Us(o,f);return{compositeProps:S.useMemo(()=>({tabIndex:u?0:-1,onFocus(){i(l)},onMouseMove(){const y=f.current;if(!t||!y)return;const v=y.hasAttribute("disabled")||y.ariaDisabled==="true";!u&&!v&&y.focus()}}),[u,i,l,t]),compositeRef:h,index:l}}function b8(e){const{render:t,className:n,state:i=Kt,props:o=Yc,refs:l=Yc,metadata:u,stateAttributesMapping:f,tag:h="div",...p}=e,{compositeProps:y,compositeRef:v}=nj({metadata:u});return At(h,e,{state:i,ref:[...l,v],props:[y,...o,p],stateAttributesMapping:f})}const x8=S.forwardRef(function(t,n){const{className:i,defaultPressed:o=!1,disabled:l=!1,form:u,onPressedChange:f,pressed:h,render:p,type:y,value:v,nativeButton:b=!0,...x}=t,E=tr(v||void 0),_=v8(),T=_?.value??[],C=_?void 0:o,M=(l||_?.disabled)??!1,[R,N]=_h({controlled:_?E!==void 0&&T.indexOf(E)>-1:h,default:C,name:"Toggle",state:"pressed"}),k=je((P,Q)=>{E&&_?.setGroupValue?.(E,P,Q),f?.(P,Q)}),{getButtonProps:z,buttonRef:j}=El({disabled:M,native:b}),A={disabled:M,pressed:R},D=[j,n],G=[{"aria-pressed":R,onClick(P){const Q=!R,X=Pt(Pi,P.nativeEvent);k(Q,X),!X.isCanceled&&N(Q)}},x,z],F=At("button",t,{enabled:!_,state:A,ref:D,props:G});return _?d.jsx(b8,{tag:"button",render:p,className:i,state:A,refs:D,props:G}):F}),rj=S.forwardRef(({className:e,...t},n)=>d.jsx(x8,{ref:n,className:me("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}));rj.displayName="Toggle";function S8(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const sj="data-composite-item-active",E8=[];function _8(e){const{itemSizes:t,cols:n=1,loopFocus:i=!0,dense:o=!1,orientation:l="both",direction:u,highlightedIndex:f,onHighlightedIndexChange:h,rootRef:p,enableHomeAndEndKeys:y=!1,stopEventPropagation:v=!1,disabledIndices:b,modifierKeys:x=E8}=e,[E,_]=S.useState(0),T=n>1,C=S.useRef(null),M=Us(C,p),R=S.useRef([]),N=S.useRef(!1),k=f??E,z=je((D,G=!1)=>{if((h??_)(D),G){const F=R.current[D];gT(C.current,F,u,l)}}),j=je(D=>{if(D.size===0||N.current)return;N.current=!0;const G=Array.from(D.keys()),F=G.find(Q=>Q?.hasAttribute(sj))??null,P=F?G.indexOf(F):-1;P!==-1&&z(P),gT(C.current,F,u,l)}),A=S.useMemo(()=>({"aria-orientation":l==="both"?void 0:l,ref:M,onFocus(D){!C.current||!mT(D.target)||D.target.setSelectionRange(0,D.target.value.length??0)},onKeyDown(D){const G=y?Jq:ZN;if(!G.has(D.key)||w8(D,x)||!C.current)return;const P=u==="rtl",Q=P?Wc:Qa,X={horizontal:Q,vertical:Ro,both:Q}[l],te=P?Qa:Wc,L={horizontal:te,vertical:Xa,both:te}[l];if(mT(D.target)&&!S8(D.target)){const Z=D.target.selectionStart,W=D.target.selectionEnd,se=D.target.value??"";if(Z==null||D.shiftKey||Z!==W||D.key!==L&&Z<se.length||D.key!==X&&Z>0)return}let $=k;const H=zH(R,b),V=UH(R,b);if(T){const Z=t||Array.from({length:R.current.length},()=>({width:1,height:1})),W=HH(Z,n,o),se=W.findIndex(he=>he!=null&&!Dc(R,he,b)),ie=W.reduce((he,xe,de)=>xe!=null&&!Dc(R,xe,b)?de:he,-1);$=W[BH({current:W.map(he=>he?R.current[he]:null)},{event:D,orientation:l,loopFocus:i,cols:n,disabledIndices:qH([...b||R.current.map((he,xe)=>Dc(R,xe)?xe:void 0),void 0],W),minIndex:se,maxIndex:ie,prevIndex:FH(k>V?H:k,Z,W,n,D.key===Ro?"bl":D.key===Qa?"tr":"tl"),rtl:P})]}const U={horizontal:[Q],vertical:[Ro],both:[Q,Ro]}[l],I={horizontal:[te],vertical:[Xa],both:[te,Xa]}[l],K=T?G:{horizontal:y?Wq:QN,vertical:y?Zq:WN,both:G}[l];y&&(D.key===yu?$=H:D.key===vu&&($=V)),$===k&&(U.includes(D.key)||I.includes(D.key))&&(i&&$===V&&U.includes(D.key)?$=H:i&&$===H&&I.includes(D.key)?$=V:$=Kn(R,{startingIndex:$,decrement:I.includes(D.key),disabledIndices:b})),$!==k&&!Ed(R,$)&&(v&&D.stopPropagation(),K.has(D.key)&&D.preventDefault(),z($,!0),queueMicrotask(()=>{R.current[$]?.focus()}))}}),[n,o,u,b,R,y,k,T,t,i,M,x,z,l,v]);return S.useMemo(()=>({props:A,highlightedIndex:k,onHighlightedIndexChange:z,elementsRef:R,disabledIndices:b,onMapChange:j,relayKeyboardEvent:A.onKeyDown}),[A,k,z,R,b,j])}function w8(e,t){for(const n of s8.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function ij(e){const{render:t,className:n,refs:i=Yc,props:o=Yc,state:l=Kt,stateAttributesMapping:u,highlightedIndex:f,onHighlightedIndexChange:h,orientation:p,dense:y,itemSizes:v,loopFocus:b,cols:x,enableHomeAndEndKeys:E,onMapChange:_,stopEventPropagation:T=!0,rootRef:C,disabledIndices:M,modifierKeys:R,highlightItemOnHover:N=!1,tag:k="div",...z}=e,j=LN(),{props:A,highlightedIndex:D,onHighlightedIndexChange:G,elementsRef:F,onMapChange:P,relayKeyboardEvent:Q}=_8({itemSizes:v,cols:x,loopFocus:b,dense:y,orientation:p,highlightedIndex:f,onHighlightedIndexChange:h,rootRef:C,stopEventPropagation:T,enableHomeAndEndKeys:E,direction:j,disabledIndices:M,modifierKeys:R}),X=At(k,e,{state:l,ref:i,props:[A,...o,z],stateAttributesMapping:u}),te=S.useMemo(()=>({highlightedIndex:D,onHighlightedIndexChange:G,highlightItemOnHover:N,relayKeyboardEvent:Q}),[D,G,N,Q]);return d.jsx(j1.Provider,{value:te,children:d.jsx($N,{elementsRef:F,onMapChange:L=>{_?.(L),P(L)},children:X})})}let T8=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const ST={multiple(e){return e?{[T8.multiple]:""}:null}},C8=S.forwardRef(function(t,n){const{defaultValue:i,disabled:o=!1,loopFocus:l=!0,onValueChange:u,orientation:f="horizontal",multiple:h=!1,value:p,className:y,render:v,...b}=t,x=XN(),E=S.useMemo(()=>{if(p===void 0)return i??[]},[p,i]),_=S.useMemo(()=>p!==void 0||i!==void 0,[p,i]),T=(x?.disabled??!1)||o,[C,M]=_h({controlled:p,default:E,name:"ToggleGroup",state:"value"}),R=je((A,D,G)=>{let F;if(h?(F=C.slice(),D?F.push(A):F.splice(C.indexOf(A),1)):F=D?[A]:[],Array.isArray(F)){if(u?.(F,G),G.isCanceled)return;M(F)}}),N={disabled:T,multiple:h,orientation:f},k=S.useMemo(()=>({disabled:T,orientation:f,setGroupValue:R,value:C,isValueInitialized:_}),[T,f,R,C,_]),z={role:"group"},j=At("div",t,{enabled:!!x,state:N,ref:n,props:[z,b],stateAttributesMapping:ST});return d.jsx(tj.Provider,{value:k,children:x?j:d.jsx(ij,{render:v,className:y,state:N,refs:[n],props:[z,b],stateAttributesMapping:ST,loopFocus:l,enableHomeAndEndKeys:!0})})}),Cd=S.forwardRef(({className:e,...t},n)=>d.jsx(C8,{ref:n,className:me("flex items-center gap-0.5",e),...t}));Cd.displayName="ToggleGroup";const R8=me(q1({variant:"secondary",size:"sm"}),"h-7 whitespace-nowrap uppercase tracking-[0.08em] leading-none no-underline");function oj({active:e,onClick:t,children:n,className:i}){return d.jsxs("button",{type:"button",onClick:t,className:me("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",i),children:[n,e&&d.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 N8({items:e,activeId:t,onItemChange:n,renderItem:i,className:o}){return d.jsx("div",{className:me("flex items-center gap-0.5",o),children:e.map(l=>{const u=l.id===t,f=()=>n?.(l.id);return i?d.jsx("span",{children:i(l,{active:u,onClick:f})},l.id):d.jsx(oj,{active:u,onClick:f,children:l.label},l.id)})})}const j8=Vi("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}}),M8={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 A8({color:e,size:t,glow:n,pulse:i,className:o}){return d.jsx("span",{className:me(j8({color:e,size:t,glow:n}),i&&"dot-pulse",o),style:n?{boxShadow:M8[e??"healthy"]}:void 0})}const O8="0.0.6-201",k8={version:O8},I8=k8.version;function D8({label:e,className:t}){return d.jsxs("div",{className:me("flex items-center gap-3",t),children:[d.jsx(A8,{color:"healthy",size:"md",glow:!0}),d.jsx("span",{className:"font-display font-bold text-white text-sm tracking-tight",children:"syncular"}),e&&d.jsx("span",{className:"font-mono text-[9px] text-neutral-600 uppercase tracking-widest",children:e}),d.jsxs("span",{className:"font-mono text-[9px] text-neutral-600 tracking-wider",children:["v",I8]})]})}function L8({brand:e,center:t,right:n,className:i}){return d.jsxs(d.Fragment,{children:[d.jsx("div",{"aria-hidden":"true",className:"h-[42px] shrink-0"}),d.jsxs("nav",{className:me("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",i),children:[d.jsx("div",{className:"flex items-center gap-3",children:e}),d.jsx("div",{className:"flex items-center gap-0.5",children:t}),d.jsx("div",{className:"flex items-center gap-2",children:n})]})]})}const P8=Vi("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"}}),bn=S.forwardRef(({className:e,variant:t,...n},i)=>d.jsx("div",{ref:i,role:"alert",className:me(P8({variant:t,className:e})),...n}));bn.displayName="Alert";const bu=S.forwardRef(({className:e,...t},n)=>d.jsx("h5",{ref:n,className:me("font-medium text-white mb-1",e),...t}));bu.displayName="AlertTitle";const xn=S.forwardRef(({className:e,...t},n)=>d.jsx("p",{ref:n,className:me("text-neutral-400",e),...t}));xn.displayName="AlertDescription";const aj=S.createContext(void 0);function jl(e){const t=S.useContext(aj);if(e===!1&&t===void 0)throw new Error(nn(27));return t}const z8={...Nl,...Ko},fb=S.forwardRef(function(t,n){const{render:i,className:o,forceRender:l=!1,...u}=t,{store:f}=jl(),h=f.useState("open"),p=f.useState("nested"),y=f.useState("mounted"),v=f.useState("transitionStatus");return At("div",t,{state:{open:h,transitionStatus:v},ref:[f.context.backdropRef,n],stateAttributesMapping:z8,props:[{role:"presentation",hidden:!y,style:{userSelect:"none",WebkitUserSelect:"none"}},u],enabled:l||!p})}),lj=S.forwardRef(function(t,n){const{render:i,className:o,id:l,...u}=t,{store:f}=jl(),h=tr(l);return f.useSyncedValueWithCleanup("descriptionElementId",h),At("p",t,{ref:n,props:[{id:h},u]})});let U8=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),B8=(function(e){return e[e.open=Co.open]="open",e[e.closed=Co.closed]="closed",e[e.startingStyle=Co.startingStyle]="startingStyle",e[e.endingStyle=Co.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const cj=S.createContext(void 0);function H8(){const e=S.useContext(cj);if(e===void 0)throw new Error(nn(26));return e}const F8={...Nl,...Ko,nestedDialogOpen(e){return e?{[B8.nestedDialogOpen]:""}:null}},uj=S.forwardRef(function(t,n){const{className:i,finalFocus:o,initialFocus:l,render:u,...f}=t,{store:h}=jl(),p=h.useState("descriptionElementId"),y=h.useState("disablePointerDismissal"),v=h.useState("floatingRootContext"),b=h.useState("popupProps"),x=h.useState("modal"),E=h.useState("mounted"),_=h.useState("nested"),T=h.useState("nestedOpenDialogCount"),C=h.useState("open"),M=h.useState("openMethod"),R=h.useState("titleElementId"),N=h.useState("transitionStatus"),k=h.useState("role");H8(),Yo({open:C,ref:h.context.popupRef,onComplete(){C&&h.context.onOpenChangeComplete?.(!0)}});function z(F){return F==="touch"?h.context.popupRef.current:!0}const j=l===void 0?z:l,A=T>0,G=At("div",t,{state:{open:C,nested:_,transitionStatus:N,nestedDialogOpen:A},props:[b,{"aria-labelledby":R??void 0,"aria-describedby":p??void 0,role:k,tabIndex:-1,hidden:!E,onKeyDown(F){JN.has(F.key)&&F.stopPropagation()},style:{[U8.nestedDialogs]:T}},f],ref:[n,h.context.popupRef,h.useStateSetter("popupElement")],stateAttributesMapping:F8});return d.jsx(wN,{context:v,openInteractionType:M,disabled:!E,closeOnFocusOut:!y,initialFocus:j,returnFocus:o,modal:x!==!1,restoreFocus:"popup",children:G})}),fj=S.forwardRef(function(t,n){const{keepMounted:i=!1,...o}=t,{store:l}=jl(),u=l.useState("mounted"),f=l.useState("modal"),h=l.useState("open");return u||i?d.jsx(cj.Provider,{value:i,children:d.jsxs(_N,{ref:n,...o,children:[u&&f===!0&&d.jsx(KN,{ref:l.context.internalBackdropRef,inert:cb(!h)}),t.children]})}):null});function q8(e){const{store:t,parentContext:n,actionsRef:i}=e,o=t.useState("open"),l=t.useState("disablePointerDismissal"),u=t.useState("modal"),f=t.useState("popupElement"),{openMethod:h,triggerProps:p,reset:y}=jq(o);bF(t);const{forceUnmount:v}=xF(o,t,()=>{y()}),b=je(G=>{const F=Pt(G);return F.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},F}),x=S.useCallback(()=>{t.setOpen(!1,b(_B))},[t,b]);S.useImperativeHandle(i,()=>({unmount:v,close:x}),[v,x]);const E=CF({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[_,T]=S.useState(0),C=_===0,M=DF(E),R=aF(E,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:u==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(G){if(!t.context.outsidePressEnabledRef.current||"button"in G&&G.button!==0||"touches"in G&&G.touches.length!==1)return!1;const F=Sr(G);if(C&&!l){const P=F;return u&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===P||t.context.backdropRef.current===P||Rt(P,f)&&!P?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:C});qN(o&&u===!0,f);const{getReferenceProps:N,getFloatingProps:k,getTriggerProps:z}=kF([M,R]);t.useContextCallback("onNestedDialogOpen",G=>{T(G+1)}),t.useContextCallback("onNestedDialogClose",()=>{T(0)}),S.useEffect(()=>(n?.onNestedDialogOpen&&o&&n.onNestedDialogOpen(_),n?.onNestedDialogClose&&!o&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&o&&n.onNestedDialogClose()}),[o,n,_]);const j=S.useMemo(()=>N(p),[N,p]),A=S.useMemo(()=>z(p),[z,p]),D=S.useMemo(()=>k(),[k]);t.useSyncedValues({openMethod:h,activeTriggerProps:j,inactiveTriggerProps:A,popupProps:D,floatingRootContext:E,nestedOpenDialogCount:_})}const V8={..._F,modal:ke(e=>e.modal),nested:ke(e=>e.nested),nestedOpenDialogCount:ke(e=>e.nestedOpenDialogCount),disablePointerDismissal:ke(e=>e.disablePointerDismissal),openMethod:ke(e=>e.openMethod),descriptionElementId:ke(e=>e.descriptionElementId),titleElementId:ke(e=>e.titleElementId),viewportElement:ke(e=>e.viewportElement),role:ke(e=>e.role)};class $8 extends kN{constructor(t){super(G8(t),{popupRef:S.createRef(),backdropRef:S.createRef(),internalBackdropRef:S.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new ab,onOpenChange:void 0,onOpenChangeComplete:void 0},V8)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const i={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",i);const o={open:t},l=n.trigger?.id??null;(l||t)&&(o.activeTriggerId=l,o.activeTriggerElement=n.trigger??null),this.update(o)}}function G8(e={}){return{...EF(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function K8(e){const{children:t,open:n,defaultOpen:i=!1,onOpenChange:o,onOpenChangeComplete:l,disablePointerDismissal:u=!1,modal:f=!0,actionsRef:h,handle:p,triggerId:y,defaultTriggerId:v=null}=e,b=jl(!0),x=!!b,E=En(()=>p?.store??new $8({open:i,openProp:n,activeTriggerId:v,triggerIdProp:y,modal:f,disablePointerDismissal:u,nested:x})).current;cH(()=>{n===void 0&&E.state.open===!1&&i===!0&&E.update({open:!0,activeTriggerId:v})}),E.useControlledProp("openProp",n),E.useControlledProp("triggerIdProp",y),E.useSyncedValues({disablePointerDismissal:u,nested:x,modal:f}),E.useContextCallback("onOpenChange",o),E.useContextCallback("onOpenChangeComplete",l);const _=E.useState("payload");q8({store:E,actionsRef:h,parentContext:b?.store.context});const T=S.useMemo(()=>({store:E}),[E]);return d.jsx(aj.Provider,{value:T,children:typeof t=="function"?t({payload:_}):t})}const dj=S.forwardRef(function(t,n){const{render:i,className:o,id:l,...u}=t,{store:f}=jl(),h=tr(l);return f.useSyncedValueWithCleanup("titleElementId",h),At("h2",t,{ref:n,props:[{id:h},u]})}),Er=K8,Y8=S.forwardRef(({className:e,...t},n)=>d.jsx(fb,{ref:n,className:me("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",e),...t}));Y8.displayName="DialogOverlay";const Xn=S.forwardRef(({className:e,children:t,...n},i)=>d.jsxs(fj,{children:[d.jsx(fb,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),d.jsx(uj,{ref:i,className:me("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})]}));Xn.displayName="DialogContent";const Qn=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:me("px-5 py-3 border-b border-border",e),...t}));Qn.displayName="DialogHeader";const pn=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:me("px-5 py-3 border-t border-border flex justify-end gap-2",e),...t}));pn.displayName="DialogFooter";const Wn=S.forwardRef(({className:e,...t},n)=>d.jsx(dj,{ref:n,className:me("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));Wn.displayName="DialogTitle";const X8=S.forwardRef(({className:e,...t},n)=>d.jsx(lj,{ref:n,className:me("font-mono text-[10px] text-neutral-500",e),...t}));X8.displayName="DialogDescription";const db=S.forwardRef(({className:e,page:t,totalPages:n,totalItems:i,onPageChange:o,...l},u)=>d.jsxs("div",{ref:u,className:me("px-5 py-2.5 border-t border-border flex items-center justify-between",e),...l,children:[d.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[i," items · Page ",t," of ",n]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsx(Ae,{size:"sm",variant:"default",disabled:t<=1,onClick:()=>o(t-1),children:"Prev"}),d.jsx(Ae,{size:"sm",variant:"default",disabled:t>=n,onClick:()=>o(t+1),children:"Next"})]})]}));db.displayName="Pagination";const Q8=S.forwardRef(({className:e,orientation:t="horizontal",...n},i)=>d.jsx("hr",{ref:i,"aria-orientation":t==="vertical"?"vertical":void 0,className:me("border-none m-0",t==="horizontal"?"h-px w-full bg-border":"w-px h-4 bg-border",e),...n}));Q8.displayName="Separator";const W8=Vi("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"}}),Z8=S.forwardRef(({className:e,side:t,children:n,...i},o)=>d.jsxs(fj,{children:[d.jsx(fb,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),d.jsx(uj,{ref:o,className:me(W8({side:t,className:e})),...i,children:n})]}));Z8.displayName="SheetContent";const J8=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:me("px-5 py-3 border-b border-border",e),...t}));J8.displayName="SheetHeader";const eV=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:me("px-5 py-3 border-t border-border flex justify-end gap-2",e),...t}));eV.displayName="SheetFooter";const tV=S.forwardRef(({className:e,...t},n)=>d.jsx(dj,{ref:n,className:me("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));tV.displayName="SheetTitle";const nV=S.forwardRef(({className:e,...t},n)=>d.jsx(lj,{ref:n,className:me("text-sm text-neutral-400",e),...t}));nV.displayName="SheetDescription";const rV=S.forwardRef(({className:e,...t},n)=>d.jsx("div",{ref:n,className:me("rounded-md bg-neutral-800 animate-pulse",e),...t}));rV.displayName="Skeleton";const sV=S.createContext(void 0);function hb(){const e=S.useContext(sV);if(e===void 0)throw new Error(nn(64));return e}let iV=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const hj={tabActivationDirection:e=>({[iV.activationDirection]:e})},pj=S.createContext(void 0);function oV(){const e=S.useContext(pj);if(e===void 0)throw new Error(nn(65));return e}const aV=S.forwardRef(function(t,n){const{className:i,disabled:o=!1,render:l,value:u,id:f,nativeButton:h=!0,...p}=t,{value:y,getTabPanelIdByValue:v,orientation:b}=hb(),{activateOnFocus:x,highlightedTabIndex:E,onTabActivation:_,setHighlightedTabIndex:T,tabsListElement:C}=oV(),M=tr(f),R=S.useMemo(()=>({disabled:o,id:M,value:u}),[o,M,u]),{compositeProps:N,compositeRef:k,index:z}=nj({metadata:R}),j=u===y,A=S.useRef(!1);De(()=>{if(A.current){A.current=!1;return}if(!(j&&z>-1&&E!==z))return;const V=C;if(V!=null){const U=Si(_t(V));if(U&&Rt(V,U))return}o||T(z)},[j,z,E,T,o,C]);const{getButtonProps:D,buttonRef:G}=El({disabled:o,native:h,focusableWhenDisabled:!0}),F=v(u),P=S.useRef(!1),Q=S.useRef(!1);function X(V){j||o||_(u,Pt(Pi,V.nativeEvent,void 0,{activationDirection:"none"}))}function te(V){j||(z>-1&&!o&&T(z),!o&&x&&(!P.current||P.current&&Q.current)&&_(u,Pt(Pi,V.nativeEvent,void 0,{activationDirection:"none"})))}function L(V){if(j||o)return;P.current=!0;function U(){P.current=!1,Q.current=!1}(!V.button||V.button===0)&&(Q.current=!0,_t(V.currentTarget).addEventListener("pointerup",U,{once:!0}))}return At("button",t,{state:{disabled:o,active:j,orientation:b},ref:[n,G,k],props:[N,{role:"tab","aria-controls":F,"aria-selected":j,id:M,onClick:X,onFocus:te,onPointerDown:L,[sj]:j?"":void 0,onKeyDownCapture(){A.current=!0}},p,D]})});let lV=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const cV={...hj,...Ko},uV=S.forwardRef(function(t,n){const{className:i,value:o,render:l,keepMounted:u=!1,...f}=t,{value:h,getTabIdByPanelValue:p,orientation:y,tabActivationDirection:v,registerMountedTabPanel:b,unregisterMountedTabPanel:x}=hb(),E=tr(),_=S.useMemo(()=>({id:E,value:o}),[E,o]),{ref:T,index:C}=ub({metadata:_}),M=o===h,{mounted:R,transitionStatus:N,setMounted:k}=Lh(M),z=!R,j=p(o),A={hidden:z,orientation:y,tabActivationDirection:v,transitionStatus:N},D=S.useRef(null),G=At("div",t,{state:A,ref:[n,T,D],props:[{"aria-labelledby":j,hidden:z,id:E,role:"tabpanel",tabIndex:M?0:-1,inert:cb(!M),[lV.index]:C},f],stateAttributesMapping:cV});return Yo({open:M,ref:D,onComplete(){M||k(!1)}}),De(()=>{if(!(z&&!u)&&E!=null)return b(o,E),()=>{x(o,E)}},[z,u,o,E,b,x]),u||R?G:null}),fV=S.forwardRef(function(t,n){const{activateOnFocus:i=!1,className:o,loopFocus:l=!0,render:u,...f}=t,{getTabElementBySelectedValue:h,onValueChange:p,orientation:y,value:v,setTabMap:b,tabActivationDirection:x}=hb(),[E,_]=S.useState(0),[T,C]=S.useState(null),M=dV(v,y,T,h),R=je((j,A)=>{if(j!==v){const D=M(j);A.activationDirection=D,p(j,A)}}),N={orientation:y,tabActivationDirection:x},k={"aria-orientation":y==="vertical"?"vertical":void 0,role:"tablist"},z=S.useMemo(()=>({activateOnFocus:i,highlightedTabIndex:E,onTabActivation:R,setHighlightedTabIndex:_,tabsListElement:T,value:v}),[i,E,R,_,T,v]);return d.jsx(pj.Provider,{value:z,children:d.jsx(ij,{render:u,className:o,state:N,refs:[n,C],props:[k,f],stateAttributesMapping:hj,highlightedIndex:E,enableHomeAndEndKeys:!0,loopFocus:l,orientation:y,onHighlightedIndexChange:_,onMapChange:b,disabledIndices:Yc})})});function ET(e,t){const{left:n,top:i}=e.getBoundingClientRect(),{left:o,top:l}=t.getBoundingClientRect(),u=n-o,f=i-l;return{left:u,top:f}}function dV(e,t,n,i){const[o,l]=S.useState(null);return De(()=>{if(e==null||n==null){l(null);return}const u=i(e);if(u==null){l(null);return}const{left:f,top:h}=ET(u,n);l(t==="horizontal"?f:h)},[t,i,n,e]),S.useCallback(u=>{if(u===e)return"none";if(u==null)return l(null),"none";if(u!=null&&n!=null){const f=i(u);if(f!=null){const{left:h,top:p}=ET(f,n);if(o==null)return l(t==="horizontal"?h:p),"none";if(t==="horizontal"){if(h<o)return l(h),"left";if(h>o)return l(h),"right"}else{if(p<o)return l(p),"up";if(p>o)return l(p),"down"}}}return"none"},[i,t,o,n,e])}const hV=S.forwardRef(({className:e,...t},n)=>d.jsx(fV,{ref:n,className:me("flex items-center gap-0.5",e),...t}));hV.displayName="TabsList";const pV=Vi("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"}}),mV=S.forwardRef(({className:e,variant:t,...n},i)=>d.jsx(aV,{ref:i,className:me(pV({variant:t,className:e})),...n}));mV.displayName="TabsTrigger";const gV=S.forwardRef(({className:e,...t},n)=>d.jsx(uV,{ref:n,className:me("outline-none",e),...t}));gV.displayName="TabsContent";const yV=S.forwardRef(({className:e,...t},n)=>d.jsx("p",{ref:n,className:me("font-mono text-[11px] text-neutral-300",e),...t}));yV.displayName="Text";const vV=S.forwardRef(({className:e,...t},n)=>d.jsx("p",{ref:n,className:me("font-mono text-[10px] text-neutral-500",e),...t}));vV.displayName="TextMuted";const bV=S.forwardRef(({className:e,...t},n)=>d.jsx("code",{ref:n,className:me("font-mono text-[11px] text-white",e),...t}));bV.displayName="TextCode";const xV=S.forwardRef(({className:e,...t},n)=>d.jsx("span",{ref:n,className:me("font-mono text-[9px] uppercase tracking-wider text-neutral-500",e),...t}));xV.displayName="TextLabel";const SV=S.forwardRef(({className:e,...t},n)=>d.jsx("pre",{ref:n,className:me("font-mono text-[11px] text-neutral-300 p-3 rounded border border-border bg-panel-alt overflow-x-auto",e),...t}));SV.displayName="CodeBlock";function Xo(e,t){const[n,i]=S.useState(()=>{if(typeof window>"u")return t;try{const l=window.localStorage.getItem(e);return l===null?t:JSON.parse(l)}catch{return t}});S.useEffect(()=>{try{n==null?window.localStorage.removeItem(e):window.localStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]);const o=S.useCallback(l=>{i(u=>typeof l=="function"?l(u):l)},[]);return[n,o]}const EV="console:instance-id";function zh(){const[e,t]=Xo(EV,""),n=e.trim();return S.useMemo(()=>({instanceId:n.length>0?n:void 0,rawInstanceId:e,setInstanceId:t,clearInstanceId:()=>t("")}),[n,e,t])}const Dn={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 Qi(e,t){return e===0?!1:e??t}function _V(e){const t=new URLSearchParams;if(!e)return t;for(const[n,i]of Object.entries(e))i!=null&&t.set(n,String(i));return t}function mj(e,t,n){const i=e.endsWith("/")?e.slice(0,-1):e,l=_V(n)?.toString();return`${i}${t}${l?`?${l}`:""}`}function Uh(e,t){if(!t||!e)throw new Error("Not connected");return e}async function sr(e){const t={Authorization:`Bearer ${e.connectionConfig.token}`};e.body!==void 0&&(t["Content-Type"]="application/json");const n=await fetch(mj(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 new Error(e.errorMessage);return n.json()}async function wV(e){const t=await fetch(mj(e.connectionConfig.serverUrl,e.path,e.query),{method:"GET",headers:{Authorization:`Bearer ${e.connectionConfig.token}`}});if(!t.ok)throw new Error(e.errorMessage);return t.blob()}function Hr(e){const{config:t,isConnected:n}=$o();return wR({queryKey:e.queryKey,queryFn:()=>sr({connectionConfig:Uh(t,n),path:e.path,query:e.query,method:e.method,errorMessage:e.errorMessage}),enabled:(e.enabled??!0)&&n&&!!t,refetchInterval:e.refetchInterval})}function pb(e){const{config:t,isConnected:n}=$o();return wR({queryKey:e.queryKey,queryFn:()=>{if(e.id===void 0)throw new Error(e.requiredMessage);return sr({connectionConfig:Uh(t,n),path:e.path(e.id),query:e.query,errorMessage:e.errorMessage})},enabled:(e.enabled??!0)&&e.id!==void 0&&n&&!!t})}function TV(e,t){for(const n of t)e.invalidateQueries({queryKey:n})}function ir(e){const{instanceId:t}=zh();return e??t}function Fr(e){const{config:t,isConnected:n}=$o(),{instanceId:i}=zh(),o=Rv();return G5({mutationFn:l=>e.mutationFn({connectionConfig:Uh(t,n),variables:l,selectedInstanceId:i}),onSuccess:()=>{e.invalidateQueryKeys&&TV(o,e.invalidateQueryKeys)}})}function xu(e={}){const t=ir(e.instanceId);return Hr({queryKey:Dn.stats({partitionId:e.partitionId,instanceId:t}),path:"/console/stats",query:{partitionId:e.partitionId,instanceId:t},errorMessage:"Failed to fetch stats",refetchInterval:Qi(e.refetchIntervalMs,5e3)})}function CV(e={},t={}){const n=ir(e.instanceId);return Hr({queryKey:Dn.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:Qi(t.refetchIntervalMs,3e4)})}function RV(e={},t={}){const n=ir(e.instanceId);return Hr({queryKey:Dn.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:Qi(t.refetchIntervalMs,3e4)})}function NV(e={},t={}){const n=ir(e.instanceId);return Hr({queryKey:Dn.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:Qi(t.refetchIntervalMs,1e4)})}function jV(e,t={}){const n=ir(t.instanceId);return pb({queryKey:Dn.commitDetail(e,t.partitionId,n),id:e,requiredMessage:"Commit sequence is required",path:i=>`/console/commits/${encodeURIComponent(String(i))}`,query:{partitionId:t.partitionId,instanceId:n},errorMessage:"Failed to fetch commit detail",enabled:t.enabled})}function MV(e={},t={}){const n=ir(e.instanceId);return Hr({queryKey:Dn.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:Qi(t.refetchIntervalMs,1e4)})}function gj(e={},t={}){const n=ir(e.instanceId);return Hr({queryKey:Dn.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:Qi(t.refetchIntervalMs,1e4)})}function AV(e,t={}){const n=ir(t.instanceId);return pb({queryKey:Dn.eventDetail(e,t.partitionId,n),id:e,requiredMessage:"Event id is required",path:i=>`/console/events/${encodeURIComponent(String(i))}`,query:{partitionId:t.partitionId,instanceId:n},errorMessage:"Failed to fetch event detail",enabled:t.enabled})}function OV(e,t={}){const n=ir(t.instanceId);return pb({queryKey:Dn.eventPayload(e,t.partitionId,n),id:e,requiredMessage:"Event id is required",path:i=>`/console/events/${encodeURIComponent(String(i))}/payload`,query:{partitionId:t.partitionId,instanceId:n},errorMessage:"Failed to fetch event payload",enabled:t.enabled})}function kV(e={}){const t=ir(e.instanceId);return Hr({queryKey:Dn.handlers(t),path:"/console/handlers",query:{instanceId:t},errorMessage:"Failed to fetch handlers"})}function IV(e={}){const t=ir(e.instanceId);return Hr({queryKey:Dn.prunePreview(t),path:"/console/prune/preview",query:{instanceId:t},method:"POST",errorMessage:"Failed to fetch prune preview",enabled:e.enabled})}function DV(e={},t={}){const n=ir(e.instanceId);return Hr({queryKey:Dn.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:Qi(t.refetchIntervalMs,1e4)})}function LV(){return Fr({mutationFn:async({connectionConfig:e,selectedInstanceId:t})=>sr({connectionConfig:e,path:"/console/events",query:{instanceId:t},method:"DELETE",errorMessage:"Failed to clear events"}),invalidateQueryKeys:[["console","events"]]})}function PV(){return Fr({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>{const i=t.instanceId??n;return sr({connectionConfig:e,path:`/console/clients/${encodeURIComponent(t.clientId)}`,query:{partitionId:t.partitionId,instanceId:i},method:"DELETE",errorMessage:"Failed to evict client"})},invalidateQueryKeys:[["console","clients"],["console","stats"],["console","operations"]]})}function zV(){return Fr({mutationFn:async({connectionConfig:e,selectedInstanceId:t})=>sr({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 UV(){return Fr({mutationFn:async({connectionConfig:e,selectedInstanceId:t})=>sr({connectionConfig:e,path:"/console/compact",query:{instanceId:t},method:"POST",errorMessage:"Failed to compact"}),invalidateQueryKeys:[["console","stats"],["console","operations"]]})}function BV(){return Fr({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>{const i=t.instanceId??n;return sr({connectionConfig:e,path:"/console/notify-data-change",query:{instanceId:i},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 HV(e={}){const t=ir(e.instanceId);return Hr({queryKey:Dn.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 FV(){return Fr({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>sr({connectionConfig:e,path:"/console/api-keys",query:{instanceId:n},method:"POST",body:t,errorMessage:"Failed to create API key"}),invalidateQueryKeys:[["console","api-keys"]]})}function qV(){return Fr({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>sr({connectionConfig:e,path:`/console/api-keys/${encodeURIComponent(t)}`,query:{instanceId:n},method:"DELETE",errorMessage:"Failed to revoke API key"}),invalidateQueryKeys:[["console","api-keys"]]})}function VV(){return Fr({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>sr({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 $V(){return Fr({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>sr({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 GV(){return Fr({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>sr({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 KV(e={}){return Hr({queryKey:Dn.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:Qi(e.refetchIntervalMs,3e4)})}function YV(){return Fr({mutationFn:async({connectionConfig:e,variables:t})=>sr({connectionConfig:e,path:`/console/storage/${encodeURIComponent(t)}`,method:"DELETE",errorMessage:"Failed to delete blob"}),invalidateQueryKeys:[["console","storage"]]})}function XV(){const{config:e,isConnected:t}=$o();return async n=>{const i=await wV({connectionConfig:Uh(e,t),path:`/console/storage/${encodeURIComponent(n)}/download`,errorMessage:"Failed to download blob"}),o=URL.createObjectURL(i),l=document.createElement("a");l.href=o,l.download=n.split("/").pop()||n,document.body.appendChild(l),l.click(),document.body.removeChild(l),URL.revokeObjectURL(o)}}const QV="console:partition-id";function Su(){const[e,t]=Xo(QV,""),n=e.trim();return S.useMemo(()=>({partitionId:n.length>0?n:void 0,rawPartitionId:e,setPartitionId:t,clearPartitionId:()=>t("")}),[n,e,t])}const _T={refreshInterval:5,timeFormat:"relative",showSparklines:!0,pageSize:20};function Eu(){const[e,t]=Xo("console:preferences",_T);return{preferences:e,setPreferences:t,updatePreference:(o,l)=>{t(u=>({...u,[o]:l}))},resetPreferences:()=>{t(_T)}}}const WV=[{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"}],ZV=[{value:10,label:"10"},{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"}],mb="syncular-console-root";function JV(e){e.classList.add(mb)}const e$=[{suffix:"",label:"Command"},{suffix:"/stream",label:"Stream"},{suffix:"/fleet",label:"Fleet"},{suffix:"/ops",label:"Ops"},{suffix:"/storage",label:"Storage"},{suffix:"/config",label:"Config"}];function t$(e){const t=e?.trim()??"";return!t||t==="/"?"":(t.startsWith("/")?t:`/${t}`).replace(/\/+$/g,"")}function Kg(e,t){return e?t?`${e}${t}`:e:t||"/"}function n$({basePath:e,appHref:t,modeBadge:n}){const{connect:i,config:o,isConnected:l,isConnecting:u}=$o(),{preferences:f}=Eu(),{instanceId:h,rawInstanceId:p,setInstanceId:y,clearInstanceId:v}=zh(),{partitionId:b,rawPartitionId:x,setPartitionId:E,clearPartitionId:_}=Su(),T=er({select:D=>D.location.pathname}),{data:C}=xu({refetchIntervalMs:f.refreshInterval*1e3,partitionId:b,instanceId:h}),M=t$(e),R=S.useMemo(()=>e$.map(D=>({...D,id:Kg(M,D.suffix)})),[M]),N=Kg(M,""),k=Kg(M,"/config"),z=u?"connecting":l?"connected":o?"disconnected":"not-configured",j=R.find(D=>D.suffix===""?T===N||T===`${N}/`:T.startsWith(D.id))?.id??N,A=C?[{label:"HEAD",value:`#${C.maxCommitSeq}`},{label:"COMMITS",value:`${C.commitCount}`},{label:"CHANGES",value:`${C.changeCount}`},{label:"CLIENTS",value:`${C.activeClientCount}/${C.clientCount}`}]:[];return d.jsxs("div",{className:`${mb} h-screen bg-background text-foreground flex flex-col`,children:[d.jsx(L8,{brand:d.jsx($a,{to:N,children:d.jsx(D8,{label:"console"})}),center:d.jsx(N8,{items:R,activeId:j,renderItem:(D,{active:G})=>d.jsx($a,{to:D.id,children:d.jsx(oj,{active:G,children:D.label})},D.id)}),right:d.jsxs("div",{className:"flex items-center gap-2",children:[n?d.jsx(en,{variant:"flow",className:"hidden md:inline-flex px-2 py-1 text-[10px]",children:n}):null,d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wide",children:"Instance"}),d.jsx(An,{variant:"mono",value:p,onChange:D=>y(D.target.value),onBlur:D=>y(D.target.value.trim()),placeholder:"all",className:"h-7 w-[110px] px-2 py-1"}),h?d.jsx(Ae,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[10px]",onClick:v,children:"All"}):null]}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("span",{className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wide",children:"Partition"}),d.jsx(An,{variant:"mono",value:x,onChange:D=>E(D.target.value),onBlur:D=>E(D.target.value.trim()),placeholder:"all",className:"h-7 w-[110px] px-2 py-1"}),b?d.jsx(Ae,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[10px]",onClick:_,children:"All"}):null]}),d.jsx(AB,{state:z}),d.jsx($a,{to:k,children:d.jsx(Ae,{variant:T===k?"secondary":"ghost",size:"icon",children:d.jsx(YB,{className:"h-3 w-3"})})}),t?d.jsxs("a",{href:t,className:R8,children:[d.jsx(GB,{className:"h-3 w-3"}),"Go to app"]}):null]})}),d.jsx("main",{className:"flex-1 overflow-auto pb-[32px]",children:d.jsx("div",{className:"min-h-full",children:l||T===k?d.jsx("div",{style:{animation:"pageIn 0.3s ease-out"},children:d.jsx(XR,{})},T):d.jsx(r$,{configPath:k,hasSavedConfig:!!o,isConnecting:u,onConnect:()=>{i()}})})}),l&&d.jsx(H1,{isLive:l,metrics:A,uptime:"--"})]})}function r$({configPath:e,hasSavedConfig:t,isConnecting:n,onConnect:i}){return d.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[d.jsx("p",{className:"mb-4 text-foreground-muted",children:"Not connected to a @syncular server"}),d.jsxs("div",{className:"flex items-center gap-2",children:[t&&d.jsx(Ae,{variant:"default",onClick:i,disabled:n,children:n?"Connecting...":"Connect"}),d.jsx($a,{to:e,children:d.jsx(Ae,{variant:"link",children:"Configure connection"})})]})]})}const Vs=O3({component:n$});function s$(e={}){const{maxEvents:t=100,enabled:n=!0,staleAfterMs:i=65e3,replayLimit:o=100,partitionId:l,instanceId:u}=e,{config:f,isConnected:h}=$o(),{instanceId:p}=zh(),y=u??p,[v,b]=S.useState([]),[x,E]=S.useState(!1),[_,T]=S.useState("disconnected"),[C,M]=S.useState(null),R=S.useRef(null),N=S.useRef(null),k=S.useRef(null),z=S.useRef(0),j=S.useRef(0),A=S.useRef(null),D=S.useCallback(()=>{b([]),A.current=null},[]);return S.useEffect(()=>{if(!n||!h||!f?.serverUrl||!f?.token)return;let G=!1;const F=Number.isFinite(o)?Math.max(1,Math.min(500,Math.floor(o))):100;if(typeof WebSocket>"u")return;const P=()=>{N.current&&(clearTimeout(N.current),N.current=null)},Q=()=>{k.current&&(clearInterval(k.current),k.current=null)},X=()=>{if(G||N.current)return;z.current+=1;const $=Math.min(3e4,1e3*2**Math.max(0,z.current-1)),H=Math.floor($*.2*Math.random()),V=$+H;N.current=setTimeout(()=>{N.current=null,G||L()},V)},te=()=>{j.current=Date.now(),E(!0),T("connected")},L=()=>{if(G)return;T("connecting"),P();const $=(()=>{const V=new URL(f.serverUrl,window.location.origin);V.protocol=V.protocol==="https:"?"wss:":"ws:";const U=V.pathname.endsWith("/")?V.pathname.slice(0,-1):V.pathname;return V.pathname=`${U}/console/events/live`,V.search="",A.current&&V.searchParams.set("since",A.current),V.searchParams.set("replayLimit",String(F)),l&&V.searchParams.set("partitionId",l),y&&V.searchParams.set("instanceId",y),V.toString()})(),H=new WebSocket($);R.current=H,H.onopen=()=>{if(G){H.close();return}z.current=0,M(null),T("connecting"),E(!1);try{H.send(JSON.stringify({type:"auth",token:f.token}))}catch{H.close();return}Q(),k.current=setInterval(()=>{const V=R.current;if(!V||V.readyState!==WebSocket.OPEN)return;const U=j.current;!U||Date.now()-U<=i||(E(!1),T("stale"),V.close())},1e3)},H.onclose=()=>{G||(E(!1),T("disconnected"),Q(),X())},H.onerror=()=>{G||M(new Error("WebSocket connection failed"))},H.onmessage=V=>{try{const U=JSON.parse(V.data),I=U.type;if(te(),I==="connected"||I==="heartbeat"||I==="auth_required")return;if(I==="error"){const se=typeof U.message=="string"?U.message:"Live events authentication failed";M(new Error(se));return}const K={type:I,timestamp:U.timestamp||new Date().toISOString(),data:U};if(l&&K.data.partitionId!==l||y&&K.data.instanceId!==y)return;const Z=Date.parse(A.current??""),W=Date.parse(K.timestamp);Number.isFinite(W)&&(!Number.isFinite(Z)||W>Z)&&(A.current=K.timestamp),b(se=>[K,...se].slice(0,t))}catch{}}};return L(),()=>{G=!0,P(),Q(),R.current&&(R.current.close(),R.current=null),E(!1),T("disconnected")}},[n,h,f?.serverUrl,f?.token,t,l,y,o,i]),{events:v,isConnected:x,connectionState:_,error:C,clearEvents:D}}const i$=S.createContext(null);function yj(){const[e,t]=Xo("console:time-range","24h");return{range:e,setRange:t}}const o$=[{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 a$(e){const t=e.toLowerCase();for(const n of o$)if(t.includes(n.hint))return n.type;return"client"}function l$(e){const 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 c$(e,t){return typeof e.lagCommitCount=="number"?Math.max(0,e.lagCommitCount):t?Math.max(0,t.maxCommitSeq-e.cursor):0}function u$(e,t){return e.activityState==="stale"?"offline":t>0?"syncing":"online"}function f$(e,t){return e.length<=16?e:`${e.slice(0,12)}-${t+1}`}function d$(e,t,n={}){const i=n.maxNodes??10;return e.slice(0,i).map((o,l)=>{const u=c$(o,t),f=u$(o,u);return{id:f$(o.clientId,l),type:a$(o.clientId),status:f,cursor:Math.max(0,o.cursor),actor:o.actorId,mode:o.connectionMode,dialect:l$(o.clientId),scopes:Object.keys(o.effectiveScopes||{}),lastSeen:o.updatedAt}})}const h$={enabled:!1,thresholds:{p90Latency:500,errorRate:5,clientLag:100}};function wT(e,t="relative"){if(t==="absolute")return new Date(e).toLocaleString();const n=new Date(e),o=new Date().getTime()-n.getTime(),l=Math.floor(o/1e3);return l<60?`${l}s ago`:l<3600?`${Math.floor(l/60)}m ago`:l<86400?`${Math.floor(l/3600)}h ago`:`${Math.floor(l/86400)}d ago`}function p$(e){const t=e.length>1&&e.endsWith("/")?e.slice(0,-1):e;return t==="/console"||t.startsWith("/console/")?"/console/stream":"/stream"}function m$(){const e=Sh(),t=S.useMemo(()=>typeof window>"u"?"/stream":p$(window.location.pathname),[]),n=yj(),{range:i}=n,{preferences:o}=Eu(),{partitionId:l}=Su(),u=o.refreshInterval*1e3,[f]=Xo("console:alert-config",h$),[h,p]=S.useState("1h"),{data:y}=xu({refetchIntervalMs:u,partitionId:l}),{data:v}=CV({range:i,partitionId:l},{refetchIntervalMs:u}),{data:b}=RV({range:i,partitionId:l},{refetchIntervalMs:u}),{data:x}=NV({limit:5,partitionId:l},{refetchIntervalMs:u}),{data:E}=gj({limit:12,offset:0,partitionId:l},{refetchIntervalMs:u}),{events:_,isConnected:T}=s$({maxEvents:8,partitionId:l}),C=S.useMemo(()=>{const P=v?.buckets??[];let Q=0,X=0;for(const L of P)Q+=L.pushCount+L.pullCount,X+=L.errorCount;const te=Q>0?X/Q*100:0;return{totalEvents:Q,errorRate:te}},[v?.buckets]),M=S.useMemo(()=>E?.items?d$(E.items,y,{maxNodes:12}):[],[E?.items,y]),R=M.filter(P=>P.status!=="offline").length,N=M.filter(P=>P.status==="offline").length,k=S.useMemo(()=>y?[{label:"Ops (Range)",value:C.totalEvents,color:"flow"},{label:"P50 Latency",value:b?.push?.p50??0,unit:"ms",color:"healthy"},{label:"Error Rate",value:`${C.errorRate.toFixed(1)}%`,color:C.errorRate>0?"offline":"muted"},{label:"Active Clients",value:y.activeClientCount,color:"syncing"},{label:"Pending",value:y.maxActiveClientCursor!==null&&y.maxCommitSeq>0?y.maxCommitSeq-(y.minActiveClientCursor??0):0,color:"relay"}]:[],[y,b,C.errorRate,C.totalEvents]),z=S.useMemo(()=>_.map(P=>({type:P.type.toUpperCase(),actor:P.data?.actorId??"",table:(P.data?.tables??[])[0]??"",time:wT(P.timestamp,o.timeFormat)})),[_,o.timeFormat]),j=S.useMemo(()=>{const P=v?.buckets;if(!P?.length)return[];const Q=Math.max(...P.map(X=>Math.max(X.pushCount,X.pullCount)),1);return P.map(X=>({pushPercent:Q>0?X.pushCount/Q*100:0,pullPercent:Q>0?X.pullCount/Q*100:0}))},[v?.buckets]),A=S.useMemo(()=>{if(!b)return[];const P=Math.max(b.push.p50,b.push.p90,b.push.p99,b.pull.p50,b.pull.p90,b.pull.p99,1);return[{label:"P50",pushMs:b.push.p50,pullMs:b.pull.p50,pushBarPercent:b.push.p50/P*100,pullBarPercent:b.pull.p50/P*100},{label:"P90",pushMs:b.push.p90,pullMs:b.pull.p90,pushBarPercent:b.push.p90/P*100,pullBarPercent:b.pull.p90/P*100},{label:"P99",pushMs:b.push.p99,pullMs:b.pull.p99,pushBarPercent:b.push.p99/P*100,pullBarPercent:b.pull.p99/P*100}]},[b]),D=S.useMemo(()=>x?.items?x.items.map(P=>({seq:P.commitSeq,actor:P.actorId,changes:P.changeCount,tables:(P.affectedTables??[]).join(", "),time:wT(P.createdAt,o.timeFormat)})):[],[x?.items,o.timeFormat]),G=S.useMemo(()=>Math.max(0,100-C.errorRate),[C.errorRate]),F=S.useMemo(()=>{if(!f.enabled||!y)return[];const P=[];return b?.push?.p90&&b.push.p90>f.thresholds.p90Latency&&P.push(`P90 push latency (${b.push.p90}ms) exceeds threshold (${f.thresholds.p90Latency}ms)`),y.minActiveClientCursor!==null&&y.maxCommitSeq-y.minActiveClientCursor>f.thresholds.clientLag&&P.push(`Client lag (${y.maxCommitSeq-y.minActiveClientCursor}) exceeds threshold (${f.thresholds.clientLag})`),C.errorRate>f.thresholds.errorRate&&P.push(`Error rate (${C.errorRate.toFixed(1)}%) exceeds threshold (${f.thresholds.errorRate}%)`),P},[f,y,b,C.errorRate]);return y?d.jsx(i$.Provider,{value:n,children:d.jsxs("div",{className:"flex flex-col",children:[F.length>0&&d.jsx("div",{className:"px-6 pb-4",children:d.jsxs(bn,{variant:"destructive",children:[d.jsx(bu,{children:"Threshold Exceeded"}),d.jsx(xn,{children:F.map((P,Q)=>d.jsx("span",{className:"block",children:P},Q))})]})}),d.jsx(UN,{clients:M,totalNodes:M.length+2,onlineCount:R,offlineCount:N,relayClientIds:[]}),d.jsx(X1,{items:k}),d.jsxs("div",{className:"flex",children:[d.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[d.jsx("div",{className:"border-b border-border border-r border-border",children:d.jsx(S1,{bars:j,activeRange:h,onRangeChange:p})}),d.jsx("div",{className:"border-b border-border border-r border-border",children:d.jsx(Q1,{buckets:A,successRate:G})}),d.jsx("div",{className:"border-r border-border",children:d.jsx(F1,{commits:D,onViewAll:()=>e({href:t})})})]}),d.jsx(W1,{entries:z,isConnected:T,maxVisible:20,maxHeight:"calc(100vh - 200px)"})]})]})}):d.jsx("div",{className:"flex items-center justify-center py-24",children:d.jsx(Mt,{size:"lg"})})}function g$(){return d.jsx(m$,{})}const Dr=rj;function y$({children:e}){return d.jsxs("div",{className:"space-y-4 px-5 py-5",children:[d.jsx(v$,{}),d.jsx(_$,{}),d.jsx(w$,{}),e]})}function v$(){const{clearError:e,config:t,connect:n,disconnect:i,error:o,isConnected:l,isConnecting:u}=$o(),[f,h]=S.useState(t?.serverUrl??"/api"),[p,y]=S.useState(t?.token??""),[v,b]=S.useState(null),[x,E]=S.useState(!1),[_,T]=S.useState(null),[C,M]=Xo("console:disconnect-clear-saved-config",!1);S.useEffect(()=>{const j=new URLSearchParams(window.location.search),A=j.get("server");let D=!1;if(A&&(h(A),j.delete("server"),D=!0),j.has("token")&&(j.delete("token"),D=!0),D){const G=j.toString(),F=G?`${window.location.pathname}?${G}`:window.location.pathname;window.history.replaceState({},"",F)}},[]),S.useEffect(()=>{t?.serverUrl&&h(t.serverUrl),t?.token&&y(t.token)},[t?.serverUrl,t?.token]),S.useEffect(()=>{T(null)},[]);const R=async()=>{e(),b(null);const j=await n({serverUrl:f.trim(),token:p.trim()},{persistOverride:!0});T(j?"Connected successfully and configuration saved.":"Failed to connect with the provided settings.")},N=()=>{i({clearSavedConfig:C}),C&&(h("/api"),y("")),T(C?"Disconnected and saved credentials cleared.":"Disconnected."),b(null)},k=async()=>{E(!0),b(null),T(null);const j=performance.now();try{const A=f.trim(),D=p.trim();if(!A||!D)throw new Error("Missing server URL or token");if(!(await fetch(`${A}/console/stats`,{headers:{Authorization:`Bearer ${D}`}})).ok)throw new Error("Failed to connect");b(Math.round(performance.now()-j))}catch{b(-1)}finally{E(!1)}},z=o??_??(v!==null?v<0?"Connection failed":`Connection successful (${v}ms latency)`:void 0);return d.jsx(V1,{isConnected:l,isConnecting:u,isTestingConnection:x,serverUrl:f,onServerUrlChange:h,consoleToken:p,onConsoleTokenChange:y,onSaveAndConnect:R,onDisconnect:N,onTestConnection:k,statusMessage:z,children:d.jsx("div",{className:"px-5 pb-5 -mt-2",children:d.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2",children:[d.jsxs("div",{children:[d.jsx("p",{className:"font-mono text-[10px] text-neutral-400",children:"Clear saved credentials on disconnect"}),d.jsx("p",{className:"font-mono text-[9px] text-neutral-500",children:"Removes stored server URL and token from this browser."})]}),d.jsx(Mh,{checked:C,onCheckedChange:M})]})})})}const b$=1440*60*1e3;function TT(e){const t=e.trim();if(!t)return null;const n=Number.parseInt(t,10);return!Number.isInteger(n)||n<=0?null:n}function Yg(e){if(!e)return"Never";const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():"Invalid date"}function x$(e){return e.length===0?"all scopes":e.length<=2?e.join(", "):`${e.slice(0,2).join(", ")} +${e.length-2}`}function S$(e,t){if(e.revokedAt)return"revoked";if(!e.expiresAt)return"active";const n=Date.parse(e.expiresAt);if(!Number.isFinite(n))return"active";const i=Date.now();return n<=i?"expired":n<=i+t*b$?"expiring":"active"}function E$(e){return e==="revoked"?"destructive":e==="expired"?"offline":e==="expiring"?"syncing":"healthy"}function _$(){const[e,t]=S.useState("all"),[n,i]=S.useState("all"),[o,l]=S.useState("14"),[u,f]=S.useState(!1),[h,p]=S.useState(!1),[y,v]=S.useState(""),[b,x]=S.useState("relay"),[E,_]=S.useState(""),[T,C]=S.useState(""),[M,R]=S.useState(""),[N,k]=S.useState(null),[z,j]=S.useState([]),[A,D]=S.useState(null),[G,F]=S.useState(null),[P,Q]=S.useState(null),[X,te]=S.useState(null),[L,$]=S.useState(null),[H,V]=S.useState(null),[U,I]=S.useState(null),K=S.useMemo(()=>TT(o),[o]),Z=K??14,W=S.useMemo(()=>TT(M),[M]),se=M.trim().length>0,ie=!se||W!==null,he=S.useMemo(()=>({type:e==="all"?void 0:e,status:n==="all"?void 0:n,expiresWithinDays:n==="expiring"?Z:void 0}),[e,n,Z]),{data:xe,isLoading:de,error:Be}=HV(he),_e=FV(),re=VV(),fe=qV(),ae=$V(),Se=GV();S.useEffect(()=>{const pe=new Set((xe?.items??[]).map(we=>we.keyId));j(we=>we.filter(He=>pe.has(He)))},[xe?.items]);const ye=async()=>{try{const pe=T.split(",").map(He=>He.trim()).filter(He=>He.length>0),we=await _e.mutateAsync({name:y,keyType:b,actorId:E||void 0,scopeKeys:pe.length>0?pe:void 0,expiresInDays:se?W??void 0:void 0});k(we.secretKey),v(""),_(""),C(""),R("")}catch{}},be=pe=>{navigator.clipboard.writeText(pe),F(pe),setTimeout(()=>F(null),2e3)},ge=async()=>{if(P)try{await fe.mutateAsync(P)}finally{Q(null)}},Le=async()=>{if(z.length!==0)try{const pe=await re.mutateAsync({keyIds:z});D(pe),j([])}catch{}},Oe=async()=>{if(X)try{const pe=await Se.mutateAsync(X.keyId);$({oldKeyId:X.keyId,oldKeyName:X.name,secretKey:pe.secretKey})}catch{}},Ee=async()=>{if(L)try{await fe.mutateAsync(L.oldKeyId)}finally{$(null),te(null)}},Fe=async()=>{if(H)try{const pe=await ae.mutateAsync(H);I(pe.secretKey)}finally{V(null)}};if(de)return d.jsx("div",{className:"flex h-[200px] items-center justify-center",children:d.jsx(Mt,{size:"lg"})});if(Be)return d.jsx("div",{className:"flex h-[200px] items-center justify-center",children:d.jsxs("p",{className:"text-danger",children:["Failed to load API keys: ",Be.message]})});const Ke=(xe?.items??[]).filter(pe=>pe.revokedAt===null).map(pe=>pe.keyId),ze=Ke.length>0&&Ke.every(pe=>z.includes(pe)),Xe=z.length>0,Ue=(xe?.items??[]).filter(pe=>z.includes(pe.keyId)).map(pe=>pe.name);return d.jsxs(d.Fragment,{children:[d.jsxs(Qv,{title:"API Keys",description:"Issue, rotate, revoke, and audit key lifecycle state.",actions:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(Ae,{size:"sm",variant:"destructive",onClick:()=>p(!0),disabled:z.length===0,children:["Revoke Selected (",z.length,")"]}),d.jsx(Ae,{size:"sm",onClick:()=>f(!0),children:"Create Key"})]}),children:[d.jsxs("div",{className:"mb-4 grid gap-3 lg:grid-cols-3",children:[d.jsxs(Wr,{children:[d.jsx(Lr,{children:"Type filter"}),d.jsxs(Cd,{value:[e],multiple:!1,onValueChange:pe=>{const we=pe.find(He=>typeof He=="string");(we==="all"||we==="relay"||we==="proxy"||we==="admin")&&t(we)},children:[d.jsx(Dr,{value:"all",children:"all"}),d.jsx(Dr,{value:"relay",children:"relay"}),d.jsx(Dr,{value:"proxy",children:"proxy"}),d.jsx(Dr,{value:"admin",children:"admin"})]})]}),d.jsxs(Wr,{children:[d.jsx(Lr,{children:"Status filter"}),d.jsxs(Cd,{value:[n],multiple:!1,onValueChange:pe=>{const we=pe.find(He=>typeof He=="string");(we==="all"||we==="active"||we==="revoked"||we==="expiring")&&i(we)},children:[d.jsx(Dr,{value:"all",children:"all"}),d.jsx(Dr,{value:"active",children:"active"}),d.jsx(Dr,{value:"revoked",children:"revoked"}),d.jsx(Dr,{value:"expiring",children:"expiring"})]})]}),d.jsxs(Wr,{children:[d.jsx(Lr,{htmlFor:"api-key-expiring-window",children:"Expiring window (days)"}),d.jsx(Ha,{children:"Used when status filter is set to expiring."}),d.jsx(An,{id:"api-key-expiring-window",placeholder:"14",value:o,inputMode:"numeric",onChange:pe=>l(pe.target.value)}),K===null&&o.trim().length>0?d.jsx("p",{className:"font-mono text-[10px] text-offline",children:"Enter a positive whole number."}):null]})]}),xe?.items.length===0?d.jsx(Yv,{message:"No API keys match the current filters."}):d.jsxs(wl,{children:[d.jsx(Tl,{children:d.jsxs(Br,{children:[d.jsx(ut,{className:"w-[28px]",children:d.jsx($y,{checked:ze,indeterminate:!ze&&Xe&&Ke.length>0,onCheckedChange:pe=>{j(pe?Ke:[])},"aria-label":"Select all active keys"})}),d.jsx(ut,{className:"w-[100px]",children:"NAME"}),d.jsx(ut,{className:"w-[55px]",children:"TYPE"}),d.jsx(ut,{className:"w-[90px]",children:"KEY PREFIX"}),d.jsx(ut,{className:"w-[80px]",children:"ACTOR"}),d.jsx(ut,{className:"w-[100px]",children:"SCOPES"}),d.jsx(ut,{className:"w-[120px]",children:"CREATED"}),d.jsx(ut,{className:"w-[120px]",children:"LAST USED"}),d.jsx(ut,{className:"w-[120px]",children:"EXPIRES"}),d.jsx(ut,{className:"flex-1",children:"STATUS"})]})}),d.jsx(Cl,{children:(xe?.items??[]).map(pe=>{const we=S$(pe,Z);return d.jsxs(Br,{className:"group relative",children:[d.jsx(ft,{className:"w-[28px]",children:d.jsx($y,{checked:z.includes(pe.keyId),onCheckedChange:He=>{j(dt=>He?[...new Set([...dt,pe.keyId])]:dt.filter(ot=>ot!==pe.keyId))},"aria-label":`Select ${pe.name}`,disabled:pe.revokedAt!==null})}),d.jsx(ft,{className:"w-[100px] font-medium",children:pe.name}),d.jsx(ft,{className:"w-[55px]",children:d.jsx(en,{variant:pe.keyType==="admin"?"flow":pe.keyType==="proxy"?"ghost":"relay",children:pe.keyType})}),d.jsx(ft,{className:"w-[90px]",children:d.jsxs("code",{className:"font-mono text-[11px]",children:[pe.keyPrefix,"..."]})}),d.jsx(ft,{className:"w-[80px] text-neutral-500",children:pe.actorId??"-"}),d.jsx(ft,{className:"w-[100px] text-neutral-500",children:d.jsx("code",{className:"font-mono text-[10px]",children:x$(pe.scopeKeys)})}),d.jsx(ft,{className:"w-[120px] text-neutral-500",children:Yg(pe.createdAt)}),d.jsx(ft,{className:"w-[120px] text-neutral-500",children:Yg(pe.lastUsedAt)}),d.jsx(ft,{className:"w-[120px] text-neutral-500",children:Yg(pe.expiresAt)}),d.jsx(ft,{className:"flex-1",children:d.jsx(en,{variant:E$(we),children:we})}),pe.revokedAt===null&&d.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:[d.jsx("button",{type:"button",onClick:()=>te(pe),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"}),d.jsx("button",{type:"button",onClick:()=>V(pe.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"}),d.jsx("button",{type:"button",onClick:()=>Q(pe.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"})]})]},pe.keyId)})})]})]}),d.jsx(Er,{open:u,onOpenChange:f,children:d.jsxs(Xn,{children:[d.jsx(Qn,{children:d.jsx(Wn,{children:"Create API Key"})}),N?d.jsx(CT,{copiedKeyId:G,onClose:()=>{k(null),f(!1)},onCopy:be,secretKey:N,warning:"Copy this key now. You will not be able to view it again."}):d.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[d.jsxs(Wr,{children:[d.jsx(Lr,{htmlFor:"api-key-name",children:"Name"}),d.jsx(An,{id:"api-key-name",placeholder:"Backend Relay Key",value:y,onChange:pe=>v(pe.target.value)})]}),d.jsxs(Wr,{children:[d.jsx(Lr,{children:"Key type"}),d.jsxs(Cd,{value:[b],multiple:!1,onValueChange:pe=>{const we=pe.find(He=>typeof He=="string");(we==="relay"||we==="proxy"||we==="admin")&&x(we)},children:[d.jsx(Dr,{value:"relay",children:"relay"}),d.jsx(Dr,{value:"proxy",children:"proxy"}),d.jsx(Dr,{value:"admin",children:"admin"})]})]}),d.jsxs(Wr,{children:[d.jsx(Lr,{htmlFor:"api-key-actor-id",children:"Actor ID (optional)"}),d.jsx(Ha,{children:"Pin this key to a fixed actor ID"}),d.jsx(An,{id:"api-key-actor-id",placeholder:"actor-123",value:E,onChange:pe=>_(pe.target.value)})]}),d.jsxs(Wr,{children:[d.jsx(Lr,{htmlFor:"api-key-scope-keys",children:"Scope keys (optional)"}),d.jsx(Ha,{children:"Comma-separated list of allowed scope keys"}),d.jsx(An,{id:"api-key-scope-keys",placeholder:"scope-a, scope-b",value:T,onChange:pe=>C(pe.target.value)})]}),d.jsxs(Wr,{children:[d.jsx(Lr,{htmlFor:"api-key-expires-days",children:"Expires in days (optional)"}),d.jsx(Ha,{children:"Leave empty to keep the key non-expiring."}),d.jsx(An,{id:"api-key-expires-days",placeholder:"30",value:M,inputMode:"numeric",onChange:pe=>R(pe.target.value)}),ie?null:d.jsx("p",{className:"font-mono text-[10px] text-offline",children:"Enter a positive whole number."})]}),d.jsxs(pn,{children:[d.jsx(Ae,{variant:"default",onClick:()=>f(!1),children:"Cancel"}),d.jsx(Ae,{variant:"primary",onClick:ye,disabled:_e.isPending||!y||!ie,children:_e.isPending?d.jsxs(d.Fragment,{children:[d.jsx(Mt,{size:"sm"}),"Creating..."]}):"Create"})]})]})]})}),d.jsx(Er,{open:h,onOpenChange:pe=>{p(pe),pe||D(null)},children:d.jsxs(Xn,{children:[d.jsx(Qn,{children:d.jsx(Wn,{children:"Bulk Revoke API Keys"})}),A?d.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[d.jsx(bn,{variant:"destructive",children:d.jsxs(xn,{children:["Requested ",A.requestedCount," keys. Revoked"," ",A.revokedCount,", already revoked"," ",A.alreadyRevokedCount,", not found"," ",A.notFoundCount,"."]})}),d.jsx(pn,{children:d.jsx(Ae,{variant:"primary",onClick:()=>{p(!1),D(null)},children:"Done"})})]}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[d.jsx(bn,{variant:"destructive",children:d.jsx(xn,{children:"This revokes selected keys immediately and cannot be undone."})}),d.jsxs("p",{className:"font-mono text-[10px] text-neutral-500",children:["Selected keys: ",Ue.slice(0,5).join(", "),Ue.length>5?` +${Ue.length-5} more`:""]})]}),d.jsxs(pn,{children:[d.jsx(Ae,{variant:"default",onClick:()=>p(!1),children:"Cancel"}),d.jsx(Ae,{variant:"destructive",onClick:Le,disabled:re.isPending||z.length===0,children:re.isPending?d.jsxs(d.Fragment,{children:[d.jsx(Mt,{size:"sm"}),"Revoking..."]}):"Revoke Selected"})]})]})]})}),d.jsx(Er,{open:X!==null||L!==null,onOpenChange:()=>{te(null),$(null)},children:d.jsxs(Xn,{children:[d.jsx(Qn,{children:d.jsx(Wn,{children:"Stage Rotate API Key"})}),L?d.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[d.jsx(bn,{variant:"default",children:d.jsxs(xn,{children:["Replacement key created for ",L.oldKeyName,". The old key is still active until you revoke it."]})}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("code",{className:"flex-1 rounded-md border border-border bg-surface p-3 font-mono text-[11px] text-white break-all",children:L.secretKey}),d.jsx(Ae,{variant:"default",size:"sm",onClick:()=>be(L.secretKey),children:G===L.secretKey?"Copied":"Copy"})]}),d.jsxs(pn,{children:[d.jsx(Ae,{variant:"default",onClick:()=>{$(null),te(null)},children:"Keep Old Key Active"}),d.jsx(Ae,{variant:"destructive",onClick:Ee,disabled:fe.isPending,children:fe.isPending?d.jsxs(d.Fragment,{children:[d.jsx(Mt,{size:"sm"}),"Revoking Old Key..."]}):"Finalize and Revoke Old Key"})]})]}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"px-5 py-4",children:d.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."})}),d.jsxs(pn,{children:[d.jsx(Ae,{variant:"default",onClick:()=>te(null),children:"Cancel"}),d.jsx(Ae,{variant:"primary",onClick:Oe,disabled:Se.isPending||!X,children:Se.isPending?d.jsxs(d.Fragment,{children:[d.jsx(Mt,{size:"sm"}),"Staging..."]}):"Create Replacement Key"})]})]})]})}),d.jsx(Er,{open:P!==null,onOpenChange:()=>Q(null),children:d.jsxs(Xn,{children:[d.jsx(Qn,{children:d.jsx(Wn,{children:"Revoke API Key"})}),d.jsx("div",{className:"px-5 py-4",children:d.jsx(bn,{variant:"destructive",children:d.jsx(xn,{children:"Revoking a key immediately invalidates it for all requests."})})}),d.jsxs(pn,{children:[d.jsx(Ae,{variant:"default",onClick:()=>Q(null),children:"Cancel"}),d.jsx(Ae,{variant:"destructive",onClick:ge,disabled:fe.isPending,children:fe.isPending?d.jsxs(d.Fragment,{children:[d.jsx(Mt,{size:"sm"}),"Revoking..."]}):"Revoke"})]})]})}),d.jsx(Er,{open:H!==null||U!==null,onOpenChange:()=>{V(null),I(null)},children:d.jsxs(Xn,{children:[d.jsx(Qn,{children:d.jsx(Wn,{children:"Rotate API Key"})}),U?d.jsx(CT,{copiedKeyId:G,onClose:()=>I(null),onCopy:be,secretKey:U,warning:"The previous key has been invalidated. Store this replacement securely."}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"px-5 py-4",children:d.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"Rotating a key invalidates the previous secret immediately."})}),d.jsxs(pn,{children:[d.jsx(Ae,{variant:"default",onClick:()=>V(null),children:"Cancel"}),d.jsx(Ae,{variant:"primary",onClick:Fe,disabled:ae.isPending,children:ae.isPending?d.jsxs(d.Fragment,{children:[d.jsx(Mt,{size:"sm"}),"Rotating..."]}):"Rotate"})]})]})]})})]})}function w$(){const{preferences:e,updatePreference:t,resetPreferences:n}=Eu(),i=[{type:"filter",label:"Auto-refresh interval",options:WV.map(o=>({id:`${o.value}`,label:o.label})),activeId:`${e.refreshInterval}`,onActiveChange:o=>t("refreshInterval",Number.parseInt(o,10))},{type:"filter",label:"Items per page",options:ZV.map(o=>({id:`${o.value}`,label:o.label})),activeId:`${e.pageSize}`,onActiveChange:o=>t("pageSize",Number.parseInt(o,10))},{type:"filter",label:"Time format",options:[{id:"relative",label:"Relative"},{id:"absolute",label:"Absolute"}],activeId:e.timeFormat,onActiveChange:o=>t("timeFormat",o)},{type:"toggle",label:"Show sparklines",description:"Display mini trend charts in dashboard metric cards",checked:e.showSparklines,onCheckedChange:o=>t("showSparklines",o)}];return d.jsx(Z1,{rows:i,onResetDefaults:n})}function CT({copiedKeyId:e,onClose:t,onCopy:n,secretKey:i,warning:o}){return d.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[d.jsx(bn,{variant:"destructive",children:d.jsx(xn,{children:o})}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("code",{className:"flex-1 rounded-md border border-border bg-surface p-3 font-mono text-[11px] text-white break-all",children:i}),d.jsx(Ae,{variant:"default",size:"sm",onClick:()=>n(i),children:e===i?"Copied":"Copy"})]}),d.jsx(pn,{children:d.jsx(Ae,{variant:"primary",onClick:t,children:"Done"})})]})}function T$(e){const 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 C$(e){const 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 R$(e,t){if(t==="absolute")return new Date(e).toLocaleString();try{const n=new Date(e),o=new Date().getTime()-n.getTime(),l=Math.floor(o/1e3),u=Math.floor(l/60),f=Math.floor(u/60),h=Math.floor(f/24);return l<60?"just now":u<60?`${u}m ago`:f<24?`${f}h ago`:`${h}d ago`}catch{return e}}function N$(e,t,n){return{id:e.clientId,type:T$(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:C$(e.clientId),scopes:Object.keys(e.effectiveScopes??{}),lastSeen:R$(e.updatedAt,n)}}function j$({emptyState:e}={}){const[t,n]=S.useState(1),[i,o]=S.useState(null),{preferences:l}=Eu(),{partitionId:u}=Su(),f=l.pageSize,h=l.refreshInterval*1e3,{data:p,isLoading:y}=xu({refetchIntervalMs:h,partitionId:u}),{data:v,isLoading:b,error:x}=gj({limit:f,offset:(t-1)*f,partitionId:u},{refetchIntervalMs:h}),E=PV(),_=Math.ceil((v?.total??0)/f),T=p?.maxCommitSeq??0;S.useEffect(()=>{n(1)},[]);const C=async()=>{if(i)try{await E.mutateAsync({clientId:i,partitionId:u})}finally{o(null)}};if(b||y)return d.jsx("div",{className:"flex items-center justify-center h-[200px]",children:d.jsx(Mt,{size:"lg"})});if(x)return d.jsx("div",{className:"flex items-center justify-center h-[200px]",children:d.jsxs("p",{className:"text-danger",children:["Failed to load clients: ",x.message]})});const M=(v?.items??[]).map(R=>N$(R,T,l.timeFormat));return d.jsxs("div",{className:"flex flex-col gap-5 px-5 py-5",children:[M.length>0&&d.jsx(eN,{clients:M,headSeq:T}),M.length===0?e??d.jsx(rH,{children:d.jsx(Yv,{message:"No clients yet"})}):d.jsx(K1,{clients:M,headSeq:T,onEvict:R=>{const N=v?.items.find(k=>k.clientId===R);o(N?.clientId??R)}}),_>1&&d.jsx(db,{page:t,totalPages:_,totalItems:v?.total??0,onPageChange:n}),d.jsx(Er,{open:i!==null,onOpenChange:()=>o(null),children:d.jsxs(Xn,{children:[d.jsx(Qn,{children:d.jsx(Wn,{children:"Evict Client"})}),d.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[d.jsxs("p",{className:"font-mono text-[11px] text-neutral-300",children:["Are you sure you want to evict client"," ",d.jsxs("span",{className:"font-mono text-white",children:[i?.slice(0,12),"..."]}),"?"]}),d.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"This will force the client to re-bootstrap on their next sync."})]}),d.jsxs(pn,{children:[d.jsx(Ae,{variant:"default",onClick:()=>o(null),children:"Cancel"}),d.jsx(Ae,{variant:"destructive",onClick:C,disabled:E.isPending,children:E.isPending?d.jsxs(d.Fragment,{children:[d.jsx(Mt,{size:"sm"}),"Evicting..."]}):"Evict"})]})]})})]})}const M$={latencyThresholdMs:1e3,errorRateThreshold:5,clientLagThreshold:50,enabled:!1};function A$(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 O$(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n.length>0);return Array.from(new Set(t))}function k$(e){switch(e){case"notify_data_change":return"Notify";case"evict_client":return"Evict";case"compact":return"Compact";default:return"Prune"}}function RT(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function I$(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function D$(e){const t=RT(e.requestPayload),n=RT(e.resultPayload);if(e.operationType==="notify_data_change"){const l=I$(t?.tables),u=n?.commitSeq;return`${l.length} table${l.length===1?"":"s"} -> commit #${typeof u=="number"?u:"?"}`}if(e.operationType==="evict_client"){const l=n?.evicted===!0?"evicted":"not found";return`client ${e.targetClientId??"?"} ${l}`}if(e.operationType==="compact")return`${typeof n?.deletedChanges=="number"?n.deletedChanges:0} changes removed`;const i=typeof n?.deletedCommits=="number"?n.deletedCommits:0,o=typeof t?.watermarkCommitSeq=="number"?` at #${t.watermarkCommitSeq}`:"";return`${i} commits removed${o}`}function L$(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function P$(){const{partitionId:e}=Su();return d.jsxs("div",{className:"flex flex-col gap-4 px-5 py-5",children:[d.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[d.jsx(z$,{}),d.jsx(q$,{})]}),d.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[d.jsx(U$,{partitionId:e}),d.jsx(B$,{partitionId:e}),d.jsx(H$,{partitionId:e})]}),d.jsx(F$,{partitionId:e})]})}function z$(){const{data:e,isLoading:t,error:n}=kV();if(t)return d.jsx("div",{className:"flex items-center justify-center h-[200px]",children:d.jsx(Mt,{size:"lg"})});if(n)return d.jsx("div",{className:"flex items-center justify-center h-[200px]",children:d.jsxs("p",{className:"text-danger",children:["Failed to load handlers: ",n.message]})});const i=(e?.items??[]).map(o=>({table:o.table,dependsOn:o.dependsOn?.join(", ")??null,chunkTtl:o.snapshotChunkTtlMs?A$(o.snapshotChunkTtlMs):"default"}));return d.jsx(Y1,{handlers:i,tableCount:e?.items.length??0})}function U$({partitionId:e}){const[t,n]=S.useState(!1),[i,o]=S.useState(null),{data:l,isLoading:u}=xu({partitionId:e}),{data:f,isLoading:h,refetch:p}=IV({enabled:!1}),y=zV(),v=async()=>{n(!0),o(null),await p()},b=async()=>{const E=await y.mutateAsync();o(E.deletedCommits)};if(u)return d.jsx("div",{className:"flex items-center justify-center h-[200px]",children:d.jsx(Mt,{size:"lg"})});const x=[{label:"Total commits",value:l?.commitCount??0},{label:"Commit range",value:`${l?.minCommitSeq??0} - ${l?.maxCommitSeq??0}`},{label:"Min active cursor",value:l?.minActiveClientCursor??"N/A",tone:"syncing"}];return d.jsxs(d.Fragment,{children:[d.jsx(Ah,{title:"Prune",description:"Delete commits that all clients have already synced. Pruning removes commits older than the oldest active client cursor.",dotColor:"syncing",stats:x,actionLabel:"Preview Prune",actionVariant:"destructive",onAction:v}),d.jsx(Er,{open:t,onOpenChange:n,children:d.jsxs(Xn,{children:[d.jsx(Qn,{children:d.jsx(Wn,{children:"Prune Old Commits"})}),d.jsx("div",{className:"px-5 py-4 flex flex-col gap-4",children:i!==null?d.jsxs(bn,{variant:"default",children:[d.jsx(bu,{children:"Pruning Complete"}),d.jsxs(xn,{children:["Successfully deleted ",d.jsx("strong",{children:i})," commits."]})]}):h?d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsx(Mt,{size:"sm"})}):f?d.jsxs(d.Fragment,{children:[d.jsx(bn,{variant:f.commitsToDelete>0?"destructive":"default",children:d.jsx(xn,{children:f.commitsToDelete>0?d.jsxs(d.Fragment,{children:["This will delete"," ",d.jsx("strong",{children:f.commitsToDelete})," commits up to sequence"," ",d.jsxs("code",{className:"font-mono",children:["#",f.watermarkCommitSeq]}),"."]}):"No commits are eligible for pruning."})}),d.jsxs("div",{className:"flex flex-col gap-2",children:[d.jsxs("div",{className:"flex justify-between font-mono text-[11px]",children:[d.jsx("span",{className:"text-neutral-500",children:"Watermark commit seq:"}),d.jsxs("span",{className:"text-white",children:["#",f.watermarkCommitSeq]})]}),d.jsxs("div",{className:"flex justify-between font-mono text-[11px] items-center",children:[d.jsx("span",{className:"text-neutral-500",children:"Commits to delete:"}),d.jsx(en,{variant:f.commitsToDelete>0?"offline":"ghost",children:f.commitsToDelete})]})]})]}):null}),d.jsxs(pn,{children:[d.jsx(Ae,{variant:"default",onClick:()=>n(!1),children:i!==null?"Close":"Cancel"}),i===null&&d.jsx(Ae,{variant:"destructive",onClick:b,disabled:y.isPending||h||(f?.commitsToDelete??0)===0,children:y.isPending?d.jsxs(d.Fragment,{children:[d.jsx(Mt,{size:"sm"}),"Pruning..."]}):"Prune Now"})]})]})})]})}function B$({partitionId:e}){const[t,n]=S.useState(!1),[i,o]=S.useState(null),{data:l,isLoading:u}=xu({partitionId:e}),f=UV(),h=()=>{n(!0),o(null)},p=async()=>{const v=await f.mutateAsync();o(v.deletedChanges)};if(u)return d.jsx("div",{className:"flex items-center justify-center h-[200px]",children:d.jsx(Mt,{size:"lg"})});const y=[{label:"Total changes",value:l?.changeCount??0},{label:"Total commits",value:l?.commitCount??0}];return d.jsxs(d.Fragment,{children:[d.jsx(Ah,{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:y,actionLabel:"Run Compaction",actionVariant:"primary",onAction:h}),d.jsx(Er,{open:t,onOpenChange:n,children:d.jsxs(Xn,{children:[d.jsx(Qn,{children:d.jsx(Wn,{children:"Compact Changes"})}),d.jsx("div",{className:"px-5 py-4 flex flex-col gap-4",children:i!==null?d.jsxs(bn,{variant:"default",children:[d.jsx(bu,{children:"Compaction Complete"}),d.jsxs(xn,{children:["Successfully removed ",d.jsx("strong",{children:i})," redundant changes."]})]}):d.jsx(bn,{variant:"default",children:d.jsx(xn,{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."})})}),d.jsxs(pn,{children:[d.jsx(Ae,{variant:"default",onClick:()=>n(!1),children:i!==null?"Close":"Cancel"}),i===null&&d.jsx(Ae,{variant:"primary",onClick:p,disabled:f.isPending,children:f.isPending?d.jsxs(d.Fragment,{children:[d.jsx(Mt,{size:"sm"}),"Compacting..."]}):"Compact Now"})]})]})})]})}function H$({partitionId:e}){const[t,n]=S.useState(!1),[i,o]=S.useState("tasks"),[l,u]=S.useState(e??""),[f,h]=S.useState(null),[p,y]=S.useState(null),v=BV(),b=O$(i),x=[{label:"Next tables",value:b.length,tone:"syncing"},{label:"Last commit seq",value:f?`#${f.commitSeq}`:"—",tone:"syncing"},{label:"Last chunks cleared",value:f?.deletedChunks??"—"}],E=()=>{n(!0),y(null)},_=async()=>{if(b.length===0){y("Provide at least one table name.");return}y(null);const T=await v.mutateAsync({tables:b,partitionId:l.trim()||void 0});h(T)};return d.jsxs(d.Fragment,{children:[d.jsx(Ah,{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:x,actionLabel:"Notify Clients",actionVariant:"primary",onAction:E}),d.jsx(Er,{open:t,onOpenChange:n,children:d.jsxs(Xn,{children:[d.jsx(Qn,{children:d.jsx(Wn,{children:"Notify External Data Change"})}),d.jsxs("div",{className:"flex flex-col gap-4 px-5 py-4",children:[f?d.jsxs(bn,{variant:"default",children:[d.jsx(bu,{children:"Notification Sent"}),d.jsxs(xn,{children:["Created synthetic commit"," ",d.jsxs("strong",{children:["#",f.commitSeq]})," for"," ",d.jsx("strong",{children:f.tables.length})," table",f.tables.length===1?"":"s"," and cleared"," ",d.jsx("strong",{children:f.deletedChunks})," cached chunk",f.deletedChunks===1?"":"s","."]})]}):d.jsx(bn,{variant:"default",children:d.jsx(xn,{children:"Use this when data changed outside Syncular push flow. It invalidates cached snapshot chunks and forces clients to pull fresh data."})}),p?d.jsx(bn,{variant:"destructive",children:d.jsx(xn,{children:p})}):null,d.jsxs(Wr,{children:[d.jsx(Lr,{children:"Tables (comma-separated)"}),d.jsx(An,{value:i,onChange:T=>o(T.target.value),placeholder:"tasks, notes",disabled:v.isPending}),d.jsx(Ha,{children:"Enter one or more table names affected by the external change."})]}),d.jsxs(Wr,{children:[d.jsx(Lr,{children:"Partition ID (optional)"}),d.jsx(An,{value:l,onChange:T=>u(T.target.value),placeholder:"default",disabled:v.isPending})]})]}),d.jsxs(pn,{children:[d.jsx(Ae,{variant:"default",onClick:()=>n(!1),children:f?"Close":"Cancel"}),f?null:d.jsx(Ae,{variant:"primary",onClick:_,disabled:v.isPending,children:v.isPending?d.jsxs(d.Fragment,{children:[d.jsx(Mt,{size:"sm"}),"Notifying..."]}):"Notify Data Change"})]})]})})]})}function F$({partitionId:e}){const[t,n]=S.useState("all"),{data:i,isLoading:o,error:l}=DV({limit:20,offset:0,operationType:t==="all"?void 0:t,partitionId:e},{refetchIntervalMs:5e3});return d.jsx(Qv,{title:"Operation Audit",description:"Recent prune/compact/notify/evict actions with actor and result context.",actions:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Ae,{variant:t==="all"?"default":"ghost",size:"sm",onClick:()=>n("all"),children:"All"}),d.jsx(Ae,{variant:t==="prune"?"default":"ghost",size:"sm",onClick:()=>n("prune"),children:"Prune"}),d.jsx(Ae,{variant:t==="compact"?"default":"ghost",size:"sm",onClick:()=>n("compact"),children:"Compact"}),d.jsx(Ae,{variant:t==="notify_data_change"?"default":"ghost",size:"sm",onClick:()=>n("notify_data_change"),children:"Notify"}),d.jsx(Ae,{variant:t==="evict_client"?"default":"ghost",size:"sm",onClick:()=>n("evict_client"),children:"Evict"})]}),contentClassName:"pt-2",children:o?d.jsx("div",{className:"flex items-center justify-center py-10",children:d.jsx(Mt,{size:"lg"})}):l?d.jsx(bn,{variant:"destructive",children:d.jsxs(xn,{children:["Failed to load operation audit events: ",l.message]})}):(i?.items.length??0)===0?d.jsx("div",{className:"px-2 py-8 text-sm text-neutral-500",children:"No operation events found for this filter."}):d.jsx("div",{className:"overflow-x-auto",children:d.jsxs(wl,{children:[d.jsx(Tl,{children:d.jsxs(Br,{children:[d.jsx(ut,{children:"Time"}),d.jsx(ut,{children:"Type"}),d.jsx(ut,{children:"User"}),d.jsx(ut,{children:"Target"}),d.jsx(ut,{children:"Result"})]})}),d.jsx(Cl,{children:(i?.items??[]).map((u,f)=>d.jsxs(Br,{children:[d.jsx(ft,{className:"whitespace-nowrap text-xs text-neutral-400",children:L$(u.createdAt)}),d.jsx(ft,{children:d.jsx(en,{variant:"ghost",children:k$(u.operationType)})}),d.jsx(ft,{className:"font-mono text-xs",children:u.consoleUserId??"system"}),d.jsx(ft,{className:"font-mono text-xs",children:u.targetClientId??u.partitionId??(u.operationType==="notify_data_change"?"partition default":"global")}),d.jsx(ft,{className:"font-mono text-xs text-neutral-300",children:D$(u)})]},`${u.operationId}:${u.createdAt}:${f}`))})]})})})}function q$(){const[e,t]=Xo("console:alert-config",M$),n={p90Latency:e.latencyThresholdMs,errorRate:e.errorRateThreshold,clientLag:e.clientLagThreshold},i=l=>{t(u=>({...u,latencyThresholdMs:l.p90Latency,errorRateThreshold:l.errorRate,clientLagThreshold:l.clientLag}))},o=l=>{t(u=>({...u,enabled:l}))};return d.jsx(B1,{enabled:e.enabled,onEnabledChange:o,thresholds:n,onThresholdsChange:i})}function V$(e){if(e===0)return"0 B";const 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 $$(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function G$(){const[e,t]=S.useState(""),[n,i]=S.useState(void 0),[o,l]=S.useState(void 0),[u,f]=S.useState([]),[h,p]=S.useState(null),{data:y,isLoading:v,error:b}=KV({prefix:n,cursor:o,limit:100}),x=YV(),E=XV();function _(){const k=e.trim();i(k.length>0?k:void 0),l(void 0),f([])}function T(){t(""),i(void 0),l(void 0),f([])}function C(){y?.cursor&&(f(k=>[...k,o??""]),l(y.cursor))}function M(){f(k=>{const z=[...k],j=z.pop();return l(j&&j.length>0?j:void 0),z})}function R(){h&&x.mutate(h,{onSuccess:()=>p(null)})}if(v)return d.jsx("div",{className:"flex flex-col gap-4 px-5 py-5",children:d.jsx("div",{className:"flex items-center justify-center h-[200px]",children:d.jsx(Mt,{size:"lg"})})});if(b)return d.jsx("div",{className:"flex flex-col gap-4 px-5 py-5",children:d.jsx("div",{className:"flex items-center justify-center h-[200px]",children:d.jsxs("p",{className:"text-danger font-mono text-[11px]",children:["Failed to load storage items: ",b.message]})})});const N=y?.items??[];return d.jsxs("div",{className:"flex flex-col gap-4 px-5 py-5",children:[d.jsx(Qv,{title:"Storage",actions:d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(An,{placeholder:"Prefix filter...",value:e,onChange:k=>t(k.target.value),onKeyDown:k=>{k.key==="Enter"&&_()},className:"h-7 w-48 text-xs"}),d.jsx(Ae,{variant:"default",size:"sm",onClick:_,children:"Filter"}),n&&d.jsx(Ae,{variant:"ghost",size:"sm",onClick:T,children:"Clear"})]}),children:N.length===0?d.jsx(Yv,{message:n?`No storage items matching prefix "${n}".`:"No storage items found."}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"overflow-x-auto",children:d.jsxs(wl,{children:[d.jsx(Tl,{children:d.jsxs(Br,{children:[d.jsx(ut,{children:"Key"}),d.jsx(ut,{children:"Size"}),d.jsx(ut,{children:"Type"}),d.jsx(ut,{children:"Uploaded"}),d.jsx(ut,{children:"Actions"})]})}),d.jsx(Cl,{children:N.map(k=>d.jsxs(Br,{children:[d.jsx(ft,{className:"font-mono text-xs max-w-[320px]",title:k.key,children:k.key}),d.jsx(ft,{className:"font-mono text-xs text-neutral-400 whitespace-nowrap",children:V$(k.size)}),d.jsx(ft,{children:k.httpMetadata?.contentType?d.jsx(en,{variant:"ghost",children:k.httpMetadata.contentType}):d.jsx("span",{className:"text-neutral-500 text-xs",children:"--"})}),d.jsx(ft,{className:"whitespace-nowrap text-xs text-neutral-400",children:$$(k.uploaded)}),d.jsx(ft,{children:d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(Ae,{variant:"ghost",size:"sm",onClick:()=>{E(k.key)},children:"Download"}),d.jsx(Ae,{variant:"ghost",size:"sm",onClick:()=>p(k.key),children:"Delete"})]})})]},k.key))})]})}),d.jsxs("div",{className:"flex items-center justify-between px-2 py-2",children:[d.jsx(Ae,{variant:"ghost",size:"sm",disabled:u.length===0,onClick:M,children:"Previous"}),d.jsx(Ae,{variant:"ghost",size:"sm",disabled:!y?.truncated,onClick:C,children:"Next"})]})]})}),d.jsx(Er,{open:h!==null,onOpenChange:()=>p(null),children:d.jsxs(Xn,{children:[d.jsx(Qn,{children:d.jsx(Wn,{children:"Delete Storage Item"})}),d.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[d.jsxs("p",{className:"font-mono text-[11px] text-neutral-300",children:["Are you sure you want to delete"," ",d.jsx("span",{className:"font-mono text-white",children:h}),"?"]}),d.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"This action cannot be undone."})]}),d.jsxs(pn,{children:[d.jsx(Ae,{variant:"default",onClick:()=>p(null),children:"Cancel"}),d.jsx(Ae,{variant:"destructive",onClick:R,disabled:x.isPending,children:x.isPending?d.jsxs(d.Fragment,{children:[d.jsx(Mt,{size:"sm"})," Deleting..."]}):"Delete"})]})]})})]})}const K$={};function jc(e,t){if(t==="absolute")return new Date(e).toLocaleString();const n=new Date(e),o=new Date().getTime()-n.getTime(),l=Math.floor(o/1e3);return l<60?`${l}s`:l<3600?`${Math.floor(l/60)}m`:l<86400?`${Math.floor(l/3600)}h`:`${Math.floor(l/86400)}d`}function Y$(e){const t=e.split(/\s+/).map(o=>o.trim()).filter(o=>o.length>0),n={},i=[];for(const o of t){const[l="",...u]=o.split(":"),f=u.join(":").trim(),h=l.toLowerCase();if(!f){i.push(o);continue}if(h==="actor"){n.actorId=f;continue}if(h==="client"){n.clientId=f;continue}if(h==="table"){n.table=f;continue}if(h==="request"){n.requestId=f;continue}if(h==="trace"){n.traceId=f;continue}i.push(o)}return i.length>0&&(n.search=i.join(" ")),n}function X$(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 ad(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function Q$(e,t){return e?`#${e.federatedCommitId??(t?`${t}:${e.commitSeq}`:String(e.commitSeq))}`:"#?"}function W$(e,t){return e?`E${e.federatedEventId??(t?`${t}:${e.eventId}`:e.eventId)}`:"E?"}function Z$(e,t,n){return!e||!t?null:e.replaceAll("{traceId}",encodeURIComponent(t)).replaceAll("{spanId}",encodeURIComponent(n??""))}function gb({initialSelectedEntryId:e}={}){const{preferences:t}=Eu(),{partitionId:n}=Su(),{range:i,setRange:o}=yj(),l=t.pageSize,u=t.refreshInterval*1e3,f=K$?.VITE_CONSOLE_TRACE_URL_TEMPLATE,[h,p]=S.useState(()=>e?.startsWith("#")?"commits":e?.startsWith("E")?"events":"all"),[y,v]=S.useState("all"),[b,x]=S.useState("all"),[E,_]=S.useState(""),[T,C]=S.useState(1),[M,R]=S.useState(!1),[N,k]=S.useState(e??null),z=S.useRef(!1),j=S.useMemo(()=>Y$(E),[E]),A=S.useMemo(()=>new Date(Date.now()-X$(i)).toISOString(),[i]),{data:D,isLoading:G,refetch:F}=MV({limit:l,offset:(T-1)*l,...n?{partitionId:n}:{},view:h,...h!=="commits"&&y!=="all"?{eventType:y}:{},...h!=="commits"&&b!=="all"?{outcome:b}:{},...j.actorId?{actorId:j.actorId}:{},...j.clientId?{clientId:j.clientId}:{},...j.requestId?{requestId:j.requestId}:{},...j.traceId?{traceId:j.traceId}:{},...j.table?{table:j.table}:{},...j.search?{search:j.search}:{},from:A},{refetchIntervalMs:u}),P=LV(),Q=N?.startsWith("#")?N.slice(1):void 0,X=N?.startsWith("E")?N.slice(1):void 0,te=Q&&Q!=="?"?Q:void 0,L=X&&X!=="?"?X:void 0,{data:$,isLoading:H,error:V}=jV(te,{enabled:te!==void 0,partitionId:n}),{data:U,isLoading:I,error:K}=AV(L,{enabled:L!==void 0,partitionId:n}),{data:Z,isLoading:W,error:se}=OV(L,{enabled:L!==void 0&&!!U?.payloadRef,partitionId:n}),ie=S.useMemo(()=>Z$(f,U?.traceId??null,U?.spanId??null),[U?.spanId,U?.traceId,f]);S.useEffect(()=>{C(1)},[]),S.useEffect(()=>{C(1)},[]),S.useEffect(()=>{e&&k(e)},[e]),S.useEffect(()=>{if(!z.current){z.current=!0;return}k(null)},[]),S.useEffect(()=>{C(1),k(null)},[]);const xe=S.useMemo(()=>(D?.items??[]).map(Se=>{const ye=Se.instanceId??Se.commit?.instanceId??Se.event?.instanceId,be=ye?`[${ye}] `:"";if(Se.type==="commit"&&Se.commit){const Le=Se.commit;return{type:"commit",id:Q$(Le,ye),outcome:"--",duration:"--",actor:Le.actorId,client:Le.clientId,detail:`${be}${Le.changeCount} chg | ${(Le.affectedTables??[]).join(", ")}`,time:jc(Se.timestamp,t.timeFormat)}}const ge=Se.event;return ge?{type:ge.eventType,id:W$(ge,ye),outcome:ge.outcome,duration:`${ge.durationMs}ms`,actor:ge.actorId,client:ge.clientId,detail:`${be}${(ge.tables??[]).join(", ")||"--"}`,time:jc(Se.timestamp,t.timeFormat)}:{type:"pull",id:"E?",outcome:"unknown",duration:"--",actor:"",client:"",detail:"--",time:jc(Se.timestamp,t.timeFormat)}}),[t.timeFormat,D?.items]),de=D?.total??0,Be=Math.max(1,Math.ceil(de/l)),_e=G,re=[{label:"",options:[{id:"all",label:"All"},{id:"commits",label:"Commits"},{id:"events",label:"Events"}],activeId:h,onActiveChange:ae=>{p(ae),ae==="commits"&&(v("all"),x("all")),C(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:i,onActiveChange:ae=>{o(ae),C(1)}},{label:"Type",options:[{id:"all",label:"All"},{id:"push",label:"Push"},{id:"pull",label:"Pull"}],activeId:y,onActiveChange:ae=>{v(ae),C(1)}},{label:"Outcome",options:[{id:"all",label:"All"},{id:"applied",label:"Applied"},{id:"error",label:"Error"},{id:"rejected",label:"Rejected"}],activeId:b,onActiveChange:ae=>{x(ae),C(1)}}];function fe(){P.mutate(void 0,{onSuccess:()=>{R(!1),F()}})}return d.jsxs("div",{className:"flex flex-col h-full",children:[_e&&xe.length===0?d.jsx("div",{className:"flex items-center justify-center py-24",children:d.jsx(Mt,{size:"lg"})}):d.jsx(J1,{entries:xe,selectedEntryId:N,onEntryClick:ae=>k(ae.id),filterBar:d.jsx($1,{groups:re,searchValue:E,searchPlaceholder:"Use actor:, client:, table:, request:, trace: or free text...",onSearchChange:_,actions:d.jsxs(d.Fragment,{children:[d.jsx(Ae,{size:"sm",variant:"ghost",onClick:()=>{F()},children:"Refresh"}),d.jsx(Ae,{size:"sm",variant:"ghost",children:"Export"}),d.jsx(Ae,{size:"sm",variant:"destructive",onClick:()=>R(!0),children:"Clear"})]})}),pagination:d.jsx(db,{page:T,totalPages:Be,totalItems:de,onPageChange:C})}),d.jsx(Er,{open:N!==null,onOpenChange:ae=>{ae||k(null)},children:d.jsxs(Xn,{children:[d.jsx(Qn,{children:d.jsx(Wn,{children:te!==void 0?`Commit #${te}`:L!==void 0?`Event E${L}`:"Entry details"})}),d.jsx("div",{className:"px-5 py-4 space-y-3 max-h-[70vh] overflow-y-auto",children:H||I?d.jsx("div",{className:"flex items-center justify-center py-8",children:d.jsx(Mt,{size:"sm"})}):V||K?d.jsx("p",{className:"font-mono text-[11px] text-offline",children:"Failed to load details."}):$?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"grid grid-cols-2 gap-3 font-mono text-[11px]",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Actor"}),d.jsx("div",{className:"text-neutral-100",children:$.actorId})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Client"}),d.jsx("div",{className:"text-neutral-100",children:$.clientId})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Instance"}),d.jsx("div",{className:"text-neutral-100",children:$.instanceId??"--"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Created"}),d.jsx("div",{className:"text-neutral-100",children:jc($.createdAt,t.timeFormat)})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Changes"}),d.jsx("div",{className:"text-neutral-100",children:$.changeCount})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Affected Tables"}),d.jsx("p",{className:"font-mono text-[11px] text-neutral-200",children:$.affectedTables.join(", ")||"--"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Changes"}),$.changes.length===0?d.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No changes recorded."}):$.changes.map(ae=>d.jsxs("div",{className:"rounded-md border border-border p-3 space-y-2",children:[d.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px]",children:[d.jsxs("span",{className:"text-neutral-300",children:[ae.table," | ",ae.op]}),d.jsxs("span",{className:"text-neutral-500",children:["#",ae.changeId]})]}),d.jsxs("div",{className:"font-mono text-[11px] text-neutral-400",children:["rowId: ",ae.rowId,ae.rowVersion!==null?` | version: ${ae.rowVersion}`:""]}),d.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:ad(ae.rowJson)})]},ae.changeId))]})]}):U?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"grid grid-cols-2 gap-3 font-mono text-[11px]",children:[d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Type"}),d.jsx("div",{className:"text-neutral-100",children:U.eventType})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Path"}),d.jsx("div",{className:"text-neutral-100",children:U.syncPath})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Instance"}),d.jsx("div",{className:"text-neutral-100",children:U.instanceId??"--"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Outcome"}),d.jsx("div",{className:"text-neutral-100",children:U.outcome})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Response Status"}),d.jsx("div",{className:"text-neutral-100",children:U.responseStatus})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Actor"}),d.jsx("div",{className:"text-neutral-100",children:U.actorId})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Client"}),d.jsx("div",{className:"text-neutral-100",children:U.clientId})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Status"}),d.jsx("div",{className:"text-neutral-100",children:U.statusCode})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Transport"}),d.jsx("div",{className:"text-neutral-100",children:U.transportPath})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Duration"}),d.jsxs("div",{className:"text-neutral-100",children:[U.durationMs,"ms"]})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Request ID"}),d.jsx("div",{className:"text-neutral-100",children:U.requestId})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Trace ID"}),d.jsx("div",{className:"text-neutral-100",children:U.traceId??"--"}),ie&&d.jsx("a",{href:ie,target:"_blank",rel:"noreferrer",className:"font-mono text-[10px] text-flow underline underline-offset-4",children:"Open external trace"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Span ID"}),d.jsx("div",{className:"text-neutral-100",children:U.spanId??"--"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Commit Seq"}),d.jsx("div",{className:"text-neutral-100",children:U.commitSeq??"--"}),U.commitSeq!==null&&d.jsx(Ae,{variant:"ghost",size:"sm",onClick:()=>k(`#${U.instanceId?`${U.instanceId}:`:""}${U.commitSeq}`),children:"Open linked commit"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Subscription Count"}),d.jsx("div",{className:"text-neutral-100",children:U.subscriptionCount??"--"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Error Code"}),d.jsx("div",{className:"text-neutral-100",children:U.errorCode??"--"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Payload Ref"}),d.jsx("div",{className:"text-neutral-100",children:U.payloadRef??"--"})]}),d.jsxs("div",{children:[d.jsx("span",{className:"text-neutral-500",children:"Created"}),d.jsx("div",{className:"text-neutral-100",children:jc(U.createdAt,t.timeFormat)})]})]}),d.jsxs("div",{children:[d.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Tables"}),d.jsx("p",{className:"font-mono text-[11px] text-neutral-200",children:U.tables.join(", ")||"--"})]}),U.scopesSummary&&d.jsxs("div",{children:[d.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Scopes Summary"}),d.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:ad(U.scopesSummary)})]}),U.payloadRef&&d.jsxs("div",{children:[d.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Payload Snapshot"}),W?d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Mt,{size:"sm"}),d.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:"Loading payload snapshot..."})]}):se?d.jsx("p",{className:"font-mono text-[11px] text-offline",children:"Failed to load payload snapshot."}):Z?d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Request"}),d.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:ad(Z.requestPayload)}),d.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Response"}),d.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:ad(Z.responsePayload)})]}):d.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No payload snapshot available."})]}),U.errorMessage&&d.jsxs("div",{children:[d.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Error"}),d.jsx("p",{className:"font-mono text-[11px] text-offline",children:U.errorMessage})]})]}):d.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No details available for this row."})}),d.jsx(pn,{children:d.jsx(Ae,{variant:"default",size:"sm",onClick:()=>k(null),children:"Close"})})]})}),d.jsx(Er,{open:M,onOpenChange:ae=>{ae||R(!1)},children:d.jsxs(Xn,{children:[d.jsx(Qn,{children:d.jsx(Wn,{children:"Clear all events"})}),d.jsx("div",{className:"p-4",children:d.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?"})}),d.jsxs(pn,{children:[d.jsx(Ae,{variant:"default",size:"sm",onClick:()=>R(!1),children:"Cancel"}),d.jsx(Ae,{variant:"destructive",size:"sm",onClick:fe,disabled:P.isPending,children:P.isPending?"Clearing...":"Clear all"})]})]})})]})}const J$=Fs({getParentRoute:()=>Vs,path:"/config",component:y$}),e9=Fs({getParentRoute:()=>Vs,path:"/fleet",component:j$}),t9=Fs({getParentRoute:()=>Vs,path:"/",component:g$});function n9(){const{seq:e}=vj.useParams();return d.jsx(gb,{initialSelectedEntryId:`#${e}`})}const vj=Fs({getParentRoute:()=>Vs,path:"/investigate/commit/$seq",component:n9});function r9(){const{id:e}=bj.useParams();return d.jsx(gb,{initialSelectedEntryId:`E${e}`})}const bj=Fs({getParentRoute:()=>Vs,path:"/investigate/event/$id",component:r9}),s9=Fs({getParentRoute:()=>Vs,path:"/ops",component:P$}),i9=Fs({getParentRoute:()=>Vs,path:"/storage",component:G$}),o9=Fs({getParentRoute:()=>Vs,path:"/stream",component:gb}),a9=Vs.addChildren([t9,o9,vj,bj,e9,s9,i9,J$]),l9="syncular-console-basepath",c9="syncular-console-server-url",u9="syncular-console-token";function f9(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function Gy(e){const t=globalThis.document;if(!t)return;const n=t.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return f9(n)}function xj(e){return!e||e==="/"?"/":(e.startsWith("/")?e:`/${e}`).replace(/\/+$/g,"")||"/"}function d9(){return xj(Gy(l9))}function h9(){const e=Gy(c9),t=Gy(u9);return!e||!t?null:{serverUrl:e,token:t}}function p9(){return new k5({defaultOptions:{queries:{staleTime:5e3,retry:1}}})}function m9(e){return xj(e??d9())}function g9(e){const[t]=S.useState(()=>p9()),n=S.useMemo(()=>B3({routeTree:a9,basepath:m9(e.basePath)}),[e.basePath]),i=e.defaultConfig===void 0?h9():e.defaultConfig,o=e.autoConnect??e.defaultConfig===void 0;return d.jsx(I5,{client:t,children:d.jsx(t4,{defaultConfig:i,autoConnect:o,storageMode:e.storageMode,children:d.jsx(q3,{router:n})})})}function y9(e){return d.jsx("div",{className:mb,children:d.jsx(g9,{...e})})}function v9(e){const t=document.querySelector(e);if(!t)throw new Error(`Unable to mount console: ${e} not found`);return t}function b9(e,t={}){const n=v9(e);JV(n);const i=c5.createRoot(n),o=d.jsx(y9,{basePath:t.basePath,defaultConfig:t.defaultConfig,autoConnect:t.autoConnect});return t.strictMode===!1?(i.render(o),i):(i.render(d.jsx(S.StrictMode,{children:o})),i)}var x9={};const S9="syncular-sentry-dsn",E9="syncular-sentry-environment",_9="syncular-sentry-release";function Pc(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function Xg(e){if(typeof document>"u")return;const t=document.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return Pc(t)}function Qg(e){if(!(typeof process>"u"))return Pc(x9[e])}function Wg(e){for(const t of e)if(t)return t}function w9(){const e=Wg([Pc(globalThis.__SYNCULAR_SENTRY_DSN__),Xg(S9),Qg("SYNCULAR_SENTRY_DSN")]);if(!e)return null;const t=Wg([Pc(globalThis.__SYNCULAR_SENTRY_ENVIRONMENT__),Xg(E9),Qg("SYNCULAR_SENTRY_ENVIRONMENT")]),n=Wg([Pc(globalThis.__SYNCULAR_SENTRY_RELEASE__),Xg(_9),Qg("SYNCULAR_SENTRY_RELEASE")]);return{dsn:e,environment:t,release:n,enableLogs:!0,tracesSampleRate:.2,tracePropagationTargets:[/^https?:\/\/.*\/api\/.*/]}}const NT=w9();NT&&e5(NT);b9("#root");
|