@syncular/console 0.0.6-159 → 0.0.6-165
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.
- package/dist/hooks/index.d.ts +0 -1
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +0 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useConsoleApi.d.ts +113 -97
- package/dist/hooks/useConsoleApi.d.ts.map +1 -1
- package/dist/hooks/useConsoleApi.js +368 -520
- package/dist/hooks/useConsoleApi.js.map +1 -1
- package/dist/hooks/useLiveEvents.d.ts.map +1 -1
- package/dist/hooks/useLiveEvents.js +2 -94
- package/dist/hooks/useLiveEvents.js.map +1 -1
- package/dist/lib/topology.d.ts +2 -2
- package/dist/lib/topology.d.ts.map +1 -1
- package/dist/lib/topology.js.map +1 -1
- package/dist/lib/types.d.ts +58 -170
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/types.js +1 -1
- package/dist/pages/Config.d.ts.map +1 -1
- package/dist/pages/Config.js +2 -1
- package/dist/pages/Config.js.map +1 -1
- package/package.json +4 -4
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useConsoleApi.ts +552 -756
- package/src/hooks/useLiveEvents.ts +2 -115
- package/src/lib/topology.ts +3 -3
- package/src/lib/types.ts +104 -187
- package/src/pages/Config.tsx +3 -1
- package/web-dist/assets/index-BXJahjhP.js +86 -0
- package/web-dist/index.html +1 -1
- package/dist/hooks/useRequestEvents.d.ts +0 -7
- package/dist/hooks/useRequestEvents.d.ts.map +0 -1
- package/dist/hooks/useRequestEvents.js +0 -33
- package/dist/hooks/useRequestEvents.js.map +0 -1
- package/src/hooks/useRequestEvents.ts +0 -35
- package/web-dist/assets/index-DWD8MzCy.js +0 -86
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
function Pk(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in e)){const a=Object.getOwnPropertyDescriptor(s,i);a&&Object.defineProperty(e,i,a.get?a:{enumerable:!0,get:()=>s[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();const Ce=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,lt=globalThis,Yi="10.40.0";function ca(){return Yh(lt),lt}function Yh(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Yi,t[Yi]=t[Yi]||{}}function Ul(e,t,n=lt){const s=n.__SENTRY__=n.__SENTRY__||{},i=s[Yi]=s[Yi]||{};return i[e]||(i[e]=t())}const zk=["debug","info","warn","error","log","assert","trace"],Lk="Sentry Logger ",ch={};function ua(e){if(!("console"in lt))return e();const t=lt.console,n={},s=Object.keys(ch);s.forEach(i=>{const a=ch[i];n[i]=t[i],t[i]=a});try{return e()}finally{s.forEach(i=>{t[i]=n[i]})}}function Uk(){Fv().enabled=!0}function $k(){Fv().enabled=!1}function eR(){return Fv().enabled}function Bk(...e){Bv("log",...e)}function Fk(...e){Bv("warn",...e)}function Hk(...e){Bv("error",...e)}function Bv(e,...t){Ce&&eR()&&ua(()=>{lt.console[e](`${Lk}[${e}]:`,...t)})}function Fv(){return Ce?Ul("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const be={enable:Uk,disable:$k,isEnabled:eR,log:Bk,warn:Fk,error:Hk},tR=50,ta="?",uw=/\(error: (.*)\)/,fw=/captureMessage|captureException/;function nR(...e){const t=e.sort((n,s)=>n[0]-s[0]).map(n=>n[1]);return(n,s=0,i=0)=>{const a=[],c=n.split(`
|
|
2
|
+
`);for(let f=s;f<c.length;f++){let d=c[f];d.length>1024&&(d=d.slice(0,1024));const p=uw.test(d)?d.replace(uw,"$1"):d;if(!p.match(/\S*Error: /)){for(const g of t){const y=g(p);if(y){a.push(y);break}}if(a.length>=tR+i)break}}return Vk(a.slice(i))}}function qk(e){return Array.isArray(e)?nR(...e):e}function Vk(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(yd(t).function||"")&&t.pop(),t.reverse(),fw.test(yd(t).function||"")&&(t.pop(),fw.test(yd(t).function||"")&&t.pop()),t.slice(0,tR).map(n=>({...n,filename:n.filename||yd(t).filename,function:n.function||ta}))}function yd(e){return e[e.length-1]||{}}const Lg="<anonymous>";function Gs(e){try{return!e||typeof e!="function"?Lg:e.name||Lg}catch{return Lg}}function dw(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(s=>{s.stacktrace.frames&&n.push(...s.stacktrace.frames)}),n}catch{return}}}function rR(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const qd={},hw={};function oi(e,t){qd[e]=qd[e]||[],qd[e].push(t)}function ii(e,t){if(!hw[e]){hw[e]=!0;try{t()}catch(n){Ce&&be.error(`Error while instrumenting ${e}`,n)}}}function Lr(e,t){const n=e&&qd[e];if(n)for(const s of n)try{s(t)}catch(i){Ce&&be.error(`Error while triggering instrumentation handler.
|
|
3
|
+
Type: ${e}
|
|
4
|
+
Name: ${Gs(s)}
|
|
5
|
+
Error:`,i)}}let Ug=null;function sR(e){const t="error";oi(t,e),ii(t,Kk)}function Kk(){Ug=lt.onerror,lt.onerror=function(e,t,n,s,i){return Lr("error",{column:s,error:i,line:n,msg:e,url:t}),Ug?Ug.apply(this,arguments):!1},lt.onerror.__SENTRY_INSTRUMENTED__=!0}let $g=null;function oR(e){const t="unhandledrejection";oi(t,e),ii(t,Gk)}function Gk(){$g=lt.onunhandledrejection,lt.onunhandledrejection=function(e){return Lr("unhandledrejection",e),$g?$g.apply(this,arguments):!0},lt.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const iR=Object.prototype.toString;function Xh(e){switch(iR.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Zs(e,Error)}}function $l(e,t){return iR.call(e)===`[object ${t}]`}function aR(e){return $l(e,"ErrorEvent")}function pw(e){return $l(e,"DOMError")}function Zk(e){return $l(e,"DOMException")}function qs(e){return $l(e,"String")}function Qh(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function wl(e){return e===null||Qh(e)||typeof e!="object"&&typeof e!="function"}function pu(e){return $l(e,"Object")}function Wh(e){return typeof Event<"u"&&Zs(e,Event)}function Yk(e){return typeof Element<"u"&&Zs(e,Element)}function Xk(e){return $l(e,"RegExp")}function Bl(e){return!!(e?.then&&typeof e.then=="function")}function Qk(e){return pu(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function Zs(e,t){try{return e instanceof t}catch{return!1}}function lR(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function Hv(e){return typeof Request<"u"&&Zs(e,Request)}const qv=lt,Wk=80;function $r(e,t={}){if(!e)return"<unknown>";try{let n=e;const s=5,i=[];let a=0,c=0;const f=" > ",d=f.length;let p;const g=Array.isArray(t)?t:t.keyAttrs,y=!Array.isArray(t)&&t.maxStringLength||Wk;for(;n&&a++<s&&(p=Jk(n,g),!(p==="html"||a>1&&c+i.length*d+p.length>=y));)i.push(p),c+=p.length,n=n.parentNode;return i.reverse().join(f)}catch{return"<unknown>"}}function Jk(e,t){const n=e,s=[];if(!n?.tagName)return"";if(qv.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}s.push(n.tagName.toLowerCase());const i=t?.length?t.filter(c=>n.getAttribute(c)).map(c=>[c,n.getAttribute(c)]):null;if(i?.length)i.forEach(c=>{s.push(`[${c[0]}="${c[1]}"]`)});else{n.id&&s.push(`#${n.id}`);const c=n.className;if(c&&qs(c)){const f=c.split(/\s+/);for(const d of f)s.push(`.${d}`)}}const a=["aria-label","type","name","title","alt"];for(const c of a){const f=n.getAttribute(c);f&&s.push(`[${c}="${f}"]`)}return s.join("")}function ju(){try{return qv.document.location.href}catch{return""}}function cR(e){if(!qv.HTMLElement)return null;let t=e;const n=5;for(let s=0;s<n;s++){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 fr(e,t,n){if(!(t in e))return;const s=e[t];if(typeof s!="function")return;const i=n(s);typeof i=="function"&&uR(i,s);try{e[t]=i}catch{Ce&&be.log(`Failed to replace method "${t}" in object`,e)}}function Vn(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{Ce&&be.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function uR(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Vn(e,"__sentry_original__",t)}catch{}}function Vv(e){return e.__sentry_original__}function fR(e){if(Xh(e))return{message:e.message,name:e.name,stack:e.stack,...gw(e)};if(Wh(e)){const t={type:e.type,target:mw(e.target),currentTarget:mw(e.currentTarget),...gw(e)};return typeof CustomEvent<"u"&&Zs(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function mw(e){try{return Yk(e)?$r(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function gw(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 eI(e){const t=Object.keys(fR(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let sl;function Au(e){if(sl!==void 0)return sl?sl(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=lt;return t in n&&typeof n[t]=="function"?(sl=n[t],sl(e)):(sl=null,e())}function Fo(){return Au(()=>Math.random())}function Ou(){return Au(()=>Date.now())}function Hy(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function yw(e,t){if(!Array.isArray(e))return"";const n=[];for(let s=0;s<e.length;s++){const i=e[s];try{lR(i)?n.push(rR(i)):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Vd(e,t,n=!1){return qs(e)?Xk(t)?t.test(e):qs(t)?n?e===t:e.includes(t):!1:!1}function Ho(e,t=[],n=!1){return t.some(s=>Vd(e,s,n))}function tI(){const e=lt;return e.crypto||e.msCrypto}let Bg;function nI(){return Fo()*16}function Ur(e=tI()){try{if(e?.randomUUID)return Au(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Bg||(Bg="10000000100040008000"+1e11),Bg.replace(/[018]/g,t=>(t^(nI()&15)>>t/4).toString(16))}function dR(e){return e.exception?.values?.[0]}function Hi(e){const{message:t,event_id:n}=e;if(t)return t;const s=dR(e);return s?s.type&&s.value?`${s.type}: ${s.value}`:s.type||s.value||n||"<unknown>":n||"<unknown>"}function qy(e,t,n){const s=e.exception=e.exception||{},i=s.values=s.values||[],a=i[0]=i[0]||{};a.value||(a.value=t||""),a.type||(a.type="Error")}function El(e,t){const n=dR(e);if(!n)return;const s={type:"generic",handled:!0},i=n.mechanism;if(n.mechanism={...s,...i,...t},t&&"data"in t){const a={...i?.data,...t.data};n.mechanism.data=a}}function vw(e){if(rI(e))return!0;try{Vn(e,"__sentry_captured__",!0)}catch{}return!1}function rI(e){try{return e.__sentry_captured__}catch{}}const hR=1e3;function fa(){return Ou()/hR}function sI(){const{performance:e}=lt;if(!e?.now||!e.timeOrigin)return fa;const t=e.timeOrigin;return()=>(t+Au(()=>e.now()))/hR}let bw;function sn(){return(bw??(bw=sI()))()}let Fg=null;function oI(){const{performance:e}=lt;if(!e?.now)return;const t=3e5,n=Au(()=>e.now()),s=Ou(),i=e.timeOrigin;if(typeof i=="number"&&Math.abs(i+n-s)<t)return i;const a=e.timing?.navigationStart;return typeof a=="number"&&Math.abs(a+n-s)<t?a:s-n}function gr(){return Fg===null&&(Fg=oI()),Fg}function iI(e){const t=sn(),n={sid:Ur(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>lI(n)};return e&&Tl(n,e),n}function Tl(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||sn(),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:Ur()),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 aI(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),Tl(e,n)}function lI(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 Mu(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const s={...e};for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(s[i]=Mu(s[i],t[i],n-1));return s}function Ys(){return Ur()}function Vs(){return Ur().substring(16)}const Vy="_sentrySpan";function Cl(e,t){t?Vn(e,Vy,t):delete e[Vy]}function Rl(e){return e[Vy]}const cI=100;class Xs{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:Ys(),sampleRand:Fo()}}clone(){const t=new Xs;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,Cl(t,Rl(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&&Tl(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,s=n instanceof Xs?n.getScopeData():pu(n)?t:void 0,{tags:i,attributes:a,extra:c,user:f,contexts:d,level:p,fingerprint:g=[],propagationContext:y,conversationId:b}=s||{};return this._tags={...this._tags,...i},this._attributes={...this._attributes,...a},this._extra={...this._extra,...c},this._contexts={...this._contexts,...d},f&&Object.keys(f).length&&(this._user=f),p&&(this._level=p),g.length&&(this._fingerprint=g),y&&(this._propagationContext=y),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,Cl(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ys(),sampleRand:Fo()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const s=typeof n=="number"?n:cI;if(s<=0)return this;const i={timestamp:fa(),...t,message:t.message?Hy(t.message,2048):t.message};return this._breadcrumbs.push(i),this._breadcrumbs.length>s&&(this._breadcrumbs=this._breadcrumbs.slice(-s),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:Rl(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Mu(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const s=n?.event_id||Ur();if(!this._client)return Ce&&be.warn("No client configured on scope - will not capture exception!"),s;const i=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:i,...n,event_id:s},this),s}captureMessage(t,n,s){const i=s?.event_id||Ur();if(!this._client)return Ce&&be.warn("No client configured on scope - will not capture message!"),i;const a=s?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:a,...s,event_id:i},this),i}captureEvent(t,n){const s=t.event_id||n?.event_id||Ur();return this._client?(this._client.captureEvent(t,{...n,event_id:s},this),s):(Ce&&be.warn("No client configured on scope - will not capture event!"),s)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function uI(){return Ul("defaultCurrentScope",()=>new Xs)}function fI(){return Ul("defaultIsolationScope",()=>new Xs)}class dI{constructor(t,n){let s;t?s=t:s=new Xs;let i;n?i=n:i=new Xs,this._stack=[{scope:s}],this._isolationScope=i}withScope(t){const n=this._pushScope();let s;try{s=t(n)}catch(i){throw this._popScope(),i}return Bl(s)?s.then(i=>(this._popScope(),i),i=>{throw this._popScope(),i}):(this._popScope(),s)}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=ca(),t=Yh(e);return t.stack=t.stack||new dI(uI(),fI())}function hI(e){return Nl().withScope(e)}function pI(e,t){const n=Nl();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function xw(e){return Nl().withScope(()=>e(Nl().getIsolationScope()))}function mI(){return{withIsolationScope:xw,withScope:hI,withSetScope:pI,withSetIsolationScope:(e,t)=>xw(t),getCurrentScope:()=>Nl().getScope(),getIsolationScope:()=>Nl().getIsolationScope()}}function Fl(e){const t=Yh(e);return t.acs?t.acs:mI()}function bt(){const e=ca();return Fl(e).getCurrentScope()}function Hr(){const e=ca();return Fl(e).getIsolationScope()}function gI(){return Ul("globalScope",()=>new Xs)}function ku(...e){const t=ca(),n=Fl(t);if(e.length===2){const[s,i]=e;return s?n.withSetScope(s,i):n.withScope(i)}return n.withScope(e[0])}function vt(){return bt().getClient()}function pR(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:s,propagationSpanId:i}=t,a={trace_id:n,span_id:i||Vs()};return s&&(a.parent_span_id=s),a}const ms="sentry.source",Kv="sentry.sample_rate",mR="sentry.previous_trace_sample_rate",Qs="sentry.op",hn="sentry.origin",mu="sentry.idle_span_finish_reason",Iu="sentry.measurement_unit",Du="sentry.measurement_value",Sw="sentry.custom_span_name",Gv="sentry.profile_id",Hl="sentry.exclusive_time",yI="sentry.link.type",vI="gen_ai.conversation.id",bI=0,Zv=1,un=2;function xI(e){if(e<400&&e>=100)return{code:Zv};if(e>=400&&e<500)switch(e){case 401:return{code:un,message:"unauthenticated"};case 403:return{code:un,message:"permission_denied"};case 404:return{code:un,message:"not_found"};case 409:return{code:un,message:"already_exists"};case 413:return{code:un,message:"failed_precondition"};case 429:return{code:un,message:"resource_exhausted"};case 499:return{code:un,message:"cancelled"};default:return{code:un,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:un,message:"unimplemented"};case 503:return{code:un,message:"unavailable"};case 504:return{code:un,message:"deadline_exceeded"};default:return{code:un,message:"internal_error"}}return{code:un,message:"internal_error"}}function gR(e,t){e.setAttribute("http.response.status_code",t);const n=xI(t);n.message!=="unknown_error"&&e.setStatus(n)}const yR="_sentryScope",vR="_sentryIsolationScope";function SI(e){try{const t=lt.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function _I(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function wI(e,t,n){e&&(Vn(e,vR,SI(n)),Vn(e,yR,t))}function uh(e){const t=e;return{scope:t[yR],isolationScope:_I(t[vR])}}const Yv="sentry-",EI=/^sentry-/,TI=8192;function bR(e){const t=RI(e);if(!t)return;const n=Object.entries(t).reduce((s,[i,a])=>{if(i.match(EI)){const c=i.slice(Yv.length);s[c]=a}return s},{});if(Object.keys(n).length>0)return n}function CI(e){if(!e)return;const t=Object.entries(e).reduce((n,[s,i])=>(i&&(n[`${Yv}${s}`]=i),n),{});return NI(t)}function RI(e){if(!(!e||!qs(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const s=_w(n);return Object.entries(s).forEach(([i,a])=>{t[i]=a}),t},{}):_w(e)}function _w(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const s=t.slice(0,n),i=t.slice(n+1);return[s,i].map(a=>{try{return decodeURIComponent(a.trim())}catch{return}})}).reduce((t,[n,s])=>(n&&s&&(t[n]=s),t),{})}function NI(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,s],i)=>{const a=`${encodeURIComponent(n)}=${encodeURIComponent(s)}`,c=i===0?a:`${t},${a}`;return c.length>TI?(Ce&&be.warn(`Not adding key: ${n} with val: ${s} to baggage header due to exceeding baggage size limits.`),t):c},"")}const jI=/^o(\d+)\./,AI=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function OI(e){return e==="http"||e==="https"}function ql(e,t=!1){const{host:n,path:s,pass:i,port:a,projectId:c,protocol:f,publicKey:d}=e;return`${f}://${d}${t&&i?`:${i}`:""}@${n}${a?`:${a}`:""}/${s&&`${s}/`}${c}`}function MI(e){const t=AI.exec(e);if(!t){ua(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,s,i="",a="",c="",f=""]=t.slice(1);let d="",p=f;const g=p.split("/");if(g.length>1&&(d=g.slice(0,-1).join("/"),p=g.pop()),p){const y=p.match(/^\d+/);y&&(p=y[0])}return xR({host:a,pass:i,path:d,projectId:p,port:c,protocol:n,publicKey:s})}function xR(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function kI(e){if(!Ce)return!0;const{port:t,projectId:n,protocol:s}=e;return["protocol","publicKey","host","projectId"].find(c=>e[c]?!1:(be.error(`Invalid Sentry Dsn: ${c} missing`),!0))?!1:n.match(/^\d+$/)?OI(s)?t&&isNaN(parseInt(t,10))?(be.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(be.error(`Invalid Sentry Dsn: Invalid protocol ${s}`),!1):(be.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function II(e){return e.match(jI)?.[1]}function DI(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let s;return t.orgId?s=String(t.orgId):n&&(s=II(n)),s}function PI(e){const t=typeof e=="string"?MI(e):xR(e);if(!(!t||!kI(t)))return t}function gu(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 SR=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function zI(e){if(!e)return;const t=e.match(SR);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 LI(e,t){const n=zI(e),s=bR(t);if(!n?.traceId)return{traceId:Ys(),sampleRand:Fo()};const i=UI(n,s);s&&(s.sample_rand=i.toString());const{traceId:a,parentSpanId:c,parentSampled:f}=n;return{traceId:a,parentSpanId:c,sampled:f,dsc:s||{},sampleRand:i}}function _R(e=Ys(),t=Vs(),n){let s="";return n!==void 0&&(s=n?"-1":"-0"),`${e}-${t}${s}`}function wR(e=Ys(),t=Vs(),n){return`00-${e}-${t}-${n?"01":"00"}`}function UI(e,t){const n=gu(t?.sample_rand);if(n!==void 0)return n;const s=gu(t?.sample_rate);return s&&e?.parentSampled!==void 0?e.parentSampled?Fo()*s:s+Fo()*(1-s):Fo()}const ER=0,Xv=1;let ww=!1;function $I(e){const{spanId:t,traceId:n}=e.spanContext(),{data:s,op:i,parent_span_id:a,status:c,origin:f,links:d}=yt(e);return{parent_span_id:a,span_id:t,trace_id:n,data:s,op:i,status:c,origin:f,links:d}}function TR(e){const{spanId:t,traceId:n,isRemote:s}=e.spanContext(),i=s?t:yt(e).parent_span_id,a=uh(e).scope,c=s?a?.getPropagationContext().propagationSpanId||Vs():t;return{parent_span_id:i,span_id:c,trace_id:n}}function BI(e){const{traceId:t,spanId:n}=e.spanContext(),s=ai(e);return _R(t,n,s)}function FI(e){const{traceId:t,spanId:n}=e.spanContext(),s=ai(e);return wR(t,n,s)}function CR(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:s,...i},attributes:a})=>({span_id:t,trace_id:n,sampled:s===Xv,attributes:a,...i}))}function Xi(e){return typeof e=="number"?Ew(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Ew(e.getTime()):sn()}function Ew(e){return e>9999999999?e/1e3:e}function yt(e){if(qI(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(HI(e)){const{attributes:s,startTime:i,name:a,endTime:c,status:f,links:d}=e,p="parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0;return{span_id:t,trace_id:n,data:s,description:a,parent_span_id:p,start_timestamp:Xi(i),timestamp:Xi(c)||void 0,status:RR(f),op:s[Qs],origin:s[hn],links:CR(d)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function HI(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function qI(e){return typeof e.getSpanJSON=="function"}function ai(e){const{traceFlags:t}=e.spanContext();return t===Xv}function RR(e){if(!(!e||e.code===bI))return e.code===Zv?"ok":e.message||"internal_error"}const Qi="_sentryChildSpans",Ky="_sentryRootSpan";function NR(e,t){const n=e[Ky]||e;Vn(t,Ky,n),e[Qi]?e[Qi].add(t):Vn(e,Qi,new Set([t]))}function VI(e,t){e[Qi]&&e[Qi].delete(t)}function Kd(e){const t=new Set;function n(s){if(!t.has(s)&&ai(s)){t.add(s);const i=s[Qi]?Array.from(s[Qi]):[];for(const a of i)n(a)}}return n(e),Array.from(t)}function kn(e){return e[Ky]||e}function Kn(){const e=ca(),t=Fl(e);return t.getActiveSpan?t.getActiveSpan():Rl(bt())}function Gy(){ww||(ua(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),ww=!0)}let Tw=!1;function KI(){if(Tw)return;function e(){const t=Kn(),n=t&&kn(t);if(n){const s="internal_error";Ce&&be.log(`[Tracing] Root span: ${s} -> Global error occurred`),n.setStatus({code:un,message:s})}}e.tag="sentry_tracingErrorCallback",Tw=!0,sR(e),oR(e)}function es(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||vt()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function Cw(e){be.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function fh(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(ZI(n)){if(Vd(e.description,n))return Ce&&Cw(e),!0;continue}if(!n.name&&!n.op)continue;const s=n.name?Vd(e.description,n.name):!0,i=n.op?e.op&&Vd(e.op,n.op):!0;if(s&&i)return Ce&&Cw(e),!0}return!1}function GI(e,t){const n=t.parent_span_id,s=t.span_id;if(n)for(const i of e)i.parent_span_id===s&&(i.parent_span_id=n)}function ZI(e){return typeof e=="string"||e instanceof RegExp}const Qv="production",jR="_frozenDsc";function Gd(e,t){Vn(e,jR,t)}function AR(e,t){const n=t.getOptions(),{publicKey:s}=t.getDsn()||{},i={environment:n.environment||Qv,release:n.release,public_key:s,trace_id:e,org_id:DI(t)};return t.emit("createDsc",i),i}function Wv(e,t){const n=t.getPropagationContext();return n.dsc||AR(n.traceId,e)}function Ws(e){const t=vt();if(!t)return{};const n=kn(e),s=yt(n),i=s.data,a=n.spanContext().traceState,c=a?.get("sentry.sample_rate")??i[Kv]??i[mR];function f(S){return(typeof c=="number"||typeof c=="string")&&(S.sample_rate=`${c}`),S}const d=n[jR];if(d)return f(d);const p=a?.get("sentry.dsc"),g=p&&bR(p);if(g)return f(g);const y=AR(e.spanContext().traceId,t),b=i[ms],x=s.description;return b!=="url"&&x&&(y.transaction=x),es()&&(y.sampled=String(ai(n)),y.sample_rand=a?.get("sentry.sample_rand")??uh(n).scope?.getPropagationContext().sampleRand.toString()),f(y),t.emit("createDsc",y,n),y}class Qo{constructor(t={}){this._traceId=t.traceId||Ys(),this._spanId=t.spanId||Vs()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:ER}}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,s){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}}function Fs(e,t=100,n=1/0){try{return Zy("",e,t,n)}catch(s){return{ERROR:`**non-serializable** (${s})`}}}function OR(e,t=3,n=100*1024){const s=Fs(e,t);return WI(s)>n?OR(e,t-1,n):s}function Zy(e,t,n=1/0,s=1/0,i=JI()){const[a,c]=i;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const f=YI(e,t);if(!f.startsWith("[object "))return f;if(t.__sentry_skip_normalization__)return t;const d=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(d===0)return f.replace("object ","");if(a(t))return"[Circular ~]";const p=t;if(p&&typeof p.toJSON=="function")try{const x=p.toJSON();return Zy("",x,d-1,s,i)}catch{}const g=Array.isArray(t)?[]:{};let y=0;const b=fR(t);for(const x in b){if(!Object.prototype.hasOwnProperty.call(b,x))continue;if(y>=s){g[x]="[MaxProperties ~]";break}const S=b[x];g[x]=Zy(x,S,d-1,s,i),y++}return c(t),g}function YI(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(lR(t))return rR(t);if(Qk(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Gs(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=XI(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function XI(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function QI(e){return~-encodeURI(e).split(/%..|./).length}function WI(e){return QI(JSON.stringify(e))}function JI(){const e=new WeakSet;function t(s){return e.has(s)?!0:(e.add(s),!1)}function n(s){e.delete(s)}return[t,n]}function da(e,t=[]){return[e,t]}function eD(e,t){const[n,s]=e;return[n,[...s,t]]}function Yy(e,t){const n=e[1];for(const s of n){const i=s[0].type;if(t(s,i))return!0}return!1}function tD(e,t){return Yy(e,(n,s)=>t.includes(s))}function Xy(e){const t=Yh(lt);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function nD(e){const[t,n]=e;let s=JSON.stringify(t);function i(a){typeof s=="string"?s=typeof a=="string"?s+a:[Xy(s),a]:s.push(typeof a=="string"?Xy(a):a)}for(const a of n){const[c,f]=a;if(i(`
|
|
6
|
+
${JSON.stringify(c)}
|
|
7
|
+
`),typeof f=="string"||f instanceof Uint8Array)i(f);else{let d;try{d=JSON.stringify(f)}catch{d=JSON.stringify(Fs(f))}i(d)}}return typeof s=="string"?s:rD(s)}function rD(e){const t=e.reduce((i,a)=>i+a.length,0),n=new Uint8Array(t);let s=0;for(const i of e)n.set(i,s),s+=i.length;return n}function sD(e){return[{type:"span"},e]}function oD(e){const t=typeof e.data=="string"?Xy(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const iD={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 Rw(e){return iD[e]}function MR(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function aD(e,t,n,s){const i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&s&&{dsn:ql(s)},...i&&{trace:i}}}function lD(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 cD(e,t,n,s){const i=MR(n),a={sent_at:new Date().toISOString(),...i&&{sdk:i},...!!s&&t&&{dsn:ql(t)}},c="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return da(a,[c])}function uD(e,t,n,s){const i=MR(n),a=e.type&&e.type!=="replay_event"?e.type:"event";lD(e,n?.sdk);const c=aD(e,i,s,t);return delete e.sdkProcessingMetadata,da(c,[[{type:a},e]])}function fD(e,t){function n(x){return!!x.trace_id&&!!x.public_key}const s=Ws(e[0]),i=t?.getDsn(),a=t?.getOptions().tunnel,c={sent_at:new Date().toISOString(),...n(s)&&{trace:s},...!!a&&i&&{dsn:ql(i)}},{beforeSendSpan:f,ignoreSpans:d}=t?.getOptions()||{},p=d?.length?e.filter(x=>!fh(yt(x),d)):e,g=e.length-p.length;g&&t?.recordDroppedEvent("before_send","span",g);const y=f?x=>{const S=yt(x),w=f(S);return w||(Gy(),S)}:yt,b=[];for(const x of p){const S=y(x);S&&b.push(sD(S))}return da(c,b)}function dD(e){if(!Ce)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:s}=yt(e),{spanId:i}=e.spanContext(),a=ai(e),c=kn(e),f=c===e,d=`[Tracing] Starting ${a?"sampled":"unsampled"} ${f?"root ":""}span`,p=[`op: ${n}`,`name: ${t}`,`ID: ${i}`];if(s&&p.push(`parent ID: ${s}`),!f){const{op:g,description:y}=yt(c);p.push(`root ID: ${c.spanContext().spanId}`),g&&p.push(`root op: ${g}`),y&&p.push(`root description: ${y}`)}be.log(`${d}
|
|
8
|
+
${p.join(`
|
|
9
|
+
`)}`)}function hD(e){if(!Ce)return;const{description:t="< unknown name >",op:n="< unknown op >"}=yt(e),{spanId:s}=e.spanContext(),a=kn(e)===e,c=`[Tracing] Finishing "${n}" ${a?"root ":""}span "${t}" with ID ${s}`;be.log(c)}function pD(e,t,n,s=Kn()){const i=s&&kn(s);i&&(Ce&&be.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[Du]:t,[Iu]:n}))}function Nw(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const s=n.attributes||{},i=s[Iu],a=s[Du];typeof i=="string"&&typeof a=="number"&&(t[n.name]={value:a,unit:i})}),t}const jw=1e3;class Jh{constructor(t={}){this._traceId=t.traceId||Ys(),this._spanId=t.spanId||Vs(),this._startTime=t.startTimestamp||sn(),this._links=t.links,this._attributes={},this.setAttributes({[hn]:"manual",[Qs]: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:s}=this;return{spanId:t,traceId:n,traceFlags:s?Xv:ER}}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=Xi(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(ms,"custom"),this}end(t){this._endTime||(this._endTime=Xi(t),hD(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[Qs],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:RR(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[hn],profile_id:this._attributes[Gv],exclusive_time:this._attributes[Hl],measurements:Nw(this._events),is_segment:this._isStandaloneSpan&&kn(this)===this||void 0,segment_id:this._isStandaloneSpan?kn(this).spanContext().spanId:void 0,links:CR(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,s){Ce&&be.log("[Tracing] Adding an event to span:",t);const i=Aw(n)?n:s||sn(),a=Aw(n)?{}:n||{},c={name:t,time:Xi(i),attributes:a};return this._events.push(c),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=vt();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===kn(this)))return;if(this._isStandaloneSpan){this._sampled?gD(fD([this],t)):(Ce&&be.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}const s=this._convertSpanToTransaction();s&&(uh(this).scope||bt()).captureEvent(s)}_convertSpanToTransaction(){if(!Ow(yt(this)))return;this._name||(Ce&&be.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=uh(this),s=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;const a=Kd(this).filter(g=>g!==this&&!mD(g)).map(g=>yt(g)).filter(Ow),c=this._attributes[ms];delete this._attributes[Sw],a.forEach(g=>{delete g.data[Sw]});const f={contexts:{trace:$I(this)},spans:a.length>jw?a.sort((g,y)=>g.start_timestamp-y.start_timestamp).slice(0,jw):a,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:Ws(this)},request:s,...c&&{transaction_info:{source:c}}},d=Nw(this._events);return d&&Object.keys(d).length&&(Ce&&be.log("[Measurements] Adding measurements to transaction event",JSON.stringify(d,void 0,2)),f.measurements=d),f}}function Aw(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function Ow(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function mD(e){return e instanceof Jh&&e.isStandaloneSpan()}function gD(e){const t=vt();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function yD(e,t,n=()=>{},s=()=>{}){let i;try{i=e()}catch(a){throw t(a),n(),a}return vD(i,t,n,s)}function vD(e,t,n,s){return Bl(e)?e.then(i=>(n(),s(i),i),i=>{throw t(i),n(),i}):(n(),s(e),e)}function bD(e,t,n){if(!es(e))return[!1];let s,i;typeof e.tracesSampler=="function"?(i=e.tracesSampler({...t,inheritOrSampleWith:f=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):f}),s=!0):t.parentSampled!==void 0?i=t.parentSampled:typeof e.tracesSampleRate<"u"&&(i=e.tracesSampleRate,s=!0);const a=gu(i);if(a===void 0)return Ce&&be.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(i)} of type ${JSON.stringify(typeof i)}.`),[!1];if(!a)return Ce&&be.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,a,s];const c=n<a;return c||Ce&&be.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[c,a,s]}const kR="__SENTRY_SUPPRESS_TRACING__";function IR(e,t){const n=eb();if(n.startSpan)return n.startSpan(e,t);const s=PR(e),{forceTransaction:i,parentSpan:a,scope:c}=e,f=c?.clone();return ku(f,()=>SD(a)(()=>{const p=bt(),g=zR(p,a),b=e.onlyIfParent&&!g?new Qo:DR({parentSpan:g,spanArguments:s,forceTransaction:i,scope:p});return Cl(p,b),yD(()=>t(b),()=>{const{status:x}=yt(b);b.isRecording()&&(!x||x==="ok")&&b.setStatus({code:un,message:"internal_error"})},()=>{b.end()})}))}function Vl(e){const t=eb();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=PR(e),{forceTransaction:s,parentSpan:i}=e;return(e.scope?c=>ku(e.scope,c):i!==void 0?c=>Jv(i,c):c=>c())(()=>{const c=bt(),f=zR(c,i);return e.onlyIfParent&&!f?new Qo:DR({parentSpan:f,spanArguments:n,forceTransaction:s,scope:c})})}function Jv(e,t){const n=eb();return n.withActiveSpan?n.withActiveSpan(e,t):ku(s=>(Cl(s,e||void 0),t(s)))}function DR({parentSpan:e,spanArguments:t,forceTransaction:n,scope:s}){if(!es()){const c=new Qo;if(n||!e){const f={sampled:"false",sample_rate:"0",transaction:t.name,...Ws(c)};Gd(c,f)}return c}const i=Hr();let a;if(e&&!n)a=xD(e,s,t),NR(e,a);else if(e){const c=Ws(e),{traceId:f,spanId:d}=e.spanContext(),p=ai(e);a=Mw({traceId:f,parentSpanId:d,...t},s,p),Gd(a,c)}else{const{traceId:c,dsc:f,parentSpanId:d,sampled:p}={...i.getPropagationContext(),...s.getPropagationContext()};a=Mw({traceId:c,parentSpanId:d,...t},s,p),f&&Gd(a,f)}return dD(a),wI(a,s,i),a}function PR(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const s={...n};return s.startTimestamp=Xi(e.startTime),delete s.startTime,s}return n}function eb(){const e=ca();return Fl(e)}function Mw(e,t,n){const s=vt(),i=s?.getOptions()||{},{name:a=""}=e,c={spanAttributes:{...e.attributes},spanName:a,parentSampled:n};s?.emit("beforeSampling",c,{decision:!1});const f=c.parentSampled??n,d=c.spanAttributes,p=t.getPropagationContext(),[g,y,b]=t.getScopeData().sdkProcessingMetadata[kR]?[!1]:bD(i,{name:a,parentSampled:f,attributes:d,parentSampleRate:gu(p.dsc?.sample_rate)},p.sampleRand),x=new Jh({...e,attributes:{[ms]:"custom",[Kv]:y!==void 0&&b?y:void 0,...d},sampled:g});return!g&&s&&(Ce&&be.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),s.recordDroppedEvent("sample_rate","transaction")),s&&s.emit("spanStart",x),x}function xD(e,t,n){const{spanId:s,traceId:i}=e.spanContext(),a=t.getScopeData().sdkProcessingMetadata[kR]?!1:ai(e),c=a?new Jh({...n,parentSpanId:s,traceId:i,sampled:a}):new Qo({traceId:i});NR(e,c);const f=vt();return f&&(f.emit("spanStart",c),n.endTimestamp&&f.emit("spanEnd",c)),c}function zR(e,t){if(t)return t;if(t===null)return;const n=Rl(e);if(!n)return;const s=vt();return(s?s.getOptions():{}).parentSpanIsAlwaysRootSpan?kn(n):n}function SD(e){return e!==void 0?t=>Jv(e,t):t=>t()}const Zd={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},_D="heartbeatFailed",wD="idleTimeout",ED="finalTimeout",TD="externalFinish";function LR(e,t={}){const n=new Map;let s=!1,i,a=TD,c=!t.disableAutoFinish;const f=[],{idleTimeout:d=Zd.idleTimeout,finalTimeout:p=Zd.finalTimeout,childSpanTimeout:g=Zd.childSpanTimeout,beforeSpanEnd:y,trimIdleSpanEndTimestamp:b=!0}=t,x=vt();if(!x||!es()){const j=new Qo,O={sample_rate:"0",sampled:"false",...Ws(j)};return Gd(j,O),j}const S=bt(),w=Kn(),T=CD(e);T.end=new Proxy(T.end,{apply(j,O,D){if(y&&y(T),O instanceof Qo)return;const[K,...F]=D,z=K||sn(),X=Xi(z),Y=Kd(T).filter(U=>U!==T),te=yt(T);if(!Y.length||!b)return L(X),Reflect.apply(j,O,[X,...F]);const P=x.getOptions().ignoreSpans,V=Y?.reduce((U,I)=>{const G=yt(I);return!G.timestamp||P&&fh(G,P)?U:U?Math.max(U,G.timestamp):G.timestamp},void 0),B=te.start_timestamp,q=Math.min(B?B+p/1e3:1/0,Math.max(B||-1/0,Math.min(X,V||1/0)));return L(q),Reflect.apply(j,O,[q,...F])}});function C(){i&&(clearTimeout(i),i=void 0)}function A(j){C(),i=setTimeout(()=>{!s&&n.size===0&&c&&(a=wD,T.end(j))},d)}function N(j){i=setTimeout(()=>{!s&&c&&(a=_D,T.end(j))},g)}function R(j){C(),n.set(j,!0);const O=sn();N(O+g/1e3)}function k(j){if(n.has(j)&&n.delete(j),n.size===0){const O=sn();A(O+d/1e3)}}function L(j){s=!0,n.clear(),f.forEach(Y=>Y()),Cl(S,w);const O=yt(T),{start_timestamp:D}=O;if(!D)return;O.data[mu]||T.setAttribute(mu,a);const F=O.status;(!F||F==="unknown")&&T.setStatus({code:Zv}),be.log(`[Tracing] Idle span "${O.op}" finished`);const z=Kd(T).filter(Y=>Y!==T);let X=0;z.forEach(Y=>{Y.isRecording()&&(Y.setStatus({code:un,message:"cancelled"}),Y.end(j),Ce&&be.log("[Tracing] Cancelling span since span ended early",JSON.stringify(Y,void 0,2)));const te=yt(Y),{timestamp:P=0,start_timestamp:V=0}=te,B=V<=j,q=(p+d)/1e3,U=P-V<=q;if(Ce){const I=JSON.stringify(Y,void 0,2);B?U||be.log("[Tracing] Discarding span since it finished after idle span final timeout",I):be.log("[Tracing] Discarding span since it happened after idle span was finished",I)}(!U||!B)&&(VI(T,Y),X++)}),X>0&&T.setAttribute("sentry.idle_span_discarded_spans",X)}return f.push(x.on("spanStart",j=>{if(s||j===T||yt(j).timestamp||j instanceof Jh&&j.isStandaloneSpan())return;Kd(T).includes(j)&&R(j.spanContext().spanId)})),f.push(x.on("spanEnd",j=>{s||k(j.spanContext().spanId)})),f.push(x.on("idleSpanEnableAutoFinish",j=>{j===T&&(c=!0,A(),n.size&&N())})),t.disableAutoFinish||A(),setTimeout(()=>{s||(T.setStatus({code:un,message:"deadline_exceeded"}),a=ED,T.end())},p),T}function CD(e){const t=Vl(e);return Cl(bt(),t),Ce&&be.log("[Tracing] Started span is an idle span"),t}const Hg=0,kw=1,Iw=2;function Pu(e){return new yu(t=>{t(e)})}function tb(e){return new yu((t,n)=>{n(e)})}class yu{constructor(t){this._state=Hg,this._handlers=[],this._runExecutor(t)}then(t,n){return new yu((s,i)=>{this._handlers.push([!1,a=>{if(!t)s(a);else try{s(t(a))}catch(c){i(c)}},a=>{if(!n)i(a);else try{s(n(a))}catch(c){i(c)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new yu((n,s)=>{let i,a;return this.then(c=>{a=!1,i=c,t&&t()},c=>{a=!0,i=c,t&&t()}).then(()=>{if(a){s(i);return}n(i)})})}_executeHandlers(){if(this._state===Hg)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===kw&&n[1](this._value),this._state===Iw&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(a,c)=>{if(this._state===Hg){if(Bl(c)){c.then(s,i);return}this._state=a,this._value=c,this._executeHandlers()}},s=a=>{n(kw,a)},i=a=>{n(Iw,a)};try{t(s,i)}catch(a){i(a)}}}function RD(e,t,n,s=0){try{const i=Qy(t,n,e,s);return Bl(i)?i:Pu(i)}catch(i){return tb(i)}}function Qy(e,t,n,s){const i=n[s];if(!e||!i)return e;const a=i({...e},t);return Ce&&a===null&&be.log(`Event processor "${i.id||"?"}" dropped event`),Bl(a)?a.then(c=>Qy(c,t,n,s+1)):Qy(a,t,n,s+1)}let Li,Dw,Pw,Io;function ND(e){const t=lt._sentryDebugIds,n=lt._debugIds;if(!t&&!n)return{};const s=t?Object.keys(t):[],i=n?Object.keys(n):[];if(Io&&s.length===Dw&&i.length===Pw)return Io;Dw=s.length,Pw=i.length,Io={},Li||(Li={});const a=(c,f)=>{for(const d of c){const p=f[d],g=Li?.[d];if(g&&Io&&p)Io[g[0]]=p,Li&&(Li[d]=[g[0],p]);else if(p){const y=e(d);for(let b=y.length-1;b>=0;b--){const S=y[b]?.filename;if(S&&Io&&Li){Io[S]=p,Li[d]=[S,p];break}}}}};return t&&a(s,t),n&&a(i,n),Io}function jD(e,t){const{fingerprint:n,span:s,breadcrumbs:i,sdkProcessingMetadata:a}=t;AD(e,t),s&&kD(e,s),ID(e,n),OD(e,i),MD(e,a)}function zw(e,t){const{extra:n,tags:s,attributes:i,user:a,contexts:c,level:f,sdkProcessingMetadata:d,breadcrumbs:p,fingerprint:g,eventProcessors:y,attachments:b,propagationContext:x,transactionName:S,span:w}=t;Yc(e,"extra",n),Yc(e,"tags",s),Yc(e,"attributes",i),Yc(e,"user",a),Yc(e,"contexts",c),e.sdkProcessingMetadata=Mu(e.sdkProcessingMetadata,d,2),f&&(e.level=f),S&&(e.transactionName=S),w&&(e.span=w),p.length&&(e.breadcrumbs=[...e.breadcrumbs,...p]),g.length&&(e.fingerprint=[...e.fingerprint,...g]),y.length&&(e.eventProcessors=[...e.eventProcessors,...y]),b.length&&(e.attachments=[...e.attachments,...b]),e.propagationContext={...e.propagationContext,...x}}function Yc(e,t,n){e[t]=Mu(e[t],n,1)}function ep(e,t){const n=gI().getScopeData();return e&&zw(n,e.getScopeData()),t&&zw(n,t.getScopeData()),n}function AD(e,t){const{extra:n,tags:s,user:i,contexts:a,level:c,transactionName:f}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(s).length&&(e.tags={...s,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),c&&(e.level=c),f&&e.type!=="transaction"&&(e.transaction=f)}function OD(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function MD(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function kD(e,t){e.contexts={trace:TR(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Ws(t),...e.sdkProcessingMetadata};const n=kn(t),s=yt(n).description;s&&!e.transaction&&e.type==="transaction"&&(e.transaction=s)}function ID(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 DD(e,t,n,s,i,a){const{normalizeDepth:c=3,normalizeMaxBreadth:f=1e3}=e,d={...t,event_id:t.event_id||n.event_id||Ur(),timestamp:t.timestamp||fa()},p=n.integrations||e.integrations.map(C=>C.name);PD(d,e),UD(d,p),i&&i.emit("applyFrameMetadata",t),t.type===void 0&&zD(d,e.stackParser);const g=BD(s,n.captureContext);n.mechanism&&El(d,n.mechanism);const y=i?i.getEventProcessors():[],b=ep(a,g),x=[...n.attachments||[],...b.attachments];x.length&&(n.attachments=x),jD(d,b);const S=[...y,...b.eventProcessors];return(n.data&&n.data.__sentry__===!0?Pu(d):RD(S,d,n)).then(C=>(C&&LD(C),typeof c=="number"&&c>0?$D(C,c,f):C))}function PD(e,t){const{environment:n,release:s,dist:i,maxValueLength:a}=t;e.environment=e.environment||n||Qv,!e.release&&s&&(e.release=s),!e.dist&&i&&(e.dist=i);const c=e.request;c?.url&&a&&(c.url=Hy(c.url,a)),a&&e.exception?.values?.forEach(f=>{f.value&&(f.value=Hy(f.value,a))})}function zD(e,t){const n=ND(t);e.exception?.values?.forEach(s=>{s.stacktrace?.frames?.forEach(i=>{i.filename&&(i.debug_id=n[i.filename])})})}function LD(e){const t={};if(e.exception?.values?.forEach(s=>{s.stacktrace?.frames?.forEach(i=>{i.debug_id&&(i.abs_path?t[i.abs_path]=i.debug_id:i.filename&&(t[i.filename]=i.debug_id),delete i.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(([s,i])=>{n.push({type:"sourcemap",code_file:s,debug_id:i})})}function UD(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function $D(e,t,n){if(!e)return null;const s={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>({...i,...i.data&&{data:Fs(i.data,t,n)}}))},...e.user&&{user:Fs(e.user,t,n)},...e.contexts&&{contexts:Fs(e.contexts,t,n)},...e.extra&&{extra:Fs(e.extra,t,n)}};return e.contexts?.trace&&s.contexts&&(s.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(s.contexts.trace.data=Fs(e.contexts.trace.data,t,n))),e.spans&&(s.spans=e.spans.map(i=>({...i,...i.data&&{data:Fs(i.data,t,n)}}))),e.contexts?.flags&&s.contexts&&(s.contexts.flags=Fs(e.contexts.flags,3,n)),s}function BD(e,t){if(!t)return e;const n=e?e.clone():new Xs;return n.update(t),n}function UR(e,t){return bt().captureException(e,void 0)}function $R(e,t){return bt().captureEvent(e,t)}function FD(e,t){Hr().setContext(e,t)}function HD(){const e=vt();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Lw(e){const t=Hr(),{user:n}=ep(t,bt()),{userAgent:s}=lt.navigator||{},i=iI({user:n,...s&&{userAgent:s},...e}),a=t.getSession();return a?.status==="ok"&&Tl(a,{status:"exited"}),BR(),t.setSession(i),i}function BR(){const e=Hr(),n=bt().getSession()||e.getSession();n&&aI(n),FR(),e.setSession()}function FR(){const e=Hr(),t=vt(),n=e.getSession();n&&t&&t.captureSession(n)}function qg(e=!1){if(e){BR();return}FR()}const qD="7";function VD(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function KD(e){return`${VD(e)}${e.projectId}/envelope/`}function GD(e,t){const n={sentry_version:qD};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function ZD(e,t,n){return t||`${KD(e)}?${GD(e,n)}`}const Uw=[];function YD(e){const t={};return e.forEach(n=>{const{name:s}=n,i=t[s];i&&!i.isDefaultInstance&&n.isDefaultInstance||(t[s]=n)}),Object.values(t)}function XD(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(i=>{i.isDefaultInstance=!0});let s;if(Array.isArray(n))s=[...t,...n];else if(typeof n=="function"){const i=n(t);s=Array.isArray(i)?i:[i]}else s=t;return YD(s)}function QD(e,t){const n={};return t.forEach(s=>{s&&HR(e,s,n)}),n}function $w(e,t){for(const n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function HR(e,t,n){if(n[t.name]){Ce&&be.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Uw.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Uw.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const s=t.preprocessEvent.bind(t);e.on("preprocessEvent",(i,a)=>s(i,a,e))}if(typeof t.processEvent=="function"){const s=t.processEvent.bind(t),i=Object.assign((a,c)=>s(a,c,e),{id:t.name});e.addEventProcessor(i)}Ce&&be.log(`Integration installed: ${t.name}`)}function WD(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function JD(e,t){const{value:n,unit:s}=WD(e)?e:{value:e,unit:void 0},i=e2(n),a=s&&typeof s=="string"?{unit:s}:{};if(i)return{...i,...a};if(!t||t==="skip-undefined"&&n===void 0)return;let c="";try{c=JSON.stringify(n)??""}catch{}return{value:c,type:"string",...a}}function dh(e,t=!1){const n={};for(const[s,i]of Object.entries(e??{})){const a=JD(i,t);a&&(n[s]=a)}return n}function e2(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 qR(e,t){return t?ku(t,()=>{const n=Kn(),s=n?TR(n):pR(t);return[n?Ws(n):Wv(e,t),s]}):[void 0,void 0]}const t2={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function n2(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function r2(e,t,n,s){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&s&&(i.dsn=ql(s)),da(i,[n2(e)])}const s2=100;function fs(e,t,n,s=!0){n&&(!e[t]||s)&&(e[t]=n)}function o2(e,t){const n=nb(),s=VR(e);s===void 0?n.set(e,[t]):s.length>=s2?(hh(e,s),n.set(e,[t])):n.set(e,[...s,t])}function i2(e,t=bt(),n=o2){const s=t?.getClient()??vt();if(!s){Ce&&be.warn("No client available to capture log.");return}const{release:i,environment:a,enableLogs:c=!1,beforeSendLog:f}=s.getOptions();if(!c){Ce&&be.warn("logging option not enabled, log will not be captured.");return}const[,d]=qR(s,t),p={...e.attributes},{user:{id:g,email:y,username:b},attributes:x={}}=ep(Hr(),t);fs(p,"user.id",g,!1),fs(p,"user.email",y,!1),fs(p,"user.name",b,!1),fs(p,"sentry.release",i),fs(p,"sentry.environment",a);const{name:S,version:w}=s.getSdkMetadata()?.sdk??{};fs(p,"sentry.sdk.name",S),fs(p,"sentry.sdk.version",w);const T=s.getIntegrationByName("Replay"),C=T?.getReplayId(!0);fs(p,"sentry.replay_id",C),C&&T?.getRecordingMode()==="buffer"&&fs(p,"sentry._internal.replay_is_buffering",!0);const A=e.message;if(Qh(A)){const{__sentry_template_string__:F,__sentry_template_values__:z=[]}=A;z?.length&&(p["sentry.message.template"]=F),z.forEach((X,Y)=>{p[`sentry.message.parameter.${Y}`]=X})}const N=Rl(t);fs(p,"sentry.trace.parent_span_id",N?.spanContext().spanId);const R={...e,attributes:p};s.emit("beforeCaptureLog",R);const k=f?ua(()=>f(R)):R;if(!k){s.recordDroppedEvent("before_send","log_item",1),Ce&&be.warn("beforeSendLog returned null, log will not be captured.");return}const{level:L,message:j,attributes:O={},severityNumber:D}=k,K={timestamp:sn(),level:L,body:j,trace_id:d?.trace_id,severity_number:D??t2[L],attributes:{...dh(x),...dh(O,!0)}};n(s,K),s.emit("afterCaptureLog",k)}function hh(e,t){const n=t??VR(e)??[];if(n.length===0)return;const s=e.getOptions(),i=r2(n,s._metadata,s.tunnel,e.getDsn());nb().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(i)}function VR(e){return nb().get(e)}function nb(){return Ul("clientToLogBufferMap",()=>new WeakMap)}function a2(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function l2(e,t,n,s){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),n&&s&&(i.dsn=ql(s)),da(i,[a2(e)])}const c2=1e3;function Us(e,t,n,s=!0){n&&(s||!(t in e))&&(e[t]=n)}function u2(e,t){const n=sb(),s=KR(e);s===void 0?n.set(e,[t]):s.length>=c2?(rb(e,s),n.set(e,[t])):n.set(e,[...s,t])}function f2(e,t,n){const{release:s,environment:i}=t.getOptions(),a={...e.attributes};Us(a,"user.id",n.id,!1),Us(a,"user.email",n.email,!1),Us(a,"user.name",n.username,!1),Us(a,"sentry.release",s),Us(a,"sentry.environment",i);const{name:c,version:f}=t.getSdkMetadata()?.sdk??{};Us(a,"sentry.sdk.name",c),Us(a,"sentry.sdk.version",f);const d=t.getIntegrationByName("Replay"),p=d?.getReplayId(!0);return Us(a,"sentry.replay_id",p),p&&d?.getRecordingMode()==="buffer"&&Us(a,"sentry._internal.replay_is_buffering",!0),{...e,attributes:a}}function d2(e,t,n,s){const[,i]=qR(t,n),a=Rl(n),c=a?a.spanContext().traceId:i?.trace_id,f=a?a.spanContext().spanId:void 0;return{timestamp:sn(),trace_id:c??"",span_id:f,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...dh(s),...dh(e.attributes,"skip-undefined")}}}function h2(e,t){const n=t?.scope??bt(),s=t?.captureSerializedMetric??u2,i=n?.getClient()??vt();if(!i){Ce&&be.warn("No client available to capture metric.");return}const{_experiments:a,enableMetrics:c,beforeSendMetric:f}=i.getOptions();if(!(c??a?.enableMetrics??!0)){Ce&&be.warn("metrics option not enabled, metric will not be captured.");return}const{user:p,attributes:g}=ep(Hr(),n),y=f2(e,i,p);i.emit("processMetric",y);const b=f||a?.beforeSendMetric,x=b?b(y):y;if(!x){Ce&&be.log("`beforeSendMetric` returned `null`, will not send metric.");return}const S=d2(x,i,n,g);Ce&&be.log("[Metric]",S),s(i,S),i.emit("afterCaptureMetric",x)}function rb(e,t){const n=t??KR(e)??[];if(n.length===0)return;const s=e.getOptions(),i=l2(n,s._metadata,s.tunnel,e.getDsn());sb().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(i)}function KR(e){return sb().get(e)}function sb(){return Ul("clientToMetricBufferMap",()=>new WeakMap)}function GR(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const ob=Symbol.for("SentryBufferFullError");function ib(e=100){const t=new Set;function n(){return t.size<e}function s(c){t.delete(c)}function i(c){if(!n())return tb(ob);const f=c();return t.add(f),f.then(()=>s(f),()=>s(f)),f}function a(c){if(!t.size)return Pu(!0);const f=Promise.allSettled(Array.from(t)).then(()=>!0);if(!c)return f;const d=[f,new Promise(p=>GR(setTimeout(()=>p(!1),c)))];return Promise.race(d)}return{get $(){return Array.from(t)},add:i,drain:a}}const p2=60*1e3;function m2(e,t=Ou()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const s=Date.parse(`${e}`);return isNaN(s)?p2:s-t}function g2(e,t){return e[t]||e.all||0}function y2(e,t,n=Ou()){return g2(e,t)>n}function v2(e,{statusCode:t,headers:n},s=Ou()){const i={...e},a=n?.["x-sentry-rate-limits"],c=n?.["retry-after"];if(a)for(const f of a.trim().split(",")){const[d,p,,,g]=f.split(":",5),y=parseInt(d,10),b=(isNaN(y)?60:y)*1e3;if(!p)i.all=s+b;else for(const x of p.split(";"))x==="metric_bucket"?(!g||g.split(";").includes("custom"))&&(i[x]=s+b):i[x]=s+b}else c?i.all=s+m2(c,s):t===429&&(i.all=s+60*1e3);return i}const ZR=64;function b2(e,t,n=ib(e.bufferSize||ZR)){let s={};const i=c=>n.drain(c);function a(c){const f=[];if(Yy(c,(y,b)=>{const x=Rw(b);y2(s,x)?e.recordDroppedEvent("ratelimit_backoff",x):f.push(y)}),f.length===0)return Promise.resolve({});const d=da(c[0],f),p=y=>{if(tD(d,["client_report"])){Ce&&be.warn(`Dropping client report. Will not send outcomes (reason: ${y}).`);return}Yy(d,(b,x)=>{e.recordDroppedEvent(y,Rw(x))})},g=()=>t({body:nD(d)}).then(y=>y.statusCode===413?(Ce&&be.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),p("send_error"),y):(Ce&&y.statusCode!==void 0&&(y.statusCode<200||y.statusCode>=300)&&be.warn(`Sentry responded with status code ${y.statusCode} to sent event.`),s=v2(s,y),y),y=>{throw p("network_error"),Ce&&be.error("Encountered error running transport request:",y),y});return n.add(g).then(y=>y,y=>{if(y===ob)return Ce&&be.error("Skipped sending event because buffer is full."),p("queue_overflow"),Promise.resolve({});throw y})}return{send:a,flush:i}}function x2(e,t,n){const s=[{type:"client_report"},{timestamp:fa(),discarded_events:e}];return da(t?{dsn:t}:{},[s])}function YR(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 S2(e){const{trace_id:t,parent_span_id:n,span_id:s,status:i,origin:a,data:c,op:f}=e.contexts?.trace??{};return{data:c??{},description:e.transaction,op:f,parent_span_id:n,span_id:s??"",start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??"",origin:a,profile_id:c?.[Gv],exclusive_time:c?.[Hl],measurements:e.measurements,is_segment:!0}}function _2(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&&{[Gv]:e.profile_id},...e.exclusive_time&&{[Hl]:e.exclusive_time}}}},measurements:e.measurements}}const Bw="Not capturing exception because it's already been captured.",Fw="Discarded session because of missing or non-string release",XR=Symbol.for("SentryInternalError"),QR=Symbol.for("SentryDoNotSendEventError"),w2=5e3;function Yd(e){return{message:e,[XR]:!0}}function Vg(e){return{message:e,[QR]:!0}}function Hw(e){return!!e&&typeof e=="object"&&XR in e}function qw(e){return!!e&&typeof e=="object"&&QR in e}function Vw(e,t,n,s,i){let a=0,c,f=!1;e.on(n,()=>{a=0,clearTimeout(c),f=!1}),e.on(t,d=>{a+=s(d),a>=8e5?i(e):f||(f=!0,c=GR(setTimeout(()=>{i(e)},w2)))}),e.on("flush",()=>{i(e)})}class E2{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=ib(t.transportOptions?.bufferSize??ZR),t.dsn?this._dsn=PI(t.dsn):Ce&&be.warn("No DSN provided, client will not send events."),this._dsn){const s=ZD(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:s})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&Vw(this,"afterCaptureLog","flushLogs",N2,hh),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Vw(this,"afterCaptureMetric","flushMetrics",R2,rb)}captureException(t,n,s){const i=Ur();if(vw(t))return Ce&&be.log(Bw),i;const a={event_id:i,...n};return this._process(()=>this.eventFromException(t,a).then(c=>this._captureEvent(c,a,s)).then(c=>c),"error"),a.event_id}captureMessage(t,n,s,i){const a={event_id:Ur(),...s},c=Qh(t)?t:String(t),f=wl(t),d=f?this.eventFromMessage(c,n,a):this.eventFromException(t,a);return this._process(()=>d.then(p=>this._captureEvent(p,a,i)),f?"unknown":"error"),a.event_id}captureEvent(t,n,s){const i=Ur();if(n?.originalException&&vw(n.originalException))return Ce&&be.log(Bw),i;const a={event_id:i,...n},c=t.sdkProcessingMetadata||{},f=c.capturedSpanScope,d=c.capturedSpanIsolationScope,p=Kw(t.type);return this._process(()=>this._captureEvent(t,a,f||s,d),p),a.event_id}captureSession(t){this.sendSession(t),Tl(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 s=await this._isClientDoneProcessing(t),i=await n.flush(t);return s&&i}async close(t){hh(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];HR(this,t,this._integrations),n||$w(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let s=uD(t,this._dsn,this._options._metadata,this._options.tunnel);for(const i of n.attachments||[])s=eD(s,oD(i));this.sendEnvelope(s).then(i=>this.emit("afterSendEvent",t,i))}sendSession(t){const{release:n,environment:s=Qv}=this._options;if("aggregates"in t){const a=t.attrs||{};if(!a.release&&!n){Ce&&be.warn(Fw);return}a.release=a.release||n,a.environment=a.environment||s,t.attrs=a}else{if(!t.release&&!n){Ce&&be.warn(Fw);return}t.release=t.release||n,t.environment=t.environment||s}this.emit("beforeSendSession",t);const i=cD(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(i)}recordDroppedEvent(t,n,s=1){if(this._options.sendClientReports){const i=`${t}:${n}`;Ce&&be.log(`Recording outcome: "${i}"${s>1?` (${s} times)`:""}`),this._outcomes[i]=(this._outcomes[i]||0)+s}}on(t,n){const s=this._hooks[t]=this._hooks[t]||new Set,i=(...a)=>n(...a);return s.add(i),()=>{s.delete(i)}}emit(t,...n){const s=this._hooks[t];s&&s.forEach(i=>i(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return Ce&&be.error("Error while sending envelope:",n),{}}return Ce&&be.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=QD(this,t),$w(this,t)}_updateSessionFromEvent(t,n){let s=n.level==="fatal",i=!1;const a=n.exception?.values;if(a){i=!0,s=!1;for(const d of a)if(d.mechanism?.handled===!1){s=!0;break}}const c=t.status==="ok";(c&&t.errors===0||c&&s)&&(Tl(t,{...s&&{status:"crashed"},errors:t.errors||Number(i||s)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(s=>setTimeout(s,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,s,i){const a=this.getOptions(),c=Object.keys(this._integrations);return!n.integrations&&c?.length&&(n.integrations=c),this.emit("preprocessEvent",t,n),t.type||i.setLastEventId(t.event_id||n.event_id),DD(a,t,n,s,this,i).then(f=>{if(f===null)return f;this.emit("postprocessEvent",f,n),f.contexts={trace:pR(s),...f.contexts};const d=Wv(this,s);return f.sdkProcessingMetadata={dynamicSamplingContext:d,...f.sdkProcessingMetadata},f})}_captureEvent(t,n={},s=bt(),i=Hr()){return Ce&&Wy(t)&&be.log(`Captured error event \`${YR(t)[0]||"<unknown>"}\``),this._processEvent(t,n,s,i).then(a=>a.event_id,a=>{Ce&&(qw(a)?be.log(a.message):Hw(a)?be.warn(a.message):be.warn(a))})}_processEvent(t,n,s,i){const a=this.getOptions(),{sampleRate:c}=a,f=WR(t),d=Wy(t),g=`before send for type \`${t.type||"error"}\``,y=typeof c>"u"?void 0:gu(c);if(d&&typeof y=="number"&&Fo()>y)return this.recordDroppedEvent("sample_rate","error"),tb(Vg(`Discarding event because it's not included in the random sample (sampling rate = ${c})`));const b=Kw(t.type);return this._prepareEvent(t,n,s,i).then(x=>{if(x===null)throw this.recordDroppedEvent("event_processor",b),Vg("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return x;const w=C2(this,a,x,n);return T2(w,g)}).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 Vg(`${g} returned \`null\`, will not send event.`)}const S=s.getSession()||i.getSession();if(d&&S&&this._updateSessionFromEvent(S,x),f){const T=x.sdkProcessingMetadata?.spanCountBeforeProcessing||0,C=x.spans?x.spans.length:0,A=T-C;A>0&&this.recordDroppedEvent("before_send","span",A)}const w=x.transaction_info;if(f&&w&&x.transaction!==t.transaction){const T="custom";x.transaction_info={...w,source:T}}return this.sendEvent(x,n),x}).then(null,x=>{throw qw(x)||Hw(x)?x:(this.captureException(x,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:x}),Yd(`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(s=>(this._numProcessing--,s),s=>(this._numProcessing--,s===ob&&this.recordDroppedEvent("queue_overflow",n),s))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,s])=>{const[i,a]=n.split(":");return{reason:i,category:a,quantity:s}})}_flushOutcomes(){Ce&&be.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){Ce&&be.log("No outcomes to send");return}if(!this._dsn){Ce&&be.log("No dsn provided, will not send outcomes");return}Ce&&be.log("Sending outcomes:",t);const n=x2(t,this._options.tunnel&&ql(this._dsn));this.sendEnvelope(n)}}function Kw(e){return e==="replay_event"?"replay":e||"error"}function T2(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Bl(e))return e.then(s=>{if(!pu(s)&&s!==null)throw Yd(n);return s},s=>{throw Yd(`${t} rejected with ${s}`)});if(!pu(e)&&e!==null)throw Yd(n);return e}function C2(e,t,n,s){const{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:c,ignoreSpans:f}=t;let d=n;if(Wy(d)&&i)return i(d,s);if(WR(d)){if(c||f){const p=S2(d);if(f?.length&&fh(p,f))return null;if(c){const g=c(p);g?d=Mu(n,_2(g)):Gy()}if(d.spans){const g=[],y=d.spans;for(const x of y){if(f?.length&&fh(x,f)){GI(y,x);continue}if(c){const S=c(x);S?g.push(S):(Gy(),g.push(x))}else g.push(x)}const b=d.spans.length-g.length;b&&e.recordDroppedEvent("before_send","span",b),d.spans=g}}if(a){if(d.spans){const p=d.spans.length;d.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:p}}return a(d,s)}}return d}function Wy(e){return e.type===void 0}function WR(e){return e.type==="transaction"}function R2(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+JR(e.attributes)}function N2(e){let t=0;return e.message&&(t+=e.message.length*2),t+JR(e.attributes)}function JR(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*Gw(n[0]):wl(n)?t+=Gw(n):t+=100}),t}function Gw(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function j2(e){return Xh(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Zw(e){return j2(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function A2(e,t){t.debug===!0&&(Ce?be.enable():ua(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),bt().update(t.initialScope);const s=new e(t);return O2(s),s.init(),s}function O2(e){bt().setClient(e)}const M2="thismessage:/";function e1(e){return"isRelative"in e}function t1(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,s=n?M2:void 0;try{if("canParse"in URL&&!URL.canParse(e,s))return;const i=new URL(e,s);return n?{isRelative:n,pathname:i.pathname,search:i.search,hash:i.hash}:i}catch{}}function k2(e){if(e1(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 Wi(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",s=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:s,relative:t[5]+n+s}}function I2(e){return e.split(/[?#]/,1)[0]}function qo(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),s=n?n[1]:"text/plain",i=e.includes(";base64,"),a=e.indexOf(",");let c="";if(t&&a!==-1){const f=e.slice(a+1);c=f.length>10?`${f.slice(0,10)}... [truncated]`:f}return`data:${s}${i?",base64":""}${c?`,${c}`:""}`}return e}function D2(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 P2=D2;function z2(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 n1(e,t,n=[t],s="npm"){const i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=n.map(a=>({name:`${s}:@sentry/${a}`,version:Yi})),i.version=Yi)}function r1(e={}){const t=e.client||vt();if(!HD()||!t)return{};const n=ca(),s=Fl(n);if(s.getTraceData)return s.getTraceData(e);const i=e.scope||bt(),a=e.span||Kn(),c=a?BI(a):L2(i),f=a?Ws(a):Wv(t,i),d=CI(f);if(!SR.test(c))return be.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const g={"sentry-trace":c,baggage:d};return e.propagateTraceparent&&(g.traceparent=a?FI(a):U2(i)),g}function L2(e){const{traceId:t,sampled:n,propagationSpanId:s}=e.getPropagationContext();return _R(t,s,n)}function U2(e){const{traceId:t,sampled:n,propagationSpanId:s}=e.getPropagationContext();return wR(t,s,n)}const $2=100;function na(e,t){const n=vt(),s=Hr();if(!n)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=$2}=n.getOptions();if(a<=0)return;const f={timestamp:fa(),...e},d=i?ua(()=>i(f,t)):f;d!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",d,t),s.addBreadcrumb(d,a))}let Yw;const B2="FunctionToString",Xw=new WeakMap,F2=(()=>({name:B2,setupOnce(){Yw=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Vv(this),n=Xw.has(vt())&&t!==void 0?t:this;return Yw.apply(n,e)}}catch{}},setup(e){Xw.set(e,!0)}})),H2=F2,q2=[/^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$/],V2="EventFilters",K2=(e={})=>{let t;return{name:V2,setup(n){const s=n.getOptions();t=Qw(e,s)},processEvent(n,s,i){if(!t){const a=i.getOptions();t=Qw(e,a)}return Z2(n,t)?null:n}}},G2=((e={})=>({...K2(e),name:"InboundFilters"}));function Qw(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:q2],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Z2(e,t){if(e.type){if(e.type==="transaction"&&X2(e,t.ignoreTransactions))return Ce&&be.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
11
|
+
Event: ${Hi(e)}`),!0}else{if(Y2(e,t.ignoreErrors))return Ce&&be.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
12
|
+
Event: ${Hi(e)}`),!0;if(eP(e))return Ce&&be.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
13
|
+
Event: ${Hi(e)}`),!0;if(Q2(e,t.denyUrls))return Ce&&be.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
14
|
+
Event: ${Hi(e)}.
|
|
15
|
+
Url: ${ph(e)}`),!0;if(!W2(e,t.allowUrls))return Ce&&be.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
16
|
+
Event: ${Hi(e)}.
|
|
17
|
+
Url: ${ph(e)}`),!0}return!1}function Y2(e,t){return t?.length?YR(e).some(n=>Ho(n,t)):!1}function X2(e,t){if(!t?.length)return!1;const n=e.transaction;return n?Ho(n,t):!1}function Q2(e,t){if(!t?.length)return!1;const n=ph(e);return n?Ho(n,t):!1}function W2(e,t){if(!t?.length)return!0;const n=ph(e);return n?Ho(n,t):!0}function J2(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 ph(e){try{const n=[...e.exception?.values??[]].reverse().find(s=>s.mechanism?.parent_id===void 0&&s.stacktrace?.frames?.length)?.stacktrace?.frames;return n?J2(n):null}catch{return Ce&&be.error(`Cannot extract url for event ${Hi(e)}`),null}}function eP(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function tP(e,t,n,s,i,a){if(!i.exception?.values||!a||!Zs(a.originalException,Error))return;const c=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;c&&(i.exception.values=Jy(e,t,s,a.originalException,n,i.exception.values,c,0))}function Jy(e,t,n,s,i,a,c,f){if(a.length>=n+1)return a;let d=[...a];if(Zs(s[i],Error)){Ww(c,f,s);const p=e(t,s[i]),g=d.length;Jw(p,i,g,f),d=Jy(e,t,n,s[i],i,[p,...d],p,g)}return s1(s)&&s.errors.forEach((p,g)=>{if(Zs(p,Error)){Ww(c,f,s);const y=e(t,p),b=d.length;Jw(y,`errors[${g}]`,b,f),d=Jy(e,t,n,p,i,[y,...d],y,b)}}),d}function s1(e){return Array.isArray(e.errors)}function Ww(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...s1(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Jw(e,t,n,s){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:s}}function nP(e){const t="console";oi(t,e),ii(t,rP)}function rP(){"console"in lt&&zk.forEach(function(e){e in lt.console&&fr(lt.console,e,function(t){return ch[e]=t,function(...n){Lr("console",{args:n,level:e}),ch[e]?.apply(lt.console,n)}})})}function sP(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const oP="Dedupe",iP=(()=>{let e;return{name:oP,processEvent(t){if(t.type)return t;try{if(lP(t,e))return Ce&&be.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),aP=iP;function lP(e,t){return t?!!(cP(e,t)||uP(e,t)):!1}function cP(e,t){const n=e.message,s=t.message;return!(!n&&!s||n&&!s||!n&&s||n!==s||!i1(e,t)||!o1(e,t))}function uP(e,t){const n=eE(t),s=eE(e);return!(!n||!s||n.type!==s.type||n.value!==s.value||!i1(e,t)||!o1(e,t))}function o1(e,t){let n=dw(e),s=dw(t);if(!n&&!s)return!0;if(n&&!s||!n&&s||(n=n,s=s,s.length!==n.length))return!1;for(let i=0;i<s.length;i++){const a=s[i],c=n[i];if(a.filename!==c.filename||a.lineno!==c.lineno||a.colno!==c.colno||a.function!==c.function)return!1}return!0}function i1(e,t){let n=e.fingerprint,s=t.fingerprint;if(!n&&!s)return!0;if(n&&!s||!n&&s)return!1;n=n,s=s;try{return n.join("")===s.join("")}catch{return!1}}function eE(e){return e.exception?.values?.[0]}const fP="ConversationId",dP=(()=>({name:fP,setup(e){e.on("spanStart",t=>{const n=bt().getScopeData(),s=Hr().getScopeData(),i=n.conversationId||s.conversationId;i&&t.setAttribute(vI,i)})}})),hP=dP;function pP(e,t,n,s,i){if(!e.fetchData)return;const{method:a,url:c}=e.fetchData,f=es()&&t(c);if(e.endTimestamp){const x=e.fetchData.__span;if(!x)return;const S=s[x];S&&(f&&(yP(S,e),mP(S,e,i)),delete s[x]);return}const{spanOrigin:d="auto.http.browser",propagateTraceparent:p=!1}=typeof i=="object"?i:{spanOrigin:i},g=!!Kn(),y=f&&g?Vl(bP(c,a,d)):new Qo;if(e.fetchData.__span=y.spanContext().spanId,s[y.spanContext().spanId]=y,n(e.fetchData.url)){const x=e.args[0],S={...e.args[1]||{}},w=gP(x,S,es()&&g?y:void 0,p);w&&(e.args[1]=S,S.headers=w)}const b=vt();if(b){const x={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};b.emit("beforeOutgoingRequestSpan",y,x)}return y}function mP(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function gP(e,t,n,s){const i=r1({span:n,propagateTraceparent:s}),a=i["sentry-trace"],c=i.baggage,f=i.traceparent;if(!a)return;const d=t.headers||(Hv(e)?e.headers:void 0);if(d)if(vP(d)){const p=new Headers(d);if(p.get("sentry-trace")||p.set("sentry-trace",a),s&&f&&!p.get("traceparent")&&p.set("traceparent",f),c){const g=p.get("baggage");g?vd(g)||p.set("baggage",`${g},${c}`):p.set("baggage",c)}return p}else if(Array.isArray(d)){const p=[...d];d.find(y=>y[0]==="sentry-trace")||p.push(["sentry-trace",a]),s&&f&&!d.find(y=>y[0]==="traceparent")&&p.push(["traceparent",f]);const g=d.find(y=>y[0]==="baggage"&&vd(y[1]));return c&&!g&&p.push(["baggage",c]),p}else{const p="sentry-trace"in d?d["sentry-trace"]:void 0,g="traceparent"in d?d.traceparent:void 0,y="baggage"in d?d.baggage:void 0,b=y?Array.isArray(y)?[...y]:[y]:[],x=y&&(Array.isArray(y)?y.find(w=>vd(w)):vd(y));c&&!x&&b.push(c);const S={...d,"sentry-trace":p??a,baggage:b.length>0?b.join(","):void 0};return s&&f&&!g&&(S.traceparent=f),S}else return{...i}}function yP(e,t){if(t.response){gR(e,t.response.status);const n=t.response?.headers?.get("content-length");if(n){const s=parseInt(n);s>0&&e.setAttribute("http.response_content_length",s)}}else t.error&&e.setStatus({code:un,message:"internal_error"});e.end()}function vd(e){return e.split(",").some(t=>t.trim().startsWith(Yv))}function vP(e){return typeof Headers<"u"&&Zs(e,Headers)}function bP(e,t,n){if(e.startsWith("data:")){const a=qo(e);return{name:`${t} ${a}`,attributes:tE(e,void 0,t,n)}}const s=t1(e),i=s?k2(s):e;return{name:`${t} ${i}`,attributes:tE(e,s,t,n)}}function tE(e,t,n,s){const i={url:qo(e),type:"fetch","http.method":n,[hn]:s,[Qs]:"http.client"};return t&&(e1(t)||(i["http.url"]=qo(t.href),i["server.address"]=t.host),t.search&&(i["http.query"]=t.search),t.hash&&(i["http.fragment"]=t.hash)),i}function Kl(e,t,n,s,i){i2({level:e,message:t,attributes:n,severityNumber:i},s)}function xP(e,t,{scope:n}={}){Kl("trace",e,t,n)}function SP(e,t,{scope:n}={}){Kl("debug",e,t,n)}function _P(e,t,{scope:n}={}){Kl("info",e,t,n)}function wP(e,t,{scope:n}={}){Kl("warn",e,t,n)}function EP(e,t,{scope:n}={}){Kl("error",e,t,n)}function TP(e,t,{scope:n}={}){Kl("fatal",e,t,n)}const CP=Object.freeze(Object.defineProperty({__proto__:null,debug:SP,error:EP,fatal:TP,fmt:P2,info:_P,trace:xP,warn:wP},Symbol.toStringTag,{value:"Module"}));function ab(e,t,n,s){h2({type:e,name:t,value:n,unit:s?.unit,attributes:s?.attributes},{scope:s?.scope})}function nE(e,t=1,n){ab("counter",e,t,n)}function rE(e,t,n){ab("gauge",e,t,n)}function sE(e,t,n){ab("distribution",e,t,n)}function a1(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const vu=lt;function RP(){return"history"in vu&&!!vu.history}function NP(){if(!("fetch"in vu))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function ev(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function jP(){if(typeof EdgeRuntime=="string")return!0;if(!NP())return!1;if(ev(vu.fetch))return!0;let e=!1;const t=vu.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=ev(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){Ce&&be.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function l1(e,t){const n="fetch";oi(n,e),ii(n,()=>c1(void 0,t))}function AP(e){const t="fetch-body-resolved";oi(t,e),ii(t,()=>c1(MP))}function c1(e,t=!1){t&&!jP()||fr(lt,"fetch",function(n){return function(...s){const i=new Error,{method:a,url:c}=kP(s),f={args:s,fetchData:{method:a,url:c},startTimestamp:sn()*1e3,virtualError:i,headers:IP(s)};return e||Lr("fetch",{...f}),n.apply(lt,s).then(async d=>(e?e(d):Lr("fetch",{...f,endTimestamp:sn()*1e3,response:d}),d),d=>{Lr("fetch",{...f,endTimestamp:sn()*1e3,error:d}),Xh(d)&&d.stack===void 0&&(d.stack=i.stack,Vn(d,"framesToPop",1));const g=vt()?.getOptions().enhanceFetchErrorMessages??"always";if(g!==!1&&d instanceof TypeError&&(d.message==="Failed to fetch"||d.message==="Load failed"||d.message==="NetworkError when attempting to fetch resource."))try{const x=new URL(f.fetchData.url).host;g==="always"?d.message=`${d.message} (${x})`:Vn(d,"__sentry_fetch_url_host__",x)}catch{}throw d})}})}async function OP(e,t){if(e?.body){const n=e.body,s=n.getReader(),i=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let a=!0;for(;a;){let c;try{c=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:f}=await s.read();clearTimeout(c),f&&(t(),a=!1)}catch{a=!1}finally{clearTimeout(c)}}clearTimeout(i),s.releaseLock(),n.cancel().then(null,()=>{})}}function MP(e){let t;try{t=e.clone()}catch{return}OP(t,()=>{Lr("fetch-body-resolved",{endTimestamp:sn()*1e3,response:e})})}function Xd(e,t){return!!e&&typeof e=="object"&&!!e[t]}function oE(e){return typeof e=="string"?e:e?Xd(e,"url")?e.url:e.toString?e.toString():"":""}function kP(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,s]=e;return{url:oE(n),method:Xd(s,"method")?String(s.method).toUpperCase():Hv(n)&&Xd(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:oE(t),method:Xd(t,"method")?String(t.method).toUpperCase():"GET"}}function IP(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Hv(t))return new Headers(t.headers)}catch{}}function DP(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function PP(){return"npm"}function zP(){return!DP()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function LP(){return typeof window<"u"&&(!zP()||UP())}function UP(){return lt.process?.type==="renderer"}const st=lt;let tv=0;function u1(){return tv>0}function $P(){tv++,setTimeout(()=>{tv--})}function jl(e,t={}){function n(i){return typeof i=="function"}if(!n(e))return e;try{const i=e.__sentry_wrapped__;if(i)return typeof i=="function"?i:e;if(Vv(e))return e}catch{return e}const s=function(...i){try{const a=i.map(c=>jl(c,t));return e.apply(this,a)}catch(a){throw $P(),ku(c=>{c.addEventProcessor(f=>(t.mechanism&&(qy(f,void 0),El(f,t.mechanism)),f.extra={...f.extra,arguments:i},f)),UR(a)}),a}};try{for(const i in e)Object.prototype.hasOwnProperty.call(e,i)&&(s[i]=e[i])}catch{}uR(s,e),Vn(e,"__sentry_wrapped__",s);try{Object.getOwnPropertyDescriptor(s,"name").configurable&&Object.defineProperty(s,"name",{get(){return e.name}})}catch{}return s}function lb(){const e=ju(),{referrer:t}=st.document||{},{userAgent:n}=st.navigator||{},s={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:s}}function cb(e,t){const n=ub(e,t),s={type:VP(t),value:KP(t)};return n.length&&(s.stacktrace={frames:n}),s.type===void 0&&s.value===""&&(s.value="Unrecoverable error caught"),s}function BP(e,t,n,s){const a=vt()?.getOptions().normalizeDepth,c=QP(t),f={__serialized__:OR(t,a)};if(c)return{exception:{values:[cb(e,c)]},extra:f};const d={exception:{values:[{type:Wh(t)?t.constructor.name:s?"UnhandledRejection":"Error",value:YP(t,{isUnhandledRejection:s})}]},extra:f};if(n){const p=ub(e,n);p.length&&(d.exception.values[0].stacktrace={frames:p})}return d}function Kg(e,t){return{exception:{values:[cb(e,t)]}}}function ub(e,t){const n=t.stacktrace||t.stack||"",s=HP(t),i=qP(t);try{return e(n,s,i)}catch{}return[]}const FP=/Minified React error #\d+;/i;function HP(e){return e&&FP.test(e.message)?1:0}function qP(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function f1(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function VP(e){const t=e?.name;return!t&&f1(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function KP(e){const t=e?.message;return f1(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?Zw(t.error):Zw(e):"No error message"}function GP(e,t,n,s){const i=n?.syntheticException||void 0,a=fb(e,t,i,s);return El(a),a.level="error",n?.event_id&&(a.event_id=n.event_id),Pu(a)}function ZP(e,t,n="info",s,i){const a=s?.syntheticException||void 0,c=nv(e,t,a,i);return c.level=n,s?.event_id&&(c.event_id=s.event_id),Pu(c)}function fb(e,t,n,s,i){let a;if(aR(t)&&t.error)return Kg(e,t.error);if(pw(t)||Zk(t)){const c=t;if("stack"in t)a=Kg(e,t);else{const f=c.name||(pw(c)?"DOMError":"DOMException"),d=c.message?`${f}: ${c.message}`:f;a=nv(e,d,n,s),qy(a,d)}return"code"in c&&(a.tags={...a.tags,"DOMException.code":`${c.code}`}),a}return Xh(t)?Kg(e,t):pu(t)||Wh(t)?(a=BP(e,t,n,i),El(a,{synthetic:!0}),a):(a=nv(e,t,n,s),qy(a,`${t}`),El(a,{synthetic:!0}),a)}function nv(e,t,n,s){const i={};if(s&&n){const a=ub(e,n);a.length&&(i.exception={values:[{value:t,stacktrace:{frames:a}}]}),El(i,{synthetic:!0})}if(Qh(t)){const{__sentry_template_string__:a,__sentry_template_values__:c}=t;return i.logentry={message:a,params:c},i}return i.message=t,i}function YP(e,{isUnhandledRejection:t}){const n=eI(e),s=t?"promise rejection":"exception";return aR(e)?`Event \`ErrorEvent\` captured as ${s} with message \`${e.message}\``:Wh(e)?`Event \`${XP(e)}\` (type=${e.type}) captured as ${s}`:`Object captured as ${s} with keys: ${n}`}function XP(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function QP(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}class WP extends E2{constructor(t){const n=JP(t),s=st.SENTRY_SDK_SOURCE||PP();n1(n,"browser",["browser"],s),n._metadata?.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:i,sendClientReports:a,enableLogs:c,_experiments:f,enableMetrics:d}=this._options,p=d??f?.enableMetrics??!0;st.document&&(a||c||p)&&st.document.addEventListener("visibilitychange",()=>{st.document.visibilityState==="hidden"&&(a&&this._flushOutcomes(),c&&hh(this),p&&rb(this))}),i&&this.on("beforeSendSession",z2)}eventFromException(t,n){return GP(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",s){return ZP(this._options.stackParser,t,n,s,this._options.attachStacktrace)}_prepareEvent(t,n,s,i){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,s,i)}}function JP(e){return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:st.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const zu=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Ge=lt,ez=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Lu=(e,t,n,s)=>{let i,a;return c=>{t.value>=0&&(c||s)&&(a=t.value-(i??0),(a||i===void 0)&&(i=t.value,t.delta=a,t.rating=ez(t.value,n),e(t)))}},Uu=(e=!0)=>{const t=Ge.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Gl=()=>Uu()?.activationStart??0;function Vo(e,t,n){Ge.document&&Ge.addEventListener(e,t,n)}function mh(e,t,n){Ge.document&&Ge.removeEventListener(e,t,n)}let hl=-1;const d1=new Set,tz=()=>Ge.document?.visibilityState==="hidden"&&!Ge.document?.prerendering?0:1/0,Qd=e=>{if(nz(e)&&hl>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of d1)t();isFinite(hl)||(hl=e.type==="visibilitychange"?e.timeStamp:0,mh("prerenderingchange",Qd,!0))}},$u=()=>{if(Ge.document&&hl<0){const e=Gl();hl=(Ge.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??tz(),Vo("visibilitychange",Qd,!0),Vo("pagehide",Qd,!0),Vo("prerenderingchange",Qd,!0)}return{get firstHiddenTime(){return hl},onHidden(e){d1.add(e)}}};function nz(e){return e.type==="pagehide"||Ge.document?.visibilityState==="hidden"}const rz=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,Bu=(e,t=-1)=>{const n=Uu();let s="navigate";return n&&(Ge.document?.prerendering||Gl()>0?s="prerender":Ge.document?.wasDiscarded?s="restore":n.type&&(s=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:rz(),navigationType:s}},Gg=new WeakMap;function db(e,t){try{return Gg.get(e)||Gg.set(e,new t),Gg.get(e)}catch{return new t}}class gh{constructor(){gh.prototype.__init.call(this),gh.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){if(t.hadRecentInput)return;const n=this._sessionEntries[0],s=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&s&&t.startTime-s.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 Zl=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const s=new PerformanceObserver(i=>{Promise.resolve().then(()=>{t(i.getEntries())})});return s.observe({type:e,buffered:!0,...n}),s}}catch{}},hb=e=>{let t=!1;return()=>{t||(e(),t=!0)}},tp=e=>{Ge.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},sz=[1800,3e3],oz=(e,t={})=>{tp(()=>{const n=$u(),s=Bu("FCP");let i;const c=Zl("paint",f=>{for(const d of f)d.name==="first-contentful-paint"&&(c.disconnect(),d.startTime<n.firstHiddenTime&&(s.value=Math.max(d.startTime-Gl(),0),s.entries.push(d),i(!0)))});c&&(i=Lu(e,s,sz,t.reportAllChanges))})},iz=[.1,.25],az=(e,t={})=>{oz(hb(()=>{const n=Bu("CLS",0);let s;const i=$u(),a=db(t,gh),c=d=>{for(const p of d)a._processEntry(p);a._sessionValue>n.value&&(n.value=a._sessionValue,n.entries=a._sessionEntries,s())},f=Zl("layout-shift",c);f&&(s=Lu(e,n,iz,t.reportAllChanges),i.onHidden(()=>{c(f.takeRecords()),s(!0)}),Ge?.setTimeout?.(s))}))};let h1=0,Zg=1/0,bd=0;const lz=e=>{e.forEach(t=>{t.interactionId&&(Zg=Math.min(Zg,t.interactionId),bd=Math.max(bd,t.interactionId),h1=bd?(bd-Zg)/7+1:0)})};let rv;const p1=()=>rv?h1:performance.interactionCount||0,cz=()=>{"interactionCount"in performance||rv||(rv=Zl("event",lz,{type:"event",buffered:!0,durationThreshold:0}))},Yg=10;let m1=0;const uz=()=>p1()-m1;class yh{constructor(){yh.prototype.__init.call(this),yh.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){m1=p1(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(uz()/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 s=this._longestInteractionMap.get(t.interactionId);if(s||this._longestInteractionList.length<Yg||t.duration>n._latency){if(s?t.duration>s._latency?(s.entries=[t],s._latency=t.duration):t.duration===s._latency&&t.startTime===s.entries[0].startTime&&s.entries.push(t):(s={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(s.id,s),this._longestInteractionList.push(s)),this._longestInteractionList.sort((i,a)=>a._latency-i._latency),this._longestInteractionList.length>Yg){const i=this._longestInteractionList.splice(Yg);for(const a of i)this._longestInteractionMap.delete(a.id)}this._onAfterProcessingINPCandidate?.(s)}}}const g1=e=>{const t=Ge.requestIdleCallback||Ge.setTimeout;Ge.document?.visibilityState==="hidden"?e():(e=hb(e),Vo("visibilitychange",e,{once:!0,capture:!0}),Vo("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),mh("visibilitychange",e,{capture:!0}),mh("pagehide",e,{capture:!0})}))},fz=[200,500],dz=40,hz=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=$u();tp(()=>{cz();const s=Bu("INP");let i;const a=db(t,yh),c=d=>{g1(()=>{for(const g of d)a._processEntry(g);const p=a._estimateP98LongestInteraction();p&&p._latency!==s.value&&(s.value=p._latency,s.entries=p.entries,i())})},f=Zl("event",c,{durationThreshold:t.durationThreshold??dz});i=Lu(e,s,fz,t.reportAllChanges),f&&(f.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{c(f.takeRecords()),i(!0)}))})};class pz{_processEntry(t){this._onBeforeProcessingEntry?.(t)}}const mz=[2500,4e3],gz=(e,t={})=>{tp(()=>{const n=$u(),s=Bu("LCP");let i;const a=db(t,pz),c=d=>{t.reportAllChanges||(d=d.slice(-1));for(const p of d)a._processEntry(p),p.startTime<n.firstHiddenTime&&(s.value=Math.max(p.startTime-Gl(),0),s.entries=[p],i())},f=Zl("largest-contentful-paint",c);if(f){i=Lu(e,s,mz,t.reportAllChanges);const d=hb(()=>{c(f.takeRecords()),f.disconnect(),i(!0)}),p=g=>{g.isTrusted&&(g1(d),mh(g.type,p,{capture:!0}))};for(const g of["keydown","click","visibilitychange"])Vo(g,p,{capture:!0})}})},yz=[800,1800],sv=e=>{Ge.document?.prerendering?tp(()=>sv(e)):Ge.document?.readyState!=="complete"?addEventListener("load",()=>sv(e),!0):setTimeout(e)},vz=(e,t={})=>{const n=Bu("TTFB"),s=Lu(e,n,yz,t.reportAllChanges);sv(()=>{const i=Uu();i&&(n.value=Math.max(i.responseStart-Gl(),0),n.entries=[i],s(!0))})},au={},vh={};let y1,v1,b1,x1;function S1(e,t=!1){return np("cls",e,Sz,y1,t)}function _1(e,t=!1){return np("lcp",e,_z,v1,t)}function bz(e){return np("ttfb",e,wz,b1)}function xz(e){return np("inp",e,Ez,x1)}function Al(e,t){return w1(e,t),vh[e]||(Tz(e),vh[e]=!0),E1(e,t)}function Fu(e,t){const n=au[e];if(n?.length)for(const s of n)try{s(t)}catch(i){zu&&be.error(`Error while triggering instrumentation handler.
|
|
18
|
+
Type: ${e}
|
|
19
|
+
Name: ${Gs(s)}
|
|
20
|
+
Error:`,i)}}function Sz(){return az(e=>{Fu("cls",{metric:e}),y1=e},{reportAllChanges:!0})}function _z(){return gz(e=>{Fu("lcp",{metric:e}),v1=e},{reportAllChanges:!0})}function wz(){return vz(e=>{Fu("ttfb",{metric:e}),b1=e})}function Ez(){return hz(e=>{Fu("inp",{metric:e}),x1=e})}function np(e,t,n,s,i=!1){w1(e,t);let a;return vh[e]||(a=n(),vh[e]=!0),s&&t({metric:s}),E1(e,t,i?a:void 0)}function Tz(e){const t={};e==="event"&&(t.durationThreshold=0),Zl(e,n=>{Fu(e,{entries:n})},t)}function w1(e,t){au[e]=au[e]||[],au[e].push(t)}function E1(e,t,n){return()=>{n&&n();const s=au[e];if(!s)return;const i=s.indexOf(t);i!==-1&&s.splice(i,1)}}function Cz(e){return"duration"in e}const Rz=e=>{const t=n=>{(n.type==="pagehide"||Ge.document?.visibilityState==="hidden")&&e(n)};Vo("visibilitychange",t,{capture:!0,once:!0}),Vo("pagehide",t,{capture:!0,once:!0})};function Xg(e){return typeof e=="number"&&isFinite(e)}function Wo(e,t,n,{...s}){const i=yt(e).start_timestamp;return i&&i>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),Jv(e,()=>{const a=Vl({startTime:t,...s});return a&&a.end(n),a})}function pb(e){const t=vt();if(!t)return;const{name:n,transaction:s,attributes:i,startTime:a}=e,{release:c,environment:f,sendDefaultPii:d}=t.getOptions(),g=t.getIntegrationByName("Replay")?.getReplayId(),y=bt(),b=y.getUser(),x=b!==void 0?b.email||b.id||b.ip_address:void 0;let S;try{S=y.getScopeData().contexts.profile.profile_id}catch{}const w={release:c,environment:f,user:x||void 0,profile_id:S||void 0,replay_id:g||void 0,transaction:s,"user_agent.original":Ge.navigator?.userAgent,"client.address":d?"{{auto}}":void 0,...i};return Vl({name:n,attributes:w,startTime:a,experimental:{standalone:!0}})}function Hu(){return Ge.addEventListener&&Ge.performance}function Gt(e){return e/1e3}function Nz(e){let t="unknown",n="unknown",s="";for(const i of e){if(i==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(i))){t=s==="h"?"http":s,n=e.split(s)[1];break}s+=i}return s===e&&(t=s),{name:t,version:n}}function T1(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function C1(e,t){let n,s=!1;function i(f){!s&&n&&t(f,n),s=!0}Rz(()=>{i("pagehide")});const a=e.on("beforeStartNavigationSpan",(f,d)=>{d?.isRedirect||(i("navigation"),a(),c())}),c=e.on("afterStartPageLoadSpan",f=>{n=f.spanContext().spanId,c()})}function jz(e){let t=0,n;if(!T1("layout-shift"))return;const s=S1(({metric:i})=>{const a=i.entries[i.entries.length-1];a&&(t=i.value,n=a)},!0);C1(e,(i,a)=>{Az(t,n,a,i),s()})}function Az(e,t,n,s){zu&&be.log(`Sending CLS span (${e})`);const i=t?Gt((gr()||0)+t.startTime):sn(),a=bt().getScopeData().transactionName,c=t?$r(t.sources[0]?.node):"Layout shift",f={[hn]:"auto.http.browser.cls",[Qs]:"ui.webvital.cls",[Hl]:0,"sentry.pageload.span_id":n,"sentry.report_event":s};t?.sources&&t.sources.forEach((p,g)=>{f[`cls.source.${g+1}`]=$r(p.node)});const d=pb({name:c,transaction:a,attributes:f,startTime:i});d&&(d.addEvent("cls",{[Iu]:"",[Du]:e}),d.end(i))}function Oz(e){let t=0,n;if(!T1("largest-contentful-paint"))return;const s=_1(({metric:i})=>{const a=i.entries[i.entries.length-1];a&&(t=i.value,n=a)},!0);C1(e,(i,a)=>{Mz(t,n,a,i),s()})}function Mz(e,t,n,s){zu&&be.log(`Sending LCP span (${e})`);const i=Gt((gr()||0)+(t?.startTime||0)),a=bt().getScopeData().transactionName,c=t?$r(t.element):"Largest contentful paint",f={[hn]:"auto.http.browser.lcp",[Qs]:"ui.webvital.lcp",[Hl]:0,"sentry.pageload.span_id":n,"sentry.report_event":s};t&&(t.element&&(f["lcp.element"]=$r(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 d=pb({name:c,transaction:a,attributes:f,startTime:i});d&&(d.addEvent("lcp",{[Iu]:"millisecond",[Du]:e}),d.end(i))}function Or(e){return e&&((gr()||performance.timeOrigin)+e)/1e3}function R1(e){const t={};if(e.nextHopProtocol!=null){const{name:n,version:s}=Nz(e.nextHopProtocol);t["network.protocol.version"]=s,t["network.protocol.name"]=n}return gr()||Hu()?.timeOrigin?kz({...t,"http.request.redirect_start":Or(e.redirectStart),"http.request.redirect_end":Or(e.redirectEnd),"http.request.worker_start":Or(e.workerStart),"http.request.fetch_start":Or(e.fetchStart),"http.request.domain_lookup_start":Or(e.domainLookupStart),"http.request.domain_lookup_end":Or(e.domainLookupEnd),"http.request.connect_start":Or(e.connectStart),"http.request.secure_connection_start":Or(e.secureConnectionStart),"http.request.connection_end":Or(e.connectEnd),"http.request.request_start":Or(e.requestStart),"http.request.response_start":Or(e.responseStart),"http.request.response_end":Or(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function kz(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const Iz=2147483647;let iE=0,Wr={},Fn,bh;function Dz({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const s=Hu();if(s&&gr()){s.mark&&Ge.performance.mark("sentry-tracing-init");const i=t?Oz(n):$z(),a=Bz(),c=e?jz(n):Uz();return()=>{i?.(),a(),c?.()}}return()=>{}}function Pz(){Al("longtask",({entries:e})=>{const t=Kn();if(!t)return;const{op:n,start_timestamp:s}=yt(t);for(const i of e){const a=Gt(gr()+i.startTime),c=Gt(i.duration);n==="navigation"&&s&&a<s||Wo(t,a,a+c,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[hn]:"auto.ui.browser.metrics"}})}})}function zz(){new PerformanceObserver(t=>{const n=Kn();if(n)for(const s of t.getEntries()){if(!s.scripts[0])continue;const i=Gt(gr()+s.startTime),{start_timestamp:a,op:c}=yt(n);if(c==="navigation"&&a&&i<a)continue;const f=Gt(s.duration),d={[hn]:"auto.ui.browser.metrics"},p=s.scripts[0],{invoker:g,invokerType:y,sourceURL:b,sourceFunctionName:x,sourceCharPosition:S}=p;d["browser.script.invoker"]=g,d["browser.script.invoker_type"]=y,b&&(d["code.filepath"]=b),x&&(d["code.function"]=x),S!==-1&&(d["browser.script.source_char_position"]=S),Wo(n,i,i+f,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:d})}}).observe({type:"long-animation-frame",buffered:!0})}function Lz(){Al("event",({entries:e})=>{const t=Kn();if(t){for(const n of e)if(n.name==="click"){const s=Gt(gr()+n.startTime),i=Gt(n.duration),a={name:$r(n.target),op:`ui.interaction.${n.name}`,startTime:s,attributes:{[hn]:"auto.ui.browser.metrics"}},c=cR(n.target);c&&(a.attributes["ui.component_name"]=c),Wo(t,s,s+i,a)}}})}function Uz(){return S1(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Wr.cls={value:e.value,unit:""},bh=t)},!0)}function $z(){return _1(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Wr.lcp={value:e.value,unit:"millisecond"},Fn=t)},!0)}function Bz(){return bz(({metric:e})=>{e.entries[e.entries.length-1]&&(Wr.ttfb={value:e.value,unit:"millisecond"})})}function Fz(e,t){const n=Hu(),s=gr();if(!n?.getEntries||!s)return;const i=Gt(s),a=n.getEntries(),{op:c,start_timestamp:f}=yt(e);a.slice(iE).forEach(d=>{const p=Gt(d.startTime),g=Gt(Math.max(0,d.duration));if(!(c==="navigation"&&f&&i+p<f))switch(d.entryType){case"navigation":{Kz(e,d,i);break}case"mark":case"paint":case"measure":{qz(e,d,p,g,i,t.ignorePerformanceApiSpans);const y=$u(),b=d.startTime<y.firstHiddenTime;d.name==="first-paint"&&b&&(Wr.fp={value:d.startTime,unit:"millisecond"}),d.name==="first-contentful-paint"&&b&&(Wr.fcp={value:d.startTime,unit:"millisecond"});break}case"resource":{Yz(e,d,d.name,p,g,i,t.ignoreResourceSpans);break}}}),iE=Math.max(a.length-1,0),Xz(e),c==="pageload"&&(Jz(Wr),t.recordClsOnPageloadSpan||delete Wr.cls,t.recordLcpOnPageloadSpan||delete Wr.lcp,Object.entries(Wr).forEach(([d,p])=>{pD(d,p.value,p.unit)}),e.setAttribute("performance.timeOrigin",i),e.setAttribute("performance.activationStart",Gl()),Qz(e,t)),Fn=void 0,bh=void 0,Wr={}}function Hz(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function qz(e,t,n,s,i,a){if(Hz(t)||["mark","measure"].includes(t.entryType)&&Ho(t.name,a))return;const c=Uu(!1),f=Gt(c?c.requestStart:0),d=i+Math.max(n,f),p=i+n,g=p+s,y={[hn]:"auto.resource.browser.metrics"};d!==p&&(y["sentry.browser.measure_happened_before_request"]=!0,y["sentry.browser.measure_start_time"]=d),Vz(y,t),d<=g&&Wo(e,d,g,{name:t.name,op:t.entryType,attributes:y})}function Vz(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[s,i]of Object.entries(n))if(i&&wl(i))e[`sentry.browser.measure.detail.${s}`]=i;else if(i!==void 0)try{e[`sentry.browser.measure.detail.${s}`]=JSON.stringify(i)}catch{}return}if(wl(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function Kz(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(s=>{xd(e,t,s,n)}),xd(e,t,"secureConnection",n,"TLS/SSL"),xd(e,t,"fetch",n,"cache"),xd(e,t,"domainLookup",n,"DNS"),Zz(e,t,n)}function xd(e,t,n,s,i=n){const a=Gz(n),c=t[a],f=t[`${n}Start`];!f||!c||Wo(e,s+Gt(f),s+Gt(c),{op:`browser.${i}`,name:t.name,attributes:{[hn]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function Gz(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function Zz(e,t,n){const s=n+Gt(t.requestStart),i=n+Gt(t.responseEnd),a=n+Gt(t.responseStart);t.responseEnd&&(Wo(e,s,i,{op:"browser.request",name:t.name,attributes:{[hn]:"auto.ui.browser.metrics"}}),Wo(e,a,i,{op:"browser.response",name:t.name,attributes:{[hn]:"auto.ui.browser.metrics"}}))}function Yz(e,t,n,s,i,a,c){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const f=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(c?.includes(f))return;const d={[hn]:"auto.resource.browser.metrics"},p=Wi(n);p.protocol&&(d["url.scheme"]=p.protocol.split(":").pop()),p.host&&(d["server.address"]=p.host),d["url.same_origin"]=n.includes(Ge.location.origin),Wz(t,d,[["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 g={...d,...R1(t)},y=a+s,b=y+i;Wo(e,y,b,{name:n.replace(Ge.location.origin,""),op:f,attributes:g})}function Xz(e){const t=Ge.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),Xg(n.rtt)&&(Wr["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Xg(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),Xg(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function Qz(e,t){Fn&&t.recordLcpOnPageloadSpan&&(Fn.element&&e.setAttribute("lcp.element",$r(Fn.element)),Fn.id&&e.setAttribute("lcp.id",Fn.id),Fn.url&&e.setAttribute("lcp.url",Fn.url.trim().slice(0,200)),Fn.loadTime!=null&&e.setAttribute("lcp.loadTime",Fn.loadTime),Fn.renderTime!=null&&e.setAttribute("lcp.renderTime",Fn.renderTime),e.setAttribute("lcp.size",Fn.size)),bh?.sources&&t.recordClsOnPageloadSpan&&bh.sources.forEach((n,s)=>e.setAttribute(`cls.source.${s+1}`,$r(n.node)))}function Wz(e,t,n){n.forEach(([s,i])=>{const a=e[s];a!=null&&(typeof a=="number"&&a<Iz||typeof a=="string")&&(t[i]=a)})}function Jz(e){const t=Uu(!1);if(!t)return;const{responseStart:n,requestStart:s}=t;s<=n&&(e["ttfb.requestTime"]={value:n-s,unit:"millisecond"})}function eL(){return Hu()&&gr()?Al("element",tL):()=>{}}const tL=({entries:e})=>{const t=Kn(),n=t?kn(t):void 0,s=n?yt(n).description:bt().getScopeData().transactionName;e.forEach(i=>{const a=i;if(!a.identifier)return;const c=a.name,f=a.renderTime,d=a.loadTime,[p,g]=d?[Gt(d),"load-time"]:f?[Gt(f),"render-time"]:[sn(),"entry-emission"],y=c==="image-paint"?Gt(Math.max(0,(f??0)-(d??0))):0,b={[hn]:"auto.ui.browser.elementtiming",[Qs]:"ui.elementtiming",[ms]:"component","sentry.span_start_time_source":g,"sentry.transaction_name":s,"element.id":a.id,"element.type":a.element?.tagName?.toLowerCase()||"unknown","element.size":a.naturalWidth&&a.naturalHeight?`${a.naturalWidth}x${a.naturalHeight}`:void 0,"element.render_time":f,"element.load_time":d,"element.url":a.url||void 0,"element.identifier":a.identifier,"element.paint_type":c};IR({name:`element[${a.identifier}]`,attributes:b,startTime:p,onlyIfParent:!0},x=>{x.end(p+y)})})},nL=1e3;let aE,ov,iv;function rL(e){oi("dom",e),ii("dom",sL)}function sL(){if(!Ge.document)return;const e=Lr.bind(null,"dom"),t=lE(e,!0);Ge.document.addEventListener("click",t,!1),Ge.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const i=Ge[n]?.prototype;i?.hasOwnProperty?.("addEventListener")&&(fr(i,"addEventListener",function(a){return function(c,f,d){if(c==="click"||c=="keypress")try{const p=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},g=p[c]=p[c]||{refCount:0};if(!g.handler){const y=lE(e);g.handler=y,a.call(this,c,y,d)}g.refCount++}catch{}return a.call(this,c,f,d)}}),fr(i,"removeEventListener",function(a){return function(c,f,d){if(c==="click"||c=="keypress")try{const p=this.__sentry_instrumentation_handlers__||{},g=p[c];g&&(g.refCount--,g.refCount<=0&&(a.call(this,c,g.handler,d),g.handler=void 0,delete p[c]),Object.keys(p).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,c,f,d)}}))})}function oL(e){if(e.type!==ov)return!1;try{if(!e.target||e.target._sentryId!==iv)return!1}catch{}return!0}function iL(e,t){return e!=="keypress"?!1:t?.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function lE(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const s=aL(n);if(iL(n.type,s))return;Vn(n,"_sentryCaptured",!0),s&&!s._sentryId&&Vn(s,"_sentryId",Ur());const i=n.type==="keypress"?"input":n.type;oL(n)||(e({event:n,name:i,global:t}),ov=n.type,iv=s?s._sentryId:void 0),clearTimeout(aE),aE=Ge.setTimeout(()=>{iv=void 0,ov=void 0},nL)}}function aL(e){try{return e.target}catch{return null}}let Sd;function mb(e){const t="history";oi(t,e),ii(t,lL)}function lL(){if(Ge.addEventListener("popstate",()=>{const t=Ge.location.href,n=Sd;if(Sd=t,n===t)return;Lr("history",{from:n,to:t})}),!RP())return;function e(t){return function(...n){const s=n.length>2?n[2]:void 0;if(s){const i=Sd,a=cL(String(s));if(Sd=a,i===a)return t.apply(this,n);Lr("history",{from:i,to:a})}return t.apply(this,n)}}fr(Ge.history,"pushState",e),fr(Ge.history,"replaceState",e)}function cL(e){try{return new URL(e,Ge.location.origin).toString()}catch{return e}}const Wd={};function uL(e){const t=Wd[e];if(t)return t;let n=Ge[e];if(ev(n))return Wd[e]=n.bind(Ge);const s=Ge.document;if(s&&typeof s.createElement=="function")try{const i=s.createElement("iframe");i.hidden=!0,s.head.appendChild(i);const a=i.contentWindow;a?.[e]&&(n=a[e]),s.head.removeChild(i)}catch(i){zu&&be.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,i)}return n&&(Wd[e]=n.bind(Ge))}function fL(e){Wd[e]=void 0}const ll="__sentry_xhr_v3__";function N1(e){oi("xhr",e),ii("xhr",dL)}function dL(){if(!Ge.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,s){const i=new Error,a=sn()*1e3,c=qs(s[0])?s[0].toUpperCase():void 0,f=hL(s[1]);if(!c||!f)return t.apply(n,s);n[ll]={method:c,url:f,request_headers:{}},c==="POST"&&f.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const d=()=>{const p=n[ll];if(p&&n.readyState===4){try{p.status_code=n.status}catch{}const g={endTimestamp:sn()*1e3,startTimestamp:a,xhr:n,virtualError:i};Lr("xhr",g)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(p,g,y){return d(),p.apply(g,y)}}):n.addEventListener("readystatechange",d),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(p,g,y){const[b,x]=y,S=g[ll];return S&&qs(b)&&qs(x)&&(S.request_headers[b.toLowerCase()]=x),p.apply(g,y)}}),t.apply(n,s)}}),e.send=new Proxy(e.send,{apply(t,n,s){const i=n[ll];if(!i)return t.apply(n,s);s[0]!==void 0&&(i.body=s[0]);const a={startTimestamp:sn()*1e3,xhr:n};return Lr("xhr",a),t.apply(n,s)}})}function hL(e){if(qs(e))return e;try{return e.toString()}catch{}}function pL(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return zu&&be.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
|
|
21
|
+
`).reduce((n,s)=>{const[i,a]=s.split(": ");return a&&(n[i.toLowerCase()]=a),n},{}):{}}const Qg=[],Jd=new Map,ol=new Map,mL=60;function gL(){if(Hu()&&gr()){const t=yL();return()=>{t()}}return()=>{}}const av={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 yL(){return xz(vL)}const vL=({metric:e})=>{if(e.value==null)return;const t=Gt(e.value);if(t>mL)return;const n=e.entries.find(S=>S.duration===e.value&&av[S.name]);if(!n)return;const{interactionId:s}=n,i=av[n.name],a=Gt(gr()+n.startTime),c=Kn(),f=c?kn(c):void 0,d=s!=null?Jd.get(s):void 0,p=d?.span||f,g=p?yt(p).description:bt().getScopeData().transactionName,y=d?.elementName||$r(n.target),b={[hn]:"auto.http.browser.inp",[Qs]:`ui.interaction.${i}`,[Hl]:n.duration},x=pb({name:y,transaction:g,attributes:b,startTime:a});x&&(x.addEvent("inp",{[Iu]:"millisecond",[Du]:e.value}),x.end(a+t))};function bL(){const e=Object.keys(av);LP()&&e.forEach(i=>{Ge.addEventListener(i,t,{capture:!0,passive:!0})});function t(i){const a=i.target;if(!a)return;const c=$r(a),f=Math.round(i.timeStamp);if(ol.set(f,c),ol.size>50){const d=ol.keys().next().value;d!==void 0&&ol.delete(d)}}function n(i){const a=Math.round(i.startTime);let c=ol.get(a);if(!c)for(let f=-5;f<=5;f++){const d=ol.get(a+f);if(d){c=d;break}}return c||"<unknown>"}const s=({entries:i})=>{const a=Kn(),c=a&&kn(a);i.forEach(f=>{if(!Cz(f))return;const d=f.interactionId;if(d==null||Jd.has(d))return;const p=f.target?$r(f.target):n(f);if(Qg.length>10){const g=Qg.shift();Jd.delete(g)}Qg.push(d),Jd.set(d,{span:c,elementName:p})})};Al("event",s),Al("first-input",s)}const xL=40;function SL(e,t=uL("fetch")){let n=0,s=0;async function i(a){const c=a.body.length;n+=c,s++;const f={body:a.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&s<15,...e.fetchOptions};try{const d=await t(e.url,f);return{statusCode:d.status,headers:{"x-sentry-rate-limits":d.headers.get("X-Sentry-Rate-Limits"),"retry-after":d.headers.get("Retry-After")}}}catch(d){throw fL("fetch"),d}finally{n-=c,s--}}return b2(e,i,ib(e.bufferSize||xL))}const Br=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,_L=30,wL=50;function lv(e,t,n,s){const i={filename:e,function:t==="<anonymous>"?ta:t,in_app:!0};return n!==void 0&&(i.lineno=n),s!==void 0&&(i.colno=s),i}const EL=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,TL=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,CL=/\((\S*)(?::(\d+))(?::(\d+))\)/,RL=/at (.+?) ?\(data:(.+?),/,NL=e=>{const t=e.match(RL);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=EL.exec(e);if(n){const[,i,a,c]=n;return lv(i,ta,+a,+c)}const s=TL.exec(e);if(s){if(s[2]&&s[2].indexOf("eval")===0){const f=CL.exec(s[2]);f&&(s[2]=f[1],s[3]=f[2],s[4]=f[3])}const[a,c]=j1(s[1]||ta,s[2]);return lv(c,a,s[3]?+s[3]:void 0,s[4]?+s[4]:void 0)}},jL=[_L,NL],AL=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,OL=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,ML=e=>{const t=AL.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const a=OL.exec(t[3]);a&&(t[1]=t[1]||"eval",t[3]=a[1],t[4]=a[2],t[5]="")}let s=t[3],i=t[1]||ta;return[i,s]=j1(i,s),lv(s,i,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},kL=[wL,ML],IL=[jL,kL],DL=nR(...IL),j1=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,s=e.indexOf("safari-web-extension")!==-1;return n||s?[e.indexOf("@")!==-1?e.split("@")[0]:ta,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},_d=1024,PL="Breadcrumbs",zL=((e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:PL,setup(n){t.console&&nP(BL(n)),t.dom&&rL($L(n,t.dom)),t.xhr&&N1(FL(n)),t.fetch&&l1(HL(n)),t.history&&mb(qL(n)),t.sentry&&n.on("beforeSendEvent",UL(n))}}}),LL=zL;function UL(e){return function(n){vt()===e&&na({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Hi(n)},{event:n})}}function $L(e,t){return function(s){if(vt()!==e)return;let i,a,c=typeof t=="object"?t.serializeAttribute:void 0,f=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;f&&f>_d&&(Br&&be.warn(`\`dom.maxStringLength\` cannot exceed ${_d}, but a value of ${f} was configured. Sentry will use ${_d} instead.`),f=_d),typeof c=="string"&&(c=[c]);try{const p=s.event,g=VL(p)?p.target:p;i=$r(g,{keyAttrs:c,maxStringLength:f}),a=cR(g)}catch{i="<unknown>"}if(i.length===0)return;const d={category:`ui.${s.name}`,message:i};a&&(d.data={"ui.component_name":a}),na(d,{event:s.event,name:s.name,global:s.global})}}function BL(e){return function(n){if(vt()!==e)return;const s={category:"console",data:{arguments:n.args,logger:"console"},level:sP(n.level),message:yw(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)s.message=`Assertion failed: ${yw(n.args.slice(1)," ")||"console.assert"}`,s.data.arguments=n.args.slice(1);else return;na(s,{input:n.args,level:n.level})}}function FL(e){return function(n){if(vt()!==e)return;const{startTimestamp:s,endTimestamp:i}=n,a=n.xhr[ll];if(!s||!i||!a)return;const{method:c,url:f,status_code:d,body:p}=a,g={method:c,url:f,status_code:d},y={xhr:n.xhr,input:p,startTimestamp:s,endTimestamp:i},b={category:"xhr",data:g,type:"http",level:a1(d)};e.emit("beforeOutgoingRequestBreadcrumb",b,y),na(b,y)}}function HL(e){return function(n){if(vt()!==e)return;const{startTimestamp:s,endTimestamp:i}=n;if(i&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.fetchData.method,n.fetchData.url,n.error){const a=n.fetchData,c={data:n.error,input:n.args,startTimestamp:s,endTimestamp:i},f={category:"fetch",data:a,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",f,c),na(f,c)}else{const a=n.response,c={...n.fetchData,status_code:a?.status};n.fetchData.request_body_size,n.fetchData.response_body_size,a?.status;const f={input:n.args,response:a,startTimestamp:s,endTimestamp:i},d={category:"fetch",data:c,type:"http",level:a1(c.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",d,f),na(d,f)}}}function qL(e){return function(n){if(vt()!==e)return;let s=n.from,i=n.to;const a=Wi(st.location.href);let c=s?Wi(s):void 0;const f=Wi(i);c?.path||(c=a),a.protocol===f.protocol&&a.host===f.host&&(i=f.relative),a.protocol===c.protocol&&a.host===c.host&&(s=c.relative),na({category:"navigation",data:{from:s,to:i}})}}function VL(e){return!!e&&!!e.target}const KL=["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"],GL="BrowserApiErrors",ZL=((e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:GL,setupOnce(){t.setTimeout&&fr(st,"setTimeout",cE),t.setInterval&&fr(st,"setInterval",cE),t.requestAnimationFrame&&fr(st,"requestAnimationFrame",XL),t.XMLHttpRequest&&"XMLHttpRequest"in st&&fr(XMLHttpRequest.prototype,"send",QL);const n=t.eventTarget;n&&(Array.isArray(n)?n:KL).forEach(i=>WL(i,t))}}}),YL=ZL;function cE(e){return function(...t){const n=t[0];return t[0]=jl(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${Gs(e)}`}}),e.apply(this,t)}}function XL(e){return function(t){return e.apply(this,[jl(t,{mechanism:{data:{handler:Gs(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function QL(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&fr(n,i,function(a){const c={mechanism:{data:{handler:Gs(a)},handled:!1,type:`auto.browser.browserapierrors.xhr.${i}`}},f=Vv(a);return f&&(c.mechanism.data.handler=Gs(f)),jl(a,c)})}),e.apply(this,t)}}function WL(e,t){const s=st[e]?.prototype;s?.hasOwnProperty?.("addEventListener")&&(fr(s,"addEventListener",function(i){return function(a,c,f){try{JL(c)&&(c.handleEvent=jl(c.handleEvent,{mechanism:{data:{handler:Gs(c),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&e4(this,a,c),i.apply(this,[a,jl(c,{mechanism:{data:{handler:Gs(c),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),f])}}),fr(s,"removeEventListener",function(i){return function(a,c,f){try{const d=c.__sentry_wrapped__;d&&i.call(this,a,d,f)}catch{}return i.call(this,a,c,f)}}))}function JL(e){return typeof e.handleEvent=="function"}function e4(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const t4=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof st.document>"u"){Br&&be.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Lw({ignoreDuration:!0}),qg();const n=Hr();let s=n.getUser();n.addScopeListener(i=>{const a=i.getUser();(s?.id!==a?.id||s?.ip_address!==a?.ip_address)&&(qg(),s=a)}),t==="route"&&mb(({from:i,to:a})=>{i!==a&&(Lw({ignoreDuration:!0}),qg())})}}},n4="CultureContext",r4=(()=>({name:n4,preprocessEvent(e){const t=o4();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})}})),s4=r4;function o4(){try{const e=st.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const i4="GlobalHandlers",a4=((e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:i4,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(c4(n),uE("onerror")),t.onunhandledrejection&&(u4(n),uE("onunhandledrejection"))}}}),l4=a4;function c4(e){sR(t=>{const{stackParser:n,attachStacktrace:s}=A1();if(vt()!==e||u1())return;const{msg:i,url:a,line:c,column:f,error:d}=t,p=h4(fb(n,d||i,void 0,s,!1),a,c,f);p.level="error",$R(p,{originalException:d,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function u4(e){oR(t=>{const{stackParser:n,attachStacktrace:s}=A1();if(vt()!==e||u1())return;const i=f4(t),a=wl(i)?d4(i):fb(n,i,void 0,s,!0);a.level="error",$R(a,{originalException:i,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function f4(e){if(wl(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 d4(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function h4(e,t,n,s){const i=e.exception=e.exception||{},a=i.values=i.values||[],c=a[0]=a[0]||{},f=c.stacktrace=c.stacktrace||{},d=f.frames=f.frames||[],p=s,g=n,y=p4(t)??ju();return d.length===0&&d.push({colno:p,filename:y,function:ta,in_app:!0,lineno:g}),e}function uE(e){Br&&be.log(`Global Handler attached: ${e}`)}function A1(){return vt()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function p4(e){if(!(!qs(e)||e.length===0))return e.startsWith("data:")?`<${qo(e,!1)}>`:e}const m4=()=>({name:"HttpContext",preprocessEvent(e){if(!st.navigator&&!st.location&&!st.document)return;const t=lb(),n={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:n}}}),g4="cause",y4=5,v4="LinkedErrors",b4=((e={})=>{const t=e.limit||y4,n=e.key||g4;return{name:v4,preprocessEvent(s,i,a){const c=a.getOptions();tP(cb,c.stackParser,n,t,s,i)}}}),x4=b4;function S4(){return _4()?(Br&&ua(()=>{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 _4(){if(typeof st.window>"u")return!1;const e=st;if(e.nw||!(e.chrome||e.browser)?.runtime?.id)return!1;const n=ju(),s=["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"];return!(st===st.top&&s.some(a=>n.startsWith(`${a}://`)))}function w4(e){return[G2(),H2(),hP(),YL(),LL(),l4(),x4(),aP(),m4(),s4(),t4()]}function E4(e={}){const t=!e.skipBrowserExtensionCheck&&S4();let n=e.defaultIntegrations==null?w4():e.defaultIntegrations;const s={...e,enabled:t?!1:e.enabled,stackParser:qk(e.stackParser||DL),integrations:XD({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||SL};return A2(WP,s)}function T4(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function O1(e){try{return new URL(e,st.location.origin).href}catch{return}}function C4(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function M1(e){try{return new Headers(e)}catch{return}}const fE=new WeakMap,Wg=new Map,k1={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function R4(e,t){const{traceFetch:n,traceXHR:s,trackFetchStreamPerformance:i,shouldCreateSpanForRequest:a,enableHTTPTimings:c,tracePropagationTargets:f,onRequestSpanStart:d,onRequestSpanEnd:p}={...k1,...t},g=typeof a=="function"?a:S=>!0,y=S=>N4(S,f),b={},x=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(S=>(S.type==="transaction"&&S.spans&&S.spans.forEach(w=>{if(w.op==="http.client"){const T=Wg.get(w.span_id);T&&(w.timestamp=T/1e3,Wg.delete(w.span_id))}}),S)),i&&AP(S=>{if(S.response){const w=fE.get(S.response);w&&S.endTimestamp&&Wg.set(w,S.endTimestamp)}}),l1(S=>{const w=pP(S,g,y,b,{propagateTraceparent:x,onRequestSpanEnd:p});if(S.response&&S.fetchData.__span&&fE.set(S.response,S.fetchData.__span),w){const T=O1(S.fetchData.url),C=T?Wi(T).host:void 0;w.setAttributes({"http.url":T?qo(T):void 0,"server.address":C}),c&&dE(w),d?.(w,{headers:S.headers})}})),s&&N1(S=>{const w=j4(S,g,y,b,x,p);w&&(c&&dE(w),d?.(w,{headers:M1(S.xhr.__sentry_xhr_v3__?.request_headers)}))})}function dE(e){const{url:t}=yt(e).data;if(!t||typeof t!="string")return;const n=Al("resource",({entries:s})=>{s.forEach(i=>{C4(i)&&i.name.endsWith(t)&&(e.setAttributes(R1(i)),setTimeout(n))})})}function N4(e,t){const n=ju();if(n){let s,i;try{s=new URL(e,n),i=new URL(n).origin}catch{return!1}const a=s.origin===i;return t?Ho(s.toString(),t)||a&&Ho(s.pathname,t):a}else{const s=!!e.match(/^\/(?!\/)/);return t?Ho(e,t):s}}function j4(e,t,n,s,i,a){const c=e.xhr,f=c?.[ll];if(!c||c.__sentry_own_request__||!f)return;const{url:d,method:p}=f,g=es()&&t(d);if(e.endTimestamp){const C=c.__sentry_xhr_span_id__;if(!C)return;const A=s[C];A&&(g&&f.status_code!==void 0&&(gR(A,f.status_code),A.end(),a?.(A,{headers:M1(pL(c)),error:e.error})),delete s[C]);return}const y=O1(d),b=Wi(y||d),x=qo(I2(d)),S=!!Kn(),w=g&&S?Vl({name:`${p} ${x}`,attributes:{url:qo(d),type:"xhr","http.method":p,"http.url":y?qo(y):void 0,"server.address":b?.host,[hn]:"auto.http.browser",[Qs]:"http.client",...b?.search&&{"http.query":b?.search},...b?.hash&&{"http.fragment":b?.hash}}}):new Qo;c.__sentry_xhr_span_id__=w.spanContext().spanId,s[c.__sentry_xhr_span_id__]=w,n(d)&&A4(c,es()&&S?w:void 0,i);const T=vt();return T&&T.emit("beforeOutgoingRequestSpan",w,e),w}function A4(e,t,n){const{"sentry-trace":s,baggage:i,traceparent:a}=r1({span:t,propagateTraceparent:n});s&&O4(e,s,i,a)}function O4(e,t,n,s){const i=e.__sentry_xhr_v3__?.request_headers;if(!(i?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),s&&!i?.traceparent&&e.setRequestHeader("traceparent",s),n){const a=i?.baggage;(!a||!T4(a))&&e.setRequestHeader("baggage",n)}}catch{}}function M4(){st.document?st.document.addEventListener("visibilitychange",()=>{const e=Kn();if(!e)return;const t=kn(e);if(st.document.hidden&&t){const n="cancelled",{op:s,status:i}=yt(t);Br&&be.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${s}`),i||t.setStatus({code:un,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Br&&be.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const k4=3600,I1="sentry_previous_trace",I4="sentry.previous_trace";function D4(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const s=t==="session-storage";let i=s?L4():void 0;e.on("spanStart",c=>{if(kn(c)!==c)return;const f=bt().getPropagationContext();i=P4(i,c,f),s&&z4(i)});let a=!0;n&&e.on("beforeSampling",c=>{if(!i)return;const f=bt(),d=f.getPropagationContext();if(a&&d.parentSpanId){a=!1;return}f.setPropagationContext({...d,dsc:{...d.dsc,sample_rate:String(i.sampleRate),sampled:String(cv(i.spanContext))},sampleRand:i.sampleRand}),c.parentSampled=cv(i.spanContext),c.parentSampleRate=i.sampleRate,c.spanAttributes={...c.spanAttributes,[mR]:i.sampleRate}})}function P4(e,t,n){const s=yt(t);function i(){try{return Number(n.dsc?.sample_rate)??Number(s.data?.[Kv])}catch{return 0}}const a={spanContext:t.spanContext(),startTimestamp:s.start_timestamp,sampleRate:i(),sampleRand:n.sampleRand};if(!e)return a;const c=e.spanContext;return c.traceId===s.trace_id?e:(Date.now()/1e3-e.startTimestamp<=k4&&(Br&&be.log(`Adding previous_trace \`${JSON.stringify(c)}\` link to span \`${JSON.stringify({op:s.op,...t.spanContext()})}\``),t.addLink({context:c,attributes:{[yI]:"previous_trace"}}),t.setAttribute(I4,`${c.traceId}-${c.spanId}-${cv(c)?1:0}`)),a)}function z4(e){try{st.sessionStorage.setItem(I1,JSON.stringify(e))}catch(t){Br&&be.warn("Could not store previous trace in sessionStorage",t)}}function L4(){try{const e=st.sessionStorage?.getItem(I1);return JSON.parse(e)}catch{return}}function cv(e){return e.traceFlags===1}const U4="BrowserTracing",$4={...Zd,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:{},...k1},B4=((e={})=>{const t={name:void 0,source:void 0},n=st.document,{enableInp:s,enableElementTiming:i,enableLongTask:a,enableLongAnimationFrame:c,_experiments:{enableInteractions:f,enableStandaloneClsSpans:d,enableStandaloneLcpSpans:p},beforeStartSpan:g,idleTimeout:y,finalTimeout:b,childSpanTimeout:x,markBackgroundSpan:S,traceFetch:w,traceXHR:T,trackFetchStreamPerformance:C,shouldCreateSpanForRequest:A,enableHTTPTimings:N,ignoreResourceSpans:R,ignorePerformanceApiSpans:k,instrumentPageLoad:L,instrumentNavigation:j,detectRedirects:O,linkPreviousTrace:D,consistentTraceSampling:K,enableReportPageLoaded:F,onRequestSpanStart:z,onRequestSpanEnd:X}={...$4,...e};let Y,te,P;function V(B,q,U=!0){const I=q.op==="pageload",G=q.name,W=g?g(q):q,Q=W.attributes||{};if(G!==W.name&&(Q[ms]="custom",W.attributes=Q),!U){const pe=fa();Vl({...W,startTime:pe}).end(pe);return}t.name=W.name,t.source=Q[ms];const se=LR(W,{idleTimeout:y,finalTimeout:b,childSpanTimeout:x,disableAutoFinish:I,beforeSpanEnd:pe=>{Y?.(),Fz(pe,{recordClsOnPageloadSpan:!d,recordLcpOnPageloadSpan:!p,ignoreResourceSpans:R,ignorePerformanceApiSpans:k}),mE(B,void 0);const Se=bt(),he=Se.getPropagationContext();Se.setPropagationContext({...he,traceId:se.spanContext().traceId,sampled:ai(se),dsc:Ws(pe)}),I&&(P=void 0)},trimIdleSpanEndTimestamp:!F});I&&F&&(P=se),mE(B,se);function oe(){n&&["interactive","complete"].includes(n.readyState)&&B.emit("idleSpanEnableAutoFinish",se)}I&&!F&&n&&(n.addEventListener("readystatechange",()=>{oe()}),oe())}return{name:U4,setup(B){if(KI(),Y=Dz({recordClsStandaloneSpans:d||!1,recordLcpStandaloneSpans:p||!1,client:B}),s&&gL(),i&&eL(),c&<.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?zz():a&&Pz(),f&&Lz(),O&&n){const U=()=>{te=sn()};addEventListener("click",U,{capture:!0}),addEventListener("keydown",U,{capture:!0,passive:!0})}function q(){const U=bu(B);U&&!yt(U).timestamp&&(Br&&be.log(`[Tracing] Finishing current active span with op: ${yt(U).op}`),U.setAttribute(mu,"cancelled"),U.end())}B.on("startNavigationSpan",(U,I)=>{if(vt()!==B)return;if(I?.isRedirect){Br&&be.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),V(B,{op:"navigation.redirect",...U},!1);return}te=void 0,q(),Hr().setPropagationContext({traceId:Ys(),sampleRand:Math.random(),propagationSpanId:es()?void 0:Vs()});const G=bt();G.setPropagationContext({traceId:Ys(),sampleRand:Math.random(),propagationSpanId:es()?void 0:Vs()}),G.setSDKProcessingMetadata({normalizedRequest:void 0}),V(B,{op:"navigation",...U,parentSpan:null,forceTransaction:!0})}),B.on("startPageLoadSpan",(U,I={})=>{if(vt()!==B)return;q();const G=I.sentryTrace||hE("sentry-trace")||pE("sentry-trace"),W=I.baggage||hE("baggage")||pE("baggage"),Q=LI(G,W),se=bt();se.setPropagationContext(Q),es()||(se.getPropagationContext().propagationSpanId=Vs()),se.setSDKProcessingMetadata({normalizedRequest:lb()}),V(B,{op:"pageload",...U})}),B.on("endPageloadSpan",()=>{F&&P&&(P.setAttribute(mu,"reportPageLoaded"),P.end())})},afterAllSetup(B){let q=ju();if(D!=="off"&&D4(B,{linkPreviousTrace:D,consistentTraceSampling:K}),st.location){if(L){const U=gr();F4(B,{name:st.location.pathname,startTime:U?U/1e3:void 0,attributes:{[ms]:"url",[hn]:"auto.pageload.browser"}})}j&&mb(({to:U,from:I})=>{if(I===void 0&&q?.indexOf(U)!==-1){q=void 0;return}q=void 0;const G=t1(U),W=bu(B),Q=W&&O&&V4(W,te);H4(B,{name:G?.pathname||st.location.pathname,attributes:{[ms]:"url",[hn]:"auto.navigation.browser"}},{url:U,isRedirect:Q})})}S&&M4(),f&&q4(B,y,b,x,t),s&&bL(),R4(B,{traceFetch:w,traceXHR:T,trackFetchStreamPerformance:C,tracePropagationTargets:B.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:A,enableHTTPTimings:N,onRequestSpanStart:z,onRequestSpanEnd:X})}}});function F4(e,t,n){e.emit("startPageLoadSpan",t,n),bt().setTransactionName(t.name);const s=bu(e);return s&&e.emit("afterStartPageLoadSpan",s),s}function H4(e,t,n){const{url:s,isRedirect:i}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:i}),e.emit("startNavigationSpan",t,{isRedirect:i});const a=bt();return a.setTransactionName(t.name),s&&!i&&a.setSDKProcessingMetadata({normalizedRequest:{...lb(),url:s}}),bu(e)}function hE(e){return st.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function pE(e){return st.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(s=>s.name===e)?.description}function q4(e,t,n,s,i){const a=st.document;let c;const f=()=>{const d="ui.action.click",p=bu(e);if(p){const g=yt(p).op;if(["navigation","pageload"].includes(g)){Br&&be.warn(`[Tracing] Did not create ${d} span because a pageload or navigation span is in progress.`);return}}if(c&&(c.setAttribute(mu,"interactionInterrupted"),c.end(),c=void 0),!i.name){Br&&be.warn(`[Tracing] Did not create ${d} transaction because _latestRouteName is missing.`);return}c=LR({name:i.name,op:d,attributes:{[ms]:i.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:s})};a&&addEventListener("click",f,{capture:!0})}const D1="_sentry_idleSpan";function bu(e){return e[D1]}function mE(e,t){Vn(e,D1,t)}const gE=1.5;function V4(e,t){const n=yt(e),s=fa(),i=n.start_timestamp;return!(s-i>gE||t&&s-t<=gE)}function P1(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Jg={exports:{}},Ke={};var yE;function K4(){if(yE)return Ke;yE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=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 S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,T={};function C(I,G,W){this.props=I,this.context=G,this.refs=T,this.updater=W||S}C.prototype.isReactComponent={},C.prototype.setState=function(I,G){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,G,"setState")},C.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function A(){}A.prototype=C.prototype;function N(I,G,W){this.props=I,this.context=G,this.refs=T,this.updater=W||S}var R=N.prototype=new A;R.constructor=N,w(R,C.prototype),R.isPureReactComponent=!0;var k=Array.isArray;function L(){}var j={H:null,A:null,T:null,S:null},O=Object.prototype.hasOwnProperty;function D(I,G,W){var Q=W.ref;return{$$typeof:e,type:I,key:G,ref:Q!==void 0?Q:null,props:W}}function K(I,G){return D(I.type,G,I.props)}function F(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function z(I){var G={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(W){return G[W]})}var X=/\/+/g;function Y(I,G){return typeof I=="object"&&I!==null&&I.key!=null?z(""+I.key):G.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(L,L):(I.status="pending",I.then(function(G){I.status==="pending"&&(I.status="fulfilled",I.value=G)},function(G){I.status==="pending"&&(I.status="rejected",I.reason=G)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function P(I,G,W,Q,se){var oe=typeof I;(oe==="undefined"||oe==="boolean")&&(I=null);var pe=!1;if(I===null)pe=!0;else switch(oe){case"bigint":case"string":case"number":pe=!0;break;case"object":switch(I.$$typeof){case e:case t:pe=!0;break;case g:return pe=I._init,P(pe(I._payload),G,W,Q,se)}}if(pe)return se=se(I),pe=Q===""?"."+Y(I,0):Q,k(se)?(W="",pe!=null&&(W=pe.replace(X,"$&/")+"/"),P(se,G,W,"",function(He){return He})):se!=null&&(F(se)&&(se=K(se,W+(se.key==null||I&&I.key===se.key?"":(""+se.key).replace(X,"$&/")+"/")+pe)),G.push(se)),1;pe=0;var Se=Q===""?".":Q+":";if(k(I))for(var he=0;he<I.length;he++)Q=I[he],oe=Se+Y(Q,he),pe+=P(Q,G,W,oe,se);else if(he=x(I),typeof he=="function")for(I=he.call(I),he=0;!(Q=I.next()).done;)Q=Q.value,oe=Se+Y(Q,he++),pe+=P(Q,G,W,oe,se);else if(oe==="object"){if(typeof I.then=="function")return P(te(I),G,W,Q,se);throw G=String(I),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return pe}function V(I,G,W){if(I==null)return I;var Q=[],se=0;return P(I,Q,"","",function(oe){return G.call(W,oe,se++)}),Q}function B(I){if(I._status===-1){var G=I._result;G=G(),G.then(function(W){(I._status===0||I._status===-1)&&(I._status=1,I._result=W)},function(W){(I._status===0||I._status===-1)&&(I._status=2,I._result=W)}),I._status===-1&&(I._status=0,I._result=G)}if(I._status===1)return I._result.default;throw I._result}var q=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=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(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},U={map:V,forEach:function(I,G,W){V(I,function(){G.apply(this,arguments)},W)},count:function(I){var G=0;return V(I,function(){G++}),G},toArray:function(I){return V(I,function(G){return G})||[]},only:function(I){if(!F(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return Ke.Activity=y,Ke.Children=U,Ke.Component=C,Ke.Fragment=n,Ke.Profiler=i,Ke.PureComponent=N,Ke.StrictMode=s,Ke.Suspense=d,Ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Ke.__COMPILER_RUNTIME={__proto__:null,c:function(I){return j.H.useMemoCache(I)}},Ke.cache=function(I){return function(){return I.apply(null,arguments)}},Ke.cacheSignal=function(){return null},Ke.cloneElement=function(I,G,W){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var Q=w({},I.props),se=I.key;if(G!=null)for(oe in G.key!==void 0&&(se=""+G.key),G)!O.call(G,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&G.ref===void 0||(Q[oe]=G[oe]);var oe=arguments.length-2;if(oe===1)Q.children=W;else if(1<oe){for(var pe=Array(oe),Se=0;Se<oe;Se++)pe[Se]=arguments[Se+2];Q.children=pe}return D(I.type,se,Q)},Ke.createContext=function(I){return I={$$typeof:c,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:a,_context:I},I},Ke.createElement=function(I,G,W){var Q,se={},oe=null;if(G!=null)for(Q in G.key!==void 0&&(oe=""+G.key),G)O.call(G,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(se[Q]=G[Q]);var pe=arguments.length-2;if(pe===1)se.children=W;else if(1<pe){for(var Se=Array(pe),he=0;he<pe;he++)Se[he]=arguments[he+2];se.children=Se}if(I&&I.defaultProps)for(Q in pe=I.defaultProps,pe)se[Q]===void 0&&(se[Q]=pe[Q]);return D(I,oe,se)},Ke.createRef=function(){return{current:null}},Ke.forwardRef=function(I){return{$$typeof:f,render:I}},Ke.isValidElement=F,Ke.lazy=function(I){return{$$typeof:g,_payload:{_status:-1,_result:I},_init:B}},Ke.memo=function(I,G){return{$$typeof:p,type:I,compare:G===void 0?null:G}},Ke.startTransition=function(I){var G=j.T,W={};j.T=W;try{var Q=I(),se=j.S;se!==null&&se(W,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(L,q)}catch(oe){q(oe)}finally{G!==null&&W.types!==null&&(G.types=W.types),j.T=G}},Ke.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},Ke.use=function(I){return j.H.use(I)},Ke.useActionState=function(I,G,W){return j.H.useActionState(I,G,W)},Ke.useCallback=function(I,G){return j.H.useCallback(I,G)},Ke.useContext=function(I){return j.H.useContext(I)},Ke.useDebugValue=function(){},Ke.useDeferredValue=function(I,G){return j.H.useDeferredValue(I,G)},Ke.useEffect=function(I,G){return j.H.useEffect(I,G)},Ke.useEffectEvent=function(I){return j.H.useEffectEvent(I)},Ke.useId=function(){return j.H.useId()},Ke.useImperativeHandle=function(I,G,W){return j.H.useImperativeHandle(I,G,W)},Ke.useInsertionEffect=function(I,G){return j.H.useInsertionEffect(I,G)},Ke.useLayoutEffect=function(I,G){return j.H.useLayoutEffect(I,G)},Ke.useMemo=function(I,G){return j.H.useMemo(I,G)},Ke.useOptimistic=function(I,G){return j.H.useOptimistic(I,G)},Ke.useReducer=function(I,G,W){return j.H.useReducer(I,G,W)},Ke.useRef=function(I){return j.H.useRef(I)},Ke.useState=function(I){return j.H.useState(I)},Ke.useSyncExternalStore=function(I,G,W){return j.H.useSyncExternalStore(I,G,W)},Ke.useTransition=function(){return j.H.useTransition()},Ke.version="19.2.4",Ke}var vE;function qu(){return vE||(vE=1,Jg.exports=K4()),Jg.exports}var _=qu();const Ol=P1(_),z1=Pk({__proto__:null,default:Ol},[_]);function G4(e){const t={...e};return n1(t,"react"),FD("react",{version:_.version}),E4(t)}function ue(e,t,n){function s(f,d){if(f._zod||Object.defineProperty(f,"_zod",{value:{def:d,constr:c,traits:new Set},enumerable:!1}),f._zod.traits.has(e))return;f._zod.traits.add(e),t(f,d);const p=c.prototype,g=Object.keys(p);for(let y=0;y<g.length;y++){const b=g[y];b in f||(f[b]=p[b].bind(f))}}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function c(f){var d;const p=n?.Parent?new a:this;s(p,f),(d=p._zod).deferred??(d.deferred=[]);for(const g of p._zod.deferred)g();return p}return Object.defineProperty(c,"init",{value:s}),Object.defineProperty(c,Symbol.hasInstance,{value:f=>n?.Parent&&f instanceof n.Parent?!0:f?._zod?.traits?.has(e)}),Object.defineProperty(c,"name",{value:e}),c}class pl extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class L1 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const U1={};function Jo(e){return U1}function $1(e){const t=Object.values(e).filter(s=>typeof s=="number");return Object.entries(e).filter(([s,i])=>t.indexOf(+s)===-1).map(([s,i])=>i)}function uv(e,t){return typeof t=="bigint"?t.toString():t}function gb(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function yb(e){return e==null}function vb(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Z4(e,t){const n=(e.toString().split(".")[1]||"").length,s=t.toString();let i=(s.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(s)){const d=s.match(/\d?e-(\d?)/);d?.[1]&&(i=Number.parseInt(d[1]))}const a=n>i?n:i,c=Number.parseInt(e.toFixed(a).replace(".","")),f=Number.parseInt(t.toFixed(a).replace(".",""));return c%f/10**a}const bE=Symbol("evaluating");function wt(e,t,n){let s;Object.defineProperty(e,t,{get(){if(s!==bE)return s===void 0&&(s=bE,s=n()),s},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function ha(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function li(...e){const t={};for(const n of e){const s=Object.getOwnPropertyDescriptors(n);Object.assign(t,s)}return Object.defineProperties({},t)}function xE(e){return JSON.stringify(e)}function Y4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const B1="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function xh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const X4=gb(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ml(e){if(xh(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(xh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function F1(e){return Ml(e)?{...e}:Array.isArray(e)?[...e]:e}const Q4=new Set(["string","number","symbol"]);function kl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ci(e,t,n){const s=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(s._zod.parent=e),s}function De(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function W4(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const J4={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function e5(e,t){const n=e._zod.def,s=n.checks;if(s&&s.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=li(e._zod.def,{get shape(){const c={};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&(c[f]=n.shape[f])}return ha(this,"shape",c),c},checks:[]});return ci(e,a)}function t5(e,t){const n=e._zod.def,s=n.checks;if(s&&s.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=li(e._zod.def,{get shape(){const c={...e._zod.def.shape};for(const f in t){if(!(f in n.shape))throw new Error(`Unrecognized key: "${f}"`);t[f]&&delete c[f]}return ha(this,"shape",c),c},checks:[]});return ci(e,a)}function n5(e,t){if(!Ml(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const a=e._zod.def.shape;for(const c in t)if(Object.getOwnPropertyDescriptor(a,c)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=li(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return ha(this,"shape",a),a}});return ci(e,i)}function r5(e,t){if(!Ml(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=li(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return ha(this,"shape",s),s}});return ci(e,n)}function s5(e,t){const n=li(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t._zod.def.shape};return ha(this,"shape",s),s},get catchall(){return t._zod.def.catchall},checks:[]});return ci(e,n)}function o5(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const c=li(t._zod.def,{get shape(){const f=t._zod.def.shape,d={...f};if(n)for(const p in n){if(!(p in f))throw new Error(`Unrecognized key: "${p}"`);n[p]&&(d[p]=e?new e({type:"optional",innerType:f[p]}):f[p])}else for(const p in f)d[p]=e?new e({type:"optional",innerType:f[p]}):f[p];return ha(this,"shape",d),d},checks:[]});return ci(t,c)}function i5(e,t,n){const s=li(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const c in n){if(!(c in a))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(a[c]=new e({type:"nonoptional",innerType:i[c]}))}else for(const c in i)a[c]=new e({type:"nonoptional",innerType:i[c]});return ha(this,"shape",a),a}});return ci(t,s)}function cl(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function ul(e,t){return t.map(n=>{var s;return(s=n).path??(s.path=[]),n.path.unshift(e),n})}function wd(e){return typeof e=="string"?e:e?.message}function ei(e,t,n){const s={...e,path:e.path??[]};if(!e.message){const i=wd(e.inst?._zod.def?.error?.(e))??wd(t?.error?.(e))??wd(n.customError?.(e))??wd(n.localeError?.(e))??"Invalid input";s.message=i}return delete s.inst,delete s.continue,t?.reportInput||delete s.input,s}function bb(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function xu(...e){const[t,n,s]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:s}:{...t}}const H1=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,uv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},q1=ue("$ZodError",H1),V1=ue("$ZodError",H1,{Parent:Error});function a5(e,t=n=>n.message){const n={},s=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):s.push(t(i));return{formErrors:s,fieldErrors:n}}function l5(e,t=n=>n.message){const n={_errors:[]},s=i=>{for(const a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>s({issues:c}));else if(a.code==="invalid_key")s({issues:a.issues});else if(a.code==="invalid_element")s({issues:a.issues});else if(a.path.length===0)n._errors.push(t(a));else{let c=n,f=0;for(;f<a.path.length;){const d=a.path[f];f===a.path.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(t(a))):c[d]=c[d]||{_errors:[]},c=c[d],f++}}};return s(e),n}const xb=e=>(t,n,s,i)=>{const a=s?Object.assign(s,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},a);if(c instanceof Promise)throw new pl;if(c.issues.length){const f=new(i?.Err??e)(c.issues.map(d=>ei(d,a,Jo())));throw B1(f,i?.callee),f}return c.value},Sb=e=>async(t,n,s,i)=>{const a=s?Object.assign(s,{async:!0}):{async:!0};let c=t._zod.run({value:n,issues:[]},a);if(c instanceof Promise&&(c=await c),c.issues.length){const f=new(i?.Err??e)(c.issues.map(d=>ei(d,a,Jo())));throw B1(f,i?.callee),f}return c.value},rp=e=>(t,n,s)=>{const i=s?{...s,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new pl;return a.issues.length?{success:!1,error:new(e??q1)(a.issues.map(c=>ei(c,i,Jo())))}:{success:!0,data:a.value}},c5=rp(V1),sp=e=>async(t,n,s)=>{const i=s?Object.assign(s,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(c=>ei(c,i,Jo())))}:{success:!0,data:a.value}},u5=sp(V1),f5=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return xb(e)(t,n,i)},d5=e=>(t,n,s)=>xb(e)(t,n,s),h5=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return Sb(e)(t,n,i)},p5=e=>async(t,n,s)=>Sb(e)(t,n,s),m5=e=>(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return rp(e)(t,n,i)},g5=e=>(t,n,s)=>rp(e)(t,n,s),y5=e=>async(t,n,s)=>{const i=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return sp(e)(t,n,i)},v5=e=>async(t,n,s)=>sp(e)(t,n,s),b5=/^[cC][^\s-]{8,}$/,x5=/^[0-9a-z]+$/,S5=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,_5=/^[0-9a-vA-V]{20}$/,w5=/^[A-Za-z0-9]{27}$/,E5=/^[a-zA-Z0-9_-]{21}$/,T5=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,C5=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,SE=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,R5=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,N5="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function j5(){return new RegExp(N5,"u")}const A5=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,O5=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,M5=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,k5=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,I5=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,K1=/^[A-Za-z0-9_-]*$/,D5=/^\+[1-9]\d{6,14}$/,G1="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",P5=new RegExp(`^${G1}$`);function Z1(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function z5(e){return new RegExp(`^${Z1(e)}$`)}function L5(e){const t=Z1({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${t}(?:${n.join("|")})`;return new RegExp(`^${G1}T(?:${s})$`)}const U5=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},$5=/^-?\d+$/,Y1=/^-?\d+(?:\.\d+)?$/,B5=/^(?:true|false)$/i,F5=/^[^A-Z]*$/,H5=/^[^a-z]*$/,Gn=ue("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),X1={number:"number",bigint:"bigint",object:"date"},Q1=ue("$ZodCheckLessThan",(e,t)=>{Gn.init(e,t);const n=X1[typeof t.value];e._zod.onattach.push(s=>{const i=s._zod.bag,a=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value<=t.value:s.value<t.value)||s.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),W1=ue("$ZodCheckGreaterThan",(e,t)=>{Gn.init(e,t);const n=X1[typeof t.value];e._zod.onattach.push(s=>{const i=s._zod.bag,a=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=s=>{(t.inclusive?s.value>=t.value:s.value>t.value)||s.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:s.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),q5=ue("$ZodCheckMultipleOf",(e,t)=>{Gn.init(e,t),e._zod.onattach.push(n=>{var s;(s=n._zod.bag).multipleOf??(s.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Z4(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),V5=ue("$ZodCheckNumberFormat",(e,t)=>{Gn.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),s=n?"int":"number",[i,a]=J4[t.format];e._zod.onattach.push(c=>{const f=c._zod.bag;f.format=t.format,f.minimum=i,f.maximum=a,n&&(f.pattern=$5)}),e._zod.check=c=>{const f=c.value;if(n){if(!Number.isInteger(f)){c.issues.push({expected:s,format:t.format,code:"invalid_type",continue:!1,input:f,inst:e});return}if(!Number.isSafeInteger(f)){f>0?c.issues.push({input:f,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort}):c.issues.push({input:f,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,inclusive:!0,continue:!t.abort});return}}f<i&&c.issues.push({origin:"number",input:f,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),f>a&&c.issues.push({origin:"number",input:f,code:"too_big",maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),K5=ue("$ZodCheckMaxLength",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!yb(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(s._zod.bag.maximum=t.maximum)}),e._zod.check=s=>{const i=s.value;if(i.length<=t.maximum)return;const c=bb(i);s.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),G5=ue("$ZodCheckMinLength",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!yb(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(s._zod.bag.minimum=t.minimum)}),e._zod.check=s=>{const i=s.value;if(i.length>=t.minimum)return;const c=bb(i);s.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Z5=ue("$ZodCheckLengthEquals",(e,t)=>{var n;Gn.init(e,t),(n=e._zod.def).when??(n.when=s=>{const i=s.value;return!yb(i)&&i.length!==void 0}),e._zod.onattach.push(s=>{const i=s._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=s=>{const i=s.value,a=i.length;if(a===t.length)return;const c=bb(i),f=a>t.length;s.issues.push({origin:c,...f?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!t.abort})}}),op=ue("$ZodCheckStringFormat",(e,t)=>{var n,s;Gn.init(e,t),e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(s=e._zod).check??(s.check=()=>{})}),Y5=ue("$ZodCheckRegex",(e,t)=>{op.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),X5=ue("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=F5),op.init(e,t)}),Q5=ue("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=H5),op.init(e,t)}),W5=ue("$ZodCheckIncludes",(e,t)=>{Gn.init(e,t);const n=kl(t.includes),s=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=s,e._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(s)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),J5=ue("$ZodCheckStartsWith",(e,t)=>{Gn.init(e,t);const n=new RegExp(`^${kl(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=s=>{s.value.startsWith(t.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:s.value,inst:e,continue:!t.abort})}}),e3=ue("$ZodCheckEndsWith",(e,t)=>{Gn.init(e,t);const n=new RegExp(`.*${kl(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(s=>{const i=s._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=s=>{s.value.endsWith(t.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:s.value,inst:e,continue:!t.abort})}}),t3=ue("$ZodCheckOverwrite",(e,t)=>{Gn.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class n3{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const s=t.split(`
|
|
22
|
+
`).filter(c=>c),i=Math.min(...s.map(c=>c.length-c.trimStart().length)),a=s.map(c=>c.slice(i)).map(c=>" ".repeat(this.indent*2)+c);for(const c of a)this.content.push(c)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
|
|
23
|
+
`))}}const r3={major:4,minor:3,patch:6},$t=ue("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=r3;const s=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&s.unshift(e);for(const i of s)for(const a of i._zod.onattach)a(e);if(s.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(c,f,d)=>{let p=cl(c),g;for(const y of f){if(y._zod.def.when){if(!y._zod.def.when(c))continue}else if(p)continue;const b=c.issues.length,x=y._zod.check(c);if(x instanceof Promise&&d?.async===!1)throw new pl;if(g||x instanceof Promise)g=(g??Promise.resolve()).then(async()=>{await x,c.issues.length!==b&&(p||(p=cl(c,b)))});else{if(c.issues.length===b)continue;p||(p=cl(c,b))}}return g?g.then(()=>c):c},a=(c,f,d)=>{if(cl(c))return c.aborted=!0,c;const p=i(f,s,d);if(p instanceof Promise){if(d.async===!1)throw new pl;return p.then(g=>e._zod.parse(g,d))}return e._zod.parse(p,d)};e._zod.run=(c,f)=>{if(f.skipChecks)return e._zod.parse(c,f);if(f.direction==="backward"){const p=e._zod.parse({value:c.value,issues:[]},{...f,skipChecks:!0});return p instanceof Promise?p.then(g=>a(g,c,f)):a(p,c,f)}const d=e._zod.parse(c,f);if(d instanceof Promise){if(f.async===!1)throw new pl;return d.then(p=>i(p,s,f))}return i(d,s,f)}}wt(e,"~standard",()=>({validate:i=>{try{const a=c5(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return u5(e,i).then(c=>c.success?{value:c.data}:{issues:c.error?.issues})}},vendor:"zod",version:1}))}),_b=ue("$ZodString",(e,t)=>{$t.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??U5(e._zod.bag),e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Ut=ue("$ZodStringFormat",(e,t)=>{op.init(e,t),_b.init(e,t)}),s3=ue("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=C5),Ut.init(e,t)}),o3=ue("$ZodUUID",(e,t)=>{if(t.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(s===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=SE(s))}else t.pattern??(t.pattern=SE());Ut.init(e,t)}),i3=ue("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=R5),Ut.init(e,t)}),a3=ue("$ZodURL",(e,t)=>{Ut.init(e,t),e._zod.check=n=>{try{const s=n.value.trim(),i=new URL(s);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=s;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),l3=ue("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=j5()),Ut.init(e,t)}),c3=ue("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=E5),Ut.init(e,t)}),u3=ue("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=b5),Ut.init(e,t)}),f3=ue("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=x5),Ut.init(e,t)}),d3=ue("$ZodULID",(e,t)=>{t.pattern??(t.pattern=S5),Ut.init(e,t)}),h3=ue("$ZodXID",(e,t)=>{t.pattern??(t.pattern=_5),Ut.init(e,t)}),p3=ue("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=w5),Ut.init(e,t)}),m3=ue("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=L5(t)),Ut.init(e,t)}),g3=ue("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=P5),Ut.init(e,t)}),y3=ue("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=z5(t)),Ut.init(e,t)}),v3=ue("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=T5),Ut.init(e,t)}),b3=ue("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=A5),Ut.init(e,t),e._zod.bag.format="ipv4"}),x3=ue("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=O5),Ut.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),S3=ue("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=M5),Ut.init(e,t)}),_3=ue("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=k5),Ut.init(e,t),e._zod.check=n=>{const s=n.value.split("/");try{if(s.length!==2)throw new Error;const[i,a]=s;if(!a)throw new Error;const c=Number(a);if(`${c}`!==a)throw new Error;if(c<0||c>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function J1(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const w3=ue("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=I5),Ut.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{J1(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function E3(e){if(!K1.test(e))return!1;const t=e.replace(/[-_]/g,s=>s==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return J1(n)}const T3=ue("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=K1),Ut.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{E3(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),C3=ue("$ZodE164",(e,t)=>{t.pattern??(t.pattern=D5),Ut.init(e,t)});function R3(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[s]=n;if(!s)return!1;const i=JSON.parse(atob(s));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const N3=ue("$ZodJWT",(e,t)=>{Ut.init(e,t),e._zod.check=n=>{R3(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),eN=ue("$ZodNumber",(e,t)=>{$t.init(e,t),e._zod.pattern=e._zod.bag.pattern??Y1,e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),n}}),j3=ue("$ZodNumberFormat",(e,t)=>{V5.init(e,t),eN.init(e,t)}),A3=ue("$ZodBoolean",(e,t)=>{$t.init(e,t),e._zod.pattern=B5,e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),O3=ue("$ZodUnknown",(e,t)=>{$t.init(e,t),e._zod.parse=n=>n}),M3=ue("$ZodNever",(e,t)=>{$t.init(e,t),e._zod.parse=(n,s)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function _E(e,t,n){e.issues.length&&t.issues.push(...ul(n,e.issues)),t.value[n]=e.value}const k3=ue("$ZodArray",(e,t)=>{$t.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const a=[];for(let c=0;c<i.length;c++){const f=i[c],d=t.element._zod.run({value:f,issues:[]},s);d instanceof Promise?a.push(d.then(p=>_E(p,n,c))):_E(d,n,c)}return a.length?Promise.all(a).then(()=>n):n}});function Sh(e,t,n,s,i){if(e.issues.length){if(i&&!(n in s))return;t.issues.push(...ul(n,e.issues))}e.value===void 0?n in s&&(t.value[n]=void 0):t.value[n]=e.value}function tN(e){const t=Object.keys(e.shape);for(const s of t)if(!e.shape?.[s]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);const n=W4(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function nN(e,t,n,s,i,a){const c=[],f=i.keySet,d=i.catchall._zod,p=d.def.type,g=d.optout==="optional";for(const y in t){if(f.has(y))continue;if(p==="never"){c.push(y);continue}const b=d.run({value:t[y],issues:[]},s);b instanceof Promise?e.push(b.then(x=>Sh(x,n,y,t,g))):Sh(b,n,y,t,g)}return c.length&&n.issues.push({code:"unrecognized_keys",keys:c,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const I3=ue("$ZodObject",(e,t)=>{if($t.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const f=t.shape;Object.defineProperty(t,"shape",{get:()=>{const d={...f};return Object.defineProperty(t,"shape",{value:d}),d}})}const s=gb(()=>tN(t));wt(e._zod,"propValues",()=>{const f=t.shape,d={};for(const p in f){const g=f[p]._zod;if(g.values){d[p]??(d[p]=new Set);for(const y of g.values)d[p].add(y)}}return d});const i=xh,a=t.catchall;let c;e._zod.parse=(f,d)=>{c??(c=s.value);const p=f.value;if(!i(p))return f.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),f;f.value={};const g=[],y=c.shape;for(const b of c.keys){const x=y[b],S=x._zod.optout==="optional",w=x._zod.run({value:p[b],issues:[]},d);w instanceof Promise?g.push(w.then(T=>Sh(T,f,b,p,S))):Sh(w,f,b,p,S)}return a?nN(g,p,f,d,s.value,e):g.length?Promise.all(g).then(()=>f):f}}),D3=ue("$ZodObjectJIT",(e,t)=>{I3.init(e,t);const n=e._zod.parse,s=gb(()=>tN(t)),i=b=>{const x=new n3(["shape","payload","ctx"]),S=s.value,w=N=>{const R=xE(N);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};x.write("const input = payload.value;");const T=Object.create(null);let C=0;for(const N of S.keys)T[N]=`key_${C++}`;x.write("const newResult = {};");for(const N of S.keys){const R=T[N],k=xE(N),j=b[N]?._zod?.optout==="optional";x.write(`const ${R} = ${w(N)};`),j?x.write(`
|
|
24
|
+
if (${R}.issues.length) {
|
|
25
|
+
if (${k} in input) {
|
|
26
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
27
|
+
...iss,
|
|
28
|
+
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
29
|
+
})));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (${R}.value === undefined) {
|
|
34
|
+
if (${k} in input) {
|
|
35
|
+
newResult[${k}] = undefined;
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
newResult[${k}] = ${R}.value;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
`):x.write(`
|
|
42
|
+
if (${R}.issues.length) {
|
|
43
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
44
|
+
...iss,
|
|
45
|
+
path: iss.path ? [${k}, ...iss.path] : [${k}]
|
|
46
|
+
})));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (${R}.value === undefined) {
|
|
50
|
+
if (${k} in input) {
|
|
51
|
+
newResult[${k}] = undefined;
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
newResult[${k}] = ${R}.value;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
`)}x.write("payload.value = newResult;"),x.write("return payload;");const A=x.compile();return(N,R)=>A(b,N,R)};let a;const c=xh,f=!U1.jitless,p=f&&X4.value,g=t.catchall;let y;e._zod.parse=(b,x)=>{y??(y=s.value);const S=b.value;return c(S)?f&&p&&x?.async===!1&&x.jitless!==!0?(a||(a=i(t.shape)),b=a(b,x),g?nN([],S,b,x,y,e):b):n(b,x):(b.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),b)}});function wE(e,t,n,s){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const i=e.filter(a=>!cl(a));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(c=>ei(c,s,Jo())))}),t)}const P3=ue("$ZodUnion",(e,t)=>{$t.init(e,t),wt(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),wt(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),wt(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),wt(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${i.map(a=>vb(a.source)).join("|")})$`)}});const n=t.options.length===1,s=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return s(i,a);let c=!1;const f=[];for(const d of t.options){const p=d._zod.run({value:i.value,issues:[]},a);if(p instanceof Promise)f.push(p),c=!0;else{if(p.issues.length===0)return p;f.push(p)}}return c?Promise.all(f).then(d=>wE(d,i,e,a)):wE(f,i,e,a)}}),z3=ue("$ZodIntersection",(e,t)=>{$t.init(e,t),e._zod.parse=(n,s)=>{const i=n.value,a=t.left._zod.run({value:i,issues:[]},s),c=t.right._zod.run({value:i,issues:[]},s);return a instanceof Promise||c instanceof Promise?Promise.all([a,c]).then(([d,p])=>EE(n,d,p)):EE(n,a,c)}});function fv(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ml(e)&&Ml(t)){const n=Object.keys(t),s=Object.keys(e).filter(a=>n.indexOf(a)!==-1),i={...e,...t};for(const a of s){const c=fv(e[a],t[a]);if(!c.valid)return{valid:!1,mergeErrorPath:[a,...c.mergeErrorPath]};i[a]=c.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let s=0;s<e.length;s++){const i=e[s],a=t[s],c=fv(i,a);if(!c.valid)return{valid:!1,mergeErrorPath:[s,...c.mergeErrorPath]};n.push(c.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function EE(e,t,n){const s=new Map;let i;for(const f of t.issues)if(f.code==="unrecognized_keys"){i??(i=f);for(const d of f.keys)s.has(d)||s.set(d,{}),s.get(d).l=!0}else e.issues.push(f);for(const f of n.issues)if(f.code==="unrecognized_keys")for(const d of f.keys)s.has(d)||s.set(d,{}),s.get(d).r=!0;else e.issues.push(f);const a=[...s].filter(([,f])=>f.l&&f.r).map(([f])=>f);if(a.length&&i&&e.issues.push({...i,keys:a}),cl(e))return e;const c=fv(t.value,n.value);if(!c.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);return e.value=c.data,e}const L3=ue("$ZodRecord",(e,t)=>{$t.init(e,t),e._zod.parse=(n,s)=>{const i=n.value;if(!Ml(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const a=[],c=t.keyType._zod.values;if(c){n.value={};const f=new Set;for(const p of c)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){f.add(typeof p=="number"?p.toString():p);const g=t.valueType._zod.run({value:i[p],issues:[]},s);g instanceof Promise?a.push(g.then(y=>{y.issues.length&&n.issues.push(...ul(p,y.issues)),n.value[p]=y.value})):(g.issues.length&&n.issues.push(...ul(p,g.issues)),n.value[p]=g.value)}let d;for(const p in i)f.has(p)||(d=d??[],d.push(p));d&&d.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:d})}else{n.value={};for(const f of Reflect.ownKeys(i)){if(f==="__proto__")continue;let d=t.keyType._zod.run({value:f,issues:[]},s);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof f=="string"&&Y1.test(f)&&d.issues.length){const y=t.keyType._zod.run({value:Number(f),issues:[]},s);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");y.issues.length===0&&(d=y)}if(d.issues.length){t.mode==="loose"?n.value[f]=i[f]:n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(y=>ei(y,s,Jo())),input:f,path:[f],inst:e});continue}const g=t.valueType._zod.run({value:i[f],issues:[]},s);g instanceof Promise?a.push(g.then(y=>{y.issues.length&&n.issues.push(...ul(f,y.issues)),n.value[d.value]=y.value})):(g.issues.length&&n.issues.push(...ul(f,g.issues)),n.value[d.value]=g.value)}}return a.length?Promise.all(a).then(()=>n):n}}),U3=ue("$ZodEnum",(e,t)=>{$t.init(e,t);const n=$1(t.entries),s=new Set(n);e._zod.values=s,e._zod.pattern=new RegExp(`^(${n.filter(i=>Q4.has(typeof i)).map(i=>typeof i=="string"?kl(i):i.toString()).join("|")})$`),e._zod.parse=(i,a)=>{const c=i.value;return s.has(c)||i.issues.push({code:"invalid_value",values:n,input:c,inst:e}),i}}),$3=ue("$ZodLiteral",(e,t)=>{if($t.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(s=>typeof s=="string"?kl(s):s?kl(s.toString()):String(s)).join("|")})$`),e._zod.parse=(s,i)=>{const a=s.value;return n.has(a)||s.issues.push({code:"invalid_value",values:t.values,input:a,inst:e}),s}}),B3=ue("$ZodTransform",(e,t)=>{$t.init(e,t),e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new L1(e.constructor.name);const i=t.transform(n.value,n);if(s.async)return(i instanceof Promise?i:Promise.resolve(i)).then(c=>(n.value=c,n));if(i instanceof Promise)throw new pl;return n.value=i,n}});function TE(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const rN=ue("$ZodOptional",(e,t)=>{$t.init(e,t),e._zod.optin="optional",e._zod.optout="optional",wt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),wt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${vb(n.source)})?$`):void 0}),e._zod.parse=(n,s)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(a=>TE(a,n.value)):TE(i,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,s)}}),F3=ue("$ZodExactOptional",(e,t)=>{rN.init(e,t),wt(e._zod,"values",()=>t.innerType._zod.values),wt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,s)=>t.innerType._zod.run(n,s)}),H3=ue("$ZodNullable",(e,t)=>{$t.init(e,t),wt(e._zod,"optin",()=>t.innerType._zod.optin),wt(e._zod,"optout",()=>t.innerType._zod.optout),wt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${vb(n.source)}|null)$`):void 0}),wt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,s)=>n.value===null?n:t.innerType._zod.run(n,s)}),q3=ue("$ZodDefault",(e,t)=>{$t.init(e,t),e._zod.optin="optional",wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(a=>CE(a,t)):CE(i,t)}});function CE(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const V3=ue("$ZodPrefault",(e,t)=>{$t.init(e,t),e._zod.optin="optional",wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>(s.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,s))}),K3=ue("$ZodNonOptional",(e,t)=>{$t.init(e,t),wt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(s=>s!==void 0)):void 0}),e._zod.parse=(n,s)=>{const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(a=>RE(a,e)):RE(i,e)}});function RE(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const G3=ue("$ZodCatch",(e,t)=>{$t.init(e,t),wt(e._zod,"optin",()=>t.innerType._zod.optin),wt(e._zod,"optout",()=>t.innerType._zod.optout),wt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(c=>ei(c,s,Jo()))},input:n.value}),n.issues=[]),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(a=>ei(a,s,Jo()))},input:n.value}),n.issues=[]),n)}}),Z3=ue("$ZodPipe",(e,t)=>{$t.init(e,t),wt(e._zod,"values",()=>t.in._zod.values),wt(e._zod,"optin",()=>t.in._zod.optin),wt(e._zod,"optout",()=>t.out._zod.optout),wt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,s)=>{if(s.direction==="backward"){const a=t.out._zod.run(n,s);return a instanceof Promise?a.then(c=>Ed(c,t.in,s)):Ed(a,t.in,s)}const i=t.in._zod.run(n,s);return i instanceof Promise?i.then(a=>Ed(a,t.out,s)):Ed(i,t.out,s)}});function Ed(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Y3=ue("$ZodReadonly",(e,t)=>{$t.init(e,t),wt(e._zod,"propValues",()=>t.innerType._zod.propValues),wt(e._zod,"values",()=>t.innerType._zod.values),wt(e._zod,"optin",()=>t.innerType?._zod?.optin),wt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,s)=>{if(s.direction==="backward")return t.innerType._zod.run(n,s);const i=t.innerType._zod.run(n,s);return i instanceof Promise?i.then(NE):NE(i)}});function NE(e){return e.value=Object.freeze(e.value),e}const X3=ue("$ZodCustom",(e,t)=>{Gn.init(e,t),$t.init(e,t),e._zod.parse=(n,s)=>n,e._zod.check=n=>{const s=n.value,i=t.fn(s);if(i instanceof Promise)return i.then(a=>jE(a,n,s,e));jE(i,n,s,e)}});function jE(e,t,n,s){if(!e){const i={code:"custom",input:n,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(i.params=s._zod.def.params),t.issues.push(xu(i))}}var AE;class Q3{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const s=n[0];return this._map.set(t,s),s&&typeof s=="object"&&"id"in s&&this._idmap.set(s.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const s={...this.get(n)??{}};delete s.id;const i={...s,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function W3(){return new Q3}(AE=globalThis).__zod_globalRegistry??(AE.__zod_globalRegistry=W3());const ou=globalThis.__zod_globalRegistry;function J3(e,t){return new e({type:"string",...De(t)})}function eU(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...De(t)})}function OE(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...De(t)})}function tU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...De(t)})}function nU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...De(t)})}function rU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...De(t)})}function sU(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...De(t)})}function oU(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...De(t)})}function iU(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...De(t)})}function aU(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...De(t)})}function lU(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...De(t)})}function cU(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...De(t)})}function uU(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...De(t)})}function fU(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...De(t)})}function dU(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...De(t)})}function hU(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...De(t)})}function pU(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...De(t)})}function mU(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...De(t)})}function gU(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...De(t)})}function yU(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...De(t)})}function vU(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...De(t)})}function bU(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...De(t)})}function xU(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...De(t)})}function SU(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...De(t)})}function _U(e,t){return new e({type:"string",format:"date",check:"string_format",...De(t)})}function wU(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...De(t)})}function EU(e,t){return new e({type:"string",format:"duration",check:"string_format",...De(t)})}function TU(e,t){return new e({type:"number",checks:[],...De(t)})}function CU(e,t){return new e({type:"number",coerce:!0,checks:[],...De(t)})}function RU(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...De(t)})}function NU(e,t){return new e({type:"boolean",...De(t)})}function jU(e){return new e({type:"unknown"})}function AU(e,t){return new e({type:"never",...De(t)})}function ME(e,t){return new Q1({check:"less_than",...De(t),value:e,inclusive:!1})}function ey(e,t){return new Q1({check:"less_than",...De(t),value:e,inclusive:!0})}function kE(e,t){return new W1({check:"greater_than",...De(t),value:e,inclusive:!1})}function ty(e,t){return new W1({check:"greater_than",...De(t),value:e,inclusive:!0})}function IE(e,t){return new q5({check:"multiple_of",...De(t),value:e})}function sN(e,t){return new K5({check:"max_length",...De(t),maximum:e})}function _h(e,t){return new G5({check:"min_length",...De(t),minimum:e})}function oN(e,t){return new Z5({check:"length_equals",...De(t),length:e})}function OU(e,t){return new Y5({check:"string_format",format:"regex",...De(t),pattern:e})}function MU(e){return new X5({check:"string_format",format:"lowercase",...De(e)})}function kU(e){return new Q5({check:"string_format",format:"uppercase",...De(e)})}function IU(e,t){return new W5({check:"string_format",format:"includes",...De(t),includes:e})}function DU(e,t){return new J5({check:"string_format",format:"starts_with",...De(t),prefix:e})}function PU(e,t){return new e3({check:"string_format",format:"ends_with",...De(t),suffix:e})}function Yl(e){return new t3({check:"overwrite",tx:e})}function zU(e){return Yl(t=>t.normalize(e))}function LU(){return Yl(e=>e.trim())}function UU(){return Yl(e=>e.toLowerCase())}function $U(){return Yl(e=>e.toUpperCase())}function BU(){return Yl(e=>Y4(e))}function FU(e,t,n){return new e({type:"array",element:t,...De(n)})}function HU(e,t,n){return new e({type:"custom",check:"custom",fn:t,...De(n)})}function qU(e){const t=VU(n=>(n.addIssue=s=>{if(typeof s=="string")n.issues.push(xu(s,n.value,t._zod.def));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),n.issues.push(xu(i))}},e(n.value,n)));return t}function VU(e,t){const n=new Gn({check:"custom",...De(t)});return n._zod.check=e,n}function iN(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??ou,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function on(e,t,n={path:[],schemaPath:[]}){var s;const i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const c={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,c);const f=e._zod.toJSONSchema?.();if(f)c.schema=f;else{const g={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,c.schema,g);else{const b=c.schema,x=t.processors[i.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);x(e,t,b,g)}const y=e._zod.parent;y&&(c.ref||(c.ref=y),on(y,t,g),t.seen.get(y).isParent=!0)}const d=t.metadataRegistry.get(e);return d&&Object.assign(c.schema,d),t.io==="input"&&jn(e)&&(delete c.schema.examples,delete c.schema.default),t.io==="input"&&c.schema._prefault&&((s=c.schema).default??(s.default=c.schema._prefault)),delete c.schema._prefault,t.seen.get(e).schema}function aN(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=new Map;for(const c of e.seen.entries()){const f=e.metadataRegistry.get(c[0])?.id;if(f){const d=s.get(f);if(d&&d!==c[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);s.set(f,c[0])}}const i=c=>{const f=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=e.external.registry.get(c[0])?.id,b=e.external.uri??(S=>S);if(y)return{ref:b(y)};const x=c[1].defId??c[1].schema.id??`schema${e.counter++}`;return c[1].defId=x,{defId:x,ref:`${b("__shared")}#/${f}/${x}`}}if(c[1]===n)return{ref:"#"};const p=`#/${f}/`,g=c[1].schema.id??`__schema${e.counter++}`;return{defId:g,ref:p+g}},a=c=>{if(c[1].schema.$ref)return;const f=c[1],{ref:d,defId:p}=i(c);f.def={...f.schema},p&&(f.defId=p);const g=f.schema;for(const y in g)delete g[y];g.$ref=d};if(e.cycles==="throw")for(const c of e.seen.entries()){const f=c[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
|
|
58
|
+
|
|
59
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const c of e.seen.entries()){const f=c[1];if(t===c[0]){a(c);continue}if(e.external){const p=e.external.registry.get(c[0])?.id;if(t!==c[0]&&p){a(c);continue}}if(e.metadataRegistry.get(c[0])?.id){a(c);continue}if(f.cycle){a(c);continue}if(f.count>1&&e.reused==="ref"){a(c);continue}}}function lN(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=c=>{const f=e.seen.get(c);if(f.ref===null)return;const d=f.def??f.schema,p={...d},g=f.ref;if(f.ref=null,g){s(g);const b=e.seen.get(g),x=b.schema;if(x.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(x)):Object.assign(d,x),Object.assign(d,p),c._zod.parent===g)for(const w in d)w==="$ref"||w==="allOf"||w in p||delete d[w];if(x.$ref&&b.def)for(const w in d)w==="$ref"||w==="allOf"||w in b.def&&JSON.stringify(d[w])===JSON.stringify(b.def[w])&&delete d[w]}const y=c._zod.parent;if(y&&y!==g){s(y);const b=e.seen.get(y);if(b?.schema.$ref&&(d.$ref=b.schema.$ref,b.def))for(const x in d)x==="$ref"||x==="allOf"||x in b.def&&JSON.stringify(d[x])===JSON.stringify(b.def[x])&&delete d[x]}e.override({zodSchema:c,jsonSchema:d,path:f.path??[]})};for(const c of[...e.seen.entries()].reverse())s(c[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const c=e.external.registry.get(t)?.id;if(!c)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(c)}Object.assign(i,n.def??n.schema);const a=e.external?.defs??{};for(const c of e.seen.entries()){const f=c[1];f.def&&f.defId&&(a[f.defId]=f.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?i.$defs=a:i.definitions=a);try{const c=JSON.parse(JSON.stringify(i));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:wh(t,"input",e.processors),output:wh(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function jn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const s=e._zod.def;if(s.type==="transform")return!0;if(s.type==="array")return jn(s.element,n);if(s.type==="set")return jn(s.valueType,n);if(s.type==="lazy")return jn(s.getter(),n);if(s.type==="promise"||s.type==="optional"||s.type==="nonoptional"||s.type==="nullable"||s.type==="readonly"||s.type==="default"||s.type==="prefault")return jn(s.innerType,n);if(s.type==="intersection")return jn(s.left,n)||jn(s.right,n);if(s.type==="record"||s.type==="map")return jn(s.keyType,n)||jn(s.valueType,n);if(s.type==="pipe")return jn(s.in,n)||jn(s.out,n);if(s.type==="object"){for(const i in s.shape)if(jn(s.shape[i],n))return!0;return!1}if(s.type==="union"){for(const i of s.options)if(jn(i,n))return!0;return!1}if(s.type==="tuple"){for(const i of s.items)if(jn(i,n))return!0;return!!(s.rest&&jn(s.rest,n))}return!1}const KU=(e,t={})=>n=>{const s=iN({...n,processors:t});return on(e,s),aN(s,e),lN(s,e)},wh=(e,t,n={})=>s=>{const{libraryOptions:i,target:a}=s??{},c=iN({...i??{},target:a,io:t,processors:n});return on(e,c),aN(c,e),lN(c,e)},GU={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ZU=(e,t,n,s)=>{const i=n;i.type="string";const{minimum:a,maximum:c,format:f,patterns:d,contentEncoding:p}=e._zod.bag;if(typeof a=="number"&&(i.minLength=a),typeof c=="number"&&(i.maxLength=c),f&&(i.format=GU[f]??f,i.format===""&&delete i.format,f==="time"&&delete i.format),p&&(i.contentEncoding=p),d&&d.size>0){const g=[...d];g.length===1?i.pattern=g[0].source:g.length>1&&(i.allOf=[...g.map(y=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:y.source}))])}},YU=(e,t,n,s)=>{const i=n,{minimum:a,maximum:c,format:f,multipleOf:d,exclusiveMaximum:p,exclusiveMinimum:g}=e._zod.bag;typeof f=="string"&&f.includes("int")?i.type="integer":i.type="number",typeof g=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=g,i.exclusiveMinimum=!0):i.exclusiveMinimum=g),typeof a=="number"&&(i.minimum=a,typeof g=="number"&&t.target!=="draft-04"&&(g>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=p,i.exclusiveMaximum=!0):i.exclusiveMaximum=p),typeof c=="number"&&(i.maximum=c,typeof p=="number"&&t.target!=="draft-04"&&(p<=c?delete i.maximum:delete i.exclusiveMaximum)),typeof d=="number"&&(i.multipleOf=d)},XU=(e,t,n,s)=>{n.type="boolean"},QU=(e,t,n,s)=>{n.not={}},WU=(e,t,n,s)=>{},JU=(e,t,n,s)=>{const i=e._zod.def,a=$1(i.entries);a.every(c=>typeof c=="number")&&(n.type="number"),a.every(c=>typeof c=="string")&&(n.type="string"),n.enum=a},e$=(e,t,n,s)=>{const i=e._zod.def,a=[];for(const c of i.values)if(c===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof c=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");a.push(Number(c))}else a.push(c);if(a.length!==0)if(a.length===1){const c=a[0];n.type=c===null?"null":typeof c,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[c]:n.const=c}else a.every(c=>typeof c=="number")&&(n.type="number"),a.every(c=>typeof c=="string")&&(n.type="string"),a.every(c=>typeof c=="boolean")&&(n.type="boolean"),a.every(c=>c===null)&&(n.type="null"),n.enum=a},t$=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},n$=(e,t,n,s)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},r$=(e,t,n,s)=>{const i=n,a=e._zod.def,{minimum:c,maximum:f}=e._zod.bag;typeof c=="number"&&(i.minItems=c),typeof f=="number"&&(i.maxItems=f),i.type="array",i.items=on(a.element,t,{...s,path:[...s.path,"items"]})},s$=(e,t,n,s)=>{const i=n,a=e._zod.def;i.type="object",i.properties={};const c=a.shape;for(const p in c)i.properties[p]=on(c[p],t,{...s,path:[...s.path,"properties",p]});const f=new Set(Object.keys(c)),d=new Set([...f].filter(p=>{const g=a.shape[p]._zod;return t.io==="input"?g.optin===void 0:g.optout===void 0}));d.size>0&&(i.required=Array.from(d)),a.catchall?._zod.def.type==="never"?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=on(a.catchall,t,{...s,path:[...s.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},o$=(e,t,n,s)=>{const i=e._zod.def,a=i.inclusive===!1,c=i.options.map((f,d)=>on(f,t,{...s,path:[...s.path,a?"oneOf":"anyOf",d]}));a?n.oneOf=c:n.anyOf=c},i$=(e,t,n,s)=>{const i=e._zod.def,a=on(i.left,t,{...s,path:[...s.path,"allOf",0]}),c=on(i.right,t,{...s,path:[...s.path,"allOf",1]}),f=p=>"allOf"in p&&Object.keys(p).length===1,d=[...f(a)?a.allOf:[a],...f(c)?c.allOf:[c]];n.allOf=d},a$=(e,t,n,s)=>{const i=n,a=e._zod.def;i.type="object";const c=a.keyType,d=c._zod.bag?.patterns;if(a.mode==="loose"&&d&&d.size>0){const g=on(a.valueType,t,{...s,path:[...s.path,"patternProperties","*"]});i.patternProperties={};for(const y of d)i.patternProperties[y.source]=g}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=on(a.keyType,t,{...s,path:[...s.path,"propertyNames"]})),i.additionalProperties=on(a.valueType,t,{...s,path:[...s.path,"additionalProperties"]});const p=c._zod.values;if(p){const g=[...p].filter(y=>typeof y=="string"||typeof y=="number");g.length>0&&(i.required=g)}},l$=(e,t,n,s)=>{const i=e._zod.def,a=on(i.innerType,t,s),c=t.seen.get(e);t.target==="openapi-3.0"?(c.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},c$=(e,t,n,s)=>{const i=e._zod.def;on(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType},u$=(e,t,n,s)=>{const i=e._zod.def;on(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},f$=(e,t,n,s)=>{const i=e._zod.def;on(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},d$=(e,t,n,s)=>{const i=e._zod.def;on(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType;let c;try{c=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=c},h$=(e,t,n,s)=>{const i=e._zod.def,a=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;on(a,t,s);const c=t.seen.get(e);c.ref=a},p$=(e,t,n,s)=>{const i=e._zod.def;on(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},cN=(e,t,n,s)=>{const i=e._zod.def;on(i.innerType,t,s);const a=t.seen.get(e);a.ref=i.innerType},m$=ue("ZodISODateTime",(e,t)=>{m3.init(e,t),Ft.init(e,t)});function g$(e){return SU(m$,e)}const y$=ue("ZodISODate",(e,t)=>{g3.init(e,t),Ft.init(e,t)});function v$(e){return _U(y$,e)}const b$=ue("ZodISOTime",(e,t)=>{y3.init(e,t),Ft.init(e,t)});function x$(e){return wU(b$,e)}const S$=ue("ZodISODuration",(e,t)=>{v3.init(e,t),Ft.init(e,t)});function _$(e){return EU(S$,e)}const w$=(e,t)=>{q1.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>l5(e,n)},flatten:{value:n=>a5(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,uv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,uv,2)}},isEmpty:{get(){return e.issues.length===0}}})},qr=ue("ZodError",w$,{Parent:Error}),E$=xb(qr),T$=Sb(qr),C$=rp(qr),R$=sp(qr),N$=f5(qr),j$=d5(qr),A$=h5(qr),O$=p5(qr),M$=m5(qr),k$=g5(qr),I$=y5(qr),D$=v5(qr),Bt=ue("ZodType",(e,t)=>($t.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:wh(e,"input"),output:wh(e,"output")}}),e.toJSONSchema=KU(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(li(t,{checks:[...t.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0}),e.with=e.check,e.clone=(n,s)=>ci(e,n,s),e.brand=()=>e,e.register=((n,s)=>(n.add(e,s),e)),e.parse=(n,s)=>E$(e,n,s,{callee:e.parse}),e.safeParse=(n,s)=>C$(e,n,s),e.parseAsync=async(n,s)=>T$(e,n,s,{callee:e.parseAsync}),e.safeParseAsync=async(n,s)=>R$(e,n,s),e.spa=e.safeParseAsync,e.encode=(n,s)=>N$(e,n,s),e.decode=(n,s)=>j$(e,n,s),e.encodeAsync=async(n,s)=>A$(e,n,s),e.decodeAsync=async(n,s)=>O$(e,n,s),e.safeEncode=(n,s)=>M$(e,n,s),e.safeDecode=(n,s)=>k$(e,n,s),e.safeEncodeAsync=async(n,s)=>I$(e,n,s),e.safeDecodeAsync=async(n,s)=>D$(e,n,s),e.refine=(n,s)=>e.check(NB(n,s)),e.superRefine=n=>e.check(jB(n)),e.overwrite=n=>e.check(Yl(n)),e.optional=()=>zE(e),e.exactOptional=()=>mB(e),e.nullable=()=>LE(e),e.nullish=()=>zE(LE(e)),e.nonoptional=n=>SB(e,n),e.array=()=>Fr(e),e.or=n=>Eb([e,n]),e.and=n=>cB(e,n),e.transform=n=>UE(e,hB(n)),e.default=n=>vB(e,n),e.prefault=n=>xB(e,n),e.catch=n=>wB(e,n),e.pipe=n=>UE(e,n),e.readonly=()=>CB(e),e.describe=n=>{const s=e.clone();return ou.add(s,{description:n}),s},Object.defineProperty(e,"description",{get(){return ou.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ou.get(e);const s=e.clone();return ou.add(s,n[0]),s},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),uN=ue("_ZodString",(e,t)=>{_b.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(s,i,a)=>ZU(e,s,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...s)=>e.check(OU(...s)),e.includes=(...s)=>e.check(IU(...s)),e.startsWith=(...s)=>e.check(DU(...s)),e.endsWith=(...s)=>e.check(PU(...s)),e.min=(...s)=>e.check(_h(...s)),e.max=(...s)=>e.check(sN(...s)),e.length=(...s)=>e.check(oN(...s)),e.nonempty=(...s)=>e.check(_h(1,...s)),e.lowercase=s=>e.check(MU(s)),e.uppercase=s=>e.check(kU(s)),e.trim=()=>e.check(LU()),e.normalize=(...s)=>e.check(zU(...s)),e.toLowerCase=()=>e.check(UU()),e.toUpperCase=()=>e.check($U()),e.slugify=()=>e.check(BU())}),P$=ue("ZodString",(e,t)=>{_b.init(e,t),uN.init(e,t),e.email=n=>e.check(eU(z$,n)),e.url=n=>e.check(oU(L$,n)),e.jwt=n=>e.check(xU(J$,n)),e.emoji=n=>e.check(iU(U$,n)),e.guid=n=>e.check(OE(DE,n)),e.uuid=n=>e.check(tU(Td,n)),e.uuidv4=n=>e.check(nU(Td,n)),e.uuidv6=n=>e.check(rU(Td,n)),e.uuidv7=n=>e.check(sU(Td,n)),e.nanoid=n=>e.check(aU($$,n)),e.guid=n=>e.check(OE(DE,n)),e.cuid=n=>e.check(lU(B$,n)),e.cuid2=n=>e.check(cU(F$,n)),e.ulid=n=>e.check(uU(H$,n)),e.base64=n=>e.check(yU(X$,n)),e.base64url=n=>e.check(vU(Q$,n)),e.xid=n=>e.check(fU(q$,n)),e.ksuid=n=>e.check(dU(V$,n)),e.ipv4=n=>e.check(hU(K$,n)),e.ipv6=n=>e.check(pU(G$,n)),e.cidrv4=n=>e.check(mU(Z$,n)),e.cidrv6=n=>e.check(gU(Y$,n)),e.e164=n=>e.check(bU(W$,n)),e.datetime=n=>e.check(g$(n)),e.date=n=>e.check(v$(n)),e.time=n=>e.check(x$(n)),e.duration=n=>e.check(_$(n))});function Be(e){return J3(P$,e)}const Ft=ue("ZodStringFormat",(e,t)=>{Ut.init(e,t),uN.init(e,t)}),z$=ue("ZodEmail",(e,t)=>{i3.init(e,t),Ft.init(e,t)}),DE=ue("ZodGUID",(e,t)=>{s3.init(e,t),Ft.init(e,t)}),Td=ue("ZodUUID",(e,t)=>{o3.init(e,t),Ft.init(e,t)}),L$=ue("ZodURL",(e,t)=>{a3.init(e,t),Ft.init(e,t)}),U$=ue("ZodEmoji",(e,t)=>{l3.init(e,t),Ft.init(e,t)}),$$=ue("ZodNanoID",(e,t)=>{c3.init(e,t),Ft.init(e,t)}),B$=ue("ZodCUID",(e,t)=>{u3.init(e,t),Ft.init(e,t)}),F$=ue("ZodCUID2",(e,t)=>{f3.init(e,t),Ft.init(e,t)}),H$=ue("ZodULID",(e,t)=>{d3.init(e,t),Ft.init(e,t)}),q$=ue("ZodXID",(e,t)=>{h3.init(e,t),Ft.init(e,t)}),V$=ue("ZodKSUID",(e,t)=>{p3.init(e,t),Ft.init(e,t)}),K$=ue("ZodIPv4",(e,t)=>{b3.init(e,t),Ft.init(e,t)}),G$=ue("ZodIPv6",(e,t)=>{x3.init(e,t),Ft.init(e,t)}),Z$=ue("ZodCIDRv4",(e,t)=>{S3.init(e,t),Ft.init(e,t)}),Y$=ue("ZodCIDRv6",(e,t)=>{_3.init(e,t),Ft.init(e,t)}),X$=ue("ZodBase64",(e,t)=>{w3.init(e,t),Ft.init(e,t)}),Q$=ue("ZodBase64URL",(e,t)=>{T3.init(e,t),Ft.init(e,t)}),W$=ue("ZodE164",(e,t)=>{C3.init(e,t),Ft.init(e,t)}),J$=ue("ZodJWT",(e,t)=>{N3.init(e,t),Ft.init(e,t)}),wb=ue("ZodNumber",(e,t)=>{eN.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(s,i,a)=>YU(e,s,i),e.gt=(s,i)=>e.check(kE(s,i)),e.gte=(s,i)=>e.check(ty(s,i)),e.min=(s,i)=>e.check(ty(s,i)),e.lt=(s,i)=>e.check(ME(s,i)),e.lte=(s,i)=>e.check(ey(s,i)),e.max=(s,i)=>e.check(ey(s,i)),e.int=s=>e.check(PE(s)),e.safe=s=>e.check(PE(s)),e.positive=s=>e.check(kE(0,s)),e.nonnegative=s=>e.check(ty(0,s)),e.negative=s=>e.check(ME(0,s)),e.nonpositive=s=>e.check(ey(0,s)),e.multipleOf=(s,i)=>e.check(IE(s,i)),e.step=(s,i)=>e.check(IE(s,i)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Wt(e){return TU(wb,e)}const eB=ue("ZodNumberFormat",(e,t)=>{j3.init(e,t),wb.init(e,t)});function PE(e){return RU(eB,e)}const tB=ue("ZodBoolean",(e,t)=>{A3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>XU(e,n,s)});function Js(e){return NU(tB,e)}const nB=ue("ZodUnknown",(e,t)=>{O3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>WU()});function ra(){return jU(nB)}const rB=ue("ZodNever",(e,t)=>{M3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>QU(e,n,s)});function sB(e){return AU(rB,e)}const oB=ue("ZodArray",(e,t)=>{k3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>r$(e,n,s,i),e.element=t.element,e.min=(n,s)=>e.check(_h(n,s)),e.nonempty=n=>e.check(_h(1,n)),e.max=(n,s)=>e.check(sN(n,s)),e.length=(n,s)=>e.check(oN(n,s)),e.unwrap=()=>e.element});function Fr(e,t){return FU(oB,e,t)}const iB=ue("ZodObject",(e,t)=>{D3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>s$(e,n,s,i),wt(e,"shape",()=>t.shape),e.keyof=()=>Ku(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ra()}),e.loose=()=>e.clone({...e._zod.def,catchall:ra()}),e.strict=()=>e.clone({...e._zod.def,catchall:sB()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>n5(e,n),e.safeExtend=n=>r5(e,n),e.merge=n=>s5(e,n),e.pick=n=>e5(e,n),e.omit=n=>t5(e,n),e.partial=(...n)=>o5(fN,e,n[0]),e.required=(...n)=>i5(dN,e,n[0])});function At(e,t){const n={type:"object",shape:e??{},...De(t)};return new iB(n)}const aB=ue("ZodUnion",(e,t)=>{P3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>o$(e,n,s,i),e.options=t.options});function Eb(e,t){return new aB({type:"union",options:e,...De(t)})}const lB=ue("ZodIntersection",(e,t)=>{z3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>i$(e,n,s,i)});function cB(e,t){return new lB({type:"intersection",left:e,right:t})}const uB=ue("ZodRecord",(e,t)=>{L3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>a$(e,n,s,i),e.keyType=t.keyType,e.valueType=t.valueType});function Vu(e,t,n){return new uB({type:"record",keyType:e,valueType:t,...De(n)})}const dv=ue("ZodEnum",(e,t)=>{U3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(s,i,a)=>JU(e,s,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(s,i)=>{const a={};for(const c of s)if(n.has(c))a[c]=t.entries[c];else throw new Error(`Key ${c} not found in enum`);return new dv({...t,checks:[],...De(i),entries:a})},e.exclude=(s,i)=>{const a={...t.entries};for(const c of s)if(n.has(c))delete a[c];else throw new Error(`Key ${c} not found in enum`);return new dv({...t,checks:[],...De(i),entries:a})}});function Ku(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new dv({type:"enum",entries:n,...De(t)})}const fB=ue("ZodLiteral",(e,t)=>{$3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>e$(e,n,s),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function ti(e,t){return new fB({type:"literal",values:Array.isArray(e)?e:[e],...De(t)})}const dB=ue("ZodTransform",(e,t)=>{B3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>n$(e,n),e._zod.parse=(n,s)=>{if(s.direction==="backward")throw new L1(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(xu(a,n.value,t));else{const c=a;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=n.value),c.inst??(c.inst=e),n.issues.push(xu(c))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(a=>(n.value=a,n)):(n.value=i,n)}});function hB(e){return new dB({type:"transform",transform:e})}const fN=ue("ZodOptional",(e,t)=>{rN.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>cN(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function zE(e){return new fN({type:"optional",innerType:e})}const pB=ue("ZodExactOptional",(e,t)=>{F3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>cN(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function mB(e){return new pB({type:"optional",innerType:e})}const gB=ue("ZodNullable",(e,t)=>{H3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>l$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function LE(e){return new gB({type:"nullable",innerType:e})}const yB=ue("ZodDefault",(e,t)=>{q3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>u$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function vB(e,t){return new yB({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():F1(t)}})}const bB=ue("ZodPrefault",(e,t)=>{V3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>f$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function xB(e,t){return new bB({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():F1(t)}})}const dN=ue("ZodNonOptional",(e,t)=>{K3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>c$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function SB(e,t){return new dN({type:"nonoptional",innerType:e,...De(t)})}const _B=ue("ZodCatch",(e,t)=>{G3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>d$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function wB(e,t){return new _B({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const EB=ue("ZodPipe",(e,t)=>{Z3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>h$(e,n,s,i),e.in=t.in,e.out=t.out});function UE(e,t){return new EB({type:"pipe",in:e,out:t})}const TB=ue("ZodReadonly",(e,t)=>{Y3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>p$(e,n,s,i),e.unwrap=()=>e._zod.def.innerType});function CB(e){return new TB({type:"readonly",innerType:e})}const RB=ue("ZodCustom",(e,t)=>{X3.init(e,t),Bt.init(e,t),e._zod.processJSONSchema=(n,s,i)=>t$(e,n)});function NB(e,t={}){return HU(RB,e,t)}function jB(e){return qU(e)}function $E(e){return CU(wb,e)}At({hash:Be().regex(/^sha256:[0-9a-f]{64}$/i,"Invalid blob hash format"),size:Wt().int().min(0),mimeType:Be().min(1),encrypted:Js().optional(),keyId:Be().optional()});const hN=At({hash:Be().regex(/^sha256:[0-9a-f]{64}$/i),size:Wt().int().min(0),mimeType:Be().min(1),createdAt:Be(),expiresAt:Be().optional(),uploadComplete:Js()});At({hash:Be().regex(/^sha256:[0-9a-f]{64}$/i,"Invalid blob hash format"),size:Wt().int().min(0),mimeType:Be().min(1)});At({exists:Js(),uploadId:Be().optional(),uploadUrl:Be().url().optional(),uploadMethod:Ku(["PUT","POST"]).optional(),uploadHeaders:Vu(Be(),Be()).optional(),chunkSize:Wt().int().optional()});At({hash:Be().regex(/^sha256:[0-9a-f]{64}$/i)});At({ok:Js(),metadata:hN.optional(),error:Be().optional()});At({hash:Be().regex(/^sha256:[0-9a-f]{64}$/i)});At({url:Be().url(),expiresAt:Be(),metadata:hN});At({error:Be(),message:Be().optional(),code:Be().optional()});At({limit:$E().int().min(1).max(100).default(50),offset:$E().int().min(0).default(0)});const AB="json-row-frame-v1",OB="gzip",pN=Ku(["upsert","delete"]),MB=Vu(Be(),Be()),mN=Vu(Be(),Eb([Be(),Fr(Be())])),kB=At({table:Be(),row_id:Be(),op:pN,payload:Vu(Be(),ra()).nullable(),base_version:Wt().int().nullable().optional()}),IB=At({clientId:Be().min(1),clientCommitId:Be().min(1),operations:Fr(kB).min(1),schemaVersion:Wt().int().min(1)}),DB=At({opIndex:Wt().int(),status:ti("applied")}),PB=At({opIndex:Wt().int(),status:ti("conflict"),message:Be(),server_version:Wt().int(),server_row:ra()}),zB=At({opIndex:Wt().int(),status:ti("error"),error:Be(),code:Be().optional(),retriable:Js().optional()}),LB=Eb([DB,PB,zB]),UB=At({ok:ti(!0),status:Ku(["applied","cached","rejected"]),commitSeq:Wt().int().optional(),results:Fr(LB)}),gN=At({asOfCommitSeq:Wt().int(),tables:Fr(Be()),tableIndex:Wt().int(),rowCursor:Be().nullable()}),$B=At({id:Be().min(1),table:Be().min(1),scopes:mN,params:Vu(Be(),ra()).optional(),cursor:Wt().int(),bootstrapState:gN.nullable().optional()}),BB=At({clientId:Be().min(1),limitCommits:Wt().int().min(1),limitSnapshotRows:Wt().int().min(1).optional(),maxSnapshotPages:Wt().int().min(1).optional(),dedupeRows:Js().optional(),subscriptions:Fr($B)}),FB=At({table:Be(),row_id:Be(),op:pN,row_json:ra().nullable(),row_version:Wt().int().nullable(),scopes:MB}),HB=At({commitSeq:Wt().int(),createdAt:Be(),actorId:Be(),changes:Fr(FB)}),qB=At({id:Be(),byteLength:Wt().int(),sha256:Be(),encoding:ti(AB),compression:ti(OB)}),VB=At({table:Be(),rows:Fr(ra()),chunks:Fr(qB).optional(),isFirstPage:Js(),isLastPage:Js()}),KB=At({id:Be(),status:Ku(["active","revoked"]),scopes:mN,bootstrap:Js(),bootstrapState:gN.nullable().optional(),nextCursor:Wt().int(),commits:Fr(HB),snapshots:Fr(VB).optional()}),GB=At({ok:ti(!0),subscriptions:Fr(KB)});At({clientId:Be().min(1),push:IB.omit({clientId:!0}).optional(),pull:BB.omit({clientId:!0}).optional()});At({ok:ti(!0),push:UB.optional(),pull:GB.optional()});new TextEncoder;const ZB={setAttribute(){},setAttributes(){},setStatus(){}};function YB(e){return e.level?e.level:e.error?"error":"info"}function ny(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 XB(e){return{setAttribute(t,n){e.setAttribute?.(t,n)},setAttributes(t){if(e.setAttributes){e.setAttributes(t);return}for(const[n,s]of Object.entries(t))e.setAttribute?.(n,s)},setStatus(t){e.setStatus?.(t)}}}function QB(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 BE(e){const t={};for(const[n,s]of Object.entries(e)){const i=QB(s);i!==void 0&&(t[n]=i)}return Object.keys(t).length>0?t:null}function WB(e){return{startSpan(t,n){return e.startSpan?e.startSpan(t,s=>n(XB(s))):n(ZB)}}}function JB(e){return{count(t,n,s){e.metrics?.count?.(t,n??1,s)},gauge(t,n,s){e.metrics?.gauge?.(t,n,s)},distribution(t,n,s){e.metrics?.distribution?.(t,n,s)}}}function e6(e){return{log(t){const n=YB(t),{event:s,...i}=t,a=ny(e.logger,n);if(!a)return;const c=BE(i);if(!c){a(s);return}a(s,c)},tracer:WB(e),metrics:JB(e),captureException(t,n){if(e.captureException?.(t),!n)return;const s=ny(e.logger,"error")??ny(e.logger,"info");if(!s)return;const i=BE(n);if(!i){s("sync.exception.context");return}s("sync.exception.context",i)}}}function t6(e){if(e?.attributes)return{attributes:e.attributes}}function FE(e){if(!e)return;const t=!!e.attributes,n=!!e.unit;if(!(!t&&!n))return{attributes:e.attributes,unit:e.unit}}function n6(){return e6({logger:CP,startSpan(e,t){return IR(e,n=>t({setAttribute(s,i){n.setAttribute(s,i)},setAttributes(s){n.setAttributes(s)},setStatus(s){n.setStatus({code:s==="ok"?1:2})}}))},metrics:{count(e,t,n){const s=t6(n);if(s){nE(e,t,s);return}nE(e,t)},gauge(e,t,n){const s=FE(n);if(s){rE(e,t,s);return}rE(e,t)},distribution(e,t,n){const s=FE(n);if(s){sE(e,t,s);return}sE(e,t)}},captureException(e){UR(e)}})}function r6(){return n6()}function s6(e){const t=o6(e);return G4(t),r6()}function o6(e){const t=e.integrations;if(typeof t=="function")return e;const n=t??[];return n.some(i=>i.name==="BrowserTracing")?e:{...e,integrations:[B4(),...n]}}var ry={exports:{}},Xc={};var HE;function i6(){if(HE)return Xc;HE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,i,a){var c=null;if(a!==void 0&&(c=""+a),i.key!==void 0&&(c=""+i.key),"key"in i){a={};for(var f in i)f!=="key"&&(a[f]=i[f])}else a=i;return i=a.ref,{$$typeof:e,type:s,key:c,ref:i!==void 0?i:null,props:a}}return Xc.Fragment=t,Xc.jsx=n,Xc.jsxs=n,Xc}var qE;function a6(){return qE||(qE=1,ry.exports=i6()),ry.exports}var h=a6(),sy={exports:{}},Qc={},oy={exports:{}},iy={};var VE;function l6(){return VE||(VE=1,(function(e){function t(P,V){var B=P.length;P.push(V);e:for(;0<B;){var q=B-1>>>1,U=P[q];if(0<i(U,V))P[q]=V,P[B]=U,B=q;else break e}}function n(P){return P.length===0?null:P[0]}function s(P){if(P.length===0)return null;var V=P[0],B=P.pop();if(B!==V){P[0]=B;e:for(var q=0,U=P.length,I=U>>>1;q<I;){var G=2*(q+1)-1,W=P[G],Q=G+1,se=P[Q];if(0>i(W,B))Q<U&&0>i(se,W)?(P[q]=se,P[Q]=B,q=Q):(P[q]=W,P[G]=B,q=G);else if(Q<U&&0>i(se,B))P[q]=se,P[Q]=B,q=Q;else break e}}return V}function i(P,V){var B=P.sortIndex-V.sortIndex;return B!==0?B:P.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var d=[],p=[],g=1,y=null,b=3,x=!1,S=!1,w=!1,T=!1,C=typeof setTimeout=="function"?setTimeout:null,A=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function R(P){for(var V=n(p);V!==null;){if(V.callback===null)s(p);else if(V.startTime<=P)s(p),V.sortIndex=V.expirationTime,t(d,V);else break;V=n(p)}}function k(P){if(w=!1,R(P),!S)if(n(d)!==null)S=!0,L||(L=!0,z());else{var V=n(p);V!==null&&te(k,V.startTime-P)}}var L=!1,j=-1,O=5,D=-1;function K(){return T?!0:!(e.unstable_now()-D<O)}function F(){if(T=!1,L){var P=e.unstable_now();D=P;var V=!0;try{e:{S=!1,w&&(w=!1,A(j),j=-1),x=!0;var B=b;try{t:{for(R(P),y=n(d);y!==null&&!(y.expirationTime>P&&K());){var q=y.callback;if(typeof q=="function"){y.callback=null,b=y.priorityLevel;var U=q(y.expirationTime<=P);if(P=e.unstable_now(),typeof U=="function"){y.callback=U,R(P),V=!0;break t}y===n(d)&&s(d),R(P)}else s(d);y=n(d)}if(y!==null)V=!0;else{var I=n(p);I!==null&&te(k,I.startTime-P),V=!1}}break e}finally{y=null,b=B,x=!1}V=void 0}}finally{V?z():L=!1}}}var z;if(typeof N=="function")z=function(){N(F)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,Y=X.port2;X.port1.onmessage=F,z=function(){Y.postMessage(null)}}else z=function(){C(F,0)};function te(P,V){j=C(function(){P(e.unstable_now())},V)}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(P){P.callback=null},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):O=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(P){switch(b){case 1:case 2:case 3:var V=3;break;default:V=b}var B=b;b=V;try{return P()}finally{b=B}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(P,V){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var B=b;b=P;try{return V()}finally{b=B}},e.unstable_scheduleCallback=function(P,V,B){var q=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?q+B:q):B=q,P){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=B+U,P={id:g++,callback:V,priorityLevel:P,startTime:B,expirationTime:U,sortIndex:-1},B>q?(P.sortIndex=B,t(p,P),n(d)===null&&P===n(p)&&(w?(A(j),j=-1):w=!0,te(k,B-q))):(P.sortIndex=U,t(d,P),S||x||(S=!0,L||(L=!0,z()))),P},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(P){var V=b;return function(){var B=b;b=V;try{return P.apply(this,arguments)}finally{b=B}}}})(iy)),iy}var KE;function c6(){return KE||(KE=1,oy.exports=l6()),oy.exports}var ay={exports:{}},En={};var GE;function u6(){if(GE)return En;GE=1;var e=qu();function t(d){var p="https://react.dev/errors/"+d;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)p+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+d+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={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},i=Symbol.for("react.portal");function a(d,p,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:y==null?null:""+y,children:d,containerInfo:p,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(d,p){if(d==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return En.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,En.createPortal=function(d,p){var g=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 a(d,p,null,g)},En.flushSync=function(d){var p=c.T,g=s.p;try{if(c.T=null,s.p=2,d)return d()}finally{c.T=p,s.p=g,s.d.f()}},En.preconnect=function(d,p){typeof d=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(d,p))},En.prefetchDNS=function(d){typeof d=="string"&&s.d.D(d)},En.preinit=function(d,p){if(typeof d=="string"&&p&&typeof p.as=="string"){var g=p.as,y=f(g,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,x=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;g==="style"?s.d.S(d,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:x}):g==="script"&&s.d.X(d,{crossOrigin:y,integrity:b,fetchPriority:x,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},En.preinitModule=function(d,p){if(typeof d=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var g=f(p.as,p.crossOrigin);s.d.M(d,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&s.d.M(d)},En.preload=function(d,p){if(typeof d=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var g=p.as,y=f(g,p.crossOrigin);s.d.L(d,g,{crossOrigin:y,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})}},En.preloadModule=function(d,p){if(typeof d=="string")if(p){var g=f(p.as,p.crossOrigin);s.d.m(d,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else s.d.m(d)},En.requestFormReset=function(d){s.d.r(d)},En.unstable_batchedUpdates=function(d,p){return d(p)},En.useFormState=function(d,p,g){return c.H.useFormState(d,p,g)},En.useFormStatus=function(){return c.H.useHostTransitionStatus()},En.version="19.2.4",En}var ZE;function yN(){if(ZE)return ay.exports;ZE=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(),ay.exports=u6(),ay.exports}var YE;function f6(){if(YE)return Qc;YE=1;var e=c6(),t=qu(),n=yN();function s(r){var o="https://react.dev/errors/"+r;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)o+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function a(r){var o=r,l=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(l=o.return),r=o.return;while(r)}return o.tag===3?l:null}function c(r){if(r.tag===13){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function f(r){if(r.tag===31){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function d(r){if(a(r)!==r)throw Error(s(188))}function p(r){var o=r.alternate;if(!o){if(o=a(r),o===null)throw Error(s(188));return o!==r?null:r}for(var l=r,u=o;;){var m=l.return;if(m===null)break;var v=m.alternate;if(v===null){if(u=m.return,u!==null){l=u;continue}break}if(m.child===v.child){for(v=m.child;v;){if(v===l)return d(m),r;if(v===u)return d(m),o;v=v.sibling}throw Error(s(188))}if(l.return!==u.return)l=m,u=v;else{for(var E=!1,M=m.child;M;){if(M===l){E=!0,l=m,u=v;break}if(M===u){E=!0,u=m,l=v;break}M=M.sibling}if(!E){for(M=v.child;M;){if(M===l){E=!0,l=v,u=m;break}if(M===u){E=!0,u=v,l=m;break}M=M.sibling}if(!E)throw Error(s(189))}}if(l.alternate!==u)throw Error(s(190))}if(l.tag!==3)throw Error(s(188));return l.stateNode.current===l?r:o}function g(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r;for(r=r.child;r!==null;){if(o=g(r),o!==null)return o;r=r.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),N=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function z(r){return r===null||typeof r!="object"?null:(r=F&&r[F]||r["@@iterator"],typeof r=="function"?r:null)}var X=Symbol.for("react.client.reference");function Y(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===X?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case w:return"Fragment";case C:return"Profiler";case T:return"StrictMode";case k:return"Suspense";case L:return"SuspenseList";case D:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case N:return r.displayName||"Context";case A:return(r._context.displayName||"Context")+".Consumer";case R:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case j:return o=r.displayName||null,o!==null?o:Y(r.type)||"Memo";case O:o=r._payload,r=r._init;try{return Y(r(o))}catch{}}return null}var te=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},q=[],U=-1;function I(r){return{current:r}}function G(r){0>U||(r.current=q[U],q[U]=null,U--)}function W(r,o){U++,q[U]=r.current,r.current=o}var Q=I(null),se=I(null),oe=I(null),pe=I(null);function Se(r,o){switch(W(oe,o),W(se,r),W(Q,null),o.nodeType){case 9:case 11:r=(r=o.documentElement)&&(r=r.namespaceURI)?k_(r):0;break;default:if(r=o.tagName,o=o.namespaceURI)o=k_(o),r=I_(o,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}G(Q),W(Q,r)}function he(){G(Q),G(se),G(oe)}function He(r){r.memoizedState!==null&&W(pe,r);var o=Q.current,l=I_(o,r.type);o!==l&&(W(se,r),W(Q,l))}function Ee(r){se.current===r&&(G(Q),G(se)),pe.current===r&&(G(pe),Vc._currentValue=B)}var re,de;function ae(r){if(re===void 0)try{throw Error()}catch(l){var o=l.stack.trim().match(/\n( *(at )?)/);re=o&&o[1]||"",de=-1<l.stack.indexOf(`
|
|
60
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
61
|
+
`+re+r+de}var _e=!1;function ve(r,o){if(!r||_e)return"";_e=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(o){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(ie){var ne=ie}Reflect.construct(r,[],fe)}else{try{fe.call()}catch(ie){ne=ie}r.call(fe.prototype)}}else{try{throw Error()}catch(ie){ne=ie}(fe=r())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(ie){if(ie&&ne&&typeof ie.stack=="string")return[ie.stack,ne.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=u.DetermineComponentFrameRoot(),E=v[0],M=v[1];if(E&&M){var $=E.split(`
|
|
62
|
+
`),ee=M.split(`
|
|
63
|
+
`);for(m=u=0;u<$.length&&!$[u].includes("DetermineComponentFrameRoot");)u++;for(;m<ee.length&&!ee[m].includes("DetermineComponentFrameRoot");)m++;if(u===$.length||m===ee.length)for(u=$.length-1,m=ee.length-1;1<=u&&0<=m&&$[u]!==ee[m];)m--;for(;1<=u&&0<=m;u--,m--)if($[u]!==ee[m]){if(u!==1||m!==1)do if(u--,m--,0>m||$[u]!==ee[m]){var le=`
|
|
64
|
+
`+$[u].replace(" at new "," at ");return r.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",r.displayName)),le}while(1<=u&&0<=m);break}}}finally{_e=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?ae(l):""}function xe(r,o){switch(r.tag){case 26:case 27:case 5:return ae(r.type);case 16:return ae("Lazy");case 13:return r.child!==o&&o!==null?ae("Suspense Fallback"):ae("Suspense");case 19:return ae("SuspenseList");case 0:case 15:return ve(r.type,!1);case 11:return ve(r.type.render,!1);case 1:return ve(r.type,!0);case 31:return ae("Activity");default:return""}}function ye(r){try{var o="",l=null;do o+=xe(r,l),l=r,r=r.return;while(r);return o}catch(u){return`
|
|
65
|
+
Error generating stack: `+u.message+`
|
|
66
|
+
`+u.stack}}var Le=Object.prototype.hasOwnProperty,ke=e.unstable_scheduleCallback,we=e.unstable_cancelCallback,Ve=e.unstable_shouldYield,Xe=e.unstable_requestPaint,$e=e.unstable_now,We=e.unstable_getCurrentPriorityLevel,Fe=e.unstable_ImmediatePriority,me=e.unstable_UserBlockingPriority,Te=e.unstable_NormalPriority,qe=e.unstable_LowPriority,mt=e.unstable_IdlePriority,ct=e.log,br=e.unstable_setDisableYieldValue,xr=null,Zt=null;function ut(r){if(typeof ct=="function"&&br(r),Zt&&typeof Zt.setStrictMode=="function")try{Zt.setStrictMode(xr,r)}catch{}}var xt=Math.clz32?Math.clz32:mn,ot=Math.log,Yt=Math.LN2;function mn(r){return r>>>=0,r===0?32:31-(ot(r)/Yt|0)|0}var Ot=256,wn=262144,Yn=4194304;function Rn(r){var o=r&42;if(o!==0)return o;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 ss(r,o,l){var u=r.pendingLanes;if(u===0)return 0;var m=0,v=r.suspendedLanes,E=r.pingedLanes;r=r.warmLanes;var M=u&134217727;return M!==0?(u=M&~v,u!==0?m=Rn(u):(E&=M,E!==0?m=Rn(E):l||(l=M&~r,l!==0&&(m=Rn(l))))):(M=u&~v,M!==0?m=Rn(M):E!==0?m=Rn(E):l||(l=u&~r,l!==0&&(m=Rn(l)))),m===0?0:o!==0&&o!==m&&(o&v)===0&&(v=m&-m,l=o&-o,v>=l||v===32&&(l&4194048)!==0)?o:m}function os(r,o){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&o)===0}function ba(r,o){switch(r){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 bi(){var r=Yn;return Yn<<=1,(Yn&62914560)===0&&(Yn=4194304),r}function xi(r){for(var o=[],l=0;31>l;l++)o.push(r);return o}function xs(r,o){r.pendingLanes|=o,o!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Xn(r,o,l,u,m,v){var E=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var M=r.entanglements,$=r.expirationTimes,ee=r.hiddenUpdates;for(l=E&~l;0<l;){var le=31-xt(l),fe=1<<le;M[le]=0,$[le]=-1;var ne=ee[le];if(ne!==null)for(ee[le]=null,le=0;le<ne.length;le++){var ie=ne[le];ie!==null&&(ie.lane&=-536870913)}l&=~fe}u!==0&&is(r,u,0),v!==0&&m===0&&r.tag!==0&&(r.suspendedLanes|=v&~(E&~o))}function is(r,o,l){r.pendingLanes|=o,r.suspendedLanes&=~o;var u=31-xt(o);r.entangledLanes|=o,r.entanglements[u]=r.entanglements[u]|1073741824|l&261930}function ao(r,o){var l=r.entangledLanes|=o;for(r=r.entanglements;l;){var u=31-xt(l),m=1<<u;m&o|r[u]&o&&(r[u]|=o),l&=~m}}function lo(r,o){var l=o&-o;return l=(l&42)!==0?1:Qn(l),(l&(r.suspendedLanes|o))!==0?0:l}function Qn(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 oc(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function nf(){var r=V.p;return r!==0?r:(r=window.event,r===void 0?32:rw(r.type))}function rf(r,o){var l=V.p;try{return V.p=r,o()}finally{V.p=l}}var co=Math.random().toString(36).slice(2),vn="__reactFiber$"+co,Dn="__reactProps$"+co,xa="__reactContainer$"+co,jp="__reactEvents$"+co,TO="__reactListeners$"+co,CO="__reactHandles$"+co,xx="__reactResources$"+co,ic="__reactMarker$"+co;function Ap(r){delete r[vn],delete r[Dn],delete r[jp],delete r[TO],delete r[CO]}function Sa(r){var o=r[vn];if(o)return o;for(var l=r.parentNode;l;){if(o=l[xa]||l[vn]){if(l=o.alternate,o.child!==null||l!==null&&l.child!==null)for(r=B_(r);r!==null;){if(l=r[vn])return l;r=B_(r)}return o}r=l,l=r.parentNode}return null}function _a(r){if(r=r[vn]||r[xa]){var o=r.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return r}return null}function ac(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r.stateNode;throw Error(s(33))}function wa(r){var o=r[xx];return o||(o=r[xx]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function gn(r){r[ic]=!0}var Sx=new Set,_x={};function Si(r,o){Ea(r,o),Ea(r+"Capture",o)}function Ea(r,o){for(_x[r]=o,r=0;r<o.length;r++)Sx.add(o[r])}var RO=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]*$"),wx={},Ex={};function NO(r){return Le.call(Ex,r)?!0:Le.call(wx,r)?!1:RO.test(r)?Ex[r]=!0:(wx[r]=!0,!1)}function sf(r,o,l){if(NO(o))if(l===null)r.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":r.removeAttribute(o);return;case"boolean":var u=o.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){r.removeAttribute(o);return}}r.setAttribute(o,""+l)}}function of(r,o,l){if(l===null)r.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttribute(o,""+l)}}function Ss(r,o,l,u){if(u===null)r.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(o,l,""+u)}}function Sr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Tx(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function jO(r,o,l){var u=Object.getOwnPropertyDescriptor(r.constructor.prototype,o);if(!r.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var m=u.get,v=u.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return m.call(this)},set:function(E){l=""+E,v.call(this,E)}}),Object.defineProperty(r,o,{enumerable:u.enumerable}),{getValue:function(){return l},setValue:function(E){l=""+E},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function Op(r){if(!r._valueTracker){var o=Tx(r)?"checked":"value";r._valueTracker=jO(r,o,""+r[o])}}function Cx(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var l=o.getValue(),u="";return r&&(u=Tx(r)?r.checked?"true":"false":r.value),r=u,r!==l?(o.setValue(r),!0):!1}function af(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 AO=/[\n"\\]/g;function _r(r){return r.replace(AO,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Mp(r,o,l,u,m,v,E,M){r.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?r.type=E:r.removeAttribute("type"),o!=null?E==="number"?(o===0&&r.value===""||r.value!=o)&&(r.value=""+Sr(o)):r.value!==""+Sr(o)&&(r.value=""+Sr(o)):E!=="submit"&&E!=="reset"||r.removeAttribute("value"),o!=null?kp(r,E,Sr(o)):l!=null?kp(r,E,Sr(l)):u!=null&&r.removeAttribute("value"),m==null&&v!=null&&(r.defaultChecked=!!v),m!=null&&(r.checked=m&&typeof m!="function"&&typeof m!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?r.name=""+Sr(M):r.removeAttribute("name")}function Rx(r,o,l,u,m,v,E,M){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),o!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){Op(r);return}l=l!=null?""+Sr(l):"",o=o!=null?""+Sr(o):l,M||o===r.value||(r.value=o),r.defaultValue=o}u=u??m,u=typeof u!="function"&&typeof u!="symbol"&&!!u,r.checked=M?r.checked:!!u,r.defaultChecked=!!u,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(r.name=E),Op(r)}function kp(r,o,l){o==="number"&&af(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function Ta(r,o,l,u){if(r=r.options,o){o={};for(var m=0;m<l.length;m++)o["$"+l[m]]=!0;for(l=0;l<r.length;l++)m=o.hasOwnProperty("$"+r[l].value),r[l].selected!==m&&(r[l].selected=m),m&&u&&(r[l].defaultSelected=!0)}else{for(l=""+Sr(l),o=null,m=0;m<r.length;m++){if(r[m].value===l){r[m].selected=!0,u&&(r[m].defaultSelected=!0);return}o!==null||r[m].disabled||(o=r[m])}o!==null&&(o.selected=!0)}}function Nx(r,o,l){if(o!=null&&(o=""+Sr(o),o!==r.value&&(r.value=o),l==null)){r.defaultValue!==o&&(r.defaultValue=o);return}r.defaultValue=l!=null?""+Sr(l):""}function jx(r,o,l,u){if(o==null){if(u!=null){if(l!=null)throw Error(s(92));if(te(u)){if(1<u.length)throw Error(s(93));u=u[0]}l=u}l==null&&(l=""),o=l}l=Sr(o),r.defaultValue=l,u=r.textContent,u===l&&u!==""&&u!==null&&(r.value=u),Op(r)}function Ca(r,o){if(o){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=o;return}}r.textContent=o}var OO=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 Ax(r,o,l){var u=o.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?r.setProperty(o,""):o==="float"?r.cssFloat="":r[o]="":u?r.setProperty(o,l):typeof l!="number"||l===0||OO.has(o)?o==="float"?r.cssFloat=l:r[o]=(""+l).trim():r[o]=l+"px"}function Ox(r,o,l){if(o!=null&&typeof o!="object")throw Error(s(62));if(r=r.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||o!=null&&o.hasOwnProperty(u)||(u.indexOf("--")===0?r.setProperty(u,""):u==="float"?r.cssFloat="":r[u]="");for(var m in o)u=o[m],o.hasOwnProperty(m)&&l[m]!==u&&Ax(r,m,u)}else for(var v in o)o.hasOwnProperty(v)&&Ax(r,v,o[v])}function Ip(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 MO=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"]]),kO=/^[\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 lf(r){return kO.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function _s(){}var Dp=null;function Pp(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Ra=null,Na=null;function Mx(r){var o=_a(r);if(o&&(r=o.stateNode)){var l=r[Dn]||null;e:switch(r=o.stateNode,o.type){case"input":if(Mp(r,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),o=l.name,l.type==="radio"&&o!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+_r(""+o)+'"][type="radio"]'),o=0;o<l.length;o++){var u=l[o];if(u!==r&&u.form===r.form){var m=u[Dn]||null;if(!m)throw Error(s(90));Mp(u,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(o=0;o<l.length;o++)u=l[o],u.form===r.form&&Cx(u)}break e;case"textarea":Nx(r,l.value,l.defaultValue);break e;case"select":o=l.value,o!=null&&Ta(r,!!l.multiple,o,!1)}}}var zp=!1;function kx(r,o,l){if(zp)return r(o,l);zp=!0;try{var u=r(o);return u}finally{if(zp=!1,(Ra!==null||Na!==null)&&(Yf(),Ra&&(o=Ra,r=Na,Na=Ra=null,Mx(o),r)))for(o=0;o<r.length;o++)Mx(r[o])}}function lc(r,o){var l=r.stateNode;if(l===null)return null;var u=l[Dn]||null;if(u===null)return null;l=u[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(r=r.type,u=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!u;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(s(231,o,typeof l));return l}var ws=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lp=!1;if(ws)try{var cc={};Object.defineProperty(cc,"passive",{get:function(){Lp=!0}}),window.addEventListener("test",cc,cc),window.removeEventListener("test",cc,cc)}catch{Lp=!1}var uo=null,Up=null,cf=null;function Ix(){if(cf)return cf;var r,o=Up,l=o.length,u,m="value"in uo?uo.value:uo.textContent,v=m.length;for(r=0;r<l&&o[r]===m[r];r++);var E=l-r;for(u=1;u<=E&&o[l-u]===m[v-u];u++);return cf=m.slice(r,1<u?1-u:void 0)}function uf(r){var o=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&o===13&&(r=13)):r=o,r===10&&(r=13),32<=r||r===13?r:0}function ff(){return!0}function Dx(){return!1}function Pn(r){function o(l,u,m,v,E){this._reactName=l,this._targetInst=m,this.type=u,this.nativeEvent=v,this.target=E,this.currentTarget=null;for(var M in r)r.hasOwnProperty(M)&&(l=r[M],this[M]=l?l(v):v[M]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?ff:Dx,this.isPropagationStopped=Dx,this}return y(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=ff)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=ff)},persist:function(){},isPersistent:ff}),o}var _i={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},df=Pn(_i),uc=y({},_i,{view:0,detail:0}),IO=Pn(uc),$p,Bp,fc,hf=y({},uc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hp,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!==fc&&(fc&&r.type==="mousemove"?($p=r.screenX-fc.screenX,Bp=r.screenY-fc.screenY):Bp=$p=0,fc=r),$p)},movementY:function(r){return"movementY"in r?r.movementY:Bp}}),Px=Pn(hf),DO=y({},hf,{dataTransfer:0}),PO=Pn(DO),zO=y({},uc,{relatedTarget:0}),Fp=Pn(zO),LO=y({},_i,{animationName:0,elapsedTime:0,pseudoElement:0}),UO=Pn(LO),$O=y({},_i,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),BO=Pn($O),FO=y({},_i,{data:0}),zx=Pn(FO),HO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qO={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"},VO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function KO(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=VO[r])?!!o[r]:!1}function Hp(){return KO}var GO=y({},uc,{key:function(r){if(r.key){var o=HO[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=uf(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?qO[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hp,charCode:function(r){return r.type==="keypress"?uf(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?uf(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),ZO=Pn(GO),YO=y({},hf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lx=Pn(YO),XO=y({},uc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hp}),QO=Pn(XO),WO=y({},_i,{propertyName:0,elapsedTime:0,pseudoElement:0}),JO=Pn(WO),eM=y({},hf,{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}),tM=Pn(eM),nM=y({},_i,{newState:0,oldState:0}),rM=Pn(nM),sM=[9,13,27,32],qp=ws&&"CompositionEvent"in window,dc=null;ws&&"documentMode"in document&&(dc=document.documentMode);var oM=ws&&"TextEvent"in window&&!dc,Ux=ws&&(!qp||dc&&8<dc&&11>=dc),$x=" ",Bx=!1;function Fx(r,o){switch(r){case"keyup":return sM.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hx(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var ja=!1;function iM(r,o){switch(r){case"compositionend":return Hx(o);case"keypress":return o.which!==32?null:(Bx=!0,$x);case"textInput":return r=o.data,r===$x&&Bx?null:r;default:return null}}function aM(r,o){if(ja)return r==="compositionend"||!qp&&Fx(r,o)?(r=Ix(),cf=Up=uo=null,ja=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return Ux&&o.locale!=="ko"?null:o.data;default:return null}}var lM={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 qx(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!lM[r.type]:o==="textarea"}function Vx(r,o,l,u){Ra?Na?Na.push(u):Na=[u]:Ra=u,o=nd(o,"onChange"),0<o.length&&(l=new df("onChange","change",null,l,u),r.push({event:l,listeners:o}))}var hc=null,pc=null;function cM(r){R_(r,0)}function pf(r){var o=ac(r);if(Cx(o))return r}function Kx(r,o){if(r==="change")return o}var Gx=!1;if(ws){var Vp;if(ws){var Kp="oninput"in document;if(!Kp){var Zx=document.createElement("div");Zx.setAttribute("oninput","return;"),Kp=typeof Zx.oninput=="function"}Vp=Kp}else Vp=!1;Gx=Vp&&(!document.documentMode||9<document.documentMode)}function Yx(){hc&&(hc.detachEvent("onpropertychange",Xx),pc=hc=null)}function Xx(r){if(r.propertyName==="value"&&pf(pc)){var o=[];Vx(o,pc,r,Pp(r)),kx(cM,o)}}function uM(r,o,l){r==="focusin"?(Yx(),hc=o,pc=l,hc.attachEvent("onpropertychange",Xx)):r==="focusout"&&Yx()}function fM(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return pf(pc)}function dM(r,o){if(r==="click")return pf(o)}function hM(r,o){if(r==="input"||r==="change")return pf(o)}function pM(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var Wn=typeof Object.is=="function"?Object.is:pM;function mc(r,o){if(Wn(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var l=Object.keys(r),u=Object.keys(o);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var m=l[u];if(!Le.call(o,m)||!Wn(r[m],o[m]))return!1}return!0}function Qx(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Wx(r,o){var l=Qx(r);r=0;for(var u;l;){if(l.nodeType===3){if(u=r+l.textContent.length,r<=o&&u>=o)return{node:l,offset:o-r};r=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Qx(l)}}function Jx(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?Jx(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function e0(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var o=af(r.document);o instanceof r.HTMLIFrameElement;){try{var l=typeof o.contentWindow.location.href=="string"}catch{l=!1}if(l)r=o.contentWindow;else break;o=af(r.document)}return o}function Gp(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}var mM=ws&&"documentMode"in document&&11>=document.documentMode,Aa=null,Zp=null,gc=null,Yp=!1;function t0(r,o,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Yp||Aa==null||Aa!==af(u)||(u=Aa,"selectionStart"in u&&Gp(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),gc&&mc(gc,u)||(gc=u,u=nd(Zp,"onSelect"),0<u.length&&(o=new df("onSelect","select",null,o,l),r.push({event:o,listeners:u}),o.target=Aa)))}function wi(r,o){var l={};return l[r.toLowerCase()]=o.toLowerCase(),l["Webkit"+r]="webkit"+o,l["Moz"+r]="moz"+o,l}var Oa={animationend:wi("Animation","AnimationEnd"),animationiteration:wi("Animation","AnimationIteration"),animationstart:wi("Animation","AnimationStart"),transitionrun:wi("Transition","TransitionRun"),transitionstart:wi("Transition","TransitionStart"),transitioncancel:wi("Transition","TransitionCancel"),transitionend:wi("Transition","TransitionEnd")},Xp={},n0={};ws&&(n0=document.createElement("div").style,"AnimationEvent"in window||(delete Oa.animationend.animation,delete Oa.animationiteration.animation,delete Oa.animationstart.animation),"TransitionEvent"in window||delete Oa.transitionend.transition);function Ei(r){if(Xp[r])return Xp[r];if(!Oa[r])return r;var o=Oa[r],l;for(l in o)if(o.hasOwnProperty(l)&&l in n0)return Xp[r]=o[l];return r}var r0=Ei("animationend"),s0=Ei("animationiteration"),o0=Ei("animationstart"),gM=Ei("transitionrun"),yM=Ei("transitionstart"),vM=Ei("transitioncancel"),i0=Ei("transitionend"),a0=new Map,Qp="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(" ");Qp.push("scrollEnd");function Kr(r,o){a0.set(r,o),Si(o,[r])}var mf=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=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(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},wr=[],Ma=0,Wp=0;function gf(){for(var r=Ma,o=Wp=Ma=0;o<r;){var l=wr[o];wr[o++]=null;var u=wr[o];wr[o++]=null;var m=wr[o];wr[o++]=null;var v=wr[o];if(wr[o++]=null,u!==null&&m!==null){var E=u.pending;E===null?m.next=m:(m.next=E.next,E.next=m),u.pending=m}v!==0&&l0(l,m,v)}}function yf(r,o,l,u){wr[Ma++]=r,wr[Ma++]=o,wr[Ma++]=l,wr[Ma++]=u,Wp|=u,r.lanes|=u,r=r.alternate,r!==null&&(r.lanes|=u)}function Jp(r,o,l,u){return yf(r,o,l,u),vf(r)}function Ti(r,o){return yf(r,null,null,o),vf(r)}function l0(r,o,l){r.lanes|=l;var u=r.alternate;u!==null&&(u.lanes|=l);for(var m=!1,v=r.return;v!==null;)v.childLanes|=l,u=v.alternate,u!==null&&(u.childLanes|=l),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(m=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,m&&o!==null&&(m=31-xt(l),r=v.hiddenUpdates,u=r[m],u===null?r[m]=[o]:u.push(o),o.lane=l|536870912),v):null}function vf(r){if(50<Lc)throw Lc=0,lg=null,Error(s(185));for(var o=r.return;o!==null;)r=o,o=r.return;return r.tag===3?r.stateNode:null}var ka={};function bM(r,o,l,u){this.tag=r,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jn(r,o,l,u){return new bM(r,o,l,u)}function em(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Es(r,o){var l=r.alternate;return l===null?(l=Jn(r.tag,o,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=o,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&65011712,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,o=r.dependencies,l.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l.refCleanup=r.refCleanup,l}function c0(r,o){r.flags&=65011714;var l=r.alternate;return l===null?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=l.childLanes,r.lanes=l.lanes,r.child=l.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=l.memoizedProps,r.memoizedState=l.memoizedState,r.updateQueue=l.updateQueue,r.type=l.type,o=l.dependencies,r.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),r}function bf(r,o,l,u,m,v){var E=0;if(u=r,typeof r=="function")em(r)&&(E=1);else if(typeof r=="string")E=Ek(r,l,Q.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case D:return r=Jn(31,l,o,m),r.elementType=D,r.lanes=v,r;case w:return Ci(l.children,m,v,o);case T:E=8,m|=24;break;case C:return r=Jn(12,l,o,m|2),r.elementType=C,r.lanes=v,r;case k:return r=Jn(13,l,o,m),r.elementType=k,r.lanes=v,r;case L:return r=Jn(19,l,o,m),r.elementType=L,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case N:E=10;break e;case A:E=9;break e;case R:E=11;break e;case j:E=14;break e;case O:E=16,u=null;break e}E=29,l=Error(s(130,r===null?"null":typeof r,"")),u=null}return o=Jn(E,l,o,m),o.elementType=r,o.type=u,o.lanes=v,o}function Ci(r,o,l,u){return r=Jn(7,r,u,o),r.lanes=l,r}function tm(r,o,l){return r=Jn(6,r,null,o),r.lanes=l,r}function u0(r){var o=Jn(18,null,null,0);return o.stateNode=r,o}function nm(r,o,l){return o=Jn(4,r.children!==null?r.children:[],r.key,o),o.lanes=l,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}var f0=new WeakMap;function Er(r,o){if(typeof r=="object"&&r!==null){var l=f0.get(r);return l!==void 0?l:(o={value:r,source:o,stack:ye(o)},f0.set(r,o),o)}return{value:r,source:o,stack:ye(o)}}var Ia=[],Da=0,xf=null,yc=0,Tr=[],Cr=0,fo=null,as=1,ls="";function Ts(r,o){Ia[Da++]=yc,Ia[Da++]=xf,xf=r,yc=o}function d0(r,o,l){Tr[Cr++]=as,Tr[Cr++]=ls,Tr[Cr++]=fo,fo=r;var u=as;r=ls;var m=32-xt(u)-1;u&=~(1<<m),l+=1;var v=32-xt(o)+m;if(30<v){var E=m-m%5;v=(u&(1<<E)-1).toString(32),u>>=E,m-=E,as=1<<32-xt(o)+m|l<<m|u,ls=v+r}else as=1<<v|l<<m|u,ls=r}function rm(r){r.return!==null&&(Ts(r,1),d0(r,1,0))}function sm(r){for(;r===xf;)xf=Ia[--Da],Ia[Da]=null,yc=Ia[--Da],Ia[Da]=null;for(;r===fo;)fo=Tr[--Cr],Tr[Cr]=null,ls=Tr[--Cr],Tr[Cr]=null,as=Tr[--Cr],Tr[Cr]=null}function h0(r,o){Tr[Cr++]=as,Tr[Cr++]=ls,Tr[Cr++]=fo,as=o.id,ls=o.overflow,fo=r}var bn=null,kt=null,rt=!1,ho=null,Rr=!1,om=Error(s(519));function po(r){var o=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vc(Er(o,r)),om}function p0(r){var o=r.stateNode,l=r.type,u=r.memoizedProps;switch(o[vn]=r,o[Dn]=u,l){case"dialog":et("cancel",o),et("close",o);break;case"iframe":case"object":case"embed":et("load",o);break;case"video":case"audio":for(l=0;l<$c.length;l++)et($c[l],o);break;case"source":et("error",o);break;case"img":case"image":case"link":et("error",o),et("load",o);break;case"details":et("toggle",o);break;case"input":et("invalid",o),Rx(o,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":et("invalid",o);break;case"textarea":et("invalid",o),jx(o,u.value,u.defaultValue,u.children)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||o.textContent===""+l||u.suppressHydrationWarning===!0||O_(o.textContent,l)?(u.popover!=null&&(et("beforetoggle",o),et("toggle",o)),u.onScroll!=null&&et("scroll",o),u.onScrollEnd!=null&&et("scrollend",o),u.onClick!=null&&(o.onclick=_s),o=!0):o=!1,o||po(r,!0)}function m0(r){for(bn=r.return;bn;)switch(bn.tag){case 5:case 31:case 13:Rr=!1;return;case 27:case 3:Rr=!0;return;default:bn=bn.return}}function Pa(r){if(r!==bn)return!1;if(!rt)return m0(r),rt=!0,!1;var o=r.tag,l;if((l=o!==3&&o!==27)&&((l=o===5)&&(l=r.type,l=!(l!=="form"&&l!=="button")||wg(r.type,r.memoizedProps)),l=!l),l&&kt&&po(r),m0(r),o===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));kt=$_(r)}else if(o===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(317));kt=$_(r)}else o===27?(o=kt,No(r.type)?(r=Ng,Ng=null,kt=r):kt=o):kt=bn?jr(r.stateNode.nextSibling):null;return!0}function Ri(){kt=bn=null,rt=!1}function im(){var r=ho;return r!==null&&($n===null?$n=r:$n.push.apply($n,r),ho=null),r}function vc(r){ho===null?ho=[r]:ho.push(r)}var am=I(null),Ni=null,Cs=null;function mo(r,o,l){W(am,o._currentValue),o._currentValue=l}function Rs(r){r._currentValue=am.current,G(am)}function lm(r,o,l){for(;r!==null;){var u=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,u!==null&&(u.childLanes|=o)):u!==null&&(u.childLanes&o)!==o&&(u.childLanes|=o),r===l)break;r=r.return}}function cm(r,o,l,u){var m=r.child;for(m!==null&&(m.return=r);m!==null;){var v=m.dependencies;if(v!==null){var E=m.child;v=v.firstContext;e:for(;v!==null;){var M=v;v=m;for(var $=0;$<o.length;$++)if(M.context===o[$]){v.lanes|=l,M=v.alternate,M!==null&&(M.lanes|=l),lm(v.return,l,r),u||(E=null);break e}v=M.next}}else if(m.tag===18){if(E=m.return,E===null)throw Error(s(341));E.lanes|=l,v=E.alternate,v!==null&&(v.lanes|=l),lm(E,l,r),E=null}else E=m.child;if(E!==null)E.return=m;else for(E=m;E!==null;){if(E===r){E=null;break}if(m=E.sibling,m!==null){m.return=E.return,E=m;break}E=E.return}m=E}}function za(r,o,l,u){r=null;for(var m=o,v=!1;m!==null;){if(!v){if((m.flags&524288)!==0)v=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var E=m.alternate;if(E===null)throw Error(s(387));if(E=E.memoizedProps,E!==null){var M=m.type;Wn(m.pendingProps.value,E.value)||(r!==null?r.push(M):r=[M])}}else if(m===pe.current){if(E=m.alternate,E===null)throw Error(s(387));E.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(r!==null?r.push(Vc):r=[Vc])}m=m.return}r!==null&&cm(o,r,l,u),o.flags|=262144}function Sf(r){for(r=r.firstContext;r!==null;){if(!Wn(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function ji(r){Ni=r,Cs=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function xn(r){return g0(Ni,r)}function _f(r,o){return Ni===null&&ji(r),g0(r,o)}function g0(r,o){var l=o._currentValue;if(o={context:o,memoizedValue:l,next:null},Cs===null){if(r===null)throw Error(s(308));Cs=o,r.dependencies={lanes:0,firstContext:o},r.flags|=524288}else Cs=Cs.next=o;return l}var xM=typeof AbortController<"u"?AbortController:function(){var r=[],o=this.signal={aborted:!1,addEventListener:function(l,u){r.push(u)}};this.abort=function(){o.aborted=!0,r.forEach(function(l){return l()})}},SM=e.unstable_scheduleCallback,_M=e.unstable_NormalPriority,Jt={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function um(){return{controller:new xM,data:new Map,refCount:0}}function bc(r){r.refCount--,r.refCount===0&&SM(_M,function(){r.controller.abort()})}var xc=null,fm=0,La=0,Ua=null;function wM(r,o){if(xc===null){var l=xc=[];fm=0,La=pg(),Ua={status:"pending",value:void 0,then:function(u){l.push(u)}}}return fm++,o.then(y0,y0),o}function y0(){if(--fm===0&&xc!==null){Ua!==null&&(Ua.status="fulfilled");var r=xc;xc=null,La=0,Ua=null;for(var o=0;o<r.length;o++)(0,r[o])()}}function EM(r,o){var l=[],u={status:"pending",value:null,reason:null,then:function(m){l.push(m)}};return r.then(function(){u.status="fulfilled",u.value=o;for(var m=0;m<l.length;m++)(0,l[m])(o)},function(m){for(u.status="rejected",u.reason=m,m=0;m<l.length;m++)(0,l[m])(void 0)}),u}var v0=P.S;P.S=function(r,o){t_=$e(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&wM(r,o),v0!==null&&v0(r,o)};var Ai=I(null);function dm(){var r=Ai.current;return r!==null?r:Nt.pooledCache}function wf(r,o){o===null?W(Ai,Ai.current):W(Ai,o.pool)}function b0(){var r=dm();return r===null?null:{parent:Jt._currentValue,pool:r}}var $a=Error(s(460)),hm=Error(s(474)),Ef=Error(s(542)),Tf={then:function(){}};function x0(r){return r=r.status,r==="fulfilled"||r==="rejected"}function S0(r,o,l){switch(l=r[l],l===void 0?r.push(o):l!==o&&(o.then(_s,_s),o=l),o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,w0(r),r;default:if(typeof o.status=="string")o.then(_s,_s);else{if(r=Nt,r!==null&&100<r.shellSuspendCounter)throw Error(s(482));r=o,r.status="pending",r.then(function(u){if(o.status==="pending"){var m=o;m.status="fulfilled",m.value=u}},function(u){if(o.status==="pending"){var m=o;m.status="rejected",m.reason=u}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,w0(r),r}throw Mi=o,$a}}function Oi(r){try{var o=r._init;return o(r._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Mi=l,$a):l}}var Mi=null;function _0(){if(Mi===null)throw Error(s(459));var r=Mi;return Mi=null,r}function w0(r){if(r===$a||r===Ef)throw Error(s(483))}var Ba=null,Sc=0;function Cf(r){var o=Sc;return Sc+=1,Ba===null&&(Ba=[]),S0(Ba,r,o)}function _c(r,o){o=o.props.ref,r.ref=o!==void 0?o:null}function Rf(r,o){throw o.$$typeof===b?Error(s(525)):(r=Object.prototype.toString.call(o),Error(s(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r)))}function E0(r){function o(Z,H){if(r){var J=Z.deletions;J===null?(Z.deletions=[H],Z.flags|=16):J.push(H)}}function l(Z,H){if(!r)return null;for(;H!==null;)o(Z,H),H=H.sibling;return null}function u(Z){for(var H=new Map;Z!==null;)Z.key!==null?H.set(Z.key,Z):H.set(Z.index,Z),Z=Z.sibling;return H}function m(Z,H){return Z=Es(Z,H),Z.index=0,Z.sibling=null,Z}function v(Z,H,J){return Z.index=J,r?(J=Z.alternate,J!==null?(J=J.index,J<H?(Z.flags|=67108866,H):J):(Z.flags|=67108866,H)):(Z.flags|=1048576,H)}function E(Z){return r&&Z.alternate===null&&(Z.flags|=67108866),Z}function M(Z,H,J,ce){return H===null||H.tag!==6?(H=tm(J,Z.mode,ce),H.return=Z,H):(H=m(H,J),H.return=Z,H)}function $(Z,H,J,ce){var Pe=J.type;return Pe===w?le(Z,H,J.props.children,ce,J.key):H!==null&&(H.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===O&&Oi(Pe)===H.type)?(H=m(H,J.props),_c(H,J),H.return=Z,H):(H=bf(J.type,J.key,J.props,null,Z.mode,ce),_c(H,J),H.return=Z,H)}function ee(Z,H,J,ce){return H===null||H.tag!==4||H.stateNode.containerInfo!==J.containerInfo||H.stateNode.implementation!==J.implementation?(H=nm(J,Z.mode,ce),H.return=Z,H):(H=m(H,J.children||[]),H.return=Z,H)}function le(Z,H,J,ce,Pe){return H===null||H.tag!==7?(H=Ci(J,Z.mode,ce,Pe),H.return=Z,H):(H=m(H,J),H.return=Z,H)}function fe(Z,H,J){if(typeof H=="string"&&H!==""||typeof H=="number"||typeof H=="bigint")return H=tm(""+H,Z.mode,J),H.return=Z,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case x:return J=bf(H.type,H.key,H.props,null,Z.mode,J),_c(J,H),J.return=Z,J;case S:return H=nm(H,Z.mode,J),H.return=Z,H;case O:return H=Oi(H),fe(Z,H,J)}if(te(H)||z(H))return H=Ci(H,Z.mode,J,null),H.return=Z,H;if(typeof H.then=="function")return fe(Z,Cf(H),J);if(H.$$typeof===N)return fe(Z,_f(Z,H),J);Rf(Z,H)}return null}function ne(Z,H,J,ce){var Pe=H!==null?H.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Pe!==null?null:M(Z,H,""+J,ce);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return J.key===Pe?$(Z,H,J,ce):null;case S:return J.key===Pe?ee(Z,H,J,ce):null;case O:return J=Oi(J),ne(Z,H,J,ce)}if(te(J)||z(J))return Pe!==null?null:le(Z,H,J,ce,null);if(typeof J.then=="function")return ne(Z,H,Cf(J),ce);if(J.$$typeof===N)return ne(Z,H,_f(Z,J),ce);Rf(Z,J)}return null}function ie(Z,H,J,ce,Pe){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Z=Z.get(J)||null,M(H,Z,""+ce,Pe);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:return Z=Z.get(ce.key===null?J:ce.key)||null,$(H,Z,ce,Pe);case S:return Z=Z.get(ce.key===null?J:ce.key)||null,ee(H,Z,ce,Pe);case O:return ce=Oi(ce),ie(Z,H,J,ce,Pe)}if(te(ce)||z(ce))return Z=Z.get(J)||null,le(H,Z,ce,Pe,null);if(typeof ce.then=="function")return ie(Z,H,J,Cf(ce),Pe);if(ce.$$typeof===N)return ie(Z,H,J,_f(H,ce),Pe);Rf(H,ce)}return null}function Re(Z,H,J,ce){for(var Pe=null,ft=null,Oe=H,Ye=H=0,nt=null;Oe!==null&&Ye<J.length;Ye++){Oe.index>Ye?(nt=Oe,Oe=null):nt=Oe.sibling;var dt=ne(Z,Oe,J[Ye],ce);if(dt===null){Oe===null&&(Oe=nt);break}r&&Oe&&dt.alternate===null&&o(Z,Oe),H=v(dt,H,Ye),ft===null?Pe=dt:ft.sibling=dt,ft=dt,Oe=nt}if(Ye===J.length)return l(Z,Oe),rt&&Ts(Z,Ye),Pe;if(Oe===null){for(;Ye<J.length;Ye++)Oe=fe(Z,J[Ye],ce),Oe!==null&&(H=v(Oe,H,Ye),ft===null?Pe=Oe:ft.sibling=Oe,ft=Oe);return rt&&Ts(Z,Ye),Pe}for(Oe=u(Oe);Ye<J.length;Ye++)nt=ie(Oe,Z,Ye,J[Ye],ce),nt!==null&&(r&&nt.alternate!==null&&Oe.delete(nt.key===null?Ye:nt.key),H=v(nt,H,Ye),ft===null?Pe=nt:ft.sibling=nt,ft=nt);return r&&Oe.forEach(function(ko){return o(Z,ko)}),rt&&Ts(Z,Ye),Pe}function Ue(Z,H,J,ce){if(J==null)throw Error(s(151));for(var Pe=null,ft=null,Oe=H,Ye=H=0,nt=null,dt=J.next();Oe!==null&&!dt.done;Ye++,dt=J.next()){Oe.index>Ye?(nt=Oe,Oe=null):nt=Oe.sibling;var ko=ne(Z,Oe,dt.value,ce);if(ko===null){Oe===null&&(Oe=nt);break}r&&Oe&&ko.alternate===null&&o(Z,Oe),H=v(ko,H,Ye),ft===null?Pe=ko:ft.sibling=ko,ft=ko,Oe=nt}if(dt.done)return l(Z,Oe),rt&&Ts(Z,Ye),Pe;if(Oe===null){for(;!dt.done;Ye++,dt=J.next())dt=fe(Z,dt.value,ce),dt!==null&&(H=v(dt,H,Ye),ft===null?Pe=dt:ft.sibling=dt,ft=dt);return rt&&Ts(Z,Ye),Pe}for(Oe=u(Oe);!dt.done;Ye++,dt=J.next())dt=ie(Oe,Z,Ye,dt.value,ce),dt!==null&&(r&&dt.alternate!==null&&Oe.delete(dt.key===null?Ye:dt.key),H=v(dt,H,Ye),ft===null?Pe=dt:ft.sibling=dt,ft=dt);return r&&Oe.forEach(function(Dk){return o(Z,Dk)}),rt&&Ts(Z,Ye),Pe}function Ct(Z,H,J,ce){if(typeof J=="object"&&J!==null&&J.type===w&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case x:e:{for(var Pe=J.key;H!==null;){if(H.key===Pe){if(Pe=J.type,Pe===w){if(H.tag===7){l(Z,H.sibling),ce=m(H,J.props.children),ce.return=Z,Z=ce;break e}}else if(H.elementType===Pe||typeof Pe=="object"&&Pe!==null&&Pe.$$typeof===O&&Oi(Pe)===H.type){l(Z,H.sibling),ce=m(H,J.props),_c(ce,J),ce.return=Z,Z=ce;break e}l(Z,H);break}else o(Z,H);H=H.sibling}J.type===w?(ce=Ci(J.props.children,Z.mode,ce,J.key),ce.return=Z,Z=ce):(ce=bf(J.type,J.key,J.props,null,Z.mode,ce),_c(ce,J),ce.return=Z,Z=ce)}return E(Z);case S:e:{for(Pe=J.key;H!==null;){if(H.key===Pe)if(H.tag===4&&H.stateNode.containerInfo===J.containerInfo&&H.stateNode.implementation===J.implementation){l(Z,H.sibling),ce=m(H,J.children||[]),ce.return=Z,Z=ce;break e}else{l(Z,H);break}else o(Z,H);H=H.sibling}ce=nm(J,Z.mode,ce),ce.return=Z,Z=ce}return E(Z);case O:return J=Oi(J),Ct(Z,H,J,ce)}if(te(J))return Re(Z,H,J,ce);if(z(J)){if(Pe=z(J),typeof Pe!="function")throw Error(s(150));return J=Pe.call(J),Ue(Z,H,J,ce)}if(typeof J.then=="function")return Ct(Z,H,Cf(J),ce);if(J.$$typeof===N)return Ct(Z,H,_f(Z,J),ce);Rf(Z,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,H!==null&&H.tag===6?(l(Z,H.sibling),ce=m(H,J),ce.return=Z,Z=ce):(l(Z,H),ce=tm(J,Z.mode,ce),ce.return=Z,Z=ce),E(Z)):l(Z,H)}return function(Z,H,J,ce){try{Sc=0;var Pe=Ct(Z,H,J,ce);return Ba=null,Pe}catch(Oe){if(Oe===$a||Oe===Ef)throw Oe;var ft=Jn(29,Oe,null,Z.mode);return ft.lanes=ce,ft.return=Z,ft}}}var ki=E0(!0),T0=E0(!1),go=!1;function pm(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mm(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function yo(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function vo(r,o,l){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(gt&2)!==0){var m=u.pending;return m===null?o.next=o:(o.next=m.next,m.next=o),u.pending=o,o=vf(r),l0(r,null,l),o}return yf(r,u,o,l),vf(r)}function wc(r,o,l){if(o=o.updateQueue,o!==null&&(o=o.shared,(l&4194048)!==0)){var u=o.lanes;u&=r.pendingLanes,l|=u,o.lanes=l,ao(r,l)}}function gm(r,o){var l=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var m=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var E={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};v===null?m=v=E:v=v.next=E,l=l.next}while(l!==null);v===null?m=v=o:v=v.next=o}else m=v=o;l={baseState:u.baseState,firstBaseUpdate:m,lastBaseUpdate:v,shared:u.shared,callbacks:u.callbacks},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=o:r.next=o,l.lastBaseUpdate=o}var ym=!1;function Ec(){if(ym){var r=Ua;if(r!==null)throw r}}function Tc(r,o,l,u){ym=!1;var m=r.updateQueue;go=!1;var v=m.firstBaseUpdate,E=m.lastBaseUpdate,M=m.shared.pending;if(M!==null){m.shared.pending=null;var $=M,ee=$.next;$.next=null,E===null?v=ee:E.next=ee,E=$;var le=r.alternate;le!==null&&(le=le.updateQueue,M=le.lastBaseUpdate,M!==E&&(M===null?le.firstBaseUpdate=ee:M.next=ee,le.lastBaseUpdate=$))}if(v!==null){var fe=m.baseState;E=0,le=ee=$=null,M=v;do{var ne=M.lane&-536870913,ie=ne!==M.lane;if(ie?(tt&ne)===ne:(u&ne)===ne){ne!==0&&ne===La&&(ym=!0),le!==null&&(le=le.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var Re=r,Ue=M;ne=o;var Ct=l;switch(Ue.tag){case 1:if(Re=Ue.payload,typeof Re=="function"){fe=Re.call(Ct,fe,ne);break e}fe=Re;break e;case 3:Re.flags=Re.flags&-65537|128;case 0:if(Re=Ue.payload,ne=typeof Re=="function"?Re.call(Ct,fe,ne):Re,ne==null)break e;fe=y({},fe,ne);break e;case 2:go=!0}}ne=M.callback,ne!==null&&(r.flags|=64,ie&&(r.flags|=8192),ie=m.callbacks,ie===null?m.callbacks=[ne]:ie.push(ne))}else ie={lane:ne,tag:M.tag,payload:M.payload,callback:M.callback,next:null},le===null?(ee=le=ie,$=fe):le=le.next=ie,E|=ne;if(M=M.next,M===null){if(M=m.shared.pending,M===null)break;ie=M,M=ie.next,ie.next=null,m.lastBaseUpdate=ie,m.shared.pending=null}}while(!0);le===null&&($=fe),m.baseState=$,m.firstBaseUpdate=ee,m.lastBaseUpdate=le,v===null&&(m.shared.lanes=0),wo|=E,r.lanes=E,r.memoizedState=fe}}function C0(r,o){if(typeof r!="function")throw Error(s(191,r));r.call(o)}function R0(r,o){var l=r.callbacks;if(l!==null)for(r.callbacks=null,r=0;r<l.length;r++)C0(l[r],o)}var Fa=I(null),Nf=I(0);function N0(r,o){r=Ps,W(Nf,r),W(Fa,o),Ps=r|o.baseLanes}function vm(){W(Nf,Ps),W(Fa,Fa.current)}function bm(){Ps=Nf.current,G(Fa),G(Nf)}var er=I(null),Nr=null;function bo(r){var o=r.alternate;W(Xt,Xt.current&1),W(er,r),Nr===null&&(o===null||Fa.current!==null||o.memoizedState!==null)&&(Nr=r)}function xm(r){W(Xt,Xt.current),W(er,r),Nr===null&&(Nr=r)}function j0(r){r.tag===22?(W(Xt,Xt.current),W(er,r),Nr===null&&(Nr=r)):xo()}function xo(){W(Xt,Xt.current),W(er,er.current)}function tr(r){G(er),Nr===r&&(Nr=null),G(Xt)}var Xt=I(0);function jf(r){for(var o=r;o!==null;){if(o.tag===13){var l=o.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Cg(l)||Rg(l)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Ns=0,Ze=null,Et=null,en=null,Af=!1,Ha=!1,Ii=!1,Of=0,Cc=0,qa=null,TM=0;function Ht(){throw Error(s(321))}function Sm(r,o){if(o===null)return!1;for(var l=0;l<o.length&&l<r.length;l++)if(!Wn(r[l],o[l]))return!1;return!0}function _m(r,o,l,u,m,v){return Ns=v,Ze=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,P.H=r===null||r.memoizedState===null?dS:zm,Ii=!1,v=l(u,m),Ii=!1,Ha&&(v=O0(o,l,u,m)),A0(r),v}function A0(r){P.H=jc;var o=Et!==null&&Et.next!==null;if(Ns=0,en=Et=Ze=null,Af=!1,Cc=0,qa=null,o)throw Error(s(300));r===null||tn||(r=r.dependencies,r!==null&&Sf(r)&&(tn=!0))}function O0(r,o,l,u){Ze=r;var m=0;do{if(Ha&&(qa=null),Cc=0,Ha=!1,25<=m)throw Error(s(301));if(m+=1,en=Et=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}P.H=hS,v=o(l,u)}while(Ha);return v}function CM(){var r=P.H,o=r.useState()[0];return o=typeof o.then=="function"?Rc(o):o,r=r.useState()[0],(Et!==null?Et.memoizedState:null)!==r&&(Ze.flags|=1024),o}function wm(){var r=Of!==0;return Of=0,r}function Em(r,o,l){o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~l}function Tm(r){if(Af){for(r=r.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Af=!1}Ns=0,en=Et=Ze=null,Ha=!1,Cc=Of=0,qa=null}function Nn(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return en===null?Ze.memoizedState=en=r:en=en.next=r,en}function Qt(){if(Et===null){var r=Ze.alternate;r=r!==null?r.memoizedState:null}else r=Et.next;var o=en===null?Ze.memoizedState:en.next;if(o!==null)en=o,Et=r;else{if(r===null)throw Ze.alternate===null?Error(s(467)):Error(s(310));Et=r,r={memoizedState:Et.memoizedState,baseState:Et.baseState,baseQueue:Et.baseQueue,queue:Et.queue,next:null},en===null?Ze.memoizedState=en=r:en=en.next=r}return en}function Mf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Rc(r){var o=Cc;return Cc+=1,qa===null&&(qa=[]),r=S0(qa,r,o),o=Ze,(en===null?o.memoizedState:en.next)===null&&(o=o.alternate,P.H=o===null||o.memoizedState===null?dS:zm),r}function kf(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Rc(r);if(r.$$typeof===N)return xn(r)}throw Error(s(438,String(r)))}function Cm(r){var o=null,l=Ze.updateQueue;if(l!==null&&(o=l.memoCache),o==null){var u=Ze.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(o={data:u.data.map(function(m){return m.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),l===null&&(l=Mf(),Ze.updateQueue=l),l.memoCache=o,l=o.data[o.index],l===void 0)for(l=o.data[o.index]=Array(r),u=0;u<r;u++)l[u]=K;return o.index++,l}function js(r,o){return typeof o=="function"?o(r):o}function If(r){var o=Qt();return Rm(o,Et,r)}function Rm(r,o,l){var u=r.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=l;var m=r.baseQueue,v=u.pending;if(v!==null){if(m!==null){var E=m.next;m.next=v.next,v.next=E}o.baseQueue=m=v,u.pending=null}if(v=r.baseState,m===null)r.memoizedState=v;else{o=m.next;var M=E=null,$=null,ee=o,le=!1;do{var fe=ee.lane&-536870913;if(fe!==ee.lane?(tt&fe)===fe:(Ns&fe)===fe){var ne=ee.revertLane;if(ne===0)$!==null&&($=$.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),fe===La&&(le=!0);else if((Ns&ne)===ne){ee=ee.next,ne===La&&(le=!0);continue}else fe={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},$===null?(M=$=fe,E=v):$=$.next=fe,Ze.lanes|=ne,wo|=ne;fe=ee.action,Ii&&l(v,fe),v=ee.hasEagerState?ee.eagerState:l(v,fe)}else ne={lane:fe,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},$===null?(M=$=ne,E=v):$=$.next=ne,Ze.lanes|=fe,wo|=fe;ee=ee.next}while(ee!==null&&ee!==o);if($===null?E=v:$.next=M,!Wn(v,r.memoizedState)&&(tn=!0,le&&(l=Ua,l!==null)))throw l;r.memoizedState=v,r.baseState=E,r.baseQueue=$,u.lastRenderedState=v}return m===null&&(u.lanes=0),[r.memoizedState,u.dispatch]}function Nm(r){var o=Qt(),l=o.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=r;var u=l.dispatch,m=l.pending,v=o.memoizedState;if(m!==null){l.pending=null;var E=m=m.next;do v=r(v,E.action),E=E.next;while(E!==m);Wn(v,o.memoizedState)||(tn=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),l.lastRenderedState=v}return[v,u]}function M0(r,o,l){var u=Ze,m=Qt(),v=rt;if(v){if(l===void 0)throw Error(s(407));l=l()}else l=o();var E=!Wn((Et||m).memoizedState,l);if(E&&(m.memoizedState=l,tn=!0),m=m.queue,Om(D0.bind(null,u,m,r),[r]),m.getSnapshot!==o||E||en!==null&&en.memoizedState.tag&1){if(u.flags|=2048,Va(9,{destroy:void 0},I0.bind(null,u,m,l,o),null),Nt===null)throw Error(s(349));v||(Ns&127)!==0||k0(u,o,l)}return l}function k0(r,o,l){r.flags|=16384,r={getSnapshot:o,value:l},o=Ze.updateQueue,o===null?(o=Mf(),Ze.updateQueue=o,o.stores=[r]):(l=o.stores,l===null?o.stores=[r]:l.push(r))}function I0(r,o,l,u){o.value=l,o.getSnapshot=u,P0(o)&&z0(r)}function D0(r,o,l){return l(function(){P0(o)&&z0(r)})}function P0(r){var o=r.getSnapshot;r=r.value;try{var l=o();return!Wn(r,l)}catch{return!0}}function z0(r){var o=Ti(r,2);o!==null&&Bn(o,r,2)}function jm(r){var o=Nn();if(typeof r=="function"){var l=r;if(r=l(),Ii){ut(!0);try{l()}finally{ut(!1)}}}return o.memoizedState=o.baseState=r,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:r},o}function L0(r,o,l,u){return r.baseState=l,Rm(r,Et,typeof u=="function"?u:js)}function RM(r,o,l,u,m){if(zf(r))throw Error(s(485));if(r=o.action,r!==null){var v={payload:m,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){v.listeners.push(E)}};P.T!==null?l(!0):v.isTransition=!1,u(v),l=o.pending,l===null?(v.next=o.pending=v,U0(o,v)):(v.next=l.next,o.pending=l.next=v)}}function U0(r,o){var l=o.action,u=o.payload,m=r.state;if(o.isTransition){var v=P.T,E={};P.T=E;try{var M=l(m,u),$=P.S;$!==null&&$(E,M),$0(r,o,M)}catch(ee){Am(r,o,ee)}finally{v!==null&&E.types!==null&&(v.types=E.types),P.T=v}}else try{v=l(m,u),$0(r,o,v)}catch(ee){Am(r,o,ee)}}function $0(r,o,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){B0(r,o,u)},function(u){return Am(r,o,u)}):B0(r,o,l)}function B0(r,o,l){o.status="fulfilled",o.value=l,F0(o),r.state=l,o=r.pending,o!==null&&(l=o.next,l===o?r.pending=null:(l=l.next,o.next=l,U0(r,l)))}function Am(r,o,l){var u=r.pending;if(r.pending=null,u!==null){u=u.next;do o.status="rejected",o.reason=l,F0(o),o=o.next;while(o!==u)}r.action=null}function F0(r){r=r.listeners;for(var o=0;o<r.length;o++)(0,r[o])()}function H0(r,o){return o}function q0(r,o){if(rt){var l=Nt.formState;if(l!==null){e:{var u=Ze;if(rt){if(kt){t:{for(var m=kt,v=Rr;m.nodeType!==8;){if(!v){m=null;break t}if(m=jr(m.nextSibling),m===null){m=null;break t}}v=m.data,m=v==="F!"||v==="F"?m:null}if(m){kt=jr(m.nextSibling),u=m.data==="F!";break e}}po(u)}u=!1}u&&(o=l[0])}}return l=Nn(),l.memoizedState=l.baseState=o,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:H0,lastRenderedState:o},l.queue=u,l=cS.bind(null,Ze,u),u.dispatch=l,u=jm(!1),v=Pm.bind(null,Ze,!1,u.queue),u=Nn(),m={state:o,dispatch:null,action:r,pending:null},u.queue=m,l=RM.bind(null,Ze,m,v,l),m.dispatch=l,u.memoizedState=r,[o,l,!1]}function V0(r){var o=Qt();return K0(o,Et,r)}function K0(r,o,l){if(o=Rm(r,o,H0)[0],r=If(js)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var u=Rc(o)}catch(E){throw E===$a?Ef:E}else u=o;o=Qt();var m=o.queue,v=m.dispatch;return l!==o.memoizedState&&(Ze.flags|=2048,Va(9,{destroy:void 0},NM.bind(null,m,l),null)),[u,v,r]}function NM(r,o){r.action=o}function G0(r){var o=Qt(),l=Et;if(l!==null)return K0(o,l,r);Qt(),o=o.memoizedState,l=Qt();var u=l.queue.dispatch;return l.memoizedState=r,[o,u,!1]}function Va(r,o,l,u){return r={tag:r,create:l,deps:u,inst:o,next:null},o=Ze.updateQueue,o===null&&(o=Mf(),Ze.updateQueue=o),l=o.lastEffect,l===null?o.lastEffect=r.next=r:(u=l.next,l.next=r,r.next=u,o.lastEffect=r),r}function Z0(){return Qt().memoizedState}function Df(r,o,l,u){var m=Nn();Ze.flags|=r,m.memoizedState=Va(1|o,{destroy:void 0},l,u===void 0?null:u)}function Pf(r,o,l,u){var m=Qt();u=u===void 0?null:u;var v=m.memoizedState.inst;Et!==null&&u!==null&&Sm(u,Et.memoizedState.deps)?m.memoizedState=Va(o,v,l,u):(Ze.flags|=r,m.memoizedState=Va(1|o,v,l,u))}function Y0(r,o){Df(8390656,8,r,o)}function Om(r,o){Pf(2048,8,r,o)}function jM(r){Ze.flags|=4;var o=Ze.updateQueue;if(o===null)o=Mf(),Ze.updateQueue=o,o.events=[r];else{var l=o.events;l===null?o.events=[r]:l.push(r)}}function X0(r){var o=Qt().memoizedState;return jM({ref:o,nextImpl:r}),function(){if((gt&2)!==0)throw Error(s(440));return o.impl.apply(void 0,arguments)}}function Q0(r,o){return Pf(4,2,r,o)}function W0(r,o){return Pf(4,4,r,o)}function J0(r,o){if(typeof o=="function"){r=r();var l=o(r);return function(){typeof l=="function"?l():o(null)}}if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function eS(r,o,l){l=l!=null?l.concat([r]):null,Pf(4,4,J0.bind(null,o,r),l)}function Mm(){}function tS(r,o){var l=Qt();o=o===void 0?null:o;var u=l.memoizedState;return o!==null&&Sm(o,u[1])?u[0]:(l.memoizedState=[r,o],r)}function nS(r,o){var l=Qt();o=o===void 0?null:o;var u=l.memoizedState;if(o!==null&&Sm(o,u[1]))return u[0];if(u=r(),Ii){ut(!0);try{r()}finally{ut(!1)}}return l.memoizedState=[u,o],u}function km(r,o,l){return l===void 0||(Ns&1073741824)!==0&&(tt&261930)===0?r.memoizedState=o:(r.memoizedState=l,r=r_(),Ze.lanes|=r,wo|=r,l)}function rS(r,o,l,u){return Wn(l,o)?l:Fa.current!==null?(r=km(r,l,u),Wn(r,o)||(tn=!0),r):(Ns&42)===0||(Ns&1073741824)!==0&&(tt&261930)===0?(tn=!0,r.memoizedState=l):(r=r_(),Ze.lanes|=r,wo|=r,o)}function sS(r,o,l,u,m){var v=V.p;V.p=v!==0&&8>v?v:8;var E=P.T,M={};P.T=M,Pm(r,!1,o,l);try{var $=m(),ee=P.S;if(ee!==null&&ee(M,$),$!==null&&typeof $=="object"&&typeof $.then=="function"){var le=EM($,u);Nc(r,o,le,sr(r))}else Nc(r,o,u,sr(r))}catch(fe){Nc(r,o,{then:function(){},status:"rejected",reason:fe},sr())}finally{V.p=v,E!==null&&M.types!==null&&(E.types=M.types),P.T=E}}function AM(){}function Im(r,o,l,u){if(r.tag!==5)throw Error(s(476));var m=oS(r).queue;sS(r,m,o,B,l===null?AM:function(){return iS(r),l(u)})}function oS(r){var o=r.memoizedState;if(o!==null)return o;o={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:B},next:null};var l={};return o.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:l},next:null},r.memoizedState=o,r=r.alternate,r!==null&&(r.memoizedState=o),o}function iS(r){var o=oS(r);o.next===null&&(o=r.alternate.memoizedState),Nc(r,o.next.queue,{},sr())}function Dm(){return xn(Vc)}function aS(){return Qt().memoizedState}function lS(){return Qt().memoizedState}function OM(r){for(var o=r.return;o!==null;){switch(o.tag){case 24:case 3:var l=sr();r=yo(l);var u=vo(o,r,l);u!==null&&(Bn(u,o,l),wc(u,o,l)),o={cache:um()},r.payload=o;return}o=o.return}}function MM(r,o,l){var u=sr();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},zf(r)?uS(o,l):(l=Jp(r,o,l,u),l!==null&&(Bn(l,r,u),fS(l,o,u)))}function cS(r,o,l){var u=sr();Nc(r,o,l,u)}function Nc(r,o,l,u){var m={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(zf(r))uS(o,m);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var E=o.lastRenderedState,M=v(E,l);if(m.hasEagerState=!0,m.eagerState=M,Wn(M,E))return yf(r,o,m,0),Nt===null&&gf(),!1}catch{}if(l=Jp(r,o,m,u),l!==null)return Bn(l,r,u),fS(l,o,u),!0}return!1}function Pm(r,o,l,u){if(u={lane:2,revertLane:pg(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},zf(r)){if(o)throw Error(s(479))}else o=Jp(r,l,u,2),o!==null&&Bn(o,r,2)}function zf(r){var o=r.alternate;return r===Ze||o!==null&&o===Ze}function uS(r,o){Ha=Af=!0;var l=r.pending;l===null?o.next=o:(o.next=l.next,l.next=o),r.pending=o}function fS(r,o,l){if((l&4194048)!==0){var u=o.lanes;u&=r.pendingLanes,l|=u,o.lanes=l,ao(r,l)}}var jc={readContext:xn,use:kf,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht,useHostTransitionStatus:Ht,useFormState:Ht,useActionState:Ht,useOptimistic:Ht,useMemoCache:Ht,useCacheRefresh:Ht};jc.useEffectEvent=Ht;var dS={readContext:xn,use:kf,useCallback:function(r,o){return Nn().memoizedState=[r,o===void 0?null:o],r},useContext:xn,useEffect:Y0,useImperativeHandle:function(r,o,l){l=l!=null?l.concat([r]):null,Df(4194308,4,J0.bind(null,o,r),l)},useLayoutEffect:function(r,o){return Df(4194308,4,r,o)},useInsertionEffect:function(r,o){Df(4,2,r,o)},useMemo:function(r,o){var l=Nn();o=o===void 0?null:o;var u=r();if(Ii){ut(!0);try{r()}finally{ut(!1)}}return l.memoizedState=[u,o],u},useReducer:function(r,o,l){var u=Nn();if(l!==void 0){var m=l(o);if(Ii){ut(!0);try{l(o)}finally{ut(!1)}}}else m=o;return u.memoizedState=u.baseState=m,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:m},u.queue=r,r=r.dispatch=MM.bind(null,Ze,r),[u.memoizedState,r]},useRef:function(r){var o=Nn();return r={current:r},o.memoizedState=r},useState:function(r){r=jm(r);var o=r.queue,l=cS.bind(null,Ze,o);return o.dispatch=l,[r.memoizedState,l]},useDebugValue:Mm,useDeferredValue:function(r,o){var l=Nn();return km(l,r,o)},useTransition:function(){var r=jm(!1);return r=sS.bind(null,Ze,r.queue,!0,!1),Nn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,o,l){var u=Ze,m=Nn();if(rt){if(l===void 0)throw Error(s(407));l=l()}else{if(l=o(),Nt===null)throw Error(s(349));(tt&127)!==0||k0(u,o,l)}m.memoizedState=l;var v={value:l,getSnapshot:o};return m.queue=v,Y0(D0.bind(null,u,v,r),[r]),u.flags|=2048,Va(9,{destroy:void 0},I0.bind(null,u,v,l,o),null),l},useId:function(){var r=Nn(),o=Nt.identifierPrefix;if(rt){var l=ls,u=as;l=(u&~(1<<32-xt(u)-1)).toString(32)+l,o="_"+o+"R_"+l,l=Of++,0<l&&(o+="H"+l.toString(32)),o+="_"}else l=TM++,o="_"+o+"r_"+l.toString(32)+"_";return r.memoizedState=o},useHostTransitionStatus:Dm,useFormState:q0,useActionState:q0,useOptimistic:function(r){var o=Nn();o.memoizedState=o.baseState=r;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=l,o=Pm.bind(null,Ze,!0,l),l.dispatch=o,[r,o]},useMemoCache:Cm,useCacheRefresh:function(){return Nn().memoizedState=OM.bind(null,Ze)},useEffectEvent:function(r){var o=Nn(),l={impl:r};return o.memoizedState=l,function(){if((gt&2)!==0)throw Error(s(440));return l.impl.apply(void 0,arguments)}}},zm={readContext:xn,use:kf,useCallback:tS,useContext:xn,useEffect:Om,useImperativeHandle:eS,useInsertionEffect:Q0,useLayoutEffect:W0,useMemo:nS,useReducer:If,useRef:Z0,useState:function(){return If(js)},useDebugValue:Mm,useDeferredValue:function(r,o){var l=Qt();return rS(l,Et.memoizedState,r,o)},useTransition:function(){var r=If(js)[0],o=Qt().memoizedState;return[typeof r=="boolean"?r:Rc(r),o]},useSyncExternalStore:M0,useId:aS,useHostTransitionStatus:Dm,useFormState:V0,useActionState:V0,useOptimistic:function(r,o){var l=Qt();return L0(l,Et,r,o)},useMemoCache:Cm,useCacheRefresh:lS};zm.useEffectEvent=X0;var hS={readContext:xn,use:kf,useCallback:tS,useContext:xn,useEffect:Om,useImperativeHandle:eS,useInsertionEffect:Q0,useLayoutEffect:W0,useMemo:nS,useReducer:Nm,useRef:Z0,useState:function(){return Nm(js)},useDebugValue:Mm,useDeferredValue:function(r,o){var l=Qt();return Et===null?km(l,r,o):rS(l,Et.memoizedState,r,o)},useTransition:function(){var r=Nm(js)[0],o=Qt().memoizedState;return[typeof r=="boolean"?r:Rc(r),o]},useSyncExternalStore:M0,useId:aS,useHostTransitionStatus:Dm,useFormState:G0,useActionState:G0,useOptimistic:function(r,o){var l=Qt();return Et!==null?L0(l,Et,r,o):(l.baseState=r,[r,l.queue.dispatch])},useMemoCache:Cm,useCacheRefresh:lS};hS.useEffectEvent=X0;function Lm(r,o,l,u){o=r.memoizedState,l=l(u,o),l=l==null?o:y({},o,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var Um={enqueueSetState:function(r,o,l){r=r._reactInternals;var u=sr(),m=yo(u);m.payload=o,l!=null&&(m.callback=l),o=vo(r,m,u),o!==null&&(Bn(o,r,u),wc(o,r,u))},enqueueReplaceState:function(r,o,l){r=r._reactInternals;var u=sr(),m=yo(u);m.tag=1,m.payload=o,l!=null&&(m.callback=l),o=vo(r,m,u),o!==null&&(Bn(o,r,u),wc(o,r,u))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var l=sr(),u=yo(l);u.tag=2,o!=null&&(u.callback=o),o=vo(r,u,l),o!==null&&(Bn(o,r,l),wc(o,r,l))}};function pS(r,o,l,u,m,v,E){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,v,E):o.prototype&&o.prototype.isPureReactComponent?!mc(l,u)||!mc(m,v):!0}function mS(r,o,l,u){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(l,u),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(l,u),o.state!==r&&Um.enqueueReplaceState(o,o.state,null)}function Di(r,o){var l=o;if("ref"in o){l={};for(var u in o)u!=="ref"&&(l[u]=o[u])}if(r=r.defaultProps){l===o&&(l=y({},l));for(var m in r)l[m]===void 0&&(l[m]=r[m])}return l}function gS(r){mf(r)}function yS(r){console.error(r)}function vS(r){mf(r)}function Lf(r,o){try{var l=r.onUncaughtError;l(o.value,{componentStack:o.stack})}catch(u){setTimeout(function(){throw u})}}function bS(r,o,l){try{var u=r.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function $m(r,o,l){return l=yo(l),l.tag=3,l.payload={element:null},l.callback=function(){Lf(r,o)},l}function xS(r){return r=yo(r),r.tag=3,r}function SS(r,o,l,u){var m=l.type.getDerivedStateFromError;if(typeof m=="function"){var v=u.value;r.payload=function(){return m(v)},r.callback=function(){bS(o,l,u)}}var E=l.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(r.callback=function(){bS(o,l,u),typeof m!="function"&&(Eo===null?Eo=new Set([this]):Eo.add(this));var M=u.stack;this.componentDidCatch(u.value,{componentStack:M!==null?M:""})})}function kM(r,o,l,u,m){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(o=l.alternate,o!==null&&za(o,l,m,!0),l=er.current,l!==null){switch(l.tag){case 31:case 13:return Nr===null?Xf():l.alternate===null&&qt===0&&(qt=3),l.flags&=-257,l.flags|=65536,l.lanes=m,u===Tf?l.flags|=16384:(o=l.updateQueue,o===null?l.updateQueue=new Set([u]):o.add(u),fg(r,u,m)),!1;case 22:return l.flags|=65536,u===Tf?l.flags|=16384:(o=l.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=o):(l=o.retryQueue,l===null?o.retryQueue=new Set([u]):l.add(u)),fg(r,u,m)),!1}throw Error(s(435,l.tag))}return fg(r,u,m),Xf(),!1}if(rt)return o=er.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=m,u!==om&&(r=Error(s(422),{cause:u}),vc(Er(r,l)))):(u!==om&&(o=Error(s(423),{cause:u}),vc(Er(o,l))),r=r.current.alternate,r.flags|=65536,m&=-m,r.lanes|=m,u=Er(u,l),m=$m(r.stateNode,u,m),gm(r,m),qt!==4&&(qt=2)),!1;var v=Error(s(520),{cause:u});if(v=Er(v,l),zc===null?zc=[v]:zc.push(v),qt!==4&&(qt=2),o===null)return!0;u=Er(u,l),l=o;do{switch(l.tag){case 3:return l.flags|=65536,r=m&-m,l.lanes|=r,r=$m(l.stateNode,u,r),gm(l,r),!1;case 1:if(o=l.type,v=l.stateNode,(l.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Eo===null||!Eo.has(v))))return l.flags|=65536,m&=-m,l.lanes|=m,m=xS(m),SS(m,r,l,u),gm(l,m),!1}l=l.return}while(l!==null);return!1}var Bm=Error(s(461)),tn=!1;function Sn(r,o,l,u){o.child=r===null?T0(o,null,l,u):ki(o,r.child,l,u)}function _S(r,o,l,u,m){l=l.render;var v=o.ref;if("ref"in u){var E={};for(var M in u)M!=="ref"&&(E[M]=u[M])}else E=u;return ji(o),u=_m(r,o,l,E,v,m),M=wm(),r!==null&&!tn?(Em(r,o,m),As(r,o,m)):(rt&&M&&rm(o),o.flags|=1,Sn(r,o,u,m),o.child)}function wS(r,o,l,u,m){if(r===null){var v=l.type;return typeof v=="function"&&!em(v)&&v.defaultProps===void 0&&l.compare===null?(o.tag=15,o.type=v,ES(r,o,v,u,m)):(r=bf(l.type,null,u,o,o.mode,m),r.ref=o.ref,r.return=o,o.child=r)}if(v=r.child,!Ym(r,m)){var E=v.memoizedProps;if(l=l.compare,l=l!==null?l:mc,l(E,u)&&r.ref===o.ref)return As(r,o,m)}return o.flags|=1,r=Es(v,u),r.ref=o.ref,r.return=o,o.child=r}function ES(r,o,l,u,m){if(r!==null){var v=r.memoizedProps;if(mc(v,u)&&r.ref===o.ref)if(tn=!1,o.pendingProps=u=v,Ym(r,m))(r.flags&131072)!==0&&(tn=!0);else return o.lanes=r.lanes,As(r,o,m)}return Fm(r,o,l,u,m)}function TS(r,o,l,u){var m=u.children,v=r!==null?r.memoizedState:null;if(r===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((o.flags&128)!==0){if(v=v!==null?v.baseLanes|l:l,r!==null){for(u=o.child=r.child,m=0;u!==null;)m=m|u.lanes|u.childLanes,u=u.sibling;u=m&~v}else u=0,o.child=null;return CS(r,o,v,l,u)}if((l&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},r!==null&&wf(o,v!==null?v.cachePool:null),v!==null?N0(o,v):vm(),j0(o);else return u=o.lanes=536870912,CS(r,o,v!==null?v.baseLanes|l:l,l,u)}else v!==null?(wf(o,v.cachePool),N0(o,v),xo(),o.memoizedState=null):(r!==null&&wf(o,null),vm(),xo());return Sn(r,o,m,l),o.child}function Ac(r,o){return r!==null&&r.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function CS(r,o,l,u,m){var v=dm();return v=v===null?null:{parent:Jt._currentValue,pool:v},o.memoizedState={baseLanes:l,cachePool:v},r!==null&&wf(o,null),vm(),j0(o),r!==null&&za(r,o,u,!0),o.childLanes=m,null}function Uf(r,o){return o=Bf({mode:o.mode,children:o.children},r.mode),o.ref=r.ref,r.child=o,o.return=r,o}function RS(r,o,l){return ki(o,r.child,null,l),r=Uf(o,o.pendingProps),r.flags|=2,tr(o),o.memoizedState=null,r}function IM(r,o,l){var u=o.pendingProps,m=(o.flags&128)!==0;if(o.flags&=-129,r===null){if(rt){if(u.mode==="hidden")return r=Uf(o,u),o.lanes=536870912,Ac(null,r);if(xm(o),(r=kt)?(r=U_(r,Rr),r=r!==null&&r.data==="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:fo!==null?{id:as,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},l=u0(r),l.return=o,o.child=l,bn=o,kt=null)):r=null,r===null)throw po(o);return o.lanes=536870912,null}return Uf(o,u)}var v=r.memoizedState;if(v!==null){var E=v.dehydrated;if(xm(o),m)if(o.flags&256)o.flags&=-257,o=RS(r,o,l);else if(o.memoizedState!==null)o.child=r.child,o.flags|=128,o=null;else throw Error(s(558));else if(tn||za(r,o,l,!1),m=(l&r.childLanes)!==0,tn||m){if(u=Nt,u!==null&&(E=lo(u,l),E!==0&&E!==v.retryLane))throw v.retryLane=E,Ti(r,E),Bn(u,r,E),Bm;Xf(),o=RS(r,o,l)}else r=v.treeContext,kt=jr(E.nextSibling),bn=o,rt=!0,ho=null,Rr=!1,r!==null&&h0(o,r),o=Uf(o,u),o.flags|=4096;return o}return r=Es(r.child,{mode:u.mode,children:u.children}),r.ref=o.ref,o.child=r,r.return=o,r}function $f(r,o){var l=o.ref;if(l===null)r!==null&&r.ref!==null&&(o.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(s(284));(r===null||r.ref!==l)&&(o.flags|=4194816)}}function Fm(r,o,l,u,m){return ji(o),l=_m(r,o,l,u,void 0,m),u=wm(),r!==null&&!tn?(Em(r,o,m),As(r,o,m)):(rt&&u&&rm(o),o.flags|=1,Sn(r,o,l,m),o.child)}function NS(r,o,l,u,m,v){return ji(o),o.updateQueue=null,l=O0(o,u,l,m),A0(r),u=wm(),r!==null&&!tn?(Em(r,o,v),As(r,o,v)):(rt&&u&&rm(o),o.flags|=1,Sn(r,o,l,v),o.child)}function jS(r,o,l,u,m){if(ji(o),o.stateNode===null){var v=ka,E=l.contextType;typeof E=="object"&&E!==null&&(v=xn(E)),v=new l(u,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Um,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=u,v.state=o.memoizedState,v.refs={},pm(o),E=l.contextType,v.context=typeof E=="object"&&E!==null?xn(E):ka,v.state=o.memoizedState,E=l.getDerivedStateFromProps,typeof E=="function"&&(Lm(o,l,E,u),v.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(E=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),E!==v.state&&Um.enqueueReplaceState(v,v.state,null),Tc(o,u,v,m),Ec(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!0}else if(r===null){v=o.stateNode;var M=o.memoizedProps,$=Di(l,M);v.props=$;var ee=v.context,le=l.contextType;E=ka,typeof le=="object"&&le!==null&&(E=xn(le));var fe=l.getDerivedStateFromProps;le=typeof fe=="function"||typeof v.getSnapshotBeforeUpdate=="function",M=o.pendingProps!==M,le||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(M||ee!==E)&&mS(o,v,u,E),go=!1;var ne=o.memoizedState;v.state=ne,Tc(o,u,v,m),Ec(),ee=o.memoizedState,M||ne!==ee||go?(typeof fe=="function"&&(Lm(o,l,fe,u),ee=o.memoizedState),($=go||pS(o,l,$,u,ne,ee,E))?(le||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(o.flags|=4194308)):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=u,o.memoizedState=ee),v.props=u,v.state=ee,v.context=E,u=$):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!1)}else{v=o.stateNode,mm(r,o),E=o.memoizedProps,le=Di(l,E),v.props=le,fe=o.pendingProps,ne=v.context,ee=l.contextType,$=ka,typeof ee=="object"&&ee!==null&&($=xn(ee)),M=l.getDerivedStateFromProps,(ee=typeof M=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(E!==fe||ne!==$)&&mS(o,v,u,$),go=!1,ne=o.memoizedState,v.state=ne,Tc(o,u,v,m),Ec();var ie=o.memoizedState;E!==fe||ne!==ie||go||r!==null&&r.dependencies!==null&&Sf(r.dependencies)?(typeof M=="function"&&(Lm(o,l,M,u),ie=o.memoizedState),(le=go||pS(o,l,le,u,ne,ie,$)||r!==null&&r.dependencies!==null&&Sf(r.dependencies))?(ee||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(u,ie,$),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(u,ie,$)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=1024),o.memoizedProps=u,o.memoizedState=ie),v.props=u,v.state=ie,v.context=$,u=le):(typeof v.componentDidUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||E===r.memoizedProps&&ne===r.memoizedState||(o.flags|=1024),u=!1)}return v=u,$f(r,o),u=(o.flags&128)!==0,v||u?(v=o.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,r!==null&&u?(o.child=ki(o,r.child,null,m),o.child=ki(o,null,l,m)):Sn(r,o,l,m),o.memoizedState=v.state,r=o.child):r=As(r,o,m),r}function AS(r,o,l,u){return Ri(),o.flags|=256,Sn(r,o,l,u),o.child}var Hm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qm(r){return{baseLanes:r,cachePool:b0()}}function Vm(r,o,l){return r=r!==null?r.childLanes&~l:0,o&&(r|=rr),r}function OS(r,o,l){var u=o.pendingProps,m=!1,v=(o.flags&128)!==0,E;if((E=v)||(E=r!==null&&r.memoizedState===null?!1:(Xt.current&2)!==0),E&&(m=!0,o.flags&=-129),E=(o.flags&32)!==0,o.flags&=-33,r===null){if(rt){if(m?bo(o):xo(),(r=kt)?(r=U_(r,Rr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:fo!==null?{id:as,overflow:ls}:null,retryLane:536870912,hydrationErrors:null},l=u0(r),l.return=o,o.child=l,bn=o,kt=null)):r=null,r===null)throw po(o);return Rg(r)?o.lanes=32:o.lanes=536870912,null}var M=u.children;return u=u.fallback,m?(xo(),m=o.mode,M=Bf({mode:"hidden",children:M},m),u=Ci(u,m,l,null),M.return=o,u.return=o,M.sibling=u,o.child=M,u=o.child,u.memoizedState=qm(l),u.childLanes=Vm(r,E,l),o.memoizedState=Hm,Ac(null,u)):(bo(o),Km(o,M))}var $=r.memoizedState;if($!==null&&(M=$.dehydrated,M!==null)){if(v)o.flags&256?(bo(o),o.flags&=-257,o=Gm(r,o,l)):o.memoizedState!==null?(xo(),o.child=r.child,o.flags|=128,o=null):(xo(),M=u.fallback,m=o.mode,u=Bf({mode:"visible",children:u.children},m),M=Ci(M,m,l,null),M.flags|=2,u.return=o,M.return=o,u.sibling=M,o.child=u,ki(o,r.child,null,l),u=o.child,u.memoizedState=qm(l),u.childLanes=Vm(r,E,l),o.memoizedState=Hm,o=Ac(null,u));else if(bo(o),Rg(M)){if(E=M.nextSibling&&M.nextSibling.dataset,E)var ee=E.dgst;E=ee,u=Error(s(419)),u.stack="",u.digest=E,vc({value:u,source:null,stack:null}),o=Gm(r,o,l)}else if(tn||za(r,o,l,!1),E=(l&r.childLanes)!==0,tn||E){if(E=Nt,E!==null&&(u=lo(E,l),u!==0&&u!==$.retryLane))throw $.retryLane=u,Ti(r,u),Bn(E,r,u),Bm;Cg(M)||Xf(),o=Gm(r,o,l)}else Cg(M)?(o.flags|=192,o.child=r.child,o=null):(r=$.treeContext,kt=jr(M.nextSibling),bn=o,rt=!0,ho=null,Rr=!1,r!==null&&h0(o,r),o=Km(o,u.children),o.flags|=4096);return o}return m?(xo(),M=u.fallback,m=o.mode,$=r.child,ee=$.sibling,u=Es($,{mode:"hidden",children:u.children}),u.subtreeFlags=$.subtreeFlags&65011712,ee!==null?M=Es(ee,M):(M=Ci(M,m,l,null),M.flags|=2),M.return=o,u.return=o,u.sibling=M,o.child=u,Ac(null,u),u=o.child,M=r.child.memoizedState,M===null?M=qm(l):(m=M.cachePool,m!==null?($=Jt._currentValue,m=m.parent!==$?{parent:$,pool:$}:m):m=b0(),M={baseLanes:M.baseLanes|l,cachePool:m}),u.memoizedState=M,u.childLanes=Vm(r,E,l),o.memoizedState=Hm,Ac(r.child,u)):(bo(o),l=r.child,r=l.sibling,l=Es(l,{mode:"visible",children:u.children}),l.return=o,l.sibling=null,r!==null&&(E=o.deletions,E===null?(o.deletions=[r],o.flags|=16):E.push(r)),o.child=l,o.memoizedState=null,l)}function Km(r,o){return o=Bf({mode:"visible",children:o},r.mode),o.return=r,r.child=o}function Bf(r,o){return r=Jn(22,r,null,o),r.lanes=0,r}function Gm(r,o,l){return ki(o,r.child,null,l),r=Km(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function MS(r,o,l){r.lanes|=o;var u=r.alternate;u!==null&&(u.lanes|=o),lm(r.return,o,l)}function Zm(r,o,l,u,m,v){var E=r.memoizedState;E===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:m,treeForkCount:v}:(E.isBackwards=o,E.rendering=null,E.renderingStartTime=0,E.last=u,E.tail=l,E.tailMode=m,E.treeForkCount=v)}function kS(r,o,l){var u=o.pendingProps,m=u.revealOrder,v=u.tail;u=u.children;var E=Xt.current,M=(E&2)!==0;if(M?(E=E&1|2,o.flags|=128):E&=1,W(Xt,E),Sn(r,o,u,l),u=rt?yc:0,!M&&r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&MS(r,l,o);else if(r.tag===19)MS(r,l,o);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===o)break e;for(;r.sibling===null;){if(r.return===null||r.return===o)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(m){case"forwards":for(l=o.child,m=null;l!==null;)r=l.alternate,r!==null&&jf(r)===null&&(m=l),l=l.sibling;l=m,l===null?(m=o.child,o.child=null):(m=l.sibling,l.sibling=null),Zm(o,!1,m,l,v,u);break;case"backwards":case"unstable_legacy-backwards":for(l=null,m=o.child,o.child=null;m!==null;){if(r=m.alternate,r!==null&&jf(r)===null){o.child=m;break}r=m.sibling,m.sibling=l,l=m,m=r}Zm(o,!0,l,null,v,u);break;case"together":Zm(o,!1,null,null,void 0,u);break;default:o.memoizedState=null}return o.child}function As(r,o,l){if(r!==null&&(o.dependencies=r.dependencies),wo|=o.lanes,(l&o.childLanes)===0)if(r!==null){if(za(r,o,l,!1),(l&o.childLanes)===0)return null}else return null;if(r!==null&&o.child!==r.child)throw Error(s(153));if(o.child!==null){for(r=o.child,l=Es(r,r.pendingProps),o.child=l,l.return=o;r.sibling!==null;)r=r.sibling,l=l.sibling=Es(r,r.pendingProps),l.return=o;l.sibling=null}return o.child}function Ym(r,o){return(r.lanes&o)!==0?!0:(r=r.dependencies,!!(r!==null&&Sf(r)))}function DM(r,o,l){switch(o.tag){case 3:Se(o,o.stateNode.containerInfo),mo(o,Jt,r.memoizedState.cache),Ri();break;case 27:case 5:He(o);break;case 4:Se(o,o.stateNode.containerInfo);break;case 10:mo(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,xm(o),null;break;case 13:var u=o.memoizedState;if(u!==null)return u.dehydrated!==null?(bo(o),o.flags|=128,null):(l&o.child.childLanes)!==0?OS(r,o,l):(bo(o),r=As(r,o,l),r!==null?r.sibling:null);bo(o);break;case 19:var m=(r.flags&128)!==0;if(u=(l&o.childLanes)!==0,u||(za(r,o,l,!1),u=(l&o.childLanes)!==0),m){if(u)return kS(r,o,l);o.flags|=128}if(m=o.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),W(Xt,Xt.current),u)break;return null;case 22:return o.lanes=0,TS(r,o,l,o.pendingProps);case 24:mo(o,Jt,r.memoizedState.cache)}return As(r,o,l)}function IS(r,o,l){if(r!==null)if(r.memoizedProps!==o.pendingProps)tn=!0;else{if(!Ym(r,l)&&(o.flags&128)===0)return tn=!1,DM(r,o,l);tn=(r.flags&131072)!==0}else tn=!1,rt&&(o.flags&1048576)!==0&&d0(o,yc,o.index);switch(o.lanes=0,o.tag){case 16:e:{var u=o.pendingProps;if(r=Oi(o.elementType),o.type=r,typeof r=="function")em(r)?(u=Di(r,u),o.tag=1,o=jS(null,o,r,u,l)):(o.tag=0,o=Fm(null,o,r,u,l));else{if(r!=null){var m=r.$$typeof;if(m===R){o.tag=11,o=_S(null,o,r,u,l);break e}else if(m===j){o.tag=14,o=wS(null,o,r,u,l);break e}}throw o=Y(r)||r,Error(s(306,o,""))}}return o;case 0:return Fm(r,o,o.type,o.pendingProps,l);case 1:return u=o.type,m=Di(u,o.pendingProps),jS(r,o,u,m,l);case 3:e:{if(Se(o,o.stateNode.containerInfo),r===null)throw Error(s(387));u=o.pendingProps;var v=o.memoizedState;m=v.element,mm(r,o),Tc(o,u,null,l);var E=o.memoizedState;if(u=E.cache,mo(o,Jt,u),u!==v.cache&&cm(o,[Jt],l,!0),Ec(),u=E.element,v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:E.cache},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){o=AS(r,o,u,l);break e}else if(u!==m){m=Er(Error(s(424)),o),vc(m),o=AS(r,o,u,l);break e}else for(r=o.stateNode.containerInfo,r.nodeType===9?r=r.body:r=r.nodeName==="HTML"?r.ownerDocument.body:r,kt=jr(r.firstChild),bn=o,rt=!0,ho=null,Rr=!0,l=T0(o,null,u,l),o.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Ri(),u===m){o=As(r,o,l);break e}Sn(r,o,u,l)}o=o.child}return o;case 26:return $f(r,o),r===null?(l=V_(o.type,null,o.pendingProps,null))?o.memoizedState=l:rt||(l=o.type,r=o.pendingProps,u=rd(oe.current).createElement(l),u[vn]=o,u[Dn]=r,_n(u,l,r),gn(u),o.stateNode=u):o.memoizedState=V_(o.type,r.memoizedProps,o.pendingProps,r.memoizedState),null;case 27:return He(o),r===null&&rt&&(u=o.stateNode=F_(o.type,o.pendingProps,oe.current),bn=o,Rr=!0,m=kt,No(o.type)?(Ng=m,kt=jr(u.firstChild)):kt=m),Sn(r,o,o.pendingProps.children,l),$f(r,o),r===null&&(o.flags|=4194304),o.child;case 5:return r===null&&rt&&((m=u=kt)&&(u=fk(u,o.type,o.pendingProps,Rr),u!==null?(o.stateNode=u,bn=o,kt=jr(u.firstChild),Rr=!1,m=!0):m=!1),m||po(o)),He(o),m=o.type,v=o.pendingProps,E=r!==null?r.memoizedProps:null,u=v.children,wg(m,v)?u=null:E!==null&&wg(m,E)&&(o.flags|=32),o.memoizedState!==null&&(m=_m(r,o,CM,null,null,l),Vc._currentValue=m),$f(r,o),Sn(r,o,u,l),o.child;case 6:return r===null&&rt&&((r=l=kt)&&(l=dk(l,o.pendingProps,Rr),l!==null?(o.stateNode=l,bn=o,kt=null,r=!0):r=!1),r||po(o)),null;case 13:return OS(r,o,l);case 4:return Se(o,o.stateNode.containerInfo),u=o.pendingProps,r===null?o.child=ki(o,null,u,l):Sn(r,o,u,l),o.child;case 11:return _S(r,o,o.type,o.pendingProps,l);case 7:return Sn(r,o,o.pendingProps,l),o.child;case 8:return Sn(r,o,o.pendingProps.children,l),o.child;case 12:return Sn(r,o,o.pendingProps.children,l),o.child;case 10:return u=o.pendingProps,mo(o,o.type,u.value),Sn(r,o,u.children,l),o.child;case 9:return m=o.type._context,u=o.pendingProps.children,ji(o),m=xn(m),u=u(m),o.flags|=1,Sn(r,o,u,l),o.child;case 14:return wS(r,o,o.type,o.pendingProps,l);case 15:return ES(r,o,o.type,o.pendingProps,l);case 19:return kS(r,o,l);case 31:return IM(r,o,l);case 22:return TS(r,o,l,o.pendingProps);case 24:return ji(o),u=xn(Jt),r===null?(m=dm(),m===null&&(m=Nt,v=um(),m.pooledCache=v,v.refCount++,v!==null&&(m.pooledCacheLanes|=l),m=v),o.memoizedState={parent:u,cache:m},pm(o),mo(o,Jt,m)):((r.lanes&l)!==0&&(mm(r,o),Tc(o,null,null,l),Ec()),m=r.memoizedState,v=o.memoizedState,m.parent!==u?(m={parent:u,cache:u},o.memoizedState=m,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=m),mo(o,Jt,u)):(u=v.cache,mo(o,Jt,u),u!==m.cache&&cm(o,[Jt],l,!0))),Sn(r,o,o.pendingProps.children,l),o.child;case 29:throw o.pendingProps}throw Error(s(156,o.tag))}function Os(r){r.flags|=4}function Xm(r,o,l,u,m){if((o=(r.mode&32)!==0)&&(o=!1),o){if(r.flags|=16777216,(m&335544128)===m)if(r.stateNode.complete)r.flags|=8192;else if(a_())r.flags|=8192;else throw Mi=Tf,hm}else r.flags&=-16777217}function DS(r,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!X_(o))if(a_())r.flags|=8192;else throw Mi=Tf,hm}function Ff(r,o){o!==null&&(r.flags|=4),r.flags&16384&&(o=r.tag!==22?bi():536870912,r.lanes|=o,Ya|=o)}function Oc(r,o){if(!rt)switch(r.tailMode){case"hidden":o=r.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:u.sibling=null}}function It(r){var o=r.alternate!==null&&r.alternate.child===r.child,l=0,u=0;if(o)for(var m=r.child;m!==null;)l|=m.lanes|m.childLanes,u|=m.subtreeFlags&65011712,u|=m.flags&65011712,m.return=r,m=m.sibling;else for(m=r.child;m!==null;)l|=m.lanes|m.childLanes,u|=m.subtreeFlags,u|=m.flags,m.return=r,m=m.sibling;return r.subtreeFlags|=u,r.childLanes=l,o}function PM(r,o,l){var u=o.pendingProps;switch(sm(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return It(o),null;case 1:return It(o),null;case 3:return l=o.stateNode,u=null,r!==null&&(u=r.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),Rs(Jt),he(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(r===null||r.child===null)&&(Pa(o)?Os(o):r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,im())),It(o),null;case 26:var m=o.type,v=o.memoizedState;return r===null?(Os(o),v!==null?(It(o),DS(o,v)):(It(o),Xm(o,m,null,u,l))):v?v!==r.memoizedState?(Os(o),It(o),DS(o,v)):(It(o),o.flags&=-16777217):(r=r.memoizedProps,r!==u&&Os(o),It(o),Xm(o,m,r,u,l)),null;case 27:if(Ee(o),l=oe.current,m=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&Os(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return It(o),null}r=Q.current,Pa(o)?p0(o):(r=F_(m,u,l),o.stateNode=r,Os(o))}return It(o),null;case 5:if(Ee(o),m=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&Os(o);else{if(!u){if(o.stateNode===null)throw Error(s(166));return It(o),null}if(v=Q.current,Pa(o))p0(o);else{var E=rd(oe.current);switch(v){case 1:v=E.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:v=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":v=E.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":v=E.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":v=E.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof u.is=="string"?E.createElement("select",{is:u.is}):E.createElement("select"),u.multiple?v.multiple=!0:u.size&&(v.size=u.size);break;default:v=typeof u.is=="string"?E.createElement(m,{is:u.is}):E.createElement(m)}}v[vn]=o,v[Dn]=u;e:for(E=o.child;E!==null;){if(E.tag===5||E.tag===6)v.appendChild(E.stateNode);else if(E.tag!==4&&E.tag!==27&&E.child!==null){E.child.return=E,E=E.child;continue}if(E===o)break e;for(;E.sibling===null;){if(E.return===null||E.return===o)break e;E=E.return}E.sibling.return=E.return,E=E.sibling}o.stateNode=v;e:switch(_n(v,m,u),m){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&Os(o)}}return It(o),Xm(o,o.type,r===null?null:r.memoizedProps,o.pendingProps,l),null;case 6:if(r&&o.stateNode!=null)r.memoizedProps!==u&&Os(o);else{if(typeof u!="string"&&o.stateNode===null)throw Error(s(166));if(r=oe.current,Pa(o)){if(r=o.stateNode,l=o.memoizedProps,u=null,m=bn,m!==null)switch(m.tag){case 27:case 5:u=m.memoizedProps}r[vn]=o,r=!!(r.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||O_(r.nodeValue,l)),r||po(o,!0)}else r=rd(r).createTextNode(u),r[vn]=o,o.stateNode=r}return It(o),null;case 31:if(l=o.memoizedState,r===null||r.memoizedState!==null){if(u=Pa(o),l!==null){if(r===null){if(!u)throw Error(s(318));if(r=o.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(s(557));r[vn]=o}else Ri(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;It(o),r=!1}else l=im(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=l),r=!0;if(!r)return o.flags&256?(tr(o),o):(tr(o),null);if((o.flags&128)!==0)throw Error(s(558))}return It(o),null;case 13:if(u=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(m=Pa(o),u!==null&&u.dehydrated!==null){if(r===null){if(!m)throw Error(s(318));if(m=o.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(s(317));m[vn]=o}else Ri(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;It(o),m=!1}else m=im(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=m),m=!0;if(!m)return o.flags&256?(tr(o),o):(tr(o),null)}return tr(o),(o.flags&128)!==0?(o.lanes=l,o):(l=u!==null,r=r!==null&&r.memoizedState!==null,l&&(u=o.child,m=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(m=u.alternate.memoizedState.cachePool.pool),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==m&&(u.flags|=2048)),l!==r&&l&&(o.child.flags|=8192),Ff(o,o.updateQueue),It(o),null);case 4:return he(),r===null&&vg(o.stateNode.containerInfo),It(o),null;case 10:return Rs(o.type),It(o),null;case 19:if(G(Xt),u=o.memoizedState,u===null)return It(o),null;if(m=(o.flags&128)!==0,v=u.rendering,v===null)if(m)Oc(u,!1);else{if(qt!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(v=jf(r),v!==null){for(o.flags|=128,Oc(u,!1),r=v.updateQueue,o.updateQueue=r,Ff(o,r),o.subtreeFlags=0,r=l,l=o.child;l!==null;)c0(l,r),l=l.sibling;return W(Xt,Xt.current&1|2),rt&&Ts(o,u.treeForkCount),o.child}r=r.sibling}u.tail!==null&&$e()>Gf&&(o.flags|=128,m=!0,Oc(u,!1),o.lanes=4194304)}else{if(!m)if(r=jf(v),r!==null){if(o.flags|=128,m=!0,r=r.updateQueue,o.updateQueue=r,Ff(o,r),Oc(u,!0),u.tail===null&&u.tailMode==="hidden"&&!v.alternate&&!rt)return It(o),null}else 2*$e()-u.renderingStartTime>Gf&&l!==536870912&&(o.flags|=128,m=!0,Oc(u,!1),o.lanes=4194304);u.isBackwards?(v.sibling=o.child,o.child=v):(r=u.last,r!==null?r.sibling=v:o.child=v,u.last=v)}return u.tail!==null?(r=u.tail,u.rendering=r,u.tail=r.sibling,u.renderingStartTime=$e(),r.sibling=null,l=Xt.current,W(Xt,m?l&1|2:l&1),rt&&Ts(o,u.treeForkCount),r):(It(o),null);case 22:case 23:return tr(o),bm(),u=o.memoizedState!==null,r!==null?r.memoizedState!==null!==u&&(o.flags|=8192):u&&(o.flags|=8192),u?(l&536870912)!==0&&(o.flags&128)===0&&(It(o),o.subtreeFlags&6&&(o.flags|=8192)):It(o),l=o.updateQueue,l!==null&&Ff(o,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),u=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),u!==l&&(o.flags|=2048),r!==null&&G(Ai),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),o.memoizedState.cache!==l&&(o.flags|=2048),Rs(Jt),It(o),null;case 25:return null;case 30:return null}throw Error(s(156,o.tag))}function zM(r,o){switch(sm(o),o.tag){case 1:return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return Rs(Jt),he(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 26:case 27:case 5:return Ee(o),null;case 31:if(o.memoizedState!==null){if(tr(o),o.alternate===null)throw Error(s(340));Ri()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 13:if(tr(o),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(s(340));Ri()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return G(Xt),null;case 4:return he(),null;case 10:return Rs(o.type),null;case 22:case 23:return tr(o),bm(),r!==null&&G(Ai),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 24:return Rs(Jt),null;case 25:return null;default:return null}}function PS(r,o){switch(sm(o),o.tag){case 3:Rs(Jt),he();break;case 26:case 27:case 5:Ee(o);break;case 4:he();break;case 31:o.memoizedState!==null&&tr(o);break;case 13:tr(o);break;case 19:G(Xt);break;case 10:Rs(o.type);break;case 22:case 23:tr(o),bm(),r!==null&&G(Ai);break;case 24:Rs(Jt)}}function Mc(r,o){try{var l=o.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var m=u.next;l=m;do{if((l.tag&r)===r){u=void 0;var v=l.create,E=l.inst;u=v(),E.destroy=u}l=l.next}while(l!==m)}}catch(M){_t(o,o.return,M)}}function So(r,o,l){try{var u=o.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var v=m.next;u=v;do{if((u.tag&r)===r){var E=u.inst,M=E.destroy;if(M!==void 0){E.destroy=void 0,m=o;var $=l,ee=M;try{ee()}catch(le){_t(m,$,le)}}}u=u.next}while(u!==v)}}catch(le){_t(o,o.return,le)}}function zS(r){var o=r.updateQueue;if(o!==null){var l=r.stateNode;try{R0(o,l)}catch(u){_t(r,r.return,u)}}}function LS(r,o,l){l.props=Di(r.type,r.memoizedProps),l.state=r.memoizedState;try{l.componentWillUnmount()}catch(u){_t(r,o,u)}}function kc(r,o){try{var l=r.ref;if(l!==null){switch(r.tag){case 26:case 27:case 5:var u=r.stateNode;break;case 30:u=r.stateNode;break;default:u=r.stateNode}typeof l=="function"?r.refCleanup=l(u):l.current=u}}catch(m){_t(r,o,m)}}function cs(r,o){var l=r.ref,u=r.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(m){_t(r,o,m)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(m){_t(r,o,m)}else l.current=null}function US(r){var o=r.type,l=r.memoizedProps,u=r.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(m){_t(r,r.return,m)}}function Qm(r,o,l){try{var u=r.stateNode;ok(u,r.type,l,o),u[Dn]=o}catch(m){_t(r,r.return,m)}}function $S(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&No(r.type)||r.tag===4}function Wm(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||$S(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&&No(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 Jm(r,o,l){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(r,o):(o=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,o.appendChild(r),l=l._reactRootContainer,l!=null||o.onclick!==null||(o.onclick=_s));else if(u!==4&&(u===27&&No(r.type)&&(l=r.stateNode,o=null),r=r.child,r!==null))for(Jm(r,o,l),r=r.sibling;r!==null;)Jm(r,o,l),r=r.sibling}function Hf(r,o,l){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?l.insertBefore(r,o):l.appendChild(r);else if(u!==4&&(u===27&&No(r.type)&&(l=r.stateNode),r=r.child,r!==null))for(Hf(r,o,l),r=r.sibling;r!==null;)Hf(r,o,l),r=r.sibling}function BS(r){var o=r.stateNode,l=r.memoizedProps;try{for(var u=r.type,m=o.attributes;m.length;)o.removeAttributeNode(m[0]);_n(o,u,l),o[vn]=r,o[Dn]=l}catch(v){_t(r,r.return,v)}}var Ms=!1,nn=!1,eg=!1,FS=typeof WeakSet=="function"?WeakSet:Set,yn=null;function LM(r,o){if(r=r.containerInfo,Sg=ud,r=e0(r),Gp(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var m=u.anchorOffset,v=u.focusNode;u=u.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var E=0,M=-1,$=-1,ee=0,le=0,fe=r,ne=null;t:for(;;){for(var ie;fe!==l||m!==0&&fe.nodeType!==3||(M=E+m),fe!==v||u!==0&&fe.nodeType!==3||($=E+u),fe.nodeType===3&&(E+=fe.nodeValue.length),(ie=fe.firstChild)!==null;)ne=fe,fe=ie;for(;;){if(fe===r)break t;if(ne===l&&++ee===m&&(M=E),ne===v&&++le===u&&($=E),(ie=fe.nextSibling)!==null)break;fe=ne,ne=fe.parentNode}fe=ie}l=M===-1||$===-1?null:{start:M,end:$}}else l=null}l=l||{start:0,end:0}}else l=null;for(_g={focusedElem:r,selectionRange:l},ud=!1,yn=o;yn!==null;)if(o=yn,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,yn=r;else for(;yn!==null;){switch(o=yn,v=o.alternate,r=o.flags,o.tag){case 0:if((r&4)!==0&&(r=o.updateQueue,r=r!==null?r.events:null,r!==null))for(l=0;l<r.length;l++)m=r[l],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,l=o,m=v.memoizedProps,v=v.memoizedState,u=l.stateNode;try{var Re=Di(l.type,m);r=u.getSnapshotBeforeUpdate(Re,v),u.__reactInternalSnapshotBeforeUpdate=r}catch(Ue){_t(l,l.return,Ue)}}break;case 3:if((r&1024)!==0){if(r=o.stateNode.containerInfo,l=r.nodeType,l===9)Tg(r);else if(l===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Tg(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(s(163))}if(r=o.sibling,r!==null){r.return=o.return,yn=r;break}yn=o.return}}function HS(r,o,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:Is(r,l),u&4&&Mc(5,l);break;case 1:if(Is(r,l),u&4)if(r=l.stateNode,o===null)try{r.componentDidMount()}catch(E){_t(l,l.return,E)}else{var m=Di(l.type,o.memoizedProps);o=o.memoizedState;try{r.componentDidUpdate(m,o,r.__reactInternalSnapshotBeforeUpdate)}catch(E){_t(l,l.return,E)}}u&64&&zS(l),u&512&&kc(l,l.return);break;case 3:if(Is(r,l),u&64&&(r=l.updateQueue,r!==null)){if(o=null,l.child!==null)switch(l.child.tag){case 27:case 5:o=l.child.stateNode;break;case 1:o=l.child.stateNode}try{R0(r,o)}catch(E){_t(l,l.return,E)}}break;case 27:o===null&&u&4&&BS(l);case 26:case 5:Is(r,l),o===null&&u&4&&US(l),u&512&&kc(l,l.return);break;case 12:Is(r,l);break;case 31:Is(r,l),u&4&&KS(r,l);break;case 13:Is(r,l),u&4&&GS(r,l),u&64&&(r=l.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(l=GM.bind(null,l),hk(r,l))));break;case 22:if(u=l.memoizedState!==null||Ms,!u){o=o!==null&&o.memoizedState!==null||nn,m=Ms;var v=nn;Ms=u,(nn=o)&&!v?Ds(r,l,(l.subtreeFlags&8772)!==0):Is(r,l),Ms=m,nn=v}break;case 30:break;default:Is(r,l)}}function qS(r){var o=r.alternate;o!==null&&(r.alternate=null,qS(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&Ap(o)),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 zt=null,zn=!1;function ks(r,o,l){for(l=l.child;l!==null;)VS(r,o,l),l=l.sibling}function VS(r,o,l){if(Zt&&typeof Zt.onCommitFiberUnmount=="function")try{Zt.onCommitFiberUnmount(xr,l)}catch{}switch(l.tag){case 26:nn||cs(l,o),ks(r,o,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:nn||cs(l,o);var u=zt,m=zn;No(l.type)&&(zt=l.stateNode,zn=!1),ks(r,o,l),Fc(l.stateNode),zt=u,zn=m;break;case 5:nn||cs(l,o);case 6:if(u=zt,m=zn,zt=null,ks(r,o,l),zt=u,zn=m,zt!==null)if(zn)try{(zt.nodeType===9?zt.body:zt.nodeName==="HTML"?zt.ownerDocument.body:zt).removeChild(l.stateNode)}catch(v){_t(l,o,v)}else try{zt.removeChild(l.stateNode)}catch(v){_t(l,o,v)}break;case 18:zt!==null&&(zn?(r=zt,z_(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,l.stateNode),rl(r)):z_(zt,l.stateNode));break;case 4:u=zt,m=zn,zt=l.stateNode.containerInfo,zn=!0,ks(r,o,l),zt=u,zn=m;break;case 0:case 11:case 14:case 15:So(2,l,o),nn||So(4,l,o),ks(r,o,l);break;case 1:nn||(cs(l,o),u=l.stateNode,typeof u.componentWillUnmount=="function"&&LS(l,o,u)),ks(r,o,l);break;case 21:ks(r,o,l);break;case 22:nn=(u=nn)||l.memoizedState!==null,ks(r,o,l),nn=u;break;default:ks(r,o,l)}}function KS(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{rl(r)}catch(l){_t(o,o.return,l)}}}function GS(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{rl(r)}catch(l){_t(o,o.return,l)}}function UM(r){switch(r.tag){case 31:case 13:case 19:var o=r.stateNode;return o===null&&(o=r.stateNode=new FS),o;case 22:return r=r.stateNode,o=r._retryCache,o===null&&(o=r._retryCache=new FS),o;default:throw Error(s(435,r.tag))}}function qf(r,o){var l=UM(r);o.forEach(function(u){if(!l.has(u)){l.add(u);var m=ZM.bind(null,r,u);u.then(m,m)}})}function Ln(r,o){var l=o.deletions;if(l!==null)for(var u=0;u<l.length;u++){var m=l[u],v=r,E=o,M=E;e:for(;M!==null;){switch(M.tag){case 27:if(No(M.type)){zt=M.stateNode,zn=!1;break e}break;case 5:zt=M.stateNode,zn=!1;break e;case 3:case 4:zt=M.stateNode.containerInfo,zn=!0;break e}M=M.return}if(zt===null)throw Error(s(160));VS(v,E,m),zt=null,zn=!1,v=m.alternate,v!==null&&(v.return=null),m.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)ZS(o,r),o=o.sibling}var Gr=null;function ZS(r,o){var l=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Ln(o,r),Un(r),u&4&&(So(3,r,r.return),Mc(3,r),So(5,r,r.return));break;case 1:Ln(o,r),Un(r),u&512&&(nn||l===null||cs(l,l.return)),u&64&&Ms&&(r=r.updateQueue,r!==null&&(u=r.callbacks,u!==null&&(l=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=l===null?u:l.concat(u))));break;case 26:var m=Gr;if(Ln(o,r),Un(r),u&512&&(nn||l===null||cs(l,l.return)),u&4){var v=l!==null?l.memoizedState:null;if(u=r.memoizedState,l===null)if(u===null)if(r.stateNode===null){e:{u=r.type,l=r.memoizedProps,m=m.ownerDocument||m;t:switch(u){case"title":v=m.getElementsByTagName("title")[0],(!v||v[ic]||v[vn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=m.createElement(u),m.head.insertBefore(v,m.querySelector("head > title"))),_n(v,u,l),v[vn]=r,gn(v),u=v;break e;case"link":var E=Z_("link","href",m).get(u+(l.href||""));if(E){for(var M=0;M<E.length;M++)if(v=E[M],v.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&v.getAttribute("rel")===(l.rel==null?null:l.rel)&&v.getAttribute("title")===(l.title==null?null:l.title)&&v.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){E.splice(M,1);break t}}v=m.createElement(u),_n(v,u,l),m.head.appendChild(v);break;case"meta":if(E=Z_("meta","content",m).get(u+(l.content||""))){for(M=0;M<E.length;M++)if(v=E[M],v.getAttribute("content")===(l.content==null?null:""+l.content)&&v.getAttribute("name")===(l.name==null?null:l.name)&&v.getAttribute("property")===(l.property==null?null:l.property)&&v.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&v.getAttribute("charset")===(l.charSet==null?null:l.charSet)){E.splice(M,1);break t}}v=m.createElement(u),_n(v,u,l),m.head.appendChild(v);break;default:throw Error(s(468,u))}v[vn]=r,gn(v),u=v}r.stateNode=u}else Y_(m,r.type,r.stateNode);else r.stateNode=G_(m,u,r.memoizedProps);else v!==u?(v===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):v.count--,u===null?Y_(m,r.type,r.stateNode):G_(m,u,r.memoizedProps)):u===null&&r.stateNode!==null&&Qm(r,r.memoizedProps,l.memoizedProps)}break;case 27:Ln(o,r),Un(r),u&512&&(nn||l===null||cs(l,l.return)),l!==null&&u&4&&Qm(r,r.memoizedProps,l.memoizedProps);break;case 5:if(Ln(o,r),Un(r),u&512&&(nn||l===null||cs(l,l.return)),r.flags&32){m=r.stateNode;try{Ca(m,"")}catch(Re){_t(r,r.return,Re)}}u&4&&r.stateNode!=null&&(m=r.memoizedProps,Qm(r,m,l!==null?l.memoizedProps:m)),u&1024&&(eg=!0);break;case 6:if(Ln(o,r),Un(r),u&4){if(r.stateNode===null)throw Error(s(162));u=r.memoizedProps,l=r.stateNode;try{l.nodeValue=u}catch(Re){_t(r,r.return,Re)}}break;case 3:if(id=null,m=Gr,Gr=sd(o.containerInfo),Ln(o,r),Gr=m,Un(r),u&4&&l!==null&&l.memoizedState.isDehydrated)try{rl(o.containerInfo)}catch(Re){_t(r,r.return,Re)}eg&&(eg=!1,YS(r));break;case 4:u=Gr,Gr=sd(r.stateNode.containerInfo),Ln(o,r),Un(r),Gr=u;break;case 12:Ln(o,r),Un(r);break;case 31:Ln(o,r),Un(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,qf(r,u)));break;case 13:Ln(o,r),Un(r),r.child.flags&8192&&r.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Kf=$e()),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,qf(r,u)));break;case 22:m=r.memoizedState!==null;var $=l!==null&&l.memoizedState!==null,ee=Ms,le=nn;if(Ms=ee||m,nn=le||$,Ln(o,r),nn=le,Ms=ee,Un(r),u&8192)e:for(o=r.stateNode,o._visibility=m?o._visibility&-2:o._visibility|1,m&&(l===null||$||Ms||nn||Pi(r)),l=null,o=r;;){if(o.tag===5||o.tag===26){if(l===null){$=l=o;try{if(v=$.stateNode,m)E=v.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{M=$.stateNode;var fe=$.memoizedProps.style,ne=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;M.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Re){_t($,$.return,Re)}}}else if(o.tag===6){if(l===null){$=o;try{$.stateNode.nodeValue=m?"":$.memoizedProps}catch(Re){_t($,$.return,Re)}}}else if(o.tag===18){if(l===null){$=o;try{var ie=$.stateNode;m?L_(ie,!0):L_($.stateNode,!1)}catch(Re){_t($,$.return,Re)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===r)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break e;for(;o.sibling===null;){if(o.return===null||o.return===r)break e;l===o&&(l=null),o=o.return}l===o&&(l=null),o.sibling.return=o.return,o=o.sibling}u&4&&(u=r.updateQueue,u!==null&&(l=u.retryQueue,l!==null&&(u.retryQueue=null,qf(r,l))));break;case 19:Ln(o,r),Un(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,qf(r,u)));break;case 30:break;case 21:break;default:Ln(o,r),Un(r)}}function Un(r){var o=r.flags;if(o&2){try{for(var l,u=r.return;u!==null;){if($S(u)){l=u;break}u=u.return}if(l==null)throw Error(s(160));switch(l.tag){case 27:var m=l.stateNode,v=Wm(r);Hf(r,v,m);break;case 5:var E=l.stateNode;l.flags&32&&(Ca(E,""),l.flags&=-33);var M=Wm(r);Hf(r,M,E);break;case 3:case 4:var $=l.stateNode.containerInfo,ee=Wm(r);Jm(r,ee,$);break;default:throw Error(s(161))}}catch(le){_t(r,r.return,le)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function YS(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var o=r;YS(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),r=r.sibling}}function Is(r,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)HS(r,o.alternate,o),o=o.sibling}function Pi(r){for(r=r.child;r!==null;){var o=r;switch(o.tag){case 0:case 11:case 14:case 15:So(4,o,o.return),Pi(o);break;case 1:cs(o,o.return);var l=o.stateNode;typeof l.componentWillUnmount=="function"&&LS(o,o.return,l),Pi(o);break;case 27:Fc(o.stateNode);case 26:case 5:cs(o,o.return),Pi(o);break;case 22:o.memoizedState===null&&Pi(o);break;case 30:Pi(o);break;default:Pi(o)}r=r.sibling}}function Ds(r,o,l){for(l=l&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var u=o.alternate,m=r,v=o,E=v.flags;switch(v.tag){case 0:case 11:case 15:Ds(m,v,l),Mc(4,v);break;case 1:if(Ds(m,v,l),u=v,m=u.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(ee){_t(u,u.return,ee)}if(u=v,m=u.updateQueue,m!==null){var M=u.stateNode;try{var $=m.shared.hiddenCallbacks;if($!==null)for(m.shared.hiddenCallbacks=null,m=0;m<$.length;m++)C0($[m],M)}catch(ee){_t(u,u.return,ee)}}l&&E&64&&zS(v),kc(v,v.return);break;case 27:BS(v);case 26:case 5:Ds(m,v,l),l&&u===null&&E&4&&US(v),kc(v,v.return);break;case 12:Ds(m,v,l);break;case 31:Ds(m,v,l),l&&E&4&&KS(m,v);break;case 13:Ds(m,v,l),l&&E&4&&GS(m,v);break;case 22:v.memoizedState===null&&Ds(m,v,l),kc(v,v.return);break;case 30:break;default:Ds(m,v,l)}o=o.sibling}}function tg(r,o){var l=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),r=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(r=o.memoizedState.cachePool.pool),r!==l&&(r!=null&&r.refCount++,l!=null&&bc(l))}function ng(r,o){r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&bc(r))}function Zr(r,o,l,u){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)XS(r,o,l,u),o=o.sibling}function XS(r,o,l,u){var m=o.flags;switch(o.tag){case 0:case 11:case 15:Zr(r,o,l,u),m&2048&&Mc(9,o);break;case 1:Zr(r,o,l,u);break;case 3:Zr(r,o,l,u),m&2048&&(r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&bc(r)));break;case 12:if(m&2048){Zr(r,o,l,u),r=o.stateNode;try{var v=o.memoizedProps,E=v.id,M=v.onPostCommit;typeof M=="function"&&M(E,o.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch($){_t(o,o.return,$)}}else Zr(r,o,l,u);break;case 31:Zr(r,o,l,u);break;case 13:Zr(r,o,l,u);break;case 23:break;case 22:v=o.stateNode,E=o.alternate,o.memoizedState!==null?v._visibility&2?Zr(r,o,l,u):Ic(r,o):v._visibility&2?Zr(r,o,l,u):(v._visibility|=2,Ka(r,o,l,u,(o.subtreeFlags&10256)!==0||!1)),m&2048&&tg(E,o);break;case 24:Zr(r,o,l,u),m&2048&&ng(o.alternate,o);break;default:Zr(r,o,l,u)}}function Ka(r,o,l,u,m){for(m=m&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=r,E=o,M=l,$=u,ee=E.flags;switch(E.tag){case 0:case 11:case 15:Ka(v,E,M,$,m),Mc(8,E);break;case 23:break;case 22:var le=E.stateNode;E.memoizedState!==null?le._visibility&2?Ka(v,E,M,$,m):Ic(v,E):(le._visibility|=2,Ka(v,E,M,$,m)),m&&ee&2048&&tg(E.alternate,E);break;case 24:Ka(v,E,M,$,m),m&&ee&2048&&ng(E.alternate,E);break;default:Ka(v,E,M,$,m)}o=o.sibling}}function Ic(r,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var l=r,u=o,m=u.flags;switch(u.tag){case 22:Ic(l,u),m&2048&&tg(u.alternate,u);break;case 24:Ic(l,u),m&2048&&ng(u.alternate,u);break;default:Ic(l,u)}o=o.sibling}}var Dc=8192;function Ga(r,o,l){if(r.subtreeFlags&Dc)for(r=r.child;r!==null;)QS(r,o,l),r=r.sibling}function QS(r,o,l){switch(r.tag){case 26:Ga(r,o,l),r.flags&Dc&&r.memoizedState!==null&&Tk(l,Gr,r.memoizedState,r.memoizedProps);break;case 5:Ga(r,o,l);break;case 3:case 4:var u=Gr;Gr=sd(r.stateNode.containerInfo),Ga(r,o,l),Gr=u;break;case 22:r.memoizedState===null&&(u=r.alternate,u!==null&&u.memoizedState!==null?(u=Dc,Dc=16777216,Ga(r,o,l),Dc=u):Ga(r,o,l));break;default:Ga(r,o,l)}}function WS(r){var o=r.alternate;if(o!==null&&(r=o.child,r!==null)){o.child=null;do o=r.sibling,r.sibling=null,r=o;while(r!==null)}}function Pc(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var l=0;l<o.length;l++){var u=o[l];yn=u,e_(u,r)}WS(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)JS(r),r=r.sibling}function JS(r){switch(r.tag){case 0:case 11:case 15:Pc(r),r.flags&2048&&So(9,r,r.return);break;case 3:Pc(r);break;case 12:Pc(r);break;case 22:var o=r.stateNode;r.memoizedState!==null&&o._visibility&2&&(r.return===null||r.return.tag!==13)?(o._visibility&=-3,Vf(r)):Pc(r);break;default:Pc(r)}}function Vf(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var l=0;l<o.length;l++){var u=o[l];yn=u,e_(u,r)}WS(r)}for(r=r.child;r!==null;){switch(o=r,o.tag){case 0:case 11:case 15:So(8,o,o.return),Vf(o);break;case 22:l=o.stateNode,l._visibility&2&&(l._visibility&=-3,Vf(o));break;default:Vf(o)}r=r.sibling}}function e_(r,o){for(;yn!==null;){var l=yn;switch(l.tag){case 0:case 11:case 15:So(8,l,o);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:bc(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,yn=u;else e:for(l=r;yn!==null;){u=yn;var m=u.sibling,v=u.return;if(qS(u),u===l){yn=null;break e}if(m!==null){m.return=v,yn=m;break e}yn=v}}}var $M={getCacheForType:function(r){var o=xn(Jt),l=o.data.get(r);return l===void 0&&(l=r(),o.data.set(r,l)),l},cacheSignal:function(){return xn(Jt).controller.signal}},BM=typeof WeakMap=="function"?WeakMap:Map,gt=0,Nt=null,Je=null,tt=0,St=0,nr=null,_o=!1,Za=!1,rg=!1,Ps=0,qt=0,wo=0,zi=0,sg=0,rr=0,Ya=0,zc=null,$n=null,og=!1,Kf=0,t_=0,Gf=1/0,Zf=null,Eo=null,ln=0,To=null,Xa=null,zs=0,ig=0,ag=null,n_=null,Lc=0,lg=null;function sr(){return(gt&2)!==0&&tt!==0?tt&-tt:P.T!==null?pg():nf()}function r_(){if(rr===0)if((tt&536870912)===0||rt){var r=wn;wn<<=1,(wn&3932160)===0&&(wn=262144),rr=r}else rr=536870912;return r=er.current,r!==null&&(r.flags|=32),rr}function Bn(r,o,l){(r===Nt&&(St===2||St===9)||r.cancelPendingCommit!==null)&&(Qa(r,0),Co(r,tt,rr,!1)),xs(r,l),((gt&2)===0||r!==Nt)&&(r===Nt&&((gt&2)===0&&(zi|=l),qt===4&&Co(r,tt,rr,!1)),us(r))}function s_(r,o,l){if((gt&6)!==0)throw Error(s(327));var u=!l&&(o&127)===0&&(o&r.expiredLanes)===0||os(r,o),m=u?qM(r,o):ug(r,o,!0),v=u;do{if(m===0){Za&&!u&&Co(r,o,0,!1);break}else{if(l=r.current.alternate,v&&!FM(l)){m=ug(r,o,!1),v=!1;continue}if(m===2){if(v=o,r.errorRecoveryDisabledLanes&v)var E=0;else E=r.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){o=E;e:{var M=r;m=zc;var $=M.current.memoizedState.isDehydrated;if($&&(Qa(M,E).flags|=256),E=ug(M,E,!1),E!==2){if(rg&&!$){M.errorRecoveryDisabledLanes|=v,zi|=v,m=4;break e}v=$n,$n=m,v!==null&&($n===null?$n=v:$n.push.apply($n,v))}m=E}if(v=!1,m!==2)continue}}if(m===1){Qa(r,0),Co(r,o,0,!0);break}e:{switch(u=r,v=m,v){case 0:case 1:throw Error(s(345));case 4:if((o&4194048)!==o)break;case 6:Co(u,o,rr,!_o);break e;case 2:$n=null;break;case 3:case 5:break;default:throw Error(s(329))}if((o&62914560)===o&&(m=Kf+300-$e(),10<m)){if(Co(u,o,rr,!_o),ss(u,0,!0)!==0)break e;zs=o,u.timeoutHandle=D_(o_.bind(null,u,l,$n,Zf,og,o,rr,zi,Ya,_o,v,"Throttled",-0,0),m);break e}o_(u,l,$n,Zf,og,o,rr,zi,Ya,_o,v,null,-0,0)}}break}while(!0);us(r)}function o_(r,o,l,u,m,v,E,M,$,ee,le,fe,ne,ie){if(r.timeoutHandle=-1,fe=o.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:_s},QS(o,v,fe);var Re=(v&62914560)===v?Kf-$e():(v&4194048)===v?t_-$e():0;if(Re=Ck(fe,Re),Re!==null){zs=v,r.cancelPendingCommit=Re(h_.bind(null,r,o,v,l,u,m,E,M,$,le,fe,null,ne,ie)),Co(r,v,E,!ee);return}}h_(r,o,v,l,u,m,E,M,$)}function FM(r){for(var o=r;;){var l=o.tag;if((l===0||l===11||l===15)&&o.flags&16384&&(l=o.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var m=l[u],v=m.getSnapshot;m=m.value;try{if(!Wn(v(),m))return!1}catch{return!1}}if(l=o.child,o.subtreeFlags&16384&&l!==null)l.return=o,o=l;else{if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Co(r,o,l,u){o&=~sg,o&=~zi,r.suspendedLanes|=o,r.pingedLanes&=~o,u&&(r.warmLanes|=o),u=r.expirationTimes;for(var m=o;0<m;){var v=31-xt(m),E=1<<v;u[v]=-1,m&=~E}l!==0&&is(r,l,o)}function Yf(){return(gt&6)===0?(Uc(0),!1):!0}function cg(){if(Je!==null){if(St===0)var r=Je.return;else r=Je,Cs=Ni=null,Tm(r),Ba=null,Sc=0,r=Je;for(;r!==null;)PS(r.alternate,r),r=r.return;Je=null}}function Qa(r,o){var l=r.timeoutHandle;l!==-1&&(r.timeoutHandle=-1,lk(l)),l=r.cancelPendingCommit,l!==null&&(r.cancelPendingCommit=null,l()),zs=0,cg(),Nt=r,Je=l=Es(r.current,null),tt=o,St=0,nr=null,_o=!1,Za=os(r,o),rg=!1,Ya=rr=sg=zi=wo=qt=0,$n=zc=null,og=!1,(o&8)!==0&&(o|=o&32);var u=r.entangledLanes;if(u!==0)for(r=r.entanglements,u&=o;0<u;){var m=31-xt(u),v=1<<m;o|=r[m],u&=~v}return Ps=o,gf(),l}function i_(r,o){Ze=null,P.H=jc,o===$a||o===Ef?(o=_0(),St=3):o===hm?(o=_0(),St=4):St=o===Bm?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,nr=o,Je===null&&(qt=1,Lf(r,Er(o,r.current)))}function a_(){var r=er.current;return r===null?!0:(tt&4194048)===tt?Nr===null:(tt&62914560)===tt||(tt&536870912)!==0?r===Nr:!1}function l_(){var r=P.H;return P.H=jc,r===null?jc:r}function c_(){var r=P.A;return P.A=$M,r}function Xf(){qt=4,_o||(tt&4194048)!==tt&&er.current!==null||(Za=!0),(wo&134217727)===0&&(zi&134217727)===0||Nt===null||Co(Nt,tt,rr,!1)}function ug(r,o,l){var u=gt;gt|=2;var m=l_(),v=c_();(Nt!==r||tt!==o)&&(Zf=null,Qa(r,o)),o=!1;var E=qt;e:do try{if(St!==0&&Je!==null){var M=Je,$=nr;switch(St){case 8:cg(),E=6;break e;case 3:case 2:case 9:case 6:er.current===null&&(o=!0);var ee=St;if(St=0,nr=null,Wa(r,M,$,ee),l&&Za){E=0;break e}break;default:ee=St,St=0,nr=null,Wa(r,M,$,ee)}}HM(),E=qt;break}catch(le){i_(r,le)}while(!0);return o&&r.shellSuspendCounter++,Cs=Ni=null,gt=u,P.H=m,P.A=v,Je===null&&(Nt=null,tt=0,gf()),E}function HM(){for(;Je!==null;)u_(Je)}function qM(r,o){var l=gt;gt|=2;var u=l_(),m=c_();Nt!==r||tt!==o?(Zf=null,Gf=$e()+500,Qa(r,o)):Za=os(r,o);e:do try{if(St!==0&&Je!==null){o=Je;var v=nr;t:switch(St){case 1:St=0,nr=null,Wa(r,o,v,1);break;case 2:case 9:if(x0(v)){St=0,nr=null,f_(o);break}o=function(){St!==2&&St!==9||Nt!==r||(St=7),us(r)},v.then(o,o);break e;case 3:St=7;break e;case 4:St=5;break e;case 7:x0(v)?(St=0,nr=null,f_(o)):(St=0,nr=null,Wa(r,o,v,7));break;case 5:var E=null;switch(Je.tag){case 26:E=Je.memoizedState;case 5:case 27:var M=Je;if(E?X_(E):M.stateNode.complete){St=0,nr=null;var $=M.sibling;if($!==null)Je=$;else{var ee=M.return;ee!==null?(Je=ee,Qf(ee)):Je=null}break t}}St=0,nr=null,Wa(r,o,v,5);break;case 6:St=0,nr=null,Wa(r,o,v,6);break;case 8:cg(),qt=6;break e;default:throw Error(s(462))}}VM();break}catch(le){i_(r,le)}while(!0);return Cs=Ni=null,P.H=u,P.A=m,gt=l,Je!==null?0:(Nt=null,tt=0,gf(),qt)}function VM(){for(;Je!==null&&!Ve();)u_(Je)}function u_(r){var o=IS(r.alternate,r,Ps);r.memoizedProps=r.pendingProps,o===null?Qf(r):Je=o}function f_(r){var o=r,l=o.alternate;switch(o.tag){case 15:case 0:o=NS(l,o,o.pendingProps,o.type,void 0,tt);break;case 11:o=NS(l,o,o.pendingProps,o.type.render,o.ref,tt);break;case 5:Tm(o);default:PS(l,o),o=Je=c0(o,Ps),o=IS(l,o,Ps)}r.memoizedProps=r.pendingProps,o===null?Qf(r):Je=o}function Wa(r,o,l,u){Cs=Ni=null,Tm(o),Ba=null,Sc=0;var m=o.return;try{if(kM(r,m,o,l,tt)){qt=1,Lf(r,Er(l,r.current)),Je=null;return}}catch(v){if(m!==null)throw Je=m,v;qt=1,Lf(r,Er(l,r.current)),Je=null;return}o.flags&32768?(rt||u===1?r=!0:Za||(tt&536870912)!==0?r=!1:(_o=r=!0,(u===2||u===9||u===3||u===6)&&(u=er.current,u!==null&&u.tag===13&&(u.flags|=16384))),d_(o,r)):Qf(o)}function Qf(r){var o=r;do{if((o.flags&32768)!==0){d_(o,_o);return}r=o.return;var l=PM(o.alternate,o,Ps);if(l!==null){Je=l;return}if(o=o.sibling,o!==null){Je=o;return}Je=o=r}while(o!==null);qt===0&&(qt=5)}function d_(r,o){do{var l=zM(r.alternate,r);if(l!==null){l.flags&=32767,Je=l;return}if(l=r.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!o&&(r=r.sibling,r!==null)){Je=r;return}Je=r=l}while(r!==null);qt=6,Je=null}function h_(r,o,l,u,m,v,E,M,$){r.cancelPendingCommit=null;do Wf();while(ln!==0);if((gt&6)!==0)throw Error(s(327));if(o!==null){if(o===r.current)throw Error(s(177));if(v=o.lanes|o.childLanes,v|=Wp,Xn(r,l,v,E,M,$),r===Nt&&(Je=Nt=null,tt=0),Xa=o,To=r,zs=l,ig=v,ag=m,n_=u,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,YM(Te,function(){return v_(),null})):(r.callbackNode=null,r.callbackPriority=0),u=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||u){u=P.T,P.T=null,m=V.p,V.p=2,E=gt,gt|=4;try{LM(r,o,l)}finally{gt=E,V.p=m,P.T=u}}ln=1,p_(),m_(),g_()}}function p_(){if(ln===1){ln=0;var r=To,o=Xa,l=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||l){l=P.T,P.T=null;var u=V.p;V.p=2;var m=gt;gt|=4;try{ZS(o,r);var v=_g,E=e0(r.containerInfo),M=v.focusedElem,$=v.selectionRange;if(E!==M&&M&&M.ownerDocument&&Jx(M.ownerDocument.documentElement,M)){if($!==null&&Gp(M)){var ee=$.start,le=$.end;if(le===void 0&&(le=ee),"selectionStart"in M)M.selectionStart=ee,M.selectionEnd=Math.min(le,M.value.length);else{var fe=M.ownerDocument||document,ne=fe&&fe.defaultView||window;if(ne.getSelection){var ie=ne.getSelection(),Re=M.textContent.length,Ue=Math.min($.start,Re),Ct=$.end===void 0?Ue:Math.min($.end,Re);!ie.extend&&Ue>Ct&&(E=Ct,Ct=Ue,Ue=E);var Z=Wx(M,Ue),H=Wx(M,Ct);if(Z&&H&&(ie.rangeCount!==1||ie.anchorNode!==Z.node||ie.anchorOffset!==Z.offset||ie.focusNode!==H.node||ie.focusOffset!==H.offset)){var J=fe.createRange();J.setStart(Z.node,Z.offset),ie.removeAllRanges(),Ue>Ct?(ie.addRange(J),ie.extend(H.node,H.offset)):(J.setEnd(H.node,H.offset),ie.addRange(J))}}}}for(fe=[],ie=M;ie=ie.parentNode;)ie.nodeType===1&&fe.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<fe.length;M++){var ce=fe[M];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}ud=!!Sg,_g=Sg=null}finally{gt=m,V.p=u,P.T=l}}r.current=o,ln=2}}function m_(){if(ln===2){ln=0;var r=To,o=Xa,l=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||l){l=P.T,P.T=null;var u=V.p;V.p=2;var m=gt;gt|=4;try{HS(r,o.alternate,o)}finally{gt=m,V.p=u,P.T=l}}ln=3}}function g_(){if(ln===4||ln===3){ln=0,Xe();var r=To,o=Xa,l=zs,u=n_;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?ln=5:(ln=0,Xa=To=null,y_(r,r.pendingLanes));var m=r.pendingLanes;if(m===0&&(Eo=null),oc(l),o=o.stateNode,Zt&&typeof Zt.onCommitFiberRoot=="function")try{Zt.onCommitFiberRoot(xr,o,void 0,(o.current.flags&128)===128)}catch{}if(u!==null){o=P.T,m=V.p,V.p=2,P.T=null;try{for(var v=r.onRecoverableError,E=0;E<u.length;E++){var M=u[E];v(M.value,{componentStack:M.stack})}}finally{P.T=o,V.p=m}}(zs&3)!==0&&Wf(),us(r),m=r.pendingLanes,(l&261930)!==0&&(m&42)!==0?r===lg?Lc++:(Lc=0,lg=r):Lc=0,Uc(0)}}function y_(r,o){(r.pooledCacheLanes&=o)===0&&(o=r.pooledCache,o!=null&&(r.pooledCache=null,bc(o)))}function Wf(){return p_(),m_(),g_(),v_()}function v_(){if(ln!==5)return!1;var r=To,o=ig;ig=0;var l=oc(zs),u=P.T,m=V.p;try{V.p=32>l?32:l,P.T=null,l=ag,ag=null;var v=To,E=zs;if(ln=0,Xa=To=null,zs=0,(gt&6)!==0)throw Error(s(331));var M=gt;if(gt|=4,JS(v.current),XS(v,v.current,E,l),gt=M,Uc(0,!1),Zt&&typeof Zt.onPostCommitFiberRoot=="function")try{Zt.onPostCommitFiberRoot(xr,v)}catch{}return!0}finally{V.p=m,P.T=u,y_(r,o)}}function b_(r,o,l){o=Er(l,o),o=$m(r.stateNode,o,2),r=vo(r,o,2),r!==null&&(xs(r,2),us(r))}function _t(r,o,l){if(r.tag===3)b_(r,r,l);else for(;o!==null;){if(o.tag===3){b_(o,r,l);break}else if(o.tag===1){var u=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Eo===null||!Eo.has(u))){r=Er(l,r),l=xS(2),u=vo(o,l,2),u!==null&&(SS(l,u,o,r),xs(u,2),us(u));break}}o=o.return}}function fg(r,o,l){var u=r.pingCache;if(u===null){u=r.pingCache=new BM;var m=new Set;u.set(o,m)}else m=u.get(o),m===void 0&&(m=new Set,u.set(o,m));m.has(l)||(rg=!0,m.add(l),r=KM.bind(null,r,o,l),o.then(r,r))}function KM(r,o,l){var u=r.pingCache;u!==null&&u.delete(o),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,Nt===r&&(tt&l)===l&&(qt===4||qt===3&&(tt&62914560)===tt&&300>$e()-Kf?(gt&2)===0&&Qa(r,0):sg|=l,Ya===tt&&(Ya=0)),us(r)}function x_(r,o){o===0&&(o=bi()),r=Ti(r,o),r!==null&&(xs(r,o),us(r))}function GM(r){var o=r.memoizedState,l=0;o!==null&&(l=o.retryLane),x_(r,l)}function ZM(r,o){var l=0;switch(r.tag){case 31:case 13:var u=r.stateNode,m=r.memoizedState;m!==null&&(l=m.retryLane);break;case 19:u=r.stateNode;break;case 22:u=r.stateNode._retryCache;break;default:throw Error(s(314))}u!==null&&u.delete(o),x_(r,l)}function YM(r,o){return ke(r,o)}var Jf=null,Ja=null,dg=!1,ed=!1,hg=!1,Ro=0;function us(r){r!==Ja&&r.next===null&&(Ja===null?Jf=Ja=r:Ja=Ja.next=r),ed=!0,dg||(dg=!0,QM())}function Uc(r,o){if(!hg&&ed){hg=!0;do for(var l=!1,u=Jf;u!==null;){if(r!==0){var m=u.pendingLanes;if(m===0)var v=0;else{var E=u.suspendedLanes,M=u.pingedLanes;v=(1<<31-xt(42|r)+1)-1,v&=m&~(E&~M),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(l=!0,E_(u,v))}else v=tt,v=ss(u,u===Nt?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||os(u,v)||(l=!0,E_(u,v));u=u.next}while(l);hg=!1}}function XM(){S_()}function S_(){ed=dg=!1;var r=0;Ro!==0&&ak()&&(r=Ro);for(var o=$e(),l=null,u=Jf;u!==null;){var m=u.next,v=__(u,o);v===0?(u.next=null,l===null?Jf=m:l.next=m,m===null&&(Ja=l)):(l=u,(r!==0||(v&3)!==0)&&(ed=!0)),u=m}ln!==0&&ln!==5||Uc(r),Ro!==0&&(Ro=0)}function __(r,o){for(var l=r.suspendedLanes,u=r.pingedLanes,m=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var E=31-xt(v),M=1<<E,$=m[E];$===-1?((M&l)===0||(M&u)!==0)&&(m[E]=ba(M,o)):$<=o&&(r.expiredLanes|=M),v&=~M}if(o=Nt,l=tt,l=ss(r,r===o?l:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u=r.callbackNode,l===0||r===o&&(St===2||St===9)||r.cancelPendingCommit!==null)return u!==null&&u!==null&&we(u),r.callbackNode=null,r.callbackPriority=0;if((l&3)===0||os(r,l)){if(o=l&-l,o===r.callbackPriority)return o;switch(u!==null&&we(u),oc(l)){case 2:case 8:l=me;break;case 32:l=Te;break;case 268435456:l=mt;break;default:l=Te}return u=w_.bind(null,r),l=ke(l,u),r.callbackPriority=o,r.callbackNode=l,o}return u!==null&&u!==null&&we(u),r.callbackPriority=2,r.callbackNode=null,2}function w_(r,o){if(ln!==0&&ln!==5)return r.callbackNode=null,r.callbackPriority=0,null;var l=r.callbackNode;if(Wf()&&r.callbackNode!==l)return null;var u=tt;return u=ss(r,r===Nt?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u===0?null:(s_(r,u,o),__(r,$e()),r.callbackNode!=null&&r.callbackNode===l?w_.bind(null,r):null)}function E_(r,o){if(Wf())return null;s_(r,o,!0)}function QM(){ck(function(){(gt&6)!==0?ke(Fe,XM):S_()})}function pg(){if(Ro===0){var r=La;r===0&&(r=Ot,Ot<<=1,(Ot&261888)===0&&(Ot=256)),Ro=r}return Ro}function T_(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:lf(""+r)}function C_(r,o){var l=o.ownerDocument.createElement("input");return l.name=o.name,l.value=o.value,r.id&&l.setAttribute("form",r.id),o.parentNode.insertBefore(l,o),r=new FormData(r),l.parentNode.removeChild(l),r}function WM(r,o,l,u,m){if(o==="submit"&&l&&l.stateNode===m){var v=T_((m[Dn]||null).action),E=u.submitter;E&&(o=(o=E[Dn]||null)?T_(o.formAction):E.getAttribute("formAction"),o!==null&&(v=o,E=null));var M=new df("action","action",null,u,m);r.push({event:M,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Ro!==0){var $=E?C_(m,E):new FormData(m);Im(l,{pending:!0,data:$,method:m.method,action:v},null,$)}}else typeof v=="function"&&(M.preventDefault(),$=E?C_(m,E):new FormData(m),Im(l,{pending:!0,data:$,method:m.method,action:v},v,$))},currentTarget:m}]})}}for(var mg=0;mg<Qp.length;mg++){var gg=Qp[mg],JM=gg.toLowerCase(),ek=gg[0].toUpperCase()+gg.slice(1);Kr(JM,"on"+ek)}Kr(r0,"onAnimationEnd"),Kr(s0,"onAnimationIteration"),Kr(o0,"onAnimationStart"),Kr("dblclick","onDoubleClick"),Kr("focusin","onFocus"),Kr("focusout","onBlur"),Kr(gM,"onTransitionRun"),Kr(yM,"onTransitionStart"),Kr(vM,"onTransitionCancel"),Kr(i0,"onTransitionEnd"),Ea("onMouseEnter",["mouseout","mouseover"]),Ea("onMouseLeave",["mouseout","mouseover"]),Ea("onPointerEnter",["pointerout","pointerover"]),Ea("onPointerLeave",["pointerout","pointerover"]),Si("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Si("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Si("onBeforeInput",["compositionend","keypress","textInput","paste"]),Si("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Si("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Si("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $c="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(" "),tk=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($c));function R_(r,o){o=(o&4)!==0;for(var l=0;l<r.length;l++){var u=r[l],m=u.event;u=u.listeners;e:{var v=void 0;if(o)for(var E=u.length-1;0<=E;E--){var M=u[E],$=M.instance,ee=M.currentTarget;if(M=M.listener,$!==v&&m.isPropagationStopped())break e;v=M,m.currentTarget=ee;try{v(m)}catch(le){mf(le)}m.currentTarget=null,v=$}else for(E=0;E<u.length;E++){if(M=u[E],$=M.instance,ee=M.currentTarget,M=M.listener,$!==v&&m.isPropagationStopped())break e;v=M,m.currentTarget=ee;try{v(m)}catch(le){mf(le)}m.currentTarget=null,v=$}}}}function et(r,o){var l=o[jp];l===void 0&&(l=o[jp]=new Set);var u=r+"__bubble";l.has(u)||(N_(o,r,2,!1),l.add(u))}function yg(r,o,l){var u=0;o&&(u|=4),N_(l,r,u,o)}var td="_reactListening"+Math.random().toString(36).slice(2);function vg(r){if(!r[td]){r[td]=!0,Sx.forEach(function(l){l!=="selectionchange"&&(tk.has(l)||yg(l,!1,r),yg(l,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[td]||(o[td]=!0,yg("selectionchange",!1,o))}}function N_(r,o,l,u){switch(rw(o)){case 2:var m=jk;break;case 8:m=Ak;break;default:m=kg}l=m.bind(null,o,l,r),m=void 0,!Lp||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(m=!0),u?m!==void 0?r.addEventListener(o,l,{capture:!0,passive:m}):r.addEventListener(o,l,!0):m!==void 0?r.addEventListener(o,l,{passive:m}):r.addEventListener(o,l,!1)}function bg(r,o,l,u,m){var v=u;if((o&1)===0&&(o&2)===0&&u!==null)e:for(;;){if(u===null)return;var E=u.tag;if(E===3||E===4){var M=u.stateNode.containerInfo;if(M===m)break;if(E===4)for(E=u.return;E!==null;){var $=E.tag;if(($===3||$===4)&&E.stateNode.containerInfo===m)return;E=E.return}for(;M!==null;){if(E=Sa(M),E===null)return;if($=E.tag,$===5||$===6||$===26||$===27){u=v=E;continue e}M=M.parentNode}}u=u.return}kx(function(){var ee=v,le=Pp(l),fe=[];e:{var ne=a0.get(r);if(ne!==void 0){var ie=df,Re=r;switch(r){case"keypress":if(uf(l)===0)break e;case"keydown":case"keyup":ie=ZO;break;case"focusin":Re="focus",ie=Fp;break;case"focusout":Re="blur",ie=Fp;break;case"beforeblur":case"afterblur":ie=Fp;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=Px;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=PO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=QO;break;case r0:case s0:case o0:ie=UO;break;case i0:ie=JO;break;case"scroll":case"scrollend":ie=IO;break;case"wheel":ie=tM;break;case"copy":case"cut":case"paste":ie=BO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=Lx;break;case"toggle":case"beforetoggle":ie=rM}var Ue=(o&4)!==0,Ct=!Ue&&(r==="scroll"||r==="scrollend"),Z=Ue?ne!==null?ne+"Capture":null:ne;Ue=[];for(var H=ee,J;H!==null;){var ce=H;if(J=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||J===null||Z===null||(ce=lc(H,Z),ce!=null&&Ue.push(Bc(H,ce,J))),Ct)break;H=H.return}0<Ue.length&&(ne=new ie(ne,Re,null,l,le),fe.push({event:ne,listeners:Ue}))}}if((o&7)===0){e:{if(ne=r==="mouseover"||r==="pointerover",ie=r==="mouseout"||r==="pointerout",ne&&l!==Dp&&(Re=l.relatedTarget||l.fromElement)&&(Sa(Re)||Re[xa]))break e;if((ie||ne)&&(ne=le.window===le?le:(ne=le.ownerDocument)?ne.defaultView||ne.parentWindow:window,ie?(Re=l.relatedTarget||l.toElement,ie=ee,Re=Re?Sa(Re):null,Re!==null&&(Ct=a(Re),Ue=Re.tag,Re!==Ct||Ue!==5&&Ue!==27&&Ue!==6)&&(Re=null)):(ie=null,Re=ee),ie!==Re)){if(Ue=Px,ce="onMouseLeave",Z="onMouseEnter",H="mouse",(r==="pointerout"||r==="pointerover")&&(Ue=Lx,ce="onPointerLeave",Z="onPointerEnter",H="pointer"),Ct=ie==null?ne:ac(ie),J=Re==null?ne:ac(Re),ne=new Ue(ce,H+"leave",ie,l,le),ne.target=Ct,ne.relatedTarget=J,ce=null,Sa(le)===ee&&(Ue=new Ue(Z,H+"enter",Re,l,le),Ue.target=J,Ue.relatedTarget=Ct,ce=Ue),Ct=ce,ie&&Re)t:{for(Ue=nk,Z=ie,H=Re,J=0,ce=Z;ce;ce=Ue(ce))J++;ce=0;for(var Pe=H;Pe;Pe=Ue(Pe))ce++;for(;0<J-ce;)Z=Ue(Z),J--;for(;0<ce-J;)H=Ue(H),ce--;for(;J--;){if(Z===H||H!==null&&Z===H.alternate){Ue=Z;break t}Z=Ue(Z),H=Ue(H)}Ue=null}else Ue=null;ie!==null&&j_(fe,ne,ie,Ue,!1),Re!==null&&Ct!==null&&j_(fe,Ct,Re,Ue,!0)}}e:{if(ne=ee?ac(ee):window,ie=ne.nodeName&&ne.nodeName.toLowerCase(),ie==="select"||ie==="input"&&ne.type==="file")var ft=Kx;else if(qx(ne))if(Gx)ft=hM;else{ft=fM;var Oe=uM}else ie=ne.nodeName,!ie||ie.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?ee&&Ip(ee.elementType)&&(ft=Kx):ft=dM;if(ft&&(ft=ft(r,ee))){Vx(fe,ft,l,le);break e}Oe&&Oe(r,ne,ee),r==="focusout"&&ee&&ne.type==="number"&&ee.memoizedProps.value!=null&&kp(ne,"number",ne.value)}switch(Oe=ee?ac(ee):window,r){case"focusin":(qx(Oe)||Oe.contentEditable==="true")&&(Aa=Oe,Zp=ee,gc=null);break;case"focusout":gc=Zp=Aa=null;break;case"mousedown":Yp=!0;break;case"contextmenu":case"mouseup":case"dragend":Yp=!1,t0(fe,l,le);break;case"selectionchange":if(mM)break;case"keydown":case"keyup":t0(fe,l,le)}var Ye;if(qp)e:{switch(r){case"compositionstart":var nt="onCompositionStart";break e;case"compositionend":nt="onCompositionEnd";break e;case"compositionupdate":nt="onCompositionUpdate";break e}nt=void 0}else ja?Fx(r,l)&&(nt="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(nt="onCompositionStart");nt&&(Ux&&l.locale!=="ko"&&(ja||nt!=="onCompositionStart"?nt==="onCompositionEnd"&&ja&&(Ye=Ix()):(uo=le,Up="value"in uo?uo.value:uo.textContent,ja=!0)),Oe=nd(ee,nt),0<Oe.length&&(nt=new zx(nt,r,null,l,le),fe.push({event:nt,listeners:Oe}),Ye?nt.data=Ye:(Ye=Hx(l),Ye!==null&&(nt.data=Ye)))),(Ye=oM?iM(r,l):aM(r,l))&&(nt=nd(ee,"onBeforeInput"),0<nt.length&&(Oe=new zx("onBeforeInput","beforeinput",null,l,le),fe.push({event:Oe,listeners:nt}),Oe.data=Ye)),WM(fe,r,ee,l,le)}R_(fe,o)})}function Bc(r,o,l){return{instance:r,listener:o,currentTarget:l}}function nd(r,o){for(var l=o+"Capture",u=[];r!==null;){var m=r,v=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||v===null||(m=lc(r,l),m!=null&&u.unshift(Bc(r,m,v)),m=lc(r,o),m!=null&&u.push(Bc(r,m,v))),r.tag===3)return u;r=r.return}return[]}function nk(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function j_(r,o,l,u,m){for(var v=o._reactName,E=[];l!==null&&l!==u;){var M=l,$=M.alternate,ee=M.stateNode;if(M=M.tag,$!==null&&$===u)break;M!==5&&M!==26&&M!==27||ee===null||($=ee,m?(ee=lc(l,v),ee!=null&&E.unshift(Bc(l,ee,$))):m||(ee=lc(l,v),ee!=null&&E.push(Bc(l,ee,$)))),l=l.return}E.length!==0&&r.push({event:o,listeners:E})}var rk=/\r\n?/g,sk=/\u0000|\uFFFD/g;function A_(r){return(typeof r=="string"?r:""+r).replace(rk,`
|
|
67
|
+
`).replace(sk,"")}function O_(r,o){return o=A_(o),A_(r)===o}function Tt(r,o,l,u,m,v){switch(l){case"children":typeof u=="string"?o==="body"||o==="textarea"&&u===""||Ca(r,u):(typeof u=="number"||typeof u=="bigint")&&o!=="body"&&Ca(r,""+u);break;case"className":of(r,"class",u);break;case"tabIndex":of(r,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":of(r,l,u);break;case"style":Ox(r,u,v);break;case"data":if(o!=="object"){of(r,"data",u);break}case"src":case"href":if(u===""&&(o!=="a"||l!=="href")){r.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(l);break}u=lf(""+u),r.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){r.setAttribute(l,"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 v=="function"&&(l==="formAction"?(o!=="input"&&Tt(r,o,"name",m.name,m,null),Tt(r,o,"formEncType",m.formEncType,m,null),Tt(r,o,"formMethod",m.formMethod,m,null),Tt(r,o,"formTarget",m.formTarget,m,null)):(Tt(r,o,"encType",m.encType,m,null),Tt(r,o,"method",m.method,m,null),Tt(r,o,"target",m.target,m,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(l);break}u=lf(""+u),r.setAttribute(l,u);break;case"onClick":u!=null&&(r.onclick=_s);break;case"onScroll":u!=null&&et("scroll",r);break;case"onScrollEnd":u!=null&&et("scrollend",r);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(l=u.__html,l!=null){if(m.children!=null)throw Error(s(60));r.innerHTML=l}}break;case"multiple":r.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":r.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){r.removeAttribute("xlink:href");break}l=lf(""+u),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(l,""+u):r.removeAttribute(l);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":u&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(l,""):r.removeAttribute(l);break;case"capture":case"download":u===!0?r.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(l,u):r.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?r.setAttribute(l,u):r.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?r.removeAttribute(l):r.setAttribute(l,u);break;case"popover":et("beforetoggle",r),et("toggle",r),sf(r,"popover",u);break;case"xlinkActuate":Ss(r,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Ss(r,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Ss(r,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Ss(r,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Ss(r,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Ss(r,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Ss(r,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Ss(r,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Ss(r,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":sf(r,"is",u);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=MO.get(l)||l,sf(r,l,u))}}function xg(r,o,l,u,m,v){switch(l){case"style":Ox(r,u,v);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(s(61));if(l=u.__html,l!=null){if(m.children!=null)throw Error(s(60));r.innerHTML=l}}break;case"children":typeof u=="string"?Ca(r,u):(typeof u=="number"||typeof u=="bigint")&&Ca(r,""+u);break;case"onScroll":u!=null&&et("scroll",r);break;case"onScrollEnd":u!=null&&et("scrollend",r);break;case"onClick":u!=null&&(r.onclick=_s);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_x.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(m=l.endsWith("Capture"),o=l.slice(2,m?l.length-7:void 0),v=r[Dn]||null,v=v!=null?v[l]:null,typeof v=="function"&&r.removeEventListener(o,v,m),typeof u=="function")){typeof v!="function"&&v!==null&&(l in r?r[l]=null:r.hasAttribute(l)&&r.removeAttribute(l)),r.addEventListener(o,u,m);break e}l in r?r[l]=u:u===!0?r.setAttribute(l,""):sf(r,l,u)}}}function _n(r,o,l){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",r),et("load",r);var u=!1,m=!1,v;for(v in l)if(l.hasOwnProperty(v)){var E=l[v];if(E!=null)switch(v){case"src":u=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,o));default:Tt(r,o,v,E,l,null)}}m&&Tt(r,o,"srcSet",l.srcSet,l,null),u&&Tt(r,o,"src",l.src,l,null);return;case"input":et("invalid",r);var M=v=E=m=null,$=null,ee=null;for(u in l)if(l.hasOwnProperty(u)){var le=l[u];if(le!=null)switch(u){case"name":m=le;break;case"type":E=le;break;case"checked":$=le;break;case"defaultChecked":ee=le;break;case"value":v=le;break;case"defaultValue":M=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(s(137,o));break;default:Tt(r,o,u,le,l,null)}}Rx(r,v,M,$,ee,E,m,!1);return;case"select":et("invalid",r),u=E=v=null;for(m in l)if(l.hasOwnProperty(m)&&(M=l[m],M!=null))switch(m){case"value":v=M;break;case"defaultValue":E=M;break;case"multiple":u=M;default:Tt(r,o,m,M,l,null)}o=v,l=E,r.multiple=!!u,o!=null?Ta(r,!!u,o,!1):l!=null&&Ta(r,!!u,l,!0);return;case"textarea":et("invalid",r),v=m=u=null;for(E in l)if(l.hasOwnProperty(E)&&(M=l[E],M!=null))switch(E){case"value":u=M;break;case"defaultValue":m=M;break;case"children":v=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(s(91));break;default:Tt(r,o,E,M,l,null)}jx(r,u,m,v);return;case"option":for($ in l)l.hasOwnProperty($)&&(u=l[$],u!=null)&&($==="selected"?r.selected=u&&typeof u!="function"&&typeof u!="symbol":Tt(r,o,$,u,l,null));return;case"dialog":et("beforetoggle",r),et("toggle",r),et("cancel",r),et("close",r);break;case"iframe":case"object":et("load",r);break;case"video":case"audio":for(u=0;u<$c.length;u++)et($c[u],r);break;case"image":et("error",r),et("load",r);break;case"details":et("toggle",r);break;case"embed":case"source":case"link":et("error",r),et("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 l)if(l.hasOwnProperty(ee)&&(u=l[ee],u!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,o));default:Tt(r,o,ee,u,l,null)}return;default:if(Ip(o)){for(le in l)l.hasOwnProperty(le)&&(u=l[le],u!==void 0&&xg(r,o,le,u,l,void 0));return}}for(M in l)l.hasOwnProperty(M)&&(u=l[M],u!=null&&Tt(r,o,M,u,l,null))}function ok(r,o,l,u){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,v=null,E=null,M=null,$=null,ee=null,le=null;for(ie in l){var fe=l[ie];if(l.hasOwnProperty(ie)&&fe!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":$=fe;default:u.hasOwnProperty(ie)||Tt(r,o,ie,null,u,fe)}}for(var ne in u){var ie=u[ne];if(fe=l[ne],u.hasOwnProperty(ne)&&(ie!=null||fe!=null))switch(ne){case"type":v=ie;break;case"name":m=ie;break;case"checked":ee=ie;break;case"defaultChecked":le=ie;break;case"value":E=ie;break;case"defaultValue":M=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(s(137,o));break;default:ie!==fe&&Tt(r,o,ne,ie,u,fe)}}Mp(r,E,M,$,ee,le,v,m);return;case"select":ie=E=M=ne=null;for(v in l)if($=l[v],l.hasOwnProperty(v)&&$!=null)switch(v){case"value":break;case"multiple":ie=$;default:u.hasOwnProperty(v)||Tt(r,o,v,null,u,$)}for(m in u)if(v=u[m],$=l[m],u.hasOwnProperty(m)&&(v!=null||$!=null))switch(m){case"value":ne=v;break;case"defaultValue":M=v;break;case"multiple":E=v;default:v!==$&&Tt(r,o,m,v,u,$)}o=M,l=E,u=ie,ne!=null?Ta(r,!!l,ne,!1):!!u!=!!l&&(o!=null?Ta(r,!!l,o,!0):Ta(r,!!l,l?[]:"",!1));return;case"textarea":ie=ne=null;for(M in l)if(m=l[M],l.hasOwnProperty(M)&&m!=null&&!u.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:Tt(r,o,M,null,u,m)}for(E in u)if(m=u[E],v=l[E],u.hasOwnProperty(E)&&(m!=null||v!=null))switch(E){case"value":ne=m;break;case"defaultValue":ie=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(s(91));break;default:m!==v&&Tt(r,o,E,m,u,v)}Nx(r,ne,ie);return;case"option":for(var Re in l)ne=l[Re],l.hasOwnProperty(Re)&&ne!=null&&!u.hasOwnProperty(Re)&&(Re==="selected"?r.selected=!1:Tt(r,o,Re,null,u,ne));for($ in u)ne=u[$],ie=l[$],u.hasOwnProperty($)&&ne!==ie&&(ne!=null||ie!=null)&&($==="selected"?r.selected=ne&&typeof ne!="function"&&typeof ne!="symbol":Tt(r,o,$,ne,u,ie));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 Ue in l)ne=l[Ue],l.hasOwnProperty(Ue)&&ne!=null&&!u.hasOwnProperty(Ue)&&Tt(r,o,Ue,null,u,ne);for(ee in u)if(ne=u[ee],ie=l[ee],u.hasOwnProperty(ee)&&ne!==ie&&(ne!=null||ie!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(s(137,o));break;default:Tt(r,o,ee,ne,u,ie)}return;default:if(Ip(o)){for(var Ct in l)ne=l[Ct],l.hasOwnProperty(Ct)&&ne!==void 0&&!u.hasOwnProperty(Ct)&&xg(r,o,Ct,void 0,u,ne);for(le in u)ne=u[le],ie=l[le],!u.hasOwnProperty(le)||ne===ie||ne===void 0&&ie===void 0||xg(r,o,le,ne,u,ie);return}}for(var Z in l)ne=l[Z],l.hasOwnProperty(Z)&&ne!=null&&!u.hasOwnProperty(Z)&&Tt(r,o,Z,null,u,ne);for(fe in u)ne=u[fe],ie=l[fe],!u.hasOwnProperty(fe)||ne===ie||ne==null&&ie==null||Tt(r,o,fe,ne,u,ie)}function M_(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function ik(){if(typeof performance.getEntriesByType=="function"){for(var r=0,o=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var m=l[u],v=m.transferSize,E=m.initiatorType,M=m.duration;if(v&&M&&M_(E)){for(E=0,M=m.responseEnd,u+=1;u<l.length;u++){var $=l[u],ee=$.startTime;if(ee>M)break;var le=$.transferSize,fe=$.initiatorType;le&&M_(fe)&&($=$.responseEnd,E+=le*($<M?1:(M-ee)/($-ee)))}if(--u,o+=8*(v+E)/(m.duration/1e3),r++,10<r)break}}if(0<r)return o/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Sg=null,_g=null;function rd(r){return r.nodeType===9?r:r.ownerDocument}function k_(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 I_(r,o){if(r===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&o==="foreignObject"?0:r}function wg(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Eg=null;function ak(){var r=window.event;return r&&r.type==="popstate"?r===Eg?!1:(Eg=r,!0):(Eg=null,!1)}var D_=typeof setTimeout=="function"?setTimeout:void 0,lk=typeof clearTimeout=="function"?clearTimeout:void 0,P_=typeof Promise=="function"?Promise:void 0,ck=typeof queueMicrotask=="function"?queueMicrotask:typeof P_<"u"?function(r){return P_.resolve(null).then(r).catch(uk)}:D_;function uk(r){setTimeout(function(){throw r})}function No(r){return r==="head"}function z_(r,o){var l=o,u=0;do{var m=l.nextSibling;if(r.removeChild(l),m&&m.nodeType===8)if(l=m.data,l==="/$"||l==="/&"){if(u===0){r.removeChild(m),rl(o);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")Fc(r.ownerDocument.documentElement);else if(l==="head"){l=r.ownerDocument.head,Fc(l);for(var v=l.firstChild;v;){var E=v.nextSibling,M=v.nodeName;v[ic]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&v.rel.toLowerCase()==="stylesheet"||l.removeChild(v),v=E}}else l==="body"&&Fc(r.ownerDocument.body);l=m}while(l);rl(o)}function L_(r,o){var l=r;r=0;do{var u=l.nextSibling;if(l.nodeType===1?o?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(o?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(r===0)break;r--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||r++;l=u}while(l)}function Tg(r){var o=r.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var l=o;switch(o=o.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Tg(l),Ap(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}r.removeChild(l)}}function fk(r,o,l,u){for(;r.nodeType===1;){var m=l;if(r.nodeName.toLowerCase()!==o.toLowerCase()){if(!u&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(u){if(!r[ic])switch(o){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==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(v=r.getAttribute("src"),(v!==(m.src==null?null:m.src)||r.getAttribute("type")!==(m.type==null?null:m.type)||r.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(o==="input"&&r.type==="hidden"){var v=m.name==null?null:""+m.name;if(m.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=jr(r.nextSibling),r===null)break}return null}function dk(r,o,l){if(o==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=jr(r.nextSibling),r===null))return null;return r}function U_(r,o){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=jr(r.nextSibling),r===null))return null;return r}function Cg(r){return r.data==="$?"||r.data==="$~"}function Rg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function hk(r,o){var l=r.ownerDocument;if(r.data==="$~")r._reactRetry=o;else if(r.data!=="$?"||l.readyState!=="loading")o();else{var u=function(){o(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),r._reactRetry=u}}function jr(r){for(;r!=null;r=r.nextSibling){var o=r.nodeType;if(o===1||o===3)break;if(o===8){if(o=r.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return r}var Ng=null;function $_(r){r=r.nextSibling;for(var o=0;r;){if(r.nodeType===8){var l=r.data;if(l==="/$"||l==="/&"){if(o===0)return jr(r.nextSibling);o--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||o++}r=r.nextSibling}return null}function B_(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(o===0)return r;o--}else l!=="/$"&&l!=="/&"||o++}r=r.previousSibling}return null}function F_(r,o,l){switch(o=rd(l),r){case"html":if(r=o.documentElement,!r)throw Error(s(452));return r;case"head":if(r=o.head,!r)throw Error(s(453));return r;case"body":if(r=o.body,!r)throw Error(s(454));return r;default:throw Error(s(451))}}function Fc(r){for(var o=r.attributes;o.length;)r.removeAttributeNode(o[0]);Ap(r)}var Ar=new Map,H_=new Set;function sd(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Ls=V.d;V.d={f:pk,r:mk,D:gk,C:yk,L:vk,m:bk,X:Sk,S:xk,M:_k};function pk(){var r=Ls.f(),o=Yf();return r||o}function mk(r){var o=_a(r);o!==null&&o.tag===5&&o.type==="form"?iS(o):Ls.r(r)}var el=typeof document>"u"?null:document;function q_(r,o,l){var u=el;if(u&&typeof o=="string"&&o){var m=_r(o);m='link[rel="'+r+'"][href="'+m+'"]',typeof l=="string"&&(m+='[crossorigin="'+l+'"]'),H_.has(m)||(H_.add(m),r={rel:r,crossOrigin:l,href:o},u.querySelector(m)===null&&(o=u.createElement("link"),_n(o,"link",r),gn(o),u.head.appendChild(o)))}}function gk(r){Ls.D(r),q_("dns-prefetch",r,null)}function yk(r,o){Ls.C(r,o),q_("preconnect",r,o)}function vk(r,o,l){Ls.L(r,o,l);var u=el;if(u&&r&&o){var m='link[rel="preload"][as="'+_r(o)+'"]';o==="image"&&l&&l.imageSrcSet?(m+='[imagesrcset="'+_r(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(m+='[imagesizes="'+_r(l.imageSizes)+'"]')):m+='[href="'+_r(r)+'"]';var v=m;switch(o){case"style":v=tl(r);break;case"script":v=nl(r)}Ar.has(v)||(r=y({rel:"preload",href:o==="image"&&l&&l.imageSrcSet?void 0:r,as:o},l),Ar.set(v,r),u.querySelector(m)!==null||o==="style"&&u.querySelector(Hc(v))||o==="script"&&u.querySelector(qc(v))||(o=u.createElement("link"),_n(o,"link",r),gn(o),u.head.appendChild(o)))}}function bk(r,o){Ls.m(r,o);var l=el;if(l&&r){var u=o&&typeof o.as=="string"?o.as:"script",m='link[rel="modulepreload"][as="'+_r(u)+'"][href="'+_r(r)+'"]',v=m;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=nl(r)}if(!Ar.has(v)&&(r=y({rel:"modulepreload",href:r},o),Ar.set(v,r),l.querySelector(m)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(qc(v)))return}u=l.createElement("link"),_n(u,"link",r),gn(u),l.head.appendChild(u)}}}function xk(r,o,l){Ls.S(r,o,l);var u=el;if(u&&r){var m=wa(u).hoistableStyles,v=tl(r);o=o||"default";var E=m.get(v);if(!E){var M={loading:0,preload:null};if(E=u.querySelector(Hc(v)))M.loading=5;else{r=y({rel:"stylesheet",href:r,"data-precedence":o},l),(l=Ar.get(v))&&jg(r,l);var $=E=u.createElement("link");gn($),_n($,"link",r),$._p=new Promise(function(ee,le){$.onload=ee,$.onerror=le}),$.addEventListener("load",function(){M.loading|=1}),$.addEventListener("error",function(){M.loading|=2}),M.loading|=4,od(E,o,u)}E={type:"stylesheet",instance:E,count:1,state:M},m.set(v,E)}}}function Sk(r,o){Ls.X(r,o);var l=el;if(l&&r){var u=wa(l).hoistableScripts,m=nl(r),v=u.get(m);v||(v=l.querySelector(qc(m)),v||(r=y({src:r,async:!0},o),(o=Ar.get(m))&&Ag(r,o),v=l.createElement("script"),gn(v),_n(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(m,v))}}function _k(r,o){Ls.M(r,o);var l=el;if(l&&r){var u=wa(l).hoistableScripts,m=nl(r),v=u.get(m);v||(v=l.querySelector(qc(m)),v||(r=y({src:r,async:!0,type:"module"},o),(o=Ar.get(m))&&Ag(r,o),v=l.createElement("script"),gn(v),_n(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(m,v))}}function V_(r,o,l,u){var m=(m=oe.current)?sd(m):null;if(!m)throw Error(s(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(o=tl(l.href),l=wa(m).hoistableStyles,u=l.get(o),u||(u={type:"style",instance:null,count:0,state:null},l.set(o,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=tl(l.href);var v=wa(m).hoistableStyles,E=v.get(r);if(E||(m=m.ownerDocument||m,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,E),(v=m.querySelector(Hc(r)))&&!v._p&&(E.instance=v,E.state.loading=5),Ar.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Ar.set(r,l),v||wk(m,r,l,E.state))),o&&u===null)throw Error(s(528,""));return E}if(o&&u!==null)throw Error(s(529,""));return null;case"script":return o=l.async,l=l.src,typeof l=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=nl(l),l=wa(m).hoistableScripts,u=l.get(o),u||(u={type:"script",instance:null,count:0,state:null},l.set(o,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,r))}}function tl(r){return'href="'+_r(r)+'"'}function Hc(r){return'link[rel="stylesheet"]['+r+"]"}function K_(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function wk(r,o,l,u){r.querySelector('link[rel="preload"][as="style"]['+o+"]")?u.loading=1:(o=r.createElement("link"),u.preload=o,o.addEventListener("load",function(){return u.loading|=1}),o.addEventListener("error",function(){return u.loading|=2}),_n(o,"link",l),gn(o),r.head.appendChild(o))}function nl(r){return'[src="'+_r(r)+'"]'}function qc(r){return"script[async]"+r}function G_(r,o,l){if(o.count++,o.instance===null)switch(o.type){case"style":var u=r.querySelector('style[data-href~="'+_r(l.href)+'"]');if(u)return o.instance=u,gn(u),u;var m=y({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(r.ownerDocument||r).createElement("style"),gn(u),_n(u,"style",m),od(u,l.precedence,r),o.instance=u;case"stylesheet":m=tl(l.href);var v=r.querySelector(Hc(m));if(v)return o.state.loading|=4,o.instance=v,gn(v),v;u=K_(l),(m=Ar.get(m))&&jg(u,m),v=(r.ownerDocument||r).createElement("link"),gn(v);var E=v;return E._p=new Promise(function(M,$){E.onload=M,E.onerror=$}),_n(v,"link",u),o.state.loading|=4,od(v,l.precedence,r),o.instance=v;case"script":return v=nl(l.src),(m=r.querySelector(qc(v)))?(o.instance=m,gn(m),m):(u=l,(m=Ar.get(v))&&(u=y({},l),Ag(u,m)),r=r.ownerDocument||r,m=r.createElement("script"),gn(m),_n(m,"link",u),r.head.appendChild(m),o.instance=m);case"void":return null;default:throw Error(s(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(u=o.instance,o.state.loading|=4,od(u,l.precedence,r));return o.instance}function od(r,o,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=u.length?u[u.length-1]:null,v=m,E=0;E<u.length;E++){var M=u[E];if(M.dataset.precedence===o)v=M;else if(v!==m)break}v?v.parentNode.insertBefore(r,v.nextSibling):(o=l.nodeType===9?l.head:l,o.insertBefore(r,o.firstChild))}function jg(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.title==null&&(r.title=o.title)}function Ag(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.integrity==null&&(r.integrity=o.integrity)}var id=null;function Z_(r,o,l){if(id===null){var u=new Map,m=id=new Map;m.set(l,u)}else m=id,u=m.get(l),u||(u=new Map,m.set(l,u));if(u.has(r))return u;for(u.set(r,null),l=l.getElementsByTagName(r),m=0;m<l.length;m++){var v=l[m];if(!(v[ic]||v[vn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var E=v.getAttribute(o)||"";E=r+E;var M=u.get(E);M?M.push(v):u.set(E,[v])}}return u}function Y_(r,o,l){r=r.ownerDocument||r,r.head.insertBefore(l,o==="title"?r.querySelector("head > title"):null)}function Ek(r,o,l){if(l===1||o.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;return o.rel==="stylesheet"?(r=o.disabled,typeof o.precedence=="string"&&r==null):!0;case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function X_(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function Tk(r,o,l,u){if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var m=tl(u.href),v=o.querySelector(Hc(m));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(r.count++,r=ad.bind(r),o.then(r,r)),l.state.loading|=4,l.instance=v,gn(v);return}v=o.ownerDocument||o,u=K_(u),(m=Ar.get(m))&&jg(u,m),v=v.createElement("link"),gn(v);var E=v;E._p=new Promise(function(M,$){E.onload=M,E.onerror=$}),_n(v,"link",u),l.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(l,o),(o=l.state.preload)&&(l.state.loading&3)===0&&(r.count++,l=ad.bind(r),o.addEventListener("load",l),o.addEventListener("error",l))}}var Og=0;function Ck(r,o){return r.stylesheets&&r.count===0&&cd(r,r.stylesheets),0<r.count||0<r.imgCount?function(l){var u=setTimeout(function(){if(r.stylesheets&&cd(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+o);0<r.imgBytes&&Og===0&&(Og=62500*ik());var m=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&cd(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>Og?50:800)+o);return r.unsuspend=l,function(){r.unsuspend=null,clearTimeout(u),clearTimeout(m)}}:null}function ad(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var ld=null;function cd(r,o){r.stylesheets=null,r.unsuspend!==null&&(r.count++,ld=new Map,o.forEach(Rk,r),ld=null,ad.call(r))}function Rk(r,o){if(!(o.state.loading&4)){var l=ld.get(r);if(l)var u=l.get(null);else{l=new Map,ld.set(r,l);for(var m=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<m.length;v++){var E=m[v];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(l.set(E.dataset.precedence,E),u=E)}u&&l.set(null,u)}m=o.instance,E=m.getAttribute("data-precedence"),v=l.get(E)||u,v===u&&l.set(null,m),l.set(E,m),this.count++,u=ad.bind(this),m.addEventListener("load",u),m.addEventListener("error",u),v?v.parentNode.insertBefore(m,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(m,r.firstChild)),o.state.loading|=4}}var Vc={$$typeof:N,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function Nk(r,o,l,u,m,v,E,M,$){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=xi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xi(0),this.hiddenUpdates=xi(null),this.identifierPrefix=u,this.onUncaughtError=m,this.onCaughtError=v,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=$,this.incompleteTransitions=new Map}function Q_(r,o,l,u,m,v,E,M,$,ee,le,fe){return r=new Nk(r,o,l,E,$,ee,le,fe,M),o=1,v===!0&&(o|=24),v=Jn(3,null,null,o),r.current=v,v.stateNode=r,o=um(),o.refCount++,r.pooledCache=o,o.refCount++,v.memoizedState={element:u,isDehydrated:l,cache:o},pm(v),r}function W_(r){return r?(r=ka,r):ka}function J_(r,o,l,u,m,v){m=W_(m),u.context===null?u.context=m:u.pendingContext=m,u=yo(o),u.payload={element:l},v=v===void 0?null:v,v!==null&&(u.callback=v),l=vo(r,u,o),l!==null&&(Bn(l,r,o),wc(l,r,o))}function ew(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<o?l:o}}function Mg(r,o){ew(r,o),(r=r.alternate)&&ew(r,o)}function tw(r){if(r.tag===13||r.tag===31){var o=Ti(r,67108864);o!==null&&Bn(o,r,67108864),Mg(r,67108864)}}function nw(r){if(r.tag===13||r.tag===31){var o=sr();o=Qn(o);var l=Ti(r,o);l!==null&&Bn(l,r,o),Mg(r,o)}}var ud=!0;function jk(r,o,l,u){var m=P.T;P.T=null;var v=V.p;try{V.p=2,kg(r,o,l,u)}finally{V.p=v,P.T=m}}function Ak(r,o,l,u){var m=P.T;P.T=null;var v=V.p;try{V.p=8,kg(r,o,l,u)}finally{V.p=v,P.T=m}}function kg(r,o,l,u){if(ud){var m=Ig(u);if(m===null)bg(r,o,u,fd,l),sw(r,u);else if(Mk(m,r,o,l,u))u.stopPropagation();else if(sw(r,u),o&4&&-1<Ok.indexOf(r)){for(;m!==null;){var v=_a(m);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var E=Rn(v.pendingLanes);if(E!==0){var M=v;for(M.pendingLanes|=2,M.entangledLanes|=2;E;){var $=1<<31-xt(E);M.entanglements[1]|=$,E&=~$}us(v),(gt&6)===0&&(Gf=$e()+500,Uc(0))}}break;case 31:case 13:M=Ti(v,2),M!==null&&Bn(M,v,2),Yf(),Mg(v,2)}if(v=Ig(u),v===null&&bg(r,o,u,fd,l),v===m)break;m=v}m!==null&&u.stopPropagation()}else bg(r,o,u,null,l)}}function Ig(r){return r=Pp(r),Dg(r)}var fd=null;function Dg(r){if(fd=null,r=Sa(r),r!==null){var o=a(r);if(o===null)r=null;else{var l=o.tag;if(l===13){if(r=c(o),r!==null)return r;r=null}else if(l===31){if(r=f(o),r!==null)return r;r=null}else if(l===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null)}}return fd=r,null}function rw(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(We()){case Fe:return 2;case me:return 8;case Te:case qe:return 32;case mt:return 268435456;default:return 32}default:return 32}}var Pg=!1,jo=null,Ao=null,Oo=null,Kc=new Map,Gc=new Map,Mo=[],Ok="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 sw(r,o){switch(r){case"focusin":case"focusout":jo=null;break;case"dragenter":case"dragleave":Ao=null;break;case"mouseover":case"mouseout":Oo=null;break;case"pointerover":case"pointerout":Kc.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gc.delete(o.pointerId)}}function Zc(r,o,l,u,m,v){return r===null||r.nativeEvent!==v?(r={blockedOn:o,domEventName:l,eventSystemFlags:u,nativeEvent:v,targetContainers:[m]},o!==null&&(o=_a(o),o!==null&&tw(o)),r):(r.eventSystemFlags|=u,o=r.targetContainers,m!==null&&o.indexOf(m)===-1&&o.push(m),r)}function Mk(r,o,l,u,m){switch(o){case"focusin":return jo=Zc(jo,r,o,l,u,m),!0;case"dragenter":return Ao=Zc(Ao,r,o,l,u,m),!0;case"mouseover":return Oo=Zc(Oo,r,o,l,u,m),!0;case"pointerover":var v=m.pointerId;return Kc.set(v,Zc(Kc.get(v)||null,r,o,l,u,m)),!0;case"gotpointercapture":return v=m.pointerId,Gc.set(v,Zc(Gc.get(v)||null,r,o,l,u,m)),!0}return!1}function ow(r){var o=Sa(r.target);if(o!==null){var l=a(o);if(l!==null){if(o=l.tag,o===13){if(o=c(l),o!==null){r.blockedOn=o,rf(r.priority,function(){nw(l)});return}}else if(o===31){if(o=f(l),o!==null){r.blockedOn=o,rf(r.priority,function(){nw(l)});return}}else if(o===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function dd(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var l=Ig(r.nativeEvent);if(l===null){l=r.nativeEvent;var u=new l.constructor(l.type,l);Dp=u,l.target.dispatchEvent(u),Dp=null}else return o=_a(l),o!==null&&tw(o),r.blockedOn=l,!1;o.shift()}return!0}function iw(r,o,l){dd(r)&&l.delete(o)}function kk(){Pg=!1,jo!==null&&dd(jo)&&(jo=null),Ao!==null&&dd(Ao)&&(Ao=null),Oo!==null&&dd(Oo)&&(Oo=null),Kc.forEach(iw),Gc.forEach(iw)}function hd(r,o){r.blockedOn===o&&(r.blockedOn=null,Pg||(Pg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,kk)))}var pd=null;function aw(r){pd!==r&&(pd=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){pd===r&&(pd=null);for(var o=0;o<r.length;o+=3){var l=r[o],u=r[o+1],m=r[o+2];if(typeof u!="function"){if(Dg(u||l)===null)continue;break}var v=_a(l);v!==null&&(r.splice(o,3),o-=3,Im(v,{pending:!0,data:m,method:l.method,action:u},u,m))}}))}function rl(r){function o($){return hd($,r)}jo!==null&&hd(jo,r),Ao!==null&&hd(Ao,r),Oo!==null&&hd(Oo,r),Kc.forEach(o),Gc.forEach(o);for(var l=0;l<Mo.length;l++){var u=Mo[l];u.blockedOn===r&&(u.blockedOn=null)}for(;0<Mo.length&&(l=Mo[0],l.blockedOn===null);)ow(l),l.blockedOn===null&&Mo.shift();if(l=(r.ownerDocument||r).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var m=l[u],v=l[u+1],E=m[Dn]||null;if(typeof v=="function")E||aw(l);else if(E){var M=null;if(v&&v.hasAttribute("formAction")){if(m=v,E=v[Dn]||null)M=E.formAction;else if(Dg(m)!==null)continue}else M=E.action;typeof M=="function"?l[u+1]=M:(l.splice(u,3),u-=3),aw(l)}}}function lw(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(E){return m=E})},focusReset:"manual",scroll:"manual"})}function o(){m!==null&&(m(),m=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,m=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(l,100),function(){u=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),m!==null&&(m(),m=null)}}}function zg(r){this._internalRoot=r}md.prototype.render=zg.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(s(409));var l=o.current,u=sr();J_(l,u,r,o,null,null)},md.prototype.unmount=zg.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;J_(r.current,2,null,r,null,null),Yf(),o[xa]=null}};function md(r){this._internalRoot=r}md.prototype.unstable_scheduleHydration=function(r){if(r){var o=nf();r={blockedOn:null,target:r,priority:o};for(var l=0;l<Mo.length&&o!==0&&o<Mo[l].priority;l++);Mo.splice(l,0,r),l===0&&ow(r)}};var cw=t.version;if(cw!=="19.2.4")throw Error(s(527,cw,"19.2.4"));V.findDOMNode=function(r){var o=r._reactInternals;if(o===void 0)throw typeof r.render=="function"?Error(s(188)):(r=Object.keys(r).join(","),Error(s(268,r)));return r=p(o),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var Ik={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gd.isDisabled&&gd.supportsFiber)try{xr=gd.inject(Ik),Zt=gd}catch{}}return Qc.createRoot=function(r,o){if(!i(r))throw Error(s(299));var l=!1,u="",m=gS,v=yS,E=vS;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(u=o.identifierPrefix),o.onUncaughtError!==void 0&&(m=o.onUncaughtError),o.onCaughtError!==void 0&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(E=o.onRecoverableError)),o=Q_(r,1,!1,null,null,l,u,null,m,v,E,lw),r[xa]=o.current,vg(r),new zg(o)},Qc.hydrateRoot=function(r,o,l){if(!i(r))throw Error(s(299));var u=!1,m="",v=gS,E=yS,M=vS,$=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(m=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(E=l.onCaughtError),l.onRecoverableError!==void 0&&(M=l.onRecoverableError),l.formState!==void 0&&($=l.formState)),o=Q_(r,1,!0,o,l??null,u,m,$,v,E,M,lw),o.context=W_(null),l=o.current,u=sr(),u=Qn(u),m=yo(u),m.callback=null,vo(l,m,u),l=u,o.current.lanes=l,xs(o,l),us(o),r[xa]=o.current,vg(r),new md(o)},Qc.version="19.2.4",Qc}var XE;function d6(){if(XE)return sy.exports;XE=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(),sy.exports=f6(),sy.exports}var h6=d6(),Xl=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(){}},p6={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},m6=class{#e=p6;#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)}},qi=new m6;function g6(e){setTimeout(e,0)}var sa=typeof window>"u"||"Deno"in globalThis;function An(){}function y6(e,t){return typeof e=="function"?e(t):e}function hv(e){return typeof e=="number"&&e>=0&&e!==1/0}function vN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ko(e,t){return typeof e=="function"?e(t):e}function Mr(e,t){return typeof e=="function"?e(t):e}function QE(e,t){const{type:n="all",exact:s,fetchStatus:i,predicate:a,queryKey:c,stale:f}=e;if(c){if(s){if(t.queryHash!==Tb(c,t.options))return!1}else if(!Su(t.queryKey,c))return!1}if(n!=="all"){const d=t.isActive();if(n==="active"&&!d||n==="inactive"&&d)return!1}return!(typeof f=="boolean"&&t.isStale()!==f||i&&i!==t.state.fetchStatus||a&&!a(t))}function WE(e,t){const{exact:n,status:s,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(oa(t.options.mutationKey)!==oa(a))return!1}else if(!Su(t.options.mutationKey,a))return!1}return!(s&&t.state.status!==s||i&&!i(t))}function Tb(e,t){return(t?.queryKeyHashFn||oa)(e)}function oa(e){return JSON.stringify(e,(t,n)=>pv(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function Su(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Su(e[n],t[n])):!1}var v6=Object.prototype.hasOwnProperty;function bN(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=JE(e)&&JE(t);if(!s&&!(pv(e)&&pv(t)))return t;const a=(s?e:Object.keys(e)).length,c=s?t:Object.keys(t),f=c.length,d=s?new Array(f):{};let p=0;for(let g=0;g<f;g++){const y=s?g:c[g],b=e[y],x=t[y];if(b===x){d[y]=b,(s?g<a:v6.call(e,y))&&p++;continue}if(b===null||x===null||typeof b!="object"||typeof x!="object"){d[y]=x;continue}const S=bN(b,x,n+1);d[y]=S,S===b&&p++}return a===f&&p===a?e:d}function Eh(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 JE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function pv(e){if(!eT(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!eT(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function eT(e){return Object.prototype.toString.call(e)==="[object Object]"}function b6(e){return new Promise(t=>{qi.setTimeout(t,e)})}function mv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?bN(e,t):t}function x6(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function S6(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var Cb=Symbol();function xN(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Cb?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Rb(e,t){return typeof e=="function"?e(...t):!!e}function _6(e,t,n){let s=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var w6=class extends Xl{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!sa&&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"}},Nb=new w6;function gv(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function s(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{s({status:"fulfilled",value:i}),e(i)},n.reject=i=>{s({status:"rejected",reason:i}),t(i)},n}var E6=g6;function T6(){let e=[],t=0,n=f=>{f()},s=f=>{f()},i=E6;const a=f=>{t?e.push(f):i(()=>{n(f)})},c=()=>{const f=e;e=[],f.length&&i(()=>{s(()=>{f.forEach(d=>{n(d)})})})};return{batch:f=>{let d;t++;try{d=f()}finally{t--,t||c()}return d},batchCalls:f=>(...d)=>{a(()=>{f(...d)})},schedule:a,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{s=f},setScheduler:f=>{i=f}}}var fn=T6(),C6=class extends Xl{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!sa&&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}},Th=new C6;function R6(e){return Math.min(1e3*2**e,3e4)}function SN(e){return(e??"online")==="online"?Th.isOnline():!0}var yv=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function _N(e){let t=!1,n=0,s;const i=gv(),a=()=>i.status!=="pending",c=w=>{if(!a()){const T=new yv(w);b(T),e.onCancel?.(T)}},f=()=>{t=!0},d=()=>{t=!1},p=()=>Nb.isFocused()&&(e.networkMode==="always"||Th.isOnline())&&e.canRun(),g=()=>SN(e.networkMode)&&e.canRun(),y=w=>{a()||(s?.(),i.resolve(w))},b=w=>{a()||(s?.(),i.reject(w))},x=()=>new Promise(w=>{s=T=>{(a()||p())&&w(T)},e.onPause?.()}).then(()=>{s=void 0,a()||e.onContinue?.()}),S=()=>{if(a())return;let w;const T=n===0?e.initialPromise:void 0;try{w=T??e.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(y).catch(C=>{if(a())return;const A=e.retry??(sa?0:3),N=e.retryDelay??R6,R=typeof N=="function"?N(n,C):N,k=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,C);if(t||!k){b(C);return}n++,e.onFail?.(n,C),b6(R).then(()=>p()?void 0:x()).then(()=>{t?b(C):S()})})};return{promise:i,status:()=>i.status,cancel:c,continue:()=>(s?.(),i),cancelRetry:f,continueRetry:d,canStart:g,start:()=>(g()?S():x().then(S),i)}}var wN=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),hv(this.gcTime)&&(this.#e=qi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(sa?1/0:300*1e3))}clearGcTimeout(){this.#e&&(qi.clearTimeout(this.#e),this.#e=void 0)}},N6=class extends wN{#e;#t;#n;#s;#r;#i;#a;constructor(e){super(),this.#a=!1,this.#i=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=nT(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.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=nT(this.options);t.data!==void 0&&(this.setState(tT(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=mv(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(An).catch(An):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>Mr(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Cb||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Ko(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:!vN(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.#o({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(d=>d.options.queryFn);f&&this.setOptions(f.options)}const n=new AbortController,s=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},i=()=>{const f=xN(this.options,t),p=(()=>{const g={client:this.#s,queryKey:this.queryKey,meta:this.meta};return s(g),g})();return this.#a=!1,this.options.persister?this.options.persister(f,p,this):f(p)},c=(()=>{const f={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:i};return s(f),f})();this.options.behavior?.onFetch(c,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==c.fetchOptions?.meta)&&this.#o({type:"fetch",meta:c.fetchOptions?.meta}),this.#r=_N({initialPromise:t?.initialPromise,fn:c.fetchFn,onCancel:f=>{f instanceof yv&&f.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(f,d)=>{this.#o({type:"failed",failureCount:f,error:d})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.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 yv){if(f.silent)return this.#r.promise;if(f.revert){if(this.state.data===void 0)throw f;return this.state.data}}throw this.#o({type:"error",error:f}),this.#n.config.onError?.(f,this),this.#n.config.onSettled?.(this.state.data,f,this),f}finally{this.scheduleGc()}}#o(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,...EN(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...tT(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),fn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function EN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:SN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function tT(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function nT(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var j6=class extends Xl{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#a=gv(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#i;#a;#o;#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),rT(this.#t,this.options)?this.#f():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return vv(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return vv(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 Mr(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#t.setOptions(this.options),t._defaulted&&!Eh(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&sT(this.#t,n,this.options,t)&&this.#f(),this.updateResult(),s&&(this.#t!==n||Mr(this.options.enabled,this.#t)!==Mr(t.enabled,this.#t)||Ko(this.options.staleTime,this.#t)!==Ko(t.staleTime,this.#t))&&this.#g();const i=this.#y();s&&(this.#t!==n||Mr(this.options.enabled,this.#t)!==Mr(t.enabled,this.#t)||i!==this.#l)&&this.#v(i)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return O6(this,n)&&(this.#s=n,this.#i=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),t?.(s),s==="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,s))})}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.#_();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(An)),t}#g(){this.#x();const e=Ko(this.options.staleTime,this.#t);if(sa||this.#s.isStale||!hv(e))return;const n=vN(this.#s.dataUpdatedAt,e)+1;this.#c=qi.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,!(sa||Mr(this.options.enabled,this.#t)===!1||!hv(this.#l)||this.#l===0)&&(this.#u=qi.setInterval(()=>{(this.options.refetchIntervalInBackground||Nb.isFocused())&&this.#f()},this.#l))}#b(){this.#g(),this.#v(this.#y())}#x(){this.#c&&(qi.clearTimeout(this.#c),this.#c=void 0)}#S(){this.#u&&(qi.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,s=this.options,i=this.#s,a=this.#r,c=this.#i,d=e!==n?e.state:this.#n,{state:p}=e;let g={...p},y=!1,b;if(t._optimisticResults){const O=this.hasListeners(),D=!O&&rT(e,t),K=O&&sT(e,n,t,s);(D||K)&&(g={...g,...EN(p.data,e.options)}),t._optimisticResults==="isRestoring"&&(g.fetchStatus="idle")}let{error:x,errorUpdatedAt:S,status:w}=g;b=g.data;let T=!1;if(t.placeholderData!==void 0&&b===void 0&&w==="pending"){let O;i?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(O=i.data,T=!0):O=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,O!==void 0&&(w="success",b=mv(i?.data,O,t),y=!0)}if(t.select&&b!==void 0&&!T)if(i&&b===a?.data&&t.select===this.#m)b=this.#d;else try{this.#m=t.select,b=t.select(b),b=mv(i?.data,b,t),this.#d=b,this.#o=null}catch(O){this.#o=O}this.#o&&(x=this.#o,b=this.#d,S=Date.now(),w="error");const C=g.fetchStatus==="fetching",A=w==="pending",N=w==="error",R=A&&C,k=b!==void 0,j={status:w,fetchStatus:g.fetchStatus,isPending:A,isSuccess:w==="success",isError:N,isInitialLoading:R,isLoading:R,data:b,dataUpdatedAt:g.dataUpdatedAt,error:x,errorUpdatedAt:S,failureCount:g.fetchFailureCount,failureReason:g.fetchFailureReason,errorUpdateCount:g.errorUpdateCount,isFetched:g.dataUpdateCount>0||g.errorUpdateCount>0,isFetchedAfterMount:g.dataUpdateCount>d.dataUpdateCount||g.errorUpdateCount>d.errorUpdateCount,isFetching:C,isRefetching:C&&!A,isLoadingError:N&&!k,isPaused:g.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:N&&k,isStale:jb(e,t),refetch:this.refetch,promise:this.#a,isEnabled:Mr(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const O=j.data!==void 0,D=j.status==="error"&&!O,K=X=>{D?X.reject(j.error):O&&X.resolve(j.data)},F=()=>{const X=this.#a=j.promise=gv();K(X)},z=this.#a;switch(z.status){case"pending":e.queryHash===n.queryHash&&K(z);break;case"fulfilled":(D||j.data!==z.value)&&F();break;case"rejected":(!D||j.error!==z.reason)&&F();break}}return j}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#i=this.options,this.#r.data!==void 0&&(this.#h=this.#t),Eh(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!this.#p.size)return!0;const a=new Set(i??this.#p);return this.options.throwOnError&&a.add("error"),Object.keys(this.#s).some(c=>{const f=c;return this.#s[f]!==e[f]&&a.has(f)})};this.#w({listeners:n()})}#_(){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()}#w(e){fn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function A6(e,t){return Mr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function rT(e,t){return A6(e,t)||e.state.data!==void 0&&vv(e,t,t.refetchOnMount)}function vv(e,t,n){if(Mr(t.enabled,e)!==!1&&Ko(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&jb(e,t)}return!1}function sT(e,t,n,s){return(e!==t||Mr(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&jb(e,n)}function jb(e,t){return Mr(t.enabled,e)!==!1&&e.isStaleByTime(Ko(t.staleTime,e))}function O6(e,t){return!Eh(e.getCurrentResult(),t)}function oT(e){return{onFetch:(t,n)=>{const s=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],c=t.state.data?.pageParams||[];let f={pages:[],pageParams:[]},d=0;const p=async()=>{let g=!1;const y=S=>{_6(S,()=>t.signal,()=>g=!0)},b=xN(t.options,t.fetchOptions),x=async(S,w,T)=>{if(g)return Promise.reject();if(w==null&&S.pages.length)return Promise.resolve(S);const A=(()=>{const L={client:t.client,queryKey:t.queryKey,pageParam:w,direction:T?"backward":"forward",meta:t.options.meta};return y(L),L})(),N=await b(A),{maxPages:R}=t.options,k=T?S6:x6;return{pages:k(S.pages,N,R),pageParams:k(S.pageParams,w,R)}};if(i&&a.length){const S=i==="backward",w=S?M6:iT,T={pages:a,pageParams:c},C=w(s,T);f=await x(T,C,S)}else{const S=e??a.length;do{const w=d===0?c[0]??s.initialPageParam:iT(s,f);if(d>0&&w==null)break;f=await x(f,w),d++}while(d<S)}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 iT(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function M6(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var k6=class extends wN{#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||TN(),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=_N({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,c)=>{this.#r({type:"failed",failureCount:a,error:c})},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 s=this.state.status==="pending",i=!this.#s.canStart();try{if(s)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const c=await this.options.onMutate?.(e,n);c!==this.state.context&&this.#r({type:"pending",context:c,variables:e,isPaused:i})}const a=await this.#s.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#n.config.onError?.(a,e,this.state.context,this,n)}catch(c){Promise.reject(c)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(c){Promise.reject(c)}try{await this.#n.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(c){Promise.reject(c)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(c){Promise.reject(c)}throw this.#r({type:"error",error:a}),a}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),fn.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function TN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var I6=class extends Xl{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 s=new k6({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(s),s}add(e){this.#e.add(e);const t=Cd(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=Cd(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Cd(e);if(typeof t=="string"){const s=this.#t.get(t)?.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=Cd(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){fn.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=>WE(t,n))}findAll(e={}){return this.getAll().filter(t=>WE(e,t))}notify(e){fn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return fn.batch(()=>Promise.all(e.map(t=>t.continue().catch(An))))}};function Cd(e){return e.options.scope?.id}var D6=class extends Xl{#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),Eh(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&oa(n.mutationKey)!==oa(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.#i(t)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#r(),this.#i()}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??TN();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}}#i(t){fn.batch(()=>{if(this.#s&&this.hasListeners()){const n=this.#t.variables,s=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#s.onSuccess?.(t.data,n,s,i)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(t.data,null,n,s,i)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#s.onError?.(t.error,n,s,i)}catch(a){Promise.reject(a)}try{this.#s.onSettled?.(void 0,t.error,n,s,i)}catch(a){Promise.reject(a)}}}this.listeners.forEach(n=>{n(this.#t)})})}},P6=class extends Xl{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,i=t.queryHash??Tb(s,t);let a=this.get(i);return a||(a=new N6({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){fn.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=>QE(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>QE(e,n)):t}notify(e){fn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){fn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){fn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},z6=class{#e;#t;#n;#s;#r;#i;#a;#o;constructor(e={}){this.#e=e.queryCache||new P6,this.#t=e.mutationCache||new I6,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=Nb.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=Th.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=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),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ko(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),a=this.#e.get(s.queryHash)?.state.data,c=y6(t,a);if(c!==void 0)return this.#e.build(this,s).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return fn.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;fn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return fn.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=fn.batch(()=>this.#e.findAll(e).map(i=>i.cancel(n)));return Promise.all(s).then(An).catch(An)}invalidateQueries(e,t={}){return fn.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},s=fn.batch(()=>this.#e.findAll(e).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let a=i.fetch(void 0,n);return n.throwOnError||(a=a.catch(An)),i.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(s).then(An)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Ko(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(An).catch(An)}fetchInfiniteQuery(e){return e.behavior=oT(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(An).catch(An)}ensureInfiniteQueryData(e){return e.behavior=oT(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Th.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(oa(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(s=>{Su(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(oa(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(s=>{Su(e,s.mutationKey)&&Object.assign(n,s.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=Tb(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===Cb&&(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()}},CN=_.createContext(void 0),Ab=e=>{const t=_.useContext(CN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},L6=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),h.jsx(CN.Provider,{value:e,children:t})),RN=_.createContext(!1),U6=()=>_.useContext(RN);RN.Provider;function $6(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var B6=_.createContext($6()),F6=()=>_.useContext(B6),H6=(e,t,n)=>{const s=n?.state.error&&typeof e.throwOnError=="function"?Rb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))},q6=e=>{_.useEffect(()=>{e.clearReset()},[e])},V6=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(i&&e.data===void 0||Rb(n,[e.error,s])),K6=e=>{if(e.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...i)=>n(s(...i)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},G6=(e,t)=>e.isLoading&&e.isFetching&&!t,Z6=(e,t)=>e?.suspense&&t.isPending,aT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Y6(e,t,n){const s=U6(),i=F6(),a=Ab(),c=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(c);const f=a.getQueryCache().get(c.queryHash);c._optimisticResults=s?"isRestoring":"optimistic",K6(c),H6(c,i,f),q6(i);const d=!a.getQueryCache().get(c.queryHash),[p]=_.useState(()=>new t(a,c)),g=p.getOptimisticResult(c),y=!s&&e.subscribed!==!1;if(_.useSyncExternalStore(_.useCallback(b=>{const x=y?p.subscribe(fn.batchCalls(b)):An;return p.updateResult(),x},[p,y]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),_.useEffect(()=>{p.setOptions(c)},[c,p]),Z6(c,g))throw aT(c,p,i);if(V6({result:g,errorResetBoundary:i,throwOnError:c.throwOnError,query:f,suspense:c.suspense}))throw g.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(c,g),c.experimental_prefetchInRender&&!sa&&G6(g,s)&&(d?aT(c,p,i):f?.promise)?.catch(An).finally(()=>{p.updateResult()}),c.notifyOnChangeProps?g:p.trackResult(g)}function NN(e,t){return Y6(e,j6)}function X6(e,t){const n=Ab(),[s]=_.useState(()=>new D6(n,e));_.useEffect(()=>{s.setOptions(e)},[s,e]);const i=_.useSyncExternalStore(_.useCallback(c=>s.subscribe(fn.batchCalls(c)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),a=_.useCallback((c,f)=>{s.mutate(c,f).catch(An)},[s]);if(i.error&&Rb(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Lt=(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))(Lt||{});function jN({update:e,notify:t,unwatched:n}){return{link:s,unlink:i,propagate:a,checkDirty:c,shallowPropagate:f};function s(p,g,y){const b=g.depsTail;if(b!==void 0&&b.dep===p)return;const x=b!==void 0?b.nextDep:g.deps;if(x!==void 0&&x.dep===p){x.version=y,g.depsTail=x;return}const S=p.subsTail;if(S!==void 0&&S.version===y&&S.sub===g)return;const w=g.depsTail=p.subsTail={version:y,dep:p,sub:g,prevDep:b,nextDep:x,prevSub:S,nextSub:void 0};x!==void 0&&(x.prevDep=w),b!==void 0?b.nextDep=w:g.deps=w,S!==void 0?S.nextSub=w:p.subs=w}function i(p,g=p.sub){const y=p.dep,b=p.prevDep,x=p.nextDep,S=p.nextSub,w=p.prevSub;return x!==void 0?x.prevDep=b:g.depsTail=b,b!==void 0?b.nextDep=x:g.deps=x,S!==void 0?S.prevSub=w:y.subsTail=w,w!==void 0?w.nextSub=S:(y.subs=S)===void 0&&n(y),x}function a(p){let g=p.nextSub,y;e:do{const b=p.sub;let x=b.flags;if(x&60?x&12?x&4?!(x&48)&&d(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 S=b.subs;if(S!==void 0){const w=(p=S).nextSub;w!==void 0&&(y={value:g,prev:y},g=w);continue}}if((p=g)!==void 0){g=p.nextSub;continue}for(;y!==void 0;)if(p=y.value,y=y.prev,p!==void 0){g=p.nextSub;continue e}break}while(!0)}function c(p,g){let y,b=0,x=!1;e:do{const S=p.dep,w=S.flags;if(g.flags&16)x=!0;else if((w&17)===17){if(e(S)){const T=S.subs;T.nextSub!==void 0&&f(T),x=!0}}else if((w&33)===33){(p.nextSub!==void 0||p.prevSub!==void 0)&&(y={value:p,prev:y}),p=S.deps,g=S,++b;continue}if(!x){const T=p.nextDep;if(T!==void 0){p=T;continue}}for(;b--;){const T=g.subs,C=T.nextSub!==void 0;if(C?(p=y.value,y=y.prev):p=T,x){if(e(g)){C&&f(T),g=p.sub;continue}x=!1}else g.flags&=-33;g=p.sub;const A=p.nextDep;if(A!==void 0){p=A;continue e}}return x}while(!0)}function f(p){do{const g=p.sub,y=g.flags;(y&48)===32&&(g.flags=y|16,(y&6)===2&&t(g))}while((p=p.nextSub)!==void 0)}function d(p,g){let y=g.depsTail;for(;y!==void 0;){if(y===p)return!0;y=y.prevDep}return!1}}let Ob=0,Ui=0,lu=0;const Hs=[],{link:AQ,unlink:AN,propagate:OQ,checkDirty:Q6,shallowPropagate:MQ}=jN({update(e){return e.depsTail!==void 0?tF(e):nF(e)},notify(e){let t=lu,n=t;do if(Hs[t++]=e,e.flags&=-3,e=e.subs?.sub,e===void 0||!(e.flags&2))break;while(!0);for(lu=t;n<--t;){const s=Hs[n];Hs[n++]=Hs[t],Hs[t]=s}},unwatched(e){e.flags&1?e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,ip(e)):oF.call(e)}});function W6(){return Ob}function J6(){++Ob}function eF(){--Ob||sF()}function tF(e){e.depsTail=void 0,e.flags=5;try{const t=e.value;return t!==(e.value=e.getter(t))}finally{e.flags&=-5,ip(e)}}function nF(e){return e.flags=1,e.currentValue!==(e.currentValue=e.pendingValue)}function rF(e){const t=e.flags;if(t&16||t&32&&Q6(e.deps,e)){e.depsTail=void 0,e.flags=6;try{e.fn()}finally{e.flags&=-5,ip(e)}}else e.flags=2}function sF(){try{for(;Ui<lu;){const e=Hs[Ui];Hs[Ui++]=void 0,rF(e)}}finally{for(;Ui<lu;){const e=Hs[Ui];Hs[Ui++]=void 0,e.flags|=10}Ui=0,lu=0}}function oF(){this.depsTail=void 0,this.flags=0,ip(this);const e=this.subs;e!==void 0&&AN(e)}function ip(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=AN(n,e)}function Mb(e,t,n){const s=typeof e=="object",i=s?e:void 0;return{next:(s?e.next:e)?.bind(i),error:(s?e.error:t)?.bind(i),complete:(s?e.complete:n)?.bind(i)}}const bv=[];let eh=0;const{link:lT,unlink:iF,propagate:aF,checkDirty:ON,shallowPropagate:cT}=jN({update(e){return e._update()},notify(e){bv[xv++]=e,e.flags&=~Lt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Lt.Mutable|Lt.Dirty,Ch(e))}});let Rd=0,xv=0,hs;function Ch(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=iF(n,e)}function MN(){if(!(W6()>0)){for(;Rd<xv;){const e=bv[Rd];bv[Rd++]=void 0,e.notify()}Rd=0,xv=0}}function kN(e,t){const n=typeof e=="function",s=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?Lt.None:Lt.Mutable,get(){return hs!==void 0&&lT(i,hs,eh),i._snapshot},subscribe(a){const c=Mb(a),f={current:!1},d=lF(()=>{i.get(),f.current?c.next?.(i._snapshot):f.current=!0});return{unsubscribe:()=>{d.stop()}}},_update(a){const c=hs,f=Object.is;hs=i,++eh,i.depsTail=void 0,n&&(i.flags=Lt.Mutable|Lt.RecursedCheck);try{const d=i._snapshot,p=typeof a=="function"?a(d):a===void 0&&n?s(d):a;return d===void 0||!f(d,p)?(i._snapshot=p,!0):!1}finally{hs=c,n&&(i.flags&=~Lt.RecursedCheck),Ch(i)}}};return n?(i.flags=Lt.Mutable|Lt.Dirty,i.get=function(){const a=i.flags;if(a&Lt.Dirty||a&Lt.Pending&&ON(i.deps,i)){if(i._update()){const c=i.subs;c!==void 0&&cT(c)}}else a&Lt.Pending&&(i.flags=a&~Lt.Pending);return hs!==void 0&&lT(i,hs,eh),i._snapshot}):i.set=function(a){if(i._update(a)){const c=i.subs;c!==void 0&&(aF(c),cT(c),MN())}},i}function lF(e){const t=()=>{const s=hs;hs=n,++eh,n.depsTail=void 0,n.flags=Lt.Watching|Lt.RecursedCheck;try{return e()}finally{hs=s,n.flags&=~Lt.RecursedCheck,Ch(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Lt.Watching|Lt.RecursedCheck,notify(){const s=this.flags;s&Lt.Dirty||s&Lt.Pending&&ON(this.deps,this)?t():this.flags=Lt.Watching},stop(){this.flags=Lt.None,this.depsTail=void 0,Ch(this)}};return t(),n}let cF=class{constructor(t){this.atom=kN(t)}setState(t){this.atom.set(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Mb(t))}};class uF{constructor(t){this.atom=kN(t)}get state(){return this.atom.get()}get(){return this.state}subscribe(t){return this.atom.subscribe(Mb(t))}}function fF(e){return typeof e=="function"?new uF(e):new cF(e)}function dF(e){try{J6(),e()}finally{eF(),MN()}}const Go="__TSR_index",uT="popstate",fT="beforeunload";function hF(e){let t=e.getLocation();const n=new Set,s=c=>{t=e.getLocation(),n.forEach(f=>f({location:t,action:c}))},i=c=>{e.notifyOnIndexChange??!0?s(c):t=e.getLocation()},a=async({task:c,navigateOpts:f,...d})=>{if(f?.ignoreBlocker??!1){c();return}const g=e.getBlockers?.()??[],y=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&g.length&&y)for(const b of g){const x=Rh(d.path,d.state);if(await b.blockerFn({currentLocation:t,nextLocation:x,action:d.type})){e.onBlocked?.();return}}c()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:c=>(n.add(c),()=>{n.delete(c)}),push:(c,f,d)=>{const p=t.state[Go];f=dT(p+1,f),a({task:()=>{e.pushState(c,f),s({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:c,state:f})},replace:(c,f,d)=>{const p=t.state[Go];f=dT(p,f),a({task:()=>{e.replaceState(c,f),s({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:c,state:f})},go:(c,f)=>{a({task:()=>{e.go(c),i({type:"GO",index:c})},navigateOpts:f,type:"GO"})},back:c=>{a({task:()=>{e.back(c?.ignoreBlocker??!1),i({type:"BACK"})},navigateOpts:c,type:"BACK"})},forward:c=>{a({task:()=>{e.forward(c?.ignoreBlocker??!1),i({type:"FORWARD"})},navigateOpts:c,type:"FORWARD"})},canGoBack:()=>t.state[Go]!==0,createHref:c=>e.createHref(c),block:c=>{if(!e.setBlockers)return()=>{};const f=e.getBlockers?.()??[];return e.setBlockers([...f,c]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(p=>p!==c))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:s}}function dT(e,t){t||(t={});const n=kb();return{...t,key:n,__TSR_key:n,[Go]:e}}function pF(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,s=t.history.replaceState;let i=[];const a=()=>i,c=O=>i=O,f=(O=>O),d=(()=>Rh(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const O=kb();t.history.replaceState({[Go]:0,key:O,__TSR_key:O},"")}let p=d(),g,y=!1,b=!1,x=!1,S=!1;const w=()=>p;let T,C;const A=()=>{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,g=void 0)},N=(O,D,K)=>{const F=f(D);C||(g=p),p=Rh(D,K),T={href:F,state:K,isPush:T?.isPush||O==="push"},C||(C=Promise.resolve().then(()=>A()))},R=O=>{p=d(),j.notify({type:O})},k=async()=>{if(b){b=!1;return}const O=d(),D=O.state[Go]-p.state[Go],K=D===1,F=D===-1,z=!K&&!F||y;y=!1;const X=z?"GO":F?"BACK":"FORWARD",Y=z?{type:"GO",index:D}:{type:F?"BACK":"FORWARD"};if(x)x=!1;else{const te=a();if(typeof document<"u"&&te.length){for(const P of te)if(await P.blockerFn({currentLocation:p,nextLocation:O,action:X})){b=!0,t.history.go(1),j.notify(Y);return}}}p=d(),j.notify(Y)},L=O=>{if(S){S=!1;return}let D=!1;const K=a();if(typeof document<"u"&&K.length)for(const F of K){const z=F.enableBeforeUnload??!0;if(z===!0){D=!0;break}if(typeof z=="function"&&z()===!0){D=!0;break}}if(D)return O.preventDefault(),O.returnValue=""},j=hF({getLocation:w,getLength:()=>t.history.length,pushState:(O,D)=>N("push",O,D),replaceState:(O,D)=>N("replace",O,D),back:O=>(O&&(x=!0),S=!0,t.history.back()),forward:O=>{O&&(x=!0),S=!0,t.history.forward()},go:O=>{y=!0,t.history.go(O)},createHref:O=>f(O),flush:A,destroy:()=>{t.history.pushState=n,t.history.replaceState=s,t.removeEventListener(fT,L,{capture:!0}),t.removeEventListener(uT,k)},onBlocked:()=>{g&&p!==g&&(p=g)},getBlockers:a,setBlockers:c,notifyOnIndexChange:!1});return t.addEventListener(fT,L,{capture:!0}),t.addEventListener(uT,k),t.history.pushState=function(...O){const D=n.apply(t.history,O);return j._ignoreSubscribers||R("PUSH"),D},t.history.replaceState=function(...O){const D=s.apply(t.history,O);return j._ignoreSubscribers||R("REPLACE"),D},j}function mF(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Rh(e,t){const n=mF(e),s=n.indexOf("#"),i=n.indexOf("?"),a=kb();return{href:n,pathname:n.substring(0,s>0?i>0?Math.min(s,i):s:i>0?i:n.length),hash:s>-1?n.substring(s):"",search:i>-1?n.slice(i,s===-1?void 0:s):"",state:t||{[Go]:0,key:a,__TSR_key:a}}}function kb(){return(Math.random()+1).toString(36).substring(7)}const gF=!1;function cu(e){let t;return dF(()=>{t=e()}),t}function _u(e){return e[e.length-1]}function yF(e){return typeof e=="function"}function Uo(e,t){return yF(e)?e(t):e}const vF=Object.prototype.hasOwnProperty,hT=Object.prototype.propertyIsEnumerable;function or(e,t,n=0){if(e===t)return e;if(n>500)return t;const s=t,i=gT(e)&&gT(s);if(!i&&!(Nh(e)&&Nh(s)))return s;const a=i?e:pT(e);if(!a)return s;const c=i?s:pT(s);if(!c)return s;const f=a.length,d=c.length,p=i?new Array(d):{};let g=0;for(let y=0;y<d;y++){const b=i?y:c[y],x=e[b],S=s[b];if(x===S){p[b]=x,(i?y<f:vF.call(e,b))&&g++;continue}if(x===null||S===null||typeof x!="object"||typeof S!="object"){p[b]=S;continue}const w=or(x,S,n+1);p[b]=w,w===x&&g++}return f===d&&g===f?e:p}function pT(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!hT.call(e,i))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const s=t;for(const i of n){if(!hT.call(e,i))return!1;s.push(i)}return s}function Nh(e){if(!mT(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!mT(n)||!n.hasOwnProperty("isPrototypeOf"))}function mT(e){return Object.prototype.toString.call(e)==="[object Object]"}function gT(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ji(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 s=0,i=e.length;s<i;s++)if(!Ji(e[s],t[s],n))return!1;return!0}if(Nh(e)&&Nh(t)){const s=n?.ignoreUndefined??!0;if(n?.partial){for(const c in t)if((!s||t[c]!==void 0)&&!Ji(e[c],t[c],n))return!1;return!0}let i=0;if(!s)i=Object.keys(e).length;else for(const c in e)e[c]!==void 0&&i++;let a=0;for(const c in t)if((!s||t[c]!==void 0)&&(a++,a>i||!Ji(e[c],t[c],n)))return!1;return i===a}return!1}function Il(e){let t,n;const s=new Promise((i,a)=>{t=i,n=a});return s.status="pending",s.resolve=i=>{s.status="resolved",s.value=i,t(i),e?.(i)},s.reject=i=>{s.status="rejected",n(i)},s}function ml(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function bF(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function yT(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 bF(t)}const xF=["http:","https:","mailto:","tel:"];function jh(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function Wc(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,s="",i;for(;(i=t.exec(e))!==null;)s+=yT(e.slice(n,i.index))+i[0],n=t.lastIndex;s=s+yT(n?e.slice(n):e);let a=!1;return s.startsWith("//")&&(a=!0,s="/"+s.replace(/^\/+/,"")),{path:s,handledProtocolRelativeURL:a}}function SF(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}var _F="Invariant failed";function eo(e,t){if(!e)throw new Error(_F)}function Ah(e){const t=new Map;let n,s;const i=a=>{a.next&&(a.prev?(a.prev.next=a.next,a.next.prev=a.prev,a.next=void 0,s&&(s.next=a,a.prev=s)):(a.next.prev=void 0,n=a.next,a.next=void 0,s&&(a.prev=s,s.next=a)),s=a)};return{get(a){const c=t.get(a);if(c)return i(c),c.value},set(a,c){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===s&&(s=void 0)}const f=t.get(a);if(f)f.value=c,i(f);else{const d={key:a,value:c,prev:s};s&&(s.next=d),s=d,n||(n=d),t.set(a,d)}},clear(){t.clear(),n=void 0,s=void 0}}}const Dl=0,ia=1,aa=2,wu=3,Vi=4,IN=5;function wF(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 Ib(e,t,n=new Uint16Array(6)){const s=e.indexOf("/",t),i=s===-1?e.length:s,a=e.substring(t,i);if(!a||!a.includes("$"))return n[0]=Dl,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a==="$"){const f=e.length;return n[0]=aa,n[1]=t,n[2]=t,n[3]=f,n[4]=f,n[5]=f,n}if(a.charCodeAt(0)===36)return n[0]=ia,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const c=wF(a);if(c){const[f,d]=c,p=a.charCodeAt(f+1);if(p===45){if(f+2<a.length&&a.charCodeAt(f+2)===36){const g=f+3,y=d;if(g<y)return n[0]=wu,n[1]=t+f,n[2]=t+g,n[3]=t+y,n[4]=t+d+1,n[5]=i,n}}else if(p===36){const g=f+1,y=f+2;return y===d?(n[0]=aa,n[1]=t+f,n[2]=t+g,n[3]=t+y,n[4]=t+d+1,n[5]=e.length,n):(n[0]=ia,n[1]=t+f,n[2]=t+y,n[3]=t+d,n[4]=t+d+1,n[5]=i,n)}}return n[0]=Dl,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function ap(e,t,n,s,i,a,c){c?.(n);let f=s;{const d=n.fullPath??n.from,p=d.length,g=n.options?.caseSensitive??e,y=!!(n.options?.params?.parse&&n.options?.skipRouteOnParseError?.params);for(;f<p;){const x=Ib(d,f,t);let S;const w=f,T=x[5];switch(f=T+1,a++,x[0]){case Dl:{const A=d.substring(x[2],x[3]);if(g){const N=i.static?.get(A);if(N)S=N;else{i.static??=new Map;const R=Ki(n.fullPath??n.from);R.parent=i,R.depth=a,S=R,i.static.set(A,R)}}else{const N=A.toLowerCase(),R=i.staticInsensitive?.get(N);if(R)S=R;else{i.staticInsensitive??=new Map;const k=Ki(n.fullPath??n.from);k.parent=i,k.depth=a,S=k,i.staticInsensitive.set(N,k)}}break}case ia:{const A=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(A||N),k=A?R?A:A.toLowerCase():void 0,L=N?R?N:N.toLowerCase():void 0,j=!y&&i.dynamic?.find(O=>!O.skipOnParamError&&O.caseSensitive===R&&O.prefix===k&&O.suffix===L);if(j)S=j;else{const O=cy(ia,n.fullPath??n.from,R,k,L);S=O,O.depth=a,O.parent=i,i.dynamic??=[],i.dynamic.push(O)}break}case wu:{const A=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(A||N),k=A?R?A:A.toLowerCase():void 0,L=N?R?N:N.toLowerCase():void 0,j=!y&&i.optional?.find(O=>!O.skipOnParamError&&O.caseSensitive===R&&O.prefix===k&&O.suffix===L);if(j)S=j;else{const O=cy(wu,n.fullPath??n.from,R,k,L);S=O,O.parent=i,O.depth=a,i.optional??=[],i.optional.push(O)}break}case aa:{const A=d.substring(w,x[1]),N=d.substring(x[4],T),R=g&&!!(A||N),k=A?R?A:A.toLowerCase():void 0,L=N?R?N:N.toLowerCase():void 0,j=cy(aa,n.fullPath??n.from,R,k,L);S=j,j.parent=i,j.depth=a,i.wildcard??=[],i.wildcard.push(j)}}i=S}if(y&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const x=Ki(n.fullPath??n.from);x.kind=IN,x.parent=i,a++,x.depth=a,i.pathless??=[],i.pathless.push(x),i=x}const b=(n.path||!n.children)&&!n.isRoot;if(b&&d.endsWith("/")){const x=Ki(n.fullPath??n.from);x.kind=Vi,x.parent=i,a++,x.depth=a,i.index=x,i=x}i.parse=n.options?.params?.parse??null,i.skipOnParamError=y,i.parsingPriority=n.options?.skipRouteOnParseError?.priority??0,b&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const d of n.children)ap(e,t,d,f,i,a,c)}function ly(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 zo(e){if(e.pathless)for(const t of e.pathless)zo(t);if(e.static)for(const t of e.static.values())zo(t);if(e.staticInsensitive)for(const t of e.staticInsensitive.values())zo(t);if(e.dynamic?.length){e.dynamic.sort(ly);for(const t of e.dynamic)zo(t)}if(e.optional?.length){e.optional.sort(ly);for(const t of e.optional)zo(t)}if(e.wildcard?.length){e.wildcard.sort(ly);for(const t of e.wildcard)zo(t)}}function Ki(e){return{kind:Dl,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 cy(e,t,n,s,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,skipOnParamError:!1,parsingPriority:0,caseSensitive:n,prefix:s,suffix:i}}function EF(e,t){const n=Ki("/"),s=new Uint16Array(6);for(const i of e)ap(!1,s,i,1,n,0);zo(n),t.masksTree=n,t.flatCache=Ah(1e3)}function TF(e,t){e||="/";const n=t.flatCache.get(e);if(n)return n;const s=Db(e,t.masksTree);return t.flatCache.set(e,s),s}function CF(e,t,n,s,i){e||="/",s||="/";const a=t?`case\0${e}`:e;let c=i.singleCache.get(a);if(!c){c=Ki("/");const f=new Uint16Array(6);ap(t,f,{from:e},1,c,0),i.singleCache.set(a,c)}return Db(s,c,n)}function RF(e,t,n=!1){const s=n?e:`nofuzz\0${e}`,i=t.matchCache.get(s);if(i!==void 0)return i;e||="/";let a;try{a=Db(e,t.segmentTree,n)}catch(c){if(c instanceof URIError)a=null;else throw c}return a&&(a.branch=AF(a.route)),t.matchCache.set(s,a),a}function NF(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function jF(e,t=!1,n){const s=Ki(e.fullPath),i=new Uint16Array(6),a={},c={};let f=0;return ap(t,i,e,1,s,0,p=>{if(n?.(p,f),eo(!(p.id in a),`Duplicate routes found with id: ${String(p.id)}`),a[p.id]=p,f!==0&&p.path){const g=NF(p.fullPath);(!c[g]||p.fullPath.endsWith("/"))&&(c[g]=p)}f++}),zo(s),{processedTree:{segmentTree:s,singleCache:Ah(1e3),matchCache:Ah(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:c}}function Db(e,t,n=!1){const s=e.split("/"),i=MF(e,s,t,n);if(!i)return null;const[a]=DN(e,s,i);return{route:i.node.route,rawParams:a,parsedParams:i.parsedParams}}function DN(e,t,n){const s=OF(n.node);let i=null;const a={};let c=n.extract?.part??0,f=n.extract?.node??0,d=n.extract?.path??0,p=n.extract?.segment??0;for(;f<s.length;c++,f++,d++,p++){const g=s[f];if(g.kind===Vi)break;if(g.kind===IN){p--,c--,d--;continue}const y=t[c],b=d;if(y&&(d+=y.length),g.kind===ia){i??=n.node.fullPath.split("/");const x=i[p],S=g.prefix?.length??0;if(x.charCodeAt(S)===123){const T=g.suffix?.length??0,C=x.substring(S+2,x.length-T-1),A=y.substring(S,y.length-T);a[C]=decodeURIComponent(A)}else{const T=x.substring(1);a[T]=decodeURIComponent(y)}}else if(g.kind===wu){if(n.skipped&1<<f){c--,d=b-1;continue}i??=n.node.fullPath.split("/");const x=i[p],S=g.prefix?.length??0,w=g.suffix?.length??0,T=x.substring(S+3,x.length-w-1),C=g.suffix||g.prefix?y.substring(S,y.length-w):y;C&&(a[T]=decodeURIComponent(C))}else if(g.kind===aa){const x=g,S=e.substring(b+(x.prefix?.length??0),e.length-(x.suffix?.length??0)),w=decodeURIComponent(S);a["*"]=w,a._splat=w;break}}return n.rawParams&&Object.assign(a,n.rawParams),[a,{part:c,node:f,path:d,segment:p}]}function AF(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function OF(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function MF(e,t,n,s){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!_u(t),a=i&&e!=="/",c=t.length-(i?1:0),f=[{node:n,index:1,skipped:0,depth:1,statics:1,dynamics:0,optionals:0}];let d=null,p=null,g=null;for(;f.length;){const y=f.pop(),{node:b,index:x,skipped:S,depth:w,statics:T,dynamics:C,optionals:A}=y;let{extract:N,rawParams:R,parsedParams:k}=y;if(b.skipOnParamError){if(!uy(e,t,y))continue;R=y.rawParams,N=y.extract,k=y.parsedParams}s&&b.route&&b.kind!==Vi&&Jc(p,y)&&(p=y);const L=x===c;if(L&&(b.route&&!a&&Jc(g,y)&&(g=y),!b.optional&&!b.wildcard&&!b.index&&!b.pathless))continue;const j=L?void 0:t[x];let O;if(L&&b.index){const D={node:b.index,index:x,skipped:S,depth:w+1,statics:T,dynamics:C,optionals:A,extract:N,rawParams:R,parsedParams:k};let K=!0;if(b.index.skipOnParamError&&(uy(e,t,D)||(K=!1)),K){if(T===c&&!C&&!A&&!S)return D;Jc(g,D)&&(g=D)}}if(b.wildcard&&Jc(d,y))for(const D of b.wildcard){const{prefix:K,suffix:F}=D;if(K&&(L||!(D.caseSensitive?j:O??=j.toLowerCase()).startsWith(K)))continue;if(F){if(L)continue;const X=t.slice(x).join("/").slice(-F.length);if((D.caseSensitive?X:X.toLowerCase())!==F)continue}const z={node:D,index:c,skipped:S,depth:w,statics:T,dynamics:C,optionals:A,extract:N,rawParams:R,parsedParams:k};if(!(D.skipOnParamError&&!uy(e,t,z))){d=z;break}}if(b.optional){const D=S|1<<w,K=w+1;for(let F=b.optional.length-1;F>=0;F--){const z=b.optional[F];f.push({node:z,index:x,skipped:D,depth:K,statics:T,dynamics:C,optionals:A,extract:N,rawParams:R,parsedParams:k})}if(!L)for(let F=b.optional.length-1;F>=0;F--){const z=b.optional[F],{prefix:X,suffix:Y}=z;if(X||Y){const te=z.caseSensitive?j:O??=j.toLowerCase();if(X&&!te.startsWith(X)||Y&&!te.endsWith(Y))continue}f.push({node:z,index:x+1,skipped:S,depth:K,statics:T,dynamics:C,optionals:A+1,extract:N,rawParams:R,parsedParams:k})}}if(!L&&b.dynamic&&j)for(let D=b.dynamic.length-1;D>=0;D--){const K=b.dynamic[D],{prefix:F,suffix:z}=K;if(F||z){const X=K.caseSensitive?j:O??=j.toLowerCase();if(F&&!X.startsWith(F)||z&&!X.endsWith(z))continue}f.push({node:K,index:x+1,skipped:S,depth:w+1,statics:T,dynamics:C+1,optionals:A,extract:N,rawParams:R,parsedParams:k})}if(!L&&b.staticInsensitive){const D=b.staticInsensitive.get(O??=j.toLowerCase());D&&f.push({node:D,index:x+1,skipped:S,depth:w+1,statics:T+1,dynamics:C,optionals:A,extract:N,rawParams:R,parsedParams:k})}if(!L&&b.static){const D=b.static.get(j);D&&f.push({node:D,index:x+1,skipped:S,depth:w+1,statics:T+1,dynamics:C,optionals:A,extract:N,rawParams:R,parsedParams:k})}if(b.pathless){const D=w+1;for(let K=b.pathless.length-1;K>=0;K--){const F=b.pathless[K];f.push({node:F,index:x,skipped:S,depth:D,statics:T,dynamics:C,optionals:A,extract:N,rawParams:R,parsedParams:k})}}}if(g&&d)return Jc(d,g)?g:d;if(g)return g;if(d)return d;if(s&&p){let y=p.index;for(let x=0;x<p.index;x++)y+=t[x].length;const b=y===e.length?"/":e.slice(y);return p.rawParams??={},p.rawParams["**"]=decodeURIComponent(b),p}return null}function uy(e,t,n){try{const[s,i]=DN(e,t,n);n.rawParams=s,n.extract=i;const a=n.node.parse(s);return n.parsedParams=Object.assign({},n.parsedParams,a),!0}catch{return null}}function Jc(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===Vi)>(e.node.kind===Vi)||t.node.kind===Vi==(e.node.kind===Vi)&&t.depth>e.depth))):!0}function th(e){return Pb(e.filter(t=>t!==void 0).join("/"))}function Pb(e){return e.replace(/\/{2,}/g,"/")}function PN(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Zo(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function zN(e){return Zo(PN(e))}function Oh(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function kF(e,t,n){return Oh(e,n)===Oh(t,n)}function IF({base:e,to:t,trailingSlash:n="never",cache:s}){const i=t.startsWith("/"),a=!i&&t===".";let c;if(s){c=i?t:a?e:e+"\0"+t;const y=s.get(c);if(y)return y}let f;if(a)f=e.split("/");else if(i)f=t.split("/");else{for(f=e.split("/");f.length>1&&_u(f)==="";)f.pop();const y=t.split("/");for(let b=0,x=y.length;b<x;b++){const S=y[b];S===""?b?b===x-1&&f.push(S):f=[S]:S===".."?f.pop():S==="."||f.push(S)}}f.length>1&&(_u(f)===""?n==="never"&&f.pop():n==="always"&&f.push(""));let d,p="";for(let y=0;y<f.length;y++){y>0&&(p+="/");const b=f[y];if(!b)continue;d=Ib(b,0,d);const x=d[0];if(x===Dl){p+=b;continue}const S=d[5],w=b.substring(0,d[1]),T=b.substring(d[4],S),C=b.substring(d[2],d[3]);x===ia?p+=w||T?`${w}{$${C}}${T}`:`$${C}`:x===aa?p+=w||T?`${w}{$}${T}`:"$":p+=`${w}{-$${C}}${T}`}p=Pb(p);const g=p||"/";return c&&s&&s.set(c,g),g}function DF(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),s=new RegExp(n,"g");return i=>i.replace(s,a=>t.get(a)??a)}function fy(e,t,n){const s=t[e];return typeof s!="string"?s:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(s)?s:s.split("/").map(i=>bT(i,n)).join("/"):bT(s,n)}function vT({path:e,params:t,decoder:n,...s}){let i=!1;const a={};if(!e||e==="/")return{interpolatedPath:"/",usedParams:a,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:a,isMissingParams:i};const c=e.length;let f=0,d,p="";for(;f<c;){const y=f;d=Ib(e,y,d);const b=d[5];if(f=b+1,y===b)continue;const x=d[0];if(x===Dl){p+="/"+e.substring(y,b);continue}if(x===aa){const S=t._splat;a._splat=S,a["*"]=S;const w=e.substring(y,d[1]),T=e.substring(d[4],b);if(!S){i=!0,(w||T)&&(p+="/"+w+T);continue}const C=fy("_splat",t,n);p+="/"+w+C+T;continue}if(x===ia){const S=e.substring(d[2],d[3]);!i&&!(S in t)&&(i=!0),a[S]=t[S];const w=e.substring(y,d[1]),T=e.substring(d[4],b),C=fy(S,t,n)??"undefined";p+="/"+w+C+T;continue}if(x===wu){const S=e.substring(d[2],d[3]),w=t[S];if(w==null)continue;a[S]=w;const T=e.substring(y,d[1]),C=e.substring(d[4],b),A=fy(S,t,n)??"";p+="/"+T+A+C;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:a,interpolatedPath:p||"/",isMissingParams:i}}function bT(e,t){const n=encodeURIComponent(e);return t?.(n)??n}function dr(e){return!!e?.isNotFound}function PF(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Sv="tsr-scroll-restoration-v1_3",zF=(e,t)=>{let n;return(...s)=>{n||(n=setTimeout(()=>{e(...s),n=null},t))}};function LF(){const e=PF();if(!e)return null;const t=e.getItem(Sv);let n=t?JSON.parse(t):{};return{state:n,set:s=>{n=Uo(s,n)||n;try{e.setItem(Sv,JSON.stringify(n))}catch{console.warn("[ts-router] Could not persist scroll restoration state to sessionStorage.")}}}}const Nd=LF(),UF=e=>e.state.__TSR_key||e.href;function $F(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 Mh=!1;function BF({storageKey:e,key:t,behavior:n,shouldScrollRestoration:s,scrollToTopSelectors:i,location:a}){let c;try{c=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(p){console.error(p);return}const f=t||window.history.state?.__TSR_key,d=c[f];Mh=!0;e:{if(s&&d&&Object.keys(d).length>0){for(const y in d){const b=d[y];if(y==="window")window.scrollTo({top:b.scrollY,left:b.scrollX,behavior:n});else if(y){const x=document.querySelector(y);x&&(x.scrollLeft=b.scrollX,x.scrollTop=b.scrollY)}}break e}const p=(a??window.location).hash.split("#",2)[1];if(p){const y=window.history.state?.__hashScrollIntoViewOptions??!0;if(y){const b=document.getElementById(p);b&&b.scrollIntoView(y)}break e}const g={top:0,left:0,behavior:n};if(window.scrollTo(g),i)for(const y of i){if(y==="window")continue;const b=typeof y=="function"?y():document.querySelector(y);b&&b.scrollTo(g)}}Mh=!1}function FF(e,t){if(!Nd||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isScrollRestorationSetup||!Nd))return;e.isScrollRestorationSetup=!0,Mh=!1;const s=e.options.getScrollRestorationKey||UF;window.history.scrollRestoration="manual";const i=a=>{if(Mh||!e.isScrollRestoring)return;let c="";if(a.target===document||a.target===window)c="window";else{const d=a.target.getAttribute("data-scroll-restoration-id");d?c=`[data-scroll-restoration-id="${d}"]`:c=$F(a.target)}const f=s(e.state.location);Nd.set(d=>{const p=d[f]||={},g=p[c]||={};if(c==="window")g.scrollX=window.scrollX||0,g.scrollY=window.scrollY||0;else if(c){const y=document.querySelector(c);y&&(g.scrollX=y.scrollLeft||0,g.scrollY=y.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",zF(i,100),!0),e.subscribe("onRendered",a=>{const c=s(a.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(BF({storageKey:Sv,key:c,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&Nd.set(f=>(f[c]||={},f)))})}function HF(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 qF(e,t=String){const n=new URLSearchParams;for(const s in e){const i=e[s];i!==void 0&&n.set(s,t(i))}return n.toString()}function dy(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function VF(e){const t=new URLSearchParams(e),n={};for(const[s,i]of t.entries()){const a=n[s];a==null?n[s]=dy(i):Array.isArray(a)?a.push(dy(i)):n[s]=[a,dy(i)]}return n}const KF=ZF(JSON.parse),GF=YF(JSON.stringify,JSON.parse);function ZF(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=VF(t);for(const s in n){const i=n[s];if(typeof i=="string")try{n[s]=e(i)}catch{}}return n}}function YF(e,t){const n=typeof t=="function";function s(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const a=qF(i,s);return a?`?${a}`:""}}const kr="__root__";function XF(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 Pr(e){return e instanceof Response&&!!e.options}const nh=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},lp=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),gl=(e,t,n=!0)=>{const s={...e.router.options.context??{}},i=n?t:t-1;for(let a=0;a<=i;a++){const c=e.matches[a];if(!c)continue;const f=e.router.getMatch(c.id);f&&Object.assign(s,f.__routeContext,f.__beforeLoadContext)}return s},LN=(e,t,n)=>{const s=e.router.routesById[t.routeId??""]??e.router.routeTree;!s.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(s.options.notFoundComponent=e.router.options.defaultNotFoundComponent);const i=n==="BEFORE_LOAD"&&s.parentRoute;i||eo(s.options.notFoundComponent);const a=e.matches.find(c=>c.routeId===s.id);eo(a,"Could not find match for route: "+s.id),e.updateMatch(a.id,c=>({...c,status:"notFound",error:t,isFetching:!1})),i&&(t.routeId=s.parentRoute.id,LN(e,t,n))},$o=(e,t,n,s)=>{if(!(!Pr(n)&&!dr(n))){if(Pr(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 i=Pr(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,a=>({...a,status:i,context:gl(e,t.index),isFetching:!1,error:n})),dr(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Pr(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(LN(e,n,s),n)}},UN=(e,t)=>!!e.router.getMatch(t)._nonReactive.dehydrated,eu=(e,t,n,s)=>{const{id:i,routeId:a}=e.matches[t],c=e.router.looseRoutesById[a];if(n instanceof Promise)throw n;n.routerCode=s,e.firstBadMatchIndex??=t,$o(e,e.router.getMatch(i),n,s);try{c.options.onError?.(n)}catch(f){n=f,$o(e,e.router.getMatch(i),n,s)}e.updateMatch(i,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}))},$N=(e,t,n,s)=>{if(s._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!lp(e,t)&&(n.options.loader||n.options.beforeLoad||HN(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const c=setTimeout(()=>{nh(e)},i);s._nonReactive.pendingTimeout=c}},QF=(e,t,n)=>{const s=e.router.getMatch(t);if(!s._nonReactive.beforeLoadPromise&&!s._nonReactive.loaderPromise)return;$N(e,t,n,s);const i=()=>{const a=e.router.getMatch(t);a.preload&&(a.status==="redirected"||a.status==="notFound")&&$o(e,a,a.error)};return s._nonReactive.beforeLoadPromise?s._nonReactive.beforeLoadPromise.then(i):i()},WF=(e,t,n,s)=>{const i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=Il(()=>{a?.resolve()});const{paramsError:c,searchError:f}=i;c&&eu(e,n,c,"PARSE_PARAMS"),f&&eu(e,n,f,"VALIDATE_SEARCH"),$N(e,t,s,i);const d=new AbortController;let p=!1;const g=()=>{p||(p=!0,e.updateMatch(t,R=>({...R,isFetching:"beforeLoad",fetchCount:R.fetchCount+1,abortController:d})))},y=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,R=>({...R,isFetching:!1}))};if(!s.options.beforeLoad){cu(()=>{g(),y()});return}i._nonReactive.beforeLoadPromise=Il();const b={...gl(e,n,!1),...i.__routeContext},{search:x,params:S,cause:w}=i,T=lp(e,t),C={search:x,abortController:d,params:S,preload:T,context:b,location:e.location,navigate:R=>e.router.navigate({...R,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:T?"preload":w,matches:e.matches,routeId:s.id,...e.router.options.additionalContext},A=R=>{if(R===void 0){cu(()=>{g(),y()});return}(Pr(R)||dr(R))&&(g(),eu(e,n,R,"BEFORE_LOAD")),cu(()=>{g(),e.updateMatch(t,k=>({...k,__beforeLoadContext:R})),y()})};let N;try{if(N=s.options.beforeLoad(C),ml(N))return g(),N.catch(R=>{eu(e,n,R,"BEFORE_LOAD")}).then(A)}catch(R){g(),eu(e,n,R,"BEFORE_LOAD")}A(N)},JF=(e,t)=>{const{id:n,routeId:s}=e.matches[t],i=e.router.looseRoutesById[s],a=()=>f(),c=()=>WF(e,n,t,i),f=()=>{if(UN(e,n))return;const d=QF(e,n,i);return ml(d)?d.then(c):c()};return a()},eH=(e,t,n)=>{const s=e.router.getMatch(t);if(!s||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:s,params:s.params,loaderData:s.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([a,c,f])=>{const d=a?.meta,p=a?.links,g=a?.scripts,y=a?.styles;return{meta:d,links:p,headScripts:g,headers:f,scripts:c,styles:y}})},BN=(e,t,n,s)=>{const i=e.matchPromises[n-1],{params:a,loaderDeps:c,abortController:f,cause:d}=e.router.getMatch(t),p=gl(e,n),g=lp(e,t);return{params:a,deps:c,preload:!!g,parentMatchPromise:i,abortController:f,context:p,location:e.location,navigate:y=>e.router.navigate({...y,_fromLocation:e.location}),cause:g?"preload":d,route:s,...e.router.options.additionalContext}},xT=async(e,t,n,s)=>{try{const i=e.router.getMatch(t);try{(!(gF??e.router.isServer)||i.ssr===!0)&&FN(s);const a=s.options.loader?.(BN(e,t,n,s)),c=s.options.loader&&ml(a);if((c||s._lazyPromise||s._componentsPromise||s.options.head||s.options.scripts||s.options.headers||i._nonReactive.minPendingPromise)&&e.updateMatch(t,p=>({...p,isFetching:"loader"})),s.options.loader){const p=c?await a:a;$o(e,e.router.getMatch(t),p),p!==void 0&&e.updateMatch(t,g=>({...g,loaderData:p}))}s._lazyPromise&&await s._lazyPromise;const d=i._nonReactive.minPendingPromise;d&&await d,s._componentsPromise&&await s._componentsPromise,e.updateMatch(t,p=>({...p,error:void 0,context:gl(e,n),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(a){let c=a;if(c?.name==="AbortError"){if(i.abortController.signal.aborted){i._nonReactive.loaderPromise?.resolve(),i._nonReactive.loaderPromise=void 0;return}e.updateMatch(t,d=>({...d,status:d.status==="pending"?"success":d.status,isFetching:!1,context:gl(e,n)}));return}const f=i._nonReactive.minPendingPromise;f&&await f,dr(a)&&await s.options.notFoundComponent?.preload?.(),$o(e,e.router.getMatch(t),a);try{s.options.onError?.(a)}catch(d){c=d,$o(e,e.router.getMatch(t),d)}e.updateMatch(t,d=>({...d,error:c,context:gl(e,n),status:"error",isFetching:!1}))}}catch(i){const a=e.router.getMatch(t);a&&(a._nonReactive.loaderPromise=void 0),$o(e,a,i)}},tH=async(e,t)=>{async function n(g,y,b,x){const S=Date.now()-y.updatedAt,w=g?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(BN(e,s,t,x)):T,{status:A,invalid:N}=b;a=A==="success"&&(N||(C??S>w)),g&&x.options.preload===!1||(a&&!e.sync?(c=!0,(async()=>{try{await xT(e,s,t,x);const R=e.router.getMatch(s);R._nonReactive.loaderPromise?.resolve(),R._nonReactive.loadPromise?.resolve(),R._nonReactive.loaderPromise=void 0}catch(R){Pr(R)&&await e.router.navigate(R.options)}})()):(A!=="success"||a&&e.sync)&&await xT(e,s,t,x))}const{id:s,routeId:i}=e.matches[t];let a=!1,c=!1;const f=e.router.looseRoutesById[i];if(!UN(e,s)){const g=e.router.getMatch(s),y=lp(e,s);if(g._nonReactive.loaderPromise){if(g.status==="success"&&!e.sync&&!g.preload)return g;await g._nonReactive.loaderPromise;const b=e.router.getMatch(s),x=b._nonReactive.error||b.error;x&&$o(e,b,x),b.status==="pending"&&await n(y,g,b,f)}else{const b=y&&!e.router.state.matches.some(S=>S.id===s),x=e.router.getMatch(s);x._nonReactive.loaderPromise=Il(),b!==x.preload&&e.updateMatch(s,S=>({...S,preload:b})),await n(y,g,x,f)}}const d=e.router.getMatch(s);c||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve()),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,c||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;const p=c?d.isFetching:!1;return p!==d.isFetching||d.invalid!==!1?(e.updateMatch(s,g=>({...g,isFetching:p,invalid:!1})),e.router.getMatch(s)):d};async function ST(e){const t=Object.assign(e,{matchPromises:[]});t.router.state.matches.some(n=>n._forcePending)&&nh(t);try{for(let f=0;f<t.matches.length;f++){const d=JF(t,f);ml(d)&&await d}const n=t.firstBadMatchIndex??t.matches.length;for(let f=0;f<n;f++)t.matchPromises.push(tH(t,f));const i=(await Promise.allSettled(t.matchPromises)).filter(f=>f.status==="rejected").map(f=>f.reason);let a;for(const f of i){if(Pr(f))throw f;!a&&dr(f)&&(a=f)}for(const f of t.matches){const{id:d,routeId:p}=f,g=t.router.looseRoutesById[p];try{const y=eH(t,d,g);if(y){const b=await y;t.updateMatch(d,x=>({...x,...b}))}}catch(y){console.error(`Error executing head for route ${p}:`,y)}}if(a)throw a;const c=nh(t);ml(c)&&await c}catch(n){if(dr(n)&&!t.preload){const s=nh(t);throw ml(s)&&await s,n}if(Pr(n))throw n}return t.matches}async function FN(e){if(!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{const{id:n,...s}=t.options;Object.assign(e.options,s),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const s of qN){const i=e.options[s]?.preload;i&&n.push(i())}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 HN(e){for(const t of qN)if(e.options[t]?.preload)return!0;return!1}const qN=["component","errorComponent","pendingComponent","notFoundComponent"];function nH(e){return{input:({url:t})=>{for(const n of e)t=_v(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=VN(e[n],t);return t}}}function rH(e){const t=zN(e.basepath),n=`/${t}`,s=`${n}/`,i=e.caseSensitive?n:n.toLowerCase(),a=e.caseSensitive?s:s.toLowerCase();return{input:({url:c})=>{const f=e.caseSensitive?c.pathname:c.pathname.toLowerCase();return f===i?c.pathname="/":f.startsWith(a)&&(c.pathname=c.pathname.slice(n.length)),c},output:({url:c})=>(c.pathname=th(["/",t,c.pathname]),c)}}function _v(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 VN(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 ea(e){const t=e.resolvedLocation,n=e.location,s=t?.pathname!==n.pathname,i=t?.href!==n.href,a=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:s,hrefChanged:i,hashChanged:a}}function sH(e){const t=e.filter(n=>n.status!=="redirected");return t.length===e.length?e:t}class oH{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 s=this.options,i=this.basepath??s?.basepath??"/",a=this.basepath===void 0,c=s?.rewrite;if(this.options={...s,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=DF(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=pF()),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=Ah(1e3),b=this.buildRouteTree(),this.setRoutes(b)}!this.__store&&this.latestLocation&&(this.__store=fF(aH(this.latestLocation)),FF(this));let f=!1;const d=this.options.basepath??"/",p=this.options.rewrite;if(a||i!==d||c!==p){this.basepath=d;const b=[],x=zN(d);x&&x!=="/"&&b.push(rH({basepath:d})),p&&b.push(p),this.rewrite=b.length===0?void 0:b.length===1?b[0]:nH(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=jF(this.routeTree,this.options.caseSensitive,(s,i)=>{s.init({originalIndex:i})});return this.options.routeMasks&&EF(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,s)=>{const i={eventType:n,fn:s};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(s=>{s.eventType===n.type&&s.fn(n)})},this.parseLocation=(n,s)=>{const i=({pathname:d,search:p,hash:g,href:y,state:b})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(d)){const A=this.options.parseSearch(p),N=this.options.stringifySearch(A);return{href:d+N+g,publicHref:y,pathname:Wc(d).path,external:!1,searchStr:N,search:or(s?.search,A),hash:Wc(g.slice(1)).path,state:or(s?.state,b)}}const x=new URL(y,this.origin),S=_v(this.rewrite,x),w=this.options.parseSearch(S.search),T=this.options.stringifySearch(w);return S.search=T,{href:S.href.replace(S.origin,""),publicHref:y,pathname:Wc(S.pathname).path,external:!!this.rewrite&&S.origin!==this.origin,searchStr:T,search:or(s?.search,w),hash:Wc(S.hash.slice(1)).path,state:or(s?.state,b)}},a=i(n),{__tempLocation:c,__tempKey:f}=a.state;if(c&&(!f||f===this.tempLocationKey)){const d=i(c);return d.state.key=a.state.key,d.state.__TSR_key=a.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:a}}return a},this.resolvePathWithBase=(n,s)=>IF({base:n,to:Pb(s),trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,s,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:s},i):this.matchRoutesInternal(n,s),this.getMatchedRoutes=n=>lH({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const s=this.getMatch(n);s&&(s.abortController.abort(),clearTimeout(s._nonReactive.pendingTimeout),s._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(a=>a.status==="pending"),s=this.state.matches.filter(a=>a.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...s]).forEach(a=>{this.cancelMatch(a.id)})},this.buildLocation=n=>{const s=(a={})=>{const c=a._fromLocation||this.pendingBuiltLocation||this.latestLocation,f=this.matchRoutesLightweight(c);a.from;const d=a.unsafeRelative==="path"?c.pathname:a.from??f.fullPath,p=this.resolvePathWithBase(d,"."),g=f.search,y={...f.params},b=a.to?this.resolvePathWithBase(p,`${a.to}`):this.resolvePathWithBase(p,"."),x=a.params===!1||a.params===null?{}:(a.params??!0)===!0?y:Object.assign(y,Uo(a.params,y)),S=this.getMatchedRoutes(b);let w=S.matchedRoutes;if((!S.foundRoute||S.foundRoute.path!=="/"&&S.routeParams["**"])&&this.options.notFoundRoute&&(w=[...w,this.options.notFoundRoute]),Object.keys(x).length>0)for(const F of w){const z=F.options.params?.stringify??F.options.stringifyParams;if(z)try{Object.assign(x,z(x))}catch{}}const C=n.leaveParams?b:Wc(vT({path:b,params:x,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let A=g;if(n._includeValidateSearch&&this.options.search?.strict){const F={};w.forEach(z=>{if(z.options.validateSearch)try{Object.assign(F,rh(z.options.validateSearch,{...F,...A}))}catch{}}),A=F}A=cH({search:A,dest:a,destRoutes:w,_includeValidateSearch:n._includeValidateSearch}),A=or(g,A);const N=this.options.stringifySearch(A),R=a.hash===!0?c.hash:a.hash?Uo(a.hash,c.hash):void 0,k=R?`#${R}`:"";let L=a.state===!0?c.state:a.state?Uo(a.state,c.state):{};L=or(c.state,L);const j=`${C}${N}${k}`;let O,D,K=!1;if(this.rewrite){const F=new URL(j,this.origin),z=VN(this.rewrite,F);O=F.href.replace(F.origin,""),z.origin!==this.origin?(D=z.href,K=!0):D=z.pathname+z.search+z.hash}else O=SF(j),D=O;return{publicHref:D,href:O,pathname:C,search:A,searchStr:N,state:L,hash:R??"",external:K,unmaskOnReload:a.unmaskOnReload}},i=(a={},c)=>{const f=s(a);let d=c?s(c):void 0;if(!d){const p={};if(this.options.routeMasks){const g=TF(f.pathname,this.processedTree);if(g){Object.assign(p,g.rawParams);const{from:y,params:b,...x}=g.route,S=b===!1||b===null?{}:(b??!0)===!0?p:Object.assign(p,Uo(b,p));c={from:n.from,...x,params:S},d=s(c)}}}return d&&(f.maskedLocation=d),f};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:s,...i})=>{const a=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(g=>{i.state[g]=this.latestLocation.state[g]});const p=Ji(i.state,this.latestLocation.state);return d.forEach(g=>{delete i.state[g]}),p},c=Zo(this.latestLocation.href)===Zo(i.href),f=this.commitLocationPromise;if(this.commitLocationPromise=Il(()=>{f?.resolve()}),c&&a())this.load();else{let{maskedLocation:d,hashScrollIntoView:p,...g}=i;d&&(g={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...g,search:g.searchStr,state:{...g.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(g.unmaskOnReload??this.options.unmaskOnReload??!1)&&(g.state.__tempKey=this.tempLocationKey)),g.state.__hashScrollIntoViewOptions=p??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[i.replace?"replace":"push"](g.publicHref,g.state,{ignoreBlocker:s})}return this.resetNextScroll=i.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:s,hashScrollIntoView:i,viewTransition:a,ignoreBlocker:c,href:f,...d}={})=>{if(f){const y=this.history.location.state.__TSR_index,b=Rh(f,{__TSR_index:n?y:y+1}),x=new URL(b.pathname,this.origin),S=_v(this.rewrite,x);d.to=S.pathname,d.search=this.options.parseSearch(b.search),d.hash=b.hash.slice(1)}const p=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const g=this.commitLocation({...p,viewTransition:a,replace:n,resetScroll:s,hashScrollIntoView:i,ignoreBlocker:c});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),g},this.navigate=async({to:n,reloadDocument:s,href:i,publicHref:a,...c})=>{let f=!1;if(i)try{new URL(`${i}`),f=!0}catch{}if(f&&!s&&(s=!0),s){if(n!==void 0||!i){const p=this.buildLocation({to:n,...c});i=i??p.publicHref,a=a??p.publicHref}const d=!f&&a?a:i;if(jh(d,this.protocolAllowlist))return Promise.resolve();if(!c.ignoreBlocker){const g=this.history.getBlockers?.()??[];for(const y of g)if(y?.blockerFn&&await y.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return c.replace?window.location.replace(d):window.location.href=d,Promise.resolve()}return this.buildAndCommitLocation({...c,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation);this.__store.setState(s=>({...s,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:s.cachedMatches.filter(i=>!n.some(a=>a.id===i.id))}))},this.load=async n=>{let s,i,a;for(a=new Promise(f=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,p=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ea({resolvedLocation:p,location:d})}),this.emit({type:"onBeforeLoad",...ea({resolvedLocation:p,location:d})}),await ST({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let g=[],y=[],b=[],x=[];cu(()=>{this.__store.setState(S=>{const w=S.matches,T=S.pendingMatches||S.matches;return g=w.filter(C=>!T.some(A=>A.id===C.id)),y=w.filter(C=>!T.some(A=>A.routeId===C.routeId)),b=T.filter(C=>!w.some(A=>A.routeId===C.routeId)),x=T.filter(C=>w.some(A=>A.routeId===C.routeId)),{...S,isLoading:!1,loadedAt:Date.now(),matches:T,pendingMatches:void 0,cachedMatches:[...S.cachedMatches,...g.filter(C=>C.status!=="error"&&C.status!=="notFound"&&C.status!=="redirected")]}}),this.clearExpiredCache()}),[[y,"onLeave"],[b,"onEnter"],[x,"onStay"]].forEach(([S,w])=>{S.forEach(T=>{this.looseRoutesById[T.routeId].options[w]?.(T)})})})})}})}catch(d){Pr(d)?(s=d,this.navigate({...s.options,replace:!0,ignoreBlocker:!0})):dr(d)&&(i=d),this.__store.setState(p=>({...p,statusCode:s?s.status:i?404:p.matches.some(g=>g.status==="error")?500:200,redirect:s}))}this.latestLoadPromise===a&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),f()})}),this.latestLoadPromise=a,await a;this.latestLoadPromise&&a!==this.latestLoadPromise;)await this.latestLoadPromise;let c;this.hasNotFoundMatch()?c=404:this.__store.state.matches.some(f=>f.status==="error")&&(c=500),c!==void 0&&this.__store.setState(f=>({...f,statusCode:c}))},this.startViewTransition=n=>{const s=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,s&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof s=="object"&&this.isViewTransitionTypesSupported){const a=this.latestLocation,c=this.state.resolvedLocation,f=typeof s.types=="function"?s.types(ea({resolvedLocation:c,location:a})):s.types;if(f===!1){n();return}i={update:n,types:f}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,s)=>{this.startTransition(()=>{const i=this.state.pendingMatches?.some(a=>a.id===n)?"pendingMatches":this.state.matches.some(a=>a.id===n)?"matches":this.state.cachedMatches.some(a=>a.id===n)?"cachedMatches":"";i&&(i==="cachedMatches"?this.__store.setState(a=>({...a,cachedMatches:sH(a.cachedMatches.map(c=>c.id===n?s(c):c))})):this.__store.setState(a=>({...a,[i]:a[i]?.map(c=>c.id===n?s(c):c)})))})},this.getMatch=n=>{const s=i=>i.id===n;return this.state.cachedMatches.find(s)??this.state.pendingMatches?.find(s)??this.state.matches.find(s)},this.invalidate=n=>{const s=i=>n?.filter?.(i)??!0?{...i,invalid:!0,...n?.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i;return this.__store.setState(i=>({...i,matches:i.matches.map(s),cachedMatches:i.cachedMatches.map(s),pendingMatches:i.pendingMatches?.map(s)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const s=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const i=n.options._builtLocation??this.buildLocation(n.options),a=this.getParsedLocationHref(i);n.options.href=a,n.headers.set("Location",a)}else if(s)try{const i=new URL(s);if(this.origin&&i.origin===this.origin){const a=i.pathname+i.search+i.hash;n.options.href=a,n.headers.set("Location",a)}}catch{}if(n.options.href&&!n.options._builtLocation&&jh(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 s=n?.filter;s!==void 0?this.__store.setState(i=>({...i,cachedMatches:i.cachedMatches.filter(a=>!s(a))})):this.__store.setState(i=>({...i,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=s=>{const i=this.looseRoutesById[s.routeId];if(!i.options.loader)return!0;const a=(s.preload?i.options.preloadGcTime??this.options.defaultPreloadGcTime:i.options.gcTime??this.options.defaultGcTime)??300*1e3;return s.status==="error"?!0:Date.now()-s.updatedAt>=a};this.clearCache({filter:n})},this.loadRouteChunk=FN,this.preloadRoute=async n=>{const s=n._builtLocation??this.buildLocation(n);let i=this.matchRoutes(s,{throwOnError:!0,preload:!0,dest:n});const a=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(f=>f.id)),c=new Set([...a,...this.state.cachedMatches.map(f=>f.id)]);cu(()=>{i.forEach(f=>{c.has(f.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,f]}))})});try{return i=await ST({router:this,matches:i,location:s,preload:!0,updateMatch:(f,d)=>{a.has(f)?i=i.map(p=>p.id===f?d(p):p):this.updateMatch(f,d)}}),i}catch(f){if(Pr(f))return f.options.reloadDocument?void 0:await this.preloadRoute({...f.options,_fromLocation:s});dr(f)||console.error(f);return}},this.matchRoute=(n,s)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},a=this.buildLocation(i);if(s?.pending&&this.state.status!=="pending")return!1;const f=(s?.pending===void 0?!this.state.isLoading:s.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=CF(a.pathname,s?.caseSensitive??!1,s?.fuzzy??!1,f.pathname,this.processedTree);return!d||n.params&&!Ji(d.rawParams,n.params,{partial:!0})?!1:s?.includeSearch??!0?Ji(f.search,a.search,{partial:!0})?d.rawParams:!1:d.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??GF,parseSearch:t.parseSearch??KF,protocolAllowlist:t.protocolAllowlist??xF}),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:s}){this.routesById=t,this.routesByPath=n,this.processedTree=s;const i=this.options.notFoundRoute;i&&(i.init({originalIndex:99999999999}),this.routesById[i.id]=i)}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 s=this.getMatchedRoutes(t.pathname),{foundRoute:i,routeParams:a,parsedParams:c}=s;let{matchedRoutes:f}=s,d=!1;(i?i.path!=="/"&&a["**"]:Zo(t.pathname))&&(this.options.notFoundRoute?f=[...f,this.options.notFoundRoute]:d=!0);const p=d?fH(this.options.notFoundMode,f):void 0,g=new Array(f.length),y=new Map(this.state.matches.map(b=>[b.routeId,b]));for(let b=0;b<f.length;b++){const x=f[b],S=g[b-1];let w,T,C;{const Y=S?.search??t.search,te=S?._strictSearch??void 0;try{const P=rh(x.options.validateSearch,{...Y})??void 0;w={...Y,...P},T={...te,...P},C=void 0}catch(P){let V=P;if(P instanceof kh||(V=new kh(P.message,{cause:P})),n?.throwOnError)throw V;w=Y,T={},C=V}}const A=x.options.loaderDeps?.({search:w})??"",N=A?JSON.stringify(A):"",{interpolatedPath:R,usedParams:k}=vT({path:x.fullPath,params:a,decoder:this.pathParamsDecoder,server:this.isServer}),L=x.id+R+N,j=this.getMatch(L),O=y.get(x.id),D=j?._strictParams??k;let K;if(!j)try{_T(x,k,c,D)}catch(Y){if(dr(Y)||Pr(Y)?K=Y:K=new iH(Y.message,{cause:Y}),n?.throwOnError)throw K}Object.assign(a,D);const F=O?"stay":"enter";let z;if(j)z={...j,cause:F,params:O?.params??a,_strictParams:D,search:or(O?O.search:j.search,w),_strictSearch:T};else{const Y=x.options.loader||x.options.beforeLoad||x.lazyFn||HN(x)?"pending":"success";z={id:L,ssr:x.options.ssr,index:b,routeId:x.id,params:O?.params??a,_strictParams:D,pathname:R,updatedAt:Date.now(),search:O?or(O.search,w):w,_strictSearch:T,searchError:void 0,status:Y,isFetching:!1,error:void 0,paramsError:K,__routeContext:void 0,_nonReactive:{loadPromise:Il()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:F,loaderDeps:O?or(O.loaderDeps,A):A,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||(z.globalNotFound=p===x.id),z.searchError=C;const X=this.getParentContext(S);z.context={...X,...z.__routeContext,...z.__beforeLoadContext},g[b]=z}for(let b=0;b<g.length;b++){const x=g[b],S=this.looseRoutesById[x.routeId],w=this.getMatch(x.id),T=y.get(x.routeId);if(x.params=T?or(T.params,a):a,!w){const C=g[b-1],A=this.getParentContext(C);if(S.options.context){const N={deps:x.loaderDeps,params:x.params,context:A??{},location:t,navigate:R=>this.navigate({...R,_fromLocation:t}),buildLocation:this.buildLocation,cause:x.cause,abortController:x.abortController,preload:!!x.preload,matches:g,routeId:S.id};x.__routeContext=S.options.context(N)??void 0}x.context={...A,...x.__routeContext,...x.__beforeLoadContext}}}return g}matchRoutesLightweight(t){const{matchedRoutes:n,routeParams:s,parsedParams:i}=this.getMatchedRoutes(t.pathname),a=_u(n),c={...t.search};for(const g of n)try{Object.assign(c,rh(g.options.validateSearch,c))}catch{}const f=_u(this.state.matches),d=f&&f.routeId===a.id&&t.pathname===this.state.location.pathname;let p;if(d)p=f.params;else{const g={...s};for(const y of n)try{_T(y,s,i??{},g)}catch{}p=g}return{matchedRoutes:n,fullPath:a.fullPath,search:c,params:p}}}class kh extends Error{}class iH extends Error{}function aH(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function rh(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new kh("Async validation not supported");if(n.issues)throw new kh(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 lH({pathname:e,routesById:t,processedTree:n}){const s={},i=Zo(e);let a,c;const f=RF(i,n,!0);return f&&(a=f.route,Object.assign(s,f.rawParams),c=Object.assign({},f.parsedParams)),{matchedRoutes:f?.branch||[t[kr]],routeParams:s,foundRoute:a,parsedParams:c}}function cH({search:e,dest:t,destRoutes:n,_includeValidateSearch:s}){return uH(n)(e,t,s??!1)}function uH(e){const t={dest:null,_includeValidateSearch:!1,middlewares:[]};for(const i of e){if("search"in i.options)i.options.search?.middlewares&&t.middlewares.push(...i.options.search.middlewares);else if(i.options.preSearchFilters||i.options.postSearchFilters){const a=({search:c,next:f})=>{let d=c;"preSearchFilters"in i.options&&i.options.preSearchFilters&&(d=i.options.preSearchFilters.reduce((g,y)=>y(g),c));const p=f(d);return"postSearchFilters"in i.options&&i.options.postSearchFilters?i.options.postSearchFilters.reduce((g,y)=>y(g),p):p};t.middlewares.push(a)}if(i.options.validateSearch){const a=({search:c,next:f})=>{const d=f(c);if(!t._includeValidateSearch)return d;try{return{...d,...rh(i.options.validateSearch,d)??void 0}}catch{return d}};t.middlewares.push(a)}}const n=({search:i})=>{const a=t.dest;return a.search?a.search===!0?i:Uo(a.search,i):{}};t.middlewares.push(n);const s=(i,a,c)=>{if(i>=c.length)return a;const f=c[i];return f({search:a,next:p=>s(i+1,p,c)})};return function(a,c,f){return t.dest=c,t._includeValidateSearch=f,s(0,a,t.middlewares)}}function fH(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const s=t[n];if(s.children)return s.id}return kr}function _T(e,t,n,s){const i=e.options.params?.parse??e.options.parseParams;if(i)if(e.options.skipRouteOnParseError)for(const a in t)a in n&&(s[a]=n[a]);else{const a=i(s);Object.assign(s,a)}}const dH="Error preloading route! ☝️";class KN{constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const s=this.options,i=!s?.path&&!s?.id;this.parentRoute=this.options.getParentRoute?.(),i?this._path=kr:this.parentRoute||eo(!1);let a=i?kr:s?.path;a&&a!=="/"&&(a=PN(a));const c=s?.id||a;let f=i?kr:th([this.parentRoute.id===kr?"":this.parentRoute.id,c]);a===kr&&(a="/"),f!==kr&&(f=th(["/",f]));const d=f===kr?"/":th([this.parentRoute.fullPath,a]);this._path=a,this._id=f,this._fullPath=d,this._to=Zo(d)},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=>XF({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 hH extends KN{constructor(t){super(t)}}const jd=typeof window<"u"?_.useLayoutEffect:_.useEffect;function hy(e){const t=_.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function pH(e,t,n={},s={}){_.useEffect(()=>{if(!e.current||s.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([a])=>{t(a)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,s.disabled,e])}function mH(e){const t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}function zb(e){const t=e.errorComponent??Lb;return h.jsx(gH,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:s})=>n?_.createElement(t,{error:n,reset:s}):e.children})}class gH extends _.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 Lb({error:e}){const[t,n]=_.useState(!1);return h.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[h.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),h.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(s=>!s),children:t?"Hide Error":"Show Error"})]}),h.jsx("div",{style:{height:".25rem"}}),t?h.jsx("div",{children:h.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?h.jsx("code",{children:e.message}):null})}):null]})}function yH({children:e,fallback:t=null}){return GN()?h.jsx(Ol.Fragment,{children:e}):h.jsx(Ol.Fragment,{children:t})}function GN(){return Ol.useSyncExternalStore(vH,()=>!0,()=>!1)}function vH(){return()=>{}}var py={exports:{}},my={},gy={exports:{}},yy={};var wT;function bH(){if(wT)return yy;wT=1;var e=qu();function t(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&b!==b}var n=typeof Object.is=="function"?Object.is:t,s=e.useState,i=e.useEffect,a=e.useLayoutEffect,c=e.useDebugValue;function f(y,b){var x=b(),S=s({inst:{value:x,getSnapshot:b}}),w=S[0].inst,T=S[1];return a(function(){w.value=x,w.getSnapshot=b,d(w)&&T({inst:w})},[y,x,b]),i(function(){return d(w)&&T({inst:w}),y(function(){d(w)&&T({inst:w})})},[y]),c(x),x}function d(y){var b=y.getSnapshot;y=y.value;try{var x=b();return!n(y,x)}catch{return!0}}function p(y,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:f;return yy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,yy}var ET;function ZN(){return ET||(ET=1,gy.exports=bH()),gy.exports}var TT;function xH(){if(TT)return my;TT=1;var e=qu(),t=ZN();function n(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var s=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,a=e.useRef,c=e.useEffect,f=e.useMemo,d=e.useDebugValue;return my.useSyncExternalStoreWithSelector=function(p,g,y,b,x){var S=a(null);if(S.current===null){var w={hasValue:!1,value:null};S.current=w}else w=S.current;S=f(function(){function C(L){if(!A){if(A=!0,N=L,L=b(L),x!==void 0&&w.hasValue){var j=w.value;if(x(j,L))return R=j}return R=L}if(j=R,s(N,L))return j;var O=b(L);return x!==void 0&&x(j,O)?(N=L,j):(N=L,R=O)}var A=!1,N,R,k=y===void 0?null:y;return[function(){return C(g())},k===null?void 0:function(){return C(k())}]},[g,y,b,x]);var T=i(p,S[0],S[1]);return c(function(){w.hasValue=!0,w.value=T},[T]),d(T),T},my}var CT;function SH(){return CT||(CT=1,py.exports=xH()),py.exports}var YN=SH();function _H(e,t){return e===t}function wH(e,t,n=_H){const s=_.useCallback(c=>{if(!e)return()=>{};const{unsubscribe:f}=e.subscribe(c);return f},[e]),i=_.useCallback(()=>e?.get(),[e]);return YN.useSyncExternalStoreWithSelector(s,i,i,t,n)}const XN=_.createContext(null);function Vr(e){const t=_.useContext(XN);return e?.warn,t}function hr(e){const t=Vr({warn:e?.router===void 0}),n=e?.router||t,s=_.useRef(void 0);return wH(n.__store,i=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const a=or(s.current,e.select(i));return s.current=a,a}return e.select(i)}return i})}const cp=_.createContext(void 0),EH=_.createContext(void 0);function vs(e){const t=_.useContext(e.from?EH:cp);return hr({select:s=>{const i=s.matches.find(a=>e.from?e.from===a.routeId:a.id===t);if(eo(!((e.shouldThrow??!0)&&!i),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),i!==void 0)return e.select?e.select(i):i},structuralSharing:e.structuralSharing})}function Ub(e){return vs({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function $b(e){const{select:t,...n}=e;return vs({...n,select:s=>t?t(s.loaderDeps):s.loaderDeps})}function Bb(e){return vs({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 Fb(e){return vs({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function up(e){const t=Vr();return _.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var ui=yN();function TH(e,t){const n=Vr(),s=mH(t),{activeProps:i,inactiveProps:a,activeOptions:c,to:f,preload:d,preloadDelay:p,hashScrollIntoView:g,replace:y,startTransition:b,resetScroll:x,viewTransition:S,children:w,target:T,disabled:C,style:A,className:N,onClick:R,onBlur:k,onFocus:L,onMouseEnter:j,onMouseLeave:O,onTouchStart:D,ignoreBlocker:K,params:F,search:z,hash:X,state:Y,mask:te,reloadDocument:P,unsafeRelative:V,from:B,_fromLocation:q,...U}=e,I=GN(),G=hr({select:Fe=>{const me=Fe.matches[Fe.matches.length-1];return{search:me?.search,hash:Fe.location.hash,path:me?.pathname}},structuralSharing:!0}),W=e.from,Q=_.useMemo(()=>({...e,from:W}),[n,G,W,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),se=_.useMemo(()=>n.buildLocation({...Q}),[n,Q]),oe=se.maskedLocation?se.maskedLocation.publicHref:se.publicHref,pe=se.maskedLocation?se.maskedLocation.external:se.external,Se=_.useMemo(()=>OH(oe,pe,n.history,C),[C,pe,oe,n.history]),he=_.useMemo(()=>{if(Se?.external)return jh(Se.href,n.protocolAllowlist)?void 0:Se.href;if(!MH(f)&&!(typeof f!="string"||f.indexOf(":")===-1))try{return new URL(f),jh(f,n.protocolAllowlist)?void 0:f}catch{}},[f,Se,n.protocolAllowlist]),He=hr({select:Fe=>{if(he)return!1;if(c?.exact){if(!kF(Fe.location.pathname,se.pathname,n.basepath))return!1}else{const me=Oh(Fe.location.pathname,n.basepath),Te=Oh(se.pathname,n.basepath);if(!(me.startsWith(Te)&&(me.length===Te.length||me[Te.length]==="/")))return!1}return(c?.includeSearch??!0)&&!Ji(Fe.location.search,se.search,{partial:!c?.exact,ignoreUndefined:!c?.explicitUndefined})?!1:c?.includeHash?I&&Fe.location.hash===se.hash:!0}}),Ee=He?Uo(i,{})??CH:vy,re=He?vy:Uo(a,{})??vy,de=[N,Ee.className,re.className].filter(Boolean).join(" "),ae=(A||Ee.style||re.style)&&{...A,...Ee.style,...re.style},[_e,ve]=_.useState(!1),xe=_.useRef(!1),ye=e.reloadDocument||he?!1:d??n.options.defaultPreload,Le=p??n.options.defaultPreloadDelay??0,ke=_.useCallback(()=>{n.preloadRoute({...Q,_builtLocation:se}).catch(Fe=>{console.warn(Fe),console.warn(dH)})},[n,Q,se]),we=_.useCallback(Fe=>{Fe?.isIntersecting&&ke()},[ke]);pH(s,we,AH,{disabled:!!C||ye!=="viewport"}),_.useEffect(()=>{xe.current||!C&&ye==="render"&&(ke(),xe.current=!0)},[C,ke,ye]);const Ve=Fe=>{const me=Fe.currentTarget.getAttribute("target"),Te=T!==void 0?T:me;if(!C&&!kH(Fe)&&!Fe.defaultPrevented&&(!Te||Te==="_self")&&Fe.button===0){Fe.preventDefault(),ui.flushSync(()=>{ve(!0)});const qe=n.subscribe("onResolved",()=>{qe(),ve(!1)});n.navigate({...Q,replace:y,resetScroll:x,hashScrollIntoView:g,startTransition:b,viewTransition:S,ignoreBlocker:K})}};if(he)return{...U,ref:s,href:he,...w&&{children:w},...T&&{target:T},...C&&{disabled:C},...A&&{style:A},...N&&{className:N},...R&&{onClick:R},...k&&{onBlur:k},...L&&{onFocus:L},...j&&{onMouseEnter:j},...O&&{onMouseLeave:O},...D&&{onTouchStart:D}};const Xe=Fe=>{if(C||ye!=="intent")return;if(!Le){ke();return}const me=Fe.currentTarget;if(tu.has(me))return;const Te=setTimeout(()=>{tu.delete(me),ke()},Le);tu.set(me,Te)},$e=Fe=>{C||ye!=="intent"||ke()},We=Fe=>{if(C||!ye||!Le)return;const me=Fe.currentTarget,Te=tu.get(me);Te&&(clearTimeout(Te),tu.delete(me))};return{...U,...Ee,...re,href:Se?.href,ref:s,onClick:il([R,Ve]),onBlur:il([k,We]),onFocus:il([L,Xe]),onMouseEnter:il([j,Xe]),onMouseLeave:il([O,We]),onTouchStart:il([D,$e]),disabled:!!C,target:T,...ae&&{style:ae},...de&&{className:de},...C&&RH,...He&&NH,...I&&_e&&jH}}const vy={},CH={className:"active"},RH={role:"link","aria-disabled":!0},NH={"data-status":"active","aria-current":"page"},jH={"data-transitioning":"transitioning"},tu=new WeakMap,AH={rootMargin:"100px"},il=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function OH(e,t,n,s){if(!s)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function MH(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}const yl=_.forwardRef((e,t)=>{const{_asChild:n,...s}=e,{type:i,...a}=TH(s,t),c=typeof s.children=="function"?s.children({isActive:a["data-status"]==="active"}):s.children;if(!n){const{disabled:f,...d}=a;return _.createElement("a",d,c)}return _.createElement(n,a,c)});function kH(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}let IH=class extends KN{constructor(t){super(t),this.useMatch=n=>vs({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>vs({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Fb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Bb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>$b({...n,from:this.id}),this.useLoaderData=n=>Ub({...n,from:this.id}),this.useNavigate=()=>up({from:this.fullPath}),this.Link=Ol.forwardRef((n,s)=>h.jsx(yl,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}};function so(e){return new IH(e)}class DH extends hH{constructor(t){super(t),this.useMatch=n=>vs({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>vs({...n,from:this.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Fb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>Bb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>$b({...n,from:this.id}),this.useLoaderData=n=>Ub({...n,from:this.id}),this.useNavigate=()=>up({from:this.fullPath}),this.Link=Ol.forwardRef((n,s)=>h.jsx(yl,{ref:s,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function PH(e){return new DH(e)}function RT(e){return typeof e=="object"?new NT(e,{silent:!0}).createRoute(e):new NT(e,{silent:!0}).createRoute}class NT{constructor(t,n){this.path=t,this.createRoute=s=>{const i=so(s);return i.isRoot=!1,i},this.silent=n?.silent}}class jT{constructor(t){this.useMatch=n=>vs({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>vs({from:this.options.id,select:s=>n?.select?n.select(s.context):s.context}),this.useSearch=n=>Fb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>Bb({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>$b({...n,from:this.options.id}),this.useLoaderData=n=>Ub({...n,from:this.options.id}),this.useNavigate=()=>{const n=Vr();return up({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function AT(e){return typeof e=="object"?new jT(e):t=>new jT({id:e,...t})}function zH(){const e=Vr(),t=_.useRef({router:e,mounted:!1}),[n,s]=_.useState(!1),{hasPendingMatches:i,isLoading:a}=hr({select:y=>({isLoading:y.isLoading,hasPendingMatches:y.matches.some(b=>b.status==="pending")}),structuralSharing:!0}),c=hy(a),f=a||n||i,d=hy(f),p=a||i,g=hy(p);return e.startTransition=y=>{s(!0),_.startTransition(()=>{y(),s(!1)})},_.useEffect(()=>{const y=e.history.subscribe(e.load),b=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Zo(e.latestLocation.publicHref)!==Zo(b.publicHref)&&e.commitLocation({...b,replace:!0}),()=>{y()}},[e,e.history]),jd(()=>{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]),jd(()=>{c&&!a&&e.emit({type:"onLoad",...ea(e.state)})},[c,e,a]),jd(()=>{g&&!p&&e.emit({type:"onBeforeRouteMount",...ea(e.state)})},[p,g,e]),jd(()=>{if(d&&!f){const y=ea(e.state);e.emit({type:"onResolved",...y}),e.__store.setState(b=>({...b,status:"idle",resolvedLocation:b.location})),y.hrefChanged&&HF(e)}},[f,d,e]),null}function LH(e){const t=hr({select:n=>`not-found-${n.location.pathname}-${n.status}`});return h.jsx(zb,{getResetKey:()=>t,onCatch:(n,s)=>{if(dr(n))e.onCatch?.(n,s);else throw n},errorComponent:({error:n})=>{if(dr(n))return e.fallback?.(n);throw n},children:e.children})}function UH(){return h.jsx("p",{children:"Not Found"})}function al(e){return h.jsx(h.Fragment,{children:e.children})}function QN(e,t,n){return t.options.notFoundComponent?h.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?h.jsx(e.options.defaultNotFoundComponent,{...n}):h.jsx(UH,{})}function $H(){return Vr().isScrollRestoring,null}const WN=_.memo(function({matchId:t}){const n=Vr(),s=hr({select:w=>{const T=w.matches.findIndex(A=>A.id===t),C=w.matches[T];return eo(C),{routeId:C.routeId,ssr:C.ssr,_displayPending:C._displayPending,resetKey:w.loadedAt,parentRouteId:w.matches[T-1]?.routeId}},structuralSharing:!0}),i=n.routesById[s.routeId],a=i.options.pendingComponent??n.options.defaultPendingComponent,c=a?h.jsx(a,{}):null,f=i.options.errorComponent??n.options.defaultErrorComponent,d=i.options.onCatch??n.options.defaultOnCatch,p=i.isRoot?i.options.notFoundComponent??n.options.notFoundRoute?.options.component:i.options.notFoundComponent,g=s.ssr===!1||s.ssr==="data-only",y=(!i.isRoot||i.options.wrapInSuspense||g)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||g))?_.Suspense:al,b=f?zb:al,x=p?LH:al,S=i.isRoot?i.options.shellComponent??al:al;return h.jsxs(S,{children:[h.jsx(cp.Provider,{value:t,children:h.jsx(y,{fallback:c,children:h.jsx(b,{getResetKey:()=>s.resetKey,errorComponent:f||Lb,onCatch:(w,T)=>{if(dr(w))throw w;d?.(w,T)},children:h.jsx(x,{fallback:w=>{if(!p||w.routeId&&w.routeId!==s.routeId||!w.routeId&&!i.isRoot)throw w;return _.createElement(p,w)},children:g||s._displayPending?h.jsx(yH,{fallback:c,children:h.jsx(OT,{matchId:t})}):h.jsx(OT,{matchId:t})})})})}),s.parentRouteId===kr&&n.options.scrollRestoration?h.jsxs(h.Fragment,{children:[h.jsx(BH,{}),h.jsx($H,{})]}):null]})});function BH(){const e=Vr(),t=_.useRef(void 0);return h.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...ea(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const OT=_.memo(function({matchId:t}){const n=Vr(),{match:s,key:i,routeId:a}=hr({select:d=>{const p=d.matches.find(S=>S.id===t),g=p.routeId,b=(n.routesById[g].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:g,loaderDeps:p.loaderDeps,params:p._strictParams,search:p._strictSearch});return{key:b?JSON.stringify(b):void 0,routeId:g,match:{id:p.id,status:p.status,error:p.error,invalid:p.invalid,_forcePending:p._forcePending,_displayPending:p._displayPending}}},structuralSharing:!0}),c=n.routesById[a],f=_.useMemo(()=>{const d=c.options.component??n.options.defaultComponent;return d?h.jsx(d,{},i):h.jsx(JN,{})},[i,c.options.component,n.options.defaultComponent]);if(s._displayPending)throw n.getMatch(s.id)?._nonReactive.displayPendingPromise;if(s._forcePending)throw n.getMatch(s.id)?._nonReactive.minPendingPromise;if(s.status==="pending"){const d=c.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const p=n.getMatch(s.id);if(p&&!p._nonReactive.minPendingPromise){const g=Il();p._nonReactive.minPendingPromise=g,setTimeout(()=>{g.resolve(),p._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(s.id)?._nonReactive.loadPromise}if(s.status==="notFound")return eo(dr(s.error)),QN(n,c,s.error);if(s.status==="redirected")throw eo(Pr(s.error)),n.getMatch(s.id)?._nonReactive.loadPromise;if(s.status==="error")throw s.error;return f}),JN=_.memo(function(){const t=Vr(),n=_.useContext(cp),s=hr({select:p=>p.matches.find(g=>g.id===n)?.routeId}),i=t.routesById[s],a=hr({select:p=>{const y=p.matches.find(b=>b.id===n);return eo(y),y.globalNotFound}}),c=hr({select:p=>{const g=p.matches,y=g.findIndex(b=>b.id===n);return g[y+1]?.id}}),f=t.options.defaultPendingComponent?h.jsx(t.options.defaultPendingComponent,{}):null;if(a)return QN(t,i,void 0);if(!c)return null;const d=h.jsx(WN,{matchId:c});return s===kr?h.jsx(_.Suspense,{fallback:f,children:d}):d});function FH(){const e=Vr(),n=e.routesById[kr].options.pendingComponent??e.options.defaultPendingComponent,s=n?h.jsx(n,{}):null,i=typeof document<"u"&&e.ssr?al:_.Suspense,a=h.jsxs(i,{fallback:s,children:[h.jsx(zH,{}),h.jsx(HH,{})]});return e.options.InnerWrap?h.jsx(e.options.InnerWrap,{children:a}):a}function HH(){const e=Vr(),t=hr({select:i=>i.matches[0]?.id}),n=hr({select:i=>i.loadedAt}),s=t?h.jsx(WN,{matchId:t}):null;return h.jsx(cp.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?s:h.jsx(zb,{getResetKey:()=>n,errorComponent:Lb,onCatch:void 0,children:s})})}const qH=e=>new VH(e);class VH extends oH{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=RT,globalThis.createLazyFileRoute=AT):typeof window<"u"&&(window.createFileRoute=RT,window.createLazyFileRoute=AT);function KH({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const s=h.jsx(XN.Provider,{value:e,children:t});return e.options.Wrap?h.jsx(e.options.Wrap,{children:s}):s}function GH({router:e,...t}){return h.jsx(KH,{router:e,...t,children:h.jsx(FH,{})})}const ZH=/\{[^{}]+\}/g,YH=()=>typeof process=="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function XH(){return Math.random().toString(36).slice(2,11)}function QH(e){let{baseUrl:t="",Request:n=globalThis.Request,fetch:s=globalThis.fetch,querySerializer:i,bodySerializer:a,pathSerializer:c,headers:f,requestInitExt:d=void 0,...p}={...e};d=YH()?d:void 0,t=IT(t);const g=[];async function y(b,x){const{baseUrl:S,fetch:w=s,Request:T=n,headers:C,params:A={},parseAs:N="json",querySerializer:R,bodySerializer:k=a??JH,pathSerializer:L,body:j,middleware:O=[],...D}=x||{};let K=t;S&&(K=IT(S)??t);let F=typeof i=="function"?i:MT(i);R&&(F=typeof R=="function"?R:MT({...typeof i=="object"?i:{},...R}));const z=L||c||WH,X=j===void 0?void 0:k(j,kT(f,C,A.header)),Y=kT(X===void 0||X instanceof FormData?{}:{"Content-Type":"application/json"},f,C,A.header),te=[...g,...O],P={redirect:"follow",...p,...D,body:X,headers:Y};let V,B,q=new T(eq(b,{baseUrl:K,params:A,querySerializer:F,pathSerializer:z}),P),U;for(const W in D)W in q||(q[W]=D[W]);if(te.length){V=XH(),B=Object.freeze({baseUrl:K,fetch:w,parseAs:N,querySerializer:F,bodySerializer:k,pathSerializer:z});for(const W of te)if(W&&typeof W=="object"&&typeof W.onRequest=="function"){const Q=await W.onRequest({request:q,schemaPath:b,params:A,options:B,id:V});if(Q)if(Q instanceof T)q=Q;else if(Q instanceof Response){U=Q;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!U){try{U=await w(q,d)}catch(W){let Q=W;if(te.length)for(let se=te.length-1;se>=0;se--){const oe=te[se];if(oe&&typeof oe=="object"&&typeof oe.onError=="function"){const pe=await oe.onError({request:q,error:Q,schemaPath:b,params:A,options:B,id:V});if(pe){if(pe instanceof Response){Q=void 0,U=pe;break}if(pe instanceof Error){Q=pe;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(Q)throw Q}if(te.length)for(let W=te.length-1;W>=0;W--){const Q=te[W];if(Q&&typeof Q=="object"&&typeof Q.onResponse=="function"){const se=await Q.onResponse({request:q,response:U,schemaPath:b,params:A,options:B,id:V});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||q.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(N==="stream")return U.body;if(N==="json"&&!I){const Q=await U.text();return Q?JSON.parse(Q):void 0}return await U[N]()})(),response:U};let G=await U.text();try{G=JSON.parse(G)}catch{}return{error:G,response:U}}return{request(b,x,S){return y(x,{...S,method:b.toUpperCase()})},GET(b,x){return y(b,{...x,method:"GET"})},PUT(b,x){return y(b,{...x,method:"PUT"})},POST(b,x){return y(b,{...x,method:"POST"})},DELETE(b,x){return y(b,{...x,method:"DELETE"})},OPTIONS(b,x){return y(b,{...x,method:"OPTIONS"})},HEAD(b,x){return y(b,{...x,method:"HEAD"})},PATCH(b,x){return y(b,{...x,method:"PATCH"})},TRACE(b,x){return y(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()`");g.push(x)}},eject(...b){for(const x of b){const S=g.indexOf(x);S!==-1&&g.splice(S,1)}}}}function fp(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 ej(e,t,n){if(!t||typeof t!="object")return"";const s=[],i={simple:",",label:".",matrix:";"}[n.style]||"&";if(n.style!=="deepObject"&&n.explode===!1){for(const f in t)s.push(f,n.allowReserved===!0?t[f]:encodeURIComponent(t[f]));const c=s.join(",");switch(n.style){case"form":return`${e}=${c}`;case"label":return`.${c}`;case"matrix":return`;${e}=${c}`;default:return c}}for(const c in t){const f=n.style==="deepObject"?`${e}[${c}]`:c;s.push(fp(f,t[c],n))}const a=s.join(i);return n.style==="label"||n.style==="matrix"?`${i}${a}`:a}function tj(e,t,n){if(!Array.isArray(t))return"";if(n.explode===!1){const a={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[n.style]||",",c=(n.allowReserved===!0?t:t.map(f=>encodeURIComponent(f))).join(a);switch(n.style){case"simple":return c;case"label":return`.${c}`;case"matrix":return`;${e}=${c}`;default:return`${e}=${c}`}}const s={simple:",",label:".",matrix:";"}[n.style]||"&",i=[];for(const a of t)n.style==="simple"||n.style==="label"?i.push(n.allowReserved===!0?a:encodeURIComponent(a)):i.push(fp(e,a,n));return n.style==="label"||n.style==="matrix"?`${s}${i.join(s)}`:i.join(s)}function MT(e){return function(n){const s=[];if(n&&typeof n=="object")for(const i in n){const a=n[i];if(a!=null){if(Array.isArray(a)){if(a.length===0)continue;s.push(tj(i,a,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof a=="object"){s.push(ej(i,a,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}s.push(fp(i,a,e))}}return s.join("&")}}function WH(e,t){let n=e;for(const s of e.match(ZH)??[]){let i=s.substring(1,s.length-1),a=!1,c="simple";if(i.endsWith("*")&&(a=!0,i=i.substring(0,i.length-1)),i.startsWith(".")?(c="label",i=i.substring(1)):i.startsWith(";")&&(c="matrix",i=i.substring(1)),!t||t[i]===void 0||t[i]===null)continue;const f=t[i];if(Array.isArray(f)){n=n.replace(s,tj(i,f,{style:c,explode:a}));continue}if(typeof f=="object"){n=n.replace(s,ej(i,f,{style:c,explode:a}));continue}if(c==="matrix"){n=n.replace(s,`;${fp(i,f)}`);continue}n=n.replace(s,c==="label"?`.${encodeURIComponent(f)}`:encodeURIComponent(f))}return n}function JH(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 eq(e,t){let n=`${t.baseUrl}${e}`;t.params?.path&&(n=t.pathSerializer(n,t.params.path));let s=t.querySerializer(t.params.query??{});return s.startsWith("?")&&(s=s.substring(1)),s&&(n+=`?${s}`),n}function kT(...e){const t=new Headers;for(const n of e){if(!n||typeof n!="object")continue;const s=n instanceof Headers?n.entries():Object.entries(n);for(const[i,a]of s)if(a===null)t.delete(i);else if(Array.isArray(a))for(const c of a)t.append(i,c);else a!==void 0&&t.set(i,a)}return t}function IT(e){return e.endsWith("/")?e.substring(0,e.length-1):e}function tq(e){const t=QH({baseUrl:e.baseUrl,...e.fetch&&{fetch:e.fetch}}),n=e.getHeaders,s=e.transportPath??"direct";return t.use({async onRequest({request:i}){if(n){const a=await n();for(const[c,f]of Object.entries(a))i.headers.set(c,f)}return i.headers.has("x-syncular-transport-path")||i.headers.set("x-syncular-transport-path",s),i}}),t}function nq(e){return tq({baseUrl:e.serverUrl,getHeaders:()=>({Authorization:`Bearer ${e.token}`})})}async function rq(e){try{const{error:t,response:n}=await e.GET("/console/stats");if(!t)return;const s=n.status;let i=null;if(typeof t=="string")i=t;else if(t&&typeof t=="object"){const a=t,c=a.error,f=a.message;if(typeof c=="string"&&c.length>0)i=c;else if(typeof f=="string"&&f.length>0)i=f;else try{i=JSON.stringify(a)}catch{i=null}}throw new Error(i&&i.length>0?`Console API /console/stats returned ${s}: ${i}`:`Console API /console/stats returned ${s}`)}catch(t){throw t instanceof Error?t:new Error("Failed to connect to console API")}}const Eu="sync-console-connection";function wv(e){if(!e)return null;const t=e.serverUrl?.trim()??"",n=e.token?.trim()??"";return!t||!n?null:{serverUrl:t,token:n}}function nj(e){return typeof window>"u"?null:e==="local"?window.localStorage:e==="session"?window.sessionStorage:null}function DT(e){const t=nj(e);if(!t)return null;try{const n=t.getItem(Eu);return n?wv(JSON.parse(n)):null}catch{return null}}function sq(e,t){const n=nj(e);if(n)try{if(!t){n.removeItem(Eu);return}n.setItem(Eu,JSON.stringify(t))}catch{}}const rj=_.createContext(null);function oq({children:e,defaultConfig:t=null,autoConnect:n=!1,storageMode:s="session"}){const[i,a]=_.useState(()=>DT(s));_.useEffect(()=>{const w=DT(s);a(w)},[s]),_.useEffect(()=>{typeof window>"u"||(s!=="local"&&window.localStorage.removeItem(Eu),s==="memory"&&window.sessionStorage.removeItem(Eu))},[s]);const c=_.useCallback(w=>{const T=wv(w);a(T),sq(s,T)},[s]),[f,d]=_.useState({isConnected:!1,isConnecting:!1,error:null,client:null}),p=_.useRef(null);_.useEffect(()=>{if(!(i?.serverUrl?.trim()&&i.token?.trim())&&t?.serverUrl?.trim()&&t.token?.trim()){c({serverUrl:t.serverUrl.trim(),token:t.token.trim()});return}},[c,i,t]);const g=_.useCallback(async(w,T)=>{const C=w??i;if(!C)return d(N=>({...N,error:"No connection configured"})),!1;const A=wv(C);if(!A){const N=(C.serverUrl?.trim()??"").length>0;return d(R=>({...R,error:N?"Token is required":"Server URL is required"})),!1}w&&(T?.persistOverride??!0)&&c(A),d(N=>({...N,isConnecting:!0,error:null}));try{const N=nq(A);return await rq(N),d({isConnected:!0,isConnecting:!1,client:N,error:null}),!0}catch(N){return d({isConnected:!1,isConnecting:!1,client:null,error:N instanceof Error?N.message:"Connection failed"}),!1}},[i,c]),y=_.useCallback(w=>{w?.clearSavedConfig&&c(null),d({isConnected:!1,isConnecting:!1,client:null,error:null})},[c]),b=_.useCallback(()=>{d(w=>({...w,error:null}))},[]),x=_.useCallback(w=>{c(w),d({isConnected:!1,isConnecting:!1,client:null,error:null})},[c]),S=_.useMemo(()=>({config:i,setConfig:x,isConnected:f.isConnected,isConnecting:f.isConnecting,error:f.error,client:f.client,connect:g,disconnect:y,clearError:b}),[i,x,f,g,y,b]);return _.useEffect(()=>{if(!n||f.isConnected||f.isConnecting)return;const w=i??t,T=iq(w);!w||!T||p.current!==T&&(p.current=T,g(w,{persistOverride:!0}))},[n,i,t,f.isConnected,f.isConnecting,g]),h.jsx(rj.Provider,{value:S,children:e})}function iq(e){if(!e)return null;const t=e.serverUrl?.trim()??"",n=e.token?.trim()??"";return!t||!n?null:`${t}\0${n}`}function pa(){const e=_.useContext(rj);if(!e)throw new Error("useConnection must be used within a ConnectionProvider");return e}function sj(e){var t,n,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=sj(e[t]))&&(s&&(s+=" "),s+=n)}else for(n in e)e[n]&&(s&&(s+=" "),s+=n);return s}function Hb(){for(var e,t,n=0,s="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=sj(e))&&(s&&(s+=" "),s+=t);return s}var aq=e=>typeof e=="number"&&e!=+e,Ih=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,PT=e=>(typeof e=="number"||e instanceof Number)&&!aq(e);function lq(){}var Dh=Symbol("NOT_FOUND");function cq(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function uq(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function fq(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(s=>typeof s=="function"?`function ${s.name||"unnamed"}()`:typeof s).join(", ");throw new TypeError(`${t}[${n}]`)}}var zT=e=>Array.isArray(e)?e:[e];function dq(e){const t=Array.isArray(e[0])?e[0]:e;return fq(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function hq(e,t){const n=[],{length:s}=e;for(let i=0;i<s;i++)n.push(e[i].apply(null,t));return n}function pq(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Dh},put(n,s){t={key:n,value:s}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function mq(e,t){let n=[];function s(f){const d=n.findIndex(p=>t(f,p.key));if(d>-1){const p=n[d];return d>0&&(n.splice(d,1),n.unshift(p)),p.value}return Dh}function i(f,d){s(f)===Dh&&(n.unshift({key:f,value:d}),n.length>e&&n.pop())}function a(){return n}function c(){n=[]}return{get:s,put:i,getEntries:a,clear:c}}var gq=(e,t)=>e===t;function yq(e){return function(n,s){if(n===null||s===null||n.length!==s.length)return!1;const{length:i}=n;for(let a=0;a<i;a++)if(!e(n[a],s[a]))return!1;return!0}}function vq(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:s=gq,maxSize:i=1,resultEqualityCheck:a}=n,c=yq(s);let f=0;const d=i<=1?pq(c):mq(i,c);function p(){let g=d.get(arguments);if(g===Dh){if(g=e.apply(null,arguments),f++,a){const b=d.getEntries().find(x=>a(x.value,g));b&&(g=b.value,f!==0&&f--)}d.put(arguments,g)}return g}return p.clearCache=()=>{d.clear(),p.resetResultsCount()},p.resultsCount=()=>f,p.resetResultsCount=()=>{f=0},p}var bq=class{constructor(e){this.value=e}deref(){return this.value}},xq=typeof WeakRef<"u"?WeakRef:bq,Sq=0,LT=1;function Ad(){return{s:Sq,v:void 0,o:null,p:null}}function oj(e,t={}){let n=Ad();const{resultEqualityCheck:s}=t;let i,a=0;function c(){let f=n;const{length:d}=arguments;for(let y=0,b=d;y<b;y++){const x=arguments[y];if(typeof x=="function"||typeof x=="object"&&x!==null){let S=f.o;S===null&&(f.o=S=new WeakMap);const w=S.get(x);w===void 0?(f=Ad(),S.set(x,f)):f=w}else{let S=f.p;S===null&&(f.p=S=new Map);const w=S.get(x);w===void 0?(f=Ad(),S.set(x,f)):f=w}}const p=f;let g;if(f.s===LT)g=f.v;else if(g=e.apply(null,arguments),a++,s){const y=i?.deref?.()??i;y!=null&&s(y,g)&&(g=y,a!==0&&a--),i=typeof g=="object"&&g!==null||typeof g=="function"?new xq(g):g}return p.s=LT,p.v=g,g}return c.clearCache=()=>{n=Ad(),c.resetResultsCount()},c.resultsCount=()=>a,c.resetResultsCount=()=>{a=0},c}function ij(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,s=(...i)=>{let a=0,c=0,f,d={},p=i.pop();typeof p=="object"&&(d=p,p=i.pop()),cq(p,`createSelector expects an output function after the inputs, but received: [${typeof p}]`);const g={...n,...d},{memoize:y,memoizeOptions:b=[],argsMemoize:x=oj,argsMemoizeOptions:S=[]}=g,w=zT(b),T=zT(S),C=dq(i),A=y(function(){return a++,p.apply(null,arguments)},...w),N=x(function(){c++;const k=hq(C,arguments);return f=A.apply(null,k),f},...T);return Object.assign(N,{resultFunc:p,memoizedResultFunc:A,dependencies:C,dependencyRecomputations:()=>c,resetDependencyRecomputations:()=>{c=0},lastResult:()=>f,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:y,argsMemoize:x})};return Object.assign(s,{withTypes:()=>s}),s}var _q=ij(oj),wq=Object.assign((e,t=_q)=>{uq(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),s=n.map(a=>e[a]);return t(s,(...a)=>a.reduce((c,f,d)=>(c[n[d]]=f,c),{}))},{withTypes:()=>wq});function Ph(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}var by={},xy={},Sy={},UT;function Eq(){return UT||(UT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,s,{signal:i,edges:a}={}){let c,f=null;const d=a!=null&&a.includes("leading"),p=a==null||a.includes("trailing"),g=()=>{f!==null&&(n.apply(c,f),c=void 0,f=null)},y=()=>{p&&g(),w()};let b=null;const x=()=>{b!=null&&clearTimeout(b),b=setTimeout(()=>{b=null,y()},s)},S=()=>{b!==null&&(clearTimeout(b),b=null)},w=()=>{S(),c=void 0,f=null},T=()=>{g()},C=function(...A){if(i?.aborted)return;c=this,f=A;const N=b==null;x(),d&&N&&g()};return C.schedule=x,C.cancel=w,C.flush=T,i?.addEventListener("abort",w,{once:!0}),C}e.debounce=t})(Sy)),Sy}var $T;function Tq(){return $T||($T=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Eq();function n(s,i=0,a={}){typeof a!="object"&&(a={});const{leading:c=!1,trailing:f=!0,maxWait:d}=a,p=Array(2);c&&(p[0]="leading"),f&&(p[1]="trailing");let g,y=null;const b=t.debounce(function(...w){g=s.apply(this,w),y=null},i,{edges:p}),x=function(...w){return d!=null&&(y===null&&(y=Date.now()),Date.now()-y>=d)?(g=s.apply(this,w),y=Date.now(),b.cancel(),b.schedule(),g):(b.apply(this,w),g)},S=()=>(b.flush(),g);return x.cancel=b.cancel,x.flush=S,x}e.debounce=n})(xy)),xy}var BT;function Cq(){return BT||(BT=1,(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Tq();function n(s,i=0,a={}){const{leading:c=!0,trailing:f=!0}=a;return t.debounce(s,i,{leading:c,maxWait:i,trailing:f})}e.throttle=n})(by)),by}var _y,FT;function Rq(){return FT||(FT=1,_y=Cq().throttle),_y}var Nq=Rq();const jq=P1(Nq);var HT=function(t,n){for(var s=arguments.length,i=new Array(s>2?s-2:0),a=2;a<s;a++)i[a-2]=arguments[a];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 c=0;console.warn(n.replace(/%s/g,()=>i[c++]))}},gs={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},aj=(e,t,n)=>{var{width:s=gs.width,height:i=gs.height,aspect:a,maxHeight:c}=n,f=Ih(s)?e:Number(s),d=Ih(i)?t:Number(i);return a&&a>0&&(f?d=f/a:d&&(f=d*a),c&&d!=null&&d>c&&(d=c)),{calculatedWidth:f,calculatedHeight:d}},Aq={width:0,height:0,overflow:"visible"},Oq={width:0,overflowX:"visible"},Mq={height:0,overflowY:"visible"},kq={},Iq=e=>{var{width:t,height:n}=e,s=Ih(t),i=Ih(n);return s&&i?Aq:s?Oq:i?Mq:kq};function Dq(e){var{width:t,height:n,aspect:s}=e,i=t,a=n;return i===void 0&&a===void 0?(i=gs.width,a=gs.height):i===void 0?i=s&&s>0?void 0:gs.width:a===void 0&&(a=s&&s>0?void 0:gs.height),{width:i,height:a}}function Ev(){return Ev=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Ev.apply(null,arguments)}function qT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,s)}return n}function VT(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qT(Object(n),!0).forEach(function(s){Pq(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qT(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function Pq(e,t,n){return(t=zq(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function zq(e){var t=Lq(e,"string");return typeof t=="symbol"?t:t+""}function Lq(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var lj=_.createContext(gs.initialDimension);function Uq(e){return Ph(e.width)&&Ph(e.height)}function cj(e){var{children:t,width:n,height:s}=e,i=_.useMemo(()=>({width:n,height:s}),[n,s]);return Uq(i)?_.createElement(lj.Provider,{value:i},t):null}var $q=()=>_.useContext(lj),Bq=_.forwardRef((e,t)=>{var{aspect:n,initialDimension:s=gs.initialDimension,width:i,height:a,minWidth:c=gs.minWidth,minHeight:f,maxHeight:d,children:p,debounce:g=gs.debounce,id:y,className:b,onResize:x,style:S={}}=e,w=_.useRef(null),T=_.useRef();T.current=x,_.useImperativeHandle(t,()=>w.current);var[C,A]=_.useState({containerWidth:s.width,containerHeight:s.height}),N=_.useCallback((O,D)=>{A(K=>{var F=Math.round(O),z=Math.round(D);return K.containerWidth===F&&K.containerHeight===z?K:{containerWidth:F,containerHeight:z}})},[]);_.useEffect(()=>{if(w.current==null||typeof ResizeObserver>"u")return lq;var O=z=>{var X,Y=z[0];if(Y!=null){var{width:te,height:P}=Y.contentRect;N(te,P),(X=T.current)===null||X===void 0||X.call(T,te,P)}};g>0&&(O=jq(O,g,{trailing:!0,leading:!1}));var D=new ResizeObserver(O),{width:K,height:F}=w.current.getBoundingClientRect();return N(K,F),D.observe(w.current),()=>{D.disconnect()}},[N,g]);var{containerWidth:R,containerHeight:k}=C;HT(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:L,calculatedHeight:j}=aj(R,k,{width:i,height:a,aspect:n,maxHeight:d});return HT(L!=null&&L>0||j!=null&&j>0,`The width(%s) and height(%s) of chart should be greater than 0,
|
|
68
|
+
please check the style of container, or the props width(%s) and height(%s),
|
|
69
|
+
or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
|
|
70
|
+
height and width.`,L,j,i,a,c,f,n),_.createElement("div",{id:y?"".concat(y):void 0,className:Hb("recharts-responsive-container",b),style:VT(VT({},S),{},{width:i,height:a,minWidth:c,minHeight:f,maxHeight:d}),ref:w},_.createElement("div",{style:Iq({width:i,height:a})},_.createElement(cj,{width:L,height:j},p)))}),Fq=_.forwardRef((e,t)=>{var n=$q();if(Ph(n.width)&&Ph(n.height))return e.children;var{width:s,height:i}=Dq({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:c}=aj(void 0,void 0,{width:s,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return PT(a)&&PT(c)?_.createElement(cj,{width:a,height:c},e.children):_.createElement(Bq,Ev({},e,{width:s,height:i,ref:t}))});const Hq=(e,t)=>{const n=new Array(e.length+t.length);for(let s=0;s<e.length;s++)n[s]=e[s];for(let s=0;s<t.length;s++)n[e.length+s]=t[s];return n},qq=(e,t)=>({classGroupId:e,validator:t}),uj=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),zh="-",KT=[],Vq="arbitrary..",Kq=e=>{const t=Zq(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return Gq(c);const f=c.split(zh),d=f[0]===""&&f.length>1?1:0;return fj(f,d,t)},getConflictingClassGroupIds:(c,f)=>{if(f){const d=s[c],p=n[c];return d?p?Hq(p,d):d:p||KT}return n[c]||KT}}},fj=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const i=e[t],a=n.nextPart.get(i);if(a){const p=fj(e,t+1,a);if(p)return p}const c=n.validators;if(c===null)return;const f=t===0?e.join(zh):e.slice(t).join(zh),d=c.length;for(let p=0;p<d;p++){const g=c[p];if(g.validator(f))return g.classGroupId}},Gq=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),s=t.slice(0,n);return s?Vq+s:void 0})(),Zq=e=>{const{theme:t,classGroups:n}=e;return Yq(n,t)},Yq=(e,t)=>{const n=uj();for(const s in e){const i=e[s];qb(i,n,s,t)}return n},qb=(e,t,n,s)=>{const i=e.length;for(let a=0;a<i;a++){const c=e[a];Xq(c,t,n,s)}},Xq=(e,t,n,s)=>{if(typeof e=="string"){Qq(e,t,n);return}if(typeof e=="function"){Wq(e,t,n,s);return}Jq(e,t,n,s)},Qq=(e,t,n)=>{const s=e===""?t:dj(t,e);s.classGroupId=n},Wq=(e,t,n,s)=>{if(e9(e)){qb(e(s),t,n,s);return}t.validators===null&&(t.validators=[]),t.validators.push(qq(n,e))},Jq=(e,t,n,s)=>{const i=Object.entries(e),a=i.length;for(let c=0;c<a;c++){const[f,d]=i[c];qb(d,dj(t,f),n,s)}},dj=(e,t)=>{let n=e;const s=t.split(zh),i=s.length;for(let a=0;a<i;a++){const c=s[a];let f=n.nextPart.get(c);f||(f=uj(),n.nextPart.set(c,f)),n=f}return n},e9=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,t9=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),s=Object.create(null);const i=(a,c)=>{n[a]=c,t++,t>e&&(t=0,s=n,n=Object.create(null))};return{get(a){let c=n[a];if(c!==void 0)return c;if((c=s[a])!==void 0)return i(a,c),c},set(a,c){a in n?n[a]=c:i(a,c)}}},Tv="!",GT=":",n9=[],ZT=(e,t,n,s,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:s,isExternal:i}),r9=e=>{const{prefix:t,experimentalParseClassName:n}=e;let s=i=>{const a=[];let c=0,f=0,d=0,p;const g=i.length;for(let w=0;w<g;w++){const T=i[w];if(c===0&&f===0){if(T===GT){a.push(i.slice(d,w)),d=w+1;continue}if(T==="/"){p=w;continue}}T==="["?c++:T==="]"?c--:T==="("?f++:T===")"&&f--}const y=a.length===0?i:i.slice(d);let b=y,x=!1;y.endsWith(Tv)?(b=y.slice(0,-1),x=!0):y.startsWith(Tv)&&(b=y.slice(1),x=!0);const S=p&&p>d?p-d:void 0;return ZT(a,x,b,S)};if(t){const i=t+GT,a=s;s=c=>c.startsWith(i)?a(c.slice(i.length)):ZT(n9,!1,c,void 0,!0)}if(n){const i=s;s=a=>n({className:a,parseClassName:i})}return s},s9=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,s)=>{t.set(n,1e6+s)}),n=>{const s=[];let i=[];for(let a=0;a<n.length;a++){const c=n[a],f=c[0]==="[",d=t.has(c);f||d?(i.length>0&&(i.sort(),s.push(...i),i=[]),s.push(c)):i.push(c)}return i.length>0&&(i.sort(),s.push(...i)),s}},o9=e=>({cache:t9(e.cacheSize),parseClassName:r9(e),sortModifiers:s9(e),...Kq(e)}),i9=/\s+/,a9=(e,t)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:i,sortModifiers:a}=t,c=[],f=e.trim().split(i9);let d="";for(let p=f.length-1;p>=0;p-=1){const g=f[p],{isExternal:y,modifiers:b,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:w}=n(g);if(y){d=g+(d.length>0?" "+d:d);continue}let T=!!w,C=s(T?S.substring(0,w):S);if(!C){if(!T){d=g+(d.length>0?" "+d:d);continue}if(C=s(S),!C){d=g+(d.length>0?" "+d:d);continue}T=!1}const A=b.length===0?"":b.length===1?b[0]:a(b).join(":"),N=x?A+Tv:A,R=N+C;if(c.indexOf(R)>-1)continue;c.push(R);const k=i(C,T);for(let L=0;L<k.length;++L){const j=k[L];c.push(N+j)}d=g+(d.length>0?" "+d:d)}return d},l9=(...e)=>{let t=0,n,s,i="";for(;t<e.length;)(n=e[t++])&&(s=hj(n))&&(i&&(i+=" "),i+=s);return i},hj=e=>{if(typeof e=="string")return e;let t,n="";for(let s=0;s<e.length;s++)e[s]&&(t=hj(e[s]))&&(n&&(n+=" "),n+=t);return n},c9=(e,...t)=>{let n,s,i,a;const c=d=>{const p=t.reduce((g,y)=>y(g),e());return n=o9(p),s=n.cache.get,i=n.cache.set,a=f,f(d)},f=d=>{const p=s(d);if(p)return p;const g=a9(d,n);return i(d,g),g};return a=c,(...d)=>a(l9(...d))},u9=[],cn=e=>{const t=n=>n[e]||u9;return t.isThemeGetter=!0,t},pj=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,mj=/^\((?:(\w[\w-]*):)?(.+)\)$/i,f9=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,d9=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,h9=/\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$/,p9=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,m9=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,g9=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Do=e=>f9.test(e),Qe=e=>!!e&&!Number.isNaN(Number(e)),Po=e=>!!e&&Number.isInteger(Number(e)),wy=e=>e.endsWith("%")&&Qe(e.slice(0,-1)),$s=e=>d9.test(e),gj=()=>!0,y9=e=>h9.test(e)&&!p9.test(e),Vb=()=>!1,v9=e=>m9.test(e),b9=e=>g9.test(e),x9=e=>!Ne(e)&&!je(e),S9=e=>fi(e,bj,Vb),Ne=e=>pj.test(e),$i=e=>fi(e,xj,y9),YT=e=>fi(e,j9,Qe),_9=e=>fi(e,_j,gj),w9=e=>fi(e,Sj,Vb),XT=e=>fi(e,yj,Vb),E9=e=>fi(e,vj,b9),Od=e=>fi(e,wj,v9),je=e=>mj.test(e),nu=e=>ma(e,xj),T9=e=>ma(e,Sj),QT=e=>ma(e,yj),C9=e=>ma(e,bj),R9=e=>ma(e,vj),Md=e=>ma(e,wj,!0),N9=e=>ma(e,_j,!0),fi=(e,t,n)=>{const s=pj.exec(e);return s?s[1]?t(s[1]):n(s[2]):!1},ma=(e,t,n=!1)=>{const s=mj.exec(e);return s?s[1]?t(s[1]):n:!1},yj=e=>e==="position"||e==="percentage",vj=e=>e==="image"||e==="url",bj=e=>e==="length"||e==="size"||e==="bg-size",xj=e=>e==="length",j9=e=>e==="number",Sj=e=>e==="family-name",_j=e=>e==="number"||e==="weight",wj=e=>e==="shadow",A9=()=>{const e=cn("color"),t=cn("font"),n=cn("text"),s=cn("font-weight"),i=cn("tracking"),a=cn("leading"),c=cn("breakpoint"),f=cn("container"),d=cn("spacing"),p=cn("radius"),g=cn("shadow"),y=cn("inset-shadow"),b=cn("text-shadow"),x=cn("drop-shadow"),S=cn("blur"),w=cn("perspective"),T=cn("aspect"),C=cn("ease"),A=cn("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],R=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...R(),je,Ne],L=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto","contain","none"],O=()=>[je,Ne,d],D=()=>[Do,"full","auto",...O()],K=()=>[Po,"none","subgrid",je,Ne],F=()=>["auto",{span:["full",Po,je,Ne]},Po,je,Ne],z=()=>[Po,"auto",je,Ne],X=()=>["auto","min","max","fr",je,Ne],Y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],te=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...O()],V=()=>[Do,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...O()],B=()=>[Do,"screen","full","dvw","lvw","svw","min","max","fit",...O()],q=()=>[Do,"screen","full","lh","dvh","lvh","svh","min","max","fit",...O()],U=()=>[e,je,Ne],I=()=>[...R(),QT,XT,{position:[je,Ne]}],G=()=>["no-repeat",{repeat:["","x","y","space","round"]}],W=()=>["auto","cover","contain",C9,S9,{size:[je,Ne]}],Q=()=>[wy,nu,$i],se=()=>["","none","full",p,je,Ne],oe=()=>["",Qe,nu,$i],pe=()=>["solid","dashed","dotted","double"],Se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],he=()=>[Qe,wy,QT,XT],He=()=>["","none",S,je,Ne],Ee=()=>["none",Qe,je,Ne],re=()=>["none",Qe,je,Ne],de=()=>[Qe,je,Ne],ae=()=>[Do,"full",...O()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$s],breakpoint:[$s],color:[gj],container:[$s],"drop-shadow":[$s],ease:["in","out","in-out"],font:[x9],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$s],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$s],shadow:[$s],spacing:["px",Qe],text:[$s],"text-shadow":[$s],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Do,Ne,je,T]}],container:["container"],columns:[{columns:[Qe,Ne,je,f]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"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:L()}],"overflow-x":[{"overflow-x":L()}],"overflow-y":[{"overflow-y":L()}],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:[Po,"auto",je,Ne]}],basis:[{basis:[Do,"full","auto",f,...O()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Qe,Do,"auto","initial","none",Ne]}],grow:[{grow:["",Qe,je,Ne]}],shrink:[{shrink:["",Qe,je,Ne]}],order:[{order:[Po,"first","last","none",je,Ne]}],"grid-cols":[{"grid-cols":K()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":K()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":X()}],"auto-rows":[{"auto-rows":X()}],gap:[{gap:O()}],"gap-x":[{"gap-x":O()}],"gap-y":[{"gap-y":O()}],"justify-content":[{justify:[...Y(),"normal"]}],"justify-items":[{"justify-items":[...te(),"normal"]}],"justify-self":[{"justify-self":["auto",...te()]}],"align-content":[{content:["normal",...Y()]}],"align-items":[{items:[...te(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...te(),{baseline:["","last"]}]}],"place-content":[{"place-content":Y()}],"place-items":[{"place-items":[...te(),"baseline"]}],"place-self":[{"place-self":["auto",...te()]}],p:[{p:O()}],px:[{px:O()}],py:[{py:O()}],ps:[{ps:O()}],pe:[{pe:O()}],pbs:[{pbs:O()}],pbe:[{pbe:O()}],pt:[{pt:O()}],pr:[{pr:O()}],pb:[{pb:O()}],pl:[{pl:O()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mbs:[{mbs:P()}],mbe:[{mbe:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":O()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":O()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],"inline-size":[{inline:["auto",...B()]}],"min-inline-size":[{"min-inline":["auto",...B()]}],"max-inline-size":[{"max-inline":["none",...B()]}],"block-size":[{block:["auto",...q()]}],"min-block-size":[{"min-block":["auto",...q()]}],"max-block-size":[{"max-block":["none",...q()]}],w:[{w:[f,"screen",...V()]}],"min-w":[{"min-w":[f,"screen","none",...V()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[c]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",n,nu,$i]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,N9,_9]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",wy,Ne]}],"font-family":[{font:[T9,w9,t]}],"font-features":[{"font-features":[Ne]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,je,Ne]}],"line-clamp":[{"line-clamp":[Qe,"none",je,YT]}],leading:[{leading:[a,...O()]}],"list-image":[{"list-image":["none",je,Ne]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",je,Ne]}],"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:[...pe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Qe,"from-font","auto",je,$i]}],"text-decoration-color":[{decoration:U()}],"underline-offset":[{"underline-offset":[Qe,"auto",je,Ne]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",je,Ne]}],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",je,Ne]}],"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:G()}],"bg-size":[{bg:W()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Po,je,Ne],radial:["",je,Ne],conic:[Po,je,Ne]},R9,E9]}],"bg-color":[{bg:U()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"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:oe()}],"border-w-x":[{"border-x":oe()}],"border-w-y":[{"border-y":oe()}],"border-w-s":[{"border-s":oe()}],"border-w-e":[{"border-e":oe()}],"border-w-bs":[{"border-bs":oe()}],"border-w-be":[{"border-be":oe()}],"border-w-t":[{"border-t":oe()}],"border-w-r":[{"border-r":oe()}],"border-w-b":[{"border-b":oe()}],"border-w-l":[{"border-l":oe()}],"divide-x":[{"divide-x":oe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":oe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...pe(),"hidden","none"]}],"divide-style":[{divide:[...pe(),"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:[...pe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Qe,je,Ne]}],"outline-w":[{outline:["",Qe,nu,$i]}],"outline-color":[{outline:U()}],shadow:[{shadow:["","none",g,Md,Od]}],"shadow-color":[{shadow:U()}],"inset-shadow":[{"inset-shadow":["none",y,Md,Od]}],"inset-shadow-color":[{"inset-shadow":U()}],"ring-w":[{ring:oe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:U()}],"ring-offset-w":[{"ring-offset":[Qe,$i]}],"ring-offset-color":[{"ring-offset":U()}],"inset-ring-w":[{"inset-ring":oe()}],"inset-ring-color":[{"inset-ring":U()}],"text-shadow":[{"text-shadow":["none",b,Md,Od]}],"text-shadow-color":[{"text-shadow":U()}],opacity:[{opacity:[Qe,je,Ne]}],"mix-blend":[{"mix-blend":[...Se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Se()}],"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":[Qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"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":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"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":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"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":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"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":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"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":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"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":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"mask-image-y-from-color":[{"mask-y-from":U()}],"mask-image-y-to-color":[{"mask-y-to":U()}],"mask-image-radial":[{"mask-radial":[je,Ne]}],"mask-image-radial-from-pos":[{"mask-radial-from":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"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":R()}],"mask-image-conic-pos":[{"mask-conic":[Qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"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:G()}],"mask-size":[{mask:W()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",je,Ne]}],filter:[{filter:["","none",je,Ne]}],blur:[{blur:He()}],brightness:[{brightness:[Qe,je,Ne]}],contrast:[{contrast:[Qe,je,Ne]}],"drop-shadow":[{"drop-shadow":["","none",x,Md,Od]}],"drop-shadow-color":[{"drop-shadow":U()}],grayscale:[{grayscale:["",Qe,je,Ne]}],"hue-rotate":[{"hue-rotate":[Qe,je,Ne]}],invert:[{invert:["",Qe,je,Ne]}],saturate:[{saturate:[Qe,je,Ne]}],sepia:[{sepia:["",Qe,je,Ne]}],"backdrop-filter":[{"backdrop-filter":["","none",je,Ne]}],"backdrop-blur":[{"backdrop-blur":He()}],"backdrop-brightness":[{"backdrop-brightness":[Qe,je,Ne]}],"backdrop-contrast":[{"backdrop-contrast":[Qe,je,Ne]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Qe,je,Ne]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Qe,je,Ne]}],"backdrop-invert":[{"backdrop-invert":["",Qe,je,Ne]}],"backdrop-opacity":[{"backdrop-opacity":[Qe,je,Ne]}],"backdrop-saturate":[{"backdrop-saturate":[Qe,je,Ne]}],"backdrop-sepia":[{"backdrop-sepia":["",Qe,je,Ne]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":O()}],"border-spacing-x":[{"border-spacing-x":O()}],"border-spacing-y":[{"border-spacing-y":O()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",je,Ne]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Qe,"initial",je,Ne]}],ease:[{ease:["linear","initial",C,je,Ne]}],delay:[{delay:[Qe,je,Ne]}],animate:[{animate:["none",A,je,Ne]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,je,Ne]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:Ee()}],"rotate-x":[{"rotate-x":Ee()}],"rotate-y":[{"rotate-y":Ee()}],"rotate-z":[{"rotate-z":Ee()}],scale:[{scale:re()}],"scale-x":[{"scale-x":re()}],"scale-y":[{"scale-y":re()}],"scale-z":[{"scale-z":re()}],"scale-3d":["scale-3d"],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[je,Ne,"","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",je,Ne]}],"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":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mbs":[{"scroll-mbs":O()}],"scroll-mbe":[{"scroll-mbe":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pbs":[{"scroll-pbs":O()}],"scroll-pbe":[{"scroll-pbe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"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",je,Ne]}],fill:[{fill:["none",...U()]}],"stroke-w":[{stroke:[Qe,nu,$i,YT]}],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"]}},O9=c9(A9);function ge(...e){return O9(Hb(e))}const M9={light:"",dark:".dark"},Ej=_.createContext(null);function k9(){const e=_.useContext(Ej);if(!e)throw new Error("useChart must be used within a <ChartContainer />");return e}const I9=_.forwardRef(({id:e,className:t,children:n,config:s,...i},a)=>{const c=_.useId(),f=`chart-${e||c.replace(/:/g,"")}`;return h.jsx(Ej.Provider,{value:{config:s},children:h.jsxs("div",{className:ge("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:a,...i,children:[h.jsx(D9,{config:s,id:f}),h.jsx(Fq,{initialDimension:{width:1,height:1},children:n})]})})});I9.displayName="ChartContainer";function D9({config:e,id:t}){const n=Object.entries(e).filter(([,s])=>s.theme||s.color);return n.length<1?null:h.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(M9).map(([s,i])=>{const a=n.map(([c,f])=>{const d=f.theme?.[s]??f.color;return d?` --color-${c}: ${d};`:null}).filter(Boolean).join(`
|
|
71
|
+
`);return`${i} [data-chart='${t}'] {
|
|
72
|
+
${a}
|
|
73
|
+
}`}).join(`
|
|
74
|
+
`)}})}const P9=_.forwardRef(({active:e,className:t,color:n,formatter:s,hideIndicator:i=!1,hideLabel:a=!1,indicator:c="dot",label:f,labelClassName:d,labelFormatter:p,labelKey:g,nameKey:y,payload:b},x)=>{const{config:S}=k9(),w=_.useMemo(()=>{if(a||!b?.length)return null;const C=b[0];if(!C)return null;const A=`${g||C.dataKey||C.name||"value"}`,N=WT(S,C,A),R=!g&&typeof f=="string"?S[f]?.label??f:N?.label;return p?h.jsx("div",{className:ge("font-medium",d),children:p(R??"",b)}):R?h.jsx("div",{className:ge("font-medium",d),children:R}):null},[S,a,f,d,p,g,b]);if(!e||!b?.length)return null;const T=b.length===1&&c!=="dot";return h.jsxs("div",{className:ge("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:w,h.jsx("div",{className:"grid gap-1.5",children:b.map((C,A)=>{const N=`${y||C.name||C.dataKey||"value"}`,R=WT(S,C,N),k=n||C.payload?.fill||C.color;return h.jsx("div",{className:ge("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-neutral-500",c==="dot"?"items-center":null),children:s&&C.value!==void 0&&C.name?s(C.value,C.name,C,A,C.payload??{}):h.jsxs(h.Fragment,{children:[R?.icon?h.jsx(R.icon,{}):i?null:h.jsx("div",{className:ge("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",c==="dot"?"h-2.5 w-2.5":null,c==="line"?"w-1":null,c==="dashed"?"w-0 border-[1.5px] border-dashed bg-transparent":null,T&&c==="dashed"?"my-0.5":null),style:{"--color-bg":k,"--color-border":k}}),h.jsxs("div",{className:ge("flex flex-1 justify-between leading-none",T?"items-end":"items-center"),children:[h.jsxs("div",{className:"grid gap-1.5",children:[T?w:null,h.jsx("span",{className:"text-neutral-500",children:R?.label||C.name})]}),C.value!==void 0?h.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:typeof C.value=="number"?C.value.toLocaleString():C.value}):null]})]})},N)})})]})});P9.displayName="ChartTooltipContent";function WT(e,t,n){const s=t.payload?.[n],i=typeof s=="string"?s:null,a=typeof t.dataKey=="string"?t.dataKey:null,c=typeof t.name=="string"?t.name:null;return e[i??a??c??n]}const z9=["1h","6h","24h","7d"],Tj=_.forwardRef(({className:e,bars:t,activeRange:n="1h",onRangeChange:s,startLabel:i="-1h",midLabel:a="-30m",endLabel:c="now",...f},d)=>h.jsxs("div",{ref:d,className:ge("px-5 pt-4 pb-3 border-b border-border",e),...f,children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Activity"}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-sm bg-healthy/70"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Push"})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-sm bg-flow/70"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Pull"})]}),h.jsx("div",{className:"flex gap-0.5 ml-2",children:z9.map(p=>h.jsx("button",{type:"button",onClick:()=>s?.(p),className:ge("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))})]})]}),h.jsx("div",{className:"flex items-end gap-[2px] h-16",children:t.map((p,g)=>h.jsxs("div",{className:"flex-1 flex flex-col gap-[1px] h-16 justify-end",children:[h.jsx("div",{className:"bg-flow/60 rounded-t-sm min-h-[2px]",style:{height:`${p.pullPercent}%`}}),h.jsx("div",{className:"bg-healthy/60 rounded-t-sm min-h-[2px]",style:{height:`${p.pushPercent}%`}})]},g))}),h.jsxs("div",{className:"flex justify-between mt-1.5",children:[h.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:i}),h.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:a}),h.jsx("span",{className:"font-mono text-[8px] text-neutral-600",children:c})]})]}));Tj.displayName="ActivityBars";const JT=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,eC=Hb,di=(e,t)=>n=>{var s;if(t?.variants==null)return eC(e,n?.class,n?.className);const{variants:i,defaultVariants:a}=t,c=Object.keys(i).map(p=>{const g=n?.[p],y=a?.[p];if(g===null)return null;const b=JT(g)||JT(y);return i[p][b]}),f=n&&Object.entries(n).reduce((p,g)=>{let[y,b]=g;return b===void 0||(p[y]=b),p},{}),d=t==null||(s=t.compoundVariants)===null||s===void 0?void 0:s.reduce((p,g)=>{let{class:y,className:b,...x}=g;return Object.entries(x).every(S=>{let[w,T]=S;return Array.isArray(T)?T.includes({...a,...f}[w]):{...a,...f}[w]===T})?[...p,y,b]:p},[]);return eC(e,c,d,n?.class,n?.className)},L9=di("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"}}),Hn=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx("input",{ref:s,className:ge(L9({variant:t,className:e})),...n}));Hn.displayName="Input";function dp({controlled:e,default:t,name:n,state:s="value"}){const{current:i}=_.useRef(e!==void 0),[a,c]=_.useState(t),f=i?e:a,d=_.useCallback(p=>{i||c(p)},[]);return[f,d]}const tC={};function In(e,t){const n=_.useRef(tC);return n.current===tC&&(n.current=e(t)),n}const Ey=z1[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],U9=Ey&&Ey!==_.useLayoutEffect?Ey:e=>e();function Ae(e){const t=In($9).current;return t.next=e,U9(t.effect),t.trampoline}function $9(){const e={next:void 0,callback:B9,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function B9(){}function to(e,t,n,s){const i=In(Cj).current;return H9(i,e,t,n,s)&&Rj(i,[e,t,n,s]),i.callback}function F9(e){const t=In(Cj).current;return q9(t,e)&&Rj(t,e),t.callback}function Cj(){return{callback:null,cleanup:null,refs:[]}}function H9(e,t,n,s,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==s||e.refs[3]!==i}function q9(e,t){return e.refs.length!==t.length||e.refs.some((n,s)=>n!==t[s])}function Rj(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 s=Array(t.length).fill(null);for(let i=0;i<t.length;i+=1){const a=t[i];if(a!=null)switch(typeof a){case"function":{const c=a(n);typeof c=="function"&&(s[i]=c);break}case"object":{a.current=n;break}}}e.cleanup=()=>{for(let i=0;i<t.length;i+=1){const a=t[i];if(a!=null)switch(typeof a){case"function":{const c=s[i];typeof c=="function"?c():a(null);break}case"object":{a.current=null;break}}}}}}}const V9=()=>{},ze=typeof document<"u"?_.useLayoutEffect:V9,Nj={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},hp={...Nj,position:"fixed",top:0,left:0},jj={...Nj,position:"absolute"};function Cn(){}const Tu=Object.freeze([]),rn=Object.freeze({});function pn(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(s=>n.searchParams.append("args[]",s)),`Base UI error #${e}; visit ${n} for the full message.`}const K9=parseInt(_.version,10);function Kb(e){return K9>=e}function nC(e){if(!_.isValidElement(e))return null;const t=e,n=t.props;return(Kb(19)?n?.ref:t.ref)??null}function Cv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}function G9(e,t){const n={};for(const s in e){const i=e[s];if(t?.hasOwnProperty(s)){const a=t[s](i);a!=null&&Object.assign(n,a);continue}i===!0?n[`data-${s.toLowerCase()}`]="":i&&(n[`data-${s.toLowerCase()}`]=i.toString())}return n}function Z9(e,t){return typeof e=="function"?e(t):e}function Y9(e,t){return typeof e=="function"?e(t):e}const uu={};function ni(e,t,n,s,i){let a={...Rv(e,uu)};return t&&(a=iu(a,t)),n&&(a=iu(a,n)),s&&(a=iu(a,s)),i&&(a=iu(a,i)),a}function X9(e){if(e.length===0)return uu;if(e.length===1)return Rv(e[0],uu);let t={...Rv(e[0],uu)};for(let n=1;n<e.length;n+=1)t=iu(t,e[n]);return t}function iu(e,t){return Aj(t)?t(e):Q9(e,t)}function Q9(e,t){if(!t)return e;for(const n in t){const s=t[n];switch(n){case"style":{e[n]=Cv(e.style,s);break}case"className":{e[n]=Oj(e.className,s);break}default:W9(n,s)?e[n]=J9(e[n],s):e[n]=s}}return e}function W9(e,t){const n=e.charCodeAt(0),s=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&s===110&&i>=65&&i<=90&&(typeof t=="function"||typeof t>"u")}function Aj(e){return typeof e=="function"}function Rv(e,t){return Aj(e)?e(t):e??uu}function J9(e,t){return t?e?n=>{if(e8(n)){const i=n;Nv(i);const a=t(i);return i.baseUIHandlerPrevented||e?.(i),a}const s=t(n);return e?.(n),s}:t:e}function Nv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Oj(e,t){return t?e?t+" "+e:t:e}function e8(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}const t8={style:{transition:"none"}},n8="data-base-ui-click-trigger",r8={fallbackAxisSide:"none"},s8={fallbackAxisSide:"end"},o8={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Pt(e,t,n={}){const s=t.render,i=i8(t,n);if(n.enabled===!1)return null;const a=n.state??rn;return l8(e,s,i,a)}function i8(e,t={}){const{className:n,style:s,render:i}=e,{state:a=rn,ref:c,props:f,stateAttributesMapping:d,enabled:p=!0}=t,g=p?Z9(n,a):void 0,y=p?Y9(s,a):void 0,b=p?G9(a,d):rn,x=p?Cv(b,Array.isArray(f)?X9(f):f)??rn:rn;return typeof document<"u"&&(p?Array.isArray(c)?x.ref=F9([x.ref,nC(i),...c]):x.ref=to(x.ref,nC(i),c):to(null,null)),p?(g!==void 0&&(x.className=Oj(x.className,g)),y!==void 0&&(x.style=Cv(x.style,y)),x):rn}const a8=Symbol.for("react.lazy");function l8(e,t,n,s){if(t){if(typeof t=="function")return t(n,s);const i=ni(n,t.props);i.ref=n.ref;let a=t;return a?.$$typeof===a8&&(a=_.Children.toArray(t)[0]),_.cloneElement(a,i)}if(e&&typeof e=="string")return c8(e,n);throw new Error(pn(8))}function c8(e,t){return e==="button"?_.createElement("button",{type:"button",...t,key:t.key}):e==="img"?_.createElement("img",{alt:"",...t,key:t.key}):_.createElement(e,t)}const u8={...z1};let rC=0;function f8(e,t="mui"){const[n,s]=_.useState(e),i=e||n;return _.useEffect(()=>{n==null&&(rC+=1,s(`${t}-${rC}`))},[n,t]),i}const sC=u8.useId;function Gu(e,t){if(sC!==void 0){const n=sC();return e??(t?`${t}-${n}`:n)}return f8(e,t)}function pr(e){return Gu(e,"base-ui")}function pp(){return typeof window<"u"}function hi(e){return Gb(e)?(e.nodeName||"").toLowerCase():"#document"}function an(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function bs(e){var t;return(t=(Gb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Gb(e){return pp()?e instanceof Node||e instanceof an(e).Node:!1}function jt(e){return pp()?e instanceof Element||e instanceof an(e).Element:!1}function Vt(e){return pp()?e instanceof HTMLElement||e instanceof an(e).HTMLElement:!1}function jv(e){return!pp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof an(e).ShadowRoot}const d8=new Set(["inline","contents"]);function pi(e){const{overflow:t,overflowX:n,overflowY:s,display:i}=mr(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!d8.has(i)}const h8=new Set(["table","td","th"]);function p8(e){return h8.has(hi(e))}const m8=[":popover-open",":modal"];function mp(e){return m8.some(t=>{try{return e.matches(t)}catch{return!1}})}const g8=["transform","translate","scale","rotate","perspective"],y8=["transform","translate","scale","rotate","perspective","filter"],v8=["paint","layout","strict","content"];function Zb(e){const t=gp(),n=jt(e)?mr(e):e;return g8.some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||y8.some(s=>(n.willChange||"").includes(s))||v8.some(s=>(n.contain||"").includes(s))}function b8(e){let t=no(e);for(;Vt(t)&&!Ks(t);){if(Zb(t))return t;if(mp(t))return null;t=no(t)}return null}function gp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const x8=new Set(["html","body","#document"]);function Ks(e){return x8.has(hi(e))}function mr(e){return an(e).getComputedStyle(e)}function yp(e){return jt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function no(e){if(hi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||jv(e)&&e.host||bs(e);return jv(t)?t.host:t}function Mj(e){const t=no(e);return Ks(t)?e.ownerDocument?e.ownerDocument.body:e.body:Vt(t)&&pi(t)?t:Mj(t)}function Yo(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Mj(e),a=i===((s=e.ownerDocument)==null?void 0:s.body),c=an(i);if(a){const f=Av(c);return t.concat(c,c.visualViewport||[],pi(i)?i:[],f&&n?Yo(f):[])}return t.concat(i,Yo(i,[],n))}function Av(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const kj=_.createContext(void 0);function Ij(e=!1){const t=_.useContext(kj);if(t===void 0&&!e)throw new Error(pn(16));return t}function S8(e){const{focusableWhenDisabled:t,disabled:n,composite:s=!1,tabIndex:i=0,isNativeButton:a}=e,c=s&&t!==!1,f=s&&t===!1;return{props:_.useMemo(()=>{const p={onKeyDown(g){n&&t&&g.key!=="Tab"&&g.preventDefault()}};return s||(p.tabIndex=i,!a&&n&&(p.tabIndex=t?i:-1)),(a&&(t||c)||!a&&n)&&(p["aria-disabled"]=n),a&&(!t||f)&&(p.disabled=n),p},[s,n,t,c,f,a,i])}}function Ql(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:s=0,native:i=!0}=e,a=_.useRef(null),c=Ij(!0)!==void 0,f=Ae(()=>{const b=a.current;return!!(b?.tagName==="A"&&b?.href)}),{props:d}=S8({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:s,isNativeButton:i}),p=_.useCallback(()=>{const b=a.current;_8(b)&&c&&t&&d.disabled===void 0&&b.disabled&&(b.disabled=!1)},[t,d.disabled,c]);ze(p,[p]);const g=_.useCallback((b={})=>{const{onClick:x,onMouseDown:S,onKeyUp:w,onKeyDown:T,onPointerDown:C,...A}=b;return ni({type:i?"button":void 0,onClick(R){if(t){R.preventDefault();return}x?.(R)},onMouseDown(R){t||S?.(R)},onKeyDown(R){if(t||(Nv(R),T?.(R)),R.baseUIHandlerPrevented)return;const k=R.target===R.currentTarget&&!i&&!f()&&!t,L=R.key==="Enter",j=R.key===" ";k&&((j||L)&&R.preventDefault(),L&&x?.(R))},onKeyUp(R){t||(Nv(R),w?.(R)),!R.baseUIHandlerPrevented&&R.target===R.currentTarget&&!i&&!t&&R.key===" "&&x?.(R)},onPointerDown(R){if(t){R.preventDefault();return}C?.(R)}},i?void 0:{role:"button"},d,A)},[t,d,i,f]),y=Ae(b=>{a.current=b,p()});return{getButtonProps:g,buttonRef:y}}function _8(e){return Vt(e)&&e.tagName==="BUTTON"}const Dj=_.createContext(void 0);function w8(){const e=_.useContext(Dj);if(e===void 0)throw new Error(pn(63));return e}let oC=(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 vp={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},mi={valid(e){return e===null?null:e?{[oC.valid]:""}:{[oC.invalid]:""}}};let iC=(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 Pj={...mi,checked(e){return e?{[iC.checked]:""}:{[iC.unchecked]:""}}};function Ov(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const E8=_.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Cn,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function Wl(){return _.useContext(E8)}const zj=_.createContext({invalid:void 0,name:void 0,validityData:{state:vp,errors:[],error:"",value:"",initialValue:null},setValidityData:Cn,disabled:void 0,touched:!1,setTouched:Cn,dirty:!1,setDirty:Cn,filled:!1,setFilled:Cn,focused:!1,setFocused:Cn,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=rn)=>e,getInputValidationProps:(e=rn)=>e,inputRef:{current:null},commit:async()=>{}}});function gi(e=!0){const t=_.useContext(zj);if(t.setValidityData===Cn&&!e)throw new Error(pn(28));return t}function Lj(e){const{enabled:t=!0,value:n,id:s,name:i,controlRef:a,commit:c}=e,{formRef:f}=Wl(),{invalid:d,markedDirtyRef:p,validityData:g,setValidityData:y}=gi(),b=Ae(e.getValue);ze(()=>{if(!t)return;let x=n;x===void 0&&(x=b()),g.initialValue===null&&x!==null&&y(S=>({...S,initialValue:x}))},[t,y,n,g.initialValue,b]),ze(()=>{!t||!s||f.current.fields.set(s,{getValue:b,name:i,controlRef:a,validityData:Ov(g,d),validate(x=!0){let S=n;S===void 0&&(S=b()),p.current=!0,x?ui.flushSync(()=>c(S)):c(S)}})},[c,a,t,f,b,s,d,p,i,g,n]),ze(()=>{const x=f.current.fields;return()=>{s&&x.delete(s)}},[f,s])}const Uj=_.createContext({controlId:void 0,registerControlId:Cn,labelId:void 0,setLabelId:Cn,messageIds:[],setMessageIds:Cn,getDescriptionProps:e=>e});function oo(){return _.useContext(Uj)}function $j(e={}){const{id:t,implicit:n=!1,controlRef:s}=e,{controlId:i,registerControlId:a}=oo(),c=pr(t),f=n?i:void 0,d=In(()=>Symbol("labelable-control")),p=_.useRef(!1),g=_.useRef(t!=null),y=Ae(()=>{!p.current||a===Cn||(p.current=!1,a(d.current,void 0))});return ze(()=>{if(a===Cn)return;let b;if(n){const x=s?.current;jt(x)&&x.closest("label")!=null?b=t??null:b=f??c}else if(t!=null)g.current=!0,b=t;else if(g.current)b=c;else{y();return}if(b===void 0){y();return}p.current=!0,a(d.current,b)},[t,s,f,a,n,c,d,y]),_.useEffect(()=>y,[y]),i??c}const ri="none",aC="trigger-press",Mv="trigger-hover",Bj="outside-press",Ty="item-press",Fj="focus-out",T8="escape-key",C8="cancel-open",R8="imperative-action",N8="window-resize";function Kt(e,t,n,s){let i=!1,a=!1;const c=s??rn;return{reason:e,event:t??new Event("base-ui"),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...c}}function Hj(e,t){const n=_.useRef(e),s=Ae(t);ze(()=>{n.current!==e&&s(n.current)},[e,s]),ze(()=>{n.current=e},[e])}const j8=_.forwardRef(function(t,n){const{checked:s,className:i,defaultChecked:a,id:c,inputRef:f,name:d,nativeButton:p=!1,onCheckedChange:g,readOnly:y=!1,required:b=!1,disabled:x=!1,render:S,uncheckedValue:w,value:T,...C}=t,{clearErrors:A}=Wl(),{state:N,setTouched:R,setDirty:k,validityData:L,setFilled:j,setFocused:O,shouldValidateOnChange:D,validationMode:K,disabled:F,name:z,validation:X}=gi(),{labelId:Y}=oo(),te=F||x,P=z??d,V=Ae(g),B=_.useRef(null),q=to(B,f,X.inputRef),U=_.useRef(null),I=pr(),G=$j({id:c,implicit:!1,controlRef:U}),W=p?void 0:G,[Q,se]=dp({controlled:s,default:!!a,name:"Switch",state:"checked"});Lj({id:I,commit:X.commit,value:Q,controlRef:U,name:P,getValue:()=>Q}),ze(()=>{B.current&&j(B.current.checked)},[B,j]),Hj(Q,()=>{A(P),k(Q!==L.initialValue),j(Q),D()?X.commit(Q):X.commit(Q,!0)});const{getButtonProps:oe,buttonRef:pe}=Ql({disabled:te,native:p}),Se={id:p?G:I,role:"switch","aria-checked":Q,"aria-readonly":y||void 0,"aria-required":b||void 0,"aria-labelledby":Y,onFocus(){te||O(!0)},onBlur(){const re=B.current;!re||te||(R(!0),O(!1),K==="onBlur"&&X.commit(re.checked))},onClick(re){y||te||(re.preventDefault(),B.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:re.shiftKey,ctrlKey:re.ctrlKey,altKey:re.altKey,metaKey:re.metaKey})))}},he=_.useMemo(()=>ni({checked:Q,disabled:te,id:W,name:P,required:b,style:P?jj:hp,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:q,onChange(re){if(re.nativeEvent.defaultPrevented)return;const de=re.target.checked,ae=Kt(ri,re.nativeEvent);V?.(de,ae),!ae.isCanceled&&se(de)},onFocus(){U.current?.focus()}},X.getInputValidationProps,T!==void 0?{value:T}:rn),[Q,te,q,W,P,V,b,se,X,T]),He=_.useMemo(()=>({...N,checked:Q,disabled:te,readOnly:y,required:b}),[N,Q,te,y,b]),Ee=Pt("span",t,{state:He,ref:[n,U,pe],props:[Se,X.getValidationProps,C,oe],stateAttributesMapping:Pj});return h.jsxs(Dj.Provider,{value:He,children:[Ee,!Q&&P&&w!==void 0&&h.jsx("input",{type:"hidden",name:P,value:w}),h.jsx("input",{...he})]})}),A8=_.forwardRef(function(t,n){const{render:s,className:i,...a}=t,{state:c}=gi(),f=w8(),d={...c,...f};return Pt("span",t,{state:d,ref:n,stateAttributesMapping:Pj,props:a})}),bp=_.forwardRef(({className:e,...t},n)=>h.jsx(j8,{ref:n,className:ge("relative w-[34px] h-[18px] bg-border-bright rounded-full cursor-pointer transition data-[checked]:bg-healthy",e),...t,children:h.jsx(A8,{className:"block w-[14px] h-[14px] bg-white rounded-full transition-transform data-[checked]:translate-x-4 absolute top-0.5 left-0.5"})}));bp.displayName="Switch";const qj=_.forwardRef(({className:e,enabled:t=!0,onEnabledChange:n,thresholds:s,onThresholdsChange:i,...a},c)=>{function f(d,p){const g=Number(p);Number.isFinite(g)&&i?.({...s,[d]:g})}return h.jsxs("div",{ref:c,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...a,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-offline"}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Alerts"})]}),h.jsx(bp,{checked:t,onCheckedChange:d=>n?.(d)})]}),h.jsxs("div",{className:"p-4 space-y-3",children:[h.jsx(Cy,{label:"P90 latency threshold",value:s.p90Latency,onChange:d=>f("p90Latency",d)}),h.jsx(Cy,{label:"Error rate threshold",value:s.errorRate,onChange:d=>f("errorRate",d)}),h.jsx(Cy,{label:"Client lag threshold",value:s.clientLag,onChange:d=>f("clientLag",d)})]})]})});qj.displayName="AlertsConfig";function Cy({label:e,value:t,onChange:n}){return h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:e}),h.jsx(Hn,{variant:"mono",type:"number",value:t,onChange:s=>n(s.target.value),className:"w-[100px] text-[11px] px-2 py-1 text-right"})]})}const O8=di("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"}}),dn=_.forwardRef(({className:e,variant:t,style:n,...s},i)=>h.jsx("span",{ref:i,className:ge(O8({variant:t,className:e})),style:{lineHeight:1,...n},...s}));dn.displayName="Badge";const Jl=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"table",className:ge("w-full",e),...t}));Jl.displayName="Table";const ec=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"rowgroup",className:ge(e),...t}));ec.displayName="TableHeader";const tc=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"rowgroup",className:ge(e),...t}));tc.displayName="TableBody";const ts=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"row",className:ge("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}));ts.displayName="TableRow";const ht=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"columnheader",className:ge("min-w-0 font-mono text-[9px] text-neutral-600 uppercase tracking-wider leading-6 bg-white/[0.01] text-left truncate",e),...t}));ht.displayName="TableHead";const pt=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,role:"cell",className:ge("min-w-0 whitespace-nowrap overflow-hidden text-ellipsis",e),...t}));pt.displayName="TableCell";const M8={relay:"relay",admin:"flow",proxy:"ghost"},k8=_.forwardRef(({className:e,keys:t,onCreateKey:n,onRotateKey:s,onRevokeKey:i,...a},c)=>h.jsx("div",{ref:c,className:ge("w-full",e),...a,children:h.jsxs(Jl,{children:[h.jsx(ec,{children:h.jsxs(ts,{children:[h.jsx(ht,{children:"Name"}),h.jsx(ht,{children:"Type"}),h.jsx(ht,{children:"Prefix"}),h.jsx(ht,{children:"Created"})]})}),h.jsx(tc,{children:t.map((f,d)=>h.jsxs(ts,{className:"group relative",children:[h.jsx(pt,{children:h.jsx("span",{className:"text-white truncate",children:f.name})}),h.jsx(pt,{children:h.jsx(dn,{variant:M8[f.type]??"ghost",children:f.type})}),h.jsx(pt,{children:h.jsx("span",{className:"text-neutral-500 truncate",children:f.prefix})}),h.jsx(pt,{children:h.jsx("span",{className:"text-neutral-600 truncate",children:f.created})}),(s||i)&&h.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:[s&&h.jsx("button",{type:"button",onClick:()=>s(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"}),i&&h.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-offline hover:bg-offline/10 cursor-pointer transition-colors",children:"revoke"})]})]},`${f.name}:${f.prefix}:${d}`))})]})}));k8.displayName="ApiKeysTable";const Vj=_.forwardRef(({className:e,metrics:t=[],uptime:n,isLive:s=!0,...i},a)=>h.jsxs("div",{ref:a,className:ge("fixed bottom-0 left-0 right-0 z-100 h-8 border-t border-border bg-surface/92 backdrop-blur-lg flex items-center justify-between px-5",e),...i,children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"flex items-center gap-[2px]",children:[0,.1,.2,.3,.4].map(c=>h.jsx("div",{className:"w-0.5 h-1.5 bg-healthy rounded-sm animate-[heartbeat_1.2s_ease-in-out_infinite]",style:{animationDelay:`${c}s`}},c))}),s&&h.jsx("span",{className:"font-mono text-[9px] text-healthy uppercase tracking-widest",children:"Live"})]}),h.jsx("div",{className:"flex items-center gap-6",children:t.map(c=>h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:c.label}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-300",children:c.value})]},c.label))}),n!=null&&h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:"UPTIME"}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:n})]})]}));Vj.displayName="BottomBar";const Kj=_.forwardRef(({className:e,commits:t,onViewAll:n,...s},i)=>h.jsxs("div",{ref:i,className:ge("px-5 pt-3 pb-2",e),...s,children:[h.jsxs("div",{className:"flex items-center justify-between mb-2",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Recent Commits"}),n&&h.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 →"})]}),h.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:[h.jsx("span",{className:"w-[60px] truncate",children:"Seq"}),h.jsx("span",{className:"w-[100px] truncate",children:"Actor"}),h.jsx("span",{className:"w-[50px] truncate",children:"Chg"}),h.jsx("span",{className:"flex-1 truncate",children:"Tables"}),h.jsx("span",{className:"w-[70px] text-right truncate",children:"Time"})]}),t.map(a=>h.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:[h.jsxs("span",{className:"w-[60px] text-flow font-medium truncate",children:["#",a.seq]}),h.jsx("span",{className:"w-[100px] text-neutral-400 truncate",children:a.actor}),h.jsx("span",{className:"w-[50px] text-white truncate",children:a.changes}),h.jsx("span",{className:"flex-1 truncate",children:h.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:a.tables})}),h.jsx("span",{className:"w-[70px] text-right text-neutral-600 truncate",children:a.time})]},a.seq))]}));Kj.displayName="CommitTable";const Gj=di("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"}}),Me=_.forwardRef(({className:e,variant:t,size:n,...s},i)=>h.jsx("button",{ref:i,className:ge(Gj({variant:t,size:n,className:e})),...s}));Me.displayName="Button";const Zj=_.forwardRef(({className:e,isConnected:t=!1,isConnecting:n=!1,isTestingConnection:s=!1,serverUrl:i,onServerUrlChange:a,consoleToken:c,onConsoleTokenChange:f,onSaveAndConnect:d,onDisconnect:p,onTestConnection:g,statusMessage:y,...b},x)=>h.jsxs("div",{ref:x,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...b,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:ge("w-1.5 h-1.5 rounded-full",t?"bg-healthy":"bg-offline"),style:t?{boxShadow:"0 0 4px #22c55e"}:void 0}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Connection"})]}),h.jsx(dn,{variant:t?"healthy":"offline",children:t?"Connected":"Disconnected"})]}),h.jsxs("div",{className:"p-5 space-y-4",children:[h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"Configure the server endpoint and authentication token."}),h.jsxs("div",{children:[h.jsx("label",{htmlFor:"console-server-url",className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",children:"Server URL"}),h.jsx(Hn,{id:"console-server-url",variant:"mono",value:i,onChange:S=>a?.(S.target.value)})]}),h.jsxs("div",{children:[h.jsx("label",{htmlFor:"console-token",className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",children:"Console Token"}),h.jsx(Hn,{id:"console-token",variant:"mono",type:"password",value:c,onChange:S=>f?.(S.target.value)})]}),h.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[h.jsx(Me,{variant:"primary",size:"md",onClick:d,disabled:n,children:n?"Connecting...":"Save + Connect"}),h.jsx(Me,{variant:"default",size:"md",onClick:g,disabled:n||s,children:s?"Testing...":"Test Connection"}),h.jsx(Me,{variant:"destructive",size:"md",onClick:p,disabled:!t,children:"Disconnect"})]}),y&&h.jsx("div",{className:ge("font-mono text-[10px]",t?"text-healthy":"text-offline"),children:y})]})]}));Zj.displayName="ConnectionForm";const I8=di("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"}}),Dt=_.forwardRef(({className:e,size:t,...n},s)=>h.jsxs("svg",{ref:s,className:ge(I8({size:t,className:e})),xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",...n,children:[h.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),h.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"})]}));Dt.displayName="Spinner";function D8({className:e,state:t}){switch(t){case"connected":return h.jsx(dn,{variant:"healthy",className:e,children:"Connected"});case"disconnected":return h.jsx(dn,{variant:"destructive",className:e,children:"Disconnected"});case"connecting":return h.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-neutral-400",children:[h.jsx(Dt,{size:"sm"}),"Connecting"]});case"not-configured":return h.jsx(dn,{variant:"ghost",className:e,children:"Not configured"})}}const Yb=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...t}));Yb.displayName="Card";const P8=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-4 py-2.5 border-b border-border flex items-center justify-between",e),...t}));P8.displayName="CardHeader";const z8=_.forwardRef(({className:e,...t},n)=>h.jsx("h3",{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));z8.displayName="CardTitle";const Xb=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("p-4",e),...t}));Xb.displayName="CardContent";const L8=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-4 py-2.5 border-t border-border",e),...t}));L8.displayName="CardFooter";function Qb({action:e,className:t,icon:n,message:s}){return h.jsxs("div",{className:ge("flex flex-col items-center justify-center gap-3 py-12",t),children:[n?h.jsx("div",{className:"text-neutral-500",children:n}):null,h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:s}),e?h.jsx("div",{children:e}):null]})}const Yj=_.forwardRef(({className:e,groups:t,searchValue:n,searchPlaceholder:s="Filter by client or actor...",onSearchChange:i,actions:a,...c},f)=>h.jsxs("div",{ref:f,className:ge("px-5 py-3 border-b border-border flex items-center gap-4 flex-wrap",e),...c,children:[t.map((d,p)=>h.jsx(U8,{group:d,showDivider:p>0},p)),i!==void 0&&h.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:s,value:n,onChange:d=>i(d.target.value)}),a&&h.jsx("div",{className:"ml-auto flex items-center gap-2",children:a})]}));Yj.displayName="FilterBar";function U8({group:e,showDivider:t}){return h.jsxs(h.Fragment,{children:[t&&h.jsx("div",{className:"w-px h-4 bg-border"}),h.jsxs("div",{className:"flex items-center gap-1",children:[e.label&&h.jsx("span",{className:"font-mono text-[9px] text-neutral-500 mr-1",children:e.label}),e.options.map(n=>h.jsx("button",{type:"button",onClick:()=>e.onActiveChange(n.id),className:ge("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 $8(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const B8={online:"healthy",syncing:"syncing",offline:"offline"},F8={realtime:"flow",polling:"ghost"},H8=_.forwardRef(({className:e,client:t,headSeq:n,onEvict:s,...i},a)=>{const c=Math.max(0,n-t.cursor),f=Math.min(100,t.cursor/n*100),d=$8(c);return h.jsxs("div",{ref:a,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),style:{borderLeft:`3px solid ${d}`},...i,children:[h.jsxs("div",{className:"px-3.5 py-2 border-b border-border flex items-center justify-between",children:[h.jsx("div",{className:"flex items-center gap-2 min-w-0",children:h.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})}),h.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[h.jsx(dn,{variant:B8[t.status],children:t.status}),h.jsx(dn,{variant:F8[t.mode],children:t.mode})]})]}),h.jsxs("div",{className:"p-3 space-y-3",children:[h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["#",t.cursor.toLocaleString()]}),h.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["#",n.toLocaleString()]})]}),h.jsx("div",{className:"h-1 rounded-full bg-surface",children:h.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${f}%`,background:d}})}),h.jsx("div",{className:"font-mono text-[9px] mt-1",style:{color:d},children:c===0?"Caught up":`${c} behind`})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx(Ry,{label:"Actor",value:t.actor}),h.jsx(Ry,{label:"Dialect",value:t.dialect}),h.jsx(Ry,{label:"Last seen",value:t.lastSeen}),h.jsxs("div",{className:"flex justify-between items-start",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:"Scopes"}),h.jsxs("div",{className:"flex gap-1 flex-wrap justify-end",children:[t.scopes.slice(0,2).map(p=>h.jsx(dn,{variant:"ghost",children:p},p)),t.scopes.length>2&&h.jsxs("span",{className:"font-mono text-[9px] text-neutral-600",children:["+",t.scopes.length-2]})]})]})]}),s&&h.jsxs("button",{type:"button",onClick:s,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:[h.jsxs("svg",{className:"w-3 h-3",fill:"none",stroke:"currentColor",strokeWidth:2,viewBox:"0 0 24 24",children:[h.jsx("path",{d:"M18.36 6.64a9 9 0 11-12.73 0"}),h.jsx("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]}),"Evict"]})]})]})});H8.displayName="FleetCard";function Ry({label:e,value:t}){return h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:e}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:t})]})}const Xj=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();const q8=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const V8=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());const lC=e=>{const t=V8(e);return t.charAt(0).toUpperCase()+t.slice(1)};var K8={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 G8=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Z8=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:a,iconNode:c,...f},d)=>_.createElement("svg",{ref:d,...K8,width:t,height:t,stroke:e,strokeWidth:s?Number(n)*24/Number(t):n,className:Xj("lucide",i),...!a&&!G8(f)&&{"aria-hidden":"true"},...f},[...c.map(([p,g])=>_.createElement(p,g)),...Array.isArray(a)?a:[a]]));const Wb=(e,t)=>{const n=_.forwardRef(({className:s,...i},a)=>_.createElement(Z8,{ref:a,iconNode:t,className:Xj(`lucide-${q8(lC(e))}`,`lucide-${e}`,s),...i}));return n.displayName=lC(e),n};const Y8=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],X8=Wb("arrow-left",Y8);const Q8=[["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"}]],W8=Wb("settings",Q8);const J8=[["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"}]],eV=Wb("user-x",J8);function tV(e){return e===0?"#22c55e":e<10?"#f59e0b":e<50?"#f97316":"#ef4444"}const nV={online:"healthy",syncing:"syncing",offline:"offline"},Qj=_.forwardRef(({className:e,clients:t,headSeq:n,onEvict:s,...i},a)=>h.jsx("div",{ref:a,className:ge("w-full",e),...i,children:h.jsxs(Jl,{children:[h.jsx(ec,{children:h.jsxs(ts,{children:[h.jsx(ht,{className:"w-[160px]",children:"Client"}),h.jsx(ht,{className:"w-[70px]",children:"Status"}),h.jsx(ht,{className:"w-[60px]",children:"Type"}),h.jsx(ht,{className:"w-[80px]",children:"Cursor"}),h.jsx(ht,{className:"w-[110px]",children:"Lag"}),h.jsx(ht,{className:"w-[60px]",children:"Dialect"}),h.jsx(ht,{className:"flex-1",children:"Mode"})]})}),h.jsx(tc,{children:t.map(c=>{const f=Math.max(0,n-c.cursor),d=n>0?Math.min(100,c.cursor/n*100):100,p=tV(f);return h.jsxs(ts,{className:"group relative",children:[h.jsx(pt,{className:"w-[160px]",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-1.5 h-1.5 rounded-full flex-shrink-0",style:{background:p,boxShadow:`0 0 4px ${p}`}}),h.jsx("span",{className:"font-mono text-[11px] text-white truncate",title:c.id,children:c.id.length>18?`${c.id.substring(0,18)}…`:c.id})]})}),h.jsx(pt,{className:"w-[70px]",children:h.jsx(dn,{variant:nV[c.status],children:c.status})}),h.jsx(pt,{className:"w-[60px]",children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:c.type})}),h.jsx(pt,{className:"w-[80px]",children:h.jsxs("span",{className:"font-mono text-[11px] text-white font-medium",children:["#",c.cursor.toLocaleString()]})}),h.jsx(pt,{className:"w-[110px]",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"w-[60px] h-[3px] rounded-full bg-surface overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full transition-all",style:{width:`${d}%`,background:p}})}),h.jsx("span",{className:"font-mono text-[10px] font-medium",style:{color:p},children:f===0?"0":`${f}`})]})}),h.jsx(pt,{className:"w-[60px]",children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-400",children:c.dialect})}),h.jsx(pt,{className:"flex-1",children:h.jsx(dn,{variant:c.mode==="realtime"?"flow":"ghost",children:c.mode})}),s&&h.jsxs("button",{type:"button",title:"Evict client",onClick:()=>s(c.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:[h.jsx(eV,{size:10}),"evict"]})]},c.id)})})]})}));Qj.displayName="FleetTable";const Wj=_.forwardRef(({className:e,handlers:t,tableCount:n,...s},i)=>{const a=n??t.length;return h.jsxs("div",{ref:i,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...s,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-flow"}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Handlers"})]}),h.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[a," tables"]})]}),h.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:[h.jsx("span",{className:"flex-1",children:"Table"}),h.jsx("span",{className:"w-[100px]",children:"Depends On"}),h.jsx("span",{className:"w-[70px] text-right",children:"Chunk TTL"})]}),t.map((c,f)=>h.jsxs("div",{className:ge("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:[h.jsx("span",{className:"flex-1 text-white truncate",children:c.table}),h.jsx("span",{className:"w-[100px] truncate",children:c.dependsOn?h.jsx(dn,{variant:"ghost",children:c.dependsOn}):h.jsx("span",{className:"text-neutral-600",children:"—"})}),h.jsx("span",{className:"w-[70px] text-right text-neutral-500 truncate",children:c.chunkTtl})]},`${c.table}:${f}`))]})});Wj.displayName="HandlersTable";const rV={flow:"bg-flow",healthy:"bg-healthy",syncing:"bg-syncing",offline:"bg-offline",relay:"bg-relay",muted:"bg-neutral-500"},Jj=_.forwardRef(({className:e,items:t,...n},s)=>h.jsx("div",{ref:s,className:ge("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((i,a)=>h.jsx(sV,{item:i,showDivider:a>0},i.label))}));Jj.displayName="KpiStrip";function sV({item:e,showDivider:t}){const n=rV[e.color??"muted"]??"bg-neutral-500";return h.jsxs(h.Fragment,{children:[t&&h.jsx("div",{className:"w-px h-4 bg-border"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:ge("w-1.5 h-1.5 rounded-full",n)}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase",children:e.label}),h.jsxs("span",{className:"font-mono text-sm text-white font-semibold",children:[e.value,e.unit&&h.jsx("span",{className:"text-xs text-neutral-600",children:e.unit})]}),e.trend&&h.jsx("span",{className:ge("font-mono text-[10px]",e.trend.startsWith("+")?"text-healthy":"text-offline"),children:e.trend})]})]})}const eA=_.forwardRef(({className:e,buckets:t,successRate:n=99.6,successLabel:s="success",...i},a)=>{const c=n/100*88,f=88-c;return h.jsxs("div",{ref:a,className:ge("px-5 py-3 border-b border-border flex items-center gap-8",e),...i,children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Latency"}),h.jsx("div",{className:"flex items-center gap-6",children:t.map(d=>h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:d.label}),h.jsxs("div",{className:"flex gap-1 items-end h-5",children:[h.jsx("div",{className:"w-3 rounded-t bg-healthy/60",style:{height:`${d.pushBarPercent}%`}}),h.jsx("div",{className:"w-3 rounded-t bg-flow/60",style:{height:`${d.pullBarPercent}%`}})]}),h.jsxs("span",{className:"font-mono text-[10px] text-neutral-400",children:[d.pushMs," / ",d.pullMs,"ms"]})]},d.label))}),h.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[h.jsxs("svg",{viewBox:"0 0 36 36",className:"w-7 h-7",children:[h.jsx("circle",{cx:18,cy:18,r:14,fill:"none",stroke:"#1e1e1e",strokeWidth:4}),h.jsx("circle",{cx:18,cy:18,r:14,fill:"none",stroke:"#22c55e",strokeWidth:4,strokeDasharray:`${c} ${f}`,transform:"rotate(-90 18 18)",strokeLinecap:"round"})]}),h.jsxs("span",{className:"font-mono text-[10px] text-neutral-400",children:[n,"%"," ",h.jsx("span",{className:"text-neutral-600",children:s})]})]})]})});eA.displayName="LatencyPercentilesBar";const oV={PUSH:"syncing",PULL:"healthy",ACK:"flow"},tA=_.forwardRef(({className:e,entries:t,isConnected:n=!0,maxVisible:s=20,maxHeight:i,...a},c)=>{const f=t.slice(0,s);return h.jsxs("div",{ref:c,className:ge("flex-shrink-0",e),style:{width:360},...a,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Live Feed"}),h.jsx("span",{className:ge("w-1.5 h-1.5 rounded-full",n?"bg-healthy animate-[dotPulse_1.5s_ease-in-out_infinite]":"bg-neutral-600")})]}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:n?"WebSocket":"Disconnected"})]}),h.jsx("div",{className:"px-3 py-2 space-y-0.5 overflow-y-auto",style:i?{maxHeight:i}:void 0,children:f.length===0?h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx("p",{className:"text-neutral-500 text-sm font-mono",children:n?"Waiting for activity...":"Connect to see live activity"})}):f.map((d,p)=>h.jsxs("div",{className:"flex items-center gap-2 py-1 animate-[streamSlide_0.35s_ease-out]",children:[h.jsx(dn,{variant:oV[d.type]??"ghost",className:"text-[8px] px-1.5 py-0",children:d.type}),h.jsxs("span",{className:"font-mono text-[10px] text-neutral-400 truncate flex-1",children:[d.actor," · ",d.table]}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-600",children:d.time})]},`${d.time}-${p}`))})]})});tA.displayName="LiveActivityFeed";const iV={syncing:"bg-syncing",flow:"bg-flow",healthy:"bg-healthy",offline:"bg-offline"},xp=_.forwardRef(({className:e,title:t,description:n,dotColor:s="syncing",stats:i,actionLabel:a,actionVariant:c="default",actionIcon:f,onAction:d,...p},g)=>h.jsxs("div",{ref:g,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...p,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center gap-2",children:[h.jsx("span",{className:ge("w-1.5 h-1.5 rounded-full",iV[s])}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:t})]}),h.jsxs("div",{className:"p-4",children:[h.jsx("p",{className:"font-mono text-[10px] text-neutral-500 leading-relaxed mb-4",children:n}),h.jsx("div",{className:ge("grid gap-3 mb-4",i.length<=2?"grid-cols-2":"grid-cols-3"),children:i.map(y=>h.jsxs("div",{children:[h.jsx("div",{className:"font-mono text-[9px] text-neutral-600 uppercase tracking-wider mb-1",children:y.label}),h.jsx("div",{className:ge("font-mono font-semibold",y.tone==="syncing"?"text-sm text-syncing":"text-lg text-white"),children:y.value})]},y.label))}),h.jsxs(Me,{variant:c,size:"md",onClick:d,children:[f,a]})]})]}));xp.displayName="MaintenanceCard";function aV({actions:e,children:t,className:n,contentClassName:s,description:i,title:a}){return h.jsxs(Yb,{className:ge("border-border",n),children:[a||e?h.jsxs("div",{className:"flex items-start justify-between px-4 pt-4",children:[h.jsxs("div",{children:[a?h.jsx("h3",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:a}):null,i?h.jsx("p",{className:"mt-1 font-mono text-[10px] text-neutral-500",children:i}):null]}),e?h.jsx("div",{className:"flex items-center gap-2",children:e}):null]}):null,h.jsx(Xb,{className:s,children:t})]})}const nA=_.forwardRef(({className:e,rows:t,onResetDefaults:n,...s},i)=>h.jsxs("div",{ref:i,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...s,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Preferences"}),n&&h.jsx(Me,{variant:"default",size:"sm",onClick:n,children:"Reset defaults"})]}),h.jsx("div",{className:"p-4 space-y-4",children:t.map((a,c)=>h.jsx(lV,{row:a,showDivider:c>0},a.label))})]}));nA.displayName="PreferencesPanel";function lV({row:e,showDivider:t}){return h.jsxs(h.Fragment,{children:[t&&h.jsx("div",{className:"border-t border-border"}),h.jsx("div",{className:"flex items-center justify-between",children:e.type==="filter"?h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:e.label}),h.jsx("div",{className:"flex gap-0.5",children:e.options.map(n=>h.jsx("button",{type:"button",onClick:()=>e.onActiveChange(n.id),className:ge("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))})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:e.label}),e.description&&h.jsx("p",{className:"font-mono text-[9px] text-neutral-600 mt-0.5",children:e.description})]}),h.jsx(bp,{checked:e.checked,onCheckedChange:n=>e.onCheckedChange(n)})]})})]})}function Jb({actions:e,children:t,className:n,contentClassName:s,description:i,title:a}){return h.jsxs(Yb,{className:n,children:[a||e?h.jsxs("div",{className:"flex items-start justify-between px-4 pt-4",children:[h.jsxs("div",{children:[a?h.jsx("h3",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:a}):null,i?h.jsx("p",{className:"mt-1 font-mono text-[10px] text-neutral-500",children:i}):null]}),e?h.jsx("div",{className:"flex items-center gap-2",children:e}):null]}):null,h.jsx(Xb,{className:s,children:t})]})}const cV={commit:"text-flow",push:"text-syncing",pull:"text-healthy"},uV={applied:"text-healthy",error:"text-offline",cached:"text-syncing"},rA=_.forwardRef(({className:e,entries:t,filterBar:n,pagination:s,onEntryClick:i,selectedEntryId:a,...c},f)=>h.jsxs("div",{ref:f,className:ge("h-full flex flex-col",e),...c,children:[n,h.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:[h.jsx("span",{className:"w-[50px] truncate",children:"Time"}),h.jsx("span",{className:"w-[65px] truncate",children:"Type"}),h.jsx("span",{className:"w-[55px] truncate",children:"ID"}),h.jsx("span",{className:"w-[65px] truncate",children:"Outcome"}),h.jsx("span",{className:"w-[50px] truncate",children:"Dur"}),h.jsx("span",{className:"w-[100px] truncate",children:"Actor"}),h.jsx("span",{className:"w-[120px] truncate",children:"Client"}),h.jsx("span",{className:"flex-1 truncate",children:"Detail"})]}),h.jsx("div",{className:"flex-1 overflow-y-auto",children:t.map((d,p)=>h.jsx(fV,{entry:d,isSelected:a===d.id,onClick:i},`${d.id}-${p}`))}),s]}));rA.displayName="StreamLog";function fV({entry:e,isSelected:t,onClick:n}){const s=cV[e.type]??"text-neutral-500",i=uV[e.outcome]??"text-neutral-600",a=ge("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]"),c=h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"w-[50px] text-neutral-600 truncate",children:e.time}),h.jsx("span",{className:ge("w-[65px] font-medium truncate",s),children:e.type.toUpperCase()}),h.jsx("span",{className:"w-[55px] text-flow truncate",children:e.id}),h.jsx("span",{className:ge("w-[65px] truncate",i),children:e.outcome}),h.jsx("span",{className:"w-[50px] text-neutral-500 truncate",children:e.duration}),h.jsx("span",{className:"w-[100px] text-neutral-400 truncate",children:e.actor}),h.jsx("span",{className:"w-[120px] text-neutral-600 truncate",title:e.client,children:e.client.length>14?`${e.client.substring(0,14)}…`:e.client}),h.jsx("span",{className:"flex-1 text-neutral-500 truncate",children:e.detail})]});return n?h.jsx("button",{type:"button",className:ge(a,"w-full bg-transparent text-left"),onClick:()=>n(e),children:c}):h.jsx("div",{className:a,children:c})}function dV(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const sA=_.forwardRef(({className:e,clients:t,headSeq:n,maxLag:s,minSeq:i,...a},c)=>{const f=t.map(b=>b.cursor),d=i??Math.min(...f,n)-10,p=s??Math.max(...t.map(b=>n-b.cursor),0),g=n-d,y=[d,Math.round(d+g*.33),Math.round(d+g*.66),n];return h.jsxs("div",{ref:c,className:ge("bg-panel border border-border rounded-lg hover:border-border-bright transition",e),...a,children:[h.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Sync Horizon"}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:"Head"}),h.jsxs("span",{className:"font-mono text-xs text-white font-semibold",children:["#",n.toLocaleString()]})]}),h.jsx("div",{className:"w-px h-3 bg-border"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"font-mono text-[10px] text-neutral-500",children:"Max lag"}),h.jsx("span",{className:"font-mono text-xs text-syncing font-semibold",children:p})]})]})]}),h.jsxs("div",{className:"p-4",children:[h.jsxs("div",{className:"relative h-8 mb-3 rounded bg-surface",children:[h.jsx("div",{className:"absolute inset-0 flex items-center justify-between px-2",children:y.map(b=>h.jsxs("span",{className:"font-mono text-[8px] text-neutral-700",children:["#",b.toLocaleString()]},b))}),h.jsx("div",{className:"absolute top-0 bottom-0 w-px bg-flow/40",style:{right:"2%"}}),t.map(b=>{const x=g>0?(b.cursor-d)/g*96+2:50,S=dV(b.status),w=b.status==="offline"?.4:1;return h.jsx("div",{className:"absolute",style:{left:`${x}%`,top:"50%",transform:"translate(-50%,-50%)",opacity:w},title:`${b.id} → #${b.cursor}`,children:h.jsx("div",{className:"w-2.5 h-2.5 rounded-full",style:{background:S,boxShadow:`0 0 4px ${S}`}})},b.id)})]}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-healthy"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Caught up"})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-syncing"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Behind"})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"w-2 h-2 rounded-full bg-offline opacity-50"}),h.jsx("span",{className:"font-mono text-[9px] text-neutral-500",children:"Offline"})]})]})]})]})});sA.displayName="SyncHorizon";function hV(e){const t=_.useRef(!0);t.current&&(t.current=!1,e())}const pV=_.createContext(void 0);function ex(e){const t=_.useContext(pV);if(t===void 0)throw new Error(pn(72));return t}const mV=[];function tx(e){_.useEffect(e,mV)}const ru=0;class si{static create(){return new si}currentId=ru;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ru,n()},t)}isStarted(){return this.currentId!==ru}clear=()=>{this.currentId!==ru&&(clearTimeout(this.currentId),this.currentId=ru)};disposeEffect=()=>this.clear}function Jr(){const e=In(si.create).current;return tx(e.disposeEffect),e}function Xo(e){const t=In(gV,e).current;return t.next=e,ze(t.effect),t}function gV(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Rt(e){return e?.ownerDocument||document}const nc=typeof navigator<"u",Ny=bV(),oA=SV(),iA=xV(),nx=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),aA=Ny.platform==="MacIntel"&&Ny.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Ny.platform),yV=nc&&/apple/i.test(navigator.vendor),kv=nc&&/android/i.test(oA)||/android/i.test(iA);nc&&oA.toLowerCase().startsWith("mac")&&navigator.maxTouchPoints;const vV=iA.includes("jsdom/");function bV(){if(!nc)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 xV(){if(!nc)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function SV(){if(!nc)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const Iv="data-base-ui-focusable",lA="active",cA="selected",uA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",jy="ArrowLeft",Ay="ArrowRight",_V="ArrowUp",wV="ArrowDown";function Lo(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Mt(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&jv(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function EV(e,t){if(!jt(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,s]of t.entries())if(Mt(s,n))return!s.hasAttribute("data-trigger-disabled");return!1}function Ir(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Yr(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 TV(e){return e.matches("html,body")}function fA(e){return Vt(e)&&e.matches(uA)}function cC(e){return e?e.getAttribute("role")==="combobox"&&fA(e):!1}function Lh(e){return e?e.hasAttribute(Iv)?e:e.querySelector(`[${Iv}]`)||e:null}function vl(e,t,n=!0){return e.filter(i=>i.parentId===t&&(!n||i.context?.open)).flatMap(i=>[i,...vl(e,i.id,n)])}function uC(e,t){let n=[],s=e.find(i=>i.id===t)?.parentId;for(;s;){const i=e.find(a=>a.id===s);s=i?.parentId,i&&(n=n.concat(i))}return n}function Fi(e){e.preventDefault(),e.stopPropagation()}function CV(e){return"nativeEvent"in e}function RV(e){return e.pointerType===""&&e.isTrusted?!0:kv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function NV(e){return vV?!1:!kv&&e.width===0&&e.height===0||kv&&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 jV(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function AV(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const OV=["top","right","bottom","left"],Pl=Math.min,ar=Math.max,Uh=Math.round,fl=Math.floor,ys=e=>({x:e,y:e}),MV={left:"right",right:"left",bottom:"top",top:"bottom"},kV={start:"end",end:"start"};function Dv(e,t,n){return ar(e,Pl(t,n))}function ro(e,t){return typeof e=="function"?e(t):e}function qn(e){return e.split("-")[0]}function yi(e){return e.split("-")[1]}function rx(e){return e==="x"?"y":"x"}function sx(e){return e==="y"?"height":"width"}const IV=new Set(["top","bottom"]);function zr(e){return IV.has(qn(e))?"y":"x"}function ox(e){return rx(zr(e))}function DV(e,t,n){n===void 0&&(n=!1);const s=yi(e),i=ox(e),a=sx(i);let c=i==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(c=$h(c)),[c,$h(c)]}function PV(e){const t=$h(e);return[Pv(e),t,Pv(t)]}function Pv(e){return e.replace(/start|end/g,t=>kV[t])}const fC=["left","right"],dC=["right","left"],zV=["top","bottom"],LV=["bottom","top"];function UV(e,t,n){switch(e){case"top":case"bottom":return n?t?dC:fC:t?fC:dC;case"left":case"right":return t?zV:LV;default:return[]}}function $V(e,t,n,s){const i=yi(e);let a=UV(qn(e),n==="start",s);return i&&(a=a.map(c=>c+"-"+i),t&&(a=a.concat(a.map(Pv)))),a}function $h(e){return e.replace(/left|right|bottom|top/g,t=>MV[t])}function BV(e){return{top:0,right:0,bottom:0,left:0,...e}}function dA(e){return typeof e!="number"?BV(e):{top:e,right:e,bottom:e,left:e}}function Bh(e){const{x:t,y:n,width:s,height:i}=e;return{width:s,height:i,top:n,left:t,right:t+s,bottom:n+i,x:t,y:n}}function kd(e,t,n){return Math.floor(e/t)!==n}function sh(e,t){return t<0||t>=e.current.length}function FV(e,t){return ir(e,{disabledIndices:t})}function HV(e,t){return ir(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ir(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:s,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.current.length-1&&fu(e,a,s));return a}function qV(e,{event:t,orientation:n,loopFocus:s,rtl:i,cols:a,disabledIndices:c,minIndex:f,maxIndex:d,prevIndex:p,stopEvent:g=!1}){let y=p;const b=[],x={};let S=!1;{let C=null,A=-1;e.current.forEach((N,R)=>{if(N==null)return;const k=N.closest('[role="row"]');k&&(S=!0),(k!==C||A===-1)&&(C=k,A+=1,b[A]=[]),b[A].push(R),x[R]=A})}const w=S&&b.length>0&&b.some(C=>C.length!==a);function T(C){if(!w||p===-1)return;const A=x[p];if(A==null)return;const N=b[A].indexOf(p);let R=C==="up"?A-1:A+1;s&&(R<0?R=b.length-1:R>=b.length&&(R=0));const k=new Set;for(;R>=0&&R<b.length&&!k.has(R);){k.add(R);const L=b[R];if(L.length===0){R=C==="up"?R-1:R+1;continue}const j=Math.min(N,L.length-1);for(let O=j;O>=0;O-=1){const D=L[O];if(!fu(e,D,c))return D}R=C==="up"?R-1:R+1,s&&(R<0?R=b.length-1:R>=b.length&&(R=0))}}if(t.key===_V){const C=T("up");if(C!==void 0)g&&Fi(t),y=C;else{if(g&&Fi(t),p===-1)y=d;else if(y=ir(e,{startingIndex:y,amount:a,decrement:!0,disabledIndices:c}),s&&(p-a<f||y<0)){const A=p%a,N=d%a,R=d-(N-A);N===A?y=d:y=N>A?R:R-a}sh(e,y)&&(y=p)}}if(t.key===wV){const C=T("down");C!==void 0?(g&&Fi(t),y=C):(g&&Fi(t),p===-1?y=f:(y=ir(e,{startingIndex:p,amount:a,disabledIndices:c}),s&&p+a>d&&(y=ir(e,{startingIndex:p%a-a,amount:a,disabledIndices:c}))),sh(e,y)&&(y=p))}if(n==="both"){const C=fl(p/a);t.key===(i?jy:Ay)&&(g&&Fi(t),p%a!==a-1?(y=ir(e,{startingIndex:p,disabledIndices:c}),s&&kd(y,a,C)&&(y=ir(e,{startingIndex:p-p%a-1,disabledIndices:c}))):s&&(y=ir(e,{startingIndex:p-p%a-1,disabledIndices:c})),kd(y,a,C)&&(y=p)),t.key===(i?Ay:jy)&&(g&&Fi(t),p%a!==0?(y=ir(e,{startingIndex:p,decrement:!0,disabledIndices:c}),s&&kd(y,a,C)&&(y=ir(e,{startingIndex:p+(a-p%a),decrement:!0,disabledIndices:c}))):s&&(y=ir(e,{startingIndex:p+(a-p%a),decrement:!0,disabledIndices:c})),kd(y,a,C)&&(y=p));const A=fl(d/a)===C;sh(e,y)&&(s&&A?y=t.key===(i?Ay:jy)?d:ir(e,{startingIndex:p-p%a-1,disabledIndices:c}):y=p)}return y}function VV(e,t,n){const s=[];let i=0;return e.forEach(({width:a,height:c},f)=>{let d=!1;for(n&&(i=0);!d;){const p=[];for(let g=0;g<a;g+=1)for(let y=0;y<c;y+=1)p.push(i+g+y*t);i%t+a<=t&&p.every(g=>s[g]==null)?(p.forEach(g=>{s[g]=f}),d=!0):i+=1}}),[...s]}function KV(e,t,n,s,i){if(e===-1)return-1;const a=n.indexOf(e),c=t[e];switch(i){case"tl":return a;case"tr":return c?a+c.width-1:a;case"bl":return c?a+(c.height-1)*s:a;case"br":return n.lastIndexOf(e);default:return-1}}function GV(e,t){return t.flatMap((n,s)=>e.includes(n)?[s]:[])}function fu(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const s=e.current[t];return s?s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true":!1}var ZV=["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] *)"],Fh=ZV.join(","),hA=typeof Element>"u",zl=hA?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Hh=!hA&&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},qh=function(t,n){var s;n===void 0&&(n=!0);var i=t==null||(s=t.getAttribute)===null||s===void 0?void 0:s.call(t,"inert"),a=i===""||i==="true",c=a||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):qh(t.parentNode));return c},YV=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},pA=function(t,n,s){if(qh(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Fh));return n&&zl.call(t,Fh)&&i.unshift(t),i=i.filter(s),i},Vh=function(t,n,s){for(var i=[],a=Array.from(t);a.length;){var c=a.shift();if(!qh(c,!1))if(c.tagName==="SLOT"){var f=c.assignedElements(),d=f.length?f:c.children,p=Vh(d,!0,s);s.flatten?i.push.apply(i,p):i.push({scopeParent:c,candidates:p})}else{var g=zl.call(c,Fh);g&&s.filter(c)&&(n||!t.includes(c))&&i.push(c);var y=c.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(c),b=!qh(y,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(c));if(y&&b){var x=Vh(y===!0?c.children:y.children,!0,s);s.flatten?i.push.apply(i,x):i.push({scopeParent:c,candidates:x})}else a.unshift.apply(a,c.children)}}return i},mA=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},gA=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||YV(t))&&!mA(t)?0:t.tabIndex},XV=function(t,n){var s=gA(t);return s<0&&n&&!mA(t)?0:s},QV=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},yA=function(t){return t.tagName==="INPUT"},WV=function(t){return yA(t)&&t.type==="hidden"},JV=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},e7=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},t7=function(t){if(!t.name)return!0;var n=t.form||Hh(t),s=function(f){return n.querySelectorAll('input[type="radio"][name="'+f+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=s(window.CSS.escape(t.name));else try{i=s(t.name)}catch(c){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",c.message),!1}var a=e7(i,t.form);return!a||a===t},n7=function(t){return yA(t)&&t.type==="radio"},r7=function(t){return n7(t)&&!t7(t)},s7=function(t){var n,s=t&&Hh(t),i=(n=s)===null||n===void 0?void 0:n.host,a=!1;if(s&&s!==t){var c,f,d;for(a=!!((c=i)!==null&&c!==void 0&&(f=c.ownerDocument)!==null&&f!==void 0&&f.contains(i)||t!=null&&(d=t.ownerDocument)!==null&&d!==void 0&&d.contains(t));!a&&i;){var p,g,y;s=Hh(i),i=(p=s)===null||p===void 0?void 0:p.host,a=!!((g=i)!==null&&g!==void 0&&(y=g.ownerDocument)!==null&&y!==void 0&&y.contains(i))}}return a},hC=function(t){var n=t.getBoundingClientRect(),s=n.width,i=n.height;return s===0&&i===0},o7=function(t,n){var s=n.displayCheck,i=n.getShadowRoot;if(s==="full-native"&&"checkVisibility"in t){var a=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!a}if(getComputedStyle(t).visibility==="hidden")return!0;var c=zl.call(t,"details>summary:first-of-type"),f=c?t.parentElement:t;if(zl.call(f,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="full-native"||s==="legacy-full"){if(typeof i=="function"){for(var d=t;t;){var p=t.parentElement,g=Hh(t);if(p&&!p.shadowRoot&&i(p)===!0)return hC(t);t.assignedSlot?t=t.assignedSlot:!p&&g!==t.ownerDocument?t=g.host:t=p}t=d}if(s7(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return hC(t);return!1},i7=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var s=0;s<n.children.length;s++){var i=n.children.item(s);if(i.tagName==="LEGEND")return zl.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},zv=function(t,n){return!(n.disabled||WV(n)||o7(n,t)||JV(n)||i7(n))},Lv=function(t,n){return!(r7(n)||gA(n)<0||!zv(t,n))},a7=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},vA=function(t){var n=[],s=[];return t.forEach(function(i,a){var c=!!i.scopeParent,f=c?i.scopeParent:i,d=XV(f,c),p=c?vA(i.candidates):f;d===0?c?n.push.apply(n,p):n.push(f):s.push({documentOrder:a,tabIndex:d,item:i,isScope:c,content:p})}),s.sort(QV).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},Sp=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Vh([t],n.includeContainer,{filter:Lv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:a7}):s=pA(t,n.includeContainer,Lv.bind(null,n)),vA(s)},l7=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Vh([t],n.includeContainer,{filter:zv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=pA(t,n.includeContainer,zv.bind(null,n)),s},bA=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return zl.call(t,Fh)===!1?!1:Lv(n,t)};const Zu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function xA(e,t){const n=Sp(e,Zu()),s=n.length;if(s===0)return;const i=Lo(Rt(e)),a=n.indexOf(i),c=a===-1?t===1?0:s-1:a+t;return n[c]}function SA(e){return xA(Rt(e).body,1)||e}function _A(e){return xA(Rt(e).body,-1)||e}function du(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!Mt(n,s)}function c7(e){Sp(e,Zu()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function pC(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const s=n.dataset.tabindex;delete n.dataset.tabindex,s?n.setAttribute("tabindex",s):n.removeAttribute("tabindex")})}function u7(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(s=>s(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 f7=_.createContext(null),d7=_.createContext(null),_p=()=>_.useContext(f7)?.id||null,wp=e=>{const t=_.useContext(d7);return e??t};function Cu(e){return`data-base-ui-${e}`}const Id=null;class h7{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,s=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,s>0)for(let i=0;i<n.length;i+=1)n[i]?.(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 Dd=new h7;class ps{static create(){return new ps}static request(t){return Dd.request(t)}static cancel(t){return Dd.cancel(t)}currentId=Id;request(t){this.cancel(),this.currentId=Dd.request(()=>{this.currentId=Id,t()})}cancel=()=>{this.currentId!==Id&&(Dd.cancel(this.currentId),this.currentId=Id)};disposeEffect=()=>this.cancel}function ix(){const e=In(ps.create).current;return tx(e.disposeEffect),e}const Kh=_.forwardRef(function(t,n){const[s,i]=_.useState();ze(()=>{yV&&i("button")},[]);const a={tabIndex:0,role:s};return h.jsx("span",{...t,ref:n,style:hp,"aria-hidden":s?void 0:!0,...a,"data-base-ui-focus-guard":""})});let mC=0;function Oy(e,t={}){const{preventScroll:n=!1,cancelPrevious:s=!0,sync:i=!1}=t;s&&cancelAnimationFrame(mC);const a=()=>e?.focus({preventScroll:n});i?a():mC=requestAnimationFrame(a)}const bl={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function gC(e){return e==="inert"?bl.inert:e==="aria-hidden"?bl["aria-hidden"]:bl.none}let Pd=new WeakSet,zd={},My=0;const wA=e=>e&&(e.host||wA(e.parentNode)),p7=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=wA(n);return e.contains(s)?s:null}).filter(n=>n!=null);function m7(e,t,n,s){const i="data-base-ui-inert",a=s?"inert":n?"aria-hidden":null,c=p7(t,e),f=new Set,d=new Set(c),p=[];zd[i]||(zd[i]=new WeakMap);const g=zd[i];c.forEach(y),b(t),f.clear();function y(x){!x||f.has(x)||(f.add(x),x.parentNode&&y(x.parentNode))}function b(x){!x||d.has(x)||[].forEach.call(x.children,S=>{if(hi(S)!=="script")if(f.has(S))b(S);else{const w=a?S.getAttribute(a):null,T=w!==null&&w!=="false",C=gC(a),A=(C.get(S)||0)+1,N=(g.get(S)||0)+1;C.set(S,A),g.set(S,N),p.push(S),A===1&&T&&Pd.add(S),N===1&&S.setAttribute(i,""),!T&&a&&S.setAttribute(a,a==="inert"?"":"true")}})}return My+=1,()=>{p.forEach(x=>{const S=gC(a),T=(S.get(x)||0)-1,C=(g.get(x)||0)-1;S.set(x,T),g.set(x,C),T||(!Pd.has(x)&&a&&x.removeAttribute(a),Pd.delete(x)),C||x.removeAttribute(i)}),My-=1,My||(bl.inert=new WeakMap,bl["aria-hidden"]=new WeakMap,bl.none=new WeakMap,Pd=new WeakSet,zd={})}}function g7(e,t=!1,n=!1){const s=Rt(e[0]).body;return m7(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const EA=_.createContext(null),TA=()=>_.useContext(EA),y7=Cu("portal");function CA(e={}){const{ref:t,container:n,componentProps:s=rn,elementProps:i}=e,a=Gu(),f=TA()?.portalNode,[d,p]=_.useState(null),[g,y]=_.useState(null),b=Ae(T=>{T!==null&&y(T)}),x=_.useRef(null);ze(()=>{if(n===null){x.current&&(x.current=null,y(null),p(null));return}if(a==null)return;const T=(n&&(Gb(n)?n:n.current))??f??document.body;if(T==null){x.current&&(x.current=null,y(null),p(null));return}x.current!==T&&(x.current=T,y(null),p(T))},[n,f,a]);const S=Pt("div",s,{ref:[t,b],props:[{id:a,[y7]:""},i]});return{portalNode:g,portalSubtree:d&&S?ui.createPortal(S,d):null}}const RA=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:c,renderGuards:f,...d}=t,{portalNode:p,portalSubtree:g}=CA({container:i,ref:n,componentProps:t,elementProps:d}),y=_.useRef(null),b=_.useRef(null),x=_.useRef(null),S=_.useRef(null),[w,T]=_.useState(null),C=w?.modal,A=w?.open,N=typeof f=="boolean"?f:!!w&&!w.modal&&w.open&&!!p;_.useEffect(()=>{if(!p||C)return;function k(L){p&&L.relatedTarget&&du(L)&&(L.type==="focusin"?pC:c7)(p)}return p.addEventListener("focusin",k,!0),p.addEventListener("focusout",k,!0),()=>{p.removeEventListener("focusin",k,!0),p.removeEventListener("focusout",k,!0)}},[p,C]),_.useEffect(()=>{!p||A||pC(p)},[A,p]);const R=_.useMemo(()=>({beforeOutsideRef:y,afterOutsideRef:b,beforeInsideRef:x,afterInsideRef:S,portalNode:p,setFocusManagerState:T}),[p]);return h.jsxs(_.Fragment,{children:[g,h.jsxs(EA.Provider,{value:R,children:[N&&p&&h.jsx(Kh,{"data-type":"outside",ref:y,onFocus:k=>{if(du(k,p))x.current?.focus();else{const L=w?w.domReference:null;_A(L)?.focus()}}}),N&&p&&h.jsx("span",{"aria-owns":p.id,style:o8}),p&&ui.createPortal(s,p),N&&p&&h.jsx(Kh,{"data-type":"outside",ref:b,onFocus:k=>{if(du(k,p))S.current?.focus();else{const L=w?w.domReference:null;SA(L)?.focus(),w?.closeOnFocusOut&&w?.onOpenChange(!1,Kt(Fj,k.nativeEvent))}}})]})]})});function Bs(e){return e==null?e:"current"in e?e.current:e}function v7(e,t){const n=an(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 yC=20;let Bo=[];function ax(){Bo=Bo.filter(e=>e.deref()?.isConnected)}function b7(e){ax(),e&&hi(e)!=="body"&&(Bo.push(new WeakRef(e)),Bo.length>yC&&(Bo=Bo.slice(-yC)))}function ky(){return ax(),Bo[Bo.length-1]?.deref()}function x7(e){if(!e)return null;const t=Zu();return bA(e,t)?e:Sp(e,t)[0]||e}function S7(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():mr(e).display!=="none"}function vC(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=Zu(),i=l7(e,n).filter(c=>{const f=c.getAttribute("data-tabindex")||"";return bA(c,n)||c.hasAttribute("data-tabindex")&&!f.startsWith("-")}),a=e.getAttribute("tabindex");t.current.includes("floating")||i.length===0?a!=="0"&&e.setAttribute("tabindex","0"):(a!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function NA(e){const{context:t,children:n,disabled:s=!1,initialFocus:i=!0,returnFocus:a=!0,restoreFocus:c=!1,modal:f=!0,closeOnFocusOut:d=!0,openInteractionType:p="",nextFocusableElement:g,previousFocusableElement:y,beforeContentFocusGuardRef:b,externalTree:x}=e,S="rootStore"in t?t.rootStore:t,w=S.useState("open"),T=S.useState("domReferenceElement"),C=S.useState("floatingElement"),{events:A,dataRef:N}=S.context,R=Ae(()=>N.current.floatingContext?.nodeId),k=i===!1,L=cC(T)&&k,j=_.useRef(["content"]),O=Xo(i),D=Xo(a),K=Xo(p),F=wp(x),z=TA(),X=_.useRef(null),Y=_.useRef(null),te=_.useRef(!1),P=_.useRef(!1),V=_.useRef(!1),B=_.useRef(-1),q=_.useRef(""),U=_.useRef(""),I=_.useRef(null),G=_.useRef(null),W=to(I,b,z?.beforeInsideRef),Q=to(G,z?.afterInsideRef),se=Jr(),oe=Jr(),pe=ix(),Se=z!=null,he=Lh(C),He=Ae((de=he)=>de?Sp(de,Zu()):[]),Ee=Ae(de=>{const ae=He(de);return j.current.map(()=>ae).filter(Boolean).flat()});_.useEffect(()=>{if(s||!f)return;function de(_e){_e.key==="Tab"&&Mt(he,Lo(Rt(he)))&&He().length===0&&!L&&Fi(_e)}const ae=Rt(he);return ae.addEventListener("keydown",de),()=>{ae.removeEventListener("keydown",de)}},[s,T,he,f,j,L,He,Ee]),_.useEffect(()=>{if(s||!w)return;const de=Rt(he);function ae(){V.current=!1}function _e(xe){const ye=Ir(xe),Le=Mt(C,ye)||Mt(T,ye)||Mt(z?.portalNode,ye);V.current=!Le,U.current=xe.pointerType||"keyboard",ye?.closest(`[${n8}]`)&&(P.current=!0)}function ve(){U.current="keyboard"}return de.addEventListener("pointerdown",_e,!0),de.addEventListener("pointerup",ae,!0),de.addEventListener("pointercancel",ae,!0),de.addEventListener("keydown",ve,!0),()=>{de.removeEventListener("pointerdown",_e,!0),de.removeEventListener("pointerup",ae,!0),de.removeEventListener("pointercancel",ae,!0),de.removeEventListener("keydown",ve,!0)}},[s,C,T,he,w,z]),_.useEffect(()=>{if(s||!d)return;const de=Rt(he);function ae(){P.current=!0,oe.start(0,()=>{P.current=!1})}function _e(ke){const we=Ir(ke),Xe=He().indexOf(we);Xe!==-1&&(B.current=Xe)}function ve(ke){const we=ke.relatedTarget,Ve=ke.currentTarget,Xe=Ir(ke);queueMicrotask(()=>{const $e=R(),We=S.context.triggerElements,Fe=we?.hasAttribute(Cu("focus-guard"))&&[I.current,G.current,z?.beforeInsideRef.current,z?.afterInsideRef.current,z?.beforeOutsideRef.current,z?.afterOutsideRef.current,Bs(y),Bs(g)].includes(we),me=!(Mt(T,we)||Mt(C,we)||Mt(we,C)||Mt(z?.portalNode,we)||we!=null&&We.hasElement(we)||We.hasMatchingElement(Te=>Mt(Te,we))||Fe||F&&(vl(F.nodesRef.current,$e).find(Te=>Mt(Te.context?.elements.floating,we)||Mt(Te.context?.elements.domReference,we))||uC(F.nodesRef.current,$e).find(Te=>[Te.context?.elements.floating,Lh(Te.context?.elements.floating)].includes(we)||Te.context?.elements.domReference===we)));if(Ve===T&&he&&vC(he,j),c&&Ve!==T&&!S7(Xe)&&Lo(de)===de.body){if(Vt(he)&&(he.focus(),c==="popup")){pe.request(()=>{he.focus()});return}const Te=B.current,qe=He(),mt=qe[Te]||qe[qe.length-1]||he;Vt(mt)&&mt.focus()}if(N.current.insideReactTree){N.current.insideReactTree=!1;return}(L||!f)&&we&&me&&!P.current&&(L||we!==ky())&&(te.current=!0,S.setOpen(!1,Kt(Fj,ke)))})}function xe(){V.current||(N.current.insideReactTree=!0,se.start(0,()=>{N.current.insideReactTree=!1}))}const ye=Vt(T)?T:null,Le=[];if(!(!C&&!ye))return ye&&(ye.addEventListener("focusout",ve),ye.addEventListener("pointerdown",ae),Le.push(()=>{ye.removeEventListener("focusout",ve),ye.removeEventListener("pointerdown",ae)})),C&&(C.addEventListener("focusin",_e),C.addEventListener("focusout",ve),z&&(C.addEventListener("focusout",xe,!0),Le.push(()=>{C.removeEventListener("focusout",xe,!0)})),Le.push(()=>{C.removeEventListener("focusin",_e),C.removeEventListener("focusout",ve)})),()=>{Le.forEach(ke=>{ke()})}},[s,T,C,he,f,F,z,S,d,c,He,L,R,j,N,se,oe,pe,g,y]),_.useEffect(()=>{if(s||!C||!w)return;const de=Array.from(z?.portalNode?.querySelectorAll(`[${Cu("portal")}]`)||[]),_e=(F?uC(F.nodesRef.current,R()):[]).find(xe=>cC(xe.context?.elements.domReference||null))?.context?.elements.domReference,ve=[C,_e,...de,X.current,Y.current,I.current,G.current,z?.beforeOutsideRef.current,z?.afterOutsideRef.current,Bs(y),Bs(g),L?T:null].filter(xe=>xe!=null);return g7(ve,f||L)},[w,s,T,C,f,j,z,L,F,R,g,y]),ze(()=>{if(!w||s||!Vt(he))return;const de=Rt(he),ae=Lo(de);queueMicrotask(()=>{const _e=Ee(he),ve=O.current,xe=typeof ve=="function"?ve(K.current||""):ve;if(xe===void 0||xe===!1)return;let ye;xe===!0||xe===null?ye=_e[0]||he:ye=Bs(xe),ye=ye||_e[0]||he,!Mt(he,ae)&&Oy(ye,{preventScroll:ye===he})})},[s,w,he,k,Ee,O,K]),ze(()=>{if(s||!he)return;const de=Rt(he),ae=Lo(de);b7(ae);function _e(ye){if(ye.open||(q.current=v7(ye.nativeEvent,U.current)),ye.reason===Mv&&ye.nativeEvent.type==="mouseleave"&&(te.current=!0),ye.reason===Bj)if(ye.nested)te.current=!1;else if(RV(ye.nativeEvent)||NV(ye.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}}A.on("openchange",_e);const ve=de.createElement("span");ve.setAttribute("tabindex","-1"),ve.setAttribute("aria-hidden","true"),Object.assign(ve.style,hp),Se&&T&&T.insertAdjacentElement("afterend",ve);function xe(){const ye=D.current;let Le=typeof ye=="function"?ye(q.current):ye;if(Le===void 0||Le===!1)return null;if(Le===null&&(Le=!0),typeof Le=="boolean"){const we=T||ky();return we&&we.isConnected?we:ve}const ke=T||ky()||ve;return Bs(Le)||ke}return()=>{A.off("openchange",_e);const ye=Lo(de),Le=Mt(C,ye)||F&&vl(F.nodesRef.current,R(),!1).some(we=>Mt(we.context?.elements.floating,ye)),ke=xe();queueMicrotask(()=>{const we=x7(ke),Ve=typeof D.current!="boolean";D.current&&!te.current&&Vt(we)&&(!(!Ve&&we!==ye&&ye!==de.body)||Le)&&we.focus({preventScroll:!0}),ve.remove(),te.current=!1})}},[s,C,he,D,N,A,F,Se,T,R]),ze(()=>{if(!nx||w||!C)return;const de=Lo(Rt(C));!Vt(de)||!fA(de)||Mt(C,de)&&de.blur()},[w,C]),ze(()=>{if(!(s||!z))return z.setFocusManagerState({modal:f,closeOnFocusOut:d,open:w,onOpenChange:S.setOpen,domReference:T}),()=>{z.setFocusManagerState(null)}},[s,z,f,w,S,d,T]),ze(()=>{if(!(s||!he))return vC(he,j),()=>{queueMicrotask(ax)}},[s,he,j]);const re=!s&&(f?!L:!0)&&(Se||f);return h.jsxs(_.Fragment,{children:[re&&h.jsx(Kh,{"data-type":"inside",ref:W,onFocus:de=>{if(f){const ae=Ee();Oy(ae[ae.length-1])}else z?.portalNode&&(te.current=!1,du(de,z.portalNode)?SA(T)?.focus():Bs(y??z.beforeOutsideRef)?.focus())}}),n,re&&h.jsx(Kh,{"data-type":"inside",ref:Q,onFocus:de=>{f?Oy(Ee()[0]):z?.portalNode&&(d&&(te.current=!0),du(de,z.portalNode)?_A(T)?.focus():Bs(g??z.afterOutsideRef)?.focus())}})]})}function bC(e,t,n){let{reference:s,floating:i}=e;const a=zr(t),c=ox(t),f=sx(c),d=qn(t),p=a==="y",g=s.x+s.width/2-i.width/2,y=s.y+s.height/2-i.height/2,b=s[f]/2-i[f]/2;let x;switch(d){case"top":x={x:g,y:s.y-i.height};break;case"bottom":x={x:g,y:s.y+s.height};break;case"right":x={x:s.x+s.width,y};break;case"left":x={x:s.x-i.width,y};break;default:x={x:s.x,y:s.y}}switch(yi(t)){case"start":x[c]-=b*(n&&p?-1:1);break;case"end":x[c]+=b*(n&&p?-1:1);break}return x}async function _7(e,t){var n;t===void 0&&(t={});const{x:s,y:i,platform:a,rects:c,elements:f,strategy:d}=e,{boundary:p="clippingAncestors",rootBoundary:g="viewport",elementContext:y="floating",altBoundary:b=!1,padding:x=0}=ro(t,e),S=dA(x),T=f[b?y==="floating"?"reference":"floating":y],C=Bh(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(T)))==null||n?T:T.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(f.floating)),boundary:p,rootBoundary:g,strategy:d})),A=y==="floating"?{x:s,y:i,width:c.floating.width,height:c.floating.height}:c.reference,N=await(a.getOffsetParent==null?void 0:a.getOffsetParent(f.floating)),R=await(a.isElement==null?void 0:a.isElement(N))?await(a.getScale==null?void 0:a.getScale(N))||{x:1,y:1}:{x:1,y:1},k=Bh(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:A,offsetParent:N,strategy:d}):A);return{top:(C.top-k.top+S.top)/R.y,bottom:(k.bottom-C.bottom+S.bottom)/R.y,left:(C.left-k.left+S.left)/R.x,right:(k.right-C.right+S.right)/R.x}}const w7=async(e,t,n)=>{const{placement:s="bottom",strategy:i="absolute",middleware:a=[],platform:c}=n,f=a.filter(Boolean),d=await(c.isRTL==null?void 0:c.isRTL(t));let p=await c.getElementRects({reference:e,floating:t,strategy:i}),{x:g,y}=bC(p,s,d),b=s,x={},S=0;for(let T=0;T<f.length;T++){var w;const{name:C,fn:A}=f[T],{x:N,y:R,data:k,reset:L}=await A({x:g,y,initialPlacement:s,placement:b,strategy:i,middlewareData:x,rects:p,platform:{...c,detectOverflow:(w=c.detectOverflow)!=null?w:_7},elements:{reference:e,floating:t}});g=N??g,y=R??y,x={...x,[C]:{...x[C],...k}},L&&S<=50&&(S++,typeof L=="object"&&(L.placement&&(b=L.placement),L.rects&&(p=L.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:i}):L.rects),{x:g,y}=bC(p,b,d)),T=-1)}return{x:g,y,placement:b,strategy:i,middlewareData:x}},E7=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:i,middlewareData:a,rects:c,initialPlacement:f,platform:d,elements:p}=t,{mainAxis:g=!0,crossAxis:y=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:w=!0,...T}=ro(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const C=qn(i),A=zr(f),N=qn(f)===f,R=await(d.isRTL==null?void 0:d.isRTL(p.floating)),k=b||(N||!w?[$h(f)]:PV(f)),L=S!=="none";!b&&L&&k.push(...$V(f,w,S,R));const j=[f,...k],O=await d.detectOverflow(t,T),D=[];let K=((s=a.flip)==null?void 0:s.overflows)||[];if(g&&D.push(O[C]),y){const Y=DV(i,c,R);D.push(O[Y[0]],O[Y[1]])}if(K=[...K,{placement:i,overflows:D}],!D.every(Y=>Y<=0)){var F,z;const Y=(((F=a.flip)==null?void 0:F.index)||0)+1,te=j[Y];if(te&&(!(y==="alignment"?A!==zr(te):!1)||K.every(B=>zr(B.placement)===A?B.overflows[0]>0:!0)))return{data:{index:Y,overflows:K},reset:{placement:te}};let P=(z=K.filter(V=>V.overflows[0]<=0).sort((V,B)=>V.overflows[1]-B.overflows[1])[0])==null?void 0:z.placement;if(!P)switch(x){case"bestFit":{var X;const V=(X=K.filter(B=>{if(L){const q=zr(B.placement);return q===A||q==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(q=>q>0).reduce((q,U)=>q+U,0)]).sort((B,q)=>B[1]-q[1])[0])==null?void 0:X[0];V&&(P=V);break}case"initialPlacement":P=f;break}if(i!==P)return{reset:{placement:P}}}return{}}}};function xC(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function SC(e){return OV.some(t=>e[t]>=0)}const T7=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:i="referenceHidden",...a}=ro(e,t);switch(i){case"referenceHidden":{const c=await s.detectOverflow(t,{...a,elementContext:"reference"}),f=xC(c,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:SC(f)}}}case"escaped":{const c=await s.detectOverflow(t,{...a,altBoundary:!0}),f=xC(c,n.floating);return{data:{escapedOffsets:f,escaped:SC(f)}}}default:return{}}}}},jA=new Set(["left","top"]);async function C7(e,t){const{placement:n,platform:s,elements:i}=e,a=await(s.isRTL==null?void 0:s.isRTL(i.floating)),c=qn(n),f=yi(n),d=zr(n)==="y",p=jA.has(c)?-1:1,g=a&&d?-1:1,y=ro(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:S}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return f&&typeof S=="number"&&(x=f==="end"?S*-1:S),d?{x:x*g,y:b*p}:{x:b*p,y:x*g}}const R7=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:i,y:a,placement:c,middlewareData:f}=t,d=await C7(t,e);return c===((n=f.offset)==null?void 0:n.placement)&&(s=f.arrow)!=null&&s.alignmentOffset?{}:{x:i+d.x,y:a+d.y,data:{...d,placement:c}}}}},N7=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:i,platform:a}=t,{mainAxis:c=!0,crossAxis:f=!1,limiter:d={fn:C=>{let{x:A,y:N}=C;return{x:A,y:N}}},...p}=ro(e,t),g={x:n,y:s},y=await a.detectOverflow(t,p),b=zr(qn(i)),x=rx(b);let S=g[x],w=g[b];if(c){const C=x==="y"?"top":"left",A=x==="y"?"bottom":"right",N=S+y[C],R=S-y[A];S=Dv(N,S,R)}if(f){const C=b==="y"?"top":"left",A=b==="y"?"bottom":"right",N=w+y[C],R=w-y[A];w=Dv(N,w,R)}const T=d.fn({...t,[x]:S,[b]:w});return{...T,data:{x:T.x-n,y:T.y-s,enabled:{[x]:c,[b]:f}}}}}},j7=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:s,placement:i,rects:a,middlewareData:c}=t,{offset:f=0,mainAxis:d=!0,crossAxis:p=!0}=ro(e,t),g={x:n,y:s},y=zr(i),b=rx(y);let x=g[b],S=g[y];const w=ro(f,t),T=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const N=b==="y"?"height":"width",R=a.reference[b]-a.floating[N]+T.mainAxis,k=a.reference[b]+a.reference[N]-T.mainAxis;x<R?x=R:x>k&&(x=k)}if(p){var C,A;const N=b==="y"?"width":"height",R=jA.has(qn(i)),k=a.reference[y]-a.floating[N]+(R&&((C=c.offset)==null?void 0:C[y])||0)+(R?0:T.crossAxis),L=a.reference[y]+a.reference[N]+(R?0:((A=c.offset)==null?void 0:A[y])||0)-(R?T.crossAxis:0);S<k?S=k:S>L&&(S=L)}return{[b]:x,[y]:S}}}},A7=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,s;const{placement:i,rects:a,platform:c,elements:f}=t,{apply:d=()=>{},...p}=ro(e,t),g=await c.detectOverflow(t,p),y=qn(i),b=yi(i),x=zr(i)==="y",{width:S,height:w}=a.floating;let T,C;y==="top"||y==="bottom"?(T=y,C=b===(await(c.isRTL==null?void 0:c.isRTL(f.floating))?"start":"end")?"left":"right"):(C=y,T=b==="end"?"top":"bottom");const A=w-g.top-g.bottom,N=S-g.left-g.right,R=Pl(w-g[T],A),k=Pl(S-g[C],N),L=!t.middlewareData.shift;let j=R,O=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=N),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(j=A),L&&!b){const K=ar(g.left,0),F=ar(g.right,0),z=ar(g.top,0),X=ar(g.bottom,0);x?O=S-2*(K!==0||F!==0?K+F:ar(g.left,g.right)):j=w-2*(z!==0||X!==0?z+X:ar(g.top,g.bottom))}await d({...t,availableWidth:O,availableHeight:j});const D=await c.getDimensions(f.floating);return S!==D.width||w!==D.height?{reset:{rects:!0}}:{}}}};function AA(e){const t=mr(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=Vt(e),a=i?e.offsetWidth:n,c=i?e.offsetHeight:s,f=Uh(n)!==a||Uh(s)!==c;return f&&(n=a,s=c),{width:n,height:s,$:f}}function lx(e){return jt(e)?e:e.contextElement}function xl(e){const t=lx(e);if(!Vt(t))return ys(1);const n=t.getBoundingClientRect(),{width:s,height:i,$:a}=AA(t);let c=(a?Uh(n.width):n.width)/s,f=(a?Uh(n.height):n.height)/i;return(!c||!Number.isFinite(c))&&(c=1),(!f||!Number.isFinite(f))&&(f=1),{x:c,y:f}}const O7=ys(0);function OA(e){const t=an(e);return!gp()||!t.visualViewport?O7:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function M7(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==an(e)?!1:t}function la(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=lx(e);let c=ys(1);t&&(s?jt(s)&&(c=xl(s)):c=xl(e));const f=M7(a,n,s)?OA(a):ys(0);let d=(i.left+f.x)/c.x,p=(i.top+f.y)/c.y,g=i.width/c.x,y=i.height/c.y;if(a){const b=an(a),x=s&&jt(s)?an(s):s;let S=b,w=Av(S);for(;w&&s&&x!==S;){const T=xl(w),C=w.getBoundingClientRect(),A=mr(w),N=C.left+(w.clientLeft+parseFloat(A.paddingLeft))*T.x,R=C.top+(w.clientTop+parseFloat(A.paddingTop))*T.y;d*=T.x,p*=T.y,g*=T.x,y*=T.y,d+=N,p+=R,S=an(w),w=Av(S)}}return Bh({width:g,height:y,x:d,y:p})}function Ep(e,t){const n=yp(e).scrollLeft;return t?t.left+n:la(bs(e)).left+n}function MA(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-Ep(e,n),i=n.top+t.scrollTop;return{x:s,y:i}}function k7(e){let{elements:t,rect:n,offsetParent:s,strategy:i}=e;const a=i==="fixed",c=bs(s),f=t?mp(t.floating):!1;if(s===c||f&&a)return n;let d={scrollLeft:0,scrollTop:0},p=ys(1);const g=ys(0),y=Vt(s);if((y||!y&&!a)&&((hi(s)!=="body"||pi(c))&&(d=yp(s)),Vt(s))){const x=la(s);p=xl(s),g.x=x.x+s.clientLeft,g.y=x.y+s.clientTop}const b=c&&!y&&!a?MA(c,d):ys(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-d.scrollLeft*p.x+g.x+b.x,y:n.y*p.y-d.scrollTop*p.y+g.y+b.y}}function I7(e){return Array.from(e.getClientRects())}function D7(e){const t=bs(e),n=yp(e),s=e.ownerDocument.body,i=ar(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),a=ar(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let c=-n.scrollLeft+Ep(e);const f=-n.scrollTop;return mr(s).direction==="rtl"&&(c+=ar(t.clientWidth,s.clientWidth)-i),{width:i,height:a,x:c,y:f}}const _C=25;function P7(e,t){const n=an(e),s=bs(e),i=n.visualViewport;let a=s.clientWidth,c=s.clientHeight,f=0,d=0;if(i){a=i.width,c=i.height;const g=gp();(!g||g&&t==="fixed")&&(f=i.offsetLeft,d=i.offsetTop)}const p=Ep(s);if(p<=0){const g=s.ownerDocument,y=g.body,b=getComputedStyle(y),x=g.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,S=Math.abs(s.clientWidth-y.clientWidth-x);S<=_C&&(a-=S)}else p<=_C&&(a+=p);return{width:a,height:c,x:f,y:d}}const z7=new Set(["absolute","fixed"]);function L7(e,t){const n=la(e,!0,t==="fixed"),s=n.top+e.clientTop,i=n.left+e.clientLeft,a=Vt(e)?xl(e):ys(1),c=e.clientWidth*a.x,f=e.clientHeight*a.y,d=i*a.x,p=s*a.y;return{width:c,height:f,x:d,y:p}}function wC(e,t,n){let s;if(t==="viewport")s=P7(e,n);else if(t==="document")s=D7(bs(e));else if(jt(t))s=L7(t,n);else{const i=OA(e);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Bh(s)}function kA(e,t){const n=no(e);return n===t||!jt(n)||Ks(n)?!1:mr(n).position==="fixed"||kA(n,t)}function U7(e,t){const n=t.get(e);if(n)return n;let s=Yo(e,[],!1).filter(f=>jt(f)&&hi(f)!=="body"),i=null;const a=mr(e).position==="fixed";let c=a?no(e):e;for(;jt(c)&&!Ks(c);){const f=mr(c),d=Zb(c);!d&&f.position==="fixed"&&(i=null),(a?!d&&!i:!d&&f.position==="static"&&!!i&&z7.has(i.position)||pi(c)&&!d&&kA(e,c))?s=s.filter(g=>g!==c):i=f,c=no(c)}return t.set(e,s),s}function $7(e){let{element:t,boundary:n,rootBoundary:s,strategy:i}=e;const c=[...n==="clippingAncestors"?mp(t)?[]:U7(t,this._c):[].concat(n),s],f=c[0],d=c.reduce((p,g)=>{const y=wC(t,g,i);return p.top=ar(y.top,p.top),p.right=Pl(y.right,p.right),p.bottom=Pl(y.bottom,p.bottom),p.left=ar(y.left,p.left),p},wC(t,f,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function B7(e){const{width:t,height:n}=AA(e);return{width:t,height:n}}function F7(e,t,n){const s=Vt(t),i=bs(t),a=n==="fixed",c=la(e,!0,a,t);let f={scrollLeft:0,scrollTop:0};const d=ys(0);function p(){d.x=Ep(i)}if(s||!s&&!a)if((hi(t)!=="body"||pi(i))&&(f=yp(t)),s){const x=la(t,!0,a,t);d.x=x.x+t.clientLeft,d.y=x.y+t.clientTop}else i&&p();a&&!s&&i&&p();const g=i&&!s&&!a?MA(i,f):ys(0),y=c.left+f.scrollLeft-d.x-g.x,b=c.top+f.scrollTop-d.y-g.y;return{x:y,y:b,width:c.width,height:c.height}}function Iy(e){return mr(e).position==="static"}function EC(e,t){if(!Vt(e)||mr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return bs(e)===n&&(n=n.ownerDocument.body),n}function IA(e,t){const n=an(e);if(mp(e))return n;if(!Vt(e)){let i=no(e);for(;i&&!Ks(i);){if(jt(i)&&!Iy(i))return i;i=no(i)}return n}let s=EC(e,t);for(;s&&p8(s)&&Iy(s);)s=EC(s,t);return s&&Ks(s)&&Iy(s)&&!Zb(s)?n:s||b8(e)||n}const H7=async function(e){const t=this.getOffsetParent||IA,n=this.getDimensions,s=await n(e.floating);return{reference:F7(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function q7(e){return mr(e).direction==="rtl"}const V7={convertOffsetParentRelativeRectToViewportRelativeRect:k7,getDocumentElement:bs,getClippingRect:$7,getOffsetParent:IA,getElementRects:H7,getClientRects:I7,getDimensions:B7,getScale:xl,isElement:jt,isRTL:q7};function DA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function K7(e,t){let n=null,s;const i=bs(e);function a(){var f;clearTimeout(s),(f=n)==null||f.disconnect(),n=null}function c(f,d){f===void 0&&(f=!1),d===void 0&&(d=1),a();const p=e.getBoundingClientRect(),{left:g,top:y,width:b,height:x}=p;if(f||t(),!b||!x)return;const S=fl(y),w=fl(i.clientWidth-(g+b)),T=fl(i.clientHeight-(y+x)),C=fl(g),N={rootMargin:-S+"px "+-w+"px "+-T+"px "+-C+"px",threshold:ar(0,Pl(1,d))||1};let R=!0;function k(L){const j=L[0].intersectionRatio;if(j!==d){if(!R)return c();j?c(!1,j):s=setTimeout(()=>{c(!1,1e-7)},1e3)}j===1&&!DA(p,e.getBoundingClientRect())&&c(),R=!1}try{n=new IntersectionObserver(k,{...N,root:i.ownerDocument})}catch{n=new IntersectionObserver(k,N)}n.observe(e)}return c(!0),a}function TC(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:d=!1}=s,p=lx(e),g=i||a?[...p?Yo(p):[],...Yo(t)]:[];g.forEach(C=>{i&&C.addEventListener("scroll",n,{passive:!0}),a&&C.addEventListener("resize",n)});const y=p&&f?K7(p,n):null;let b=-1,x=null;c&&(x=new ResizeObserver(C=>{let[A]=C;A&&A.target===p&&x&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var N;(N=x)==null||N.observe(t)})),n()}),p&&!d&&x.observe(p),x.observe(t));let S,w=d?la(e):null;d&&T();function T(){const C=la(e);w&&!DA(w,C)&&n(),w=C,S=requestAnimationFrame(T)}return n(),()=>{var C;g.forEach(A=>{i&&A.removeEventListener("scroll",n),a&&A.removeEventListener("resize",n)}),y?.(),(C=x)==null||C.disconnect(),x=null,d&&cancelAnimationFrame(S)}}const G7=R7,Z7=N7,Y7=E7,X7=A7,Q7=T7,W7=j7,J7=(e,t,n)=>{const s=new Map,i={platform:V7,...n},a={...i.platform,_c:s};return w7(e,t,{...i,platform:a})};var eK=typeof document<"u",tK=function(){},oh=eK?_.useLayoutEffect:tK;function Gh(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,s,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!Gh(e[s],t[s]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,i[s]))return!1;for(s=n;s--!==0;){const a=i[s];if(!(a==="_owner"&&e.$$typeof)&&!Gh(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function PA(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function CC(e,t){const n=PA(e);return Math.round(t*n)/n}function Dy(e){const t=_.useRef(e);return oh(()=>{t.current=e}),t}function nK(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:i,elements:{reference:a,floating:c}={},transform:f=!0,whileElementsMounted:d,open:p}=e,[g,y]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=_.useState(s);Gh(b,s)||x(s);const[S,w]=_.useState(null),[T,C]=_.useState(null),A=_.useCallback(B=>{B!==L.current&&(L.current=B,w(B))},[]),N=_.useCallback(B=>{B!==j.current&&(j.current=B,C(B))},[]),R=a||S,k=c||T,L=_.useRef(null),j=_.useRef(null),O=_.useRef(g),D=d!=null,K=Dy(d),F=Dy(i),z=Dy(p),X=_.useCallback(()=>{if(!L.current||!j.current)return;const B={placement:t,strategy:n,middleware:b};F.current&&(B.platform=F.current),J7(L.current,j.current,B).then(q=>{const U={...q,isPositioned:z.current!==!1};Y.current&&!Gh(O.current,U)&&(O.current=U,ui.flushSync(()=>{y(U)}))})},[b,t,n,F,z]);oh(()=>{p===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,y(B=>({...B,isPositioned:!1})))},[p]);const Y=_.useRef(!1);oh(()=>(Y.current=!0,()=>{Y.current=!1}),[]),oh(()=>{if(R&&(L.current=R),k&&(j.current=k),R&&k){if(K.current)return K.current(R,k,X);X()}},[R,k,X,K,D]);const te=_.useMemo(()=>({reference:L,floating:j,setReference:A,setFloating:N}),[A,N]),P=_.useMemo(()=>({reference:R,floating:k}),[R,k]),V=_.useMemo(()=>{const B={position:n,left:0,top:0};if(!P.floating)return B;const q=CC(P.floating,g.x),U=CC(P.floating,g.y);return f?{...B,transform:"translate("+q+"px, "+U+"px)",...PA(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:U}},[n,f,P.floating,g.x,g.y]);return _.useMemo(()=>({...g,update:X,refs:te,elements:P,floatingStyles:V}),[g,X,te,P,V])}const rK=(e,t)=>({...G7(e),options:[e,t]}),sK=(e,t)=>({...Z7(e),options:[e,t]}),oK=(e,t)=>({...W7(e),options:[e,t]}),iK=(e,t)=>({...Y7(e),options:[e,t]}),aK=(e,t)=>({...X7(e),options:[e,t]}),lK=(e,t)=>({...Q7(e),options:[e,t]}),cK={intentional:"onClick",sloppy:"onPointerDown"};function uK(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function fK(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingElement"),a=n.useState("referenceElement"),c=n.useState("domReferenceElement"),{onOpenChange:f,dataRef:d}=n.context,{enabled:p=!0,escapeKey:g=!0,outsidePress:y=!0,outsidePressEvent:b="sloppy",referencePress:x=!1,referencePressEvent:S="sloppy",ancestorScroll:w=!1,bubbles:T,externalTree:C}=t,A=wp(C),N=Ae(typeof y=="function"?y:()=>!1),R=typeof y=="function"?N:y,k=_.useRef(!1),{escapeKey:L,outsidePress:j}=uK(T),O=_.useRef(null),D=Jr(),K=Jr(),F=Ae(()=>{K.clear(),d.current.insideReactTree=!1}),z=_.useRef(!1),X=_.useRef(""),Y=Ae(re=>{X.current=re.pointerType}),te=Ae(()=>{const re=X.current,de=re==="pen"||!re?"mouse":re,ae=typeof b=="function"?b():b;return typeof ae=="string"?ae:ae[de]}),P=Ae(re=>{if(!s||!p||!g||re.key!=="Escape"||z.current)return;const de=d.current.floatingContext?.nodeId,ae=A?vl(A.nodesRef.current,de):[];if(!L&&ae.length>0){let xe=!0;if(ae.forEach(ye=>{ye.context?.open&&!ye.context.dataRef.current.__escapeKeyBubbles&&(xe=!1)}),!xe)return}const _e=CV(re)?re.nativeEvent:re,ve=Kt(T8,_e);n.setOpen(!1,ve),!L&&!ve.isPropagationAllowed&&re.stopPropagation()}),V=Ae(re=>{const de=te();return de==="intentional"&&re.type!=="click"||de==="sloppy"&&re.type==="click"}),B=Ae(()=>{d.current.insideReactTree=!0,K.start(0,F)}),q=Ae((re,de=!1)=>{if(V(re)){F();return}if(d.current.insideReactTree){F();return}if(te()==="intentional"&&de||typeof R=="function"&&!R(re))return;const ae=Ir(re),_e=`[${Cu("inert")}]`,ve=Rt(n.select("floatingElement")).querySelectorAll(_e),xe=n.context.triggerElements;if(ae&&(xe.hasElement(ae)||xe.hasMatchingElement(Ve=>Mt(Ve,ae))))return;let ye=jt(ae)?ae:null;for(;ye&&!Ks(ye);){const Ve=no(ye);if(Ks(Ve)||!jt(Ve))break;ye=Ve}if(ve.length&&jt(ae)&&!TV(ae)&&!Mt(ae,n.select("floatingElement"))&&Array.from(ve).every(Ve=>!Mt(ye,Ve)))return;if(Vt(ae)&&!("touches"in re)){const Ve=Ks(ae),Xe=mr(ae),$e=/auto|scroll/,We=Ve||$e.test(Xe.overflowX),Fe=Ve||$e.test(Xe.overflowY),me=We&&ae.clientWidth>0&&ae.scrollWidth>ae.clientWidth,Te=Fe&&ae.clientHeight>0&&ae.scrollHeight>ae.clientHeight,qe=Xe.direction==="rtl",mt=Te&&(qe?re.offsetX<=ae.offsetWidth-ae.clientWidth:re.offsetX>ae.clientWidth),ct=me&&re.offsetY>ae.clientHeight;if(mt||ct)return}const Le=d.current.floatingContext?.nodeId,ke=A&&vl(A.nodesRef.current,Le).some(Ve=>Yr(re,Ve.context?.elements.floating));if(Yr(re,n.select("floatingElement"))||Yr(re,n.select("domReferenceElement"))||ke)return;const we=A?vl(A.nodesRef.current,Le):[];if(we.length>0){let Ve=!0;if(we.forEach(Xe=>{Xe.context?.open&&!Xe.context.dataRef.current.__outsidePressBubbles&&(Ve=!1)}),!Ve)return}n.setOpen(!1,Kt(Bj,re)),F()}),U=Ae(re=>{te()!=="sloppy"||re.pointerType==="touch"||!n.select("open")||!p||Yr(re,n.select("floatingElement"))||Yr(re,n.select("domReferenceElement"))||q(re)}),I=Ae(re=>{if(te()!=="sloppy"||!n.select("open")||!p||Yr(re,n.select("floatingElement"))||Yr(re,n.select("domReferenceElement")))return;const de=re.touches[0];de&&(O.current={startTime:Date.now(),startX:de.clientX,startY:de.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{O.current&&(O.current.dismissOnTouchEnd=!1,O.current.dismissOnMouseDown=!1)}))}),G=Ae(re=>{const de=Ir(re);function ae(){I(re),de?.removeEventListener(re.type,ae)}de?.addEventListener(re.type,ae)}),W=Ae(re=>{const de=k.current;if(k.current=!1,D.clear(),re.type==="mousedown"&&O.current&&!O.current.dismissOnMouseDown)return;const ae=Ir(re);function _e(){re.type==="pointerdown"?U(re):q(re,de),ae?.removeEventListener(re.type,_e)}ae?.addEventListener(re.type,_e)}),Q=Ae(re=>{if(te()!=="sloppy"||!O.current||Yr(re,n.select("floatingElement"))||Yr(re,n.select("domReferenceElement")))return;const de=re.touches[0];if(!de)return;const ae=Math.abs(de.clientX-O.current.startX),_e=Math.abs(de.clientY-O.current.startY),ve=Math.sqrt(ae*ae+_e*_e);ve>5&&(O.current.dismissOnTouchEnd=!0),ve>10&&(q(re),D.clear(),O.current=null)}),se=Ae(re=>{const de=Ir(re);function ae(){Q(re),de?.removeEventListener(re.type,ae)}de?.addEventListener(re.type,ae)}),oe=Ae(re=>{te()!=="sloppy"||!O.current||Yr(re,n.select("floatingElement"))||Yr(re,n.select("domReferenceElement"))||(O.current.dismissOnTouchEnd&&q(re),D.clear(),O.current=null)}),pe=Ae(re=>{const de=Ir(re);function ae(){oe(re),de?.removeEventListener(re.type,ae)}de?.addEventListener(re.type,ae)});_.useEffect(()=>{if(!s||!p)return;d.current.__escapeKeyBubbles=L,d.current.__outsidePressBubbles=j;const re=new si;function de(ye){n.setOpen(!1,Kt(ri,ye))}function ae(){re.clear(),z.current=!0}function _e(){re.start(gp()?5:0,()=>{z.current=!1})}const ve=Rt(i);ve.addEventListener("pointerdown",Y,!0),g&&(ve.addEventListener("keydown",P),ve.addEventListener("compositionstart",ae),ve.addEventListener("compositionend",_e)),R&&(ve.addEventListener("click",W,!0),ve.addEventListener("pointerdown",W,!0),ve.addEventListener("touchstart",G,!0),ve.addEventListener("touchmove",se,!0),ve.addEventListener("touchend",pe,!0),ve.addEventListener("mousedown",W,!0));let xe=[];return w&&(jt(c)&&(xe=Yo(c)),jt(i)&&(xe=xe.concat(Yo(i))),!jt(a)&&a&&a.contextElement&&(xe=xe.concat(Yo(a.contextElement)))),xe=xe.filter(ye=>ye!==ve.defaultView?.visualViewport),xe.forEach(ye=>{ye.addEventListener("scroll",de,{passive:!0})}),()=>{ve.removeEventListener("pointerdown",Y,!0),g&&(ve.removeEventListener("keydown",P),ve.removeEventListener("compositionstart",ae),ve.removeEventListener("compositionend",_e)),R&&(ve.removeEventListener("click",W,!0),ve.removeEventListener("pointerdown",W,!0),ve.removeEventListener("touchstart",G,!0),ve.removeEventListener("touchmove",se,!0),ve.removeEventListener("touchend",pe,!0),ve.removeEventListener("mousedown",W,!0)),xe.forEach(ye=>{ye.removeEventListener("scroll",de)}),re.clear(),k.current=!1}},[d,i,a,c,g,R,s,f,w,p,L,j,P,q,W,U,G,se,pe,Y,n]),_.useEffect(F,[R,F]);const Se=_.useMemo(()=>({onKeyDown:P,...x&&{[cK[S]]:re=>{n.setOpen(!1,Kt(aC,re.nativeEvent))},...S!=="intentional"&&{onClick(re){n.setOpen(!1,Kt(aC,re.nativeEvent))}}}}),[P,n,x,S]),he=Ae(re=>{const de=Ir(re.nativeEvent);!Mt(n.select("floatingElement"),de)||re.button!==0||(k.current=!0)}),He=Ae(re=>{!s||!p||re.button!==0||(k.current=!0)}),Ee=_.useMemo(()=>({onKeyDown:P,onPointerDown:he,onMouseDown:he,onMouseUp:he,onClickCapture:B,onMouseDownCapture(re){B(),He(re)},onPointerDownCapture(re){B(),He(re)},onMouseUpCapture:B,onTouchEndCapture:B,onTouchMoveCapture:B}),[P,he,B,He]);return _.useMemo(()=>p?{reference:Se,floating:Ee,trigger:Se}:{},[p,Se,Ee])}ij({memoize:vq,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Ie=(e,t,n,s,i,a,...c)=>{if(c.length>0)throw new Error(pn(1));let f;if(e)f=e;else throw new Error("Missing arguments");return f};var dK=ZN();const hK=Kb(19),pK=hK?gK:yK;function at(e,t,n,s,i){return pK(e,t,n,s,i)}function mK(e,t,n,s,i){const a=_.useCallback(()=>t(e.getSnapshot(),n,s,i),[e,t,n,s,i]);return dK.useSyncExternalStore(e.subscribe,a,a)}function gK(e,t,n,s,i){return mK(e,t,n,s,i)}function yK(e,t,n,s,i){return YN.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,a=>t(a,n,s,i))}class vK{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 s of this.listeners){if(n!==this.updateTick)return;s(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,s,i){return at(this,t,n,s,i)}}class zA extends vK{constructor(t,n={},s){super(t),this.context=n,this.selectors=s}useSyncedValue(t,n){_.useDebugValue(t),ze(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const s=this;ze(()=>(s.state[t]!==n&&s.set(t,n),()=>{s.set(t,void 0)}),[s,t,n])}useSyncedValues(t){const n=this,s=Object.values(t);ze(()=>{n.update(t)},[n,...s])}useControlledProp(t,n){_.useDebugValue(t);const s=n!==void 0;ze(()=>{s&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,s])}select(t,n,s,i){const a=this.selectors[t];return a(this.state,n,s,i)}useState(t,n,s,i){return _.useDebugValue(t),at(this,this.selectors[t],n,s,i)}useContextCallback(t,n){_.useDebugValue(t);const s=Ae(n??Cn);this.context[t]=s}useStateSetter(t){const n=_.useRef(void 0);return n.current===void 0&&(n.current=s=>{this.set(t,s)}),n.current}observe(t,n){let s;typeof t=="function"?s=t:s=this.selectors[t];let i=s(this.state);return n(i,i,this),this.subscribe(a=>{const c=s(a);if(!Object.is(i,c)){const f=i;i=c,n(c,f,this)}})}}const bK={open:Ie(e=>e.open),domReferenceElement:Ie(e=>e.domReferenceElement),referenceElement:Ie(e=>e.positionReference??e.referenceElement),floatingElement:Ie(e=>e.floatingElement),floatingId:Ie(e=>e.floatingId)};class cx extends zA{constructor(t){const{nested:n,noEmit:s,onOpenChange:i,triggerElements:a,...c}=t;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:u7(),nested:n,noEmit:s,triggerElements:a},bK)}setOpen=(t,n)=>{if((!t||!this.state.open||AV(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const s={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",s)}this.context.onOpenChange?.(t,n)}}function Tp(e,t=!1,n=!1){const[s,i]=_.useState(e&&t?"idle":void 0),[a,c]=_.useState(e);return e&&!a&&(c(!0),i("starting")),!e&&a&&s!=="ending"&&!n&&i("ending"),!e&&!a&&s==="ending"&&i(void 0),ze(()=>{if(!e&&a&&s!=="ending"&&n){const f=ps.request(()=>{i("ending")});return()=>{ps.cancel(f)}}},[e,a,s,n]),ze(()=>{if(!e||t)return;const f=ps.request(()=>{i(void 0)});return()=>{ps.cancel(f)}},[t,e]),ze(()=>{if(!e||!t)return;e&&a&&s!=="idle"&&i("starting");const f=ps.request(()=>{i("idle")});return()=>{ps.cancel(f)}},[t,e,a,i,s]),_.useMemo(()=>({mounted:a,setMounted:c,transitionStatus:s}),[a,s])}let Ru=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const xK={[Ru.startingStyle]:""},SK={[Ru.endingStyle]:""},ga={transitionStatus(e){return e==="starting"?xK:e==="ending"?SK:null}};function _K(e,t=!1,n=!0){const s=ix();return Ae((i,a=null)=>{s.cancel();function c(){ui.flushSync(i)}const f=Bs(e);if(f==null)return;const d=f;if(typeof d.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{let y=function(){const x=Ru.startingStyle;if(!d.hasAttribute(x)){s.request(b);return}const S=new MutationObserver(()=>{d.hasAttribute(x)||(S.disconnect(),b())});S.observe(d,{attributes:!0,attributeFilter:[x]}),a?.addEventListener("abort",()=>S.disconnect(),{once:!0})},b=function(){Promise.all(d.getAnimations().map(x=>x.finished)).then(()=>{a?.aborted||c()}).catch(()=>{const x=d.getAnimations();if(n){if(a?.aborted)return;c()}else x.length>0&&x.some(S=>S.pending||S.playState!=="finished")&&b()})};var p=y,g=b;if(t){y();return}s.request(b)}})}function ya(e){const{enabled:t=!0,open:n,ref:s,onComplete:i}=e,a=Ae(i),c=_K(s,n,!1);_.useEffect(()=>{if(!t)return;const f=new AbortController;return c(a,f.signal),()=>{f.abort()}},[t,n,a,c])}function wK(e){const t=e.useState("open");ze(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[s,i]=n.value;e.update({activeTriggerId:s,activeTriggerElement:i})}}},[t,e])}function EK(e,t,n){const{mounted:s,setMounted:i,transitionStatus:a}=Tp(e);t.useSyncedValues({mounted:s,transitionStatus:a});const c=Ae(()=>{i(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),f=t.useState("preventUnmountingOnClose");return ya({enabled:!f,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:a}}class ux{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const s=this.idMap.get(t);s!==n&&(s!==void 0&&this.elementsSet.delete(s),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 TK(){return new cx({open:!1,floatingElement:null,referenceElement:null,triggerElements:new ux,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function CK(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:TK(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:rn,inactiveTriggerProps:rn,popupProps:rn}}const Ld=Ie(e=>e.triggerIdProp??e.activeTriggerId),RK={open:Ie(e=>e.openProp??e.open),mounted:Ie(e=>e.mounted),transitionStatus:Ie(e=>e.transitionStatus),floatingRootContext:Ie(e=>e.floatingRootContext),preventUnmountingOnClose:Ie(e=>e.preventUnmountingOnClose),payload:Ie(e=>e.payload),activeTriggerId:Ld,activeTriggerElement:Ie(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Ie((e,t)=>t!==void 0&&Ld(e)===t),isOpenedByTrigger:Ie((e,t)=>t!==void 0&&Ld(e)===t&&e.open),isMountedByTrigger:Ie((e,t)=>t!==void 0&&Ld(e)===t&&e.mounted),triggerProps:Ie((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Ie(e=>e.popupProps),popupElement:Ie(e=>e.popupElement),positionerElement:Ie(e=>e.positionerElement)};function NK(e){const{open:t=!1,onOpenChange:n,elements:s={}}=e,i=Gu(),a=_p()!=null,c=In(()=>new cx({open:t,onOpenChange:n,referenceElement:s.reference??null,floatingElement:s.floating??null,triggerElements:new ux,floatingId:i,nested:a,noEmit:!1})).current;return ze(()=>{const f={open:t,floatingId:i};s.reference!==void 0&&(f.referenceElement=s.reference,f.domReferenceElement=jt(s.reference)?s.reference:null),s.floating!==void 0&&(f.floatingElement=s.floating),c.update(f)},[t,i,s.reference,s.floating,c]),c.context.onOpenChange=n,c.context.nested=a,c.context.noEmit=!1,c}function jK(e={}){const{nodeId:t,externalTree:n}=e,s=NK(e),i=e.rootContext||s,a={reference:i.useState("referenceElement"),floating:i.useState("floatingElement"),domReference:i.useState("domReferenceElement")},[c,f]=_.useState(null),d=_.useRef(null),p=wp(n);ze(()=>{a.domReference&&(d.current=a.domReference)},[a.domReference]);const g=nK({...e,elements:{...a,...c&&{reference:c}}}),y=_.useCallback(j=>{const O=jt(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),getClientRects:()=>j.getClientRects(),contextElement:j}:j;f(O),g.refs.setReference(O)},[g.refs]),[b,x]=_.useState(null),[S,w]=_.useState(null);i.useSyncedValue("referenceElement",b),i.useSyncedValue("domReferenceElement",jt(b)?b:null),i.useSyncedValue("floatingElement",S);const T=_.useCallback(j=>{(jt(j)||j===null)&&(d.current=j,x(j)),(jt(g.refs.reference.current)||g.refs.reference.current===null||j!==null&&!jt(j))&&g.refs.setReference(j)},[g.refs,x]),C=_.useCallback(j=>{w(j),g.refs.setFloating(j)},[g.refs]),A=_.useMemo(()=>({...g.refs,setReference:T,setFloating:C,setPositionReference:y,domReference:d}),[g.refs,T,C,y]),N=_.useMemo(()=>({...g.elements,domReference:a.domReference}),[g.elements,a.domReference]),R=i.useState("open"),k=i.useState("floatingId"),L=_.useMemo(()=>({...g,dataRef:i.context.dataRef,open:R,onOpenChange:i.setOpen,events:i.context.events,floatingId:k,refs:A,elements:N,nodeId:t,rootStore:i}),[g,A,N,t,i,R,k]);return ze(()=>{i.context.dataRef.current.floatingContext=L;const j=p?.nodesRef.current.find(O=>O.id===t);j&&(j.context=L)}),_.useMemo(()=>({...g,context:L,refs:A,elements:N,rootStore:i}),[g,A,N,L,i])}function AK(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:s=!1,onOpenChange:i}=e,a=Gu(),c=_p()!=null,f=t.useState("open"),d=t.useState("activeTriggerElement"),p=t.useState(s?"popupElement":"positionerElement"),g=t.context.triggerElements,y=In(()=>new cx({open:f,referenceElement:d,floatingElement:p,triggerElements:g,onOpenChange:i,floatingId:a,nested:c,noEmit:n})).current;return ze(()=>{const b={open:f,floatingId:a,referenceElement:d,floatingElement:p};jt(d)&&(b.domReferenceElement=d),y.state.positionReference===y.state.referenceElement&&(b.positionReference=d),y.update(b)},[f,a,d,p,y]),y.context.onOpenChange=i,y.context.nested=c,y.context.noEmit=n,y}const RC=Cu("safe-polygon"),OK=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${uA}`;function MK(e){return e?!!e.closest(OK):!1}class fx{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 si,this.restTimeout=new si,this.handleCloseOptions=void 0}static create(){return new fx}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}function kK(e){const t=In(fx.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),tx(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const IK=new Set(["click","mousedown"]);function DK(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingElement"),a=n.useState("domReferenceElement"),{dataRef:c}=n.context,{enabled:f=!0,closeDelay:d=0}=t,p=kK(n),g=wp(),y=_p(),b=Ae(()=>p.interactedInside?!0:c.current.openEvent?IK.has(c.current.openEvent.type):!1),x=Ae(()=>{const N=c.current.openEvent?.type;return N?.includes("mouse")&&N!=="mousedown"}),S=Ae(N=>EV(N,n.context.triggerElements)),w=_.useCallback((N,R=!0)=>{const k=PK(d,p.pointerType);k&&!p.handler?p.openChangeTimeout.start(k,()=>n.setOpen(!1,Kt(Mv,N))):R&&(p.openChangeTimeout.clear(),n.setOpen(!1,Kt(Mv,N)))},[d,n,p]),T=Ae(()=>{p.unbindMouseMove(),p.handler=void 0}),C=Ae(()=>{if(p.performedPointerEventsMutation){const N=Rt(i).body;N.style.pointerEvents="",N.removeAttribute(RC),p.performedPointerEventsMutation=!1}}),A=Ae(N=>{const R=Ir(N);if(!MK(R)){p.interactedInside=!1;return}p.interactedInside=!0});ze(()=>{s||(p.pointerType=void 0,p.restTimeoutPending=!1,p.interactedInside=!1,T(),C())},[s,p,T,C]),_.useEffect(()=>()=>{T()},[T]),_.useEffect(()=>C,[C]),ze(()=>{if(f&&s&&p.handleCloseOptions?.blockPointerEvents&&x()&&jt(a)&&i){p.performedPointerEventsMutation=!0;const N=Rt(i).body;N.setAttribute(RC,"");const R=a,k=i,L=g?.nodesRef.current.find(j=>j.id===y)?.context?.elements.floating;return L&&(L.style.pointerEvents=""),N.style.pointerEvents="none",R.style.pointerEvents="auto",k.style.pointerEvents="auto",()=>{N.style.pointerEvents="",R.style.pointerEvents="",k.style.pointerEvents=""}}},[f,s,a,i,p,x,g,y]),_.useEffect(()=>{if(!f)return;function N(j){b()||!c.current.floatingContext||!n.select("open")||S(j.relatedTarget)||(C(),T(),b()||w(j))}function R(j){p.openChangeTimeout.clear(),C(),p.handler?.(j),T()}function k(j){b()||w(j,!1)}const L=i;return L&&(L.addEventListener("mouseleave",N),L.addEventListener("mouseenter",R),L.addEventListener("mouseleave",k),L.addEventListener("pointerdown",A,!0)),()=>{L&&(L.removeEventListener("mouseleave",N),L.removeEventListener("mouseenter",R),L.removeEventListener("mouseleave",k),L.removeEventListener("pointerdown",A,!0))}},[f,i,n,c,b,S,w,C,T,A,p])}function PK(e,t){return t&&!jV(t)?0:typeof e=="function"?e():e}function zK(e=[]){const t=e.map(p=>p?.reference),n=e.map(p=>p?.floating),s=e.map(p=>p?.item),i=e.map(p=>p?.trigger),a=_.useCallback(p=>Ud(p,e,"reference"),t),c=_.useCallback(p=>Ud(p,e,"floating"),n),f=_.useCallback(p=>Ud(p,e,"item"),s),d=_.useCallback(p=>Ud(p,e,"trigger"),i);return _.useMemo(()=>({getReferenceProps:a,getFloatingProps:c,getItemProps:f,getTriggerProps:d}),[a,c,f,d])}function Ud(e,t,n){const s=new Map,i=n==="item",a={};n==="floating"&&(a.tabIndex=-1,a[Iv]="");for(const c in e)i&&e&&(c===lA||c===cA)||(a[c]=e[c]);for(let c=0;c<t.length;c+=1){let f;const d=t[c]?.[n];typeof d=="function"?f=e?d(e):null:f=d,f&&NC(a,f,i,s)}return NC(a,e,i,s),a}function NC(e,t,n,s){for(const i in t){const a=t[i];n&&(i===lA||i===cA)||(i.startsWith("on")?(s.has(i)||s.set(i,[]),typeof a=="function"&&(s.get(i)?.push(a),e[i]=(...c)=>s.get(i)?.map(f=>f(...c)).find(f=>f!==void 0))):e[i]=a)}}const LK=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function UK(e,t={}){const n="rootStore"in e?e.rootStore:e,s=n.useState("open"),i=n.useState("floatingId"),a=n.useState("domReferenceElement"),c=n.useState("floatingElement"),{role:f="dialog"}=t,d=Gu(),p=a?.id||d,g=_.useMemo(()=>Lh(c)?.id||i,[c,i]),y=LK.get(f)??f,x=_p()!=null,S=_.useMemo(()=>y==="tooltip"||f==="label"?rn:{"aria-haspopup":y==="alertdialog"?"dialog":y,"aria-expanded":"false",...y==="listbox"&&{role:"combobox"},...y==="menu"&&x&&{role:"menuitem"},...f==="select"&&{"aria-autocomplete":"none"},...f==="combobox"&&{"aria-autocomplete":"list"}},[y,x,f]),w=_.useMemo(()=>y==="tooltip"||f==="label"?{[`aria-${f==="label"?"labelledby":"describedby"}`]:s?g:void 0}:{...S,"aria-expanded":s?"true":"false","aria-controls":s?g:void 0,...y==="menu"&&{id:p}},[y,g,s,p,f,S]),T=_.useMemo(()=>{const A={id:g,...y&&{role:y}};return y==="tooltip"||f==="label"?A:{...A,...y==="menu"&&{"aria-labelledby":p}}},[y,g,p,f]),C=_.useCallback(({active:A,selected:N})=>{const R={role:"option",...A&&{id:`${g}-fui-option`}};switch(f){case"select":case"combobox":return{...R,"aria-selected":N}}return{}},[g,f]);return _.useMemo(()=>({reference:w,floating:T,item:C,trigger:S}),[w,T,S,C])}let Gi=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Ru.startingStyle]="startingStyle",e[e.endingStyle=Ru.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),jC=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const $K={[jC.popupOpen]:"",[jC.pressed]:""},BK={[Gi.open]:""},FK={[Gi.closed]:""},HK={[Gi.anchorHidden]:""},qK={open(e){return e?$K:null}},rc={open(e){return e?BK:FK},anchorHidden(e){return e?HK:null}},LA=_.createContext(void 0);function VK(){const e=_.useContext(LA);if(e===void 0)throw new Error(pn(70));return e}const KK=_.forwardRef(function(t,n){const{children:s,container:i,className:a,render:c,...f}=t,{portalNode:d,portalSubtree:p}=CA({container:i,ref:n,componentProps:t,elementProps:f});return!p&&!d?null:h.jsxs(_.Fragment,{children:[p,d&&ui.createPortal(s,d)]})}),GK=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t;return ex().useState("mounted")||s?h.jsx(LA.Provider,{value:s,children:h.jsx(KK,{ref:n,...i})}):null}),UA=_.createContext(void 0);function ZK(){const e=_.useContext(UA);if(e===void 0)throw new Error(pn(71));return e}const YK=_.createContext(void 0);function $A(){return _.useContext(YK)?.direction??"ltr"}const XK=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:i,rects:a,platform:c,elements:f,middlewareData:d}=t,{element:p,padding:g=0,offsetParent:y="real"}=ro(e,t)||{};if(p==null)return{};const b=dA(g),x={x:n,y:s},S=ox(i),w=sx(S),T=await c.getDimensions(p),C=S==="y",A=C?"top":"left",N=C?"bottom":"right",R=C?"clientHeight":"clientWidth",k=a.reference[w]+a.reference[S]-x[S]-a.floating[w],L=x[S]-a.reference[S],j=y==="real"?await c.getOffsetParent?.(p):f.floating;let O=f.floating[R]||a.floating[w];(!O||!await c.isElement?.(j))&&(O=f.floating[R]||a.floating[w]);const D=k/2-L/2,K=O/2-T[w]/2-1,F=Math.min(b[A],K),z=Math.min(b[N],K),X=F,Y=O-T[w]-z,te=O/2-T[w]/2+D,P=Dv(X,te,Y),V=!d.arrow&&yi(i)!=null&&te!==P&&a.reference[w]/2-(te<X?F:z)-T[w]/2<0,B=V?te<X?te-X:te-Y:0;return{[S]:x[S]+B,data:{[S]:P,centerOffset:te-P-B,...V&&{alignmentOffset:B}},reset:V}}}),QK=(e,t)=>({...XK(e),options:[e,t]}),WK={name:"hide",async fn(e){const{width:t,height:n,x:s,y:i}=e.rects.reference,a=t===0&&n===0&&s===0&&i===0;return{data:{referenceHidden:(await lK().fn(e)).data?.referenceHidden||a}}}},ih={sideX:"left",sideY:"top"},JK={name:"adaptiveOrigin",async fn(e){const{x:t,y:n,rects:{floating:s},elements:{floating:i},platform:a,strategy:c,placement:f}=e,d=an(i),p=d.getComputedStyle(i);if(!(p.transitionDuration!=="0s"&&p.transitionDuration!==""))return{x:t,y:n,data:ih};const y=await a.getOffsetParent?.(i);let b={width:0,height:0};if(c==="fixed"&&d?.visualViewport)b={width:d.visualViewport.width,height:d.visualViewport.height};else if(y===d){const A=Rt(i);b={width:A.documentElement.clientWidth,height:A.documentElement.clientHeight}}else await a.isElement?.(y)&&(b=await a.getDimensions(y));const x=qn(f);let S=t,w=n;x==="left"&&(S=b.width-(t+s.width)),x==="top"&&(w=b.height-(n+s.height));const T=x==="left"?"right":ih.sideX,C=x==="top"?"bottom":ih.sideY;return{x:S,y:w,data:{sideX:T,sideY:C}}}};function BA(e,t,n){const s=e==="inline-start"||e==="inline-end";return{top:"top",right:s?n?"inline-start":"inline-end":"right",bottom:"bottom",left:s?n?"inline-end":"inline-start":"left"}[t]}function AC(e,t,n){const{rects:s,placement:i}=e;return{side:BA(t,qn(i),n),align:yi(i)||"center",anchor:{width:s.reference.width,height:s.reference.height},positioner:{width:s.floating.width,height:s.floating.height}}}function FA(e){const{anchor:t,positionMethod:n="absolute",side:s="bottom",sideOffset:i=0,align:a="center",alignOffset:c=0,collisionBoundary:f,collisionPadding:d=5,sticky:p=!1,arrowPadding:g=5,disableAnchorTracking:y=!1,keepMounted:b=!1,floatingRootContext:x,mounted:S,collisionAvoidance:w,shiftCrossAxis:T=!1,nodeId:C,adaptiveOrigin:A,lazyFlip:N=!1,externalTree:R}=e,[k,L]=_.useState(null);!S&&k!==null&&L(null);const j=w.side||"flip",O=w.align||"flip",D=w.fallbackAxisSide||"end",K=typeof t=="function"?t:void 0,F=Ae(K),z=K?F:t,X=Xo(t),te=$A()==="rtl",P=k||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":te?"left":"right","inline-start":te?"right":"left"}[s],V=a==="center"?P:`${P}-${a}`;let B=d;const q=1,U=s==="bottom"?q:0,I=s==="top"?q:0,G=s==="right"?q:0,W=s==="left"?q:0;typeof B=="number"?B={top:B+U,right:B+W,bottom:B+I,left:B+G}:B&&(B={top:(B.top||0)+U,right:(B.right||0)+W,bottom:(B.bottom||0)+I,left:(B.left||0)+G});const Q={boundary:f==="clipping-ancestors"?"clippingAncestors":f,padding:B},se=_.useRef(null),oe=Xo(i),pe=Xo(c),He=[rK(ot=>{const Yt=AC(ot,s,te),mn=typeof oe.current=="function"?oe.current(Yt):oe.current,Ot=typeof pe.current=="function"?pe.current(Yt):pe.current;return{mainAxis:mn,crossAxis:Ot,alignmentAxis:Ot}},[typeof i!="function"?i:0,typeof c!="function"?c:0,te,s])],Ee=O==="none"&&j!=="shift",re=!Ee&&(p||T||j==="shift"),de=j==="none"?null:iK({...Q,padding:{top:B.top+q,right:B.right+q,bottom:B.bottom+q,left:B.left+q},mainAxis:!T&&j==="flip",crossAxis:O==="flip"?"alignment":!1,fallbackAxisSideDirection:D}),ae=Ee?null:sK(ot=>{const Yt=Rt(ot.elements.floating).documentElement;return{...Q,rootBoundary:T?{x:0,y:0,width:Yt.clientWidth,height:Yt.clientHeight}:void 0,mainAxis:O!=="none",crossAxis:re,limiter:p||T?void 0:oK(mn=>{if(!se.current)return{};const{width:Ot,height:wn}=se.current.getBoundingClientRect(),Yn=zr(qn(mn.placement)),Rn=Yn==="y"?Ot:wn,ss=Yn==="y"?B.left+B.right:B.top+B.bottom;return{offset:Rn/2+ss/2}})}},[Q,p,T,B,O]);j==="shift"||O==="shift"||a==="center"?He.push(ae,de):He.push(de,ae),He.push(aK({...Q,apply({elements:{floating:ot},rects:{reference:Yt},availableWidth:mn,availableHeight:Ot}){const wn=ot.style;wn.setProperty("--available-width",`${mn}px`),wn.setProperty("--available-height",`${Ot}px`),wn.setProperty("--anchor-width",`${Yt.width}px`),wn.setProperty("--anchor-height",`${Yt.height}px`)}}),QK(()=>({element:se.current||document.createElement("div"),padding:g,offsetParent:"floating"}),[g]),{name:"transformOrigin",fn(ot){const{elements:Yt,middlewareData:mn,placement:Ot,rects:wn,y:Yn}=ot,Rn=qn(Ot),ss=zr(Rn),os=se.current,ba=mn.arrow?.x||0,bi=mn.arrow?.y||0,xi=os?.clientWidth||0,xs=os?.clientHeight||0,Xn=ba+xi/2,is=bi+xs/2,ao=Math.abs(mn.shift?.y||0),lo=wn.reference.height/2,Qn=typeof i=="function"?i(AC(ot,s,te)):i,oc=ao>Qn,nf={top:`${Xn}px calc(100% + ${Qn}px)`,bottom:`${Xn}px ${-Qn}px`,left:`calc(100% + ${Qn}px) ${is}px`,right:`${-Qn}px ${is}px`}[Rn],rf=`${Xn}px ${wn.reference.y+lo-Yn}px`;return Yt.floating.style.setProperty("--transform-origin",re&&ss==="y"&&oc?rf:nf),{}}},WK,A),ze(()=>{!S&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[S,x]);const _e=_.useMemo(()=>({elementResize:!y&&typeof ResizeObserver<"u",layoutShift:!y&&typeof IntersectionObserver<"u"}),[y]),{refs:ve,elements:xe,x:ye,y:Le,middlewareData:ke,update:we,placement:Ve,context:Xe,isPositioned:$e,floatingStyles:We}=jK({rootContext:x,placement:V,middleware:He,strategy:n,whileElementsMounted:b?void 0:(...ot)=>TC(...ot,_e),nodeId:C,externalTree:R}),{sideX:Fe,sideY:me}=ke.adaptiveOrigin||ih,Te=$e?n:"fixed",qe=_.useMemo(()=>{const ot=A?{position:Te,[Fe]:ye,[me]:Le}:{position:Te,...We};return $e||(ot.opacity=0),ot},[A,Te,Fe,ye,me,Le,We,$e]),mt=_.useRef(null);ze(()=>{if(!S)return;const ot=X.current,Yt=typeof ot=="function"?ot():ot,Ot=(OC(Yt)?Yt.current:Yt)||null||null;Ot!==mt.current&&(ve.setPositionReference(Ot),mt.current=Ot)},[S,ve,z,X]),_.useEffect(()=>{if(!S)return;const ot=X.current;typeof ot!="function"&&OC(ot)&&ot.current!==mt.current&&(ve.setPositionReference(ot.current),mt.current=ot.current)},[S,ve,z,X]),_.useEffect(()=>{if(b&&S&&xe.domReference&&xe.floating)return TC(xe.domReference,xe.floating,we,_e)},[b,S,xe,we,_e]);const ct=qn(Ve),br=BA(s,ct,te),xr=yi(Ve)||"center",Zt=!!ke.hide?.referenceHidden;ze(()=>{N&&S&&$e&&L(ct)},[N,S,$e,ct]);const ut=_.useMemo(()=>({position:"absolute",top:ke.arrow?.y,left:ke.arrow?.x}),[ke.arrow]),xt=ke.arrow?.centerOffset!==0;return _.useMemo(()=>({positionerStyles:qe,arrowStyles:ut,arrowRef:se,arrowUncentered:xt,side:br,align:xr,physicalSide:ct,anchorHidden:Zt,refs:ve,context:Xe,isPositioned:$e,update:we}),[qe,ut,se,xt,br,xr,ct,Zt,ve,Xe,$e,we])}function OC(e){return e!=null&&"current"in e}function Cp(e){return e==="starting"?t8:rn}const eG=_.forwardRef(function(t,n){const{render:s,className:i,anchor:a,positionMethod:c="absolute",side:f="top",align:d="center",sideOffset:p=0,alignOffset:g=0,collisionBoundary:y="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:S=!1,disableAnchorTracking:w=!1,collisionAvoidance:T=s8,...C}=t,A=ex(),N=VK(),R=A.useState("open"),k=A.useState("mounted"),L=A.useState("trackCursorAxis"),j=A.useState("disableHoverablePopup"),O=A.useState("floatingRootContext"),D=A.useState("instantType"),K=A.useState("transitionStatus"),F=A.useState("hasViewport"),z=FA({anchor:a,positionMethod:c,floatingRootContext:O,mounted:k,side:f,sideOffset:p,align:d,alignOffset:g,collisionBoundary:y,collisionPadding:b,sticky:S,arrowPadding:x,disableAnchorTracking:w,keepMounted:N,collisionAvoidance:T,adaptiveOrigin:F?JK:void 0}),X=_.useMemo(()=>{const V={};return(!R||L==="both"||j)&&(V.pointerEvents="none"),{role:"presentation",hidden:!k,style:{...z.positionerStyles,...V}}},[R,L,j,k,z.positionerStyles]),Y=_.useMemo(()=>({open:R,side:z.side,align:z.align,anchorHidden:z.anchorHidden,instant:L!=="none"?"tracking-cursor":D}),[R,z.side,z.align,z.anchorHidden,L,D]),te=_.useMemo(()=>({...Y,arrowRef:z.arrowRef,arrowStyles:z.arrowStyles,arrowUncentered:z.arrowUncentered}),[Y,z.arrowRef,z.arrowStyles,z.arrowUncentered]),P=Pt("div",t,{state:Y,props:[X,Cp(K),C],ref:[n,A.useStateSetter("positionerElement")],stateAttributesMapping:rc});return h.jsx(UA.Provider,{value:te,children:P})}),tG={...rc,...ga},nG=_.forwardRef(function(t,n){const{className:s,render:i,...a}=t,c=ex(),{side:f,align:d}=ZK(),p=c.useState("open"),g=c.useState("instantType"),y=c.useState("transitionStatus"),b=c.useState("popupProps"),x=c.useState("floatingRootContext");ya({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}});const S=c.useState("disabled"),w=c.useState("closeDelay");return DK(x,{enabled:!S,closeDelay:w}),Pt("div",t,{state:{open:p,side:f,align:d,instant:g,transitionStatus:y},ref:[n,c.context.popupRef,c.useStateSetter("popupElement")],props:[b,Cp(y),a],stateAttributesMapping:tG})});function dx(e){return Kb(19)?e:e?"true":void 0}const rG=_.forwardRef(({className:e,sideOffset:t=4,children:n,...s},i)=>h.jsx(GK,{children:h.jsx(eG,{sideOffset:t,children:h.jsx(nG,{ref:i,className:ge("bg-[#1e1e1e] border border-neutral-700 rounded-md px-2.5 py-1.5 text-xs text-neutral-300 font-mono shadow-lg",e),...s,children:n})})}));rG.displayName="TooltipContent";function MC(e){return e==="online"?"#22c55e":e==="syncing"?"#f59e0b":"#ef4444"}const HA=_.forwardRef(({className:e,clients:t,positions:n,relayClientIds:s=[],serverPosition:i={x:420,y:190},relayPosition:a={x:780,y:190},viewBox:c={width:1200,height:380},totalNodes:f,onlineCount:d,offlineCount:p,...g},y)=>{const b=i.x,x=i.y,S=a.x,w=a.y,T={},C=2*Math.PI/Math.max(t.length,1);t.forEach((j,O)=>{const D=s.includes(j.id),K=D?S:b,F=D?w:x,z=D?240:260,X=D?130:150,Y=C*O-Math.PI/2;T[j.id]={x:K+z*Math.cos(Y),y:F+X*Math.sin(Y)}});const A={};if(n)for(const j of n)A[j.clientId]={x:j.x,y:j.y};function N(j){return A[j]??T[j]??{x:600,y:190}}const R=f??t.length+2,k=d??t.filter(j=>j.status!=="offline").length,L=p??t.filter(j=>j.status==="offline").length;return h.jsxs("div",{ref:y,className:ge("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},...g,children:[h.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"}),h.jsx("div",{className:"absolute top-4 left-5 z-10",children:h.jsx("span",{className:"font-mono text-[10px] text-neutral-500 uppercase tracking-widest",children:"Sync Topology"})}),h.jsxs("div",{className:"absolute top-4 right-5 z-10 flex items-center gap-3",children:[h.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[R," nodes"]}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-600",children:"·"}),h.jsxs("span",{className:"font-mono text-[10px] text-healthy",children:[k," online"]}),h.jsx("span",{className:"font-mono text-[10px] text-neutral-600",children:"·"}),h.jsxs("span",{className:"font-mono text-[10px] text-offline",children:[L," offline"]})]}),h.jsxs("svg",{viewBox:`0 0 ${c.width} ${c.height}`,className:"w-full h-full",preserveAspectRatio:"xMidYMid meet",children:[h.jsx("ellipse",{cx:b,cy:x,rx:280,ry:160,fill:"none",stroke:"#1a1a1a",strokeWidth:.5,strokeDasharray:"6 10"}),h.jsx("ellipse",{cx:S,cy:w,rx:260,ry:140,fill:"none",stroke:"#1a1a1a",strokeWidth:.5,strokeDasharray:"6 10"}),h.jsx("line",{x1:b,y1:x,x2:S,y2:w,stroke:"#8b5cf6",strokeWidth:2,opacity:.3}),h.jsx("line",{x1:b,y1:x,x2:S,y2:w,stroke:"#8b5cf6",strokeWidth:1,strokeDasharray:"4 2",opacity:.6,children:h.jsx("animate",{attributeName:"stroke-dashoffset",from:"20",to:"0",dur:"1s",repeatCount:"indefinite"})}),h.jsxs("circle",{r:3,fill:"#8b5cf6",opacity:.8,children:[h.jsx("animateMotion",{dur:"2.5s",repeatCount:"indefinite",path:`M${b},${x} L${S},${w}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.8;0.8;0",dur:"2.5s",repeatCount:"indefinite"})]}),h.jsxs("circle",{r:3,fill:"#8b5cf6",opacity:.8,children:[h.jsx("animateMotion",{dur:"2.5s",begin:"1.25s",repeatCount:"indefinite",path:`M${S},${w} L${b},${x}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.8;0.8;0",dur:"2.5s",begin:"1.25s",repeatCount:"indefinite"})]}),h.jsx("text",{x:(b+S)/2,y:x-20,textAnchor:"middle",fill:"#8b5cf6",fontFamily:"JetBrains Mono, monospace",fontSize:8,opacity:.4,letterSpacing:2,children:"BACKBONE"}),t.map(j=>{const O=N(j.id),D=s.includes(j.id),K=D?S:b,F=D?w:x,z=MC(j.status),X=j.status==="syncing"?2.5:1.5;if(j.status==="offline")return h.jsx("line",{x1:K,y1:F,x2:O.x,y2:O.y,stroke:z,strokeWidth:1,strokeDasharray:"3 6",opacity:.2},`line-${j.id}`);const Y=j.status==="syncing"?"1.2s":"2.8s",te=`${Number.parseFloat(Y)/2}s`;return h.jsxs("g",{children:[h.jsx("line",{x1:K,y1:F,x2:O.x,y2:O.y,stroke:z,strokeWidth:X,strokeDasharray:"4 2",children:h.jsx("animate",{attributeName:"stroke-dashoffset",from:"20",to:"0",dur:"1s",repeatCount:"indefinite"})}),h.jsxs("circle",{r:2.5,fill:z,opacity:.7,children:[h.jsx("animateMotion",{dur:Y,repeatCount:"indefinite",path:`M${K},${F} L${O.x},${O.y}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.7;0.7;0",dur:Y,repeatCount:"indefinite"})]}),h.jsxs("circle",{r:2,fill:z,opacity:.5,children:[h.jsx("animateMotion",{dur:Y,begin:te,repeatCount:"indefinite",path:`M${O.x},${O.y} L${K},${F}`}),h.jsx("animate",{attributeName:"opacity",values:"0;0.5;0.5;0",dur:Y,begin:te,repeatCount:"indefinite"})]})]},`line-${j.id}`)}),h.jsxs("circle",{cx:b,cy:x,r:50,fill:"none",stroke:"#3b82f6",strokeWidth:.5,opacity:.15,children:[h.jsx("animate",{attributeName:"r",from:"32",to:"60",dur:"3s",repeatCount:"indefinite"}),h.jsx("animate",{attributeName:"opacity",from:"0.25",to:"0",dur:"3s",repeatCount:"indefinite"})]}),h.jsxs("circle",{cx:b,cy:x,r:50,fill:"none",stroke:"#3b82f6",strokeWidth:.5,opacity:.15,children:[h.jsx("animate",{attributeName:"r",from:"32",to:"60",dur:"3s",begin:"1.5s",repeatCount:"indefinite"}),h.jsx("animate",{attributeName:"opacity",from:"0.25",to:"0",dur:"3s",begin:"1.5s",repeatCount:"indefinite"})]}),h.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))"}}),h.jsx("circle",{cx:b,cy:x,r:16,fill:"rgba(59,130,246,0.12)",stroke:"#3b82f6",strokeWidth:.8}),h.jsx("circle",{cx:b,cy:x,r:6,fill:"#3b82f6"}),h.jsx("text",{x:b,y:x+48,textAnchor:"middle",fill:"#444",fontFamily:"JetBrains Mono, monospace",fontSize:9,letterSpacing:2.5,children:"SERVER"}),h.jsxs("circle",{cx:S,cy:w,r:40,fill:"none",stroke:"#8b5cf6",strokeWidth:.5,opacity:.15,children:[h.jsx("animate",{attributeName:"r",from:"26",to:"48",dur:"3.5s",repeatCount:"indefinite"}),h.jsx("animate",{attributeName:"opacity",from:"0.2",to:"0",dur:"3.5s",repeatCount:"indefinite"})]}),h.jsx("circle",{cx:S,cy:w,r:26,fill:"#0c0c0c",stroke:"#8b5cf6",strokeWidth:2,style:{filter:"drop-shadow(0 0 10px rgba(139,92,246,0.35))"}}),h.jsx("circle",{cx:S,cy:w,r:13,fill:"rgba(139,92,246,0.12)",stroke:"#8b5cf6",strokeWidth:.8}),h.jsx("circle",{cx:S,cy:w,r:5,fill:"#8b5cf6"}),h.jsx("text",{x:S,y:w+42,textAnchor:"middle",fill:"#444",fontFamily:"JetBrains Mono, monospace",fontSize:9,letterSpacing:2.5,children:"RELAY"}),t.map(j=>{const O=N(j.id),D=MC(j.status),K=j.status==="offline"?.25:1,F=j.actor.replace("user-","").replace("svc-",""),z=s.includes(j.id);return h.jsxs("g",{opacity:K,children:[h.jsx("circle",{cx:O.x,cy:O.y,r:20,fill:"#0c0c0c",stroke:D,strokeWidth:1.5}),h.jsx("circle",{cx:O.x,cy:O.y,r:5,fill:D}),h.jsx("text",{x:O.x,y:O.y+32,textAnchor:"middle",fill:"#555",fontFamily:"JetBrains Mono, monospace",fontSize:9,children:F}),h.jsxs("text",{x:O.x,y:O.y+42,textAnchor:"middle",fill:"#333",fontFamily:"JetBrains Mono, monospace",fontSize:7,children:[j.type,z?" · relay":""]})]},`node-${j.id}`)})]})]})});HA.displayName="TopologyHero";let kC=(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 qA(e){return _.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[kC.checked]:""}:{[kC.unchecked]:""}},...mi}),[e.indeterminate])}const sG=_.createContext({disabled:!1});function oG(){return _.useContext(sG)}const iG=_.createContext(void 0);function aG(e=!0){const t=_.useContext(iG);if(t===void 0&&!e)throw new Error(pn(3));return t}const VA=_.createContext(void 0);function lG(){const e=_.useContext(VA);if(e===void 0)throw new Error(pn(14));return e}const cG="data-parent",uG=_.forwardRef(function(t,n){const{checked:s,className:i,defaultChecked:a=!1,disabled:c=!1,id:f,indeterminate:d=!1,inputRef:p,name:g,onCheckedChange:y,parent:b=!1,readOnly:x=!1,render:S,required:w=!1,uncheckedValue:T,value:C,nativeButton:A=!1,...N}=t,{clearErrors:R}=Wl(),{disabled:k,name:L,setDirty:j,setFilled:O,setFocused:D,setTouched:K,state:F,validationMode:z,validityData:X,shouldValidateOnChange:Y,validation:te}=gi(),P=oG(),{labelId:V,controlId:B,registerControlId:q,getDescriptionProps:U}=oo(),I=aG(),G=I?.parent,W=G&&I.allValues,Q=k||P.disabled||I?.disabled||c,se=L??g,oe=C??se,pe=pr(),Se=pr();let he=B;W?he=b?Se:`${G.id}-${oe}`:f&&(he=f);let He={};W&&(b?He=I.parent.getParentProps():oe&&(He=I.parent.getChildProps(oe)));const Ee=Ae(y),{checked:re=s,indeterminate:de=d,onCheckedChange:ae,..._e}=He,ve=I?.value,xe=I?.setValue,ye=I?.defaultValue,Le=_.useRef(null),ke=In(()=>Symbol("checkbox-control")),we=_.useRef(!1),{getButtonProps:Ve,buttonRef:Xe}=Ql({disabled:Q,native:A}),$e=I?.validation??te,[We,Fe]=dp({controlled:oe&&ve&&!b?ve.includes(oe):re,default:oe&&ye&&!b?ye.includes(oe):a,name:"Checkbox",state:"checked"});ze(()=>{q!==Cn&&(we.current=!0,q(ke.current,he))},[he,I,q,b,ke]),_.useEffect(()=>{const ut=ke.current;return()=>{!we.current||q===Cn||(we.current=!1,q(ut,void 0))}},[q,ke]),Lj({enabled:!I,id:pe,commit:$e.commit,value:We,controlRef:Le,name:se,getValue:()=>We});const me=_.useRef(null),Te=to(p,me,$e.inputRef);ze(()=>{me.current&&(me.current.indeterminate=de,We&&O(!0))},[We,de,O]),Hj(We,()=>{I&&!b||(R(se),O(We),j(We!==X.initialValue),Y()?$e.commit(We):$e.commit(We,!0))});const qe=ni({checked:We,disabled:Q,name:b?void 0:se,id:A?void 0:he??void 0,required:w,ref:Te,style:se?jj:hp,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(ut){if(ut.nativeEvent.defaultPrevented)return;const xt=ut.target.checked,ot=Kt(ri,ut.nativeEvent);if(ae?.(xt,ot),Ee(xt,ot),!ot.isCanceled&&(Fe(xt),oe&&ve&&xe&&!b)){const Yt=xt?[...ve,oe]:ve.filter(mn=>mn!==oe);xe(Yt,ot)}},onFocus(){Le.current?.focus()}},C!==void 0?{value:(I?We&&C:C)||""}:rn,U,I?$e.getValidationProps:$e.getInputValidationProps),mt=W?!!re:We,ct=W&&de||d;_.useEffect(()=>{if(!G||!oe)return;const ut=G.disabledStatesRef.current;return ut.set(oe,Q),()=>{ut.delete(oe)}},[G,Q,oe]);const br=_.useMemo(()=>({...F,checked:mt,disabled:Q,readOnly:x,required:w,indeterminate:ct}),[F,mt,Q,x,w,ct]),xr=qA(br),Zt=Pt("span",t,{state:br,ref:[Xe,Le,n,I?.registerControlRef],props:[{id:A?he??void 0:pe,role:"checkbox","aria-checked":de?"mixed":We,"aria-readonly":x||void 0,"aria-required":w||void 0,"aria-labelledby":V,[cG]:b?"":void 0,onFocus(){D(!0)},onBlur(){const ut=me.current;ut&&(K(!0),D(!1),z==="onBlur"&&$e.commit(I?ve:ut.checked))},onClick(ut){x||Q||(ut.preventDefault(),me.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:ut.shiftKey,ctrlKey:ut.ctrlKey,altKey:ut.altKey,metaKey:ut.metaKey})))}},U,$e.getValidationProps,N,_e,Ve],stateAttributesMapping:xr});return h.jsxs(VA.Provider,{value:br,children:[Zt,!We&&!I&&se&&!b&&T!==void 0&&h.jsx("input",{type:"hidden",name:se,value:T}),h.jsx("input",{...qe})]})}),fG=_.forwardRef(function(t,n){const{render:s,className:i,keepMounted:a=!1,...c}=t,f=lG(),d=f.checked||f.indeterminate,{mounted:p,transitionStatus:g,setMounted:y}=Tp(d),b=_.useRef(null),x={...f,transitionStatus:g};ya({open:d,ref:b,onComplete(){d||y(!1)}});const S=qA(f),w=_.useMemo(()=>({...S,...ga,...mi}),[S]),T=a||p,C=Pt("span",t,{ref:[n,b],state:x,stateAttributesMapping:w,props:c});return T?C:null}),Uv=_.forwardRef(({className:e,label:t,...n},s)=>{const i=h.jsx(uG,{ref:s,className:ge("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:h.jsx(fG,{className:"flex items-center justify-center text-white",children:h.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:h.jsx("path",{d:"M1.5 4L3.25 5.75L6.5 2.25",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})});return t?h.jsxs("span",{className:"inline-flex items-center gap-2 cursor-pointer font-mono text-[11px] text-neutral-400",children:[i,h.jsx("span",{children:t})]}):i});Uv.displayName="Checkbox";const dG=_.createContext({legendId:void 0,setLegendId:()=>{},disabled:void 0});function hG(e=!1){const t=_.useContext(dG);if(!t&&!e)throw new Error(pn(86));return t}const pG=function(t){const n=pr(),[s,i]=_.useState(t.initialControlId===void 0?n:t.initialControlId),[a,c]=_.useState(void 0),[f,d]=_.useState([]),p=In(()=>new Map),{messageIds:g}=oo(),y=Ae((S,w)=>{const T=p.current;if(w===void 0){T.delete(S);return}T.set(S,w),i(C=>{if(T.size===0)return;let A;for(const N of T.values()){if(C!==void 0&&N===C)return C;A===void 0&&(A=N)}return A})}),b=_.useCallback(S=>ni({"aria-describedby":g.concat(f).join(" ")||void 0},S),[g,f]),x=_.useMemo(()=>({controlId:s,registerControlId:y,labelId:a,setLabelId:c,messageIds:f,setMessageIds:d,getDescriptionProps:b}),[s,y,a,c,f,d,b]);return h.jsx(Uj.Provider,{value:x,children:t.children})},ah=Object.keys(vp);function mG(e){if(!e||e.valid||!e.valueMissing)return!1;let t=!1;for(const n of ah)n!=="valid"&&(n==="valueMissing"&&(t=e[n]),e[n]&&(t=!1));return t}function gG(e){const{formRef:t,clearErrors:n}=Wl(),{setValidityData:s,validate:i,validityData:a,validationDebounceTime:c,invalid:f,markedDirtyRef:d,state:p,name:g,shouldValidateOnChange:y}=e,{controlId:b,getDescriptionProps:x}=oo(),S=Jr(),w=_.useRef(null),T=Ae(async(N,R=!1)=>{const k=w.current;if(!k)return;if(R){if(p.valid!==!1)return;const X=k.validity;if(!X.valueMissing){const te={value:N,state:{...vp,valid:!0},error:"",errors:[],initialValue:a.initialValue};if(k.setCustomValidity(""),b){const P=t.current.fields.get(b);P&&t.current.fields.set(b,{...P,...Ov(te,!1)})}s(te);return}const Y=ah.reduce((te,P)=>(te[P]=X[P],te),{});if(!Y.valid&&!mG(Y))return}function L(X){const Y=ah.reduce((P,V)=>(P[V]=X.validity[V],P),{});let te=!1;for(const P of ah)if(P!=="valid"){if(P==="valueMissing"&&Y[P])te=!0;else if(Y[P])return Y}return te&&!d.current&&(Y.valid=!0,Y.valueMissing=!1),Y}S.clear();let j=null,O=[];const D=L(k);let K;const F=y();if(k.validationMessage&&!F)K=k.validationMessage,O=[k.validationMessage];else{const X=Array.from(t.current.fields.values()).reduce((te,P)=>(P.name&&(te[P.name]=P.getValue()),te),{}),Y=i(N,X);typeof Y=="object"&&Y!==null&&"then"in Y?j=await Y:j=Y,j!==null?(D.valid=!1,D.customError=!0,Array.isArray(j)?(O=j,k.setCustomValidity(j.join(`
|
|
75
|
+
`))):j&&(O=[j],k.setCustomValidity(j))):F&&(k.setCustomValidity(""),D.customError=!1,k.validationMessage?(K=k.validationMessage,O=[k.validationMessage]):k.validity.valid&&!D.valid&&(D.valid=!0))}const z={value:N,state:D,error:K??(Array.isArray(j)?j[0]:j??""),errors:O,initialValue:a.initialValue};if(b){const X=t.current.fields.get(b);X&&t.current.fields.set(b,{...X,...Ov(z,f)})}s(z)}),C=_.useCallback((N={})=>ni(x,p.valid===!1?{"aria-invalid":!0}:rn,N),[x,p.valid]),A=_.useCallback((N={})=>ni({onChange(R){if(R.nativeEvent.defaultPrevented)return;if(n(g),!y()){T(R.currentTarget.value,!0);return}if(f)return;const k=R.currentTarget;if(k.value===""){T(k.value);return}S.clear(),c?S.start(c,()=>{T(k.value)}):T(k.value)}},C(N)),[C,n,g,S,T,f,c,y]);return _.useMemo(()=>({getValidationProps:C,getInputValidationProps:A,inputRef:w,commit:T}),[C,A,T])}const yG=_.forwardRef(function(t,n){const{errors:s,validationMode:i,submitAttemptedRef:a}=Wl(),{render:c,className:f,validate:d,validationDebounceTime:p=0,validationMode:g=i,name:y,disabled:b=!1,invalid:x,dirty:S,touched:w,actionsRef:T,...C}=t,{disabled:A}=hG(),N=Ae(d||(()=>null)),R=A||b,[k,L]=_.useState(!1),[j,O]=_.useState(!1),[D,K]=_.useState(!1),[F,z]=_.useState(!1),X=S??j,Y=w??k,te=_.useRef(!1),P=Ae(Se=>{S===void 0&&(Se&&(te.current=!0),O(Se))}),V=Ae(Se=>{w===void 0&&L(Se)}),B=Ae(()=>g==="onChange"||g==="onSubmit"&&a.current),q=!!(x||y&&{}.hasOwnProperty.call(s,y)&&s[y]!==void 0),[U,I]=_.useState({state:vp,error:"",errors:[],value:null,initialValue:null}),G=!q&&U.state.valid,W=_.useMemo(()=>({disabled:R,touched:Y,dirty:X,valid:G,filled:D,focused:F}),[R,Y,X,G,D,F]),Q=gG({setValidityData:I,validate:N,validityData:U,validationDebounceTime:p,invalid:q,markedDirtyRef:te,state:W,name:y,shouldValidateOnChange:B}),se=_.useCallback(()=>{te.current=!0,Q.commit(U.value)},[Q,U]);_.useImperativeHandle(T,()=>({validate:se}),[se]);const oe=_.useMemo(()=>({invalid:q,name:y,validityData:U,setValidityData:I,disabled:R,touched:Y,setTouched:V,dirty:X,setDirty:P,filled:D,setFilled:K,focused:F,setFocused:z,validate:N,validationMode:g,validationDebounceTime:p,shouldValidateOnChange:B,state:W,markedDirtyRef:te,validation:Q}),[q,y,U,R,Y,V,X,P,D,K,F,z,N,g,p,B,W,Q]),pe=Pt("div",t,{ref:n,state:W,props:C,stateAttributesMapping:mi});return h.jsx(zj.Provider,{value:oe,children:pe})}),vG=_.forwardRef(function(t,n){return h.jsx(pG,{children:h.jsx(yG,{...t,ref:n})})}),bG=_.forwardRef(function(t,n){const{render:s,className:i,id:a,nativeLabel:c=!0,...f}=t,d=gi(!1),{controlId:p,setLabelId:g,labelId:y}=oo(),b=pr(a),x=_.useRef(null),S=Ae(T=>{if(Ir(T.nativeEvent)?.closest("button,input,select,textarea")||(!T.defaultPrevented&&T.detail>1&&T.preventDefault(),c||!p))return;const A=Rt(T.currentTarget).getElementById(p);Vt(A)&&A.focus({focusVisible:!0})});return ze(()=>(b&&g(b),()=>{g(void 0)}),[b,g]),Pt("label",t,{ref:[n,x],state:d.state,props:[{id:y},c?{htmlFor:p??void 0,onMouseDown:S}:{onClick:S,onPointerDown(T){T.preventDefault()}},f],stateAttributesMapping:mi})}),xG={...mi,...ga},SG=_.forwardRef(function(t,n){const{render:s,id:i,className:a,match:c,...f}=t,d=pr(i),{validityData:p,state:g,name:y}=gi(!1),{setMessageIds:b}=oo(),{errors:x}=Wl(),S=y?x[y]:null;let w=!1;S||c===!0?w=!0:c?w=!!p.state[c]:w=p.state.valid===!1;const{mounted:T,transitionStatus:C,setMounted:A}=Tp(w);ze(()=>{if(!(!w||!d))return b(z=>z.concat(d)),()=>{b(z=>z.filter(X=>X!==d))}},[w,d,b]);const N=_.useRef(null),[R,k]=_.useState(null),[L,j]=_.useState(null),O=S||(p.errors.length>1?h.jsx("ul",{children:p.errors.map(z=>h.jsx("li",{children:z},z))}):p.error);let D=p.error;S!=null?D=Array.isArray(S)?JSON.stringify(S):S:p.errors.length>1&&(D=JSON.stringify(p.errors)),w&&D!==L&&(j(D),k(O)),ya({open:w,ref:N,onComplete(){w||A(!1)}});const K={...g,transitionStatus:C},F=Pt("div",t,{ref:[n,N],state:K,props:[{id:d,children:w?O:R},f],stateAttributesMapping:xG,enabled:T});return T?F:null}),_G=_.forwardRef(function(t,n){const{render:s,id:i,className:a,...c}=t,f=pr(i),d=gi(!1),{setMessageIds:p}=oo();return ze(()=>{if(f)return p(y=>y.concat(f)),()=>{p(y=>y.filter(b=>b!==f))}},[f,p]),Pt("p",t,{ref:n,state:d.state,props:[{id:f},c],stateAttributesMapping:mi})}),ds=vG,Qr=_.forwardRef(({className:e,...t},n)=>h.jsx(bG,{ref:n,className:ge("font-mono text-[9px] text-neutral-500 uppercase tracking-wider block mb-1.5",e),...t}));Qr.displayName="FieldLabel";const dl=_.forwardRef(({className:e,...t},n)=>h.jsx(_G,{ref:n,className:ge("font-mono text-[9px] text-neutral-600 mt-0.5",e),...t}));dl.displayName="FieldDescription";const wG=_.forwardRef(({className:e,...t},n)=>h.jsx(SG,{ref:n,className:ge("font-mono text-[10px] text-offline mt-1",e),...t}));wG.displayName="FieldError";const EG=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge(e),...t}));EG.displayName="FieldContent";const TG=_.createContext(null),CG=_.createContext(null);function Yu(){const e=_.useContext(TG);if(e===null)throw new Error(pn(60));return e}function KA(){const e=_.useContext(CG);if(e===null)throw new Error(pn(61));return e}function Ll(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function RG(e,t,n){return!e||e.length===0?!1:e.some(s=>s===void 0?!1:Ll(t,s,n))}function Py(e,t,n){return!e||e.length===0?-1:e.findIndex(s=>s===void 0?!1:Ll(s,t,n))}function NG(e,t,n){return e.filter(s=>!Ll(t,s,n))}function IC(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function jG(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function AG(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(jG(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 OG(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?IC(e.value):IC(e)}const it={id:Ie(e=>e.id),modal:Ie(e=>e.modal),multiple:Ie(e=>e.multiple),items:Ie(e=>e.items),itemToStringLabel:Ie(e=>e.itemToStringLabel),itemToStringValue:Ie(e=>e.itemToStringValue),isItemEqualToValue:Ie(e=>e.isItemEqualToValue),value:Ie(e=>e.value),hasSelectedValue:Ie(e=>{const{value:t,multiple:n,itemToStringValue:s}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:OG(t,s)!==""}),hasNullItemLabel:Ie((e,t)=>t?AG(e.items):!1),open:Ie(e=>e.open),mounted:Ie(e=>e.mounted),forceMount:Ie(e=>e.forceMount),transitionStatus:Ie(e=>e.transitionStatus),openMethod:Ie(e=>e.openMethod),activeIndex:Ie(e=>e.activeIndex),selectedIndex:Ie(e=>e.selectedIndex),isActive:Ie((e,t)=>e.activeIndex===t),isSelected:Ie((e,t,n)=>{const s=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(a=>Ll(n,a,s)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Ll(n,i,s)}),isSelectedByFocus:Ie((e,t)=>e.selectedIndex===t),popupProps:Ie(e=>e.popupProps),triggerProps:Ie(e=>e.triggerProps),triggerElement:Ie(e=>e.triggerElement),positionerElement:Ie(e=>e.positionerElement),listElement:Ie(e=>e.listElement),scrollUpArrowVisible:Ie(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Ie(e=>e.scrollDownArrowVisible),hasScrollArrows:Ie(e=>e.hasScrollArrows)};function MG(e){const t=_.useRef(""),n=_.useCallback(i=>{i.defaultPrevented||(t.current=i.pointerType,e(i,i.pointerType))},[e]);return{onClick:_.useCallback(i=>{if(i.detail===0){e(i,"keyboard");return}"pointerType"in i?e(i,i.pointerType):e(i,t.current),t.current=""},[e]),onPointerDown:n}}function kG(e){const[t,n]=_.useState(null),s=Ae((f,d)=>{e||n(d||(aA?"touch":""))}),i=_.useCallback(()=>{n(null)},[]),{onClick:a,onPointerDown:c}=MG(s);return _.useMemo(()=>({openMethod:t,reset:i,triggerProps:{onClick:a,onPointerDown:c}}),[t,i,a,c])}function IG(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),s=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||s.content!=="none"))return t;const a=parseFloat(n.width)||0,c=parseFloat(n.height)||0,f=parseFloat(s.width)||0,d=parseFloat(s.height)||0,p=Math.max(t.width,a,f),g=Math.max(t.height,c,d),y=p-t.width,b=g-t.height;return{left:t.left-y/2,right:t.right+y/2,top:t.top-b/2,bottom:t.bottom+b/2}}const $d=2,DG=400,DC=200,PG={...qK,...mi,value:()=>null},zG=_.forwardRef(function(t,n){const{render:s,className:i,id:a,disabled:c=!1,nativeButton:f=!0,...d}=t,{setTouched:p,setFocused:g,validationMode:y,state:b,disabled:x}=gi(),{labelId:S}=oo(),{store:w,setOpen:T,selectionRef:C,validation:A,readOnly:N,required:R,alignItemWithTriggerActiveRef:k,disabled:L,keyboardActiveRef:j}=Yu(),O=x||L||c,D=at(w,it.open),K=at(w,it.value),F=at(w,it.triggerProps),z=at(w,it.positionerElement),X=at(w,it.listElement),Y=at(w,it.id),te=at(w,it.hasSelectedValue),P=!te&&D,V=at(w,it.hasNullItemLabel,P),B=a??Y;$j({id:B});const q=Xo(z),U=_.useRef(null),{getButtonProps:I,buttonRef:G}=Ql({disabled:O,native:f}),W=Ae(re=>{w.set("triggerElement",re)}),Q=to(n,U,G,W),se=Jr(),oe=Jr(),pe=Jr(),Se=Jr();_.useEffect(()=>{if(D)return!(te||V)?pe.start(DG,()=>{C.current.allowUnselectedMouseUp=!0,C.current.allowSelectedMouseUp=!0}):Se.start(DC,()=>{C.current.allowUnselectedMouseUp=!0,pe.start(DC,()=>{C.current.allowSelectedMouseUp=!0})}),()=>{pe.clear(),Se.clear()};C.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},oe.clear()},[D,te,V,C,oe,pe,Se]);const he=_.useMemo(()=>X?.id??Lh(z)?.id,[X,z]),He=ni(F,{id:B,role:"combobox","aria-expanded":D?"true":"false","aria-haspopup":"listbox","aria-controls":D?he:void 0,"aria-labelledby":S,"aria-readonly":N||void 0,"aria-required":R||void 0,tabIndex:O?-1:0,ref:Q,onFocus(re){g(!0),D&&k.current&&T(!1,Kt(ri,re.nativeEvent)),se.start(0,()=>{w.set("forceMount",!0)})},onBlur(re){Mt(z,re.relatedTarget)||(p(!0),g(!1),y==="onBlur"&&A.commit(K))},onPointerMove(){j.current=!1},onKeyDown(){j.current=!0},onMouseDown(re){if(D)return;const de=Rt(re.currentTarget);function ae(_e){if(!U.current)return;const ve=_e.target;if(Mt(U.current,ve)||Mt(q.current,ve)||ve===U.current)return;const xe=IG(U.current);_e.clientX>=xe.left-$d&&_e.clientX<=xe.right+$d&&_e.clientY>=xe.top-$d&&_e.clientY<=xe.bottom+$d||T(!1,Kt(C8,_e))}oe.start(0,()=>{de.addEventListener("mouseup",ae,{once:!0})})}},A.getValidationProps,d,I);He.role="combobox";const Ee={...b,open:D,disabled:O,value:K,readOnly:N,placeholder:!te};return Pt("button",t,{ref:[n,U],state:Ee,stateAttributesMapping:PG,props:He})}),LG=_.createContext(void 0),UG=_.forwardRef(function(t,n){const{store:s}=Yu(),i=at(s,it.mounted),a=at(s,it.forceMount);return i||a?h.jsx(LG.Provider,{value:!0,children:h.jsx(RA,{ref:n,...t})}):null});let PC={},zC={},LC="";function $G(e){if(typeof document>"u")return!1;const t=Rt(e);return an(t).innerWidth-t.documentElement.clientWidth>0}function BG(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Rt(e),s=n.documentElement,i=n.body,a=pi(s)?s:i,c=a.style.overflowY,f=s.style.scrollbarGutter;s.style.scrollbarGutter="stable",a.style.overflowY="scroll";const d=a.offsetWidth;a.style.overflowY="hidden";const p=a.offsetWidth;return a.style.overflowY=c,s.style.scrollbarGutter=f,d===p}function FG(e){const t=Rt(e),n=t.documentElement,s=t.body,i=pi(n)?n:s,a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(i.style,a)}}function HG(e){const t=Rt(e),n=t.documentElement,s=t.body,i=an(n);let a=0,c=0,f=!1;const d=ps.create();if(nx&&(i.visualViewport?.scale??1)!==1)return()=>{};function p(){const b=i.getComputedStyle(n),x=i.getComputedStyle(s),T=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";a=n.scrollTop,c=n.scrollLeft,PC={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},LC=n.style.scrollBehavior,zC={position:s.style.position,height:s.style.height,width:s.style.width,boxSizing:s.style.boxSizing,overflowY:s.style.overflowY,overflowX:s.style.overflowX,scrollBehavior:s.style.scrollBehavior};const C=n.scrollHeight>n.clientHeight,A=n.scrollWidth>n.clientWidth,N=b.overflowY==="scroll"||x.overflowY==="scroll",R=b.overflowX==="scroll"||x.overflowX==="scroll",k=Math.max(0,i.innerWidth-s.clientWidth),L=Math.max(0,i.innerHeight-s.clientHeight),j=parseFloat(x.marginTop)+parseFloat(x.marginBottom),O=parseFloat(x.marginLeft)+parseFloat(x.marginRight),D=pi(n)?n:s;if(f=BG(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||N)&&(n.style.overflowY="scroll"),(A||R)&&(n.style.overflowX="scroll"),Object.assign(s.style,{position:"relative",height:j||L?`calc(100dvh - ${j+L}px)`:"100dvh",width:O||k?`calc(100vw - ${O+k}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),s.scrollTop=a,s.scrollLeft=c,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function g(){Object.assign(n.style,PC),Object.assign(s.style,zC),f||(n.scrollTop=a,n.scrollLeft=c,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=LC)}function y(){g(),d.request(p)}return p(),i.addEventListener("resize",y),()=>{d.cancel(),g(),typeof i.removeEventListener=="function"&&i.removeEventListener("resize",y)}}class qG{lockCount=0;restore=null;timeoutLock=si.create();timeoutUnlock=si.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 s=Rt(t).documentElement,i=an(s).getComputedStyle(s).overflowY;if(i==="hidden"||i==="clip"){this.restore=Cn;return}const a=aA||!$G(t);this.restore=a?FG(t):HG(t)}}const VG=new qG;function GA(e=!0,t=null){ze(()=>{if(e)return VG.acquire(t)},[e,t])}const ZA=_.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function KG(){return _.useContext(ZA)}function YA(e){const{children:t,elementsRef:n,labelsRef:s,onMapChange:i}=e,a=Ae(i),c=_.useRef(0),f=In(ZG).current,d=In(GG).current,[p,g]=_.useState(0),y=_.useRef(p),b=Ae((C,A)=>{d.set(C,A??null),y.current+=1,g(y.current)}),x=Ae(C=>{d.delete(C),y.current+=1,g(y.current)}),S=_.useMemo(()=>{const C=new Map;return Array.from(d.keys()).filter(N=>N.isConnected).sort(YG).forEach((N,R)=>{const k=d.get(N)??{};C.set(N,{...k,index:R})}),C},[d,p]);ze(()=>{if(typeof MutationObserver!="function"||S.size===0)return;const C=new MutationObserver(A=>{const N=new Set,R=k=>N.has(k)?N.delete(k):N.add(k);A.forEach(k=>{k.removedNodes.forEach(R),k.addedNodes.forEach(R)}),N.size===0&&(y.current+=1,g(y.current))});return S.forEach((A,N)=>{N.parentElement&&C.observe(N.parentElement,{childList:!0})}),()=>{C.disconnect()}},[S]),ze(()=>{y.current===p&&(n.current.length!==S.size&&(n.current.length=S.size),s&&s.current.length!==S.size&&(s.current.length=S.size),c.current=S.size),a(S)},[a,S,n,s,p]),ze(()=>()=>{n.current=[]},[n]),ze(()=>()=>{s&&(s.current=[])},[s]);const w=Ae(C=>(f.add(C),()=>{f.delete(C)}));ze(()=>{f.forEach(C=>C(S))},[f,S]);const T=_.useMemo(()=>({register:b,unregister:x,subscribeMapChange:w,elementsRef:n,labelsRef:s,nextIndexRef:c}),[b,x,w,n,s,c]);return h.jsx(ZA.Provider,{value:T,children:t})}function GG(){return new Map}function ZG(){return new Set}function YG(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 XA=_.createContext(void 0);function XG(){const e=_.useContext(XA);if(!e)throw new Error(pn(59));return e}const QA=_.forwardRef(function(t,n){const{cutout:s,...i}=t;let a;if(s){const c=s?.getBoundingClientRect();a=`polygon(
|
|
76
|
+
0% 0%,
|
|
77
|
+
100% 0%,
|
|
78
|
+
100% 100%,
|
|
79
|
+
0% 100%,
|
|
80
|
+
0% 0%,
|
|
81
|
+
${c.left}px ${c.top}px,
|
|
82
|
+
${c.left}px ${c.bottom}px,
|
|
83
|
+
${c.right}px ${c.bottom}px,
|
|
84
|
+
${c.right}px ${c.top}px,
|
|
85
|
+
${c.left}px ${c.top}px
|
|
86
|
+
)`}return h.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...i,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:a}})});function Zh(e,t){e&&Object.assign(e.style,t)}const QG={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},WG={position:"fixed"},JG=_.forwardRef(function(t,n){const{anchor:s,positionMethod:i="absolute",className:a,render:c,side:f="bottom",align:d="center",sideOffset:p=0,alignOffset:g=0,collisionBoundary:y="clipping-ancestors",collisionPadding:b,arrowPadding:x=5,sticky:S=!1,disableAnchorTracking:w,alignItemWithTrigger:T=!0,collisionAvoidance:C=r8,...A}=t,{store:N,listRef:R,labelsRef:k,alignItemWithTriggerActiveRef:L,selectedItemTextRef:j,valuesRef:O,initialValueRef:D,popupRef:K,setValue:F}=Yu(),z=KA(),X=at(N,it.open),Y=at(N,it.mounted),te=at(N,it.modal),P=at(N,it.value),V=at(N,it.openMethod),B=at(N,it.positionerElement),q=at(N,it.triggerElement),U=at(N,it.isItemEqualToValue),I=at(N,it.transitionStatus),G=_.useRef(null),W=_.useRef(null),[Q,se]=_.useState(T),oe=Y&&Q&&V!=="touch";!Y&&Q!==T&&se(T),ze(()=>{Y||(it.scrollUpArrowVisible(N.state)&&N.set("scrollUpArrowVisible",!1),it.scrollDownArrowVisible(N.state)&&N.set("scrollDownArrowVisible",!1))},[N,Y]),_.useImperativeHandle(L,()=>oe),GA((oe||te)&&X&&V!=="touch",q);const pe=FA({anchor:s,floatingRootContext:z,positionMethod:i,mounted:Y,side:f,sideOffset:p,align:d,alignOffset:g,arrowPadding:x,collisionBoundary:y,collisionPadding:b,sticky:S,disableAnchorTracking:w??oe,collisionAvoidance:C,keepMounted:!0}),Se=oe?"none":pe.side,he=oe?WG:pe.positionerStyles,He=_.useMemo(()=>{const xe={};return X||(xe.pointerEvents="none"),{role:"presentation",hidden:!Y,style:{...he,...xe}}},[X,Y,he]),Ee={open:X,side:Se,align:pe.align,anchorHidden:pe.anchorHidden},re=Ae(xe=>{N.set("positionerElement",xe)}),de=Pt("div",t,{ref:[n,re],state:Ee,stateAttributesMapping:rc,props:[He,Cp(I),A]}),ae=_.useRef(0),_e=Ae(xe=>{if(xe.size===0&&ae.current===0||O.current.length===0)return;const ye=ae.current;if(ae.current=xe.size,xe.size===ye)return;const Le=Kt(ri);if(ye!==0&&!N.state.multiple&&P!==null&&Py(O.current,P,U)===-1){const we=D.current,Xe=we!=null&&Py(O.current,we,U)!==-1?we:null;F(Xe,Le),Xe===null&&(N.set("selectedIndex",null),j.current=null)}if(ye!==0&&N.state.multiple&&Array.isArray(P)){const ke=Ve=>Py(O.current,Ve,U)!==-1,we=P.filter(Ve=>ke(Ve));(we.length!==P.length||we.some(Ve=>!RG(P,Ve,U)))&&(F(we,Le),we.length===0&&(N.set("selectedIndex",null),j.current=null))}if(X&&oe){N.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const ke={height:""};Zh(B,ke),Zh(K.current,ke)}}),ve=_.useMemo(()=>({...pe,side:Se,alignItemWithTriggerActive:oe,setControlledAlignItemWithTrigger:se,scrollUpArrowRef:G,scrollDownArrowRef:W}),[pe,Se,oe,se]);return h.jsx(YA,{elementsRef:R,labelsRef:k,onMapChange:_e,children:h.jsxs(XA.Provider,{value:ve,children:[Y&&te&&h.jsx(QA,{inert:dx(!X),cutout:q}),de]})})});function WA(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 Bd="base-ui-disable-scrollbar",UC={className:Bd,getElement(e){return h.jsx("style",{nonce:e,href:Bd,precedence:"base-ui:low",children:`.${Bd}{scrollbar-width:none}.${Bd}::-webkit-scrollbar{display:none}`})}},eZ=_.createContext(void 0);function JA(e){return _.useContext(eZ)}const Sl="ArrowUp",Zi="ArrowDown",Nu="ArrowLeft",_l="ArrowRight",Xu="Home",Qu="End",eO=new Set([Nu,_l]),tZ=new Set([Nu,_l,Xu,Qu]),tO=new Set([Sl,Zi]),nZ=new Set([Sl,Zi,Xu,Qu]),nO=new Set([...eO,...tO]),rZ=new Set([...nO,Xu,Qu]),rO=new Set([Sl,Zi,Nu,_l,Xu,Qu]),sZ="Shift",oZ="Control",iZ="Alt",aZ="Meta",lZ=new Set([sZ,oZ,iZ,aZ]);function cZ(e){return Vt(e)&&e.tagName==="INPUT"}function $C(e){return!!(cZ(e)&&e.selectionStart!=null||Vt(e)&&e.tagName==="TEXTAREA")}function BC(e,t,n,s){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop;const c=e.clientWidth<e.scrollWidth,f=e.clientHeight<e.scrollHeight;if(c&&s!=="vertical"){const d=FC(e,t,"left"),p=Fd(e),g=Fd(t);n==="ltr"&&(d+t.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-p.scrollPaddingRight?i=d+t.offsetWidth+g.scrollMarginRight-e.clientWidth+p.scrollPaddingRight:d-g.scrollMarginLeft<e.scrollLeft+p.scrollPaddingLeft&&(i=d-g.scrollMarginLeft-p.scrollPaddingLeft)),n==="rtl"&&(d-g.scrollMarginRight<e.scrollLeft+p.scrollPaddingLeft?i=d-g.scrollMarginLeft-p.scrollPaddingLeft:d+t.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-p.scrollPaddingRight&&(i=d+t.offsetWidth+g.scrollMarginRight-e.clientWidth+p.scrollPaddingRight))}if(f&&s!=="horizontal"){const d=FC(e,t,"top"),p=Fd(e),g=Fd(t);d-g.scrollMarginTop<e.scrollTop+p.scrollPaddingTop?a=d-g.scrollMarginTop-p.scrollPaddingTop:d+t.offsetHeight+g.scrollMarginBottom>e.scrollTop+e.clientHeight-p.scrollPaddingBottom&&(a=d+t.offsetHeight+g.scrollMarginBottom-e.clientHeight+p.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:"auto"})}function FC(e,t,n){const s=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[s],t.offsetParent!==e);)t=t.offsetParent;return i}function Fd(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 zy(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const uZ=_.createContext(void 0),fZ={disableStyleElements:!1};function dZ(){return _.useContext(uZ)??fZ}const Bi=1,hZ={...rc,...ga},pZ=_.forwardRef(function(t,n){const{render:s,className:i,finalFocus:a,...c}=t,{store:f,popupRef:d,onOpenChangeComplete:p,setOpen:g,valueRef:y,selectedItemTextRef:b,keyboardActiveRef:x,multiple:S,handleScrollArrowVisibility:w,scrollHandlerRef:T,highlightItemOnHover:C}=Yu(),{side:A,align:N,alignItemWithTriggerActive:R,setControlledAlignItemWithTrigger:k,scrollDownArrowRef:L,scrollUpArrowRef:j}=XG(),O=JA()!=null,D=KA(),{nonce:K,disableStyleElements:F}=dZ(),z=Jr(),X=at(f,it.id),Y=at(f,it.open),te=at(f,it.mounted),P=at(f,it.popupProps),V=at(f,it.transitionStatus),B=at(f,it.triggerElement),q=at(f,it.positionerElement),U=at(f,it.listElement),I=_.useRef(0),G=_.useRef(!1),W=_.useRef(0),Q=_.useRef(!1),se=_.useRef({}),oe=ix(),pe=Ae(Ee=>{if(!q||!d.current||!Q.current)return;if(G.current||!R){w();return}const re=q.style.top==="0px",de=q.style.bottom==="0px",ae=q.getBoundingClientRect().height,_e=Rt(q),ve=getComputedStyle(q),xe=parseFloat(ve.marginTop),ye=parseFloat(ve.marginBottom),Le=HC(getComputedStyle(d.current)),ke=Math.min(_e.documentElement.clientHeight-xe-ye,Le),we=Ee.scrollTop,Ve=qC(Ee);let Xe=0,$e=null,We=!1,Fe=!1;const me=qe=>{q.style.height=`${qe}px`},Te=(qe,mt)=>{const ct=zy(qe,0,ke-ae);ct>0&&me(ae+ct),Ee.scrollTop=mt,ke-(ae+ct)<=Bi&&(G.current=!0),w()};if(re){const qe=Ve-we,mt=ae+qe,ct=Math.min(mt,ke);if(Xe=ct,qe<=Bi){Te(qe,Ve);return}ke-ct>Bi?Fe=!0:We=!0}else if(de){const qe=we,mt=ae+qe,ct=Math.min(mt,ke),br=mt-ke;if(Xe=ct,qe<=Bi){Te(qe,0);return}ke-ct>Bi?$e=0:(We=!0,we<Ve&&($e=we-(qe-br)))}if(Xe=Math.ceil(Xe),Xe!==0&&me(Xe),Fe||$e!=null){const qe=qC(Ee),mt=Fe?qe:zy($e,0,qe);Math.abs(Ee.scrollTop-mt)>Bi&&(Ee.scrollTop=mt)}(We||Xe>=ke-Bi)&&(G.current=!0),w()});_.useImperativeHandle(T,()=>pe,[pe]),ya({open:Y,ref:d,onComplete(){Y&&p?.(!0)}});const Se={open:Y,transitionStatus:V,side:A,align:N};ze(()=>{!q||!d.current||Object.keys(se.current).length||(se.current={top:q.style.top||"0",left:q.style.left||"0",right:q.style.right,height:q.style.height,bottom:q.style.bottom,minHeight:q.style.minHeight,maxHeight:q.style.maxHeight,marginTop:q.style.marginTop,marginBottom:q.style.marginBottom})},[d,q]),ze(()=>{Y||R||(Q.current=!1,G.current=!1,I.current=0,W.current=0,Zh(q,se.current))},[Y,R,q,d]),ze(()=>{const Ee=d.current;if(!(!Y||!B||!q||!Ee||f.state.transitionStatus==="ending")){if(!R){Q.current=!0,oe.request(w),Ee.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{const re=mZ(Ee);Ee.style.removeProperty("--transform-origin");try{const de=getComputedStyle(q),ae=getComputedStyle(Ee),_e=Rt(B),ve=an(q),xe=B.getBoundingClientRect(),ye=q.getBoundingClientRect(),Le=xe.left,ke=xe.height,we=U||Ee,Ve=we.scrollHeight,Xe=parseFloat(ae.borderBottomWidth),$e=parseFloat(de.marginTop)||10,We=parseFloat(de.marginBottom)||10,Fe=parseFloat(de.minHeight)||100,me=HC(ae),Te=5,qe=5,mt=20,ct=_e.documentElement.clientHeight-$e-We,br=_e.documentElement.clientWidth,xr=ct-xe.bottom+ke,Zt=b.current,ut=y.current;let xt,ot=0,Yt=0;if(Zt&&ut){const Xn=ut.getBoundingClientRect();xt=Zt.getBoundingClientRect();const is=Xn.left-Le,ao=xt.left-ye.left,lo=Xn.top-xe.top+Xn.height/2,Qn=xt.top-ye.top+xt.height/2;ot=is-ao,Yt=Qn-lo}const mn=xr+Yt+We+Xe;let Ot=Math.min(ct,mn);const wn=ct-$e-We,Yn=mn-Ot,Rn=Math.max(Te,Le+ot),ss=br-qe,os=Math.max(0,Rn+ye.width-ss);q.style.left=`${Rn-os}px`,q.style.height=`${Ot}px`,q.style.maxHeight="auto",q.style.marginTop=`${$e}px`,q.style.marginBottom=`${We}px`,Ee.style.height="100%";const ba=we.scrollHeight-we.clientHeight,bi=Yn>=ba;bi&&(Ot=Math.min(ct,ye.height)-(Yn-ba));const xi=xe.top<mt||xe.bottom>ct-mt||Ot<Math.min(Ve,Fe),xs=(ve.visualViewport?.scale??1)!==1&&nx;if(xi||xs){Q.current=!0,Zh(q,se.current),ui.flushSync(()=>k(!1));return}if(bi){const Xn=Math.max(0,ct-mn);q.style.top=ye.height>=wn?"0":`${Xn}px`,q.style.height=`${Ot}px`,we.scrollTop=we.scrollHeight-we.clientHeight,I.current=Math.max(Fe,Ot)}else q.style.bottom="0",I.current=Math.max(Fe,Ot),we.scrollTop=Yn;if(xt){const Xn=ye.top,is=ye.height,ao=xt.top+xt.height/2,lo=is>0?(ao-Xn)/is*100:50,Qn=zy(lo,0,100);Ee.style.setProperty("--transform-origin",`50% ${Qn}%`)}(I.current===ct||Ot>=me)&&(G.current=!0),w(),setTimeout(()=>{Q.current=!0})}finally{re()}})}},[f,Y,q,B,y,b,d,w,R,k,oe,L,j,U]),_.useEffect(()=>{if(!R||!q||!Y)return;const Ee=an(q);function re(de){g(!1,Kt(N8,de))}return Ee.addEventListener("resize",re),()=>{Ee.removeEventListener("resize",re)}},[g,R,q,Y]);const he={...U?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":S||void 0,id:`${X}-list`},onKeyDown(Ee){x.current=!0,O&&rO.has(Ee.key)&&Ee.stopPropagation()},onMouseMove(){x.current=!1},onPointerLeave(Ee){if(!C||WA(Ee)||Ee.pointerType==="touch")return;const re=Ee.currentTarget;z.start(0,()=>{f.set("activeIndex",null),re.focus({preventScroll:!0})})},onScroll(Ee){U||pe(Ee.currentTarget)},...R&&{style:U?{height:"100%"}:QG}},He=Pt("div",t,{ref:[n,d],state:Se,stateAttributesMapping:hZ,props:[P,he,Cp(V),{className:!U&&R?UC.className:void 0},c]});return h.jsxs(_.Fragment,{children:[!F&&UC.getElement(K),h.jsx(NA,{context:D,modal:!1,disabled:!te,returnFocus:a,restoreFocus:!0,children:He})]})});function HC(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function qC(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const VC=[["transform","none"],["scale","1"],["translate","0 0"]];function mZ(e){const{style:t}=e,n={};for(const[s,i]of VC)n[s]=t.getPropertyValue(s),t.setProperty(s,i,"important");return()=>{for(const[s]of VC){const i=n[s];i?t.setProperty(s,i):t.removeProperty(s)}}}let sO=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function hx(e={}){const{label:t,metadata:n,textRef:s,indexGuessBehavior:i,index:a}=e,{register:c,unregister:f,subscribeMapChange:d,elementsRef:p,labelsRef:g,nextIndexRef:y}=KG(),b=_.useRef(-1),[x,S]=_.useState(a??(i===sO.GuessFromOrder?()=>{if(b.current===-1){const C=y.current;y.current+=1,b.current=C}return b.current}:-1)),w=_.useRef(null),T=_.useCallback(C=>{if(w.current=C,x!==-1&&C!==null&&(p.current[x]=C,g)){const A=t!==void 0;g.current[x]=A?t:s?.current?.textContent??C.textContent}},[x,p,g,t,s]);return ze(()=>{if(a!=null)return;const C=w.current;if(C)return c(C,n),()=>{f(C)}},[a,c,f,n]),ze(()=>{if(a==null)return d(C=>{const A=w.current?C.get(w.current)?.index:null;A!=null&&S(A)})},[a,d,S]),_.useMemo(()=>({ref:T,index:x}),[x,T])}const gZ=_.createContext(void 0),yZ=_.memo(_.forwardRef(function(t,n){const{render:s,className:i,value:a=null,label:c,disabled:f=!1,nativeButton:d=!1,...p}=t,g=_.useRef(null),y=hx({label:c,textRef:g,indexGuessBehavior:sO.GuessFromOrder}),{store:b,getItemProps:x,setOpen:S,setValue:w,selectionRef:T,typingRef:C,valuesRef:A,keyboardActiveRef:N,multiple:R,highlightItemOnHover:k}=Yu(),L=Jr(),j=at(b,it.isActive,y.index),O=at(b,it.isSelected,y.index,a),D=at(b,it.isSelectedByFocus,y.index),K=at(b,it.isItemEqualToValue),F=y.index,z=F!==-1,X=_.useRef(null),Y=Xo(F);ze(()=>{if(!z)return;const oe=A.current;return oe[F]=a,()=>{delete oe[F]}},[z,F,a,A]),ze(()=>{if(!z)return;const oe=b.state.value;let pe=oe;R&&Array.isArray(oe)&&oe.length>0&&(pe=oe[oe.length-1]),pe!==void 0&&Ll(a,pe,K)&&b.set("selectedIndex",F)},[z,F,R,K,b,a]);const te={disabled:f,selected:O,highlighted:j},P=x({active:j,selected:O});P.onFocus=void 0,P.id=void 0;const V=_.useRef(null),B=_.useRef("mouse"),q=_.useRef(!1),{getButtonProps:U,buttonRef:I}=Ql({disabled:f,focusableWhenDisabled:!0,native:d});function G(oe){const pe=b.state.value;if(R){const Se=Array.isArray(pe)?pe:[],he=O?NG(Se,a,K):[...Se,a];w(he,Kt(Ty,oe))}else w(a,Kt(Ty,oe)),S(!1,Kt(Ty,oe))}const W={role:"option","aria-selected":O,tabIndex:j?0:-1,onFocus(){b.set("activeIndex",F)},onMouseEnter(){!N.current&&b.state.selectedIndex===null&&k&&b.set("activeIndex",F)},onMouseMove(){k&&b.set("activeIndex",F)},onMouseLeave(oe){!k||N.current||WA(oe)||L.start(0,()=>{b.state.activeIndex===F&&b.set("activeIndex",null)})},onTouchStart(){T.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(oe){V.current=oe.key,b.set("activeIndex",F)},onClick(oe){q.current=!1,!(oe.type==="keydown"&&V.current===null)&&(f||V.current===" "&&C.current||B.current!=="touch"&&!j||(V.current=null,G(oe.nativeEvent)))},onPointerEnter(oe){B.current=oe.pointerType},onPointerDown(oe){B.current=oe.pointerType,q.current=!0},onMouseUp(oe){if(f)return;if(q.current){q.current=!1;return}const pe=!T.current.allowSelectedMouseUp&&O,Se=!T.current.allowUnselectedMouseUp&&!O;pe||Se||B.current!=="touch"&&!j||G(oe.nativeEvent)}},Q=Pt("div",t,{ref:[I,n,y.ref,X],state:te,props:[P,W,p,U]}),se=_.useMemo(()=>({selected:O,indexRef:Y,textRef:g,selectedByFocus:D,hasRegistered:z}),[O,Y,g,D,z]);return h.jsx(gZ.Provider,{value:se,children:Q})})),vZ=_.forwardRef(({className:e,children:t,...n},s)=>h.jsx(zG,{ref:s,className:ge("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}));vZ.displayName="SelectTrigger";const bZ=_.forwardRef(({className:e,portalProps:t,positionerProps:n,...s},i)=>h.jsx(UG,{...t,children:h.jsx(JG,{...n,children:h.jsx(pZ,{ref:i,className:ge("bg-panel border border-border rounded-md py-1 shadow-lg z-50",e),...s})})}));bZ.displayName="SelectContent";const xZ=_.forwardRef(({className:e,...t},n)=>h.jsx(yZ,{ref:n,className:ge("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}));xZ.displayName="SelectItem";const SZ=_.forwardRef(({className:e,...t},n)=>h.jsx("textarea",{ref:n,className:ge("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}));SZ.displayName="Textarea";const oO=_.createContext(void 0);function _Z(e=!0){const t=_.useContext(oO);if(t===void 0&&!e)throw new Error(pn(7));return t}function iO(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:s}=Ij(),{ref:i,index:a}=hx(e),c=n===a,f=_.useRef(null),d=to(i,f);return{compositeProps:_.useMemo(()=>({tabIndex:c?0:-1,onFocus(){s(a)},onMouseMove(){const g=f.current;if(!t||!g)return;const y=g.hasAttribute("disabled")||g.ariaDisabled==="true";!c&&!y&&g.focus()}}),[c,s,a,t]),compositeRef:d,index:a}}function wZ(e){const{render:t,className:n,state:s=rn,props:i=Tu,refs:a=Tu,metadata:c,stateAttributesMapping:f,tag:d="div",...p}=e,{compositeProps:g,compositeRef:y}=iO({metadata:c});return Pt(d,e,{state:s,ref:[...a,y],props:[g,...i,p],stateAttributesMapping:f})}const EZ=_.forwardRef(function(t,n){const{className:s,defaultPressed:i=!1,disabled:a=!1,form:c,onPressedChange:f,pressed:d,render:p,type:g,value:y,nativeButton:b=!0,...x}=t,S=pr(y||void 0),w=_Z(),T=w?.value??[],C=w?void 0:i,A=(a||w?.disabled)??!1,[N,R]=dp({controlled:w?S!==void 0&&T.indexOf(S)>-1:d,default:C,name:"Toggle",state:"pressed"}),k=Ae((z,X)=>{S&&w?.setGroupValue?.(S,z,X),f?.(z,X)}),{getButtonProps:L,buttonRef:j}=Ql({disabled:A,native:b}),O={disabled:A,pressed:N},D=[j,n],K=[{"aria-pressed":N,onClick(z){const X=!N,Y=Kt(ri,z.nativeEvent);k(X,Y),!Y.isCanceled&&R(X)}},x,L],F=Pt("button",t,{enabled:!w,state:O,ref:D,props:K});return w?h.jsx(wZ,{tag:"button",render:p,className:s,state:O,refs:D,props:K}):F}),aO=_.forwardRef(({className:e,...t},n)=>h.jsx(EZ,{ref:n,className:ge("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}));aO.displayName="Toggle";function TZ(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const lO="data-composite-item-active",CZ=[];function RZ(e){const{itemSizes:t,cols:n=1,loopFocus:s=!0,dense:i=!1,orientation:a="both",direction:c,highlightedIndex:f,onHighlightedIndexChange:d,rootRef:p,enableHomeAndEndKeys:g=!1,stopEventPropagation:y=!1,disabledIndices:b,modifierKeys:x=CZ}=e,[S,w]=_.useState(0),T=n>1,C=_.useRef(null),A=to(C,p),N=_.useRef([]),R=_.useRef(!1),k=f??S,L=Ae((D,K=!1)=>{if((d??w)(D),K){const F=N.current[D];BC(C.current,F,c,a)}}),j=Ae(D=>{if(D.size===0||R.current)return;R.current=!0;const K=Array.from(D.keys()),F=K.find(X=>X?.hasAttribute(lO))??null,z=F?K.indexOf(F):-1;z!==-1&&L(z),BC(C.current,F,c,a)}),O=_.useMemo(()=>({"aria-orientation":a==="both"?void 0:a,ref:A,onFocus(D){!C.current||!$C(D.target)||D.target.setSelectionRange(0,D.target.value.length??0)},onKeyDown(D){const K=g?rZ:nO;if(!K.has(D.key)||NZ(D,x)||!C.current)return;const z=c==="rtl",X=z?Nu:_l,Y={horizontal:X,vertical:Zi,both:X}[a],te=z?_l:Nu,P={horizontal:te,vertical:Sl,both:te}[a];if($C(D.target)&&!TZ(D.target)){const W=D.target.selectionStart,Q=D.target.selectionEnd,se=D.target.value??"";if(W==null||D.shiftKey||W!==Q||D.key!==P&&W<se.length||D.key!==Y&&W>0)return}let V=k;const B=FV(N,b),q=HV(N,b);if(T){const W=t||Array.from({length:N.current.length},()=>({width:1,height:1})),Q=VV(W,n,i),se=Q.findIndex(pe=>pe!=null&&!fu(N,pe,b)),oe=Q.reduce((pe,Se,he)=>Se!=null&&!fu(N,Se,b)?he:pe,-1);V=Q[qV({current:Q.map(pe=>pe?N.current[pe]:null)},{event:D,orientation:a,loopFocus:s,cols:n,disabledIndices:GV([...b||N.current.map((pe,Se)=>fu(N,Se)?Se:void 0),void 0],Q),minIndex:se,maxIndex:oe,prevIndex:KV(k>q?B:k,W,Q,n,D.key===Zi?"bl":D.key===_l?"tr":"tl"),rtl:z})]}const U={horizontal:[X],vertical:[Zi],both:[X,Zi]}[a],I={horizontal:[te],vertical:[Sl],both:[te,Sl]}[a],G=T?K:{horizontal:g?tZ:eO,vertical:g?nZ:tO,both:K}[a];g&&(D.key===Xu?V=B:D.key===Qu&&(V=q)),V===k&&(U.includes(D.key)||I.includes(D.key))&&(s&&V===q&&U.includes(D.key)?V=B:s&&V===B&&I.includes(D.key)?V=q:V=ir(N,{startingIndex:V,decrement:I.includes(D.key),disabledIndices:b})),V!==k&&!sh(N,V)&&(y&&D.stopPropagation(),G.has(D.key)&&D.preventDefault(),L(V,!0),queueMicrotask(()=>{N.current[V]?.focus()}))}}),[n,i,c,b,N,g,k,T,t,s,A,x,L,a,y]);return _.useMemo(()=>({props:O,highlightedIndex:k,onHighlightedIndexChange:L,elementsRef:N,disabledIndices:b,onMapChange:j,relayKeyboardEvent:O.onKeyDown}),[O,k,L,N,b,j])}function NZ(e,t){for(const n of lZ.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function cO(e){const{render:t,className:n,refs:s=Tu,props:i=Tu,state:a=rn,stateAttributesMapping:c,highlightedIndex:f,onHighlightedIndexChange:d,orientation:p,dense:g,itemSizes:y,loopFocus:b,cols:x,enableHomeAndEndKeys:S,onMapChange:w,stopEventPropagation:T=!0,rootRef:C,disabledIndices:A,modifierKeys:N,highlightItemOnHover:R=!1,tag:k="div",...L}=e,j=$A(),{props:O,highlightedIndex:D,onHighlightedIndexChange:K,elementsRef:F,onMapChange:z,relayKeyboardEvent:X}=RZ({itemSizes:y,cols:x,loopFocus:b,dense:g,orientation:p,highlightedIndex:f,onHighlightedIndexChange:d,rootRef:C,stopEventPropagation:T,enableHomeAndEndKeys:S,direction:j,disabledIndices:A,modifierKeys:N}),Y=Pt(k,e,{state:a,ref:s,props:[O,...i,L],stateAttributesMapping:c}),te=_.useMemo(()=>({highlightedIndex:D,onHighlightedIndexChange:K,highlightItemOnHover:R,relayKeyboardEvent:X}),[D,K,R,X]);return h.jsx(kj.Provider,{value:te,children:h.jsx(YA,{elementsRef:F,onMapChange:P=>{w?.(P),z(P)},children:Y})})}let jZ=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e.multiple="data-multiple",e})({});const KC={multiple(e){return e?{[jZ.multiple]:""}:null}},AZ=_.forwardRef(function(t,n){const{defaultValue:s,disabled:i=!1,loopFocus:a=!0,onValueChange:c,orientation:f="horizontal",multiple:d=!1,value:p,className:g,render:y,...b}=t,x=JA(),S=_.useMemo(()=>{if(p===void 0)return s??[]},[p,s]),w=_.useMemo(()=>p!==void 0||s!==void 0,[p,s]),T=(x?.disabled??!1)||i,[C,A]=dp({controlled:p,default:S,name:"ToggleGroup",state:"value"}),N=Ae((O,D,K)=>{let F;if(d?(F=C.slice(),D?F.push(O):F.splice(C.indexOf(O),1)):F=D?[O]:[],Array.isArray(F)){if(c?.(F,K),K.isCanceled)return;A(F)}}),R={disabled:T,multiple:d,orientation:f},k=_.useMemo(()=>({disabled:T,orientation:f,setGroupValue:N,value:C,isValueInitialized:w}),[T,f,N,C,w]),L={role:"group"},j=Pt("div",t,{enabled:!!x,state:R,ref:n,props:[L,b],stateAttributesMapping:KC});return h.jsx(oO.Provider,{value:k,children:x?j:h.jsx(cO,{render:y,className:g,state:R,refs:[n],props:[L,b],stateAttributesMapping:KC,loopFocus:a,enableHomeAndEndKeys:!0})})}),lh=_.forwardRef(({className:e,...t},n)=>h.jsx(AZ,{ref:n,className:ge("flex items-center gap-0.5",e),...t}));lh.displayName="ToggleGroup";const OZ=ge(Gj({variant:"secondary",size:"sm"}),"h-7 whitespace-nowrap uppercase tracking-[0.08em] leading-none no-underline");function uO({active:e,onClick:t,children:n,className:s}){return h.jsxs("button",{type:"button",onClick:t,className:ge("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",s),children:[n,e&&h.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 MZ({items:e,activeId:t,onItemChange:n,renderItem:s,className:i}){return h.jsx("div",{className:ge("flex items-center gap-0.5",i),children:e.map(a=>{const c=a.id===t,f=()=>n?.(a.id);return s?h.jsx("span",{children:s(a,{active:c,onClick:f})},a.id):h.jsx(uO,{active:c,onClick:f,children:a.label},a.id)})})}const kZ=di("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}}),IZ={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 DZ({color:e,size:t,glow:n,pulse:s,className:i}){return h.jsx("span",{className:ge(kZ({color:e,size:t,glow:n}),s&&"dot-pulse",i),style:n?{boxShadow:IZ[e??"healthy"]}:void 0})}const PZ="0.0.6-165",zZ={version:PZ},LZ=zZ.version;function UZ({label:e,className:t}){return h.jsxs("div",{className:ge("flex items-center gap-3",t),children:[h.jsx(DZ,{color:"healthy",size:"md",glow:!0}),h.jsx("span",{className:"font-display font-bold text-white text-sm tracking-tight",children:"syncular"}),e&&h.jsx("span",{className:"font-mono text-[9px] text-neutral-600 uppercase tracking-widest",children:e}),h.jsxs("span",{className:"font-mono text-[9px] text-neutral-600 tracking-wider",children:["v",LZ]})]})}function $Z({brand:e,center:t,right:n,className:s}){return h.jsxs(h.Fragment,{children:[h.jsx("div",{"aria-hidden":"true",className:"h-[42px] shrink-0"}),h.jsxs("nav",{className:ge("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",s),children:[h.jsx("div",{className:"flex items-center gap-3",children:e}),h.jsx("div",{className:"flex items-center gap-0.5",children:t}),h.jsx("div",{className:"flex items-center gap-2",children:n})]})]})}const BZ=di("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"}}),On=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx("div",{ref:s,role:"alert",className:ge(BZ({variant:t,className:e})),...n}));On.displayName="Alert";const Wu=_.forwardRef(({className:e,...t},n)=>h.jsx("h5",{ref:n,className:ge("font-medium text-white mb-1",e),...t}));Wu.displayName="AlertTitle";const Mn=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("text-neutral-400",e),...t}));Mn.displayName="AlertDescription";const fO=_.createContext(void 0);function sc(e){const t=_.useContext(fO);if(e===!1&&t===void 0)throw new Error(pn(27));return t}const FZ={...rc,...ga},px=_.forwardRef(function(t,n){const{render:s,className:i,forceRender:a=!1,...c}=t,{store:f}=sc(),d=f.useState("open"),p=f.useState("nested"),g=f.useState("mounted"),y=f.useState("transitionStatus");return Pt("div",t,{state:{open:d,transitionStatus:y},ref:[f.context.backdropRef,n],stateAttributesMapping:FZ,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:a||!p})}),dO=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...c}=t,{store:f}=sc(),d=pr(a);return f.useSyncedValueWithCleanup("descriptionElementId",d),Pt("p",t,{ref:n,props:[{id:d},c]})});let HZ=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),qZ=(function(e){return e[e.open=Gi.open]="open",e[e.closed=Gi.closed]="closed",e[e.startingStyle=Gi.startingStyle]="startingStyle",e[e.endingStyle=Gi.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const hO=_.createContext(void 0);function VZ(){const e=_.useContext(hO);if(e===void 0)throw new Error(pn(26));return e}const KZ={...rc,...ga,nestedDialogOpen(e){return e?{[qZ.nestedDialogOpen]:""}:null}},pO=_.forwardRef(function(t,n){const{className:s,finalFocus:i,initialFocus:a,render:c,...f}=t,{store:d}=sc(),p=d.useState("descriptionElementId"),g=d.useState("disablePointerDismissal"),y=d.useState("floatingRootContext"),b=d.useState("popupProps"),x=d.useState("modal"),S=d.useState("mounted"),w=d.useState("nested"),T=d.useState("nestedOpenDialogCount"),C=d.useState("open"),A=d.useState("openMethod"),N=d.useState("titleElementId"),R=d.useState("transitionStatus"),k=d.useState("role");VZ(),ya({open:C,ref:d.context.popupRef,onComplete(){C&&d.context.onOpenChangeComplete?.(!0)}});function L(F){return F==="touch"?d.context.popupRef.current:!0}const j=a===void 0?L:a,O=T>0,K=Pt("div",t,{state:{open:C,nested:w,transitionStatus:R,nestedDialogOpen:O},props:[b,{"aria-labelledby":N??void 0,"aria-describedby":p??void 0,role:k,tabIndex:-1,hidden:!S,onKeyDown(F){rO.has(F.key)&&F.stopPropagation()},style:{[HZ.nestedDialogs]:T}},f],ref:[n,d.context.popupRef,d.useStateSetter("popupElement")],stateAttributesMapping:KZ});return h.jsx(NA,{context:y,openInteractionType:A,disabled:!S,closeOnFocusOut:!g,initialFocus:j,returnFocus:i,modal:x!==!1,restoreFocus:"popup",children:K})}),mO=_.forwardRef(function(t,n){const{keepMounted:s=!1,...i}=t,{store:a}=sc(),c=a.useState("mounted"),f=a.useState("modal"),d=a.useState("open");return c||s?h.jsx(hO.Provider,{value:s,children:h.jsxs(RA,{ref:n,...i,children:[c&&f===!0&&h.jsx(QA,{ref:a.context.internalBackdropRef,inert:dx(!d)}),t.children]})}):null});function GZ(e){const{store:t,parentContext:n,actionsRef:s}=e,i=t.useState("open"),a=t.useState("disablePointerDismissal"),c=t.useState("modal"),f=t.useState("popupElement"),{openMethod:d,triggerProps:p,reset:g}=kG(i);wK(t);const{forceUnmount:y}=EK(i,t,()=>{g()}),b=Ae(K=>{const F=Kt(K);return F.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},F}),x=_.useCallback(()=>{t.setOpen(!1,b(R8))},[t,b]);_.useImperativeHandle(s,()=>({unmount:y,close:x}),[y,x]);const S=AK({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[w,T]=_.useState(0),C=w===0,A=UK(S),N=fK(S,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:c==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(K){if(!t.context.outsidePressEnabledRef.current||"button"in K&&K.button!==0||"touches"in K&&K.touches.length!==1)return!1;const F=Ir(K);if(C&&!a){const z=F;return c&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===z||t.context.backdropRef.current===z||Mt(z,f)&&!z?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:C});GA(i&&c===!0,f);const{getReferenceProps:R,getFloatingProps:k,getTriggerProps:L}=zK([A,N]);t.useContextCallback("onNestedDialogOpen",K=>{T(K+1)}),t.useContextCallback("onNestedDialogClose",()=>{T(0)}),_.useEffect(()=>(n?.onNestedDialogOpen&&i&&n.onNestedDialogOpen(w),n?.onNestedDialogClose&&!i&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&i&&n.onNestedDialogClose()}),[i,n,w]);const j=_.useMemo(()=>R(p),[R,p]),O=_.useMemo(()=>L(p),[L,p]),D=_.useMemo(()=>k(),[k]);t.useSyncedValues({openMethod:d,activeTriggerProps:j,inactiveTriggerProps:O,popupProps:D,floatingRootContext:S,nestedOpenDialogCount:w})}const ZZ={...RK,modal:Ie(e=>e.modal),nested:Ie(e=>e.nested),nestedOpenDialogCount:Ie(e=>e.nestedOpenDialogCount),disablePointerDismissal:Ie(e=>e.disablePointerDismissal),openMethod:Ie(e=>e.openMethod),descriptionElementId:Ie(e=>e.descriptionElementId),titleElementId:Ie(e=>e.titleElementId),viewportElement:Ie(e=>e.viewportElement),role:Ie(e=>e.role)};class YZ extends zA{constructor(t){super(XZ(t),{popupRef:_.createRef(),backdropRef:_.createRef(),internalBackdropRef:_.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new ux,onOpenChange:void 0,onOpenChangeComplete:void 0},ZZ)}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 s={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",s);const i={open:t},a=n.trigger?.id??null;(a||t)&&(i.activeTriggerId=a,i.activeTriggerElement=n.trigger??null),this.update(i)}}function XZ(e={}){return{...CK(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function QZ(e){const{children:t,open:n,defaultOpen:s=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:c=!1,modal:f=!0,actionsRef:d,handle:p,triggerId:g,defaultTriggerId:y=null}=e,b=sc(!0),x=!!b,S=In(()=>p?.store??new YZ({open:s,openProp:n,activeTriggerId:y,triggerIdProp:g,modal:f,disablePointerDismissal:c,nested:x})).current;hV(()=>{n===void 0&&S.state.open===!1&&s===!0&&S.update({open:!0,activeTriggerId:y})}),S.useControlledProp("openProp",n),S.useControlledProp("triggerIdProp",g),S.useSyncedValues({disablePointerDismissal:c,nested:x,modal:f}),S.useContextCallback("onOpenChange",i),S.useContextCallback("onOpenChangeComplete",a);const w=S.useState("payload");GZ({store:S,actionsRef:d,parentContext:b?.store.context});const T=_.useMemo(()=>({store:S}),[S]);return h.jsx(fO.Provider,{value:T,children:typeof t=="function"?t({payload:w}):t})}const gO=_.forwardRef(function(t,n){const{render:s,className:i,id:a,...c}=t,{store:f}=sc(),d=pr(a);return f.useSyncedValueWithCleanup("titleElementId",d),Pt("h2",t,{ref:n,props:[{id:d},c]})}),Dr=QZ,WZ=_.forwardRef(({className:e,...t},n)=>h.jsx(px,{ref:n,className:ge("fixed inset-0 z-50 bg-black/60 backdrop-blur-sm",e),...t}));WZ.displayName="DialogOverlay";const lr=_.forwardRef(({className:e,children:t,...n},s)=>h.jsxs(mO,{children:[h.jsx(px,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),h.jsx(pO,{ref:s,className:ge("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})]}));lr.displayName="DialogContent";const cr=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-b border-border",e),...t}));cr.displayName="DialogHeader";const Tn=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-t border-border flex justify-end gap-2",e),...t}));Tn.displayName="DialogFooter";const ur=_.forwardRef(({className:e,...t},n)=>h.jsx(gO,{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));ur.displayName="DialogTitle";const JZ=_.forwardRef(({className:e,...t},n)=>h.jsx(dO,{ref:n,className:ge("font-mono text-[10px] text-neutral-500",e),...t}));JZ.displayName="DialogDescription";const mx=_.forwardRef(({className:e,page:t,totalPages:n,totalItems:s,onPageChange:i,...a},c)=>h.jsxs("div",{ref:c,className:ge("px-5 py-2.5 border-t border-border flex items-center justify-between",e),...a,children:[h.jsxs("span",{className:"font-mono text-[10px] text-neutral-600",children:[s," items · Page ",t," of ",n]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsx(Me,{size:"sm",variant:"default",disabled:t<=1,onClick:()=>i(t-1),children:"Prev"}),h.jsx(Me,{size:"sm",variant:"default",disabled:t>=n,onClick:()=>i(t+1),children:"Next"})]})]}));mx.displayName="Pagination";const eY=_.forwardRef(({className:e,orientation:t="horizontal",...n},s)=>h.jsx("hr",{ref:s,"aria-orientation":t==="vertical"?"vertical":void 0,className:ge("border-none m-0",t==="horizontal"?"h-px w-full bg-border":"w-px h-4 bg-border",e),...n}));eY.displayName="Separator";const tY=di("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"}}),nY=_.forwardRef(({className:e,side:t,children:n,...s},i)=>h.jsxs(mO,{children:[h.jsx(px,{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm"}),h.jsx(pO,{ref:i,className:ge(tY({side:t,className:e})),...s,children:n})]}));nY.displayName="SheetContent";const rY=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-b border-border",e),...t}));rY.displayName="SheetHeader";const sY=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("px-5 py-3 border-t border-border flex justify-end gap-2",e),...t}));sY.displayName="SheetFooter";const oY=_.forwardRef(({className:e,...t},n)=>h.jsx(gO,{ref:n,className:ge("font-mono text-[10px] text-neutral-500 uppercase tracking-widest",e),...t}));oY.displayName="SheetTitle";const iY=_.forwardRef(({className:e,...t},n)=>h.jsx(dO,{ref:n,className:ge("text-sm text-neutral-400",e),...t}));iY.displayName="SheetDescription";const aY=_.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:ge("rounded-md bg-neutral-800 animate-pulse",e),...t}));aY.displayName="Skeleton";const lY=_.createContext(void 0);function gx(){const e=_.useContext(lY);if(e===void 0)throw new Error(pn(64));return e}let cY=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const yO={tabActivationDirection:e=>({[cY.activationDirection]:e})},vO=_.createContext(void 0);function uY(){const e=_.useContext(vO);if(e===void 0)throw new Error(pn(65));return e}const fY=_.forwardRef(function(t,n){const{className:s,disabled:i=!1,render:a,value:c,id:f,nativeButton:d=!0,...p}=t,{value:g,getTabPanelIdByValue:y,orientation:b}=gx(),{activateOnFocus:x,highlightedTabIndex:S,onTabActivation:w,setHighlightedTabIndex:T,tabsListElement:C}=uY(),A=pr(f),N=_.useMemo(()=>({disabled:i,id:A,value:c}),[i,A,c]),{compositeProps:R,compositeRef:k,index:L}=iO({metadata:N}),j=c===g,O=_.useRef(!1);ze(()=>{if(O.current){O.current=!1;return}if(!(j&&L>-1&&S!==L))return;const q=C;if(q!=null){const U=Lo(Rt(q));if(U&&Mt(q,U))return}i||T(L)},[j,L,S,T,i,C]);const{getButtonProps:D,buttonRef:K}=Ql({disabled:i,native:d,focusableWhenDisabled:!0}),F=y(c),z=_.useRef(!1),X=_.useRef(!1);function Y(q){j||i||w(c,Kt(ri,q.nativeEvent,void 0,{activationDirection:"none"}))}function te(q){j||(L>-1&&!i&&T(L),!i&&x&&(!z.current||z.current&&X.current)&&w(c,Kt(ri,q.nativeEvent,void 0,{activationDirection:"none"})))}function P(q){if(j||i)return;z.current=!0;function U(){z.current=!1,X.current=!1}(!q.button||q.button===0)&&(X.current=!0,Rt(q.currentTarget).addEventListener("pointerup",U,{once:!0}))}return Pt("button",t,{state:{disabled:i,active:j,orientation:b},ref:[n,K,k],props:[R,{role:"tab","aria-controls":F,"aria-selected":j,id:A,onClick:Y,onFocus:te,onPointerDown:P,[lO]:j?"":void 0,onKeyDownCapture(){O.current=!0}},p,D]})});let dY=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const hY={...yO,...ga},pY=_.forwardRef(function(t,n){const{className:s,value:i,render:a,keepMounted:c=!1,...f}=t,{value:d,getTabIdByPanelValue:p,orientation:g,tabActivationDirection:y,registerMountedTabPanel:b,unregisterMountedTabPanel:x}=gx(),S=pr(),w=_.useMemo(()=>({id:S,value:i}),[S,i]),{ref:T,index:C}=hx({metadata:w}),A=i===d,{mounted:N,transitionStatus:R,setMounted:k}=Tp(A),L=!N,j=p(i),O={hidden:L,orientation:g,tabActivationDirection:y,transitionStatus:R},D=_.useRef(null),K=Pt("div",t,{state:O,ref:[n,T,D],props:[{"aria-labelledby":j,hidden:L,id:S,role:"tabpanel",tabIndex:A?0:-1,inert:dx(!A),[dY.index]:C},f],stateAttributesMapping:hY});return ya({open:A,ref:D,onComplete(){A||k(!1)}}),ze(()=>{if(!(L&&!c)&&S!=null)return b(i,S),()=>{x(i,S)}},[L,c,i,S,b,x]),c||N?K:null}),mY=_.forwardRef(function(t,n){const{activateOnFocus:s=!1,className:i,loopFocus:a=!0,render:c,...f}=t,{getTabElementBySelectedValue:d,onValueChange:p,orientation:g,value:y,setTabMap:b,tabActivationDirection:x}=gx(),[S,w]=_.useState(0),[T,C]=_.useState(null),A=gY(y,g,T,d),N=Ae((j,O)=>{if(j!==y){const D=A(j);O.activationDirection=D,p(j,O)}}),R={orientation:g,tabActivationDirection:x},k={"aria-orientation":g==="vertical"?"vertical":void 0,role:"tablist"},L=_.useMemo(()=>({activateOnFocus:s,highlightedTabIndex:S,onTabActivation:N,setHighlightedTabIndex:w,tabsListElement:T,value:y}),[s,S,N,w,T,y]);return h.jsx(vO.Provider,{value:L,children:h.jsx(cO,{render:c,className:i,state:R,refs:[n,C],props:[k,f],stateAttributesMapping:yO,highlightedIndex:S,enableHomeAndEndKeys:!0,loopFocus:a,orientation:g,onHighlightedIndexChange:w,onMapChange:b,disabledIndices:Tu})})});function GC(e,t){const{left:n,top:s}=e.getBoundingClientRect(),{left:i,top:a}=t.getBoundingClientRect(),c=n-i,f=s-a;return{left:c,top:f}}function gY(e,t,n,s){const[i,a]=_.useState(null);return ze(()=>{if(e==null||n==null){a(null);return}const c=s(e);if(c==null){a(null);return}const{left:f,top:d}=GC(c,n);a(t==="horizontal"?f:d)},[t,s,n,e]),_.useCallback(c=>{if(c===e)return"none";if(c==null)return a(null),"none";if(c!=null&&n!=null){const f=s(c);if(f!=null){const{left:d,top:p}=GC(f,n);if(i==null)return a(t==="horizontal"?d:p),"none";if(t==="horizontal"){if(d<i)return a(d),"left";if(d>i)return a(d),"right"}else{if(p<i)return a(p),"up";if(p>i)return a(p),"down"}}}return"none"},[s,t,i,n,e])}const yY=_.forwardRef(({className:e,...t},n)=>h.jsx(mY,{ref:n,className:ge("flex items-center gap-0.5",e),...t}));yY.displayName="TabsList";const vY=di("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"}}),bY=_.forwardRef(({className:e,variant:t,...n},s)=>h.jsx(fY,{ref:s,className:ge(vY({variant:t,className:e})),...n}));bY.displayName="TabsTrigger";const xY=_.forwardRef(({className:e,...t},n)=>h.jsx(pY,{ref:n,className:ge("outline-none",e),...t}));xY.displayName="TabsContent";const SY=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("font-mono text-[11px] text-neutral-300",e),...t}));SY.displayName="Text";const _Y=_.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:ge("font-mono text-[10px] text-neutral-500",e),...t}));_Y.displayName="TextMuted";const wY=_.forwardRef(({className:e,...t},n)=>h.jsx("code",{ref:n,className:ge("font-mono text-[11px] text-white",e),...t}));wY.displayName="TextCode";const EY=_.forwardRef(({className:e,...t},n)=>h.jsx("span",{ref:n,className:ge("font-mono text-[9px] uppercase tracking-wider text-neutral-500",e),...t}));EY.displayName="TextLabel";const TY=_.forwardRef(({className:e,...t},n)=>h.jsx("pre",{ref:n,className:ge("font-mono text-[11px] text-neutral-300 p-3 rounded border border-border bg-panel-alt overflow-x-auto",e),...t}));TY.displayName="CodeBlock";function va(e,t){const[n,s]=_.useState(()=>{if(typeof window>"u")return t;try{const a=window.localStorage.getItem(e);return a===null?t:JSON.parse(a)}catch{return t}});_.useEffect(()=>{try{n==null?window.localStorage.removeItem(e):window.localStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]);const i=_.useCallback(a=>{s(c=>typeof a=="function"?a(c):a)},[]);return[n,i]}const CY="console:instance-id";function Rp(){const[e,t]=va(CY,""),n=e.trim();return _.useMemo(()=>({instanceId:n.length>0?n:void 0,rawInstanceId:e,setInstanceId:t,clearInstanceId:()=>t("")}),[n,e,t])}const Zn={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 vi(e,t){return e===0?!1:e??t}function RY(e){const t=new URLSearchParams;if(!e)return t;for(const[n,s]of Object.entries(e))s!=null&&t.set(n,String(s));return t}function bO(e,t,n){const s=e.endsWith("/")?e.slice(0,-1):e,a=RY(n)?.toString();return`${s}${t}${a?`?${a}`:""}`}function Np(e,t){if(!t||!e)throw new Error("Not connected");return e}async function yr(e){const t={Authorization:`Bearer ${e.connectionConfig.token}`};e.body!==void 0&&(t["Content-Type"]="application/json");const n=await fetch(bO(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 NY(e){const t=await fetch(bO(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 ns(e){const{config:t,isConnected:n}=pa();return NN({queryKey:e.queryKey,queryFn:()=>yr({connectionConfig:Np(t,n),path:e.path,query:e.query,method:e.method,errorMessage:e.errorMessage}),enabled:(e.enabled??!0)&&n&&!!t,refetchInterval:e.refetchInterval})}function yx(e){const{config:t,isConnected:n}=pa();return NN({queryKey:e.queryKey,queryFn:()=>{if(e.id===void 0)throw new Error(e.requiredMessage);return yr({connectionConfig:Np(t,n),path:e.path(e.id),query:e.query,errorMessage:e.errorMessage})},enabled:(e.enabled??!0)&&e.id!==void 0&&n&&!!t})}function jY(e,t){for(const n of t)e.invalidateQueries({queryKey:n})}function vr(e){const{instanceId:t}=Rp();return e??t}function rs(e){const{config:t,isConnected:n}=pa(),{instanceId:s}=Rp(),i=Ab();return X6({mutationFn:a=>e.mutationFn({connectionConfig:Np(t,n),variables:a,selectedInstanceId:s}),onSuccess:()=>{e.invalidateQueryKeys&&jY(i,e.invalidateQueryKeys)}})}function Ju(e={}){const t=vr(e.instanceId);return ns({queryKey:Zn.stats({partitionId:e.partitionId,instanceId:t}),path:"/console/stats",query:{partitionId:e.partitionId,instanceId:t},errorMessage:"Failed to fetch stats",refetchInterval:vi(e.refetchIntervalMs,5e3)})}function AY(e={},t={}){const n=vr(e.instanceId);return ns({queryKey:Zn.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:vi(t.refetchIntervalMs,3e4)})}function OY(e={},t={}){const n=vr(e.instanceId);return ns({queryKey:Zn.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:vi(t.refetchIntervalMs,3e4)})}function MY(e={},t={}){const n=vr(e.instanceId);return ns({queryKey:Zn.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:vi(t.refetchIntervalMs,1e4)})}function kY(e,t={}){const n=vr(t.instanceId);return yx({queryKey:Zn.commitDetail(e,t.partitionId,n),id:e,requiredMessage:"Commit sequence is required",path:s=>`/console/commits/${encodeURIComponent(String(s))}`,query:{partitionId:t.partitionId,instanceId:n},errorMessage:"Failed to fetch commit detail",enabled:t.enabled})}function IY(e={},t={}){const n=vr(e.instanceId);return ns({queryKey:Zn.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:vi(t.refetchIntervalMs,1e4)})}function xO(e={},t={}){const n=vr(e.instanceId);return ns({queryKey:Zn.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:vi(t.refetchIntervalMs,1e4)})}function DY(e,t={}){const n=vr(t.instanceId);return yx({queryKey:Zn.eventDetail(e,t.partitionId,n),id:e,requiredMessage:"Event id is required",path:s=>`/console/events/${encodeURIComponent(String(s))}`,query:{partitionId:t.partitionId,instanceId:n},errorMessage:"Failed to fetch event detail",enabled:t.enabled})}function PY(e,t={}){const n=vr(t.instanceId);return yx({queryKey:Zn.eventPayload(e,t.partitionId,n),id:e,requiredMessage:"Event id is required",path:s=>`/console/events/${encodeURIComponent(String(s))}/payload`,query:{partitionId:t.partitionId,instanceId:n},errorMessage:"Failed to fetch event payload",enabled:t.enabled})}function zY(e={}){const t=vr(e.instanceId);return ns({queryKey:Zn.handlers(t),path:"/console/handlers",query:{instanceId:t},errorMessage:"Failed to fetch handlers"})}function LY(e={}){const t=vr(e.instanceId);return ns({queryKey:Zn.prunePreview(t),path:"/console/prune/preview",query:{instanceId:t},method:"POST",errorMessage:"Failed to fetch prune preview",enabled:e.enabled})}function UY(e={},t={}){const n=vr(e.instanceId);return ns({queryKey:Zn.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:vi(t.refetchIntervalMs,1e4)})}function $Y(){return rs({mutationFn:async({connectionConfig:e,selectedInstanceId:t})=>yr({connectionConfig:e,path:"/console/events",query:{instanceId:t},method:"DELETE",errorMessage:"Failed to clear events"}),invalidateQueryKeys:[["console","events"]]})}function BY(){return rs({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>{const s=t.instanceId??n;return yr({connectionConfig:e,path:`/console/clients/${encodeURIComponent(t.clientId)}`,query:{partitionId:t.partitionId,instanceId:s},method:"DELETE",errorMessage:"Failed to evict client"})},invalidateQueryKeys:[["console","clients"],["console","stats"],["console","operations"]]})}function FY(){return rs({mutationFn:async({connectionConfig:e,selectedInstanceId:t})=>yr({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 HY(){return rs({mutationFn:async({connectionConfig:e,selectedInstanceId:t})=>yr({connectionConfig:e,path:"/console/compact",query:{instanceId:t},method:"POST",errorMessage:"Failed to compact"}),invalidateQueryKeys:[["console","stats"],["console","operations"]]})}function qY(){return rs({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>{const s=t.instanceId??n;return yr({connectionConfig:e,path:"/console/notify-data-change",query:{instanceId:s},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 VY(e={}){const t=vr(e.instanceId);return ns({queryKey:Zn.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 KY(){return rs({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>yr({connectionConfig:e,path:"/console/api-keys",query:{instanceId:n},method:"POST",body:t,errorMessage:"Failed to create API key"}),invalidateQueryKeys:[["console","api-keys"]]})}function GY(){return rs({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>yr({connectionConfig:e,path:`/console/api-keys/${encodeURIComponent(t)}`,query:{instanceId:n},method:"DELETE",errorMessage:"Failed to revoke API key"}),invalidateQueryKeys:[["console","api-keys"]]})}function ZY(){return rs({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>yr({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 YY(){return rs({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>yr({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 XY(){return rs({mutationFn:async({connectionConfig:e,variables:t,selectedInstanceId:n})=>yr({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 QY(e={}){return ns({queryKey:Zn.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:vi(e.refetchIntervalMs,3e4)})}function WY(){return rs({mutationFn:async({connectionConfig:e,variables:t})=>yr({connectionConfig:e,path:`/console/storage/${encodeURIComponent(t)}`,method:"DELETE",errorMessage:"Failed to delete blob"}),invalidateQueryKeys:[["console","storage"]]})}function JY(){const{config:e,isConnected:t}=pa();return async n=>{const s=await NY({connectionConfig:Np(e,t),path:`/console/storage/${encodeURIComponent(n)}/download`,errorMessage:"Failed to download blob"}),i=URL.createObjectURL(s),a=document.createElement("a");a.href=i,a.download=n.split("/").pop()||n,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(i)}}const eX="console:partition-id";function ef(){const[e,t]=va(eX,""),n=e.trim();return _.useMemo(()=>({partitionId:n.length>0?n:void 0,rawPartitionId:e,setPartitionId:t,clearPartitionId:()=>t("")}),[n,e,t])}const ZC={refreshInterval:5,timeFormat:"relative",showSparklines:!0,pageSize:20};function tf(){const[e,t]=va("console:preferences",ZC);return{preferences:e,setPreferences:t,updatePreference:(i,a)=>{t(c=>({...c,[i]:a}))},resetPreferences:()=>{t(ZC)}}}const tX=[{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"}],nX=[{value:10,label:"10"},{value:20,label:"20"},{value:50,label:"50"},{value:100,label:"100"}],vx="syncular-console-root";function rX(e){e.classList.add(vx)}const sX=[{suffix:"",label:"Command"},{suffix:"/stream",label:"Stream"},{suffix:"/fleet",label:"Fleet"},{suffix:"/ops",label:"Ops"},{suffix:"/storage",label:"Storage"},{suffix:"/config",label:"Config"}];function oX(e){const t=e?.trim()??"";return!t||t==="/"?"":(t.startsWith("/")?t:`/${t}`).replace(/\/+$/g,"")}function Ly(e,t){return e?t?`${e}${t}`:e:t||"/"}function iX({basePath:e,appHref:t,modeBadge:n}){const{connect:s,config:i,isConnected:a,isConnecting:c}=pa(),{preferences:f}=tf(),{instanceId:d,rawInstanceId:p,setInstanceId:g,clearInstanceId:y}=Rp(),{partitionId:b,rawPartitionId:x,setPartitionId:S,clearPartitionId:w}=ef(),T=hr({select:D=>D.location.pathname}),{data:C}=Ju({refetchIntervalMs:f.refreshInterval*1e3,partitionId:b,instanceId:d}),A=oX(e),N=_.useMemo(()=>sX.map(D=>({...D,id:Ly(A,D.suffix)})),[A]),R=Ly(A,""),k=Ly(A,"/config"),L=c?"connecting":a?"connected":i?"disconnected":"not-configured",j=N.find(D=>D.suffix===""?T===R||T===`${R}/`:T.startsWith(D.id))?.id??R,O=C?[{label:"HEAD",value:`#${C.maxCommitSeq}`},{label:"COMMITS",value:`${C.commitCount}`},{label:"CHANGES",value:`${C.changeCount}`},{label:"CLIENTS",value:`${C.activeClientCount}/${C.clientCount}`}]:[];return h.jsxs("div",{className:`${vx} h-screen bg-background text-foreground flex flex-col`,children:[h.jsx($Z,{brand:h.jsx(yl,{to:R,children:h.jsx(UZ,{label:"console"})}),center:h.jsx(MZ,{items:N,activeId:j,renderItem:(D,{active:K})=>h.jsx(yl,{to:D.id,children:h.jsx(uO,{active:K,children:D.label})},D.id)}),right:h.jsxs("div",{className:"flex items-center gap-2",children:[n?h.jsx(dn,{variant:"flow",className:"hidden md:inline-flex px-2 py-1 text-[10px]",children:n}):null,h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wide",children:"Instance"}),h.jsx(Hn,{variant:"mono",value:p,onChange:D=>g(D.target.value),onBlur:D=>g(D.target.value.trim()),placeholder:"all",className:"h-7 w-[110px] px-2 py-1"}),d?h.jsx(Me,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[10px]",onClick:y,children:"All"}):null]}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("span",{className:"font-mono text-[9px] text-neutral-500 uppercase tracking-wide",children:"Partition"}),h.jsx(Hn,{variant:"mono",value:x,onChange:D=>S(D.target.value),onBlur:D=>S(D.target.value.trim()),placeholder:"all",className:"h-7 w-[110px] px-2 py-1"}),b?h.jsx(Me,{variant:"ghost",size:"sm",className:"h-7 px-2 text-[10px]",onClick:w,children:"All"}):null]}),h.jsx(D8,{state:L}),h.jsx(yl,{to:k,children:h.jsx(Me,{variant:T===k?"secondary":"ghost",size:"icon",children:h.jsx(W8,{className:"h-3 w-3"})})}),t?h.jsxs("a",{href:t,className:OZ,children:[h.jsx(X8,{className:"h-3 w-3"}),"Go to app"]}):null]})}),h.jsx("main",{className:"flex-1 overflow-auto pb-[32px]",children:h.jsx("div",{className:"min-h-full",children:a||T===k?h.jsx("div",{style:{animation:"pageIn 0.3s ease-out"},children:h.jsx(JN,{})},T):h.jsx(aX,{configPath:k,hasSavedConfig:!!i,isConnecting:c,onConnect:()=>{s()}})})}),a&&h.jsx(Vj,{isLive:a,metrics:O,uptime:"--"})]})}function aX({configPath:e,hasSavedConfig:t,isConnecting:n,onConnect:s}){return h.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[h.jsx("p",{className:"mb-4 text-foreground-muted",children:"Not connected to a @syncular server"}),h.jsxs("div",{className:"flex items-center gap-2",children:[t&&h.jsx(Me,{variant:"default",onClick:s,disabled:n,children:n?"Connecting...":"Connect"}),h.jsx(yl,{to:e,children:h.jsx(Me,{variant:"link",children:"Configure connection"})})]})]})}const io=PH({component:iX});function lX(e={}){const{maxEvents:t=100,enabled:n=!0,staleAfterMs:s=65e3,replayLimit:i=100,partitionId:a,instanceId:c}=e,{config:f,isConnected:d}=pa(),{instanceId:p}=Rp(),g=c??p,[y,b]=_.useState([]),[x,S]=_.useState(!1),[w,T]=_.useState("disconnected"),[C,A]=_.useState(null),N=_.useRef(null),R=_.useRef(null),k=_.useRef(null),L=_.useRef(0),j=_.useRef(0),O=_.useRef(null),D=_.useCallback(()=>{b([]),O.current=null},[]);return _.useEffect(()=>{if(!n||!d||!f?.serverUrl||!f?.token)return;let K=!1;const F=Number.isFinite(i)?Math.max(1,Math.min(500,Math.floor(i))):100;if(typeof WebSocket>"u")return;const z=()=>{R.current&&(clearTimeout(R.current),R.current=null)},X=()=>{k.current&&(clearInterval(k.current),k.current=null)},Y=()=>{if(K||R.current)return;L.current+=1;const V=Math.min(3e4,1e3*2**Math.max(0,L.current-1)),B=Math.floor(V*.2*Math.random()),q=V+B;R.current=setTimeout(()=>{R.current=null,K||P()},q)},te=()=>{j.current=Date.now(),S(!0),T("connected")},P=()=>{if(K)return;T("connecting"),z();const V=(()=>{const q=new URL(f.serverUrl,window.location.origin);q.protocol=q.protocol==="https:"?"wss:":"ws:";const U=q.pathname.endsWith("/")?q.pathname.slice(0,-1):q.pathname;return q.pathname=`${U}/console/events/live`,q.search="",O.current&&q.searchParams.set("since",O.current),q.searchParams.set("replayLimit",String(F)),a&&q.searchParams.set("partitionId",a),g&&q.searchParams.set("instanceId",g),q.toString()})(),B=new WebSocket(V);N.current=B,B.onopen=()=>{if(K){B.close();return}L.current=0,A(null),T("connecting"),S(!1);try{B.send(JSON.stringify({type:"auth",token:f.token}))}catch{B.close();return}X(),k.current=setInterval(()=>{const q=N.current;if(!q||q.readyState!==WebSocket.OPEN)return;const U=j.current;!U||Date.now()-U<=s||(S(!1),T("stale"),q.close())},1e3)},B.onclose=()=>{K||(S(!1),T("disconnected"),X(),Y())},B.onerror=()=>{K||A(new Error("WebSocket connection failed"))},B.onmessage=q=>{try{const U=JSON.parse(q.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";A(new Error(se));return}const G={type:I,timestamp:U.timestamp||new Date().toISOString(),data:U};if(a&&G.data.partitionId!==a||g&&G.data.instanceId!==g)return;const W=Date.parse(O.current??""),Q=Date.parse(G.timestamp);Number.isFinite(Q)&&(!Number.isFinite(W)||Q>W)&&(O.current=G.timestamp),b(se=>[G,...se].slice(0,t))}catch{}}};return P(),()=>{K=!0,z(),X(),N.current&&(N.current.close(),N.current=null),S(!1),T("disconnected")}},[n,d,f?.serverUrl,f?.token,t,a,g,i,s]),{events:y,isConnected:x,connectionState:w,error:C,clearEvents:D}}const cX=_.createContext(null);function SO(){const[e,t]=va("console:time-range","24h");return{range:e,setRange:t}}const uX=[{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 fX(e){const t=e.toLowerCase();for(const n of uX)if(t.includes(n.hint))return n.type;return"client"}function dX(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 hX(e,t){return typeof e.lagCommitCount=="number"?Math.max(0,e.lagCommitCount):t?Math.max(0,t.maxCommitSeq-e.cursor):0}function pX(e,t){return e.activityState==="stale"?"offline":t>0?"syncing":"online"}function mX(e,t){return e.length<=16?e:`${e.slice(0,12)}-${t+1}`}function gX(e,t,n={}){const s=n.maxNodes??10;return e.slice(0,s).map((i,a)=>{const c=hX(i,t),f=pX(i,c);return{id:mX(i.clientId,a),type:fX(i.clientId),status:f,cursor:Math.max(0,i.cursor),actor:i.actorId,mode:i.connectionMode,dialect:dX(i.clientId),scopes:Object.keys(i.effectiveScopes||{}),lastSeen:i.updatedAt}})}const yX={enabled:!1,thresholds:{p90Latency:500,errorRate:5,clientLag:100}};function YC(e,t="relative"){if(t==="absolute")return new Date(e).toLocaleString();const n=new Date(e),i=new Date().getTime()-n.getTime(),a=Math.floor(i/1e3);return a<60?`${a}s ago`:a<3600?`${Math.floor(a/60)}m ago`:a<86400?`${Math.floor(a/3600)}h ago`:`${Math.floor(a/86400)}d ago`}function vX(e){const t=e.length>1&&e.endsWith("/")?e.slice(0,-1):e;return t==="/console"||t.startsWith("/console/")?"/console/stream":"/stream"}function bX(){const e=up(),t=_.useMemo(()=>typeof window>"u"?"/stream":vX(window.location.pathname),[]),n=SO(),{range:s}=n,{preferences:i}=tf(),{partitionId:a}=ef(),c=i.refreshInterval*1e3,[f]=va("console:alert-config",yX),[d,p]=_.useState("1h"),{data:g}=Ju({refetchIntervalMs:c,partitionId:a}),{data:y}=AY({range:s,partitionId:a},{refetchIntervalMs:c}),{data:b}=OY({range:s,partitionId:a},{refetchIntervalMs:c}),{data:x}=MY({limit:5,partitionId:a},{refetchIntervalMs:c}),{data:S}=xO({limit:12,offset:0,partitionId:a},{refetchIntervalMs:c}),{events:w,isConnected:T}=lX({maxEvents:8,partitionId:a}),C=_.useMemo(()=>{const z=y?.buckets??[];let X=0,Y=0;for(const P of z)X+=P.pushCount+P.pullCount,Y+=P.errorCount;const te=X>0?Y/X*100:0;return{totalEvents:X,errorRate:te}},[y?.buckets]),A=_.useMemo(()=>S?.items?gX(S.items,g,{maxNodes:12}):[],[S?.items,g]),N=A.filter(z=>z.status!=="offline").length,R=A.filter(z=>z.status==="offline").length,k=_.useMemo(()=>g?[{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:g.activeClientCount,color:"syncing"},{label:"Pending",value:g.maxActiveClientCursor!==null&&g.maxCommitSeq>0?g.maxCommitSeq-(g.minActiveClientCursor??0):0,color:"relay"}]:[],[g,b,C.errorRate,C.totalEvents]),L=_.useMemo(()=>w.map(z=>({type:z.type.toUpperCase(),actor:z.data?.actorId??"",table:(z.data?.tables??[])[0]??"",time:YC(z.timestamp,i.timeFormat)})),[w,i.timeFormat]),j=_.useMemo(()=>{const z=y?.buckets;if(!z?.length)return[];const X=Math.max(...z.map(Y=>Math.max(Y.pushCount,Y.pullCount)),1);return z.map(Y=>({pushPercent:X>0?Y.pushCount/X*100:0,pullPercent:X>0?Y.pullCount/X*100:0}))},[y?.buckets]),O=_.useMemo(()=>{if(!b)return[];const z=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/z*100,pullBarPercent:b.pull.p50/z*100},{label:"P90",pushMs:b.push.p90,pullMs:b.pull.p90,pushBarPercent:b.push.p90/z*100,pullBarPercent:b.pull.p90/z*100},{label:"P99",pushMs:b.push.p99,pullMs:b.pull.p99,pushBarPercent:b.push.p99/z*100,pullBarPercent:b.pull.p99/z*100}]},[b]),D=_.useMemo(()=>x?.items?x.items.map(z=>({seq:z.commitSeq,actor:z.actorId,changes:z.changeCount,tables:(z.affectedTables??[]).join(", "),time:YC(z.createdAt,i.timeFormat)})):[],[x?.items,i.timeFormat]),K=_.useMemo(()=>Math.max(0,100-C.errorRate),[C.errorRate]),F=_.useMemo(()=>{if(!f.enabled||!g)return[];const z=[];return b?.push?.p90&&b.push.p90>f.thresholds.p90Latency&&z.push(`P90 push latency (${b.push.p90}ms) exceeds threshold (${f.thresholds.p90Latency}ms)`),g.minActiveClientCursor!==null&&g.maxCommitSeq-g.minActiveClientCursor>f.thresholds.clientLag&&z.push(`Client lag (${g.maxCommitSeq-g.minActiveClientCursor}) exceeds threshold (${f.thresholds.clientLag})`),C.errorRate>f.thresholds.errorRate&&z.push(`Error rate (${C.errorRate.toFixed(1)}%) exceeds threshold (${f.thresholds.errorRate}%)`),z},[f,g,b,C.errorRate]);return g?h.jsx(cX.Provider,{value:n,children:h.jsxs("div",{className:"flex flex-col",children:[F.length>0&&h.jsx("div",{className:"px-6 pb-4",children:h.jsxs(On,{variant:"destructive",children:[h.jsx(Wu,{children:"Threshold Exceeded"}),h.jsx(Mn,{children:F.map((z,X)=>h.jsx("span",{className:"block",children:z},X))})]})}),h.jsx(HA,{clients:A,totalNodes:A.length+2,onlineCount:N,offlineCount:R,relayClientIds:[]}),h.jsx(Jj,{items:k}),h.jsxs("div",{className:"flex",children:[h.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[h.jsx("div",{className:"border-b border-border border-r border-border",children:h.jsx(Tj,{bars:j,activeRange:d,onRangeChange:p})}),h.jsx("div",{className:"border-b border-border border-r border-border",children:h.jsx(eA,{buckets:O,successRate:K})}),h.jsx("div",{className:"border-r border-border",children:h.jsx(Kj,{commits:D,onViewAll:()=>e({href:t})})})]}),h.jsx(tA,{entries:L,isConnected:T,maxVisible:20,maxHeight:"calc(100vh - 200px)"})]})]})}):h.jsx("div",{className:"flex items-center justify-center py-24",children:h.jsx(Dt,{size:"lg"})})}function xX(){return h.jsx(bX,{})}const Xr=aO;function SX({children:e}){return h.jsxs("div",{className:"space-y-4 px-5 py-5",children:[h.jsx(_X,{}),h.jsx(RX,{}),h.jsx(NX,{}),e]})}function _X(){const{clearError:e,config:t,connect:n,disconnect:s,error:i,isConnected:a,isConnecting:c}=pa(),[f,d]=_.useState(t?.serverUrl??"/api"),[p,g]=_.useState(t?.token??""),[y,b]=_.useState(null),[x,S]=_.useState(!1),[w,T]=_.useState(null),[C,A]=va("console:disconnect-clear-saved-config",!1);_.useEffect(()=>{const j=new URLSearchParams(window.location.search),O=j.get("server");let D=!1;if(O&&(d(O),j.delete("server"),D=!0),j.has("token")&&(j.delete("token"),D=!0),D){const K=j.toString(),F=K?`${window.location.pathname}?${K}`:window.location.pathname;window.history.replaceState({},"",F)}},[]),_.useEffect(()=>{t?.serverUrl&&d(t.serverUrl),t?.token&&g(t.token)},[t?.serverUrl,t?.token]),_.useEffect(()=>{T(null)},[]);const N=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.")},R=()=>{s({clearSavedConfig:C}),C&&(d("/api"),g("")),T(C?"Disconnected and saved credentials cleared.":"Disconnected."),b(null)},k=async()=>{S(!0),b(null),T(null);const j=performance.now();try{const O=f.trim(),D=p.trim();if(!O||!D)throw new Error("Missing server URL or token");if(!(await fetch(`${O}/console/stats`,{headers:{Authorization:`Bearer ${D}`}})).ok)throw new Error("Failed to connect");b(Math.round(performance.now()-j))}catch{b(-1)}finally{S(!1)}},L=i??w??(y!==null?y<0?"Connection failed":`Connection successful (${y}ms latency)`:void 0);return h.jsx(Zj,{isConnected:a,isConnecting:c,isTestingConnection:x,serverUrl:f,onServerUrlChange:d,consoleToken:p,onConsoleTokenChange:g,onSaveAndConnect:N,onDisconnect:R,onTestConnection:k,statusMessage:L,children:h.jsx("div",{className:"px-5 pb-5 -mt-2",children:h.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border px-3 py-2",children:[h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] text-neutral-400",children:"Clear saved credentials on disconnect"}),h.jsx("p",{className:"font-mono text-[9px] text-neutral-500",children:"Removes stored server URL and token from this browser."})]}),h.jsx(bp,{checked:C,onCheckedChange:A})]})})})}const wX=1440*60*1e3;function XC(e){const t=e.trim();if(!t)return null;const n=Number.parseInt(t,10);return!Number.isInteger(n)||n<=0?null:n}function Uy(e){if(!e)return"Never";const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():"Invalid date"}function EX(e){return e.length===0?"all scopes":e.length<=2?e.join(", "):`${e.slice(0,2).join(", ")} +${e.length-2}`}function TX(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 s=Date.now();return n<=s?"expired":n<=s+t*wX?"expiring":"active"}function CX(e){return e==="revoked"?"destructive":e==="expired"?"offline":e==="expiring"?"syncing":"healthy"}function RX(){const[e,t]=_.useState("all"),[n,s]=_.useState("all"),[i,a]=_.useState("14"),[c,f]=_.useState(!1),[d,p]=_.useState(!1),[g,y]=_.useState(""),[b,x]=_.useState("relay"),[S,w]=_.useState(""),[T,C]=_.useState(""),[A,N]=_.useState(""),[R,k]=_.useState(null),[L,j]=_.useState([]),[O,D]=_.useState(null),[K,F]=_.useState(null),[z,X]=_.useState(null),[Y,te]=_.useState(null),[P,V]=_.useState(null),[B,q]=_.useState(null),[U,I]=_.useState(null),G=_.useMemo(()=>XC(i),[i]),W=G??14,Q=_.useMemo(()=>XC(A),[A]),se=A.trim().length>0,oe=!se||Q!==null,pe=_.useMemo(()=>({type:e==="all"?void 0:e,status:n==="all"?void 0:n,expiresWithinDays:n==="expiring"?W:void 0}),[e,n,W]),{data:Se,isLoading:he,error:He}=VY(pe),Ee=KY(),re=ZY(),de=GY(),ae=YY(),_e=XY();_.useEffect(()=>{const me=new Set((Se?.items??[]).map(Te=>Te.keyId));j(Te=>Te.filter(qe=>me.has(qe)))},[Se?.items]);const ve=async()=>{try{const me=T.split(",").map(qe=>qe.trim()).filter(qe=>qe.length>0),Te=await Ee.mutateAsync({name:g,keyType:b,actorId:S||void 0,scopeKeys:me.length>0?me:void 0,expiresInDays:se?Q??void 0:void 0});k(Te.secretKey),y(""),w(""),C(""),N("")}catch{}},xe=me=>{navigator.clipboard.writeText(me),F(me),setTimeout(()=>F(null),2e3)},ye=async()=>{if(z)try{await de.mutateAsync(z)}finally{X(null)}},Le=async()=>{if(L.length!==0)try{const me=await re.mutateAsync({keyIds:L});D(me),j([])}catch{}},ke=async()=>{if(Y)try{const me=await _e.mutateAsync(Y.keyId);V({oldKeyId:Y.keyId,oldKeyName:Y.name,secretKey:me.secretKey})}catch{}},we=async()=>{if(P)try{await de.mutateAsync(P.oldKeyId)}finally{V(null),te(null)}},Ve=async()=>{if(B)try{const me=await ae.mutateAsync(B);I(me.secretKey)}finally{q(null)}};if(he)return h.jsx("div",{className:"flex h-[200px] items-center justify-center",children:h.jsx(Dt,{size:"lg"})});if(He)return h.jsx("div",{className:"flex h-[200px] items-center justify-center",children:h.jsxs("p",{className:"text-danger",children:["Failed to load API keys: ",He.message]})});const Xe=(Se?.items??[]).filter(me=>me.revokedAt===null).map(me=>me.keyId),$e=Xe.length>0&&Xe.every(me=>L.includes(me)),We=L.length>0,Fe=(Se?.items??[]).filter(me=>L.includes(me.keyId)).map(me=>me.name);return h.jsxs(h.Fragment,{children:[h.jsxs(Jb,{title:"API Keys",description:"Issue, rotate, revoke, and audit key lifecycle state.",actions:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(Me,{size:"sm",variant:"destructive",onClick:()=>p(!0),disabled:L.length===0,children:["Revoke Selected (",L.length,")"]}),h.jsx(Me,{size:"sm",onClick:()=>f(!0),children:"Create Key"})]}),children:[h.jsxs("div",{className:"mb-4 grid gap-3 lg:grid-cols-3",children:[h.jsxs(ds,{children:[h.jsx(Qr,{children:"Type filter"}),h.jsxs(lh,{value:[e],multiple:!1,onValueChange:me=>{const Te=me.find(qe=>typeof qe=="string");(Te==="all"||Te==="relay"||Te==="proxy"||Te==="admin")&&t(Te)},children:[h.jsx(Xr,{value:"all",children:"all"}),h.jsx(Xr,{value:"relay",children:"relay"}),h.jsx(Xr,{value:"proxy",children:"proxy"}),h.jsx(Xr,{value:"admin",children:"admin"})]})]}),h.jsxs(ds,{children:[h.jsx(Qr,{children:"Status filter"}),h.jsxs(lh,{value:[n],multiple:!1,onValueChange:me=>{const Te=me.find(qe=>typeof qe=="string");(Te==="all"||Te==="active"||Te==="revoked"||Te==="expiring")&&s(Te)},children:[h.jsx(Xr,{value:"all",children:"all"}),h.jsx(Xr,{value:"active",children:"active"}),h.jsx(Xr,{value:"revoked",children:"revoked"}),h.jsx(Xr,{value:"expiring",children:"expiring"})]})]}),h.jsxs(ds,{children:[h.jsx(Qr,{htmlFor:"api-key-expiring-window",children:"Expiring window (days)"}),h.jsx(dl,{children:"Used when status filter is set to expiring."}),h.jsx(Hn,{id:"api-key-expiring-window",placeholder:"14",value:i,inputMode:"numeric",onChange:me=>a(me.target.value)}),G===null&&i.trim().length>0?h.jsx("p",{className:"font-mono text-[10px] text-offline",children:"Enter a positive whole number."}):null]})]}),Se?.items.length===0?h.jsx(Qb,{message:"No API keys match the current filters."}):h.jsxs(Jl,{children:[h.jsx(ec,{children:h.jsxs(ts,{children:[h.jsx(ht,{className:"w-[28px]",children:h.jsx(Uv,{checked:$e,indeterminate:!$e&&We&&Xe.length>0,onCheckedChange:me=>{j(me?Xe:[])},"aria-label":"Select all active keys"})}),h.jsx(ht,{className:"w-[100px]",children:"NAME"}),h.jsx(ht,{className:"w-[55px]",children:"TYPE"}),h.jsx(ht,{className:"w-[90px]",children:"KEY PREFIX"}),h.jsx(ht,{className:"w-[80px]",children:"ACTOR"}),h.jsx(ht,{className:"w-[100px]",children:"SCOPES"}),h.jsx(ht,{className:"w-[120px]",children:"CREATED"}),h.jsx(ht,{className:"w-[120px]",children:"LAST USED"}),h.jsx(ht,{className:"w-[120px]",children:"EXPIRES"}),h.jsx(ht,{className:"flex-1",children:"STATUS"})]})}),h.jsx(tc,{children:(Se?.items??[]).map(me=>{const Te=TX(me,W);return h.jsxs(ts,{className:"group relative",children:[h.jsx(pt,{className:"w-[28px]",children:h.jsx(Uv,{checked:L.includes(me.keyId),onCheckedChange:qe=>{j(mt=>qe?[...new Set([...mt,me.keyId])]:mt.filter(ct=>ct!==me.keyId))},"aria-label":`Select ${me.name}`,disabled:me.revokedAt!==null})}),h.jsx(pt,{className:"w-[100px] font-medium",children:me.name}),h.jsx(pt,{className:"w-[55px]",children:h.jsx(dn,{variant:me.keyType==="admin"?"flow":me.keyType==="proxy"?"ghost":"relay",children:me.keyType})}),h.jsx(pt,{className:"w-[90px]",children:h.jsxs("code",{className:"font-mono text-[11px]",children:[me.keyPrefix,"..."]})}),h.jsx(pt,{className:"w-[80px] text-neutral-500",children:me.actorId??"-"}),h.jsx(pt,{className:"w-[100px] text-neutral-500",children:h.jsx("code",{className:"font-mono text-[10px]",children:EX(me.scopeKeys)})}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:Uy(me.createdAt)}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:Uy(me.lastUsedAt)}),h.jsx(pt,{className:"w-[120px] text-neutral-500",children:Uy(me.expiresAt)}),h.jsx(pt,{className:"flex-1",children:h.jsx(dn,{variant:CX(Te),children:Te})}),me.revokedAt===null&&h.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:[h.jsx("button",{type:"button",onClick:()=>te(me),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"}),h.jsx("button",{type:"button",onClick:()=>q(me.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"}),h.jsx("button",{type:"button",onClick:()=>X(me.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"})]})]},me.keyId)})})]})]}),h.jsx(Dr,{open:c,onOpenChange:f,children:h.jsxs(lr,{children:[h.jsx(cr,{children:h.jsx(ur,{children:"Create API Key"})}),R?h.jsx(QC,{copiedKeyId:K,onClose:()=>{k(null),f(!1)},onCopy:xe,secretKey:R,warning:"Copy this key now. You will not be able to view it again."}):h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsxs(ds,{children:[h.jsx(Qr,{htmlFor:"api-key-name",children:"Name"}),h.jsx(Hn,{id:"api-key-name",placeholder:"Backend Relay Key",value:g,onChange:me=>y(me.target.value)})]}),h.jsxs(ds,{children:[h.jsx(Qr,{children:"Key type"}),h.jsxs(lh,{value:[b],multiple:!1,onValueChange:me=>{const Te=me.find(qe=>typeof qe=="string");(Te==="relay"||Te==="proxy"||Te==="admin")&&x(Te)},children:[h.jsx(Xr,{value:"relay",children:"relay"}),h.jsx(Xr,{value:"proxy",children:"proxy"}),h.jsx(Xr,{value:"admin",children:"admin"})]})]}),h.jsxs(ds,{children:[h.jsx(Qr,{htmlFor:"api-key-actor-id",children:"Actor ID (optional)"}),h.jsx(dl,{children:"Pin this key to a fixed actor ID"}),h.jsx(Hn,{id:"api-key-actor-id",placeholder:"actor-123",value:S,onChange:me=>w(me.target.value)})]}),h.jsxs(ds,{children:[h.jsx(Qr,{htmlFor:"api-key-scope-keys",children:"Scope keys (optional)"}),h.jsx(dl,{children:"Comma-separated list of allowed scope keys"}),h.jsx(Hn,{id:"api-key-scope-keys",placeholder:"scope-a, scope-b",value:T,onChange:me=>C(me.target.value)})]}),h.jsxs(ds,{children:[h.jsx(Qr,{htmlFor:"api-key-expires-days",children:"Expires in days (optional)"}),h.jsx(dl,{children:"Leave empty to keep the key non-expiring."}),h.jsx(Hn,{id:"api-key-expires-days",placeholder:"30",value:A,inputMode:"numeric",onChange:me=>N(me.target.value)}),oe?null:h.jsx("p",{className:"font-mono text-[10px] text-offline",children:"Enter a positive whole number."})]}),h.jsxs(Tn,{children:[h.jsx(Me,{variant:"default",onClick:()=>f(!1),children:"Cancel"}),h.jsx(Me,{variant:"primary",onClick:ve,disabled:Ee.isPending||!g||!oe,children:Ee.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Dt,{size:"sm"}),"Creating..."]}):"Create"})]})]})]})}),h.jsx(Dr,{open:d,onOpenChange:me=>{p(me),me||D(null)},children:h.jsxs(lr,{children:[h.jsx(cr,{children:h.jsx(ur,{children:"Bulk Revoke API Keys"})}),O?h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[h.jsx(On,{variant:"destructive",children:h.jsxs(Mn,{children:["Requested ",O.requestedCount," keys. Revoked"," ",O.revokedCount,", already revoked"," ",O.alreadyRevokedCount,", not found"," ",O.notFoundCount,"."]})}),h.jsx(Tn,{children:h.jsx(Me,{variant:"primary",onClick:()=>{p(!1),D(null)},children:"Done"})})]}):h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-3",children:[h.jsx(On,{variant:"destructive",children:h.jsx(Mn,{children:"This revokes selected keys immediately and cannot be undone."})}),h.jsxs("p",{className:"font-mono text-[10px] text-neutral-500",children:["Selected keys: ",Fe.slice(0,5).join(", "),Fe.length>5?` +${Fe.length-5} more`:""]})]}),h.jsxs(Tn,{children:[h.jsx(Me,{variant:"default",onClick:()=>p(!1),children:"Cancel"}),h.jsx(Me,{variant:"destructive",onClick:Le,disabled:re.isPending||L.length===0,children:re.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Dt,{size:"sm"}),"Revoking..."]}):"Revoke Selected"})]})]})]})}),h.jsx(Dr,{open:Y!==null||P!==null,onOpenChange:()=>{te(null),V(null)},children:h.jsxs(lr,{children:[h.jsx(cr,{children:h.jsx(ur,{children:"Stage Rotate API Key"})}),P?h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsx(On,{variant:"default",children:h.jsxs(Mn,{children:["Replacement key created for ",P.oldKeyName,". The old key is still active until you revoke it."]})}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"flex-1 rounded-md border border-border bg-surface p-3 font-mono text-[11px] text-white break-all",children:P.secretKey}),h.jsx(Me,{variant:"default",size:"sm",onClick:()=>xe(P.secretKey),children:K===P.secretKey?"Copied":"Copy"})]}),h.jsxs(Tn,{children:[h.jsx(Me,{variant:"default",onClick:()=>{V(null),te(null)},children:"Keep Old Key Active"}),h.jsx(Me,{variant:"destructive",onClick:we,disabled:de.isPending,children:de.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Dt,{size:"sm"}),"Revoking Old Key..."]}):"Finalize and Revoke Old Key"})]})]}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-5 py-4",children:h.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."})}),h.jsxs(Tn,{children:[h.jsx(Me,{variant:"default",onClick:()=>te(null),children:"Cancel"}),h.jsx(Me,{variant:"primary",onClick:ke,disabled:_e.isPending||!Y,children:_e.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Dt,{size:"sm"}),"Staging..."]}):"Create Replacement Key"})]})]})]})}),h.jsx(Dr,{open:z!==null,onOpenChange:()=>X(null),children:h.jsxs(lr,{children:[h.jsx(cr,{children:h.jsx(ur,{children:"Revoke API Key"})}),h.jsx("div",{className:"px-5 py-4",children:h.jsx(On,{variant:"destructive",children:h.jsx(Mn,{children:"Revoking a key immediately invalidates it for all requests."})})}),h.jsxs(Tn,{children:[h.jsx(Me,{variant:"default",onClick:()=>X(null),children:"Cancel"}),h.jsx(Me,{variant:"destructive",onClick:ye,disabled:de.isPending,children:de.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Dt,{size:"sm"}),"Revoking..."]}):"Revoke"})]})]})}),h.jsx(Dr,{open:B!==null||U!==null,onOpenChange:()=>{q(null),I(null)},children:h.jsxs(lr,{children:[h.jsx(cr,{children:h.jsx(ur,{children:"Rotate API Key"})}),U?h.jsx(QC,{copiedKeyId:K,onClose:()=>I(null),onCopy:xe,secretKey:U,warning:"The previous key has been invalidated. Store this replacement securely."}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"px-5 py-4",children:h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"Rotating a key invalidates the previous secret immediately."})}),h.jsxs(Tn,{children:[h.jsx(Me,{variant:"default",onClick:()=>q(null),children:"Cancel"}),h.jsx(Me,{variant:"primary",onClick:Ve,disabled:ae.isPending,children:ae.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Dt,{size:"sm"}),"Rotating..."]}):"Rotate"})]})]})]})})]})}function NX(){const{preferences:e,updatePreference:t,resetPreferences:n}=tf(),s=[{type:"filter",label:"Auto-refresh interval",options:tX.map(i=>({id:`${i.value}`,label:i.label})),activeId:`${e.refreshInterval}`,onActiveChange:i=>t("refreshInterval",Number.parseInt(i,10))},{type:"filter",label:"Items per page",options:nX.map(i=>({id:`${i.value}`,label:i.label})),activeId:`${e.pageSize}`,onActiveChange:i=>t("pageSize",Number.parseInt(i,10))},{type:"filter",label:"Time format",options:[{id:"relative",label:"Relative"},{id:"absolute",label:"Absolute"}],activeId:e.timeFormat,onActiveChange:i=>t("timeFormat",i)},{type:"toggle",label:"Show sparklines",description:"Display mini trend charts in dashboard metric cards",checked:e.showSparklines,onCheckedChange:i=>t("showSparklines",i)}];return h.jsx(nA,{rows:s,onResetDefaults:n})}function QC({copiedKeyId:e,onClose:t,onCopy:n,secretKey:s,warning:i}){return h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsx(On,{variant:"destructive",children:h.jsx(Mn,{children:i})}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("code",{className:"flex-1 rounded-md border border-border bg-surface p-3 font-mono text-[11px] text-white break-all",children:s}),h.jsx(Me,{variant:"default",size:"sm",onClick:()=>n(s),children:e===s?"Copied":"Copy"})]}),h.jsx(Tn,{children:h.jsx(Me,{variant:"primary",onClick:t,children:"Done"})})]})}function jX(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 AX(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 OX(e,t){if(t==="absolute")return new Date(e).toLocaleString();try{const n=new Date(e),i=new Date().getTime()-n.getTime(),a=Math.floor(i/1e3),c=Math.floor(a/60),f=Math.floor(c/60),d=Math.floor(f/24);return a<60?"just now":c<60?`${c}m ago`:f<24?`${f}h ago`:`${d}d ago`}catch{return e}}function MX(e,t,n){return{id:e.clientId,type:jX(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:AX(e.clientId),scopes:Object.keys(e.effectiveScopes??{}),lastSeen:OX(e.updatedAt,n)}}function kX({emptyState:e}={}){const[t,n]=_.useState(1),[s,i]=_.useState(null),{preferences:a}=tf(),{partitionId:c}=ef(),f=a.pageSize,d=a.refreshInterval*1e3,{data:p,isLoading:g}=Ju({refetchIntervalMs:d,partitionId:c}),{data:y,isLoading:b,error:x}=xO({limit:f,offset:(t-1)*f,partitionId:c},{refetchIntervalMs:d}),S=BY(),w=Math.ceil((y?.total??0)/f),T=p?.maxCommitSeq??0;_.useEffect(()=>{n(1)},[]);const C=async()=>{if(s)try{await S.mutateAsync({clientId:s,partitionId:c})}finally{i(null)}};if(b||g)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Dt,{size:"lg"})});if(x)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsxs("p",{className:"text-danger",children:["Failed to load clients: ",x.message]})});const A=(y?.items??[]).map(N=>MX(N,T,a.timeFormat));return h.jsxs("div",{className:"flex flex-col gap-5 px-5 py-5",children:[A.length>0&&h.jsx(sA,{clients:A,headSeq:T}),A.length===0?e??h.jsx(aV,{children:h.jsx(Qb,{message:"No clients yet"})}):h.jsx(Qj,{clients:A,headSeq:T,onEvict:N=>{const R=y?.items.find(k=>k.clientId===N);i(R?.clientId??N)}}),w>1&&h.jsx(mx,{page:t,totalPages:w,totalItems:y?.total??0,onPageChange:n}),h.jsx(Dr,{open:s!==null,onOpenChange:()=>i(null),children:h.jsxs(lr,{children:[h.jsx(cr,{children:h.jsx(ur,{children:"Evict Client"})}),h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsxs("p",{className:"font-mono text-[11px] text-neutral-300",children:["Are you sure you want to evict client"," ",h.jsxs("span",{className:"font-mono text-white",children:[s?.slice(0,12),"..."]}),"?"]}),h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"This will force the client to re-bootstrap on their next sync."})]}),h.jsxs(Tn,{children:[h.jsx(Me,{variant:"default",onClick:()=>i(null),children:"Cancel"}),h.jsx(Me,{variant:"destructive",onClick:C,disabled:S.isPending,children:S.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Dt,{size:"sm"}),"Evicting..."]}):"Evict"})]})]})})]})}const IX={latencyThresholdMs:1e3,errorRateThreshold:5,clientLagThreshold:50,enabled:!1};function DX(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 PX(e){const t=e.split(",").map(n=>n.trim()).filter(n=>n.length>0);return Array.from(new Set(t))}function zX(e){switch(e){case"notify_data_change":return"Notify";case"evict_client":return"Evict";case"compact":return"Compact";default:return"Prune"}}function WC(e){return!e||typeof e!="object"||Array.isArray(e)?null:e}function LX(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"):[]}function UX(e){const t=WC(e.requestPayload),n=WC(e.resultPayload);if(e.operationType==="notify_data_change"){const a=LX(t?.tables),c=n?.commitSeq;return`${a.length} table${a.length===1?"":"s"} -> commit #${typeof c=="number"?c:"?"}`}if(e.operationType==="evict_client"){const a=n?.evicted===!0?"evicted":"not found";return`client ${e.targetClientId??"?"} ${a}`}if(e.operationType==="compact")return`${typeof n?.deletedChanges=="number"?n.deletedChanges:0} changes removed`;const s=typeof n?.deletedCommits=="number"?n.deletedCommits:0,i=typeof t?.watermarkCommitSeq=="number"?` at #${t.watermarkCommitSeq}`:"";return`${s} commits removed${i}`}function $X(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function BX(){const{partitionId:e}=ef();return h.jsxs("div",{className:"flex flex-col gap-4 px-5 py-5",children:[h.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[h.jsx(FX,{}),h.jsx(GX,{})]}),h.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[h.jsx(HX,{partitionId:e}),h.jsx(qX,{partitionId:e}),h.jsx(VX,{partitionId:e})]}),h.jsx(KX,{partitionId:e})]})}function FX(){const{data:e,isLoading:t,error:n}=zY();if(t)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Dt,{size:"lg"})});if(n)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsxs("p",{className:"text-danger",children:["Failed to load handlers: ",n.message]})});const s=(e?.items??[]).map(i=>({table:i.table,dependsOn:i.dependsOn?.join(", ")??null,chunkTtl:i.snapshotChunkTtlMs?DX(i.snapshotChunkTtlMs):"default"}));return h.jsx(Wj,{handlers:s,tableCount:e?.items.length??0})}function HX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:c}=Ju({partitionId:e}),{data:f,isLoading:d,refetch:p}=LY({enabled:!1}),g=FY(),y=async()=>{n(!0),i(null),await p()},b=async()=>{const S=await g.mutateAsync();i(S.deletedCommits)};if(c)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Dt,{size:"lg"})});const x=[{label:"Total commits",value:a?.commitCount??0},{label:"Commit range",value:`${a?.minCommitSeq??0} - ${a?.maxCommitSeq??0}`},{label:"Min active cursor",value:a?.minActiveClientCursor??"N/A",tone:"syncing"}];return h.jsxs(h.Fragment,{children:[h.jsx(xp,{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:y}),h.jsx(Dr,{open:t,onOpenChange:n,children:h.jsxs(lr,{children:[h.jsx(cr,{children:h.jsx(ur,{children:"Prune Old Commits"})}),h.jsx("div",{className:"px-5 py-4 flex flex-col gap-4",children:s!==null?h.jsxs(On,{variant:"default",children:[h.jsx(Wu,{children:"Pruning Complete"}),h.jsxs(Mn,{children:["Successfully deleted ",h.jsx("strong",{children:s})," commits."]})]}):d?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(Dt,{size:"sm"})}):f?h.jsxs(h.Fragment,{children:[h.jsx(On,{variant:f.commitsToDelete>0?"destructive":"default",children:h.jsx(Mn,{children:f.commitsToDelete>0?h.jsxs(h.Fragment,{children:["This will delete"," ",h.jsx("strong",{children:f.commitsToDelete})," commits up to sequence"," ",h.jsxs("code",{className:"font-mono",children:["#",f.watermarkCommitSeq]}),"."]}):"No commits are eligible for pruning."})}),h.jsxs("div",{className:"flex flex-col gap-2",children:[h.jsxs("div",{className:"flex justify-between font-mono text-[11px]",children:[h.jsx("span",{className:"text-neutral-500",children:"Watermark commit seq:"}),h.jsxs("span",{className:"text-white",children:["#",f.watermarkCommitSeq]})]}),h.jsxs("div",{className:"flex justify-between font-mono text-[11px] items-center",children:[h.jsx("span",{className:"text-neutral-500",children:"Commits to delete:"}),h.jsx(dn,{variant:f.commitsToDelete>0?"offline":"ghost",children:f.commitsToDelete})]})]})]}):null}),h.jsxs(Tn,{children:[h.jsx(Me,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&h.jsx(Me,{variant:"destructive",onClick:b,disabled:g.isPending||d||(f?.commitsToDelete??0)===0,children:g.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Dt,{size:"sm"}),"Pruning..."]}):"Prune Now"})]})]})})]})}function qX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState(null),{data:a,isLoading:c}=Ju({partitionId:e}),f=HY(),d=()=>{n(!0),i(null)},p=async()=>{const y=await f.mutateAsync();i(y.deletedChanges)};if(c)return h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Dt,{size:"lg"})});const g=[{label:"Total changes",value:a?.changeCount??0},{label:"Total commits",value:a?.commitCount??0}];return h.jsxs(h.Fragment,{children:[h.jsx(xp,{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:g,actionLabel:"Run Compaction",actionVariant:"primary",onAction:d}),h.jsx(Dr,{open:t,onOpenChange:n,children:h.jsxs(lr,{children:[h.jsx(cr,{children:h.jsx(ur,{children:"Compact Changes"})}),h.jsx("div",{className:"px-5 py-4 flex flex-col gap-4",children:s!==null?h.jsxs(On,{variant:"default",children:[h.jsx(Wu,{children:"Compaction Complete"}),h.jsxs(Mn,{children:["Successfully removed ",h.jsx("strong",{children:s})," redundant changes."]})]}):h.jsx(On,{variant:"default",children:h.jsx(Mn,{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."})})}),h.jsxs(Tn,{children:[h.jsx(Me,{variant:"default",onClick:()=>n(!1),children:s!==null?"Close":"Cancel"}),s===null&&h.jsx(Me,{variant:"primary",onClick:p,disabled:f.isPending,children:f.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Dt,{size:"sm"}),"Compacting..."]}):"Compact Now"})]})]})})]})}function VX({partitionId:e}){const[t,n]=_.useState(!1),[s,i]=_.useState("tasks"),[a,c]=_.useState(e??""),[f,d]=_.useState(null),[p,g]=_.useState(null),y=qY(),b=PX(s),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??"—"}],S=()=>{n(!0),g(null)},w=async()=>{if(b.length===0){g("Provide at least one table name.");return}g(null);const T=await y.mutateAsync({tables:b,partitionId:a.trim()||void 0});d(T)};return h.jsxs(h.Fragment,{children:[h.jsx(xp,{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:S}),h.jsx(Dr,{open:t,onOpenChange:n,children:h.jsxs(lr,{children:[h.jsx(cr,{children:h.jsx(ur,{children:"Notify External Data Change"})}),h.jsxs("div",{className:"flex flex-col gap-4 px-5 py-4",children:[f?h.jsxs(On,{variant:"default",children:[h.jsx(Wu,{children:"Notification Sent"}),h.jsxs(Mn,{children:["Created synthetic commit"," ",h.jsxs("strong",{children:["#",f.commitSeq]})," for"," ",h.jsx("strong",{children:f.tables.length})," table",f.tables.length===1?"":"s"," and cleared"," ",h.jsx("strong",{children:f.deletedChunks})," cached chunk",f.deletedChunks===1?"":"s","."]})]}):h.jsx(On,{variant:"default",children:h.jsx(Mn,{children:"Use this when data changed outside Syncular push flow. It invalidates cached snapshot chunks and forces clients to pull fresh data."})}),p?h.jsx(On,{variant:"destructive",children:h.jsx(Mn,{children:p})}):null,h.jsxs(ds,{children:[h.jsx(Qr,{children:"Tables (comma-separated)"}),h.jsx(Hn,{value:s,onChange:T=>i(T.target.value),placeholder:"tasks, notes",disabled:y.isPending}),h.jsx(dl,{children:"Enter one or more table names affected by the external change."})]}),h.jsxs(ds,{children:[h.jsx(Qr,{children:"Partition ID (optional)"}),h.jsx(Hn,{value:a,onChange:T=>c(T.target.value),placeholder:"default",disabled:y.isPending})]})]}),h.jsxs(Tn,{children:[h.jsx(Me,{variant:"default",onClick:()=>n(!1),children:f?"Close":"Cancel"}),f?null:h.jsx(Me,{variant:"primary",onClick:w,disabled:y.isPending,children:y.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Dt,{size:"sm"}),"Notifying..."]}):"Notify Data Change"})]})]})})]})}function KX({partitionId:e}){const[t,n]=_.useState("all"),{data:s,isLoading:i,error:a}=UY({limit:20,offset:0,operationType:t==="all"?void 0:t,partitionId:e},{refetchIntervalMs:5e3});return h.jsx(Jb,{title:"Operation Audit",description:"Recent prune/compact/notify/evict actions with actor and result context.",actions:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Me,{variant:t==="all"?"default":"ghost",size:"sm",onClick:()=>n("all"),children:"All"}),h.jsx(Me,{variant:t==="prune"?"default":"ghost",size:"sm",onClick:()=>n("prune"),children:"Prune"}),h.jsx(Me,{variant:t==="compact"?"default":"ghost",size:"sm",onClick:()=>n("compact"),children:"Compact"}),h.jsx(Me,{variant:t==="notify_data_change"?"default":"ghost",size:"sm",onClick:()=>n("notify_data_change"),children:"Notify"}),h.jsx(Me,{variant:t==="evict_client"?"default":"ghost",size:"sm",onClick:()=>n("evict_client"),children:"Evict"})]}),contentClassName:"pt-2",children:i?h.jsx("div",{className:"flex items-center justify-center py-10",children:h.jsx(Dt,{size:"lg"})}):a?h.jsx(On,{variant:"destructive",children:h.jsxs(Mn,{children:["Failed to load operation audit events: ",a.message]})}):(s?.items.length??0)===0?h.jsx("div",{className:"px-2 py-8 text-sm text-neutral-500",children:"No operation events found for this filter."}):h.jsx("div",{className:"overflow-x-auto",children:h.jsxs(Jl,{children:[h.jsx(ec,{children:h.jsxs(ts,{children:[h.jsx(ht,{children:"Time"}),h.jsx(ht,{children:"Type"}),h.jsx(ht,{children:"User"}),h.jsx(ht,{children:"Target"}),h.jsx(ht,{children:"Result"})]})}),h.jsx(tc,{children:(s?.items??[]).map((c,f)=>h.jsxs(ts,{children:[h.jsx(pt,{className:"whitespace-nowrap text-xs text-neutral-400",children:$X(c.createdAt)}),h.jsx(pt,{children:h.jsx(dn,{variant:"ghost",children:zX(c.operationType)})}),h.jsx(pt,{className:"font-mono text-xs",children:c.consoleUserId??"system"}),h.jsx(pt,{className:"font-mono text-xs",children:c.targetClientId??c.partitionId??(c.operationType==="notify_data_change"?"partition default":"global")}),h.jsx(pt,{className:"font-mono text-xs text-neutral-300",children:UX(c)})]},`${c.operationId}:${c.createdAt}:${f}`))})]})})})}function GX(){const[e,t]=va("console:alert-config",IX),n={p90Latency:e.latencyThresholdMs,errorRate:e.errorRateThreshold,clientLag:e.clientLagThreshold},s=a=>{t(c=>({...c,latencyThresholdMs:a.p90Latency,errorRateThreshold:a.errorRate,clientLagThreshold:a.clientLag}))},i=a=>{t(c=>({...c,enabled:a}))};return h.jsx(qj,{enabled:e.enabled,onEnabledChange:i,thresholds:n,onThresholdsChange:s})}function ZX(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 YX(e){const t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString():e}function XX(){const[e,t]=_.useState(""),[n,s]=_.useState(void 0),[i,a]=_.useState(void 0),[c,f]=_.useState([]),[d,p]=_.useState(null),{data:g,isLoading:y,error:b}=QY({prefix:n,cursor:i,limit:100}),x=WY(),S=JY();function w(){const k=e.trim();s(k.length>0?k:void 0),a(void 0),f([])}function T(){t(""),s(void 0),a(void 0),f([])}function C(){g?.cursor&&(f(k=>[...k,i??""]),a(g.cursor))}function A(){f(k=>{const L=[...k],j=L.pop();return a(j&&j.length>0?j:void 0),L})}function N(){d&&x.mutate(d,{onSuccess:()=>p(null)})}if(y)return h.jsx("div",{className:"flex flex-col gap-4 px-5 py-5",children:h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsx(Dt,{size:"lg"})})});if(b)return h.jsx("div",{className:"flex flex-col gap-4 px-5 py-5",children:h.jsx("div",{className:"flex items-center justify-center h-[200px]",children:h.jsxs("p",{className:"text-danger font-mono text-[11px]",children:["Failed to load storage items: ",b.message]})})});const R=g?.items??[];return h.jsxs("div",{className:"flex flex-col gap-4 px-5 py-5",children:[h.jsx(Jb,{title:"Storage",actions:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Hn,{placeholder:"Prefix filter...",value:e,onChange:k=>t(k.target.value),onKeyDown:k=>{k.key==="Enter"&&w()},className:"h-7 w-48 text-xs"}),h.jsx(Me,{variant:"default",size:"sm",onClick:w,children:"Filter"}),n&&h.jsx(Me,{variant:"ghost",size:"sm",onClick:T,children:"Clear"})]}),children:R.length===0?h.jsx(Qb,{message:n?`No storage items matching prefix "${n}".`:"No storage items found."}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"overflow-x-auto",children:h.jsxs(Jl,{children:[h.jsx(ec,{children:h.jsxs(ts,{children:[h.jsx(ht,{children:"Key"}),h.jsx(ht,{children:"Size"}),h.jsx(ht,{children:"Type"}),h.jsx(ht,{children:"Uploaded"}),h.jsx(ht,{children:"Actions"})]})}),h.jsx(tc,{children:R.map(k=>h.jsxs(ts,{children:[h.jsx(pt,{className:"font-mono text-xs max-w-[320px]",title:k.key,children:k.key}),h.jsx(pt,{className:"font-mono text-xs text-neutral-400 whitespace-nowrap",children:ZX(k.size)}),h.jsx(pt,{children:k.httpMetadata?.contentType?h.jsx(dn,{variant:"ghost",children:k.httpMetadata.contentType}):h.jsx("span",{className:"text-neutral-500 text-xs",children:"--"})}),h.jsx(pt,{className:"whitespace-nowrap text-xs text-neutral-400",children:YX(k.uploaded)}),h.jsx(pt,{children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(Me,{variant:"ghost",size:"sm",onClick:()=>{S(k.key)},children:"Download"}),h.jsx(Me,{variant:"ghost",size:"sm",onClick:()=>p(k.key),children:"Delete"})]})})]},k.key))})]})}),h.jsxs("div",{className:"flex items-center justify-between px-2 py-2",children:[h.jsx(Me,{variant:"ghost",size:"sm",disabled:c.length===0,onClick:A,children:"Previous"}),h.jsx(Me,{variant:"ghost",size:"sm",disabled:!g?.truncated,onClick:C,children:"Next"})]})]})}),h.jsx(Dr,{open:d!==null,onOpenChange:()=>p(null),children:h.jsxs(lr,{children:[h.jsx(cr,{children:h.jsx(ur,{children:"Delete Storage Item"})}),h.jsxs("div",{className:"px-5 py-4 flex flex-col gap-4",children:[h.jsxs("p",{className:"font-mono text-[11px] text-neutral-300",children:["Are you sure you want to delete"," ",h.jsx("span",{className:"font-mono text-white",children:d}),"?"]}),h.jsx("p",{className:"font-mono text-[10px] text-neutral-500",children:"This action cannot be undone."})]}),h.jsxs(Tn,{children:[h.jsx(Me,{variant:"default",onClick:()=>p(null),children:"Cancel"}),h.jsx(Me,{variant:"destructive",onClick:N,disabled:x.isPending,children:x.isPending?h.jsxs(h.Fragment,{children:[h.jsx(Dt,{size:"sm"})," Deleting..."]}):"Delete"})]})]})})]})}const QX={};function su(e,t){if(t==="absolute")return new Date(e).toLocaleString();const n=new Date(e),i=new Date().getTime()-n.getTime(),a=Math.floor(i/1e3);return a<60?`${a}s`:a<3600?`${Math.floor(a/60)}m`:a<86400?`${Math.floor(a/3600)}h`:`${Math.floor(a/86400)}d`}function WX(e){const t=e.split(/\s+/).map(i=>i.trim()).filter(i=>i.length>0),n={},s=[];for(const i of t){const[a="",...c]=i.split(":"),f=c.join(":").trim(),d=a.toLowerCase();if(!f){s.push(i);continue}if(d==="actor"){n.actorId=f;continue}if(d==="client"){n.clientId=f;continue}if(d==="table"){n.table=f;continue}if(d==="request"){n.requestId=f;continue}if(d==="trace"){n.traceId=f;continue}s.push(i)}return s.length>0&&(n.search=s.join(" ")),n}function JX(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 Hd(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}function eQ(e,t){return e?`#${e.federatedCommitId??(t?`${t}:${e.commitSeq}`:String(e.commitSeq))}`:"#?"}function tQ(e,t){return e?`E${e.federatedEventId??(t?`${t}:${e.eventId}`:e.eventId)}`:"E?"}function nQ(e,t,n){return!e||!t?null:e.replaceAll("{traceId}",encodeURIComponent(t)).replaceAll("{spanId}",encodeURIComponent(n??""))}function bx({initialSelectedEntryId:e}={}){const{preferences:t}=tf(),{partitionId:n}=ef(),{range:s,setRange:i}=SO(),a=t.pageSize,c=t.refreshInterval*1e3,f=QX?.VITE_CONSOLE_TRACE_URL_TEMPLATE,[d,p]=_.useState(()=>e?.startsWith("#")?"commits":e?.startsWith("E")?"events":"all"),[g,y]=_.useState("all"),[b,x]=_.useState("all"),[S,w]=_.useState(""),[T,C]=_.useState(1),[A,N]=_.useState(!1),[R,k]=_.useState(e??null),L=_.useRef(!1),j=_.useMemo(()=>WX(S),[S]),O=_.useMemo(()=>new Date(Date.now()-JX(s)).toISOString(),[s]),{data:D,isLoading:K,refetch:F}=IY({limit:a,offset:(T-1)*a,...n?{partitionId:n}:{},view:d,...d!=="commits"&&g!=="all"?{eventType:g}:{},...d!=="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:O},{refetchIntervalMs:c}),z=$Y(),X=R?.startsWith("#")?R.slice(1):void 0,Y=R?.startsWith("E")?R.slice(1):void 0,te=X&&X!=="?"?X:void 0,P=Y&&Y!=="?"?Y:void 0,{data:V,isLoading:B,error:q}=kY(te,{enabled:te!==void 0,partitionId:n}),{data:U,isLoading:I,error:G}=DY(P,{enabled:P!==void 0,partitionId:n}),{data:W,isLoading:Q,error:se}=PY(P,{enabled:P!==void 0&&!!U?.payloadRef,partitionId:n}),oe=_.useMemo(()=>nQ(f,U?.traceId??null,U?.spanId??null),[U?.spanId,U?.traceId,f]);_.useEffect(()=>{C(1)},[]),_.useEffect(()=>{C(1)},[]),_.useEffect(()=>{e&&k(e)},[e]),_.useEffect(()=>{if(!L.current){L.current=!0;return}k(null)},[]),_.useEffect(()=>{C(1),k(null)},[]);const Se=_.useMemo(()=>(D?.items??[]).map(_e=>{const ve=_e.instanceId??_e.commit?.instanceId??_e.event?.instanceId,xe=ve?`[${ve}] `:"";if(_e.type==="commit"&&_e.commit){const Le=_e.commit;return{type:"commit",id:eQ(Le,ve),outcome:"--",duration:"--",actor:Le.actorId,client:Le.clientId,detail:`${xe}${Le.changeCount} chg | ${(Le.affectedTables??[]).join(", ")}`,time:su(_e.timestamp,t.timeFormat)}}const ye=_e.event;return ye?{type:ye.eventType,id:tQ(ye,ve),outcome:ye.outcome,duration:`${ye.durationMs}ms`,actor:ye.actorId,client:ye.clientId,detail:`${xe}${(ye.tables??[]).join(", ")||"--"}`,time:su(_e.timestamp,t.timeFormat)}:{type:"pull",id:"E?",outcome:"unknown",duration:"--",actor:"",client:"",detail:"--",time:su(_e.timestamp,t.timeFormat)}}),[t.timeFormat,D?.items]),he=D?.total??0,He=Math.max(1,Math.ceil(he/a)),Ee=K,re=[{label:"",options:[{id:"all",label:"All"},{id:"commits",label:"Commits"},{id:"events",label:"Events"}],activeId:d,onActiveChange:ae=>{p(ae),ae==="commits"&&(y("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:s,onActiveChange:ae=>{i(ae),C(1)}},{label:"Type",options:[{id:"all",label:"All"},{id:"push",label:"Push"},{id:"pull",label:"Pull"}],activeId:g,onActiveChange:ae=>{y(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 de(){z.mutate(void 0,{onSuccess:()=>{N(!1),F()}})}return h.jsxs("div",{className:"flex flex-col h-full",children:[Ee&&Se.length===0?h.jsx("div",{className:"flex items-center justify-center py-24",children:h.jsx(Dt,{size:"lg"})}):h.jsx(rA,{entries:Se,selectedEntryId:R,onEntryClick:ae=>k(ae.id),filterBar:h.jsx(Yj,{groups:re,searchValue:S,searchPlaceholder:"Use actor:, client:, table:, request:, trace: or free text...",onSearchChange:w,actions:h.jsxs(h.Fragment,{children:[h.jsx(Me,{size:"sm",variant:"ghost",onClick:()=>{F()},children:"Refresh"}),h.jsx(Me,{size:"sm",variant:"ghost",children:"Export"}),h.jsx(Me,{size:"sm",variant:"destructive",onClick:()=>N(!0),children:"Clear"})]})}),pagination:h.jsx(mx,{page:T,totalPages:He,totalItems:he,onPageChange:C})}),h.jsx(Dr,{open:R!==null,onOpenChange:ae=>{ae||k(null)},children:h.jsxs(lr,{children:[h.jsx(cr,{children:h.jsx(ur,{children:te!==void 0?`Commit #${te}`:P!==void 0?`Event E${P}`:"Entry details"})}),h.jsx("div",{className:"px-5 py-4 space-y-3 max-h-[70vh] overflow-y-auto",children:B||I?h.jsx("div",{className:"flex items-center justify-center py-8",children:h.jsx(Dt,{size:"sm"})}):q||G?h.jsx("p",{className:"font-mono text-[11px] text-offline",children:"Failed to load details."}):V?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"grid grid-cols-2 gap-3 font-mono text-[11px]",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Actor"}),h.jsx("div",{className:"text-neutral-100",children:V.actorId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Client"}),h.jsx("div",{className:"text-neutral-100",children:V.clientId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Instance"}),h.jsx("div",{className:"text-neutral-100",children:V.instanceId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Created"}),h.jsx("div",{className:"text-neutral-100",children:su(V.createdAt,t.timeFormat)})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Changes"}),h.jsx("div",{className:"text-neutral-100",children:V.changeCount})]})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Affected Tables"}),h.jsx("p",{className:"font-mono text-[11px] text-neutral-200",children:V.affectedTables.join(", ")||"--"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Changes"}),V.changes.length===0?h.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No changes recorded."}):V.changes.map(ae=>h.jsxs("div",{className:"rounded-md border border-border p-3 space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between font-mono text-[11px]",children:[h.jsxs("span",{className:"text-neutral-300",children:[ae.table," | ",ae.op]}),h.jsxs("span",{className:"text-neutral-500",children:["#",ae.changeId]})]}),h.jsxs("div",{className:"font-mono text-[11px] text-neutral-400",children:["rowId: ",ae.rowId,ae.rowVersion!==null?` | version: ${ae.rowVersion}`:""]}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Hd(ae.rowJson)})]},ae.changeId))]})]}):U?h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"grid grid-cols-2 gap-3 font-mono text-[11px]",children:[h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Type"}),h.jsx("div",{className:"text-neutral-100",children:U.eventType})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Path"}),h.jsx("div",{className:"text-neutral-100",children:U.syncPath})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Instance"}),h.jsx("div",{className:"text-neutral-100",children:U.instanceId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Outcome"}),h.jsx("div",{className:"text-neutral-100",children:U.outcome})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Response Status"}),h.jsx("div",{className:"text-neutral-100",children:U.responseStatus})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Actor"}),h.jsx("div",{className:"text-neutral-100",children:U.actorId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Client"}),h.jsx("div",{className:"text-neutral-100",children:U.clientId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Status"}),h.jsx("div",{className:"text-neutral-100",children:U.statusCode})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Transport"}),h.jsx("div",{className:"text-neutral-100",children:U.transportPath})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Duration"}),h.jsxs("div",{className:"text-neutral-100",children:[U.durationMs,"ms"]})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Request ID"}),h.jsx("div",{className:"text-neutral-100",children:U.requestId})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Trace ID"}),h.jsx("div",{className:"text-neutral-100",children:U.traceId??"--"}),oe&&h.jsx("a",{href:oe,target:"_blank",rel:"noreferrer",className:"font-mono text-[10px] text-flow underline underline-offset-4",children:"Open external trace"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Span ID"}),h.jsx("div",{className:"text-neutral-100",children:U.spanId??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Commit Seq"}),h.jsx("div",{className:"text-neutral-100",children:U.commitSeq??"--"}),U.commitSeq!==null&&h.jsx(Me,{variant:"ghost",size:"sm",onClick:()=>k(`#${U.instanceId?`${U.instanceId}:`:""}${U.commitSeq}`),children:"Open linked commit"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Subscription Count"}),h.jsx("div",{className:"text-neutral-100",children:U.subscriptionCount??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Error Code"}),h.jsx("div",{className:"text-neutral-100",children:U.errorCode??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Payload Ref"}),h.jsx("div",{className:"text-neutral-100",children:U.payloadRef??"--"})]}),h.jsxs("div",{children:[h.jsx("span",{className:"text-neutral-500",children:"Created"}),h.jsx("div",{className:"text-neutral-100",children:su(U.createdAt,t.timeFormat)})]})]}),h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Tables"}),h.jsx("p",{className:"font-mono text-[11px] text-neutral-200",children:U.tables.join(", ")||"--"})]}),U.scopesSummary&&h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Scopes Summary"}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Hd(U.scopesSummary)})]}),U.payloadRef&&h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Payload Snapshot"}),Q?h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Dt,{size:"sm"}),h.jsx("span",{className:"font-mono text-[11px] text-neutral-400",children:"Loading payload snapshot..."})]}):se?h.jsx("p",{className:"font-mono text-[11px] text-offline",children:"Failed to load payload snapshot."}):W?h.jsxs("div",{className:"space-y-2",children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Request"}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Hd(W.requestPayload)}),h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500",children:"Response"}),h.jsx("pre",{className:"font-mono text-[10px] rounded bg-surface p-2 overflow-x-auto text-neutral-200",children:Hd(W.responsePayload)})]}):h.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No payload snapshot available."})]}),U.errorMessage&&h.jsxs("div",{children:[h.jsx("p",{className:"font-mono text-[10px] uppercase tracking-wider text-neutral-500 mb-2",children:"Error"}),h.jsx("p",{className:"font-mono text-[11px] text-offline",children:U.errorMessage})]})]}):h.jsx("p",{className:"font-mono text-[11px] text-neutral-500",children:"No details available for this row."})}),h.jsx(Tn,{children:h.jsx(Me,{variant:"default",size:"sm",onClick:()=>k(null),children:"Close"})})]})}),h.jsx(Dr,{open:A,onOpenChange:ae=>{ae||N(!1)},children:h.jsxs(lr,{children:[h.jsx(cr,{children:h.jsx(ur,{children:"Clear all events"})}),h.jsx("div",{className:"p-4",children:h.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?"})}),h.jsxs(Tn,{children:[h.jsx(Me,{variant:"default",size:"sm",onClick:()=>N(!1),children:"Cancel"}),h.jsx(Me,{variant:"destructive",size:"sm",onClick:de,disabled:z.isPending,children:z.isPending?"Clearing...":"Clear all"})]})]})})]})}const rQ=so({getParentRoute:()=>io,path:"/config",component:SX}),sQ=so({getParentRoute:()=>io,path:"/fleet",component:kX}),oQ=so({getParentRoute:()=>io,path:"/",component:xX});function iQ(){const{seq:e}=_O.useParams();return h.jsx(bx,{initialSelectedEntryId:`#${e}`})}const _O=so({getParentRoute:()=>io,path:"/investigate/commit/$seq",component:iQ});function aQ(){const{id:e}=wO.useParams();return h.jsx(bx,{initialSelectedEntryId:`E${e}`})}const wO=so({getParentRoute:()=>io,path:"/investigate/event/$id",component:aQ}),lQ=so({getParentRoute:()=>io,path:"/ops",component:BX}),cQ=so({getParentRoute:()=>io,path:"/storage",component:XX}),uQ=so({getParentRoute:()=>io,path:"/stream",component:bx}),fQ=io.addChildren([oQ,uQ,_O,wO,sQ,lQ,cQ,rQ]),dQ="syncular-console-basepath",hQ="syncular-console-server-url",pQ="syncular-console-token";function mQ(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function $v(e){const t=globalThis.document;if(!t)return;const n=t.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return mQ(n)}function EO(e){return!e||e==="/"?"/":(e.startsWith("/")?e:`/${e}`).replace(/\/+$/g,"")||"/"}function gQ(){return EO($v(dQ))}function yQ(){const e=$v(hQ),t=$v(pQ);return!e||!t?null:{serverUrl:e,token:t}}function vQ(){return new z6({defaultOptions:{queries:{staleTime:5e3,retry:1}}})}function bQ(e){return EO(e??gQ())}function xQ(e){const[t]=_.useState(()=>vQ()),n=_.useMemo(()=>qH({routeTree:fQ,basepath:bQ(e.basePath)}),[e.basePath]),s=e.defaultConfig===void 0?yQ():e.defaultConfig,i=e.autoConnect??e.defaultConfig===void 0;return h.jsx(L6,{client:t,children:h.jsx(oq,{defaultConfig:s,autoConnect:i,storageMode:e.storageMode,children:h.jsx(GH,{router:n})})})}function SQ(e){return h.jsx("div",{className:vx,children:h.jsx(xQ,{...e})})}function _Q(e){const t=document.querySelector(e);if(!t)throw new Error(`Unable to mount console: ${e} not found`);return t}function wQ(e,t={}){const n=_Q(e);rX(n);const s=h6.createRoot(n),i=h.jsx(SQ,{basePath:t.basePath,defaultConfig:t.defaultConfig,autoConnect:t.autoConnect});return t.strictMode===!1?(s.render(i),s):(s.render(h.jsx(_.StrictMode,{children:i})),s)}var EQ={};const TQ="syncular-sentry-dsn",CQ="syncular-sentry-environment",RQ="syncular-sentry-release";function hu(e){if(!e)return;const t=e.trim();return t.length>0?t:void 0}function $y(e){if(typeof document>"u")return;const t=document.querySelector(`meta[name="${e}"]`)?.getAttribute("content");return hu(t)}function By(e){if(!(typeof process>"u"))return hu(EQ[e])}function Fy(e){for(const t of e)if(t)return t}function NQ(){const e=Fy([hu(globalThis.__SYNCULAR_SENTRY_DSN__),$y(TQ),By("SYNCULAR_SENTRY_DSN")]);if(!e)return null;const t=Fy([hu(globalThis.__SYNCULAR_SENTRY_ENVIRONMENT__),$y(CQ),By("SYNCULAR_SENTRY_ENVIRONMENT")]),n=Fy([hu(globalThis.__SYNCULAR_SENTRY_RELEASE__),$y(RQ),By("SYNCULAR_SENTRY_RELEASE")]);return{dsn:e,environment:t,release:n,enableLogs:!0,tracesSampleRate:.2,tracePropagationTargets:[/^https?:\/\/.*\/api\/.*/]}}const JC=NQ();JC&&s6(JC);wQ("#root");
|